Skip to content

Commit 5d26486

Browse files
sratzHannesWell
authored andcommitted
AbstractJavaProjectConfigurator: Fix NPE if EE has no compliance options
Fixes #1735
1 parent de83323 commit 5d26486

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

org.eclipse.m2e.jdt/META-INF/MANIFEST.MF

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
22
Bundle-ManifestVersion: 2
33
Bundle-Name: %Bundle-Name
44
Bundle-SymbolicName: org.eclipse.m2e.jdt;singleton:=true
5-
Bundle-Version: 2.3.401.qualifier
5+
Bundle-Version: 2.3.500.qualifier
66
Bundle-Localization: plugin
77
Export-Package: org.eclipse.m2e.jdt,
88
org.eclipse.m2e.jdt.internal;x-friends:="org.eclipse.m2e.jdt.ui",

org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/AbstractJavaProjectConfigurator.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,17 @@ public abstract class AbstractJavaProjectConfigurator extends AbstractProjectCon
125125
if(supportedExecutionEnvironmentTypes.stream().filter(type -> eeId.startsWith(type)).findAny().isEmpty()) {
126126
continue;
127127
}
128-
var compliance = ee.getComplianceOptions().get(JavaCore.COMPILER_COMPLIANCE);
129-
if(compliance != null) {
130-
sources.add(compliance);
131-
targets.add(compliance);
132-
if(JavaCore.ENABLED.equals(ee.getComplianceOptions().get(JavaCore.COMPILER_RELEASE))) {
133-
releases.add(compliance);
128+
Map<String, String> complianceOptions = ee.getComplianceOptions();
129+
if(complianceOptions != null) {
130+
String compliance = complianceOptions.get(JavaCore.COMPILER_COMPLIANCE);
131+
if(compliance != null) {
132+
sources.add(compliance);
133+
targets.add(compliance);
134+
if(JavaCore.ENABLED.equals(complianceOptions.get(JavaCore.COMPILER_RELEASE))) {
135+
releases.add(compliance);
136+
}
137+
ENVIRONMENTS.put(compliance, eeId);
134138
}
135-
ENVIRONMENTS.put(compliance, eeId);
136139
}
137140
}
138141

0 commit comments

Comments
 (0)