Bug 39172 - Incorrect error reported if extra semi-colon exists on a return statement
Summary: Incorrect error reported if extra semi-colon exists on a return statement
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-20 10:26 EDT by Steve Francisco CLA
Modified: 2003-07-16 06:03 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Francisco CLA 2003-06-20 10:26:18 EDT
The following java source compiles without error using the IBM JDK 1.3.1 
compiler, but gives an "Unreachable code" error (not warning) when using
Eclipse 2.1.0:

    public class Foo {
	public int method() {
		return 7;;
	}
    }

The extra semi-colon on the return statement shows as an error in Eclipse.  
Either the JDT compiler is incorrectly calling this an error, or the IBM JDK 
compiler is not reporting the error correctly.  I'm assuming the former is true.

The IBM JDK version used was:
java version "1.3.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1)
Classic VM (build 1.3.1, J2RE 1.3.1 IBM Windows 32 build cn131-20020710 (JIT 
enabled: jitc))
Comment 1 Philipe Mulet CLA 2003-06-20 11:56:02 EDT
Curious. This should only occur in 1.4 compliant mode.
Comment 2 Steve Francisco CLA 2003-06-20 14:25:08 EDT
Confirmed that my compliance level was set to 1.3
Comment 3 Philipe Mulet CLA 2003-06-24 03:36:55 EDT
Fixed. Empty statements are now completely filtered out in 1.3 mode (not even 
reduced).
Comment 4 Philipe Mulet CLA 2003-06-24 08:38:01 EDT
Actually, changed fix to rather always reduce empty statement nodes, but in 1.3 
compliant mode, these will never cause unreachable reports.

This is much better for DOM AST (which needs empty statements but not 
unreachable diagnosis).
Comment 5 David Audel CLA 2003-07-16 06:03:08 EDT
Verified.