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: | Regenerating method breaks the code | ||
---|---|---|---|
Product: | java | Reporter: | luky <luky> |
Component: | Source | Assignee: | Rastislav Komara <moonko> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | bohemius |
Priority: | P4 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 113143 |
Description
luky
2007-08-21 11:36:52 UTC
Well, I see two problems here: -the mobility's generator generates a class which contains "public void test(int testNumber) throws Throwable" twice. So exact print of the class is uncompilable anyway. -the code gen generates broken switch statement. May be caused by the previous problem. Two variants here: -if this problem is caused by the duplicated methods, it is a P3 codegen bug, IMO. Not nice that we generate a very broken code for a slightly broken rewrites, but broken rewrites are the principal problem. -if this problem is not caused by the duplicated methods, than this is a P2 in codegen. Could you please try to fix the mobility's generator not to duplicate the test method? Thanks. Ok, Lukas sent me a prototype version of TestCreator that does not duplicate the test method, and the codegen does not generate correct code anyway. So we need to investigate this as a P2 in codegen, IMO. I have added a commented-out test case for this (see below). Unfortunately, I do not know how to fix this properly. Checking in MethodBodyTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/MethodBodyTest.java,v <-- MethodBodyTest.java new revision: 1.6; previous revision: 1.5 done *** Issue 113144 has been marked as a duplicate of this issue. *** Checking in src/org/netbeans/modules/java/source/save/CasualDiff.java; /cvs/java/source/src/org/netbeans/modules/java/source/save/CasualDiff.java,v <-- CasualDiff.java new revision: 1.190; previous revision: 1.189 done Checking in test/unit/src/org/netbeans/api/java/source/gen/MethodBodyTest.java; /cvs/java/source/test/unit/src/org/netbeans/api/java/source/gen/MethodBodyTest.java,v <-- MethodBodyTest.java new revision: 1.8; previous revision: 1.7 done Should work now, but leaving opened until correct solution will be implemented. Decreasing priority. Thanks Honza for test-case. Confirm, it it working now Overtake. Resolving all issues with milestone "future" as LATER. If you feel strongly that it should be implemented please reopen and set the target milestone to "next". NetBeans.org Migration: changing resolution from LATER to WONTFIX |