You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bu...@apache.org on 2012/03/15 19:12:10 UTC

svn commit: r1301122 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java

Author: burn
Date: Thu Mar 15 18:12:10 2012
New Revision: 1301122

URL: http://svn.apache.org/viewvc?rev=1301122&view=rev
Log:
[UIMA-2378] Avoid use of Java 1.6 Properties.load(Reader)

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java?rev=1301122&r1=1301121&r2=1301122&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/resource/metadata/impl/ExternalOverrideSettings_impl.java Thu Mar 15 18:12:10 2012
@@ -3,10 +3,10 @@
  */
 package org.apache.uima.resource.metadata.impl;
 
-import java.io.FileReader;
+import java.io.ByteArrayInputStream;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.StringReader;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Properties;
@@ -192,7 +192,7 @@ public class ExternalOverrideSettings_im
       String fname = System.getProperty("UimaExternalOverrides");
       if (fname != null) {
         mProperties = new Properties(mProperties);
-        mProperties.load(new FileReader(fname));
+        mProperties.load(new FileInputStream(fname)); // Cannot use the 1.6 load(Reader) method
         UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
                 "resolveImports", LOG_RESOURCE_BUNDLE, "UIMA_external_overrides_loaded__CONFIG",
                 new Object[] {"cmdline file", fname} );
@@ -206,10 +206,10 @@ public class ExternalOverrideSettings_im
   }
   
   private void loadInlineSettings(String settings) throws IOException {
-    StringReader sr = new StringReader(getSettings());
+    InputStream is = new ByteArrayInputStream(getSettings().getBytes("ISO-8859-1"));
     mProperties = new Properties(mProperties);
-    mProperties.load(sr);
-    sr.close();
+    mProperties.load(is);   // Cannot use the 1.6 load(Reader) method
+    is.close();
     // External overrides loaded from {0} "{1}"
     UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(), "resolveImports",
             LOG_RESOURCE_BUNDLE, "UIMA_external_overrides_loaded__CONFIG",