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.
Create a class with a method like this public List<Foo> getWhatever() { return null; } Then do Tools | Create Unit Tests, I choose junit 4.x but possibly 3.x has the problem. This will create a unit test skeleton for me. but, the test method for getWhatever looses the parameterized type! It does List expected = null rather than List<Foo> expected = null
Confirmed.
Partially fixed (in the trunk). It will work now with the exception of parametrized types having at least one type parametrized (e.g. List<Map.Entry<String,Object>>). This is a shortage caused by bug #105176. This partial fix will go into NB 6.0 Beta 2. Modified file: junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java (1.3) Diff: http://junit.netbeans.org/source/browse/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java?r1=1.2&r2=1.3&diff_format=u
Fixed in the trunk. Now that bug #115176 was fixed, I could make a proper fix of this bug. Modified file: junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java (1.12) Diff: http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java?r1=1.11&r2=1.12
I just integrated a very simple fix of this issue - it is a one-line fix which effectively replaces all the other code modifications mentioned in this bug report. The following patch removes the complex private method and replaces it with a simple call of TreeMaker.Type(TypeMirror). http://deadlock.netbeans.org/fisheye/browse/netbeans/junit/src/org/netbeans/modules/junit/AbstractTestGenerator.java?r1=1.13&r2=1.14