sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1791778 - in /sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal: doclet/Doclet.java doclet/Include.java doclet/InlineTaglet.java doclet/Module.java doclet/Preformat.java doclet/package-info.java taglet/
Date Tue, 18 Apr 2017 12:38:32 GMT
Author: desruisseaux
Date: Tue Apr 18 12:38:32 2017
New Revision: 1791778

URL: http://svn.apache.org/viewvc?rev=1791778&view=rev
Log:
Merge the doclet and taglet packages in a single one.

Added:
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Include.java
      - copied, changed from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/InlineTaglet.java
      - copied, changed from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Module.java
      - copied, changed from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Preformat.java
      - copied, changed from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
Removed:
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/
Modified:
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
    sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java

Modified: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java?rev=1791778&r1=1791777&r2=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -38,7 +38,6 @@ import jdk.javadoc.doclet.Reporter;
 import jdk.javadoc.doclet.Doclet.Option;
 import jdk.javadoc.doclet.DocletEnvironment;
 import jdk.javadoc.doclet.StandardDoclet;
-import org.apache.sis.internal.taglet.InlineTaglet;
 
 
 /**
@@ -89,6 +88,11 @@ public final class Doclet extends Standa
     private String outputDirectory;
 
     /**
+     * Where to report warnings, or {@code null} if unknown.
+     */
+    Reporter reporter;
+
+    /**
      * Invoked by the Javadoc tools for instantiating the custom doclet.
      */
     public Doclet() {
@@ -103,7 +107,7 @@ public final class Doclet extends Standa
     @Override
     public void init(final Locale locale, final Reporter reporter) {
         super.init(locale, reporter);
-        InlineTaglet.reporter = reporter;
+        this.reporter = reporter;
     }
 
     /**
@@ -151,6 +155,7 @@ public final class Doclet extends Standa
      * @return {@code true} on success, or {@code false} on failure.
      */
     @Override
+    @SuppressWarnings("CallToPrintStackTrace")
     public boolean run(final DocletEnvironment environment) {
         final boolean success = super.run(environment);
         if (success && outputDirectory != null) try {
@@ -165,10 +170,14 @@ public final class Doclet extends Standa
                 }
             }
         } catch (IOException e) {
-            final StringWriter buffer = new StringWriter();
-            final PrintWriter p = new PrintWriter(buffer);
-            e.printStackTrace(p);
-            InlineTaglet.reporter.print(Diagnostic.Kind.ERROR, buffer.toString());
+            if (reporter != null) {
+                final StringWriter buffer = new StringWriter();
+                final PrintWriter p = new PrintWriter(buffer);
+                e.printStackTrace(p);
+                reporter.print(Diagnostic.Kind.ERROR, buffer.toString());
+            } else {
+                e.printStackTrace();            // This fallback should not be needed, but
we are paranoiac.
+            }
             return false;
         }
         return success;

Copied: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Include.java
(from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Include.java?p2=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Include.java&p1=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java&r1=1791777&r2=1791778&rev=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Include.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Include.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.taglet;
+package org.apache.sis.internal.doclet;
 
 import java.io.*;
 import com.sun.source.doctree.DocTree;

Copied: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/InlineTaglet.java
(from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/InlineTaglet.java?p2=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/InlineTaglet.java&p1=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java&r1=1791777&r2=1791778&rev=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/InlineTaglet.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.taglet;
+package org.apache.sis.internal.doclet;
 
 import java.io.File;
 import java.util.Set;
@@ -28,6 +28,7 @@ import com.sun.source.doctree.DocTree;
 import com.sun.source.doctree.TextTree;
 import com.sun.source.doctree.UnknownInlineTagTree;
 import com.sun.source.tree.CompilationUnitTree;
+import jdk.javadoc.doclet.DocletEnvironment;
 
 
 /**
@@ -38,12 +39,11 @@ import com.sun.source.tree.CompilationUn
  * @since   0.3
  * @module
  */
-public abstract class InlineTaglet implements Taglet {
+abstract class InlineTaglet implements Taglet {
     /**
      * Where to report warnings, or {@code null} if unknown.
-     * This is initialized by {@link org.apache.sis.internal.doclet.Doclet#init Doclet.init(…)}.
      */
-    public static volatile Reporter reporter;
+    private Reporter reporter;
 
     /**
      * Constructs a default inline taglet.
@@ -52,6 +52,17 @@ public abstract class InlineTaglet imple
     }
 
     /**
+     * Initializes this taglet with the given doclet environment and doclet.
+     *
+     * @param env     the environment in which the taglet is running.
+     * @param doclet  the doclet that instantiated this taglet.
+     */
+    @Override
+    public void init(final DocletEnvironment env, final jdk.javadoc.doclet.Doclet doclet)
{
+        reporter = ((Doclet) doclet).reporter;
+    }
+
+    /**
      * Returns the set of locations in which this taglet may be used.
      * By default the taglet can be used everywhere.
      *
@@ -125,8 +136,7 @@ public abstract class InlineTaglet imple
      * Prints a warning message.
      */
     @SuppressWarnings("UseOfSystemOutOrSystemErr")
-    static void printWarning(final DocTree tag, final String message) {
-        final Reporter reporter = InlineTaglet.reporter;
+    final void printWarning(final DocTree tag, final String message) {
         if (reporter != null) {
             reporter.print(Diagnostic.Kind.WARNING, message);
         } else {
@@ -138,8 +148,7 @@ public abstract class InlineTaglet imple
      * Prints an error message.
      */
     @SuppressWarnings("UseOfSystemOutOrSystemErr")
-    static void printError(final DocTree tag, final String message) {
-        final Reporter reporter = InlineTaglet.reporter;
+    final void printError(final DocTree tag, final String message) {
         if (reporter != null) {
             reporter.print(Diagnostic.Kind.ERROR, message);
         } else {

Copied: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Module.java
(from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Module.java?p2=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Module.java&p1=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java&r1=1791777&r2=1791778&rev=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Module.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Module.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.taglet;
+package org.apache.sis.internal.doclet;
 
 import java.io.File;
 import java.util.List;

Copied: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Preformat.java
(from r1791777, sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Preformat.java?p2=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Preformat.java&p1=sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java&r1=1791777&r2=1791778&rev=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Preformat.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.internal.taglet;
+package org.apache.sis.internal.doclet;
 
 import java.util.StringTokenizer;
 import com.sun.source.doctree.DocTree;

Modified: sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java?rev=1791778&r1=1791777&r2=1791778&view=diff
==============================================================================
--- sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK9/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java
[UTF-8] Tue Apr 18 12:38:32 2017
@@ -17,7 +17,8 @@
 
 
 /**
- * Doclet performing post-processing after Javadoc generation.
+ * Javadoc taglets for processing custom tags in SIS source code comments,
+ * together with doclet performing post-processing after Javadoc generation.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.8



Mime
View raw message