Skip to content

Commit 9c4b013

Browse files
committed
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.
1 parent 5d4950e commit 9c4b013

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

transpiler/src/test/java/source/extension/AnnotationTest.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.util.EventObject;
44
import java.util.List;
55
import java.util.Map;
6+
import java.util.ServiceLoader;
67

78
import jsweet.lang.Name;
89

@@ -27,7 +28,7 @@ public static void main(String[] args) {
2728

2829
public void toBeErased() {
2930
// this will not be transpiled because the method will be erased
30-
javax.accessibility.AccessibilityProvider foo = null;
31+
ServiceLoader<?> foo = null;
3132
}
3233

3334
public void m() {

0 commit comments

Comments
 (0)