Skip to content

Commit 9a216f5

Browse files
committed
Fix or suppress warnings in pde.build, api.tools and pde.bnd.ui
1 parent 134bf6e commit 9a216f5

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

apitools/org.eclipse.pde.api.tools/src/org/eclipse/pde/api/tools/internal/builder/ApiAnalysisBuilder.java

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public class ApiAnalysisBuilder extends IncrementalProjectBuilder {
120120
*
121121
* @since 1.0.3
122122
*/
123+
@SuppressWarnings("deprecation")
123124
public static final Set<String> IMPORTANT_HEADERS = Set.of(Constants.SYSTEM_BUNDLE_SYMBOLICNAME,
124125
Constants.BUNDLE_VERSION, Constants.REQUIRE_BUNDLE, Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT,
125126
Constants.EXPORT_PACKAGE, Constants.IMPORT_PACKAGE, Constants.BUNDLE_CLASSPATH);

build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ public void openScript(String scriptLocation, String scriptName) throws CoreExce
254254

255255
protected static AntScript newAntScript(String scriptLocation, String scriptName) throws CoreException {
256256
try {
257-
@SuppressWarnings("resource") // intentional return AntScript without closed stream
258257
OutputStream scriptStream = new BufferedOutputStream(new FileOutputStream(scriptLocation + '/' + scriptName));
259258
return new AntScript(scriptStream);
260259
} catch (FileNotFoundException e) {

build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -385,17 +385,18 @@ public void addBundles(Collection<File> bundles) {
385385
}
386386
}
387387

388+
@SuppressWarnings("deprecation")
389+
private static final String FRAMEWORK_EXECUTIONENVIRONMENT = Constants.FRAMEWORK_EXECUTIONENVIRONMENT;
390+
388391
public void resolveState() {
389392
List<Config> configs = AbstractScriptGenerator.getConfigInfos();
390-
ArrayList<Dictionary<String, Object>> properties = new ArrayList<>(); //Collection of dictionaries
391-
Dictionary<String, Object> prop;
393+
List<Dictionary<String, Object>> properties = new ArrayList<>(); //Collection of dictionaries
392394

393395
// initialize profileManager and get the JRE profiles
394396
String[] javaProfiles = getJavaProfiles();
395-
String ee = null;
396397

397398
for (Config aConfig : configs) {
398-
prop = new Hashtable<>();
399+
Dictionary<String, Object> prop = new Hashtable<>();
399400
if (AbstractScriptGenerator.getPropertyAsBoolean(RESOLVER_DEV_MODE))
400401
prop.put(PROPERTY_RESOLVER_MODE, VALUE_DEVELOPMENT);
401402
String os = aConfig.getOs();
@@ -427,38 +428,37 @@ public void resolveState() {
427428
properties.add(prop);
428429
}
429430

430-
Properties profileProps = null;
431431
boolean added = false;
432432
String eeJava9 = null;
433433
//javaProfiles are sorted, go in reverse order, and if when we hit 0 we haven't added any yet,
434434
//then add that last profile so we have something.
435435
for (int j = javaProfiles.length - 1; j >= 0; j--) {
436436
// add a property set for each EE that is defined in the build.
437-
profileProps = profileManager.getProfileProperties(javaProfiles[j]);
437+
Properties profileProps = profileManager.getProfileProperties(javaProfiles[j]);
438438
if (profileProps != null) {
439439
String profileName = profileProps.getProperty(ProfileManager.PROFILE_NAME);
440440
if (AbstractScriptGenerator.getImmutableAntProperty(profileName) != null || (j == 0 && !added)) {
441441
IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(javaProfiles[j]);
442442
String systemPackages = getSystemPackages(env, profileProps);
443-
ee = profileProps.getProperty(Constants.FRAMEWORK_EXECUTIONENVIRONMENT);
443+
String ee = profileProps.getProperty(FRAMEWORK_EXECUTIONENVIRONMENT);
444444

445-
prop = new Hashtable<>();
445+
Dictionary<String, Object> prop = new Hashtable<>();
446446
prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages);
447447
if (profileName.equals("JavaSE-9")) { //$NON-NLS-1$
448448
eeJava9 = ee;
449449
}
450-
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, ee);
450+
prop.put(FRAMEWORK_EXECUTIONENVIRONMENT, ee);
451451
properties.add(prop);
452452
added = true;
453453
}
454454
}
455455
}
456456
// from java 10 and beyond
457-
ArrayList<String> eeJava10AndBeyond = new ArrayList<>();
457+
List<String> eeJava10AndBeyond = new ArrayList<>();
458458
for (int i = 10; i <= LAST_SUPPORTED_JDK; i++) {
459459
eeJava10AndBeyond.add("JavaSE-" + i);//$NON-NLS-1$
460460
}
461-
prop = new Hashtable<>();
461+
Dictionary<String, Object> prop = new Hashtable<>();
462462
String previousEE = eeJava9;
463463
for (String execEnvID : eeJava10AndBeyond) {
464464
prop = new Hashtable<>();
@@ -470,7 +470,7 @@ public void resolveState() {
470470
continue;
471471
}
472472
prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages);
473-
prop.put(Constants.FRAMEWORK_EXECUTIONENVIRONMENT, currentEE);
473+
prop.put(FRAMEWORK_EXECUTIONENVIRONMENT, currentEE);
474474
previousEE = currentEE;
475475
properties.add(prop);
476476
}

ui/org.eclipse.pde.bnd.ui/src/org/eclipse/pde/bnd/ui/templating/ReposTemplateLoader.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void addTemplateEngine(TemplateEngine engine, Map<String, Object> svcProps) {
9696
engines.put(name, engine);
9797
}
9898

99-
void removeTemplateEngine(@SuppressWarnings("unused") TemplateEngine engine, Map<String, Object> svcProps) {
99+
void removeTemplateEngine(TemplateEngine engine, Map<String, Object> svcProps) {
100100
String name = (String) svcProps.get("name");
101101
engines.remove(name);
102102
}

0 commit comments

Comments
 (0)