Author: desruisseaux
Date: Tue Feb  3 13:59:01 2015
New Revision: 1656731

URL: http://svn.apache.org/r1656731
Log:
Rewrite the private 'getConfiguration()' method in a way which will make easier 
for the JDK7 and JDK6 branches to be compilable with JDK8.
The difficulty come from the fact that the way to get the Configuration object 
is different on JDK8 than on JDK7 and JDK6.

Modified:
    
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java

Modified: 
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java?rev=1656731&r1=1656730&r2=1656731&view=diff
==============================================================================
--- 
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
 [UTF-8] Tue Feb  3 13:59:01 2015
@@ -35,20 +35,17 @@ import com.sun.tools.doclets.formats.htm
 abstract class InlineTaglet implements Taglet {
     /**
      * The doclet configuration, created when first needed for reporting 
warnings.
-     *
-     * <p>Note: the JDK7 branch uses {@code ConfigurationImpl.getInstance()} 
method instead.
-     * But that method does not exist anymore in JDK8.</p>
      */
     private static Configuration configuration;
 
     /**
-     * Returns the doclet configuration.
+     * Returns the root document, or {@code null} if none.
      */
-    private static synchronized Configuration getConfiguration() {
+    private static synchronized RootDoc getRootDoc() {
         if (configuration == null) {
             configuration = new ConfigurationImpl();
         }
-        return configuration;
+        return configuration.root;
     }
 
     /**
@@ -149,7 +146,7 @@ abstract class InlineTaglet implements T
      * Prints a warning message.
      */
     static void printWarning(final SourcePosition position, final String 
message) {
-        final RootDoc root = getConfiguration().root;
+        final RootDoc root = getRootDoc();
         if (root != null) {
             root.printWarning(position, message);
         } else {
@@ -161,7 +158,7 @@ abstract class InlineTaglet implements T
      * Prints an error message.
      */
     static void printError(final SourcePosition position, final String 
message) {
-        final RootDoc root = getConfiguration().root;
+        final RootDoc root = getRootDoc();
         if (root != null) {
             root.printError(position, message);
         } else {


Reply via email to