Small question about Dependence.Modifier.SYNTHETIC

Alexey Fedorov alexey.x.fedorov at oracle.com
Mon Feb 6 09:27:29 PST 2012


Hello!

I am playing with Jigsaw and met the following strange behavior. As I 
understand, java.lang.module.Dependence.Modifier.SYNTHETIC was created 
in modular JDK for underlining that the corresponding dependency was 
added by the system, not by user. Consider the following code example:


/module-info.java:/

module my.module @ 1.0 {
     class mypackage.MyClass;
}


/MyClass.java:/

package mypackage;

public class MyClass  {

     public static void main(String[] args) throws IOException {
         ModuleInfo moduleInfo = MyClass.class.getModule().getModuleInfo();
         for (ViewDependence viewDependence : 
moduleInfo.requiresModules()) {
             System.out.println(viewDependence);
         }
     }

}


In the middle of January output was:

>>  requires*synthetic*jdk@=8-ea


But actual output is:

>>  requires jdk@=8-ea



Here dependency "jdk@=8-ea" is not marked as*synthetic*. Is it an expected behavior or regression?


--
Thank you,
Alexey




More information about the jigsaw-dev mailing list