User: rinkrank
Date: 02/06/07 07:29:46
Modified: src/xjavadoc SourceClass.java
Log:
Making the map a class-member. Keeping it static would not let xjavadoc distinguish
between classes with same name and different package, like foo.Bar and bob.Bar. Only
the 1st would be used.
Revision Changes Path
1.30 +15 -5 xjavadoc/src/xjavadoc/SourceClass.java
Index: SourceClass.java
===================================================================
RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/SourceClass.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -w -r1.29 -r1.30
--- SourceClass.java 26 May 2002 20:31:05 -0000 1.29
+++ SourceClass.java 7 Jun 2002 14:29:45 -0000 1.30
@@ -7,6 +7,10 @@
import java.util.*;
import java.io.*;
import java.lang.reflect.Modifier;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
/**
* This class represents a class for which the source code is available
*
@@ -16,12 +20,12 @@
final class SourceClass extends AbstractClass
{
+
/**
* @todo-javadoc Describe the field
*/
public static int instanceCount = 0;
-
- private static Map _qualifiedClasses = new HashMap();
+ private final Log _log = LogFactory.getLog( getClass() );
/**
* @todo-javadoc Describe the field
*/
@@ -30,6 +34,8 @@
* @todo-javadoc Describe the field
*/
private final long _lastModified;
+
+ private Map _qualifiedClasses = new HashMap();
/**
* @todo-javadoc Describe the field
*/
@@ -59,6 +65,12 @@
public SourceClass( AbstractClass containingClass, String qualifiedName, File
sourceFile )
{
super( containingClass, qualifiedName );
+
+ if( containingClass == null && qualifiedName == null )
+ {
+ throw new IllegalArgumentException( "qualifiedName can't be
null for outer classes!" );
+ }
+
// We need to check if sourceFile is null. All inner classes will have
it set to null
if( sourceFile != null )
{
@@ -224,7 +236,7 @@
if( !isWriteable() )
{
// parsed with simple parser
- error( "attempt to save not writable class: " + toString() );
+ _log.error( "attempt to save not writable class: " +
toString() );
throw new UnsupportedOperationException( "Can't save classes
that are parsed with simpleparser" );
}
NodePrinter.print( _compilationUnit, out );
@@ -269,8 +281,6 @@
*/
public XClass qualify( final String unqualifiedClassName )
{
- //System.out.println( "qualify " + unqualifiedClassName );
-
XClass result = null;
result = ( XClass ) _qualifiedClasses.get( unqualifiedClassName );
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel