Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Daniel2013-12-09 15:34:39 +0000
committerKrzysztof Daniel2013-12-09 21:44:18 +0000
commitd3decf5665a66dbd38a632457fbf77b8f0753cf6 (patch)
tree3177b6b0d7a1d8b7d06782441e54cd9349df8725
parentc54c5e3497b7f2837cec975e83c57298bb23890d (diff)
downloadrt.equinox.p2-d3decf5665a66dbd38a632457fbf77b8f0753cf6.tar.gz
rt.equinox.p2-d3decf5665a66dbd38a632457fbf77b8f0753cf6.tar.xz
rt.equinox.p2-d3decf5665a66dbd38a632457fbf77b8f0753cf6.zip
bug 418662 - Get rid of compile warnings in official build
framework admin Change-Id: I770e1b05b78d2917c989ec1f2cc62b2612c21cd4 Signed-off-by: Krzysztof Daniel <kdaniel@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java2
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java62
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java102
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java6
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java4
-rw-r--r--bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java10
6 files changed, 94 insertions, 92 deletions
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
index 733bdcb5d..ac9b6d3c5 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Activator.java
@@ -40,7 +40,7 @@ public class Activator implements BundleActivator {
public static PluginConverter acquirePluginConverter() {
if (bundleContext == null)
return null;
- ServiceReference reference = bundleContext.getServiceReference(PluginConverter.class.getName());
+ ServiceReference<?> reference = bundleContext.getServiceReference(PluginConverter.class.getName());
if (reference == null)
return null;
PluginConverter result = (PluginConverter) bundleContext.getService(reference);
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
index ee77bd86d..7855ca3de 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/SimpleBundlesState.java
@@ -38,7 +38,7 @@ public class SimpleBundlesState implements BundlesState {
*/
public static void checkAvailability(FrameworkAdmin fwAdmin) throws FrameworkAdminRuntimeException {
if (!fwAdmin.isActive())
- throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE);
+ throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE); //$NON-NLS-1$
}
/**
@@ -58,7 +58,7 @@ public class SimpleBundlesState implements BundlesState {
private final String systemBundleName;
private final String systemBundleVendor;
- List bundleInfosList = new LinkedList();
+ List<BundleInfo> bundleInfosList = new LinkedList<BundleInfo>();
FrameworkAdmin fwAdmin = null;
@@ -110,7 +110,7 @@ public class SimpleBundlesState implements BundlesState {
public BundleInfo[] getExpectedState() throws FrameworkAdminRuntimeException {
if (!fwAdmin.isActive())
- throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE);
+ throw new FrameworkAdminRuntimeException("FrameworkAdmin creates this object is no more available.", FrameworkAdminRuntimeException.FRAMEWORKADMIN_UNAVAILABLE); //$NON-NLS-1$
return Utils.getBundleInfosFromList(this.bundleInfosList);
}
@@ -126,21 +126,21 @@ public class SimpleBundlesState implements BundlesState {
return new BundleInfo[] {this.getSystemBundle()};
String[] clauses = Utils.getClauses(requiredBundles);
- List list = new LinkedList();
+ List<String> list = new LinkedList<String>();
for (int i = 0; i < clauses.length; i++)
list.add(Utils.getPathFromClause(clauses[i]));
- List ret = new LinkedList();
+ List<BundleInfo> ret = new LinkedList<BundleInfo>();
ret.add(this.getSystemBundle());
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo currentBInfo = (BundleInfo) ite.next();
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ BundleInfo currentBInfo = ite.next();
URI currentLocation = currentBInfo.getLocation();
String currentSymbolicName = Utils.getManifestMainAttributes(currentLocation, Constants.BUNDLE_SYMBOLICNAME);
if (currentSymbolicName == null)
continue;
currentSymbolicName = Utils.getPathFromClause(currentSymbolicName);
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- String symbolicName = (String) ite2.next();
+ for (Iterator<String> ite2 = list.iterator(); ite2.hasNext();) {
+ String symbolicName = ite2.next();
if (symbolicName.equals(currentSymbolicName)) {
ret.add(currentBInfo);
break;
@@ -152,8 +152,8 @@ public class SimpleBundlesState implements BundlesState {
public BundleInfo getSystemBundle() {
if (this.systemBundleSymbolicName == null) {
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ BundleInfo bInfo = ite.next();
// if (bInfo.getStartLevel() != 1)
// return null;;
URI location = bInfo.getLocation();
@@ -166,8 +166,8 @@ public class SimpleBundlesState implements BundlesState {
}
return null;
}
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ BundleInfo bInfo = ite.next();
URI location = bInfo.getLocation();
String symbolicName = Utils.getManifestMainAttributes(location, Constants.BUNDLE_SYMBOLICNAME);
symbolicName = Utils.getPathFromClause(symbolicName);
@@ -177,14 +177,16 @@ public class SimpleBundlesState implements BundlesState {
return null;
}
+ @SuppressWarnings("unchecked")
public BundleInfo[] getSystemFragmentedBundles() {
BundleInfo systemBInfo = this.getSystemBundle();
if (systemBInfo == null)
return NULL_BUNDLEINFOS;
+ @SuppressWarnings("rawtypes")
List list = new LinkedList();
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite.next();
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ BundleInfo bInfo = ite.next();
URI location = bInfo.getLocation();
String manifestVersion = Utils.getManifestMainAttributes(location, Constants.BUNDLE_MANIFESTVERSION);
if (manifestVersion == null)
@@ -211,7 +213,7 @@ public class SimpleBundlesState implements BundlesState {
}
public String[] getUnsatisfiedConstraints(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("getUnsatisfiedConstraints(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
+ throw new FrameworkAdminRuntimeException("getUnsatisfiedConstraints(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION); //$NON-NLS-1$
}
private void initialize() {
@@ -221,7 +223,7 @@ public class SimpleBundlesState implements BundlesState {
File fwJar = getFwJar(launcherData);
if (fwJar == null)
- throw new IllegalStateException("launcherData.getLauncherConfigFile() == null && fwJar is not set.");
+ throw new IllegalStateException("launcherData.getLauncherConfigFile() == null && fwJar is not set."); //$NON-NLS-1$
// No fw persistent data location is taken into consideration.
BundleInfo[] bInfos = configData.getBundles();
@@ -238,25 +240,25 @@ public class SimpleBundlesState implements BundlesState {
public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
URI newLocation = bInfo.getLocation();
- Dictionary newManifest = Utils.getOSGiManifest(newLocation);
+ Dictionary<String, String> newManifest = Utils.getOSGiManifest(newLocation);
if (newManifest == null) {
// TODO log something here
return;
}
- String newSymbolicName = (String) newManifest.get(Constants.BUNDLE_SYMBOLICNAME);
- String newVersion = (String) newManifest.get(Constants.BUNDLE_VERSION);
+ String newSymbolicName = newManifest.get(Constants.BUNDLE_SYMBOLICNAME);
+ String newVersion = newManifest.get(Constants.BUNDLE_VERSION);
//System.out.println("> currentInstalledBundles.length=" + currentInstalledBundles.length);
boolean found = false;
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
- BundleInfo currentBInfo = (BundleInfo) ite.next();
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ BundleInfo currentBInfo = ite.next();
URI location = currentBInfo.getLocation();
if (newLocation.equals(location)) {
found = true;
break;
}
- Dictionary manifest = Utils.getOSGiManifest(location);
- String symbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
- String version = (String) manifest.get(Constants.BUNDLE_VERSION);
+ Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
+ String symbolicName = manifest.get(Constants.BUNDLE_SYMBOLICNAME);
+ String version = manifest.get(Constants.BUNDLE_VERSION);
if (newSymbolicName != null && newVersion != null)
if (newSymbolicName.equals(symbolicName) && newVersion.equals(version)) {
found = true;
@@ -300,23 +302,23 @@ public class SimpleBundlesState implements BundlesState {
}
public boolean isResolved() throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("isResolved() is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
+ throw new FrameworkAdminRuntimeException("isResolved() is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION); //$NON-NLS-1$
}
public boolean isResolved(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("isResolved(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
+ throw new FrameworkAdminRuntimeException("isResolved(BundleInfo bInfo) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION); //$NON-NLS-1$
}
public void resolve(boolean increment) throws FrameworkAdminRuntimeException {
- throw new FrameworkAdminRuntimeException("resolve(boolean increment) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION);
+ throw new FrameworkAdminRuntimeException("resolve(boolean increment) is not supported in this implementation", FrameworkAdminRuntimeException.UNSUPPORTED_OPERATION); //$NON-NLS-1$
}
public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
URI targetLocation = bInfo.getLocation();
int index = -1;
- for (Iterator ite = this.bundleInfosList.iterator(); ite.hasNext();) {
+ for (Iterator<BundleInfo> ite = this.bundleInfosList.iterator(); ite.hasNext();) {
index++;
- BundleInfo currentBInfo = (BundleInfo) ite.next();
+ BundleInfo currentBInfo = ite.next();
URI location = currentBInfo.getLocation();
if (targetLocation.equals(location)) {
break;
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
index 6aaf2afb1..6cdf21b77 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/frameworkadmin/utils/Utils.java
@@ -46,7 +46,7 @@ public class Utils {
// printoutProperties(System.out, "to", to);
// printoutProperties(System.out, "from", from);
- for (Enumeration enumeration = from.keys(); enumeration.hasMoreElements();) {
+ for (Enumeration<Object> enumeration = from.keys(); enumeration.hasMoreElements();) {
String key = (String) enumeration.nextElement();
to.setProperty(key, from.getProperty(key));
}
@@ -56,7 +56,7 @@ public class Utils {
}
//Return a dictionary representing a manifest. The data may result from plugin.xml conversion
- private static Dictionary basicLoadManifest(File bundleLocation) {
+ private static Dictionary<String, String> basicLoadManifest(File bundleLocation) {
InputStream manifestStream = null;
ZipFile jarFile = null;
try {
@@ -82,7 +82,7 @@ public class Utils {
return convertPluginManifest(bundleLocation, true);
try {
- Map manifest = ManifestElement.parseBundleManifest(manifestStream, null);
+ Map<String, String> manifest = ManifestElement.parseBundleManifest(manifestStream, null);
// add this check to handle the case were we read a non-OSGi manifest
if (manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null)
return convertPluginManifest(bundleLocation, true);
@@ -110,43 +110,43 @@ public class Utils {
public static void checkAbsoluteDir(File file, String dirName) throws IllegalArgumentException {
if (file == null)
- throw new IllegalArgumentException(dirName + " is null");
+ throw new IllegalArgumentException(dirName + " is null"); //$NON-NLS-1$
if (!file.isAbsolute())
- throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath());
+ throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath()); //$NON-NLS-1$
if (!file.isDirectory())
- throw new IllegalArgumentException(dirName + " is not directory. file=" + file.getAbsolutePath());
+ throw new IllegalArgumentException(dirName + " is not directory. file=" + file.getAbsolutePath()); //$NON-NLS-1$
}
public static void checkAbsoluteFile(File file, String dirName) {//throws ManipulatorException {
if (file == null)
- throw new IllegalArgumentException(dirName + " is null");
+ throw new IllegalArgumentException(dirName + " is null"); //$NON-NLS-1$
if (!file.isAbsolute())
- throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath());
+ throw new IllegalArgumentException(dirName + " is not absolute path. file=" + file.getAbsolutePath()); //$NON-NLS-1$
if (file.isDirectory())
- throw new IllegalArgumentException(dirName + " is not file but directory");
+ throw new IllegalArgumentException(dirName + " is not file but directory"); //$NON-NLS-1$
}
public static URL checkFullUrl(URL url, String urlName) throws IllegalArgumentException {//throws ManipulatorException {
if (url == null)
- throw new IllegalArgumentException(urlName + " is null");
+ throw new IllegalArgumentException(urlName + " is null"); //$NON-NLS-1$
if (!url.getProtocol().endsWith("file")) //$NON-NLS-1$
return url;
File file = new File(url.getFile());
if (!file.isAbsolute())
- throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path");
+ throw new IllegalArgumentException(urlName + "(" + url + ") does not have absolute path"); //$NON-NLS-1$ //$NON-NLS-2$
if (file.getAbsolutePath().startsWith(PATH_SEP))
return url;
try {
return getUrl("file", null, PATH_SEP + file.getAbsolutePath()); //$NON-NLS-1$
} catch (MalformedURLException e) {
- throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified");
+ throw new IllegalArgumentException(urlName + "(" + "file:" + PATH_SEP + file.getAbsolutePath() + ") is not fully quallified"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
/*
* Copied from BundleDescriptionFactory in the metadata generator.
*/
- private static Dictionary convertPluginManifest(File bundleLocation, boolean logConversionException) {
+ private static Dictionary<String, String> convertPluginManifest(File bundleLocation, boolean logConversionException) {
PluginConverter converter;
try {
converter = org.eclipse.equinox.internal.frameworkadmin.utils.Activator.acquirePluginConverter();
@@ -162,7 +162,7 @@ public class Utils {
if (!new File(bundleLocation, PLUGIN_MANIFEST).exists() && !new File(bundleLocation, FRAGMENT_MANIFEST).exists())
return null;
if (logConversionException) {
- IStatus status = new Status(IStatus.WARNING, "org.eclipse.equinox.frameworkadmin", 0, "Error converting bundle manifest.", convertException);
+ IStatus status = new Status(IStatus.WARNING, "org.eclipse.equinox.frameworkadmin", 0, "Error converting bundle manifest.", convertException); //$NON-NLS-1$ //$NON-NLS-2$
System.out.println(status);
//TODO Need to find a way to get a logging service to log
}
@@ -179,7 +179,7 @@ public class Utils {
return parent.mkdirs();
}
- public static BundleInfo[] getBundleInfosFromList(List list) {
+ public static BundleInfo[] getBundleInfosFromList(List<BundleInfo> list) {
if (list == null)
return new BundleInfo[0];
BundleInfo[] ret = new BundleInfo[list.size()];
@@ -189,7 +189,7 @@ public class Utils {
public static String[] getClauses(String header) {
StringTokenizer token = new StringTokenizer(header, ","); //$NON-NLS-1$
- List list = new LinkedList();
+ List<String> list = new LinkedList<String>();
while (token.hasMoreTokens()) {
list.add(token.nextToken());
}
@@ -203,13 +203,13 @@ public class Utils {
}
public static String getManifestMainAttributes(URI location, String name) {
- Dictionary manifest = Utils.getOSGiManifest(location);
+ Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
if (manifest == null)
- throw new RuntimeException("Unable to locate bundle manifest: " + location);
- return (String) manifest.get(name);
+ throw new RuntimeException("Unable to locate bundle manifest: " + location); //$NON-NLS-1$
+ return manifest.get(name);
}
- public static Dictionary getOSGiManifest(URI location) {
+ public static Dictionary<String, String> getOSGiManifest(URI location) {
if (location == null)
return null;
// if we have a file-based URL that doesn't end in ".jar" then...
@@ -226,7 +226,7 @@ public class Utils {
if (entry == null)
return null;
- Map manifest = ManifestElement.parseBundleManifest(jar.getInputStream(entry), null);
+ Map<String, String> manifest = ManifestElement.parseBundleManifest(jar.getInputStream(entry), null);
// if we have a JAR'd bundle that has a non-OSGi manifest file (like
// the ones produced by Ant, then try and convert the plugin.xml
if (manifest.get(Constants.BUNDLE_SYMBOLICNAME) == null) {
@@ -244,8 +244,8 @@ public class Utils {
jar.close();
}
} catch (IOException e) {
- if (System.getProperty("osgi.debug") != null) {
- System.err.println("location=" + location);
+ if (System.getProperty("osgi.debug") != null) { //$NON-NLS-1$
+ System.err.println("location=" + location); //$NON-NLS-1$
e.printStackTrace();
}
}
@@ -255,8 +255,8 @@ public class Utils {
public static String getPathFromClause(String clause) {
if (clause == null)
return null;
- if (clause.indexOf(";") != -1)
- clause = clause.substring(0, clause.indexOf(";"));
+ if (clause.indexOf(";") != -1) //$NON-NLS-1$
+ clause = clause.substring(0, clause.indexOf(";")); //$NON-NLS-1$
return clause.trim();
}
@@ -276,7 +276,7 @@ public class Utils {
StringBuffer sb = new StringBuffer();
for (int i = index + 1; i < fromTokens.length; i++)
- sb.append(".." + PATH_SEP);
+ sb.append(".." + PATH_SEP); //$NON-NLS-1$
for (int i = index + 1; i < targetTokens.length; i++)
if (i != targetTokens.length - 1)
@@ -313,7 +313,7 @@ public class Utils {
public static String[] getTokens(String msg, String delim, boolean returnDelims) {
StringTokenizer targetST = new StringTokenizer(msg, delim, returnDelims);
String[] tokens = new String[targetST.countTokens()];
- ArrayList list = new ArrayList(targetST.countTokens());
+ ArrayList<String> list = new ArrayList<String>(targetST.countTokens());
while (targetST.hasMoreTokens()) {
list.add(targetST.nextToken());
}
@@ -322,12 +322,12 @@ public class Utils {
}
public static URL getUrl(String protocol, String host, String file) throws MalformedURLException {// throws ManipulatorException {
- file = Utils.replaceAll(file, File.separator, "/");
+ file = Utils.replaceAll(file, File.separator, "/"); //$NON-NLS-1$
return new URL(protocol, host, file);
}
public static URL getUrlInFull(String path, URL from) throws MalformedURLException {//throws ManipulatorException {
- Utils.checkFullUrl(from, "from");
+ Utils.checkFullUrl(from, "from"); //$NON-NLS-1$
path = Utils.replaceAll(path, File.separator, "/"); //$NON-NLS-1$
//System.out.println("from.toExternalForm()=" + from.toExternalForm());
String fromSt = Utils.removeLastCh(from.toExternalForm(), '/');
@@ -339,11 +339,11 @@ public class Utils {
return new URL(fromSt + "/" + path); //$NON-NLS-1$
}
- private static Properties manifestToProperties(Map d) {
- Iterator iter = d.keySet().iterator();
- Properties result = new Properties();
+ private static Dictionary<String, String> manifestToProperties(Map<String, String> d) {
+ Iterator<String> iter = d.keySet().iterator();
+ Dictionary<String, String> result = new Hashtable<String, String>();
while (iter.hasNext()) {
- String key = (String) iter.next();
+ String key = iter.next();
result.put(key, d.get(key));
}
return result;
@@ -358,14 +358,14 @@ public class Utils {
*/
public static void printoutProperties(PrintStream ps, String name, Properties props) {
if (props == null || props.size() == 0) {
- ps.println("Props(" + name + ") is empty");
+ ps.println("Props(" + name + ") is empty"); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
- ps.println("Props(" + name + ")=");
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
+ ps.println("Props(" + name + ")="); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Enumeration<Object> enumeration = props.keys(); enumeration.hasMoreElements();) {
String key = (String) enumeration.nextElement();
- ps.print("\tkey=" + key);
- ps.println("\tvalue=" + props.getProperty(key));
+ ps.print("\tkey=" + key); //$NON-NLS-1$
+ ps.println("\tvalue=" + props.getProperty(key)); //$NON-NLS-1$
}
}
@@ -394,26 +394,26 @@ public class Utils {
* @return sorted array of BundleInfos
*/
public static BundleInfo[] sortBundleInfos(BundleInfo[] bInfos, int initialBSL) {
- SortedMap bslToList = new TreeMap();
+ SortedMap<Integer, List<BundleInfo>> bslToList = new TreeMap<Integer, List<BundleInfo>>();
for (int i = 0; i < bInfos.length; i++) {
Integer sL = new Integer(bInfos[i].getStartLevel());
if (sL.intValue() == BundleInfo.NO_LEVEL)
sL = new Integer(initialBSL);
- List list = (List) bslToList.get(sL);
+ List<BundleInfo> list = bslToList.get(sL);
if (list == null) {
- list = new LinkedList();
+ list = new LinkedList<BundleInfo>();
bslToList.put(sL, list);
}
list.add(bInfos[i]);
}
// bslToList is sorted by the key (StartLevel).
- List bundleInfoList = new LinkedList();
- for (Iterator ite = bslToList.keySet().iterator(); ite.hasNext();) {
- Integer sL = (Integer) ite.next();
- List list = (List) bslToList.get(sL);
- for (Iterator ite2 = list.iterator(); ite2.hasNext();) {
- BundleInfo bInfo = (BundleInfo) ite2.next();
+ List<BundleInfo> bundleInfoList = new LinkedList<BundleInfo>();
+ for (Iterator<Integer> ite = bslToList.keySet().iterator(); ite.hasNext();) {
+ Integer sL = ite.next();
+ List<BundleInfo> list = bslToList.get(sL);
+ for (Iterator<BundleInfo> ite2 = list.iterator(); ite2.hasNext();) {
+ BundleInfo bInfo = ite2.next();
bundleInfoList.add(bInfo);
}
}
@@ -428,13 +428,13 @@ public class Utils {
*/
public static String toStringProperties(String name, Properties props) {
if (props == null || props.size() == 0) {
- return "Props(" + name + ") is empty\n";
+ return "Props(" + name + ") is empty\n"; //$NON-NLS-1$ //$NON-NLS-2$
}
StringBuffer sb = new StringBuffer();
- sb.append("Props(" + name + ") is \n");
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
+ sb.append("Props(" + name + ") is \n"); //$NON-NLS-1$ //$NON-NLS-2$
+ for (Enumeration<Object> enumeration = props.keys(); enumeration.hasMoreElements();) {
String key = (String) enumeration.nextElement();
- sb.append("\tkey=" + key + "\tvalue=" + props.getProperty(key) + "\n");
+ sb.append("\tkey=" + key + "\tvalue=" + props.getProperty(key) + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
return sb.toString();
}
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
index 55fe4a357..fd153655b 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/ConfigData.java
@@ -30,7 +30,7 @@ public class ConfigData {
private int beginningFwStartLevel = BundleInfo.NO_LEVEL;
private int initialBundleStartLevel = BundleInfo.NO_LEVEL;
// List of BundleInfo
- private LinkedHashSet bundlesList = new LinkedHashSet();
+ private LinkedHashSet<BundleInfo> bundlesList = new LinkedHashSet<BundleInfo>();
private Properties properties = new Properties();
@@ -149,7 +149,7 @@ public class ConfigData {
else {
sb.append("bundlesList=\n"); //$NON-NLS-1$
int i = 0;
- for (Iterator iter = bundlesList.iterator(); iter.hasNext();) {
+ for (Iterator<BundleInfo> iter = bundlesList.iterator(); iter.hasNext();) {
sb.append("\tbundlesList[" + i + "]=" + iter.next().toString() + "\n"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
i++;
}
@@ -164,7 +164,7 @@ public class ConfigData {
private static void setPropsStrings(StringBuffer sb, Properties props) {
if (props.size() > 0) {
sb.append("\n"); //$NON-NLS-1$
- for (Enumeration enumeration = props.keys(); enumeration.hasMoreElements();) {
+ for (Enumeration<Object> enumeration = props.keys(); enumeration.hasMoreElements();) {
String key = (String) enumeration.nextElement();
String value = props.getProperty(key);
if (value == null || value.equals("")) //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
index dbe151506..dca066ead 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/FrameworkAdminRuntimeException.java
@@ -14,8 +14,8 @@ package org.eclipse.equinox.internal.provisional.frameworkadmin;
public class FrameworkAdminRuntimeException extends RuntimeException {
private static final long serialVersionUID = -2292498677000772317L;
- public static final String FRAMEWORKADMIN_UNAVAILABLE = "FrameworkAdmin service created this object is not available any more";
- public static final String UNSUPPORTED_OPERATION = "This implementation doesn't support this method.";
+ public static final String FRAMEWORKADMIN_UNAVAILABLE = "FrameworkAdmin service created this object is not available any more"; //$NON-NLS-1$
+ public static final String UNSUPPORTED_OPERATION = "This implementation doesn't support this method."; //$NON-NLS-1$
private final String reason;
private Throwable cause;
diff --git a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
index 7f81a4863..fee1d379e 100644
--- a/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
+++ b/bundles/org.eclipse.equinox.frameworkadmin/src/org/eclipse/equinox/internal/provisional/frameworkadmin/LauncherData.java
@@ -25,8 +25,8 @@ import java.util.*;
public class LauncherData {
private File fwPersistentDataLocation = null;
private File jvm = null;
- private List jvmArgs = new LinkedList();
- private List programArgs = new LinkedList();
+ private List<String> jvmArgs = new LinkedList<String>();
+ private List<String> programArgs = new LinkedList<String>();
private boolean clean;
private File fwConfigLocation;
@@ -152,7 +152,7 @@ public class LauncherData {
programArgs.remove(index);
while (index < programArgs.size()) {
- String next = (String) programArgs.get(index);
+ String next = programArgs.get(index);
if (next.charAt(0) == '-')
return;
programArgs.remove(index);
@@ -231,7 +231,7 @@ public class LauncherData {
else {
sb.append("jvmArgs=\n"); //$NON-NLS-1$
int i = 0;
- for (Iterator iterator = jvmArgs.iterator(); iterator.hasNext(); iterator.next())
+ for (Iterator<String> iterator = jvmArgs.iterator(); iterator.hasNext(); iterator.next())
sb.append("\tjvmArgs[" + i++ + "]=" + iterator + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
@@ -240,7 +240,7 @@ public class LauncherData {
else {
sb.append("programArgs=\n"); //$NON-NLS-1$
int i = 0;
- for (Iterator iterator = programArgs.iterator(); iterator.hasNext(); iterator.next())
+ for (Iterator<String> iterator = programArgs.iterator(); iterator.hasNext(); iterator.next())
sb.append("\tprogramArgs[" + i++ + "]=" + iterator + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
sb.append("fwConfigLocation=" + this.fwConfigLocation + "\n"); //$NON-NLS-1$ //$NON-NLS-2$

Back to the top