Changeset 31095 in vbox for trunk/src/libs
- Timestamp:
- Jul 26, 2010 8:31:46 AM (14 years ago)
- Location:
- trunk/src/libs/xpcom18a4/java/src/org/mozilla/xpcom
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/INIParser.java
r29140 r31095 57 57 public class INIParser { 58 58 59 private HashMap mSections;59 private HashMap<String, Properties> mSections; 60 60 61 61 /** … … 63 63 * given path. <code>aCharset</code> specifies the character encoding of 64 64 * the file. 65 * 65 * 66 66 * @param aFilename path of INI file to parse 67 67 * @param aCharset character encoding of file … … 77 77 * Creates a new <code>INIParser</code> instance from the INI file at the 78 78 * given path, which is assumed to be in the <code>UTF-8</code> charset. 79 * 79 * 80 80 * @param aFilename path of INI file to parse 81 81 * @throws FileNotFoundException if <code>aFilename</code> does not exist. … … 89 89 * Creates a new <code>INIParser</code> instance from the given file. 90 90 * <code>aCharset</code> specifies the character encoding of the file. 91 * 91 * 92 92 * @param aFile INI file to parse 93 93 * @param aCharset character encoding of file … … 103 103 * Creates a new <code>INIParser</code> instance from the given file, 104 104 * which is assumed to be in the <code>UTF-8</code> charset. 105 * 105 * 106 106 * @param aFile INI file to parse 107 107 * @throws FileNotFoundException if <code>aFile</code> does not exist. … … 114 114 /** 115 115 * Parses given INI file. 116 * 116 * 117 117 * @param aFile INI file to parse 118 118 * @param aCharset character encoding of file … … 126 126 BufferedReader reader = new BufferedReader(inStream); 127 127 128 mSections = new HashMap ();128 mSections = new HashMap<String, Properties>(); 129 129 String currSection = null; 130 130 … … 166 166 } 167 167 168 Properties props = (Properties)mSections.get(currSection);168 Properties props = mSections.get(currSection); 169 169 if (props == null) { 170 170 props = new Properties(); … … 179 179 /** 180 180 * Returns an iterator over the section names available in the INI file. 181 * 181 * 182 182 * @return an iterator over the section names 183 183 */ … … 189 189 * Returns an iterator over the keys available within a section. 190 190 * 191 * @param aSection section name whose keys are to be returned 191 * @param aSection section name whose keys are to be returned 192 192 * @return an iterator over section keys, or <code>null</code> if no 193 193 * such section exists … … 217 217 } 218 218 219 Properties props = (Properties)mSections.get(aSection);219 Properties props = mSections.get(aSection); 220 220 if (props == null) { 221 221 return null; … … 233 233 */ 234 234 public String getString(String aSection, String aKey) { 235 Properties props = (Properties)mSections.get(aSection);235 Properties props = mSections.get(aSection); 236 236 if (props == null) { 237 237 return null; … … 242 242 243 243 } 244 -
trunk/src/libs/xpcom18a4/java/src/org/mozilla/xpcom/Mozilla.java
r29216 r31095 217 217 try { 218 218 URL[] urls = new URL[1]; 219 urls[0] = new File("/System/Library/Java/").toUR L();219 urls[0] = new File("/System/Library/Java/").toURI().toURL(); 220 220 ClassLoader loader = new URLClassLoader(urls); 221 Class bundleClass = Class.forName("com.apple.cocoa.foundation.NSBundle",222 true, loader);221 Class<?> bundleClass = Class.forName("com.apple.cocoa.foundation.NSBundle", 222 true, loader); 223 223 224 224 // Get the bundle for this app. If this is not executing from … … 638 638 URL[] urls = new URL[1]; 639 639 try { 640 urls[0] = jar.toUR L();640 urls[0] = jar.toURI().toURL(); 641 641 } catch (MalformedURLException e) { 642 642 throw new XPCOMInitializationException(e); … … 970 970 */ 971 971 public static nsISupports queryInterface(nsISupports aObject, String aIID) { 972 ArrayList classes = new ArrayList();972 ArrayList<Class> classes = new ArrayList<Class>(); 973 973 classes.add(aObject.getClass()); 974 974 975 975 while (!classes.isEmpty()) { 976 Class clazz = (Class)classes.remove(0);976 Class clazz = classes.remove(0); 977 977 978 978 // Skip over any class/interface in the "java.*" and "javax.*" domains.
Note:
See TracChangeset
for help on using the changeset viewer.