Dump services webrev

Alan Bateman Alan.Bateman at oracle.com
Tue May 29 07:40:25 PDT 2012


On 29/05/2012 09:53, Paul Sandoz wrote:
> :
> I presume the best practice is to stick to the same style in the source itself. Is there a recommended style guide available? any tools to help apply such a guide (e.g. in NetBeans)?
There is a lot of inconsistency in the JDK so I would suggest just keep 
the changes locally consistent.


> :
>
>
> 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());
This looks fine to me and I'm happy to push it for you.

-Alan.






More information about the jigsaw-dev mailing list