From 6df59243c0694c1a415a68672ac06bbd061ec232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kohlschu=CC=88tter?= Date: Sun, 8 Oct 2023 19:45:38 +0200 Subject: [PATCH] test: Change erased type in AnnotationTest Just to test a type erasure, we currently reference javax.accessibility.AccessibilityProvider, which is in the "java.deskop" module. If we were to modularize jsweet, we would have to "requires java.desktop" just for this (or Eclipse would not be able to run unit tests). Moreover, that module may not exist in all JVM environments. Change to a similar class in "java.base", ServiceLoader, and adjust module-info.java.txt accordingly. --- transpiler/src/test/java/source/extension/AnnotationTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transpiler/src/test/java/source/extension/AnnotationTest.java b/transpiler/src/test/java/source/extension/AnnotationTest.java index 8d0be4e6e..6023496e2 100644 --- a/transpiler/src/test/java/source/extension/AnnotationTest.java +++ b/transpiler/src/test/java/source/extension/AnnotationTest.java @@ -3,6 +3,7 @@ import java.util.EventObject; import java.util.List; import java.util.Map; +import java.util.ServiceLoader; import jsweet.lang.Name; @@ -27,7 +28,7 @@ public static void main(String[] args) { public void toBeErased() { // this will not be transpiled because the method will be erased - javax.accessibility.AccessibilityProvider foo = null; + ServiceLoader foo = null; } public void m() {