Bug 97820 - [1.5][dom] Syntax error in for each statement makes all method statements disappearing
Summary: [1.5][dom] Syntax error in for each statement makes all method statements dis...
Status: VERIFIED DUPLICATE of bug 42253
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-01 08:38 EDT by Frederic Fusier CLA
Modified: 2006-02-15 11:38 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2005-06-01 08:38:34 EDT
Using 3.1 RC1

public class X {
	public static void main(String[] args) {
		int i= 0;
		for (String s  args) {
			System.out.println("ZORK");
		}
		int j = 0;
		int k=i+j;
	}
}

Looking at ASTView on main method declaration which misses ':' in for statement,
I can see method is malformed (OK) and does not content any statement...

As recovery rightly suggests to insert ':' after s formal parameter, I would
expect AST convertion able to display method statements even with this syntax error.
Comment 1 Olivier Thomann CLA 2005-06-01 08:46:08 EDT
This is a known issue. When a syntax error arises in a method, the whole method
is considered as a problem method and has no statement.
Talk to David to find out if the recovery at the statement level is supposed to
be in.
Comment 2 David Audel CLA 2005-06-01 09:01:04 EDT
Currently there is no statement recovery

*** This bug has been marked as a duplicate of 42253 ***
Comment 3 Frederic Fusier CLA 2006-02-15 11:38:41 EST
Verified for 3.2 M5 using build I20060215-0010.