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.
When you have the following code the only hint offered is to create method "private void doBasicProjectTest(Object object, boolean b)". It would be nice if also a hint with "Cast to JBProject" was offered. The result would be: doBasicProjectTest((JBProject) projects.toArray()[0], true); // ** Example code follows: hello() { Collection/*<JBProject>*/ projects = iterator.getProjects(); doBasicProjectTest(projects.toArray()[0], true); // ** } void doBasicProjectTest(JBProject project, boolean hasLibraries) { // blablabla }
Better and very common example which should offer the cast (to File) on the first place: for (Iterator it = libs.iterator(); it.hasNext(); ) { FileObject fo = FileUtil.toFileObject(it.next()); }
I agree in particular with the second example.
was already planning to do something like this
Ok, please go ahead.
Jan, I was thinking that the issue was assigned to me. Now I saw that you were the initial owner of it. Maybe this sounds stupid, but I don't wanna "steal" it from you. So if you wanna fix it, it's yours. Otherwise I will take care of it at the end of the week.
Regarding assignment. I don't know to whom should I assign issues. I know you both are working on the module so once I assign it to (CC) Leon, once to Honza. If there are some rules please tell me so. I will assign it appropriately next time. Anyway, thanks for the great work. It's really usable and *stable* for me (using -J-Dorg.netbeans.modules.java.hints.experimental=true).
In fact, this bug was originally assigned to you, Leon. I considered it to be my mistake (that I have not considered it when I wrote the add cast hint), so I assigned it to myself (and have "stolen" it from you, sorry). If you want to fix it, you are welcome (and it was originally your bug :-)). Martin, you can assign the bugs to both me and Leon, we will reassign it as necessary.
probably fixed Checking in JavaHintsProvider.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/JavaHintsProvider.java,v <-- JavaHintsProvider.java new revision: 1.44; previous revision: 1.43 done will close it tomorrow after writing a few tests.
well, the fix is only partial. it doesn't work in case of method overloading: doStuff(String a, String b) { } doStuff(String a) { } and you use doStuff(Object); this is because the compiler message is different. will take care of this case too.
RCS file: /cvs/contrib/editorhints/java/tasklist.ics,v done Checking in java/tasklist.ics; /cvs/contrib/editorhints/java/tasklist.ics,v <-- tasklist.ics initial revision: 1.1 done Checking in java/src/org/netbeans/modules/java/hints/CreateElementJavaHint.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/CreateElementJavaHint.java,v <-- CreateElementJavaHint.java new revision: 1.19; previous revision: 1.18 done Checking in java/src/org/netbeans/modules/java/hints/DeclarationInfo.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/DeclarationInfo.java,v <-- DeclarationInfo.java new revision: 1.15; previous revision: 1.14 done Checking in java/src/org/netbeans/modules/java/hints/GeneratorUtils.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/GeneratorUtils.java,v <-- GeneratorUtils.java new revision: 1.10; previous revision: 1.9 done Checking in java/src/org/netbeans/modules/java/hints/JavaHintsProvider.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/JavaHintsProvider.java,v <-- JavaHintsProvider.java new revision: 1.48; previous revision: 1.47 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c-hints.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c-hints.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c-hints.pass,v <-- testCastOrMethodInvocation58494c-hints.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494c.pass,v <-- testCastOrMethodInvocation58494c.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d-hints.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d-hints.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d-hints.pass,v <-- testCastOrMethodInvocation58494d-hints.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494d.pass,v <-- testCastOrMethodInvocation58494d.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494e-hints.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494e-hints.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494e-hints.pass,v <-- testCastOrMethodInvocation58494e-hints.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f-hints.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f-hints.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f-hints.pass,v <-- testCastOrMethodInvocation58494f-hints.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f.pass,v done Checking in java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f.pass; /cvs/contrib/editorhints/java/test/qa-functional/data/goldenfiles/org/netbeans/modules/java/hints/test/JavaHintsTest/testCastOrMethodInvocation58494f.pass,v <-- testCastOrMethodInvocation58494f.pass initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494c.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494c.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494c.java,v <-- CastOrMethodInvocation58494c.java initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494d.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494d.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494d.java,v <-- CastOrMethodInvocation58494d.java initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494e.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494e.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494e.java,v <-- CastOrMethodInvocation58494e.java initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494f.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494f.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/CastOrMethodInvocation58494f.java,v <-- CastOrMethodInvocation58494f.java initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494cUsee.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494cUsee.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494cUsee.java,v <-- CastOrMethodInvocation58494cUsee.java initial revision: 1.1 done RCS file: /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494dUsee.java,v done Checking in java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494dUsee.java; /cvs/contrib/editorhints/java/test/qa-functional/data/projects/default/src/org/netbeans/test/java/hints/pkg/CastOrMethodInvocation58494dUsee.java,v <-- CastOrMethodInvocation58494dUsee.java initial revision: 1.1 done Checking in java/test/qa-functional/src/org/netbeans/modules/java/hints/test/JavaHintsTest.java; /cvs/contrib/editorhints/java/test/qa-functional/src/org/netbeans/modules/java/hints/test/JavaHintsTest.java,v <-- JavaHintsTest.java new revision: 1.26; previous revision: 1.25 done