harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r823959 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java
Date Sat, 10 Oct 2009 21:53:59 GMT
Author: ndbeyer
Date: Sat Oct 10 21:53:59 2009
New Revision: 823959

URL: http://svn.apache.org/viewvc?rev=823959&view=rev
Log:
clean up code to eliminate warnings

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java?rev=823959&r1=823958&r2=823959&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java
Sat Oct 10 21:53:59 2009
@@ -547,8 +547,6 @@
      * @return
      */
     private static FileInputStream tryPath(String path, String fileName) {
-        FileInputStream fiStream = null;
-
         if (path == null) {
             return null;
         }
@@ -558,14 +556,10 @@
         while (st.hasMoreTokens()) {
             String pathEntry = st.nextToken();
             try {
-                fiStream = new FileInputStream(pathEntry + File.separatorChar + fileName);
-                if (fiStream != null) {
-                    return fiStream;
-                }
+                return new FileInputStream(pathEntry + File.separatorChar + fileName);
             } catch (FileNotFoundException e) {}
         }
-
-        return fiStream;
+        return null;
     }
 
     public static ICC_Profile getInstance(String fileName) throws IOException {
@@ -574,18 +568,13 @@
         FileInputStream fiStream = AccessController.doPrivileged(
                 new PrivilegedAction<FileInputStream>() {
                     public FileInputStream run() {
-                        FileInputStream fiStream = null;
-
                         // Open absolute path
                         try {
-                            fiStream = new FileInputStream(fName);
-                            if (fiStream != null) {
-                                return fiStream;
-                            }
+                            return new FileInputStream(fName);
                         } catch (FileNotFoundException e) {}
 
                         // Check java.iccprofile.path entries
-                        fiStream = tryPath(org.apache.harmony.awt.Utils.getSystemProperty("java.iccprofile.path"),
fName); //$NON-NLS-1$
+                        FileInputStream fiStream = tryPath(org.apache.harmony.awt.Utils.getSystemProperty("java.iccprofile.path"),
fName); //$NON-NLS-1$
                         if (fiStream != null) {
                             return fiStream;
                         }
@@ -896,6 +885,7 @@
         return 0;
     }
 
+    @SuppressWarnings("null")
     float getGamma(int tagSignature) {
         short[] dataTRC = null;
         float gamma = getGammaOrTRC(tagSignature, dataTRC);
@@ -907,6 +897,7 @@
         throw new ProfileDataException(Messages.getString("awt.166")); //$NON-NLS-1$
     }
 
+    @SuppressWarnings("null")
     short[] getTRC(int tagSignature) {
         short[] dataTRC = null;
         getGammaOrTRC(tagSignature, dataTRC);



Mime
View raw message