Bug 51707 - Compiler] Incorrect Error Message reported in Eclipse
Summary: Compiler] Incorrect Error Message reported in Eclipse
Status: RESOLVED DUPLICATE of bug 51353
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M8   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-11 13:24 EST by Hans-Jurgen Greiner CLA
Modified: 2004-03-08 18:24 EST (History)
0 users

See Also:


Attachments
System Info and Configuration details pulled from Eclipse (31.38 KB, text/plain)
2004-02-11 16:26 EST, Hans-Jurgen Greiner CLA
no flags Details
Screen Shots of the Error. (148.00 KB, application/msword)
2004-02-12 17:43 EST, Hans-Jurgen Greiner CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hans-Jurgen Greiner CLA 2004-02-11 13:24:29 EST
Given the Class below to test some code why I am getting strange behavior
I am getting an error from Eclipse:
"Unhandled exception type IOException"
On lines of the .append(ch);  Where I am appending only a char.  To either 
StringBuilder or StringBuffer
I must surround the invocation with a try catch and it works only in eclipse,  
but since the method does not throw an exception.  If I try to compile the code 
with the try catch outside of Eclipse.  It will flag the error as the following:
Test.java:32: exception java.io.IOException is never thrown in body of 
corresponding try statement
      catch (IOException e)

I am also getting another Error. On the Line Where I am chaining several 
appends together of strings.
"The type AbstractStringBuilder is not visible"
This ocurrs on the line of code where I am doing the following.
sb.append("Hello").append(" ").append("World");

Interesting.  When I make each append() invocation terminted with a semicolon, 
it works fine.


I have compiled the Code outside of eclipse, and there are no errors nor 
warnings. and the code also runs - I am attaching the code and the Java Version.
I am doing this on both a Windows 2000 OS and Windows XP OS

C:\Temp>javac -version
javac 1.5.0-beta
javac: no source files


public class Test
{
  public static void main( String[] args )
  {
    int n = 10;
    char ch = '*';
    StringBuilder szBuild = new StringBuilder(n);
    for (int nPos = 0; nPos < n; nPos++)
    {
      szBuild.append(ch); // append 1 to n characters ch
    }
    StringBuffer szBuff = new StringBuffer(n);
    for (int nPos = 0; nPos < n; nPos++)
    {
      szBuff.append(ch); // append 1 to n characters ch
    }
    System.out.println(szBuild.toString() );
    System.out.println(szBuff.toString() );
    
    StringBuffer sb = new StringBuffer("");
    sb.append("Hello").append(" ").append("World");
    System.out.println(sb);
  }
}
Comment 1 Olivier Thomann CLA 2004-02-11 14:01:44 EST
I cannot reproduce the first problem with the IOException.
Could you please specify the following points?
- what libraries are you using to compile?
- what Eclipse build are you using?

The second problem is a duplicate of bug 51353.
Comment 2 Hans-Jurgen Greiner CLA 2004-02-11 16:26:08 EST
Created attachment 7811 [details]
System Info and Configuration details pulled from Eclipse

Here is a File containing all the Configuration details
Comment 3 Hans-Jurgen Greiner CLA 2004-02-11 16:29:15 EST
I had attached in case you were also interested, the Configuration info.

I am using the Following jar libraries from the JRE1.5.0
These libraries are the ones that are pulled in from eclise when it first comes 
up, in otherwords, nothing added, nothing deleted from the original selection.

rt.jar
jsse.jar
jce.jar
charsets.jar
dnsns.jar
localedata.jar
sunjce_provider.jar
sunpkcs11.jar


The eclipse build  is:
Version: 3.0.0
Build id: 2003121820000

Comment 4 Hans-Jurgen Greiner CLA 2004-02-12 17:43:18 EST
Created attachment 7879 [details]
Screen Shots of the Error.

Attaching a word Document, showing the Error and the resoltion ( inside eclipse
)  External to Eclispe the Resolution creates a error.
Comment 5 Philipe Mulet CLA 2004-03-04 18:26:44 EST
This should work better on build I20040304 (today's).
Need to double check
Comment 6 Philipe Mulet CLA 2004-03-08 18:24:46 EST
Verified this is a dup.

*** This bug has been marked as a duplicate of 51353 ***