I reported something similar against 621 but never saw a response. Here it
is again, hoping for some JetBrains feedback!
-sms
--------
Date: May 9, 2002
Subj: 621 - IDEA reports false positive & negative during syntax check
621 / win2k / sp2 / jdk131_03
Here is a small test class that shows something is wrong in IDEA's syntax
check and error highlighting with respect to scope checking:
import javax.swing.JTextField;
public class Test {
JTextField text = new JTextField();
public Test() {
String text = "" + text.length(); // 1 - length is marked red
System.out.println("text = " + text);
}
public void test() {
String text = text.getText(); // 2 - no error indicated
System.out.println("text = " + text);
}
}
Yes this is contrived and wacky, but it points out an issue from a couple of
points of view.
1) the word "length" is marked red by IDEA IDEA thinks text is referring to
the JTextField, but the compiler says it is really the string.
2) IDEA does not indicate a problem with "getText" since it thinks this is
legit. The compiler, however, says it really references the string.
When compiled (the "^" points to the dot before getText):
C:\dev>javac Test.java
Test.java:9: cannot resolve symbol
symbol : method getText ()
location: class java.lang.String
String text = text.getText(); // 2 - no error indicated
here
^
1 error
-sms
_______________________________________________
Eap-bugs mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-bugs