cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r586216 - in /cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl: QDoxSource.java QDoxSourceFactory.java
Date Fri, 19 Oct 2007 01:46:55 GMT
Author: vgritsenko
Date: Thu Oct 18 18:46:55 2007
New Revision: 586216

URL: http://svn.apache.org/viewvc?rev=586216&view=rev
Log:
switching to new AbstractLogEnabled

Modified:
    cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSource.java
    cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSourceFactory.java

Modified: cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSource.java?rev=586216&r1=586215&r2=586216&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSource.java
(original)
+++ cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSource.java
Thu Oct 18 18:46:55 2007
@@ -28,25 +28,13 @@
 import java.util.List;
 import java.util.Map;
 
-import com.thoughtworks.qdox.JavaDocBuilder;
-import com.thoughtworks.qdox.model.AbstractJavaEntity;
-import com.thoughtworks.qdox.model.DocletTag;
-import com.thoughtworks.qdox.model.JavaClass;
-import com.thoughtworks.qdox.model.JavaField;
-import com.thoughtworks.qdox.model.JavaMethod;
-import com.thoughtworks.qdox.model.JavaParameter;
-import com.thoughtworks.qdox.model.JavaSource;
-import com.thoughtworks.qdox.model.Type;
-
 import org.apache.avalon.excalibur.pool.Recyclable;
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.ServiceSelector;
-import org.apache.cocoon.serialization.Serializer;
-import org.apache.cocoon.xml.XMLUtils;
-
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
 import org.apache.excalibur.source.SourceResolver;
@@ -55,6 +43,19 @@
 import org.apache.excalibur.xml.sax.XMLizable;
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
+
+import org.apache.cocoon.serialization.Serializer;
+import org.apache.cocoon.xml.XMLUtils;
+
+import com.thoughtworks.qdox.JavaDocBuilder;
+import com.thoughtworks.qdox.model.AbstractJavaEntity;
+import com.thoughtworks.qdox.model.DocletTag;
+import com.thoughtworks.qdox.model.JavaClass;
+import com.thoughtworks.qdox.model.JavaField;
+import com.thoughtworks.qdox.model.JavaMethod;
+import com.thoughtworks.qdox.model.JavaParameter;
+import com.thoughtworks.qdox.model.JavaSource;
+import com.thoughtworks.qdox.model.Type;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
@@ -118,8 +119,9 @@
     protected final static int CONSTRUCTOR_INHERITANCE = 5;
     protected final static int METHOD_INHERITANCE = 6;
 
+    private final Log logger = LogFactory.getLog(getClass());
+
     protected ServiceManager manager;
-    protected Logger logger;
 
     protected Source javaSource;
     protected String javadocUri;
@@ -161,13 +163,11 @@
      *
      * @param location
      * @param javaSource
-     * @param logger
      * @param manager
      */
-    public QDoxSource(String location, Source javaSource, Logger logger, ServiceManager manager)
{
+    public QDoxSource(String location, Source javaSource, ServiceManager manager) {
         this.javadocUri = location;
         this.javaSource = javaSource;
-        this.logger = logger;
         this.manager = manager;
         this.javadocClassName = javadocUri.substring(javadocUri.indexOf(':') + 1);
         try {
@@ -295,7 +295,7 @@
      * @see Recyclable#recycle()
      */
     public void recycle() {
-        if (logger != null && logger.isDebugEnabled()) {
+        if (logger.isDebugEnabled()) {
             logger.debug("Recycling QDoxSource '" + javadocClassName + "'...");
         }
 
@@ -306,7 +306,6 @@
         javadocClass = null;
         containingJavadocClass = null;
         classMap = null;
-        logger = null;
     }
 
     /**
@@ -348,7 +347,7 @@
     /**
      * @see org.apache.excalibur.source.Source#getInputStream()
      */
-    public InputStream getInputStream() throws IOException, SourceException {
+    public InputStream getInputStream() throws IOException {
         if (this.logger.isDebugEnabled()) {
             this.logger.debug("Getting InputStream for class " + this.javadocClass.getFullyQualifiedName());
         }
@@ -379,7 +378,7 @@
         return inputStream;
     }
 
-    protected void createJavadocXml() throws SourceException, IOException {
+    protected void createJavadocXml() throws IOException {
         if (logger.isDebugEnabled()) {
             logger.debug("Reading Java source " + javaSource.getURI());
         }
@@ -404,7 +403,7 @@
      * @return String
      */
     private String resolveClassNameFromLink(String ref) {
-        String classPart = null;
+        String classPart;
         int hashIndex = ref.indexOf('#');
         if (hashIndex < 0) {
             classPart = ref;
@@ -781,8 +780,8 @@
         if (comment != null && comment.length() > 0) {
             saxStartElement(handler, COMMENT_ELEMENT);
             while (reLink.match(comment)) {
-                String ref = null;
-                String display = null;
+                String ref;
+                String display;
                 if (reLink.getParen(6) == null) {
                     // {@link xxx yyy}
                     ref = reLink.getParen(2);

Modified: cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSourceFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSourceFactory.java?rev=586216&r1=586215&r2=586216&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSourceFactory.java
(original)
+++ cocoon/trunk/blocks/cocoon-qdox/cocoon-qdox-impl/src/main/java/org/apache/cocoon/components/source/impl/QDoxSourceFactory.java
Thu Oct 18 18:46:55 2007
@@ -28,7 +28,6 @@
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
@@ -40,6 +39,8 @@
 import org.apache.regexp.RE;
 import org.apache.regexp.RESyntaxException;
 
+import org.apache.cocoon.util.AbstractLogEnabled;
+
 
 /**
  * This {@link org.apache.excalibur.source.SourceFactory SourceFactory} creates {@link
@@ -76,9 +77,9 @@
  * 
  * @version $Id$
  */
-public final class QDoxSourceFactory
-    extends AbstractLogEnabled
-    implements SourceFactory, Serviceable, Configurable, ThreadSafe {
+public final class QDoxSourceFactory extends AbstractLogEnabled
+                                     implements SourceFactory, Serviceable, Configurable,
+                                                ThreadSafe {
     
     protected final static String INCLUDE_INHERITANCE_ELEMENT = "include-inheritance";
     protected final static String VALUE_ATTRIBUTE = "value";
@@ -136,9 +137,9 @@
     /**
      * @see org.apache.excalibur.source.SourceFactory#getSource(java.lang.String, java.util.Map)
      */
-    public Source getSource(String location, Map parameters) throws MalformedURLException,
IOException, SourceException {
+    public Source getSource(String location, Map parameters) throws IOException {
         String className = location.substring(location.indexOf(':') + 1);
-        Source javaSource = null;
+        Source javaSource;
         if (className.length() > 0) {
             try {
                 if(getLogger().isDebugEnabled()) {
@@ -154,10 +155,10 @@
 
         QDoxSource result = null;
         if (javaSource != null) {
-            return new QDoxSource(location, javaSource, getLogger(), manager);
+            return new QDoxSource(location, javaSource, manager);
         }
 
-        if(getLogger().isDebugEnabled()) {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("returning source=" + result + " for className=" + className);
         }
 



Mime
View raw message