src/share/classes/com/sun/tools/javadoc/api/JavadocTool.java

changeset 1571
af8417e590f4
parent 1544
62d91c13dce2
child 2525
2eb010b6cb22
     1.1 --- a/src/share/classes/com/sun/tools/javadoc/api/JavadocTool.java	Mon Feb 04 18:08:53 2013 -0500
     1.2 +++ b/src/share/classes/com/sun/tools/javadoc/api/JavadocTool.java	Sun Feb 17 16:44:55 2013 -0500
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -139,12 +139,13 @@
    1.11  
    1.12      @Override
    1.13      public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) {
    1.14 -        PrintWriter err_pw = new PrintWriter(err, true);
    1.15 -        PrintWriter out_pw = new PrintWriter(out);
    1.16 +        PrintWriter err_pw = new PrintWriter(err == null ? System.err : err, true);
    1.17 +        PrintWriter out_pw = new PrintWriter(out == null ? System.out : out);
    1.18          try {
    1.19              String standardDocletName = "com.sun.tools.doclets.standard.Standard";
    1.20 +            ClassLoader cl = getClass().getClassLoader();
    1.21              return com.sun.tools.javadoc.Main.execute(
    1.22 -                    "javadoc", err_pw, err_pw, out_pw, standardDocletName, arguments);
    1.23 +                    "javadoc", err_pw, err_pw, out_pw, standardDocletName, cl, arguments);
    1.24          } finally {
    1.25              err_pw.flush();
    1.26              out_pw.flush();

mercurial