Bug 24502

Summary: AST: No binding for type accesses to a non-visible type
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: 2.1 M2   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Martin Aeschlimann CLA 2002-10-08 09:36:46 EDT
see bug 24449:
In this code all accesses to 'C' have binding due to the no-visible problem.

public class C {
  private class CInner {
  }
}

public class D extends C {
  public void goo() {
    C.CInner a;
    CInner b;
  }
}
Comment 1 Martin Aeschlimann CLA 2002-10-08 09:43:01 EDT
TestCase:
LocalCorrectionsQuickFixTest.testInvisibleTypeRequestedInDifferentPackage
Comment 2 Olivier Thomann CLA 2002-10-08 09:44:50 EDT
I will investigate.
Comment 3 Olivier Thomann CLA 2002-10-08 11:05:52 EDT
Do you mean all accesses to 'CInner'?
Comment 4 Olivier Thomann CLA 2002-10-08 11:08:32 EDT
In this case (C.CInner), I don't have any binding available in the compiler's
node. Therefore it is not possible to apply any visibility checks.
This problem won't be fixed.
I am investigating the second case 'CInner'.
Comment 5 Olivier Thomann CLA 2002-10-08 11:14:16 EDT
Same result for the second case. The single type reference corresponding to
'CInnner' has no binding. Therefore it is not possible to fix it.
Close as WONTFIX.
Comment 6 Olivier Thomann CLA 2002-10-08 11:39:48 EDT
Change target milestone.
Comment 7 Martin Aeschlimann CLA 2002-10-08 11:42:27 EDT
Test for the inner class reference:
testInvisibleTypeRequestedFromSuperClass

When I debug, there is a compiler type binding (ProblemReferenceBinding), which 
seems to be usable.
Comment 8 Olivier Thomann CLA 2002-10-08 11:49:36 EDT
I will try again with your test case.
Comment 9 Olivier Thomann CLA 2002-10-08 12:34:13 EDT
Your test case is fixed, but I still have a problem with the test.
junit.framework.AssertionFailedError: Wrong number of proposals, is: 0, expected: 1
	at junit.framework.Assert.fail(Assert.java:51)
	at junit.framework.Assert.assertTrue(Assert.java:38)
	at
org.eclipse.jdt.ui.tests.quickfix.QuickFixTest.assertNumberOf(QuickFixTest.java:54)
	at
org.eclipse.jdt.ui.tests.quickfix.LocalCorrectionsQuickFixTest.testInvisibleTypeRequestedFromSuperClass(LocalCorrectionsQuickFixTest.java:1014)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at junit.framework.TestCase.runTest(TestCase.java:166)
	at junit.framework.TestCase.runBare(TestCase.java:140)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:131)
	at junit.framework.TestSuite.runTest(TestSuite.java:173)
	at junit.framework.TestSuite.run(TestSuite.java:168)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:358)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:244)
	at
org.eclipse.pde.internal.junit.ui.RemotePluginTestRunner.main(RemotePluginTestRunner.java:30)
	at
org.eclipse.pde.internal.junit.ui.UITestApplication.runEventLoop(UITestApplication.java:34)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:1255)
	at
org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:775)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:247)
	at org.eclipse.core.launcher.Main.run(Main.java:703)
	at org.eclipse.core.launcher.Main.main(Main.java:539)

Comment 10 Olivier Thomann CLA 2002-10-08 12:43:58 EDT
Fixed and released in 2.1 stream. Regression tests added.
Comment 11 Olivier Thomann CLA 2002-10-08 12:44:12 EDT
Change resolution.
Comment 12 David Audel CLA 2002-10-17 10:30:59 EDT
Verified.