diff --git a/bom/compile-model/pom.xml b/bom/compile-model/pom.xml index 1930b4c99db..84796ad3857 100644 --- a/bom/compile-model/pom.xml +++ b/bom/compile-model/pom.xml @@ -140,7 +140,7 @@ org.eclipse.orbit.bundles io.github.classgraph - 4.8.138.v20211212-1642 + 4.8.149.v20220915-0556 compile diff --git a/bom/compile/pom.xml b/bom/compile/pom.xml index 963818b833d..26479ce8a49 100644 --- a/bom/compile/pom.xml +++ b/bom/compile/pom.xml @@ -99,7 +99,7 @@ com.google.code.gson gson - 2.8.9 + 2.9.1 compile diff --git a/bom/runtime/pom.xml b/bom/runtime/pom.xml index b88fb86072c..6ecde06f161 100644 --- a/bom/runtime/pom.xml +++ b/bom/runtime/pom.xml @@ -440,7 +440,7 @@ com.google.code.gson gson - 2.8.9 + 2.9.1 compile @@ -771,7 +771,7 @@ org.eclipse.orbit.bundles io.github.classgraph - 4.8.138.v20211212-1642 + 4.8.149.v20220915-0556 compile @@ -878,11 +878,6 @@ ${xtext.version} compile - - log4j - log4j - compile - org.ow2.asm asm diff --git a/bundles/org.opensmarthouse.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/NashornScriptEngineFactory.java b/bundles/org.opensmarthouse.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/NashornScriptEngineFactory.java deleted file mode 100644 index 9e1b97bba8c..00000000000 --- a/bundles/org.opensmarthouse.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/NashornScriptEngineFactory.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2010-2022 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.core.automation.module.script.internal; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import javax.script.ScriptEngine; -import javax.script.ScriptException; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.eclipse.jdt.annotation.Nullable; -import org.openhab.core.automation.module.script.AbstractScriptEngineFactory; -import org.openhab.core.automation.module.script.ScriptEngineFactory; -import org.osgi.service.component.annotations.Component; - -/** - * An implementation of {@link ScriptEngineFactory} with customizations for Nashorn ScriptEngines. - * - * @author Simon Merschjohann - Initial contribution - * @author Scott Rushworth - removed default methods provided by ScriptEngineFactory - * @author Yannick Schaus - create script engines with the bundle's class loader as "app" class loader - */ -@NonNullByDefault -@Component(service = ScriptEngineFactory.class) -public class NashornScriptEngineFactory extends AbstractScriptEngineFactory { - - private static final String SCRIPT_TYPE = "js"; - - @Override - public List getScriptTypes() { - List scriptTypes = new ArrayList<>(); - - for (javax.script.ScriptEngineFactory f : ENGINE_MANAGER.getEngineFactories()) { - List extensions = f.getExtensions(); - - if (extensions.contains(SCRIPT_TYPE)) { - scriptTypes.addAll(extensions); - scriptTypes.addAll(f.getMimeTypes()); - } - } - return Collections.unmodifiableList(scriptTypes); - } - - @Override - public void scopeValues(ScriptEngine scriptEngine, Map scopeValues) { - Set expressions = new HashSet<>(); - - for (Entry entry : scopeValues.entrySet()) { - scriptEngine.put(entry.getKey(), entry.getValue()); - if (entry.getValue() instanceof Class) { - expressions.add(String.format("%s = % org.apache.maven.plugins maven-dependency-plugin - 3.1.1 + 3.3.0 unpack-eea diff --git a/features/karaf/openhab-core/src/main/feature/feature.xml b/features/karaf/openhab-core/src/main/feature/feature.xml index d613ac90ad9..e3e87cf3c5f 100644 --- a/features/karaf/openhab-core/src/main/feature/feature.xml +++ b/features/karaf/openhab-core/src/main/feature/feature.xml @@ -28,7 +28,7 @@ openhab.tp-gson - openhab.tp;filter:="(&(feature=xtext)(version>=2.26.0)(!(version>=2.27.0)))" + openhab.tp;filter:="(&(feature=xtext)(version>=2.29.0)(!(version>=2.30.0)))" openhab.tp-xtext openhab.tp;filter:="(feature=jax-rs-whiteboard)" @@ -349,10 +349,10 @@ - openhab.tp;filter:="(&(feature=xtext-ide)(version>=2.26.0)(!(version>=2.27.0)))" + openhab.tp;filter:="(&(feature=xtext-ide)(version>=2.29.0)(!(version>=2.30.0)))" openhab.tp-xtext-ide - openhab.tp;filter:="(&(feature=lsp4j)(version>=0.12.0)(!(version>=0.13.0)))" + openhab.tp;filter:="(&(feature=lsp4j)(version>=0.19.0)(!(version>=0.20.0)))" openhab.tp-lsp4j openhab-core-model-item-ide diff --git a/features/karaf/openhab-tp/pom.xml b/features/karaf/openhab-tp/pom.xml index 1a2b2dccf8c..0d0202a896a 100644 --- a/features/karaf/openhab-tp/pom.xml +++ b/features/karaf/openhab-tp/pom.xml @@ -16,7 +16,7 @@ 9.4.46.v20220331 - 5.11.0 + 5.12.1 diff --git a/features/karaf/openhab-tp/src/main/feature/feature.xml b/features/karaf/openhab-tp/src/main/feature/feature.xml index 321174b499b..8cbf628a6d1 100644 --- a/features/karaf/openhab-tp/src/main/feature/feature.xml +++ b/features/karaf/openhab-tp/src/main/feature/feature.xml @@ -54,8 +54,8 @@ - openhab.tp;feature=gson;version=2.8.9 - mvn:com.google.code.gson/gson/2.8.9 + openhab.tp;feature=gson;version=2.9.1 + mvn:com.google.code.gson/gson/2.9.1 @@ -200,9 +200,9 @@ - openhab.tp;feature=lsp4j;version=0.12.0 - mvn:org.eclipse.lsp4j/org.eclipse.lsp4j/0.12.0 - mvn:org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc/0.12.0 + openhab.tp;feature=lsp4j;version=0.19.0 + mvn:org.eclipse.lsp4j/org.eclipse.lsp4j/0.19.0 + mvn:org.eclipse.lsp4j/org.eclipse.lsp4j.jsonrpc/0.19.0 openhab.tp-gson openhab.tp-xtext @@ -222,24 +222,24 @@ - openhab.tp;feature=xtext;version=2.26.0 + openhab.tp;feature=xtext;version=2.29.0 - mvn:org.eclipse.xtext/org.eclipse.xtext/2.26.0 + mvn:org.eclipse.xtext/org.eclipse.xtext/2.29.0 mvn:org.eclipse.emf/org.eclipse.emf.common/2.17.0 mvn:org.eclipse.emf/org.eclipse.emf.ecore/2.20.0 mvn:org.eclipse.emf/org.eclipse.emf.ecore.change/2.14.0 mvn:org.eclipse.emf/org.eclipse.emf.ecore.xmi/2.16.0 - mvn:org.eclipse.xtext/org.eclipse.xtext.common.types/2.26.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.common.types/2.29.0 mvn:javax.annotation/javax.annotation-api/1.2 - mvn:org.eclipse.xtext/org.eclipse.xtext.xbase/2.26.0 - mvn:org.eclipse.xtext/org.eclipse.xtext.xbase.lib/2.26.0 - mvn:org.eclipse.xtext/org.eclipse.xtext.smap/2.26.0 - mvn:org.eclipse.xtext/org.eclipse.xtext.util/2.26.0 - mvn:org.eclipse.xtend/org.eclipse.xtend.lib/2.26.0 - mvn:org.eclipse.xtend/org.eclipse.xtend.lib.macro/2.26.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.xbase/2.29.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.xbase.lib/2.29.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.smap/2.29.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.util/2.29.0 + mvn:org.eclipse.xtend/org.eclipse.xtend.lib/2.29.0 + mvn:org.eclipse.xtend/org.eclipse.xtend.lib.macro/2.29.0 mvn:com.google.guava/failureaccess/1.0.1 mvn:com.google.guava/guava/30.1-jre @@ -247,7 +247,7 @@ mvn:org.eclipse.orbit.bundles/org.aopalliance/1.0.0.v201105210816 mvn:org.eclipse.orbit.bundles/com.google.inject/5.0.1.v20210324-2015 - mvn:org.eclipse.orbit.bundles/io.github.classgraph/4.8.138.v20211212-1642 + mvn:org.eclipse.orbit.bundles/io.github.classgraph/4.8.149.v20220915-0556 mvn:org.eclipse.orbit.bundles/org.antlr.runtime/3.2.0.v201101311130 mvn:org.eclipse.platform/org.eclipse.equinox.common/3.13.0 @@ -256,16 +256,16 @@ - mvn:org.ow2.asm/asm/9.2 + mvn:org.ow2.asm/asm/9.4 - openhab.tp;feature=xtext-ide;version=2.26.0 + openhab.tp;feature=xtext-ide;version=2.29.0 openhab.tp-xtext - mvn:org.eclipse.xtext/org.eclipse.xtext.ide/2.26.0 - mvn:org.eclipse.xtext/org.eclipse.xtext.xbase.ide/2.26.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.ide/2.29.0 + mvn:org.eclipse.xtext/org.eclipse.xtext.xbase.ide/2.29.0 diff --git a/itests/org.opensmarthouse.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/internal/defaultscope/ScriptScopeOSGiTest.java b/itests/org.opensmarthouse.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/internal/defaultscope/ScriptScopeOSGiTest.java deleted file mode 100644 index b67af8c1182..00000000000 --- a/itests/org.opensmarthouse.core.automation.module.script.tests/src/main/java/org/openhab/core/automation/module/script/internal/defaultscope/ScriptScopeOSGiTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Copyright (c) 2010-2022 Contributors to the openHAB project - * - * See the NOTICE file(s) distributed with this work for additional - * information. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0 - * - * SPDX-License-Identifier: EPL-2.0 - */ -package org.openhab.core.automation.module.script.internal.defaultscope; - -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assumptions.assumeTrue; - -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; - -import javax.script.ScriptEngine; -import javax.script.ScriptException; - -import org.eclipse.jdt.annotation.NonNullByDefault; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.openhab.core.automation.module.script.ScriptEngineContainer; -import org.openhab.core.automation.module.script.ScriptEngineManager; -import org.openhab.core.test.java.JavaOSGiTest; - -/** - * This tests the script modules if the Nashorn JavaScript engine is available. - * - * @author Kai Kreuzer - Initial contribution - */ -@NonNullByDefault -public class ScriptScopeOSGiTest extends JavaOSGiTest { - - private static final boolean NASHORN_AVAILABLE = isNashornAvailable(); - - private @NonNullByDefault({}) ScriptEngine engine; - - private final String path = "OH-INF/automation/jsr223/"; - private final String workingFile = "scopeWorking.js"; - private final String failureFile = "scopeFailure.js"; - - /** - * Returns if the Nashorn JavaScript engine is available based on the Java specification version property. - * Nashorn has been removed from JDK 15 and onwards. - * - * @return {@code true} if Nashorn is available, {@code false} otherwise - */ - private static boolean isNashornAvailable() { - try { - String javaVersion = System.getProperty("java.specification.version"); - return javaVersion == null ? false : Long.parseLong(javaVersion) < 15; - } catch (NumberFormatException e) { - return false; - } - } - - @BeforeEach - public void init() { - assumeTrue(NASHORN_AVAILABLE); - - ScriptEngineManager scriptManager = getService(ScriptEngineManager.class); - ScriptEngineContainer container = scriptManager.createScriptEngine("js", "myJSEngine"); - engine = container.getScriptEngine(); - } - - @Test - public void testScopeDefinesItemTypes() throws ScriptException, IOException { - URL url = bundleContext.getBundle().getResource(path + workingFile); - engine.eval(new InputStreamReader(url.openStream())); - } - - @Test - public void testScopeDoesNotDefineFoobar() throws ScriptException, IOException { - URL url = bundleContext.getBundle().getResource(path + failureFile); - assertThrows(ScriptException.class, () -> engine.eval(new InputStreamReader(url.openStream()))); - } -} diff --git a/tools/static-code-analysis/spotbugs/suppressions.xml b/tools/static-code-analysis/spotbugs/suppressions.xml index 975781d2852..8502f7b364a 100644 --- a/tools/static-code-analysis/spotbugs/suppressions.xml +++ b/tools/static-code-analysis/spotbugs/suppressions.xml @@ -35,4 +35,8 @@ + + + +