Bug 78849

Summary: [1.5][compiler] Java 1.5 Boxing and Character?
Product: [Eclipse Project] JDT Reporter: Yonas Jongkind <yonasj>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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