You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by od...@apache.org on 2009/04/15 14:51:23 UTC

svn commit: r765171 - /harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java

Author: odeakin
Date: Wed Apr 15 12:51:23 2009
New Revision: 765171

URL: http://svn.apache.org/viewvc?rev=765171&view=rev
Log:
Use an InputStreamReader to read properties files to ensure the correct charater conversions occur. No need to buffer the stream at this end as Properties.load() buffers the stream itself anyway.

Modified:
    harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java

Modified: harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java?rev=765171&r1=765170&r2=765171&view=diff
==============================================================================
--- harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java (original)
+++ harmony/enhanced/classlib/branches/java6/modules/security/src/main/java/common/java/security/Security.java Wed Apr 15 12:51:23 2009
@@ -22,7 +22,7 @@
 
 package java.security;
 
-import java.io.BufferedInputStream;
+import java.io.InputStreamReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -65,7 +65,7 @@
                 if (f.exists()) {
                     try {
                         FileInputStream fis = new FileInputStream(f);
-                        InputStream is = new BufferedInputStream(fis);
+                        InputStreamReader is = new InputStreamReader(fis);
                         secprops.load(is);
                         loaded = true;
                         is.close();
@@ -90,14 +90,14 @@
 //                                    + securityFile +": " + e);
                         }
                         f = new File(securityFile);
-                        InputStream is;
+                        InputStreamReader is;
                         try {
                             if (f.exists()) {
                                 FileInputStream fis = new FileInputStream(f);
-                                is = new BufferedInputStream(fis);
+                                is = new InputStreamReader(fis);
                             } else {
                                 URL url = new URL(securityFile);
-                                is = new BufferedInputStream(url.openStream());
+                                is = new InputStreamReader(url.openStream());
                             }
                             secprops.load(is);
                             loaded = true;