Bug 80339 - Wrong error message "; expected" when writing an interface
Summary: Wrong error message "; expected" when writing an interface
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.3 M3   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-07 02:18 EST by Jan Matèrne CLA
Modified: 2006-10-30 11:49 EST (History)
0 users

See Also:


Attachments
Proposed fix (9.28 KB, patch)
2006-10-16 04:29 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Matèrne CLA 2004-12-07 02:18:05 EST
During an introduction course to Eclipse we got a error.
We wrote an interface

  public interface Test {
      public void myMethod()   <<-- without a semicolon!
  }  

and the tooltip and quick fix said that a curly brace is missing. But there must
be a semicolon.

Have to retest that on 3.1MS3. Sorry, havent have the time for download yet.
Comment 1 Olivier Thomann CLA 2004-12-07 21:28:03 EST
This is due to the fact we tolerate methods with body inside interfaces to flag
them during the resolution.
David, can we fix this?
I don't consider this as crucial since this is a syntax error.
Comment 2 Jan Matèrne CLA 2004-12-08 03:10:04 EST
Ok, Retest with Eclipse 3.1M3
Version: 3.1.0
Build id: 200411050810

Problem messages are:
- Syntax error, insert "}" to complete InterfaceBody
- Syntax error on token ")", { expected after this token
Comment 3 Philipe Mulet CLA 2005-04-07 09:44:24 EDT
Deferring post 3.1
Comment 4 Jan Matèrne CLA 2006-10-13 03:28:32 EDT
still open on 3.3 nightly build N20061013-0010
Comment 5 David Audel CLA 2006-10-16 04:29:41 EDT
Created attachment 52017 [details]
Proposed fix
Comment 6 David Audel CLA 2006-10-16 04:38:13 EDT
Released for 3.3 M3

Tests added
  DietrecoveryTest#test115() -> test116()
  StatementRecoveryTest#test0043()
  SyntaxErrorTest#test11() -> test12()

With the fix the error message is 
  "Syntax error, insert ";" to complete MethodDeclaration"

But if the test case would contain a statement

public interface Test {
    public void myMethod()
        System.out.println();
} 

the message is still to insert a "{".
Comment 7 Frederic Fusier CLA 2006-10-30 11:49:46 EST
Verified for 3.3 M3 using warm-up build I20061030-0010.