Bug 25250

Summary: Scrapbook shows wrong error message
Product: [Eclipse Project] JDT Reporter: David Whiteman <dlwhiteman>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description David Whiteman CLA 2002-10-23 10:44:27 EDT
I typed the following code in a scrapbook page, highlighted it, and 
selected "display":

java.awt.Frame f = new java.awt.Frame("");
java.lang.String b = f.getClass().getName();
int index = b.lastIndexOf('.');
b.substring(index+1, b.length);

The resulting message is "b cannot be resolved".  What I would have expected 
was a message indicating that the snippet didn't compile, or that length is not 
a field of "b".  The current message led me down a wrong path, thinking that I 
hadn't properly declared "b" somewhere, when in fact I had just failed to send 
the "length()" message to "b".
Comment 1 Darin Wright CLA 2002-11-13 10:15:27 EST
This message is coming from the CodeSnippetCompiler. Moving to JCORE.
Comment 2 Jerome Lanneluc CLA 2002-11-18 05:18:10 EST
CodeSnippetQualifiedNameReference.getOtherFieldBindings() was wrongly reporting 
an error on the scope, instead of reporting an invalid field access.

Fixed and added regression test NegativeCodeSnippetTest.testInvalidField().
Comment 3 David Audel CLA 2002-12-17 07:16:13 EST
Verified.