cp-tools-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cp-tools-discuss] Removing debug output from DocImpl and remaining


From: Mark Wielaard
Subject: Re: [Cp-tools-discuss] Removing debug output from DocImpl and remaining Classpath errors
Date: 08 May 2002 01:42:59 +0200

Hi,

On Tue, 2002-05-07 at 00:40, Mark Wielaard wrote:

> With this applied the only errors/warnings I get with Classpath java.*
> subpackages are the following which I have not tracked down yet:
> 
> WARNING: Can't find scheduled class 'AccessibleAWTPanel' in context
> 'ClassDoc{java.applet.Applet.AccessibleApplet}'
> WARNING: Can't find scheduled class 'AccessibleAWTComponent' in context
> 'ClassDoc{java.awt.Container.AccessibleAWTContainer.AccessibleContainerHandler}'
> WARNING: Can't find scheduled class 'AccessibleAWTContainer' in context
> 'ClassDoc{java.awt.Panel.AccessibleAWTPanel}'
> WARNING: Can't find scheduled class 'HashEntry' in context
> 'ClassDoc{java.util.LinkedHashMap.LinkedHashEntry}'

I think I found what goes wrong in these casses. They are all cases of
an inner class extending an inner class of the parent of the enclosing
class. But the super class of the outer class is still a ClassDocProxy
when loadScheduledClass() is called.

The following patch seems to fix it by explicitly resolving the super
classes and then rescheduling the class. But I am not completely sure
this is always the correct thing to do. The code is still a bit
mysterious to me

Cheers,

Mark
Index: src/gnu/classpath/tools/gjdoc/Main.java
===================================================================
RCS file: /cvsroot/cp-tools/gjdoc/src/gnu/classpath/tools/gjdoc/Main.java,v
retrieving revision 1.5
diff -u -r1.5 Main.java
--- src/gnu/classpath/tools/gjdoc/Main.java     24 Feb 2002 05:58:46 -0000      
1.5
+++ src/gnu/classpath/tools/gjdoc/Main.java     7 May 2002 23:39:42 -0000
@@ -1114,7 +1114,36 @@
            Parser.getInstance().processSourceFile(file, false);
         }
         else {
-           printWarning("Can't find scheduled class '"+scheduledClassName+"' 
in context '"+scheduledClassContext+"'");
+           // It might be an inner class of one of the outer/super classes.
+           // But we can only check that when they are all fully loaded.
+           boolean retryLater = false;
+
+           ClassDoc cc = scheduledClassContext.containingClass();
+           while (cc != null && !retryLater) {
+               System.err.println("Looping on: " + cc);
+               ClassDoc sc = cc.superclass();
+               while (sc != null && !retryLater) {
+                   System.err.println("  Looping on: " + sc);
+                   if (sc instanceof ClassDocProxy) {
+                       ((ClassDocImpl)cc).resolve();
+                       retryLater = true;
+                   }
+                   sc = sc.superclass();
+               }
+               cc = cc.containingClass();
+           }
+
+           if (retryLater) {
+               System.err.println("Retrying: " + scheduledClassContext
+                               + ", " + scheduledClassName);
+               scheduleClass(scheduledClassContext, scheduledClassName);
+           }
+           else
+               printWarning("Can't find scheduled class '"
+                            + scheduledClassName
+                            + "' in context '"
+                            + scheduledClassContext.qualifiedName()
+                            + "'");
         }
       }
    }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]