harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qi...@apache.org
Subject svn commit: r807111 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
Date Mon, 24 Aug 2009 08:13:13 GMT
Author: qiuxx
Date: Mon Aug 24 08:13:13 2009
New Revision: 807111

URL: http://svn.apache.org/viewvc?rev=807111&view=rev
Log:
Apply for HARMONY-6031, There are 2 unused member in java.util.Locale

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java?rev=807111&r1=807110&r2=807111&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Locale.java Mon Aug
24 08:13:13 2009
@@ -17,15 +17,12 @@
 
 package java.util;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
 import java.io.Serializable;
 import java.security.AccessController;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
 
 import org.apache.harmony.luni.util.PriviAction;
 
@@ -44,8 +41,6 @@
 
     private static final long serialVersionUID = 9149081749638150636L;
 
-    private static volatile Locale[] availableLocales;
-
     // Initialize a default which is used during static
     // initialization of the default for the platform.
     private static Locale defaultLocale = new Locale();
@@ -290,91 +285,6 @@
         return false;
     }
 
-    static Locale[] find(String prefix) {
-        int last = prefix.lastIndexOf('/');
-        final String thePackage = prefix.substring(0, last + 1);
-        int length = prefix.length();
-        final String classPrefix = prefix.substring(last + 1, length);
-        Set<String> result = new HashSet<String>();
-        StringTokenizer paths = new StringTokenizer(System.getProperty(
-                "org.apache.harmony.boot.class.path", ""), System.getProperty( //$NON-NLS-1$
//$NON-NLS-2$
-                "path.separator", ";")); //$NON-NLS-1$//$NON-NLS-2$
-        while (paths.hasMoreTokens()) {
-            String nextToken = paths.nextToken();
-            File directory = new File(nextToken);
-            if (directory.exists()) {
-                if (directory.isDirectory()) {
-                    String path;
-                    try {
-                        path = directory.getCanonicalPath();
-                    } catch (IOException e) {
-                        continue;
-                    }
-                    File newDir;
-                    if (path.charAt(path.length() - 1) == File.separatorChar) {
-                        newDir = new File(path + thePackage);
-                    } else {
-                        newDir = new File(path + File.separatorChar
-                                + thePackage);
-                    }
-                    if (newDir.isDirectory()) {
-                        String[] list = newDir.list();
-                        for (int i = 0; i < list.length; i++) {
-                            String name = list[i];
-                            if (name.startsWith(classPrefix)
-                                    && name.endsWith(".class")) { //$NON-NLS-1$
-                                result
-                                        .add(name.substring(0,
-                                                name.length() - 6));
-                            }
-                        }
-                    }
-
-                } else {
-                    // Handle ZIP/JAR files.
-                    try {
-                        ZipFile zip = new ZipFile(directory);
-                        Enumeration<? extends ZipEntry> entries = zip.entries();
-                        while (entries.hasMoreElements()) {
-                            ZipEntry e = entries.nextElement();
-                            String name = e.getName();
-                            if (name.startsWith(prefix)
-                                    && name.endsWith(".class")) {//$NON-NLS-1$
-                                result.add(name.substring(last + 1, name
-                                        .length() - 6));
-                            }
-                        }
-                        zip.close();
-                    } catch (IOException e) {
-                        // Empty
-                    }
-                }
-            }
-        }
-        Locale[] locales = new Locale[result.size()];
-        int i = 0;
-        for (String name : result) {
-            int index = name.indexOf('_');
-            int nextIndex = name.indexOf('_', index + 1);
-            if (nextIndex == -1) {
-                locales[i++] = new Locale(name.substring(index + 1, name
-                        .length()), ""); //$NON-NLS-1$
-            } else {
-                String language = name.substring(index + 1, nextIndex);
-                String variant;
-                if ((index = name.indexOf('_', nextIndex + 1)) == -1) {
-                    variant = ""; //$NON-NLS-1$
-                    index = name.length();
-                } else {
-                    variant = name.substring(index + 1, name.length());
-                }
-                String country = name.substring(nextIndex + 1, index);
-                locales[i++] = new Locale(language, country, variant);
-            }
-        }
-        return locales;
-    }
-
 	/**
      * Gets the list of installed {@code Locale}. At least a {@code Locale} that is equal
to
      * {@code Locale.US} must be contained in this array.



Mime
View raw message