Bug 18042 - AST: Resolving failes with semicolon while loop body
Summary: AST: Resolving failes with semicolon while loop body
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-28 09:55 EDT by Martin Aeschlimann CLA
Modified: 2002-06-03 09:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2002-05-28 09:55:29 EDT
F1
1. create the folling code, try an organize inport on it.
2. The simple name 'InputStream' can not be resolved
3. Change the while loop body to i= null; -> resolving works


public class Test {
	void foo() {
		InputStream i= null;
		while(true) 
			;
	}
}
Comment 1 Olivier Thomann CLA 2002-05-28 12:24:03 EDT
I cannot reproduce in latest. Could you please give it a try with tomorrow's build and let me know if 
it is still boggus?
Comment 2 Martin Aeschlimann CLA 2002-05-29 05:38:03 EDT
it's still there in 20020528

I can reproduce it with the given code.

Add "import java.io.InputStream;"
Do an organize import on it and you will still ask you which InputStream
Set a breakpoint in OrganizeImportsOperation.process
and you will see that the simplename for 'InputStream' has no binding.
Comment 3 Martin Aeschlimann CLA 2002-05-29 05:49:51 EDT
I'm using jdk 1.4 that's why InputStream exists more than once.
Try List instead.
Comment 4 Olivier Thomann CLA 2002-05-29 19:26:29 EDT
I tried what you said.
1) I defined this class:
public class Test {
   void foo() {
      
InputStream i= null;
      while(true);
   }
}
2) I organized imports and I got several 
InputStream (I am using 1.4 also).
3) I choose java.io.InputStream and I got:
import 
java.io.InputStream;

public class Test {
   void foo() {
      InputStream i= null;
      
while(true);
   }
}
4) I tried again "Organize imports..." and I didn't have to choose again an 
"InputStream" class.

Then I tried the following test case:

package 
test0353;

import java.io.InputStream;

public class Test {
        void foo() {
                
InputStream i = null;
                while (true);
        }
}

I resolve the simple name "InputStream" and the 
simple type corresponding to this simple name and both resolution replied 
"java.io.InputStream". So I guess this has been fixed with the latest changes for 18255 or 
18138.
Let me know if you can still reproduce it when the fixes for these two bugs are in the build.
Comment 5 Olivier Thomann CLA 2002-05-29 19:28:34 EDT
I tried directly in 0529 and I couldn't reproduce it.
Please reopen if you can reproduce it on 
your side with latest build.
Comment 6 Philipe Mulet CLA 2002-06-03 09:51:14 EDT
This one is verified, found new bug 18708.
Verified