Skip to content

Commit 3f0bf3b

Browse files
committed
[java223] Compilation warnings + precision notice
Signed-off-by: Gwendal Roulleau <gwendal.roulleau@gmail.com>
1 parent d86b466 commit 3f0bf3b

4 files changed

Lines changed: 9 additions & 6 deletions

File tree

bundles/org.openhab.automation.java223/NOTICE

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ This bundle uses Apache Freemarker, with the 'Apache License 2.0'.
1717
In the 3rd party directory you will find a copy of the JavaScript Engine used by the Java223 binding, made by
1818
the user eobermuhlner (source available at https://github.com/eobermuhlner/java-scriptengine). This work is distributed
1919
under the MIT licence.
20+
Some modifications have been made to the original code, mainly null safe annotations, public accessor or several small
21+
methods. Each modification is marked with "JAVA223 modification".
2022

21-
== External Java Compiler
23+
== External Java Compiler : Standalone JDK Compiler
2224

2325
A fallback compiler is used if the Java 21 compiler is not available in the openHAB runtime.
2426
It is a GPL v2 work, from Christian Kohlschütter's Standalone JDK Compiler project (extracted from the JDK).
27+
(source available at https://github.com/kohlschutter/jdk.compiler.standalone)
2528

2629
== Source Code
2730

bundles/org.openhab.automation.java223/src/helper/java/helper/rules/RuleAnnotationParser.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.util.Map;
3434
import java.util.Set;
3535
import java.util.function.Supplier;
36-
import java.util.stream.Collectors;
3736

3837
import org.eclipse.jdt.annotation.NonNullByDefault;
3938
import org.openhab.core.automation.Condition;

bundles/org.openhab.automation.java223/src/test/java/org/openhab/automation/java223/internal/rules/Java223RuleTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void fieldConstructorExecutesCallableField() throws Exception {
119119
@Test
120120
public void fieldConstructorExecutesCallableAndWrapsCheckedException() throws Exception {
121121
ScriptWithCallable script = new ScriptWithCallable(() -> {
122-
throw new Exception("checked");
122+
throw new Java223Exception("checked");
123123
});
124124
Field field = ScriptWithCallable.class.getDeclaredField("callable");
125125

@@ -280,7 +280,7 @@ public void fieldConstructorExecutesCallableFieldWithDerivedClass() throws Excep
280280
Field field = ScriptWithRunnableDerived.class.getDeclaredField("runnable");
281281

282282
Java223Rule rule = new Java223Rule(script, field);
283-
Object result = rule.execute(emptyAction, new HashMap<>());
283+
rule.execute(emptyAction, new HashMap<>());
284284

285285
assertEquals(1, runnableDerived.getCount(), "runnable.run() result must be executed");
286286
}
@@ -406,7 +406,7 @@ public String methodWithAction(Action action) {
406406
}
407407

408408
public String throwingMethod() {
409-
throw new RuntimeException("kaboom");
409+
throw new Java223Exception("kaboom");
410410
}
411411
}
412412
}

bundles/org.openhab.automation.java223/src/test/java/org/openhab/automation/java223/internal/strategy/jarloader/JarClassLoaderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ public class JarClassLoaderTest {
4242
@Test
4343
public void testGetResourceAsStream() throws IOException {
4444
Path localTempDir = tempDir;
45-
if ((localTempDir == null))
45+
if ((localTempDir == null)) {
4646
throw new AssertionError("Temp directory is null. Should not happen");
47+
}
4748
Path jarPath = localTempDir.resolve("test with space.jar");
4849
createJar(jarPath, "test with space.txt", "Hello World");
4950

0 commit comments

Comments
 (0)