sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1584984 - in /sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet: InlineTaglet.java Preformat.java SourceRepositoryURL.java
Date Sat, 05 Apr 2014 05:41:23 GMT
Author: desruisseaux
Date: Sat Apr  5 05:41:22 2014
New Revision: 1584984

URL: http://svn.apache.org/r1584984
Log:
Workaround the removal of ConfigurationImpl.getInstance() method in JDK8.

Modified:
    sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/InlineTaglet.java
    sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
    sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.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=1584984&r1=1584983&r2=1584984&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] Sat Apr  5 05:41:22 2014
@@ -18,6 +18,8 @@ package org.apache.sis.internal.taglet;
 
 import com.sun.javadoc.Tag;
 import com.sun.tools.doclets.Taglet;
+import com.sun.tools.doclets.internal.toolkit.Configuration;
+import com.sun.tools.doclets.formats.html.ConfigurationImpl;
 
 
 /**
@@ -30,6 +32,24 @@ import com.sun.tools.doclets.Taglet;
  */
 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.
+     */
+    static synchronized Configuration getConfiguration() {
+        if (configuration == null) {
+            configuration = new ConfigurationImpl();
+        }
+        return configuration;
+    }
+
+    /**
      * Constructs a default inline taglet.
      */
     InlineTaglet() {

Modified: sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java?rev=1584984&r1=1584983&r2=1584984&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/Preformat.java
[UTF-8] Sat Apr  5 05:41:22 2014
@@ -118,7 +118,7 @@ public final class Preformat extends Inl
         try {
             style = Style.valueOf(format);
         } catch (IllegalArgumentException e) {
-            ConfigurationImpl.getInstance().root.printWarning(tag.position(), "Unknown format:
" + format);
+            getConfiguration().root.printWarning(tag.position(), "Unknown format: " + format);
             style = Style.text;
         }
         /*

Modified: sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java?rev=1584984&r1=1584983&r2=1584984&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java
[UTF-8] Sat Apr  5 05:41:22 2014
@@ -88,7 +88,7 @@ public final class SourceRepositoryURL e
                 break;
             }
             default: {
-                ConfigurationImpl.getInstance().root.printWarning(tag.position(), "Unknown
keyword: " + keyword);
+                getConfiguration().root.printWarning(tag.position(), "Unknown keyword: "
+ keyword);
                 break;
             }
         }



Mime
View raw message