diff --git a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder.java b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder.java index 152b4cfc45..a9a87ecb52 100644 --- a/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder.java +++ b/apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder.java @@ -120,6 +120,7 @@ public class ApiAnalysisBuilder extends IncrementalProjectBuilder { * * @since 1.0.3 */ + @SuppressWarnings("deprecation") public static final Set IMPORTANT_HEADERS = Set.of(Constants.SYSTEM_BUNDLE_SYMBOLICNAME, Constants.BUNDLE_VERSION, Constants.REQUIRE_BUNDLE, Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, Constants.EXPORT_PACKAGE, Constants.IMPORT_PACKAGE, Constants.BUNDLE_CLASSPATH); diff --git a/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java b/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java index f2dfefdde8..c877c9a584 100644 --- a/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java +++ b/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java @@ -254,7 +254,6 @@ public void openScript(String scriptLocation, String scriptName) throws CoreExce protected static AntScript newAntScript(String scriptLocation, String scriptName) throws CoreException { try { - @SuppressWarnings("resource") // intentional return AntScript without closed stream OutputStream scriptStream = new BufferedOutputStream(new FileOutputStream(scriptLocation + '/' + scriptName)); return new AntScript(scriptStream); } catch (FileNotFoundException e) { diff --git a/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java b/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java index ed74b9711c..b112aca2f1 100644 --- a/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java +++ b/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java @@ -385,17 +385,18 @@ public void addBundles(Collection bundles) { } } + @SuppressWarnings("deprecation") + private static final String FRAMEWORK_EXECUTIONENVIRONMENT = Constants.FRAMEWORK_EXECUTIONENVIRONMENT; + public void resolveState() { List configs = AbstractScriptGenerator.getConfigInfos(); - ArrayList> properties = new ArrayList<>(); //Collection of dictionaries - Dictionary prop; + List> properties = new ArrayList<>(); //Collection of dictionaries // initialize profileManager and get the JRE profiles String[] javaProfiles = getJavaProfiles(); - String ee = null; for (Config aConfig : configs) { - prop = new Hashtable<>(); + Dictionary prop = new Hashtable<>(); if (AbstractScriptGenerator.getPropertyAsBoolean(RESOLVER_DEV_MODE)) prop.put(PROPERTY_RESOLVER_MODE, VALUE_DEVELOPMENT); String os = aConfig.getOs(); @@ -427,38 +428,37 @@ public void resolveState() { properties.add(prop); } - Properties profileProps = null; boolean added = false; String eeJava9 = null; //javaProfiles are sorted, go in reverse order, and if when we hit 0 we haven't added any yet, //then add that last profile so we have something. for (int j = javaProfiles.length - 1; j >= 0; j--) { // add a property set for each EE that is defined in the build. - profileProps = profileManager.getProfileProperties(javaProfiles[j]); + Properties profileProps = profileManager.getProfileProperties(javaProfiles[j]); if (profileProps != null) { String profileName = profileProps.getProperty(ProfileManager.PROFILE_NAME); if (AbstractScriptGenerator.getImmutableAntProperty(profileName) != null || (j == 0 && !added)) { IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(javaProfiles[j]); String systemPackages = getSystemPackages(env, profileProps); - ee = profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT); + String ee = profileProps.getProperty(FRAMEWORK_EXECUTIONENVIRONMENT); - prop = new Hashtable<>(); + Dictionary prop = new Hashtable<>(); prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); if (profileName.equals("JavaSE-9")) { //$NON-NLS-1$ eeJava9 = ee; } - prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee); + prop.put(FRAMEWORK_EXECUTIONENVIRONMENT, ee); properties.add(prop); added = true; } } } // from java 10 and beyond - ArrayList eeJava10AndBeyond = new ArrayList<>(); + List eeJava10AndBeyond = new ArrayList<>(); for (int i = 10; i <= LAST_SUPPORTED_JDK; i++) { eeJava10AndBeyond.add("JavaSE-" + i);//$NON-NLS-1$ } - prop = new Hashtable<>(); + Dictionary prop = new Hashtable<>(); String previousEE = eeJava9; for (String execEnvID : eeJava10AndBeyond) { prop = new Hashtable<>(); @@ -470,7 +470,7 @@ public void resolveState() { continue; } prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); - prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, currentEE); + prop.put(FRAMEWORK_EXECUTIONENVIRONMENT, currentEE); previousEE = currentEE; properties.add(prop); } diff --git a/ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/templating/ReposTemplateLoader.java b/ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/templating/ReposTemplateLoader.java index 07253f1d87..688a2ab73a 100644 --- a/ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/templating/ReposTemplateLoader.java +++ b/ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/templating/ReposTemplateLoader.java @@ -96,7 +96,7 @@ void addTemplateEngine(TemplateEngine engine, Map svcProps) { engines.put(name, engine); } - void removeTemplateEngine(@SuppressWarnings("unused") TemplateEngine engine, Map svcProps) { + void removeTemplateEngine(TemplateEngine engine, Map svcProps) { String name = (String) svcProps.get("name"); engines.remove(name); }