Dump services webrev

Mandy Chung mandy.chung at oracle.com
Tue May 29 13:53:59 PDT 2012


On 5/29/2012 1:53 AM, Paul Sandoz wrote:
>
>>    http://cr.openjdk.java.net/~mchung/jigsaw/annotated_jdk_webrev/
> Did you use some tool to help identify and make code changes?

I only used NetBeans (and also grep) and annotated the code while 
inspecting the code for these dependencies.   There are some patterns we 
could build a tool to identify and make code changes but I can't think 
of a good way to identify all cases.   Since the post-processing 
modularization and generating module-info.java at build time is 
temporary, I didn't spend too much time on it as I expect that the jdk 
changes to the non-static dependencies would be limited and should be 
manageable once I did the first pass.

> jdk $ hg diff src/share/classes/org/openjdk/jigsaw/Configuration.java
> diff -r 1690f9dd8ebd src/share/classes/org/openjdk/jigsaw/Configuration.java
> --- a/src/share/classes/org/openjdk/jigsaw/Configuration.java	Fri May 18 12:55:26 2012 -0700
> +++ b/src/share/classes/org/openjdk/jigsaw/Configuration.java	Tue May 29 10:42:15 2012 +0200
> @@ -144,7 +144,27 @@
>           this.contextForName = new HashMap<String,Cx>();
>       }
>
> +    private void dumpServices(String title, Map<String,Set<String>>  services,
> +                              PrintStream out)
> +    {
> +        if (!services.isEmpty()) {
> +            out.format("    %s (%d)%n", title, services.size());
> +
> +            for (Map.Entry<String, Set<String>>  service : services.entrySet()) {
> +                Set<String>  names = service.getValue();
> +                out.format("      %s (%d)%n", service.getKey(), names.size());
> +                for (String name : names) {
> +                    out.format("        %s%n", name);
> +                }
> +            }
> +        }
> +    }
> +
>       private void dump(Context cx, boolean all, PrintStream out) {
> +        dumpServices("local service providers", cx.services(), out);
> +
> +        dumpServices("remote service suppliers", cx.serviceSuppliers(), out);
> +
>           if (!cx.localClasses().isEmpty()) {
>               Set<String>  classes = new TreeSet<>(cx.localClasses());
>               out.format("    local (%d)", classes.size());

Looks fine to me.

Thanks
Mandy
Mandy



More information about the jigsaw-dev mailing list