Bug 24511

Summary: AST: Resolve on non-visible import
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 11:08:53 EDT
20021001
package pack1;
class W {
}

package pack2;
import pack1.W;
class D {
}

In D, 'pack1.W' is marked as non-visible. When I get the binding of the 
qulified name it is null. Could it be changed to return the type?

TestCase for this is
LocalCorrectionsQuickFixTest.testInvisibleImport
Comment 1 Olivier Thomann CLA 2002-10-08 11:28:24 EDT
I will investigate.
Comment 2 Olivier Thomann CLA 2002-10-08 12:35:01 EDT
Fixed and released in 2.1 stream. Regression test added.
I still have an error with your 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.testInvisibleImport(LocalCorrectionsQuickFixTest.java:1057)
	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 3 Olivier Thomann CLA 2002-10-08 12:55:16 EDT
Fixed and released in 2.1 stream. Regression test added.
Comment 4 David Audel CLA 2002-10-17 10:31:04 EDT
Verified.