Skip to content

Commit

Permalink
test: Change erased type in AnnotationTest
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kohlschuetter committed Oct 14, 2023
1 parent c520e8b commit 34d9e67
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.EventObject;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;

import jsweet.lang.Name;

Expand All @@ -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() {
Expand Down

0 comments on commit 34d9e67

Please sign in to comment.