This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The following program compiles on jdk 1.5 and jdk 1.6 without error (and oddly, without an unchecked cast warning), but the netbeans' inline error detection reports an "inconvertible types": import java.util.*; public class Test extends ArrayList<Object> { public <T> ArrayList<T> test(Class<T> clazz) { if (clazz == Object.class) { // The following return encounters 2 bugs: // 1) Netbeans inline error detection improperly identifies it as // an "inconvertible type", even though it compiles // 2) The current 1.5 and 1.6 compilers compile it without giving // an "unchecked cast" warning return (ArrayList<T>)this; // A simple workaround to get the results I expected is to use an // intermediate cast, as follows: // return (ArrayList<T>)((ArrayList<Object>)this); } // ... other junk return null; } }
Which build of 5.5 do you use? I've tried it in 5.5fcs and no error annotation was shown
No response for a long time -> closing If it is still reproducible, please reopen the issue and provide requested information.
Reorganization of java component