/[classpath]/gjdoc/src/gnu/classpath/tools/gjdoc/ClassDocImpl.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/gjdoc/ClassDocImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by gnu_andrew, Wed Apr 20 18:22:06 2005 UTC revision 1.24 by julian, Mon May 23 22:36:22 2005 UTC
# Line 99  public class ClassDocImpl Line 99  public class ClassDocImpl
99    
100     private Map findClassCache = new HashMap();     private Map findClassCache = new HashMap();
101    
102       public ClassDoc findClass(String className, String dimension)
103       {
104          ClassDoc cached = (ClassDoc)findClassCache.get(className + dimension);
105          if (null != cached) {
106             return cached;
107          }
108          else {
109             ClassDoc classDoc = findClass(className);
110    
111             if (null!=classDoc) {
112                try {
113                   if (classDoc.dimension().equals(dimension)) {
114                      return classDoc;
115                   }
116                   else {
117                      ClassDoc rc = (ClassDoc) ((WritableType)classDoc).clone();
118                      ((WritableType)rc).setDimension(dimension);
119                      findClassCache.put(className + dimension, rc);
120                      return rc;
121                   }
122                }
123                catch (CloneNotSupportedException e) {
124                   throw new RuntimeException(e);
125                }
126             }
127             else {
128                return null;
129             }
130          }
131       }
132    
133     public ClassDoc findClass(String className)     public ClassDoc findClass(String className)
134     {     {
135        String qualifiedName = Main.getRootDoc().resolveClassName(className, this);        String qualifiedName = Main.getRootDoc().resolveClassName(className, this);
# Line 683  public class ClassDocImpl Line 714  public class ClassDocImpl
714           typeName=typeName.substring(0,ndx).trim();           typeName=typeName.substring(0,ndx).trim();
715        }        }
716    
717        ClassDoc classDoc = findClass(typeName);        ClassDoc classDoc = findClass(typeName, dim);
718        if (null!=classDoc) {        if (null != classDoc) {
719           try {           return classDoc;
             if (classDoc.dimension().equals(dim)) {  
                return classDoc;  
             }  
             else {  
                Type rc = (Type) ((WritableType)classDoc).clone();  
                ((WritableType)rc).setDimension(dim);  
                return rc;  
             }  
          }  
          catch (CloneNotSupportedException e) {  
             throw new ParseException(e.toString());  
          }  
720        }        }
721    
722        Type type = (Type)typeMap.get(typeName+dim);        Type type = (Type)typeMap.get(typeName+dim);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26