RFR (small): Modularizer should scan whole classpath for services

Alan Bateman Alan.Bateman at oracle.com
Fri Jul 20 05:44:23 PDT 2012


On 20/07/2012 12:13, Chris Hegarty wrote:
>
> There is a small issue in the Modularizer where some 
> META-INF/service/XXX files are not being correctly copied to the on 
> disk "exploded" modules ( these are used to create the jmod/deb 
> packages ) during the build.
>
> The issue is that service providers can be in multiple files/jars in 
> the classpath. For example, there are two 
> META-INF/service/com.sun.jdi.connect.Connector files, one in 
> sa-jdi.jar (for the serviceability agent) and one in tools.jar. It is 
> important to preserve these META-INF files in the jmod/installed 
> modules as they are still used to find services in classpath mode 
> (they do not effect module mode).
>
> The above example, com.sun.jdi.connect.Connector, is the only instance 
> of this situation in the JDK that I can find, but I think it is a 
> general problem so I have changed the Modularizer to search the whole 
> classpath when looking for services rather exiting early once one is 
> found. The META-INF/service/XXX are files are then concatenated.
>
> http://cr.openjdk.java.net/~chegar/jigsaw/sajdi_webrev.00/webrev/
>
> Note:
>  This issue was noticed when running the com/sun/jdi tests and 
> manifests itself as follows:
>   "java.lang.IllegalArgumentException: No connector named:
>     com.sun.jdi.CommandLineLaunch"
>
It's good to get this problem fixed as the service configuration file 
from sa-jdi.jar was overriding the file from tools.jar, leading to the 
problems with JDI that we have been running into it.

The changes look okay to me and we probably don't need to be too fussy 
with the Modularizer anyway as it will go away once we are on the new build.

-Alan.




More information about the jigsaw-dev mailing list