From bcded16cf116c702cd3b50fab69083805dfc9d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Thu, 10 Oct 2024 15:47:59 +0300 Subject: [PATCH] Simplify TestPDETemplates Use api rather than quering system property java.specification.version. --- .../pde/ui/templates/tests/TestPDETemplates.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/ui/org.eclipse.pde.ui.templates.tests/src/org/eclipse/pde/ui/templates/tests/TestPDETemplates.java b/ui/org.eclipse.pde.ui.templates.tests/src/org/eclipse/pde/ui/templates/tests/TestPDETemplates.java index 9898d2105c..bf6db03733 100644 --- a/ui/org.eclipse.pde.ui.templates.tests/src/org/eclipse/pde/ui/templates/tests/TestPDETemplates.java +++ b/ui/org.eclipse.pde.ui.templates.tests/src/org/eclipse/pde/ui/templates/tests/TestPDETemplates.java @@ -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 @@ -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");