Bug 83657 - [1.5] autoboxing parameter
Summary: [1.5] autoboxing parameter
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-25 15:59 EST by Hasko Heinecke CLA
Modified: 2005-01-25 16:12 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 Hasko Heinecke CLA 2005-01-25 15:59:52 EST
Using build 200411050810, will check latest integration build tomorrow.

Here's a case where I believe autounboxing should work but doesn't.

  public class TestGeneric<T> {

    public T getSomething(T param) {
      // Note we are passing the parameter through, whatever it's type is
      return param;
    }
  }

  public class TestCaller {
  
    public void someMethod(boolean param) {
      // do nothing
    }

    public void test() {
      TestGeneric<Boolean> tbg = new TestGeneric<Boolean>();
      // The next line doesn't compile
      // because Boolean is not compatible with boolean
      test(tgb.getSomething(true));
    }
}
Comment 1 Hasko Heinecke CLA 2005-01-25 16:02:10 EST
By the way, explicit conversion is a work-around:

  test(tgb.getSomething(true).booleanValue());
Comment 2 Olivier Thomann CLA 2005-01-25 16:12:44 EST
I think your test case is more something like this:

public class X<T> {
    public T getSomething(T param) {
      return param;
    }
}
  
class Y {
    public void someMethod(boolean param) {
      // do nothing
    }

    public void test() {
      X<Boolean> x = new X<Boolean>();
      someMethod(x.getSomething(true));
    }
}

This does compile fine with latest.
Closing as WORKSFORME.