private static ImportOrderEntry[] unpackOrderList(String str) { ArrayList res = new ArrayList(); int start = 0; do { int end = str.indexOf(';', start); if (end == -1) { end = str.length(); } res.add(ImportOrderEntry.fromSerialized(str.substring(start, end))); start = end + 1; } while (start < str.length()); return (ImportOrderEntry[]) res.toArray(new ImportOrderEntry[res.size()]); }
/* * The import order file is a property file. The keys are * "0", "1" ... last entry. The values must be valid package names. */ private List loadFromProperties(Properties properties) { ArrayList res = new ArrayList(); int nEntries = properties.size(); for (int i = 0; i < nEntries; i++) { String curr = properties.getProperty(String.valueOf(i)); if (curr != null) { ImportOrderEntry entry = ImportOrderEntry.fromSerialized(curr); if (!JavaScriptConventions.validatePackageName( entry.name, JavaScriptCore.VERSION_1_3, JavaScriptCore.VERSION_1_5) .matches(IStatus.ERROR)) { res.add(entry); } else { return null; } } else { return res; } } return res; }