Bug 34002

Summary: Bogus compiler error "cannot be resolved" in editor for 2nd top-level class in compilation unit
Product: [Eclipse Project] JDT Reporter: Eric Nickell <nickell>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 2.1   
Target Milestone: 3.2 M4   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Eric Nickell CLA 2003-03-06 13:36:29 EST
If one has a second top-level class in a compilation unit, and another class in
the package makes a reference to it, the Java editor says that it cannot resolve
the type name, although the Package Explorer indicates that it compiles cleanly.

I find it quite unnerving to have red ticks next to my scroll bar for legal code.

I'm running I20030227/linux/gtk on a dual-processor 2GHz pentium.

Here is a test case (in two compilation units):

/*
 * Created on Mar 6, 2003 by Eric Nickell.
 * 
 * Copyright (C) 2003, Palo Alto Research Center, Incorporated. All rights reserved.
 */
package buildI20030227.editorcantseeclass;

/**
 * @author nickell
 */
public class FirstClass {

}

class SecondClass {
}


/*
 * Created on Mar 6, 2003 by Eric Nickell.
 * 
 * Copyright (C) 2003, Palo Alto Research Center, Incorporated. All rights reserved.
 */
package buildI20030227.editorcantseeclass;

/**
 * @author nickell
 */
public class ThirdClass {
	SecondClass thisReferenceToSecondClassIsFlaggedAsErrorByEditorButIsReallyLegal;
}
Comment 1 Philipe Mulet CLA 2003-03-06 17:34:23 EST

*** This bug has been marked as a duplicate of 32505 ***
Comment 2 Frederic Fusier CLA 2007-04-02 07:24:36 EDT
Verified for 3.2 using M20060629-1905.