Summary: | Java AST creation error due to NullPointerException in IF statement test block. | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dan de Vries <eclipse> | ||||
Component: | Core | Assignee: | Olivier Thomann <Olivier_Thomann> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | eclipsebugs, jerome.duvillier | ||||
Version: | 3.0 | ||||||
Target Milestone: | 3.1 M1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Dan de Vries
2004-07-20 04:19:20 EDT
I will investigate. This seems to be a regression in the compiler due to 1.5 work. The following code doesn't compile anymore. import java.util.StringTokenizer; public class A { public void foo() { StringTokenizer tokeniser = new StringTokenizer( "", "" ); if ( tokeniser.countTokens() = 3 ) {} } } I will attach a patch. Created attachment 13452 [details]
Apply on HEAD
Philippe, Could you please review the patch? Thanks. With this patch the AST creation doesn't fail anymore. The expected error is: ---------- 1. ERROR in C:\tests_sources\A.java (at line 6) if ( tokeniser.countTokens() = 3 ) {} ^^^^^^^^^^^^^^^^^^^^^^^ The left-hand side of an assignment must be a variable ---------- 1 problem (1 error) Fix looks good. Please apply it. Fixed and released in HEAD. Regression test added. *** Bug 70981 has been marked as a duplicate of this bug. *** |