Community
Participate
Working Groups
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)); } }
By the way, explicit conversion is a work-around: test(tgb.getSomething(true).booleanValue());
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.