Bug 25250 - Scrapbook shows wrong error message
Summary: Scrapbook shows wrong error message
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 normal (vote)
Target Milestone: 2.1 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-23 10:44 EDT by David Whiteman CLA
Modified: 2002-12-17 07:16 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.