From ca6c2990231e04529a51bcb6d87c5a86f6a5441e Mon Sep 17 00:00:00 2001 From: sharmakh <65189541+sharmakh@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:21:51 +0530 Subject: [PATCH 1/2] Null pointer check added for system package Hashtable does not store null values , so if systempackage comes as null it will throw null pointer exception --- .../src/org/eclipse/pde/internal/build/site/PDEState.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 b112aca2f1..8c9cd8d8f8 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 @@ -441,9 +441,11 @@ public void resolveState() { IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(javaProfiles[j]); String systemPackages = getSystemPackages(env, profileProps); String ee = profileProps.getProperty(FRAMEWORK_EXECUTIONENVIRONMENT); - + Dictionary prop = new Hashtable<>(); - prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); + if (systemPackages != null) { + prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages); + } if (profileName.equals("JavaSE-9")) { //$NON-NLS-1$ eeJava9 = ee; } From 4abdf1c85dacd79c0509633435e4e4fb6287a694 Mon Sep 17 00:00:00 2001 From: sharmakh <65189541+sharmakh@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:24:04 +0530 Subject: [PATCH 2/2] removed whitespace --- .../src/org/eclipse/pde/internal/build/site/PDEState.java | 1 - 1 file changed, 1 deletion(-) 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 8c9cd8d8f8..55977855ba 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 @@ -441,7 +441,6 @@ public void resolveState() { IExecutionEnvironment env = JavaRuntime.getExecutionEnvironmentsManager().getEnvironment(javaProfiles[j]); String systemPackages = getSystemPackages(env, profileProps); String ee = profileProps.getProperty(FRAMEWORK_EXECUTIONENVIRONMENT); - Dictionary prop = new Hashtable<>(); if (systemPackages != null) { prop.put(ProfileManager.SYSTEM_PACKAGES, systemPackages);