# HG changeset patch # User ksrini # Date 1409145917 25200 # Node ID 620556167c089a6d865f70200517e931ebd0c54a # Parent 4ebd9393b3735ddb612446d56e27aa8da95a6af2 8038732: [javadoc] NetBeans IDE target does not build doclets Reviewed-by: jjg, jlahoda diff -r 4ebd9393b373 -r 620556167c08 langtools/make/build.properties --- a/langtools/make/build.properties Wed Aug 27 11:41:03 2014 +0100 +++ b/langtools/make/build.properties Wed Aug 27 06:25:17 2014 -0700 @@ -128,17 +128,11 @@ javadoc.includes = \ com/sun/javadoc/ \ - com/sun/tools/javadoc/ + com/sun/tools/javadoc/ \ + com/sun/tools/doclets/ javadoc.tests = \ - tools/javadoc/ - -# - -doclets.includes = \ - com/sun/tools/doclets/ - -doclets.tests = \ + tools/javadoc/ \ com/sun/javadoc/ # diff -r 4ebd9393b373 -r 620556167c08 langtools/make/build.xml --- a/langtools/make/build.xml Wed Aug 27 11:41:03 2014 +0100 +++ b/langtools/make/build.xml Wed Aug 27 06:25:17 2014 -0700 @@ -83,7 +83,7 @@ - global property definitions - general top level targets - general diagnostic/debugging targets - - groups of targets for each tool: javac, javadoc, doclets, javah, javap + - groups of targets for each tool: javac, javadoc, javah, javap Within each group, the following targets are provided, where applicable build-bootstrap-TOOL build the bootstrap version of the tool build-classes-TOOL build the classes for the tool @@ -252,15 +252,15 @@ - + @@ -615,7 +615,7 @@ + jarclasspath="javac.jar"/> @@ -625,7 +625,7 @@ + jarclasspath="javac.jar"/> @@ -643,40 +643,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -684,7 +650,7 @@ + jarclasspath="javadoc.jar javac.jar"/> diff -r 4ebd9393b373 -r 620556167c08 langtools/make/tools/anttasks/GenStubsTask.java --- a/langtools/make/tools/anttasks/GenStubsTask.java Wed Aug 27 11:41:03 2014 +0100 +++ b/langtools/make/tools/anttasks/GenStubsTask.java Wed Aug 27 06:25:17 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,6 +82,7 @@ createClasspath().setRefid(r); } + @Override public void setIncludes(String includes) { super.setIncludes(includes); this.includes = includes; @@ -103,7 +104,7 @@ return; System.out.println("Generating " + files.length + " stub files to " + destDir); - List classNames = new ArrayList(); + List classNames = new ArrayList<>(); for (String file: files) { classNames.add(file.replaceAll(".java$", "").replace('/', '.')); } @@ -114,7 +115,7 @@ if (!ok) throw new BuildException("genstubs failed"); } else { - List cmd = new ArrayList(); + List cmd = new ArrayList<>(); String java_home = System.getProperty("java.home"); cmd.add(new File(new File(java_home, "bin"), "java").getPath()); if (classpath != null) @@ -130,20 +131,15 @@ pb.redirectErrorStream(true); try { Process p = pb.start(); - BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); - try { + try (BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()))) { String line; while ((line = in.readLine()) != null) System.out.println(line); - } finally { - in.close(); } int rc = p.waitFor(); if (rc != 0) throw new BuildException("genstubs failed"); - } catch (IOException e) { - throw new BuildException("genstubs failed", e); - } catch (InterruptedException e) { + } catch (IOException | InterruptedException e) { throw new BuildException("genstubs failed", e); } } diff -r 4ebd9393b373 -r 620556167c08 langtools/make/tools/anttasks/SelectToolTask.java --- a/langtools/make/tools/anttasks/SelectToolTask.java Wed Aug 27 11:41:03 2014 +0100 +++ b/langtools/make/tools/anttasks/SelectToolTask.java Wed Aug 27 06:25:17 2014 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,11 +41,9 @@ import java.io.IOException; import java.io.Reader; import java.io.Writer; -import java.util.ArrayList; -import java.util.Arrays; import java.util.EnumSet; -import java.util.List; import java.util.Properties; + import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; @@ -56,6 +54,7 @@ import javax.swing.JTextField; import javax.swing.SwingUtilities; + import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; import org.apache.tools.ant.Task; @@ -101,6 +100,7 @@ /** * Set the location of the private properties file used to keep the retain * user preferences for this repository. + * @param propertyFile the private properties file */ public void setPropertyFile(File propertyFile) { this.propertyFile = propertyFile; @@ -110,6 +110,7 @@ * Set the name of the property which will be set to the name of the * selected tool, if any. If no tool is selected, the property will * remain unset. + * @param toolProperty the tool name property */ public void setToolProperty(String toolProperty) { this.toolProperty = toolProperty; @@ -118,14 +119,16 @@ /** * Set the name of the property which will be set to the execution args of the * selected tool, if any. The args default to an empty string. + * @param argsProperty the execution args property value */ public void setArgsProperty(String argsProperty) { this.argsProperty = argsProperty; } /** - * Set the name of the property which will be set to the execution args of the - * selected tool, if any. The args default to an empty string. + * Set the name of the property which will be used to bootstrap the + * selected tool, if any. The property will remain unset. + * @param bootstrapProperty */ public void setBootstrapProperty(String bootstrapProperty) { this.bootstrapProperty = bootstrapProperty; @@ -134,6 +137,7 @@ /** * Specify whether or not to pop up a dialog if the user has not specified * a default value for a property. + * @param askIfUnset a boolean flag indicating to prompt the user or not */ public void setAskIfUnset(boolean askIfUnset) { this.askIfUnset = askIfUnset; @@ -208,10 +212,11 @@ body.add(toolLabel, lc); EnumSet toolChoices = toolProperty == null ? EnumSet.allOf(ToolChoices.class) : EnumSet.range(ToolChoices.JAVAC, ToolChoices.JAVAP); - toolChoice = new JComboBox(toolChoices.toArray()); + toolChoice = new JComboBox<>(toolChoices.toArray()); if (toolName != null) toolChoice.setSelectedItem(ToolChoices.valueOf(toolName.toUpperCase())); toolChoice.addItemListener(new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { String tn = ((ToolChoices)e.getItem()).toolName; argsField.setText(getDefaultArgsForTool(props, tn)); @@ -237,8 +242,10 @@ body.add(argsLabel, lc); body.add(argsField, fc); argsField.addFocusListener(new FocusListener() { + @Override public void focusGained(FocusEvent e) { } + @Override public void focusLost(FocusEvent e) { String toolName = ((ToolChoices)toolChoice.getSelectedItem()).toolName; if (toolName.length() > 0) @@ -257,6 +264,7 @@ okButton = new JButton("OK"); okButton.setEnabled(toolProperty == null || (toolName != null && !toolName.equals(""))); okButton.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { JDialog d = (JDialog) SwingUtilities.getAncestorOfClass(JDialog.class, p); d.setVisible(false); @@ -326,7 +334,7 @@ private File propertyFile; // GUI components - private JComboBox toolChoice; + private JComboBox toolChoice; private JCheckBox bootstrapCheckbox; private JTextField argsField; private JCheckBox defaultCheck;