xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r224386 - in /xmlbeans/trunk: ./ src/common/org/apache/xmlbeans/impl/common/ src/saaj_api/org/apache/xmlbeans/impl/soap/ src/store/org/apache/xmlbeans/impl/store/ src/typeimpl/org/apache/xmlbeans/impl/schema/ src/xmlcomp/org/apache/xmlbeans...
Date Fri, 22 Jul 2005 19:19:37 GMT
Author: cezar
Date: Fri Jul 22 12:18:57 2005
New Revision: 224386

URL: http://svn.apache.org/viewcvs?rev=224386&view=rev
Log:
Contributed by: Mark Swanson. Patch for Jira issue 136

Added:
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SystemProperties.java
Modified:
    xmlbeans/trunk/build.xml
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ResolverUtil.java
    xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XBeanDebug.java
    xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/FactoryFinder.java
    xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/Diff.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java
    xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java

Modified: xmlbeans/trunk/build.xml
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/build.xml?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/build.xml (original)
+++ xmlbeans/trunk/build.xml Fri Jul 22 12:18:57 2005
@@ -193,7 +193,7 @@
     </target>
 
     <target name="version">
-        <!-- svn must be on the path -->
+        <!-- svn must be on the path 
         <exec executable="svn" output="build/private/svninfo.properties">
             <arg line="info ${basedir}"/>
         </exec>
@@ -203,7 +203,6 @@
             byline="true"/>
         <property file="build/private/svninfo.properties"/>
 
-        <!-- just in case svn info or regexp failed -->
         <condition property="svn.last.rev" value="unknown">
             <not><isset property="svn.last.rev"/></not>
         </condition>
@@ -212,6 +211,7 @@
         <property name="manifest.comment" value="Apache XmlBeans version ${version.full}"/>
 
         <echo message="${manifest.comment}"/>
+	-->
     </target>
 
     <target name="default" depends="deploy"/>
@@ -465,7 +465,11 @@
         <javac srcdir="src/xmlinputstream"
             source="${javac.source}" target="${javac.target}"
             destdir="build/classes/xmlinputstream"
-            debug="on"/>
+            debug="on">
+            <classpath>
+                <pathelement location="build/classes/common"/>
+            </classpath>
+               </javac>
     </target>
 
     <!-- xmlpublic target ============================================== -->
@@ -475,6 +479,7 @@
         <javac srcdir="src/xmlpublic" destdir="build/classes/xmlpublic" source="${javac.source}"
target="${javac.target}" debug="on">
             <classpath>
                 <pathelement location="build/classes/xmlinputstream"/>
+                <pathelement location="build/classes/common"/>
                 <pathelement location="build/lib/jsr173_api.jar"/>
             </classpath>
         </javac>
@@ -655,6 +660,8 @@
         <mkdir dir="build/classes/saaj_api"/>
         <javac srcdir="src/saaj_api" destdir="build/classes/saaj_api" source="${javac.source}"
target="${javac.target}" debug="on">
             <classpath id="saaj_api.compile.path">
+                <pathelement location="build/classes/common"/>
+                <pathelement location="build/classes/xmlpublic"/>
             </classpath>
         </javac>
 

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ResolverUtil.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ResolverUtil.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ResolverUtil.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/ResolverUtil.java Fri Jul 22
12:18:57 2005
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans.impl.common;
 
+import org.apache.xmlbeans.SystemProperties;
+
 import org.xml.sax.EntityResolver;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
@@ -31,7 +33,7 @@
     {
         try
         {
-            Object o = Class.forName(System.getProperty("xmlbean.entityResolver")).newInstance();
+            Object o = Class.forName(SystemProperties.getProperty("xmlbean.entityResolver")).newInstance();
             _entityResolver = (EntityResolver)o;
         }
         catch (Exception e)

Modified: xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XBeanDebug.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XBeanDebug.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XBeanDebug.java (original)
+++ xmlbeans/trunk/src/common/org/apache/xmlbeans/impl/common/XBeanDebug.java Fri Jul 22 12:18:57
2005
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans.impl.common;
 
+import org.apache.xmlbeans.SystemProperties;
+
 import java.io.File;
 import java.io.PrintStream;
 import java.io.FileOutputStream;
@@ -33,7 +35,7 @@
     private static int initializeBitsFromProperty()
     {
         int bits = 0;
-        String prop = System.getProperty(traceProp, defaultProp);
+        String prop = SystemProperties.getProperty(traceProp, defaultProp);
         if (prop.indexOf("TRACE_SCHEMA_LOADING") >= 0)
             bits |= TRACE_SCHEMA_LOADING;
         return bits;

Modified: xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/FactoryFinder.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/FactoryFinder.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/FactoryFinder.java (original)
+++ xmlbeans/trunk/src/saaj_api/org/apache/xmlbeans/impl/soap/FactoryFinder.java Fri Jul 22
12:18:57 2005
@@ -1,153 +1,154 @@
-/*   Copyright 2004 The Apache Software Foundation
- *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
- *
- *       http://www.apache.org/licenses/LICENSE-2.0
- *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.xmlbeans.impl.soap;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-
-import java.util.Properties;
-
-/**
- * This class is used to locate factory classes for javax.xml.soap.
- * It has package scope since it is not part of JAXM and should not
- * be accessed from other packages.
- */
-class FactoryFinder {
-    /**
-     * instantiates an object go the given classname.
-     *
-     * @param factoryClassName
-     * @return a factory object
-     * @throws SOAPException
-     */
-    private static Object newInstance(String factoryClassName) throws SOAPException {
-        ClassLoader classloader = null;
-        try {
-            classloader = Thread.currentThread().getContextClassLoader();
-        } catch (Exception exception) {
-            throw new SOAPException(exception.toString(), exception);
-        }
-
-        try {
-            Class factory = null;
-            if (classloader == null) {
-                factory = Class.forName(factoryClassName);
-            } else {
-                try {
-                    factory = classloader.loadClass(factoryClassName);
-                } catch (ClassNotFoundException cnfe) {}
-            }
-            if (factory == null) {
-                classloader = FactoryFinder.class.getClassLoader();
-                factory = classloader.loadClass(factoryClassName);
-            }
-            return factory.newInstance();
-        } catch (ClassNotFoundException classnotfoundexception) {
-            throw new SOAPException("Provider " + factoryClassName + " not found", classnotfoundexception);
-        } catch (Exception exception) {
-            throw new SOAPException("Provider " + factoryClassName + " could not be instantiated:
" + exception, exception);
-        }
-    }
-
-    /**
-     * Instantiates a factory object given the factory's property name and the
-     * default class name.
-     *
-     * @param factoryPropertyName
-     * @param defaultFactoryClassName
-     * @return a factory object
-     * @throws SOAPException
-     */
-    static Object find(String factoryPropertyName, String defaultFactoryClassName) throws
SOAPException {
-        try {
-            String factoryClassName = System.getProperty(factoryPropertyName);
-            if (factoryClassName != null) {
-                return newInstance(factoryClassName);
-            }
-        } catch (SecurityException securityexception) {}
-
-        try {
-            String propertiesFileName = System.getProperty("java.home")
-                                        + File.separator + "lib"
-                                        + File.separator + "jaxm.properties";
-            File file = new File(propertiesFileName);
-            if (file.exists()) {
-                FileInputStream fileInput = new FileInputStream(file);
-                Properties properties = new Properties();
-                properties.load(fileInput);
-                fileInput.close();
-                String factoryClassName = properties.getProperty(factoryPropertyName);
-                return newInstance(factoryClassName);
-            }
-        } catch (Exception exception1) {}
-
-        String factoryResource = "META-INF/services/" + factoryPropertyName;
-
-        try {
-            InputStream inputstream = getResource(factoryResource);
-            if (inputstream != null) {
-                BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream,
"UTF-8"));
-                String factoryClassName = bufferedreader.readLine();
-                bufferedreader.close();
-                if ((factoryClassName != null) && !"".equals(factoryClassName)) {
-                    return newInstance(factoryClassName);
-                }
-            }
-        } catch (Exception exception2) {}
-
-        if (defaultFactoryClassName == null) {
-            throw new SOAPException("Provider for " + factoryPropertyName + " cannot be found",
null);
-        } else {
-            return newInstance(defaultFactoryClassName);
-        }
-    }
-
-    /**
-     * Returns an input stream for the specified resource.
-     *
-     * <p>This method will firstly try
-     * <code>ClassLoader.getSystemResourceAsStream()</code> then
-     * the class loader of the current thread with
-     * <code>getResourceAsStream()</code> and finally attempt
-     * <code>getResourceAsStream()</code> on
-     * <code>FactoryFinder.class.getClassLoader()</code>.
-     *
-     * @param factoryResource  the resource name
-     * @return  an InputStream that can be used to read that resource, or
-     *              <code>null</code> if the resource could not be resolved
-     */
-    private static InputStream getResource(String factoryResource) {
-        ClassLoader classloader = null;
-        try {
-            classloader = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException securityexception) {}
-
-        InputStream inputstream;
-        if (classloader == null) {
-            inputstream = ClassLoader.getSystemResourceAsStream(factoryResource);
-        } else {
-            inputstream = classloader.getResourceAsStream(factoryResource);
-        }
-
-        if (inputstream == null) {
-            inputstream = FactoryFinder.class.getClassLoader().getResourceAsStream(factoryResource);
-        }
-        return inputstream;
-    }
-}
+/*   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.xmlbeans.impl.soap;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+
+import java.util.Properties;
+import org.apache.xmlbeans.SystemProperties;
+
+/**
+ * This class is used to locate factory classes for javax.xml.soap.
+ * It has package scope since it is not part of JAXM and should not
+ * be accessed from other packages.
+ */
+class FactoryFinder {
+    /**
+     * instantiates an object go the given classname.
+     *
+     * @param factoryClassName
+     * @return a factory object
+     * @throws SOAPException
+     */
+    private static Object newInstance(String factoryClassName) throws SOAPException {
+        ClassLoader classloader = null;
+        try {
+            classloader = Thread.currentThread().getContextClassLoader();
+        } catch (Exception exception) {
+            throw new SOAPException(exception.toString(), exception);
+        }
+
+        try {
+            Class factory = null;
+            if (classloader == null) {
+                factory = Class.forName(factoryClassName);
+            } else {
+                try {
+                    factory = classloader.loadClass(factoryClassName);
+                } catch (ClassNotFoundException cnfe) {}
+            }
+            if (factory == null) {
+                classloader = FactoryFinder.class.getClassLoader();
+                factory = classloader.loadClass(factoryClassName);
+            }
+            return factory.newInstance();
+        } catch (ClassNotFoundException classnotfoundexception) {
+            throw new SOAPException("Provider " + factoryClassName + " not found", classnotfoundexception);
+        } catch (Exception exception) {
+            throw new SOAPException("Provider " + factoryClassName + " could not be instantiated:
" + exception, exception);
+        }
+    }
+
+    /**
+     * Instantiates a factory object given the factory's property name and the
+     * default class name.
+     *
+     * @param factoryPropertyName
+     * @param defaultFactoryClassName
+     * @return a factory object
+     * @throws SOAPException
+     */
+    static Object find(String factoryPropertyName, String defaultFactoryClassName) throws
SOAPException {
+        try {
+            String factoryClassName = SystemProperties.getProperty(factoryPropertyName);
+            if (factoryClassName != null) {
+                return newInstance(factoryClassName);
+            }
+        } catch (SecurityException securityexception) {}
+
+        try {
+            String propertiesFileName = SystemProperties.getProperty("java.home")
+                                        + File.separator + "lib"
+                                        + File.separator + "jaxm.properties";
+            File file = new File(propertiesFileName);
+            if (file.exists()) {
+                FileInputStream fileInput = new FileInputStream(file);
+                Properties properties = new Properties();
+                properties.load(fileInput);
+                fileInput.close();
+                String factoryClassName = properties.getProperty(factoryPropertyName);
+                return newInstance(factoryClassName);
+            }
+        } catch (Exception exception1) {}
+
+        String factoryResource = "META-INF/services/" + factoryPropertyName;
+
+        try {
+            InputStream inputstream = getResource(factoryResource);
+            if (inputstream != null) {
+                BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(inputstream,
"UTF-8"));
+                String factoryClassName = bufferedreader.readLine();
+                bufferedreader.close();
+                if ((factoryClassName != null) && !"".equals(factoryClassName)) {
+                    return newInstance(factoryClassName);
+                }
+            }
+        } catch (Exception exception2) {}
+
+        if (defaultFactoryClassName == null) {
+            throw new SOAPException("Provider for " + factoryPropertyName + " cannot be found",
null);
+        } else {
+            return newInstance(defaultFactoryClassName);
+        }
+    }
+
+    /**
+     * Returns an input stream for the specified resource.
+     *
+     * <p>This method will firstly try
+     * <code>ClassLoader.getSystemResourceAsStream()</code> then
+     * the class loader of the current thread with
+     * <code>getResourceAsStream()</code> and finally attempt
+     * <code>getResourceAsStream()</code> on
+     * <code>FactoryFinder.class.getClassLoader()</code>.
+     *
+     * @param factoryResource  the resource name
+     * @return  an InputStream that can be used to read that resource, or
+     *              <code>null</code> if the resource could not be resolved
+     */
+    private static InputStream getResource(String factoryResource) {
+        ClassLoader classloader = null;
+        try {
+            classloader = Thread.currentThread().getContextClassLoader();
+        } catch (SecurityException securityexception) {}
+
+        InputStream inputstream;
+        if (classloader == null) {
+            inputstream = ClassLoader.getSystemResourceAsStream(factoryResource);
+        } else {
+            inputstream = classloader.getResourceAsStream(factoryResource);
+        }
+
+        if (inputstream == null) {
+            inputstream = FactoryFinder.class.getClassLoader().getResourceAsStream(factoryResource);
+        }
+        return inputstream;
+    }
+}

Modified: xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java (original)
+++ xmlbeans/trunk/src/store/org/apache/xmlbeans/impl/store/Saver.java Fri Jul 22 12:18:57
2005
@@ -17,6 +17,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.XmlDocumentProperties;
 import org.apache.xmlbeans.XmlOptions;
 
@@ -2955,7 +2956,7 @@
     private String    _initialDefaultUri;
 
     static final String _newLine =
-        System.getProperty( "line.separator" ) == null
+        SystemProperties.getProperty( "line.separator" ) == null
             ? "\n"
-            : System.getProperty( "line.separator" );
-}
\ No newline at end of file
+            : SystemProperties.getProperty( "line.separator" );
+}

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
Fri Jul 22 12:18:57 2005
@@ -37,6 +37,7 @@
 import org.apache.xmlbeans.SchemaTypeSystem;
 import org.apache.xmlbeans.SchemaProperty;
 import org.apache.xmlbeans.SchemaStringEnumEntry;
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 import org.apache.xmlbeans.SchemaCodePrinter;
@@ -52,9 +53,9 @@
 
 
     static final String LINE_SEPARATOR =
-        System.getProperty("line.separator") == null
+        SystemProperties.getProperty("line.separator") == null
             ? "\n"
-            : System.getProperty("line.separator");
+            : SystemProperties.getProperty("line.separator");
 
     static final String MAX_SPACES = "                                        ";
     static final int INDENT_INCREMENT = 4;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
Fri Jul 22 12:18:57 2005
@@ -36,6 +36,7 @@
 import org.apache.xmlbeans.SchemaTypeLoaderException;
 import org.apache.xmlbeans.SchemaTypeSystem;
 import org.apache.xmlbeans.SimpleValue;
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.XmlAnySimpleType;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
@@ -852,7 +853,7 @@
                 String[] props = new String[] { "user.name", "user.dir", "user.timezone",
"user.country", "java.class.path", "java.home", "java.vendor", "java.version", "os.version"
};
                 for (int i = 0; i < props.length; i++)
                 {
-                    String prop = System.getProperty(props[i]);
+                    String prop = SystemProperties.getProperty(props[i]);
                     if (prop != null)
                     {
                         daos.writeUTF(prop);

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscState.java Fri Jul 22
12:18:57 2005
@@ -27,6 +27,7 @@
 import org.apache.xmlbeans.SchemaAttributeGroup;
 import org.apache.xmlbeans.SchemaModelGroup;
 import org.apache.xmlbeans.SchemaTypeLoader;
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.XmlError;
 import org.apache.xmlbeans.XmlBeans;
 import org.apache.xmlbeans.XmlOptions;
@@ -512,13 +513,13 @@
         
         _compatMap = (Map)options.get(XmlOptions.COMPILE_SUBSTITUTE_NAMES);
         _noUpa = options.hasOption(XmlOptions.COMPILE_NO_UPA_RULE) ? true :
-                !"true".equals(System.getProperty("xmlbean.uniqueparticleattribution", "true"));
+                !"true".equals(SystemProperties.getProperty("xmlbean.uniqueparticleattribution",
"true"));
         _noPvr = options.hasOption(XmlOptions.COMPILE_NO_PVR_RULE) ? true :
-                !"true".equals(System.getProperty("xmlbean.particlerestriction", "true"));
+                !"true".equals(SystemProperties.getProperty("xmlbean.particlerestriction",
"true"));
         _noAnn = options.hasOption(XmlOptions.COMPILE_NO_ANNOTATIONS) ? true :
-            !"true".equals(System.getProperty("xmlbean.schemaannotations", "true"));
+            !"true".equals(SystemProperties.getProperty("xmlbean.schemaannotations", "true"));
         _doingDownloads = options.hasOption(XmlOptions.COMPILE_DOWNLOAD_URLS) ? true :
-                "true".equals(System.getProperty("xmlbean.downloadurls", "false"));
+                "true".equals(SystemProperties.getProperty("xmlbean.downloadurls", "false"));
         _entityResolver = (EntityResolver)options.get(XmlOptions.ENTITY_RESOLVER);
 
         if (_entityResolver == null)

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java Fri Jul 22 12:18:57
2005
@@ -15,6 +15,8 @@
 
 package org.apache.xmlbeans.impl.tool;
 
+import org.apache.xmlbeans.SystemProperties;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Iterator;
@@ -268,7 +270,7 @@
     public static File[] systemClasspath()
     {
         List cp = new ArrayList();
-        String[] systemcp = System.getProperty("java.class.path").split(File.pathSeparator);
+        String[] systemcp = SystemProperties.getProperty("java.class.path").split(File.pathSeparator);
         for (int i = 0; i < systemcp.length; i++)
         {
             cp.add(new File(systemcp[i]));
@@ -364,7 +366,7 @@
             return result;
         }
         
-        String home = System.getProperty("java.home");
+        String home = SystemProperties.getProperty("java.home");
 
         String sep  = File.separator;
         result = new File(home + sep + ".." + sep + "bin", tool);

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/Diff.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/Diff.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/Diff.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/Diff.java Fri Jul 22 12:18:57
2005
@@ -15,6 +15,7 @@
 
 package org.apache.xmlbeans.impl.tool;
 
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl;
 
 import java.io.*;
@@ -275,7 +276,7 @@
 
     private static boolean isDiffIndex()
     {
-        String prop = System.getProperty("xmlbeans.diff.diffIndex");
+        String prop = SystemProperties.getProperty("xmlbeans.diff.diffIndex");
         if (prop == null)
             return true;
         if ("0".equals(prop) || "false".equalsIgnoreCase(prop))

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java Fri
Jul 22 12:18:57 2005
@@ -17,6 +17,7 @@
 
 import org.apache.xmlbeans.SchemaType;
 import org.apache.xmlbeans.SchemaTypeSystem;
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.impl.common.IOUtil;
 import org.apache.xmlbeans.impl.common.XmlErrorWatcher;
 import org.apache.xmlbeans.impl.schema.SchemaTypeCodePrinter;
@@ -117,7 +118,7 @@
 // Some beta builds of JDK1.5 are having troubles creating temp directories
 // if the java.io.tmpdir doesn't exist.  This seems to help.
 try {
-  File tmpDirFile = new File(System.getProperty("java.io.tmpdir"));
+  File tmpDirFile = new File(SystemProperties.getProperty("java.io.tmpdir"));
   tmpDirFile.mkdirs();
 } catch(Exception e) { e.printStackTrace(); }
 

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java Fri Jul 22
12:18:57 2005
@@ -18,6 +18,7 @@
 import org.apache.xmlbeans.SchemaCodePrinter;
 import org.apache.xmlbeans.SchemaTypeLoader;
 import org.apache.xmlbeans.SchemaTypeSystem;
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.SimpleValue;
 import org.apache.xmlbeans.XmlBeans;
 import org.apache.xmlbeans.XmlErrorCodes;
@@ -1049,7 +1050,7 @@
 
         // Calculate the usenames based on the relativized filenames on the filesystem
         if (baseDir == null)
-            baseDir = new File(System.getProperty("user.dir"));
+            baseDir = new File(SystemProperties.getProperty("user.dir"));
 
         ResourceLoader cpResourceLoader = null;
 

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/XSTCTester.java Fri Jul 22 12:18:57
2005
@@ -15,6 +15,7 @@
 
 package org.apache.xmlbeans.impl.tool;
 
+import org.apache.xmlbeans.SystemProperties;
 import org.apache.xmlbeans.impl.xb.ltgfmt.TestsDocument;
 import org.apache.xmlbeans.impl.xb.ltgfmt.FileDesc;
 import org.apache.xmlbeans.XmlOptions;
@@ -178,7 +179,7 @@
         
         // Launch results
         System.out.println("Results output to " + resultsFile);
-        if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0)
+        if (SystemProperties.getProperty("os.name").toLowerCase().indexOf("windows") >=
0)
             Runtime.getRuntime().exec("cmd /c start iexplore \"" + resultsFile.getAbsolutePath()
+ "\"");
         else
             Runtime.getRuntime().exec("mozilla file://" + resultsFile.getAbsolutePath());

Added: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SystemProperties.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SystemProperties.java?rev=224386&view=auto
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SystemProperties.java (added)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/SystemProperties.java Fri Jul 22 12:18:57
2005
@@ -0,0 +1,50 @@
+/*   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.xmlbeans;
+
+import java.util.Hashtable;
+
+
+public class SystemProperties
+{
+
+	protected static Hashtable propertyH;
+
+	public static String getProperty(String key) {
+		if (propertyH == null) {
+			try {
+				propertyH = System.getProperties();
+			} catch(SecurityException ex) {
+				propertyH = new Hashtable();
+				return null;
+			}
+		}
+		return (String)propertyH.get(key);
+	}
+
+	public static String getProperty(String key, String defaultValue) {
+		String result = getProperty(key);
+		if (result == null)
+			return defaultValue;
+		return result;
+	}
+
+	public static void setPropertyH(Hashtable aPropertyH) {
+		propertyH = aPropertyH;
+	}
+
+}
+

Modified: xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java?rev=224386&r1=224385&r2=224386&view=diff
==============================================================================
--- xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java (original)
+++ xmlbeans/trunk/src/xmlpublic/org/apache/xmlbeans/XmlCalendar.java Fri Jul 22 12:18:57
2005
@@ -261,7 +261,7 @@
         {
             try
             {
-                String yearstring = System.getProperty("user.defaultyear");
+                String yearstring = SystemProperties.getProperty("user.defaultyear");
                 if (yearstring != null)
                     defaultYear = Integer.parseInt(yearstring);
                 else



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: commits-help@xmlbeans.apache.org


Mime
View raw message