Skip to content

Commit

Permalink
Simplify TestPDETemplates
Browse files Browse the repository at this point in the history
Use api rather than quering system property java.specification.version.
  • Loading branch information
akurtakov committed Oct 10, 2024
1 parent 0ccbc9b commit 499c5ee
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017, 2022 Red Hat Inc. and others.
* Copyright (c) 2017, 2024 Red Hat Inc. and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -117,17 +117,7 @@ private static void createProjectWithTemplate()
data.setHasBundleStructure(true);
data.setSourceFolderName("src");
data.setOutputFolderName("bin");
data.setExecutionEnvironment("JavaSE-1.8");
String version = System.getProperty("java.specification.version"); //$NON-NLS-1$
int ver = -1;
try {
ver = Integer.parseInt(version);
} catch (NumberFormatException e) {
// preJava9
}
if (ver >= 9) {
data.setExecutionEnvironment("JavaSE-" + version);
}
data.setExecutionEnvironment("JavaSE-" + Runtime.version().feature());
data.setTargetVersion(ICoreConstants.TARGET_VERSION_LATEST);
data.setDoGenerateClass(true);
String pureOSGi = template.getConfigurationElement().getAttribute("pureOSGi");
Expand Down

0 comments on commit 499c5ee

Please sign in to comment.