forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r556752 [2/3] - in /forrest/trunk/whiteboard/forrestdoc/src/java: ./ org/apache/forrest/forrestdoc/java/doc/ org/apache/forrest/forrestdoc/java/src/ org/apache/forrest/forrestdoc/java/src/symtab/ org/apache/forrest/forrestdoc/java/src/util/...
Date Mon, 16 Jul 2007 22:17:48 GMT
Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/ClassTag.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/ClassTag.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/ClassTag.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/ClassTag.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,6 +20,8 @@
 
 /**
  * An occurrence of an HTML Tag in a file
+ *
+ * @version $Id: $
  */
 public class ClassTag implements JSComparable {
 
@@ -39,8 +41,8 @@
 
     /**
      * Method getKey
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getKey() {
         return _key;
@@ -48,8 +50,8 @@
 
     /**
      * Method getTag
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getTag() {
         return _tag;
@@ -57,32 +59,25 @@
 
     /**
      * Constructor to define a new tag
-     * 
-     * @param key 
-     * @param tag 
+     *
+     * @param key
+     * @param tag
      */
     ClassTag(String key, String tag) {
 
         _key = key;
         _tag = tag;
-
-        // System.out.println("new ClassTag");
     }
 
     /**
-     * return a string representation of the occurrence
-     * 
-     * @return 
+     * @see java.lang.Object#toString()
      */
     public String toString() {
         return _tag;
     }
 
     /**
-     * Method compareTo
-     * 
-     * @param o 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.util.JSComparable#compareTo(java.lang.Object)
      */
     public int compareTo(Object o) {
 

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Definition.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Definition.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Definition.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Definition.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.util.StringTokenizer;
@@ -23,9 +25,14 @@
 /**
  * This abstract class represents a symbol definition in a Java source file.
  * All symbols used in our Java symbol table stem from this definition.
+ *
+ * @version $Id: $
  */
 public abstract class Definition implements Taggable, java.io.Serializable {
 
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( Definition.class );
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -50,8 +57,8 @@
 
     /**
      * Method getSourceName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getSourceName() {
         return _sourceName;
@@ -59,8 +66,8 @@
 
     /**
      * Method getRefName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getRefName() {
         return _refName;
@@ -81,10 +88,10 @@
 
     /**
      * Constructor for the base of a symbol definition
-     * 
-     * @param name        
-     * @param occ         
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param parentScope
      */
     Definition(String name, // the symbol name
                Occurrence occ, // the location of its definition
@@ -113,8 +120,8 @@
 
     /**
      * Setup source and reference file names.
-     * 
-     * @param occ 
+     *
+     * @param occ
      */
     private void setupFileNames(Occurrence occ) {
 
@@ -136,15 +143,16 @@
 
     /**
      * Add a location of a reference to the symbol to our reference list
-     * 
-     * @param occ 
+     *
+     * @param occ
      */
     void addReference(Occurrence occ) {
 
-        // if (getQualifiedName().endsWith("ReferencePersistor")) {
-        // System.out.println(occ.getFile()+":"+occ.getLine()+":"+occ.getColumn()+" --> "+getQualifiedName());
-        // }
-        // System.out.println("Adding reference in:"+occ.getFile()+" to "+getQualifiedName());
+        if (log.isDebugEnabled())
+        {
+            log.debug("addReference(Occurrence) - Adding reference in:"+occ.getFile()+" to "+getQualifiedName());
+        }
+
         if (occ != null) {
             occ.setDefinition(this);
             references.addElement(occ);
@@ -154,31 +162,31 @@
 
     /**
      * Subclasses override this method to create tags for references to this definition
-     * 
-     * @param occ 
-     * @return 
+     *
+     * @param occ
+     * @return
      */
     public abstract HTMLTag getOccurrenceTag(Occurrence occ);
 
     /**
      * Get a String representation of the location where this symbol
      * was defined
-     * 
-     * @return 
+     *
+     * @return
      */
     String getDef() {
 
         if (definition != null) {
             return definition.getLocation();
-        } else {
-            return "";
         }
+
+        return "";
     }
 
     /**
      * Set the basic name of this symbol
-     * 
-     * @param name 
+     *
+     * @param name
      */
     protected void setName(String name) {
         this.name = name;
@@ -186,22 +194,22 @@
 
     /**
      * Get the basic name of the symbol
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getName() {
 
         if (name == null) {
             return "~NO NAME~";
-        } else {
-            return name;
         }
+
+        return name;
     }
 
     /**
      * Get the information about where the symbol was defined
-     * 
-     * @return 
+     *
+     * @return
      */
     public Occurrence getOccurrence() {
 
@@ -214,8 +222,8 @@
 
     /**
      * Method setOccurrence
-     * 
-     * @param definition 
+     *
+     * @param definition
      */
     protected void setOccurrence(Occurrence definition) {
         this.definition = definition;
@@ -223,8 +231,8 @@
 
     /**
      * Get the symbol that contains the definition of this symbol
-     * 
-     * @return 
+     *
+     * @return
      */
     public ScopedDef getParentScope() {
         return parentScope;
@@ -234,8 +242,8 @@
      * Get the fully-qualified name of the symbol
      * Keep building the name by recursively calling the parentScope's
      * getQualifiedName() method...
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getQualifiedName() {
 
@@ -248,15 +256,15 @@
         if ((getParentScope() != null)
                 && !getParentScope().isDefaultOrBaseScope()) {
             return getParentScope().getQualifiedName() + "." + nameToUse;
-        } else {
-            return nameToUse;
         }
+
+        return nameToUse;
     }
 
     /**
      * Get the package name by going up the list of parents till we find the package
-     * 
-     * @return 
+     *
+     * @return
      */
     String getPackageName() {
 
@@ -275,8 +283,8 @@
 
     /**
      * Get the name for the class without the package,but with outer classes
-     * 
-     * @return 
+     *
+     * @return
      */
     String getScopedClassName() {
 
@@ -294,8 +302,8 @@
 
     /**
      * Method getPackagePath
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getPackagePath() {
 
@@ -310,19 +318,21 @@
 
     /**
      * Method getRelativePath
-     * 
-     * @param o 
-     * @return 
+     *
+     * @param o
+     * @return
      */
     String getRelativePath(Occurrence o) {
 
         String newPath = "";
         String packageName = null;
 
-        // System.out.println("Package Name for "+getName()+"="+getPackageName());
-        // System.out.println("Package Name for occurrence in "+o.getFile()+"="+o.getPackageName());
-        // System.out.println("gRP Package Name for "+getName()+"="+getPackageName());
-        // System.out.println("gRP Package Name for occurrence in "+o.getFile()+"="+o.getPackageName());
+        if (log.isDebugEnabled())
+        {
+            log.debug("getRelativePath(Occurrence) - Package Name for "+getName()+"="+getPackageName());
+            log.debug("getRelativePath(Occurrence) - Package Name for occurrence in "+o.getFile()+"="+o.getPackageName());
+        }
+
         if (o != null) {
             packageName = o.getPackageName();
         }
@@ -342,30 +352,34 @@
 
             newPath = backup + pathName + '/';
 
-            /*
-             * System.out.println(" !!!!Packagename for ["+getName()+"]=["+getPackageName()+"]");
-             * System.out.println("     Occurrence   in ["+o.getClassName()+"."+o.getMethodName()+"] in File ["+o.getFile()+"]=["+o.getPackageName()+"]");
-             * System.out.println("     NewPath         ["+newPath+"]");
-             */
+            if (log.isDebugEnabled())
+            {
+                log.debug("getRelativePath(Occurrence) - Packagename for ["+getName()+"]=["+getPackageName()+"]");
+                log.debug("getRelativePath(Occurrence) - Occurrence   in ["+o.getClassName()+"."+o.getMethodName()+"] in File ["+o.getFile()+"]=["+o.getPackageName()+"]");
+                log.debug("getRelativePath(Occurrence) - NewPath         ["+newPath+"]");
+            }
         }
 
-        // System.out.println("gRP Package Name for newpath: "+newPath);
         return (newPath);
     }
 
     /**
      * Method getOccurrencePath
-     * 
-     * @param o 
-     * @return 
+     *
+     * @param o
+     * @return
      */
     String getOccurrencePath(Occurrence o) {
 
         String occurrencePackageName = o.getPackageName();
         String newPath = "";
 
-        // System.out.println("gOP Package Name for "+getName()+"="+getPackageName());
-        // System.out.println("gOP Package Name for occurrence in "+o.getFile()+"="+o.getPackageName());
+        if (log.isDebugEnabled())
+        {
+            log.debug("getOccurrencePath(Occurrence) - Package Name for "+getName()+"="+getPackageName());
+            log.debug("getOccurrencePath(Occurrence) - Package Name for occurrence in "+o.getFile()+"="+o.getPackageName());
+        }
+
         if ((getPackageName() != null) && (occurrencePackageName != null)
                 && !getPackageName().equals(occurrencePackageName)) {
 
@@ -387,11 +401,13 @@
 
             newPath = backup + occurrancePathName + File.separatorChar;
 
-            // System.out.println("DEBUG OP for  oc["+occurrencePackageName+"] me["+getPackageName()+"]");
-            // System.out.println("      OP diff oc["+newPath+"]");
+            if (log.isDebugEnabled())
+            {
+                log.debug("getOccurrencePath(Occurrence) - Occurrence["+occurrencePackageName+"] me["+getPackageName()+"]");
+                log.debug("getOccurrencePath(Occurrence) - newPath "+newPath);
+            }
         }
 
-        // System.out.println("gOP Package Name for newpath: "+newPath);
         return (newPath);
     }
 
@@ -400,9 +416,9 @@
      * another symbol.  For most symbols, this is false (because most symbols
      * are not classes...).
      * This method will be overridden for classes and interfaces.
-     * 
-     * @param def 
-     * @return 
+     *
+     * @param def
+     * @return
      */
     boolean isSuperClassOf(Definition def) {
         return false;
@@ -410,8 +426,8 @@
 
     /**
      * return a String representation of this class for printing
-     * 
-     * @return 
+     *
+     * @return
      */
     public JavaVector getReferences() {
         return references;
@@ -422,10 +438,10 @@
      * the scope of another symbol.  This version of the lookup method is a
      * convenience that just passes -1 as the parameter count (meaning
      * look the name up as a non-method symbol
-     * 
-     * @param name 
-     * @param type 
-     * @return 
+     *
+     * @param name
+     * @param type
+     * @return
      */
     Definition lookup(String name, Class type) {
         return lookup(name, -1, type);
@@ -435,35 +451,33 @@
      * Lookup a method in our scope.  Because this is only a valid
      * operation for scoped definitions, we default this to throw
      * an exception that states so
-     * 
-     * @param name      
-     * @param numParams 
-     * @param type      
-     * @return 
+     *
+     * @param name
+     * @param numParams
+     * @param type
+     * @return
      */
     Definition lookup(String name, int numParams, Class type) {
         throw new IllegalArgumentException("Can't lookup in a " + getClass());
     }
 
     /**
-     * An abstract method used to tag information about this definition.
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Taggable#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public abstract void generateTags(HTMLTagContainer tagList);
 
     /**
      * Default implementation of accept method (Visitor design pattern).
-     * 
-     * @param visitor 
+     *
+     * @param visitor
      */
     public void accept(Visitor visitor) {
     }
 
     /**
      * generateReferences
-     * 
-     * @param output 
+     *
+     * @param output
      */
     public void generateReferences(FileWriter output) {
 
@@ -473,8 +487,8 @@
     /**
      * This method resolves any references to other symbols.
      * At this level there is nothing to resolve, so do nothing.
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void resolveTypes(SymbolTable symbolTable) {
     }
@@ -482,8 +496,8 @@
     /**
      * This method resolves any references to other symbols.
      * At this level there is nothing to resolve, so do nothing.
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void resolveRefs(SymbolTable symbolTable) {
     }
@@ -491,8 +505,8 @@
     /**
      * Set a reference to the symbol that syntactically
      * contains this symbol.
-     * 
-     * @param parentScope 
+     *
+     * @param parentScope
      */
     void setParentScope(ScopedDef parentScope) {
         this.parentScope = parentScope;
@@ -500,8 +514,8 @@
 
     /**
      * Method getClassScopeName
-     * 
-     * @return 
+     *
+     * @return
      */
     String getClassScopeName() {
         return getName();
@@ -509,10 +523,10 @@
 
     /**
      * Determine whether this is an instance of exactly the specified Class.
-     * 
+     *
      * @param o the object in question
      * @param c a Class object or null.  If null, always returns true.
-     * @return 
+     * @return
      */
     protected boolean isA(Class c) {
 
@@ -525,9 +539,9 @@
 
     /**
      * Serialize
-     * 
-     * @param out 
-     * @throws java.io.IOException 
+     *
+     * @param out
+     * @throws java.io.IOException
      */
     private void writeObject(java.io.ObjectOutputStream out)
             throws java.io.IOException {
@@ -542,11 +556,7 @@
     }
 
     /**
-     * return a String representation of this class for printing
-     * Note that this version of toString() is used by nearly all of
-     * the subclasses of Definition.
-     * 
-     * @return 
+     * @see java.lang.Object#toString()
      */
     public String toString() {
         return getClass().getName() + " [" + getQualifiedName() + "]";

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/DummyClass.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/DummyClass.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/DummyClass.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/DummyClass.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
@@ -24,9 +26,14 @@
 /**
  * A stub symbol that is used to temporarily hold the name of a class
  * until it can be properly resolved
+ *
+ * @version $Id: $
  */
 public class DummyClass extends ClassDef implements Externalizable {
 
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( DummyClass.class );
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -48,9 +55,9 @@
 
     /**
      * Constructor to create a placeholder class object
-     * 
-     * @param name 
-     * @param occ  
+     *
+     * @param name
+     * @param occ
      */
     public DummyClass(String name, Occurrence occ) {
         super(name, occ, null, null, null);
@@ -59,60 +66,54 @@
     /**
      * Constructor to create a placeholder class object
      * This version provides a means to set the package containing the class
-     * 
-     * @param name        
-     * @param occ         
-     * @param packageName 
+     *
+     * @param name
+     * @param occ
+     * @param packageName
      */
     public DummyClass(String name, Occurrence occ, String packageName) {
 
         super(name, occ, null, null, null);
 
         this.packageName = packageName;
-
-        // if (name.equals("SymbolTable"))
-        // new Exception("occ="+occ).printStackTrace();
-        // System.out.println("DummyClass packageName="+packageName);
     }
 
     /**
      * Get the name of the package in which this class is defined
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getPackage() {
         return packageName;
     }
 
     /**
-     * Write information about this unresolved class to the tagList
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ClassDef#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
-        System.out.println(getQualifiedName() + " (Undefined Class/Interface)");
-        System.out.println(getReferences());
+        if ( log.isInfoEnabled() )
+        {
+            log.info( getQualifiedName() + " (Undefined Class/Interface)");
+            log.info( getReferences());
+        }
     }
 
     /**
-     * Persist this object
-     * 
-     * @param out 
-     * @throws IOException 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ClassDef#writeExternal(java.io.ObjectOutput)
      */
     public void writeExternal(ObjectOutput out) throws IOException {
 
-        // System.out.println("persisting DummyClass "+getName());
+        if (log.isDebugEnabled())
+        {
+            log.debug("writeExternal(ObjectOutput) - getName()" + getName());
+        }
+
         out.writeObject(getName());
         out.writeObject(packageName);
     }
 
     /**
-     * Restore this object
-     * 
-     * @param in 
-     * @throws IOException            
-     * @throws ClassNotFoundException 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ClassDef#readExternal(java.io.ObjectInput)
      */
     public void readExternal(ObjectInput in)
             throws IOException, ClassNotFoundException {

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTag.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,8 @@
 
 /**
  * An occurrence of an HTML Tag in a file
+ *
+ * @version $Id: $
  */
 public class HTMLTag implements JSComparable {
 
@@ -42,9 +44,6 @@
     /** The end column of the occurrence */
     private int endColumn;
 
-    /** Character num of start of token */
-    private int charNum = 0;
-
     /** The text for the tag */
     private String replaceText;
 
@@ -72,8 +71,8 @@
 
     /**
      * Method getLine
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getLine() {
         return line;
@@ -81,8 +80,8 @@
 
     /**
      * Method getStartColumn
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getStartColumn() {
         return startColumn;
@@ -90,8 +89,8 @@
 
     /**
      * Method getEndColumn
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getEndColumn() {
         return endColumn;
@@ -99,8 +98,8 @@
 
     /**
      * Method getFile
-     * 
-     * @return 
+     *
+     * @return
      */
     public File getFile() {
         return file;
@@ -108,8 +107,8 @@
 
     /**
      * Method getText
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getText() {
         return replaceText;
@@ -117,8 +116,8 @@
 
     /**
      * Method getPackageName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getPackageName() {
         return packageName;
@@ -126,8 +125,8 @@
 
     /**
      * Method getLength
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getLength() {
         return length;
@@ -135,8 +134,8 @@
 
     /**
      * Method isComment
-     * 
-     * @return 
+     *
+     * @return
      */
     public boolean isComment() {
         return (type == TYPE_COMMENT);
@@ -144,26 +143,26 @@
 
     /**
      * Method isLiteral
-     * 
-     * @return 
+     *
+     * @return
      */
     public boolean isLiteral() {
         return (type == TYPE_LITERAL);
     }
-    
+
     /**
      * Method isKeyword
-     * 
-     * @return 
+     *
+     * @return
      */
     public boolean isKeyword() {
         return (type == TYPE_KEYWORD);
     }
-    
+
     /**
      * Method getNumBreaks
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getNumBreaks() {
         return numBreaks;
@@ -171,8 +170,8 @@
 
     /**
      * Method getOrigLength
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getOrigLength() {
         return origLength;
@@ -180,15 +179,13 @@
 
     /**
      * Constructor to define a new tag
-     * 
-     * @param o           
-     * @param origText    
-     * @param replaceText 
+     *
+     * @param o
+     * @param origText
+     * @param replaceText
      */
     HTMLTag(Occurrence o, String origText, String replaceText) {
 
-        // if (origText.equals("SymbolTable"))
-        // new Exception("occ="+o+" origText="+origText+" replaceText="+replaceText).printStackTrace();
         this.file = o.getFile();
         this.line = o.getLine();
         this.startColumn = o.getColumn();
@@ -208,19 +205,17 @@
 
     /**
      * Constructor to define a new tag
-     * 
-     * @param f           
-     * @param l           
-     * @param c           
-     * @param packageName 
-     * @param origText    
-     * @param replaceText 
+     *
+     * @param f
+     * @param l
+     * @param c
+     * @param packageName
+     * @param origText
+     * @param replaceText
      */
     HTMLTag(File f, int l, int c, String packageName, String origText,
             String replaceText) {
 
-        // if (origText.equals("SymbolTable"))
-        // new Exception().printStackTrace();
         this.file = f;
         this.line = l;
         this.startColumn = c;
@@ -240,12 +235,12 @@
 
     /**
      * Constructor for comment.  Doesn't store text
-     * 
-     * @param f           
-     * @param l           
-     * @param c           
-     * @param packageName 
-     * @param length      
+     *
+     * @param f
+     * @param l
+     * @param c
+     * @param packageName
+     * @param length
      */
     HTMLTag(File f, int l, int c, String packageName, int length) {
 
@@ -259,12 +254,12 @@
 
     /**
      * Constructor for comment.  Doesn't store text
-     * 
-     * @param f           
-     * @param l           
-     * @param c           
-     * @param packageName 
-     * @param length      
+     *
+     * @param f
+     * @param l
+     * @param c
+     * @param packageName
+     * @param length
      */
     HTMLTag(File f, int l, int c, String packageName, int length, int type) {
 
@@ -275,11 +270,9 @@
         this.packageName = packageName;
         this.type = type;
     }
-    
+
     /**
-     * return a string representation of the occurrence
-     * 
-     * @return 
+     * @see java.lang.Object#toString()
      */
     public String toString() {
         return "HTMLTag [" + file + "," + line + "," + startColumn + "-"
@@ -287,10 +280,7 @@
     }
 
     /**
-     * Method compareTo
-     * 
-     * @param o 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.util.JSComparable#compareTo(java.lang.Object)
      */
     public int compareTo(Object o) {
 

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTagContainer.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTagContainer.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTagContainer.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HTMLTagContainer.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,8 @@
 
 /**
  * HTMLTagContainer contains a mapping from files to lists of HTMLTags.
+ *
+ * @version $Id: $
  */
 public class HTMLTagContainer {
 
@@ -35,8 +37,8 @@
 
     /**
      * Method getFileTable
-     * 
-     * @return 
+     *
+     * @return
      */
     public Hashtable getFileTable() {
         return _fileTable;
@@ -44,8 +46,8 @@
 
     /**
      * Method elements
-     * 
-     * @return 
+     *
+     * @return
      */
     public Enumeration elements() {
         return (_fileTable.elements());
@@ -53,8 +55,8 @@
 
     /**
      * Method addElement
-     * 
-     * @param t 
+     *
+     * @param t
      */
     public void addElement(HTMLTag t) {
 

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HasImports.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HasImports.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HasImports.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/HasImports.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,10 +16,18 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 /**
  * An abstract class representing a symbol that can import packages.
+ *
+ * @version $Id: $
  */
 abstract class HasImports extends ScopedDef {
+    /**
+    * Logger for this class
+    */
+    private static final Logger log = Logger.getLogger( HasImports.class );
 
     // ==========================================================================
     // ==  Class Variables
@@ -40,10 +48,10 @@
 
     /**
      * Constructor to set up an object that can have imports
-     * 
-     * @param name        
-     * @param occ         
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param parentScope
      */
     HasImports(String name, // name of the symbol
                Occurrence occ, // where it's defined
@@ -53,20 +61,24 @@
 
     /**
      * Tell the symbol table that we are done with our imports
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void closeImports(SymbolTable symbolTable) {
 
-        // System.out.println("Closing imports");
+        if (log.isDebugEnabled())
+        {
+            log.debug("closeImports(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         symbolTable.closeImports();
     }
 
     /**
      * Ask if this is a toplevel class or not
      * This is true if the parentScope is a package
-     * 
-     * @return 
+     *
+     * @return
      */
     boolean isTopLevel() {
         return (getParentScope() instanceof PackageDef);
@@ -74,23 +86,29 @@
 
     /**
      * Tell the symbol table that we need to import some classes
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void openImports(SymbolTable symbolTable) {
 
-        // System.out.println("Opening imports");
+        if (log.isDebugEnabled())
+        {
+            log.debug("openImports(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         symbolTable.openImports(imports);
     }
 
     /**
-     * Resolve any referenced symbols
-     * 
-     * @param symbolTable 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ScopedDef#resolveTypes(org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable)
      */
     void resolveTypes(SymbolTable symbolTable) {
 
-        // System.out.println("Resolving imports");
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveTypes(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         // this was commented out.  Why?
         // if (imports != null)            // resolve imported classes/packages
         // imports.resolveTypes(symbolTable);
@@ -104,13 +122,15 @@
     }
 
     /**
-     * Resolve any referenced symbols
-     * 
-     * @param symbolTable 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ScopedDef#resolveRefs(org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable)
      */
     void resolveRefs(SymbolTable symbolTable) {
 
-        // System.out.println("Resolving imports");
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveRefs(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         // this was commented out.  Why?
         // if (imports != null)            // resolve imported classes/packages
         // imports.resolveRefs(symbolTable);
@@ -125,8 +145,8 @@
 
     /**
      * Set the list of imported classes/packages
-     * 
-     * @param imports 
+     *
+     * @param imports
      */
     void setImports(JavaHashtable imports) {
         this.imports = imports;

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaHashtable.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaHashtable.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaHashtable.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaHashtable.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,14 +16,23 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import java.util.Enumeration;
 
 /**
  * An extension of the java.util.Hashtable that is used to
  * add some simple looup and type resolution
+ *
+ * @version $Id: $
  */
 class JavaHashtable extends java.util.Hashtable {
 
+    private static final long serialVersionUID = 3317424596680650586L;
+
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( JavaHashtable.class );
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -34,15 +43,6 @@
     /** Field resolvingRefs */
     private boolean resolvingRefs = false;
 
-    /** Field CLASS */
-    private static final int CLASS = 0;
-
-    /** Field INTERFACE */
-    private static final int INTERFACE = 1;
-
-    /** Field EITHER */
-    private static final int EITHER = 2;
-
     // ==========================================================================
     // ==  Methods
     // ==========================================================================
@@ -56,8 +56,8 @@
 
     /**
      * Generate tag info for elements
-     * 
-     * @param tagList 
+     *
+     * @param tagList
      */
     void tagElements(HTMLTagContainer tagList) {
 
@@ -70,11 +70,16 @@
 
     /**
      * Resolve the types of dummy elements in the hash table
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void resolveTypes(SymbolTable symbolTable) {
 
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveTypes(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         if (!resolving) {
             resolving = true;
 
@@ -84,27 +89,37 @@
             while (e.hasMoreElements()) {
                 Definition d = (Definition) e.nextElement();
 
-                // System.out.println("JHT:resolving "+d.getName());
-                // System.out.println("className="+d.getClass().getName());
+                if (log.isDebugEnabled())
+                {
+                    log.debug("resolveTypes(SymbolTable) - resolving "+d.getName());
+                    log.debug("resolveTypes(SymbolTable) - className="+d.getClass().getName());
+                }
+
                 // if the element is a Dummy class or dummy interface, we
                 // will replace it with the real definition
                 if (d instanceof DummyClass) {
-                    if (d.getName().endsWith("SymbolTable")) {
-                        new Exception().printStackTrace();
-                    }
 
-                    System.out.println("Resolving DummyClass:" + d.getName());
+                    if ( log.isInfoEnabled() )
+                    {
+                        log.info( "Resolving DummyClass:" + d.getName());
+                    }
 
                     Definition newD;
 
                     // get its package name and look up the class/interace
                     String pkg = ((DummyClass) d).getPackage();
 
-                    System.out.println("pkg " + pkg);
+                    if ( log.isInfoEnabled() )
+                    {
+                        log.info( "pkg " + pkg);
+                    }
 
                     newD = symbolTable.lookupDummy(d);
 
-                    System.out.println("newD = " + newD);
+                    if ( log.isInfoEnabled() )
+                    {
+                        log.info( "newD = " + newD);
+                    }
 
                     // if we found the class/interface,
                     // add a reference to it, and replace the current def
@@ -126,12 +141,16 @@
 
     /**
      * Resolve the types of dummy elements in the hash table
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     void resolveRefs(SymbolTable symbolTable) {
 
-        // System.out.println("JavaHashTable:resolveRefs");
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveRefs(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         if (!resolvingRefs) {
             resolvingRefs = true;
 
@@ -149,8 +168,8 @@
     /**
      * Accept a visitor (Visitor design pattern).  Calls
      * accept method on each element.
-     * 
-     * @param visitor 
+     *
+     * @param visitor
      */
     public void accept(Visitor visitor) {
 
@@ -162,13 +181,4 @@
             d.accept(visitor);
         }
     }
-
-    // // DEBUG METHOD
-    // public Object put(Object key, Object value)
-    // {
-    // if (value instanceof ClassDef) {
-    // System.out.println("Adding "+key+" to "+this);
-    // }
-    // return super.put(key,value);
-    // }
 }

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaStack.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaStack.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaStack.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaStack.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,12 +16,21 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 /**
  * An extended Stack class to provide simple lookup and type
  * resolution methods
+ *
+ * @version $Id: $
  */
 class JavaStack extends java.util.Stack {
 
+    private static final long serialVersionUID = -3104650488343130699L;
+
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( JavaStack.class );
+
     // ==========================================================================
     // ==  Methods
     // ==========================================================================
@@ -34,8 +43,8 @@
 
     /**
      * Find the class definition in the stack closest to the top
-     * 
-     * @return 
+     *
+     * @return
      */
     Definition findTopmostClass() {
 
@@ -54,10 +63,10 @@
     /**
      * a wrapper to lookup a non-method -- calls the real lookup
      * method passing -1 for num parameters (meaning no parameters)
-     * 
-     * @param name 
-     * @param type 
-     * @return 
+     *
+     * @param name
+     * @param type
+     * @return
      */
     Definition lookup(String name, Class type) {
         return lookup(name, -1, type);
@@ -65,11 +74,11 @@
 
     /**
      * Lookup a method in the stack
-     * 
-     * @param name      
-     * @param numParams 
-     * @param type      
-     * @return 
+     *
+     * @param name
+     * @param numParams
+     * @param type
+     * @return
      */
     Definition lookup(String name, int numParams, Class type) {
 
@@ -79,17 +88,27 @@
         for (int i = size() - 1; i > -1; i--) {
             Definition ld = (Definition) elementAt(i);
 
-            // System.out.println("JavaStack:looking in "+ld.getName());
+            if (log.isDebugEnabled())
+            {
+                log.debug("lookup(String, int, Class) - looking in "+ld.getName());
+            }
+
             Definition d = ld.lookup(name, numParams, type);
 
             if (d != null) {
 
-                // System.out.println("JavaStack.lookup returning "+d+" type="+type);
+                if (log.isDebugEnabled())
+                {
+                    log.debug("lookup(String, int, Class) - returning "+d+" type="+type);
+                }
                 return d;
             }
         }
 
-        // System.out.println("JavaStack.lookup returning null");
+        if (log.isDebugEnabled())
+        {
+            log.debug("lookup(String, int, Class) - returning null");
+        }
         return null;
     }
 }

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaVector.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaVector.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaVector.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/JavaVector.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import org.apache.forrest.forrestdoc.java.src.xref.JavaToken;
 
 import java.io.FileWriter;
@@ -28,10 +30,15 @@
 /**
  * An extended Vector class to provide simple lookup and type resolution
  * methods
+ *
+ * @version $Id: $
  */
 public class JavaVector extends java.util.Vector
         implements java.io.Externalizable {
 
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( JavaVector.class );
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -55,8 +62,8 @@
 
     /**
      * Add a new element to the vector (used for debugging)
-     * 
-     * @param o 
+     *
+     * @param o
      */
     public void addElement(Definition o) {
 
@@ -69,9 +76,9 @@
 
     /**
      * get an element from the
-     * 
-     * @param name 
-     * @return 
+     *
+     * @param name
+     * @return
      */
     public Definition getElement(String name) {
 
@@ -90,8 +97,8 @@
 
     /**
      * Write information about each element in the vector to the report,
-     * 
-     * @param tagList 
+     *
+     * @param tagList
      */
     void generateTags(HTMLTagContainer tagList) {
 
@@ -104,8 +111,8 @@
 
     /**
      * Method generateReferences
-     * 
-     * @param output 
+     *
+     * @param output
      */
     void generateReferences(FileWriter output) {
 
@@ -124,12 +131,16 @@
 
     /**
      * Resolve references that are stored as JavaTokens
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     public void resolveRefs(SymbolTable symbolTable) {
 
-        // System.out.println("JavaVector:resolveRefs");
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveRefs(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         if (!resolvingRefs) {
             resolvingRefs = true;
 
@@ -139,7 +150,11 @@
             while (e.hasMoreElements()) {
                 JavaToken t = (JavaToken) e.nextElement();
 
-                // System.out.println("!resolve "+t.getText()+" file="+t.getFile().getAbsolutePath()+":"+t.getLine());
+                if (log.isDebugEnabled())
+                {
+                    log.debug("resolveRefs(SymbolTable) - resolve "+t.getText()+" file="+t.getFile().getAbsolutePath()+":"+t.getLine());
+                }
+
                 Definition d = symbolTable.lookup(t.getText(),
                         t.getParamCount(), null);
 
@@ -149,7 +164,10 @@
 
                 if (d != null) {
 
-                    // System.out.println("Found reference:"+d.getQualifiedName());
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("resolveRefs(SymbolTable) - Found reference:"+d.getQualifiedName());
+                    }
                     d.addReference(new Occurrence(t.getFile(), t.getLine(),
                             t.getColumn(),
                             t.getPackageName(),
@@ -157,17 +175,21 @@
                             t.getMethodName()));
                     d.resolveRefs(symbolTable);
                 }
-
-                // else
-                // System.out.println("Could not resolve "+t.getText());
+                else
+                {
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("resolveRefs(SymbolTable) - Could not resolve "+t.getText());
+                    }
+                }
             }
         }
     }
 
     /**
      * Resolve the types of dummy elements in the vector
-     * 
-     * @param symbolTable 
+     *
+     * @param symbolTable
      */
     public void resolveTypes(SymbolTable symbolTable) {
 
@@ -182,12 +204,18 @@
                 if (d instanceof DummyClass) {
                     String pkg = ((DummyClass) d).getPackage();
 
-                    // System.out.println("JavaVector.resolveTypes: resolving pkg="+pkg+" name="+d.getName());
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("resolveTypes(SymbolTable) - resolving pkg="+pkg+" name="+d.getName());
+                    }
                     Definition newD = symbolTable.lookupDummy(d);
 
                     if (newD != null) {
 
-                        // System.out.println("JavaVector.resolveTypes: resolved pkg="+pkg+" name="+d.getName());
+                        if (log.isDebugEnabled())
+                        {
+                            log.debug("resolveTypes(SymbolTable) - resolved pkg="+pkg+" name="+d.getName());
+                        }
                         newD.addReference(d.getOccurrence());
                         removeElement(d);
                         addElement(newD);
@@ -200,10 +228,7 @@
     }
 
     /**
-     * Method writeExternal
-     * 
-     * @param out 
-     * @throws IOException 
+     * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
      */
     public void writeExternal(ObjectOutput out) throws IOException {
 
@@ -227,11 +252,7 @@
     }
 
     /**
-     * Method readExternal
-     * 
-     * @param in 
-     * @throws IOException            
-     * @throws ClassNotFoundException 
+     * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
      */
     public void readExternal(ObjectInput in)
             throws IOException, ClassNotFoundException {
@@ -244,8 +265,8 @@
     /**
      * Visitor design pattern.  Call accept method of each
      * element.
-     * 
-     * @param visitor 
+     *
+     * @param visitor
      */
     public void accept(Visitor visitor) {
 

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/LabelDef.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/LabelDef.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/LabelDef.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/LabelDef.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -18,19 +18,23 @@
 
 /**
  * A label that appears in the source file.
+ *
+ * @version $Id: $
  */
 class LabelDef extends Definition {
 
+    private static final long serialVersionUID = -2054703202457275137L;
+
     // ==========================================================================
     // ==  Methods
     // ==========================================================================
 
     /**
      * Constructor to create a new label symbol
-     * 
-     * @param name        
-     * @param occ         
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param parentScope
      */
     LabelDef(String name, // name of the label
              Occurrence occ, // where it was defined
@@ -39,9 +43,7 @@
     }
 
     /**
-     * Write information about the label to the tagList
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
 
@@ -52,10 +54,7 @@
     }
 
     /**
-     * Method getOccurrenceTag
-     * 
-     * @param occ 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#getOccurrenceTag(org.apache.forrest.forrestdoc.java.src.symtab.Occurrence)
      */
     public HTMLTag getOccurrenceTag(Occurrence occ) {
         return null;

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MethodDef.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MethodDef.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MethodDef.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MethodDef.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import java.io.Externalizable;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -26,9 +28,14 @@
 
 /**
  * A definition of a method in a class
+ *
+ * @version $Id: $
  */
 public class MethodDef extends ScopedDef implements TypedDef, Externalizable {
 
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( MethodDef.class );
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -56,17 +63,15 @@
      * Default constructor needs to be public for deserialization.
      */
     public MethodDef() {
-
-        // System.out.println("constructing MethodDef");
     }
 
     /**
      * Constructor to create a method definition object
-     * 
-     * @param name        
-     * @param occ         
-     * @param type        
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param type
+     * @param parentScope
      */
     MethodDef(String name, // the name of the method
               Occurrence occ, // where it was defined
@@ -77,18 +82,16 @@
         super(name, occ, parentScope);
 
         this.type = type;
-
-// System.out.println("constructing method "+name);
     }
 
     /**
      * Constructor to create a method definition object
-     * 
-     * @param name        
-     * @param className   
-     * @param occ         
-     * @param type        
-     * @param parentScope 
+     *
+     * @param name
+     * @param className
+     * @param occ
+     * @param type
+     * @param parentScope
      */
     MethodDef(String name, // the name of the method
               String className, // className (for constructor methods)
@@ -103,14 +106,12 @@
         } else {
             this.className = className;
         }
-
-        // System.out.println("constructing method "+name);
     }
 
     /**
      * Method getParameters
-     * 
-     * @return 
+     *
+     * @return
      */
     public Vector getParameters() {
         return parameters;
@@ -118,8 +119,8 @@
 
     /**
      * Method getExceptions
-     * 
-     * @return 
+     *
+     * @return
      */
     public Vector getExceptions() {
         return exceptions;
@@ -127,8 +128,8 @@
 
     /**
      * Method getClassName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getClassName() {
         return className;
@@ -136,8 +137,8 @@
 
     /**
      * Add a thrown exception to the method's exception list
-     * 
-     * @param excep 
+     *
+     * @param excep
      */
     void add(ClassDef excep) {
 
@@ -150,8 +151,8 @@
 
     /**
      * Add a parameter to the method's parameter list
-     * 
-     * @param param 
+     *
+     * @param param
      */
     void add(VariableDef param) {
 
@@ -164,8 +165,8 @@
 
     /**
      * Method getFullName
-     * 
-     * @return 
+     *
+     * @return
      */
     String getFullName() {
 
@@ -196,8 +197,8 @@
 
     /**
      * Find out how many parameters this method has
-     * 
-     * @return 
+     *
+     * @return
      */
     int getParamCount() {
 
@@ -209,9 +210,7 @@
     }
 
     /**
-     * Return the return type of the method
-     * 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.TypedDef#getType()
      */
     public Definition getType() {
         return type;
@@ -219,15 +218,20 @@
 
     /**
      * lookup the name as a local variable or local class in this class
-     * 
-     * @param name      
-     * @param numParams 
-     * @param type      
-     * @return 
+     *
+     * @param name
+     * @param numParams
+     * @param type
+     * @return
      */
     Definition lookup(String name, int numParams, Class type) {
 
-        // System.out.println("MethodDef:lookup:"+name+","+numParams);
+        if (log.isDebugEnabled())
+        {
+            log.debug("lookup(String, int, Class) - String name=" + name);
+            log.debug("lookup(String, int, Class) - String numParams=" + numParams);
+        }
+
         if (numParams == -1) {
 
             // look for it in the method's scope
@@ -255,9 +259,7 @@
     }
 
     /**
-     * Method generateReferences
-     * 
-     * @param output 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateReferences(java.io.FileWriter)
      */
     public void generateReferences(FileWriter output) {
 
@@ -302,20 +304,16 @@
 
             output.write("</p>");
         } catch (IOException e) {
+            log.error( "IOException: " + e.getMessage(), e );
         }
-        ;
     }
 
     /**
-     * Write information about this method to the report
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
 
         String methodName = getName();
-        String linkString;
-        String linkFileName;
 
         if ((methodName != null)
                 && (methodName.indexOf("~constructor~") >= 0)) {
@@ -340,22 +338,17 @@
 
         tagList.addElement(t);
 
-        String definerName = getOccurrence().getClassName();
-        
         if(parameters != null) {
             parameters.generateTags(tagList);
         }
-        
+
         if(elements != null){
             elements.tagElements(tagList);
         }
     }
 
     /**
-     * Method getOccurrenceTag
-     * 
-     * @param occ 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ScopedDef#getOccurrenceTag(org.apache.forrest.forrestdoc.java.src.symtab.Occurrence)
      */
     public HTMLTag getOccurrenceTag(Occurrence occ) {
 
@@ -385,13 +378,15 @@
     }
 
     /**
-     * Resolve references to other symbols for pass 2
-     * 
-     * @param symbolTable 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ScopedDef#resolveTypes(org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable)
      */
     void resolveTypes(SymbolTable symbolTable) {
 
-        // System.out.println("MethodDef.resolveTypes: resolving "+getFullName());
+        if (log.isDebugEnabled())
+        {
+            log.debug("resolveTypes(SymbolTable) - SymbolTable symbolTable=" + symbolTable);
+        }
+
         // if we have parameters and/or exceptions, resolve them
         if (parameters != null) {
             parameters.resolveTypes(symbolTable);
@@ -418,17 +413,15 @@
 
     /**
      * set the list of exceptions that this method can throw
-     * 
-     * @param exceptions 
+     *
+     * @param exceptions
      */
     void setExceptions(JavaVector exceptions) {
         this.exceptions = exceptions;
     }
 
     /**
-     * Method getClassScopeName
-     * 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#getClassScopeName()
      */
     String getClassScopeName() {
 
@@ -449,10 +442,7 @@
     }
 
     /**
-     * Method writeExternal
-     * 
-     * @param out 
-     * @throws java.io.IOException 
+     * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
      */
     public void writeExternal(ObjectOutput out) throws java.io.IOException {
 
@@ -472,11 +462,7 @@
     }
 
     /**
-     * Method readExternal
-     * 
-     * @param in 
-     * @throws ClassNotFoundException 
-     * @throws IOException            
+     * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
      */
     public void readExternal(ObjectInput in)
             throws ClassNotFoundException, IOException {
@@ -495,10 +481,7 @@
     }
 
     /**
-     * Visitor design pattern.  Let visitor visit this definition,
-     * then call accept method on this method's elements.
-     * 
-     * @param visitor 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#accept(org.apache.forrest.forrestdoc.java.src.symtab.Visitor)
      */
     public void accept(Visitor visitor) {
         visitor.visit(this);
@@ -506,9 +489,7 @@
     }
 
     /**
-     * Method toString
-     * 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#toString()
      */
     public String toString() {
 

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MultiDef.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MultiDef.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MultiDef.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/MultiDef.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -24,9 +24,13 @@
  * Because methods can be overloaded and member data can have the same name
  * as a method, we provide this dummy definition to hold a list of all
  * definitions in a scope with the same name.
+ *
+ * @version $Id: $
  */
 public class MultiDef extends Definition {
 
+    private static final long serialVersionUID = -4453495874767512434L;
+
     // ==========================================================================
     // ==  Class Variables
     // ==========================================================================
@@ -44,9 +48,9 @@
      * it will be replacing.
      * This is just a convenience form of the real constructor
      * that takes a Definition as the base for the new MultiDef
-     * 
-     * @param name   
-     * @param oldDef 
+     *
+     * @param name
+     * @param oldDef
      */
     MultiDef(String name, // the name of the definition
              Definition oldDef) {    // a standing def with its name
@@ -55,10 +59,10 @@
 
     /**
      * Constructor to create a new multidef object
-     * 
-     * @param name        
-     * @param occ         
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param parentScope
      */
     MultiDef(String name, // the name of the definition
              Occurrence occ, // where it was defined
@@ -72,24 +76,15 @@
 
     /**
      * Add a definition to the list of symbols with the same name
-     * 
-     * @param def 
+     *
+     * @param def
      */
     void addDef(Definition def) {
         defs.addElement(def);
     }
 
     /**
-     * Lookup a symbol in the list of symbols
-     * This is a rather lame approximation that just returns the first match
-     * based on number of parameters.  A real routine to perform this would
-     * use the best-fit parameter type matching algorithm described
-     * in the Java Language Specification
-     * 
-     * @param name      
-     * @param numParams 
-     * @param type      
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#lookup(java.lang.String, int, java.lang.Class)
      */
     Definition lookup(String name, // the name to locate
                       int numParams, // number of params
@@ -123,19 +118,14 @@
     }
 
     /**
-     * Write information about all the definitions contained within this to
-     * the tagList
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
         defs.generateTags(tagList);
     }
 
     /**
-     * Let definitions generate references
-     * 
-     * @param output 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateReferences(java.io.FileWriter)
      */
     public void generateReferences(FileWriter output) {
         defs.generateReferences(output);
@@ -143,17 +133,15 @@
 
     /**
      * Method getDefs
-     * 
-     * @return 
+     *
+     * @return
      */
     public Vector getDefs() {
         return defs;
     }
 
     /**
-     * Resolve references to other symbols
-     * 
-     * @param symbolTable 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#resolveTypes(org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable)
      */
     void resolveTypes(SymbolTable symbolTable) {
 
@@ -164,9 +152,7 @@
     }
 
     /**
-     * Resolve references to other symbols
-     * 
-     * @param symbolTable 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#resolveRefs(org.apache.forrest.forrestdoc.java.src.symtab.SymbolTable)
      */
     void resolveRefs(SymbolTable symbolTable) {
 
@@ -180,10 +166,7 @@
     }
 
     /**
-     * Method getOccurrenceTag
-     * 
-     * @param occ 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#getOccurrenceTag(org.apache.forrest.forrestdoc.java.src.symtab.Occurrence)
      */
     public HTMLTag getOccurrenceTag(Occurrence occ) {
         return null;

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Occurrence.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Occurrence.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Occurrence.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/Occurrence.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,8 @@
 
 /**
  * An occurrence of an indentifier in a file
+ *
+ * @version $Id: $
  */
 public class Occurrence implements java.io.Externalizable {
 
@@ -57,8 +59,8 @@
 
     /**
      * Method getLine
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getLine() {
         return line;
@@ -66,8 +68,8 @@
 
     /**
      * Method getColumn
-     * 
-     * @return 
+     *
+     * @return
      */
     public int getColumn() {
         return column;
@@ -75,8 +77,8 @@
 
     /**
      * Method getFile
-     * 
-     * @return 
+     *
+     * @return
      */
     public File getFile() {
         return file;
@@ -84,8 +86,8 @@
 
     /**
      * Method getPackageName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getPackageName() {
         return _packageName;
@@ -93,8 +95,8 @@
 
     /**
      * Method getClassName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getClassName() {
         return _className;
@@ -102,8 +104,8 @@
 
     /**
      * Method getMethodName
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getMethodName() {
         return _methodName;
@@ -111,8 +113,8 @@
 
     /**
      * Method getDefinition
-     * 
-     * @return 
+     *
+     * @return
      */
     public Definition getDefinition() {
         return _myDefinition;
@@ -120,8 +122,8 @@
 
     /**
      * Method setPackageName
-     * 
-     * @param packageName 
+     *
+     * @param packageName
      */
     public void setPackageName(String packageName) {
 
@@ -134,8 +136,8 @@
 
     /**
      * Method setClassName
-     * 
-     * @param className 
+     *
+     * @param className
      */
     public void setClassName(String className) {
 
@@ -148,8 +150,8 @@
 
     /**
      * Method setMethodName
-     * 
-     * @param methodName 
+     *
+     * @param methodName
      */
     public void setMethodName(String methodName) {
 
@@ -162,8 +164,8 @@
 
     /**
      * Method setDefinition
-     * 
-     * @param def 
+     *
+     * @param def
      */
     public void setDefinition(Definition def) {
         _myDefinition = def;
@@ -171,8 +173,8 @@
 
     /**
      * Method getOccurrenceTag
-     * 
-     * @return 
+     *
+     * @return
      */
     public HTMLTag getOccurrenceTag() {
 
@@ -189,9 +191,9 @@
 
     /**
      * Constructor to define a new occurrence
-     * 
-     * @param file 
-     * @param line 
+     *
+     * @param file
+     * @param line
      */
     Occurrence(File file, int line) {
         this.file = file;
@@ -200,10 +202,10 @@
 
     /**
      * Constructor to define a new occurrence
-     * 
-     * @param file   
-     * @param line   
-     * @param column 
+     *
+     * @param file
+     * @param line
+     * @param column
      */
     Occurrence(File file, int line, int column) {
 
@@ -214,11 +216,11 @@
 
     /**
      * Constructor to define a new occurrence
-     * 
-     * @param file        
-     * @param line        
-     * @param column      
-     * @param packageName 
+     *
+     * @param file
+     * @param line
+     * @param column
+     * @param packageName
      */
     Occurrence(File file, int line, int column, String packageName) {
 
@@ -233,13 +235,13 @@
 
     /**
      * Constructor to define a new occurrence
-     * 
-     * @param file        
-     * @param line        
-     * @param column      
-     * @param packageName 
-     * @param className   
-     * @param methodName  
+     *
+     * @param file
+     * @param line
+     * @param column
+     * @param packageName
+     * @param className
+     * @param methodName
      */
     Occurrence(File file, int line, int column, String packageName,
                String className, String methodName) {
@@ -261,8 +263,8 @@
 
     /**
      * Method getLinkReference
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getLinkReference() {
 
@@ -277,27 +279,22 @@
 
     /**
      * return a string representation of the occurrence
-     * 
-     * @return 
+     *
+     * @return
      */
     public String getLocation() {
         return "[" + file + ":" + line + ":" + column + "]";
     }
 
     /**
-     * return a string representation of the occurrence
-     * 
-     * @return 
+     * @see java.lang.Object#toString()
      */
     public String toString() {
         return "Occurrence [" + file + "," + line + "," + column + "]";
     }
 
     /**
-     * serialize
-     * 
-     * @param out 
-     * @throws IOException 
+     * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
      */
     public void writeExternal(ObjectOutput out) throws IOException {
 
@@ -310,14 +307,8 @@
         out.writeObject(_myDefinition);
     }
 
-    /* deserialize */
-
     /**
-     * Method readExternal
-     * 
-     * @param in 
-     * @throws IOException            
-     * @throws ClassNotFoundException 
+     * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
      */
     public void readExternal(ObjectInput in)
             throws IOException, ClassNotFoundException {

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PackageDef.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PackageDef.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PackageDef.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PackageDef.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  */
 package org.apache.forrest.forrestdoc.java.src.symtab;
 
+import org.apache.log4j.Logger;
+
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
@@ -28,19 +30,26 @@
 
 /**
  * Definition of a package.
+ *
+ * @version $Id: $
  */
 public class PackageDef extends ScopedDef implements java.io.Serializable {
 
+    private static final long serialVersionUID = 5247243972234423013L;
+
+    /** Logger for this class  */
+    private static final Logger log = Logger.getLogger( PackageDef.class );
+
     // ==========================================================================
     // ==  Methods
     // ==========================================================================
 
     /**
      * Constructor to create a package object
-     * 
-     * @param name        
-     * @param occ         
-     * @param parentScope 
+     *
+     * @param name
+     * @param occ
+     * @param parentScope
      */
     PackageDef(String name, // the name of the package
                Occurrence occ, // where it was defined (NULL)
@@ -58,7 +67,11 @@
                     new File(SymbolTable.getSymbolTable().getOutDirPath()
                     + File.separatorChar + relPath);
 
-            // System.out.println("checking for def files in "+outputDir.getAbsolutePath());
+            if (log.isDebugEnabled())
+            {
+                log.debug("PackageDef(String, Occurrence, ScopedDef) - checking for def files in "+outputDir.getAbsolutePath());
+            }
+
             FilenameFilter filter = new FilenameFilter() {
 
                 public boolean accept(File dir, String defName) {
@@ -69,15 +82,20 @@
 
             if (files != null) {
 
-                // System.out.println("def files are:");
+                if (log.isDebugEnabled())
+                {
+                    log.debug("PackageDef(String, Occurrence, ScopedDef) - def files are:");
+                }
                 for (int i = 0; i < files.length; i++) {
                     String filename = files[i].getName();
 
-                    // System.out.println("\t"+filename);
                     String className = filename.substring(0, filename.length()
                             - ".def".length());
 
-                    // System.out.println("className="+className);
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("PackageDef(String, Occurrence, ScopedDef) - filename="+filename+", className="+className);
+                    }
                     persistedDefs.put(className, files[i]);
                 }
             }
@@ -86,8 +104,8 @@
 
     /**
      * Method getDefinitions
-     * 
-     * @return 
+     *
+     * @return
      */
     public Hashtable getDefinitions() {
         return getElements();
@@ -95,18 +113,19 @@
 
     /**
      * Method persistDefinitions
-     * 
-     * @param path 
+     *
+     * @param path
      */
     public void persistDefinitions(String path) {
+        if (log.isDebugEnabled())
+        {
+            log.debug("persistDefinitions(String) - String path=" + path);
+        }
 
-        // System.out.println("\tpath="+path);
         Enumeration e;
         Definition d;
-        Occurrence o;
         String newPath;
         File currentFile = null;
-        Vector files = new Vector(20, 20);
 
         if (hasElements()) {
             JavaHashtable ht = getElements();
@@ -127,7 +146,10 @@
 
                         new File(currentFile.getParent()).mkdirs();
 
-                        // System.out.println("\tWriting "+currentFile.getAbsolutePath());
+                        if (log.isDebugEnabled())
+                        {
+                            log.debug("persistDefinitions(String) - Writing "+currentFile.getAbsolutePath());
+                        }
                         FileOutputStream fos =
                                 new FileOutputStream(currentFile);
                         ObjectOutputStream output = new ObjectOutputStream(fos);
@@ -137,7 +159,7 @@
                         output.close();
                         fos.close();
                     } catch (Exception ex) {
-                        ex.printStackTrace();
+                        log.error( "Exception: " + ex.getMessage(), ex );
                     }
                 }
             }
@@ -146,8 +168,8 @@
 
     /**
      * Method persistReferences
-     * 
-     * @param path 
+     *
+     * @param path
      */
     public void persistReferences(String path) {
 
@@ -166,9 +188,7 @@
     }
 
     /**
-     * Method accept
-     * 
-     * @param visitor 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#accept(org.apache.forrest.forrestdoc.java.src.symtab.Visitor)
      */
     public void accept(Visitor visitor) {
 
@@ -236,8 +256,8 @@
 
     /**
      * Method generateClassList
-     * 
-     * @return 
+     *
+     * @return
      */
     public Vector generateClassList() {
 
@@ -291,16 +311,10 @@
     }
 
     /**
-     * Generate HTML tags for this package
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
 
-        Enumeration e;
-        Definition d;
-        Occurrence o;
-
         // if we found any definitions in this package, report them
         if (hasElements()) {
             tagElements(tagList);
@@ -308,10 +322,7 @@
     }
 
     /**
-     * Method getOccurrenceTag
-     * 
-     * @param occ 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ScopedDef#getOccurrenceTag(org.apache.forrest.forrestdoc.java.src.symtab.Occurrence)
      */
     public HTMLTag getOccurrenceTag(Occurrence occ) {
         return null;
@@ -320,23 +331,28 @@
     // TBD: reimplement to search outputdir for this class if the class isn't already loaded
 
     /**
-     * Method lookup
-     * 
-     * @param name 
-     * @param type 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#lookup(java.lang.String, java.lang.Class)
      */
     Definition lookup(String name, Class type) {
 
-        boolean debug = false;    // name.endsWith("SymbolTable");
+        if (log.isDebugEnabled())
+        {
+            log.debug("lookup(String, Class) - String name=" + name);
+        }
 
-        // if (debug)      System.out.println("PackageDef.lookup "+name);
         Definition result = super.lookup(name, type);
 
-        // if (debug) System.out.println("PackageDef.lookup:super.lookup returned "+result);
+        if (log.isDebugEnabled())
+        {
+            log.debug("lookup(String, Class) - result=" + result);
+        }
         if ((result == null) || (result instanceof DummyClass)) {
 
-            // System.out.println(getName()+": PackageDef.lookup(\""+name+"\", \""+type.getName()+"\") returned "+(result == null ? "null" : result.getClass().getName()));
+            if (log.isDebugEnabled())
+            {
+                log.debug("lookup(String, Class) - " + getName() + ": PackageDef.lookup(\"" + name + "\", \""
+                    + type.getName() + "\") returned " + ( result == null ? "null" : result.getClass().getName() ));
+            }
             ClassDef classDef = ClassDef.findLoadedClass(getName(), name);
 
             if (classDef == null) {
@@ -350,17 +366,20 @@
             }
         }
 
-        // if (result == null) {
-        // System.out.println("not found: "+name);
-        // }
+        if (result == null) {
+            if (log.isDebugEnabled())
+            {
+                log.debug("lookup(String, Class) - not found: "+name);
+            }
+        }
         return result;
     }
 
     /**
      * Method loadClassDef
-     * 
-     * @param name 
-     * @return 
+     *
+     * @param name
+     * @return
      */
     public ClassDef loadClassDef(String name) {
 
@@ -369,10 +388,10 @@
 
         if (defFile != null) {
             try {
-
-                // new Exception("traceback").printStackTrace();
-                System.out.println("loading " + name + " from " + defFile);
-                System.out.flush();
+                if ( log.isInfoEnabled() )
+                {
+                    log.info( "loading " + name + " from " + defFile);
+                }
 
                 FileInputStream fis = new FileInputStream(defFile);
                 ObjectInputStream ois = new ObjectInputStream(fis);
@@ -382,9 +401,8 @@
                 ois.close();
                 fis.close();
 
-                // System.out.println("loaded Class "+name); System.out.flush();
             } catch (Exception ex) {
-                ex.printStackTrace();
+                log.error( "Exception: " + ex.getMessage(), ex );
             }
         }
 
@@ -393,9 +411,9 @@
 
     /**
      * Method writeObject
-     * 
-     * @param out 
-     * @throws java.io.IOException 
+     *
+     * @param out
+     * @throws java.io.IOException
      */
     private void writeObject(ObjectOutputStream out)
             throws java.io.IOException {
@@ -411,9 +429,7 @@
     }
 
     /**
-     * Method toString
-     * 
-     * @return 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.Definition#toString()
      */
     public String toString() {
 
@@ -434,13 +450,6 @@
 
         return str;
     }
-
-    // // DEBUG METHOD
-    // void add(Definition def)
-    // {
-    // System.out.println("adding "+def+" to package "+getName());
-    // super.add(def);
-    // }
 
     /** Field _currentPackPath */
     private static String _currentPackPath;

Modified: forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PrimitiveDef.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PrimitiveDef.java?view=diff&rev=556752&r1=556751&r2=556752
==============================================================================
--- forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PrimitiveDef.java (original)
+++ forrest/trunk/whiteboard/forrestdoc/src/java/org/apache/forrest/forrestdoc/java/src/symtab/PrimitiveDef.java Mon Jul 16 15:17:40 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -23,6 +23,8 @@
  * tool we don't actually perform any type conversions, but we thought it
  * would be a good example of how some constructs can be used in similar
  * ways, even though it might not appear like the proper model.
+ *
+ * @version $Id: $
  */
 class PrimitiveDef extends ClassDef {
 
@@ -32,10 +34,10 @@
 
     /**
      * Constructor to create a primitive type object
-     * 
-     * @param name        
-     * @param superClass  
-     * @param parentScope 
+     *
+     * @param name
+     * @param superClass
+     * @param parentScope
      */
     PrimitiveDef(String name, // the name of the primitive
                  ClassDef superClass, // the superclass (if applicable)
@@ -44,9 +46,7 @@
     }
 
     /**
-     * Write information about this primitive type to the tagList
-     * 
-     * @param tagList 
+     * @see org.apache.forrest.forrestdoc.java.src.symtab.ClassDef#generateTags(org.apache.forrest.forrestdoc.java.src.symtab.HTMLTagContainer)
      */
     public void generateTags(HTMLTagContainer tagList) {
 



Mime
View raw message