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.
Summary: | [editorhints] created method always "returns" void | ||
---|---|---|---|
Product: | contrib | Reporter: | Martin Krauskopf <mkrauskopf> |
Component: | Code | Assignee: | _ leonchiver <leonchiver> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | jlahoda |
Priority: | P4 | ||
Version: | 4.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
Martin Krauskopf
2005-04-20 19:54:38 UTC
"void" for methods and "Object" for fields is the fallback (it means "I have no idea of what type this should be."). It is trivial to make it "Object" for both. But, in the described case, it is possible to guess the type, so it should better propose the correct type. i guess it's not hard. will take care of it these days fixed. some functional tests to follow Checking in CreateElementJavaHint.java; /cvs/contrib/editorhints/java/src/org/netbeans/modules/java/hints/CreateElementJavaHint.java,v <-- CreateElementJavaHint.java new revision: 1.13; previous revision: 1.12 done It's much better, thanks. It's fixed only for method created in _this_ class. int a = createIntReturningMethod(); // works fine - creates method returning int int a = OtherClassThanThis.createIntReturningMethod(); // this still creates "static void". Should be "static int" so, it's hopefully fixed better now. added some more tests. please shoot if it doesn't :) Am I too "gluttonous"? Feel free to close as WONTFIX ;) class AA { static int getSomeInt() { return AA.pleasePleaseReturnInt(); } } newly created method pleasePleaseReturnInt() should return int :) But great work, thanks lot for a contribution to all hints-coders. I can't live without it anymore! fixed (alltogether with some more usecases): for example if you have: existingMethod(int i) and you write existingMethod(unexistingMethod()), the return type of unexistingMethod should be int. thanks for reporting Yes, it seems that everything works now. Really fast. Thanks. |