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

changeset 1571
af8417e590f4
parent 1544
62d91c13dce2
child 2525
2eb010b6cb22
equal deleted inserted replaced
1570:f91144b7da75 1571:af8417e590f4
1 /* 1 /*
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
137 return new JavacFileManager(context, true, charset); 137 return new JavacFileManager(context, true, charset);
138 } 138 }
139 139
140 @Override 140 @Override
141 public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) { 141 public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) {
142 PrintWriter err_pw = new PrintWriter(err, true); 142 PrintWriter err_pw = new PrintWriter(err == null ? System.err : err, true);
143 PrintWriter out_pw = new PrintWriter(out); 143 PrintWriter out_pw = new PrintWriter(out == null ? System.out : out);
144 try { 144 try {
145 String standardDocletName = "com.sun.tools.doclets.standard.Standard"; 145 String standardDocletName = "com.sun.tools.doclets.standard.Standard";
146 ClassLoader cl = getClass().getClassLoader();
146 return com.sun.tools.javadoc.Main.execute( 147 return com.sun.tools.javadoc.Main.execute(
147 "javadoc", err_pw, err_pw, out_pw, standardDocletName, arguments); 148 "javadoc", err_pw, err_pw, out_pw, standardDocletName, cl, arguments);
148 } finally { 149 } finally {
149 err_pw.flush(); 150 err_pw.flush();
150 out_pw.flush(); 151 out_pw.flush();
151 } 152 }
152 } 153 }

mercurial