Bug 78849 - [1.5][compiler] Java 1.5 Boxing and Character?
Summary: [1.5][compiler] Java 1.5 Boxing and Character?
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1 M4   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-17 11:53 EST by Yonas Jongkind CLA
Modified: 2004-12-14 23:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yonas Jongkind CLA 2004-11-17 11:53:18 EST
This code compiles in Java 1.5/ANT, but generates an error in Eclipse Version
3.1.0 build id: 200411050810.

The code is:

  private Result p$Shared3(final int yyStart) throws IOException {
    int        yyC;
    int        yyIndex;
    Character  yyValue;
    ParseError yyError = ParseError.DUMMY;

    // Option 1.

    yyC = character(yyStart);
    if (-1 != yyC) {
      yyIndex = yyStart + 1;
      yyValue = new Character((char)yyC);

      if (('\n' != yyValue) &&
          ('\r' != yyValue)) {

        return new SemanticValue(yyValue, yyIndex, yyError);
      }
    }

    // Done.
    return yyError;
  }

The error is that on both lines:

      if (('\n' != yyValue) &&
          ('\r' != yyValue)) {


The compiler in Eclipse reports "Incompatible types Char and Character"
Comment 1 Olivier Thomann CLA 2004-11-17 12:16:36 EST
Autoboxing is not supported yet.
Comment 2 Kent Johnson CLA 2004-12-08 11:09:21 EST
Added AutoBoxing test #23
Comment 3 Kent Johnson CLA 2004-12-08 11:54:37 EST
fixed.
Comment 4 Olivier Thomann CLA 2004-12-14 23:03:46 EST
Verified in 200412140800