diff --git a/java.api.common/src/org/netbeans/modules/java/api/common/ui/PlatformUiSupport.java b/java.api.common/src/org/netbeans/modules/java/api/common/ui/PlatformUiSupport.java --- a/java.api.common/src/org/netbeans/modules/java/api/common/ui/PlatformUiSupport.java +++ b/java.api.common/src/org/netbeans/modules/java/api/common/ui/PlatformUiSupport.java @@ -124,13 +124,14 @@ Parameters.notNull("projectConfigurationNamespace", projectConfigurationNamespace); //NOI18N Parameters.notNull("sourceLevel", sourceLevel); //NOI18N - PlatformKey platformKey; + JavaPlatform platform = null; if (platformName != null) { - platformKey = new PlatformKey(PlatformUiSupport.findPlatform(platformName)); - } else { - platformKey = new PlatformKey(JavaPlatformManager.getDefault().getDefaultPlatform()); + platform = PlatformUiSupport.findPlatform(platformName); } - storePlatform(props, helper, projectConfigurationNamespace, platformKey, new SourceLevelKey(sourceLevel)); + if (platform == null) { + platform = JavaPlatformManager.getDefault().getDefaultPlatform(); + } + storePlatform(props, helper, projectConfigurationNamespace, new PlatformKey(platform), new SourceLevelKey(sourceLevel)); }