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.

Bug 130157 - Code Gen is blowing away code...
Summary: Code Gen is blowing away code...
Status: VERIFIED DUPLICATE of bug 122877
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: issues@uml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-14 14:29 UTC by shche123
Modified: 2008-03-26 18:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
local history befor and after modifying i's type. (36.84 KB, image/png)
2008-03-14 17:55 UTC, George Vasick
Details
stack trace attached (31.77 KB, text/plain)
2008-03-14 21:06 UTC, Joanne Lau
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shche123 2008-03-14 14:29:25 UTC
Code Gen is blowing away my code... in 6.0.1
It is not happening in 6.0

It happens in many different instances.
One case is when I changed the variable name on the method parameter - the business logic of the method was removed on
code gen...
All of my 6.0.1 users have reported the same thing.

Thanks
Leonid
Comment 1 George Vasick 2008-03-14 16:46:50 UTC
There were no changes in UML between 6.0 and 6.0.1.  We need steps to reproduce the problem.

Thanks,
George
Comment 2 shche123 2008-03-14 16:52:40 UTC
Create a UML model with a few properties
generate the code, and business logic to a mutator method
change val argument on a mutator method on a UML to another name, say from 'val' to 'name'.
Generate code again.
Business logic is blown away.
This is the first time I am noticing this issue.
Thanks
Comment 3 George Vasick 2008-03-14 17:53:52 UTC
Got it, see attached image.  Thanks.

Steps to reproduce:

1)  create a new uml java platform model project and class diagram.
2)  drop a class on the diagram, name it foo, add a parameter int i.
3)  create a new java library project.
4)  generate code into the the java project.
5)  right click on class foo -> navigate to source.
6)  add some code to foo's body.
7)  go back to the class diagram.
8)  change the parameter int i to float i.
9)  generate code.
10) foo's body has been deleted.
Comment 4 George Vasick 2008-03-14 17:55:41 UTC
Created attachment 58405 [details]
local history befor and after modifying i's type.
Comment 5 Joanne Lau 2008-03-14 21:05:02 UTC
Issue is reproducible in 6.0 and 6.0.1, however it is not reproducible in 6.1
I've added an extra step after step 6)  to save the source file before going back to the
class diagram. 
I notice that without the save file,  when going back to the class diagram and
generate code, I'm getting the error in the generate code log:

     Merging with the existing source file ...ERROR:    
C:/Users/Joanne/Documents/NetBeansProjects/JavaApplication4/src/c1.java

and FileAlreadyLockedException appears in the messages.log

(see attached messages.log)
Comment 6 Joanne Lau 2008-03-14 21:06:08 UTC
Created attachment 58413 [details]
stack trace attached
Comment 7 Peter Lam 2008-03-14 21:18:41 UTC
Actually, there's no change between the plain 6.0 and 6.0.1 in UML at all as George said. The problem is there in both
6.0 and 6.0.1. However, this problem is not reproducible in 6.1. It might have been fixed in the bug fix for issue
119335 in 6.1.
Comment 8 Viktor Lapitski 2008-03-14 21:47:51 UTC
it was fixed as 122877 in 6.1
Comment 9 Viktor Lapitski 2008-03-15 00:12:44 UTC

*** This issue has been marked as a duplicate of 122877 ***
Comment 10 Peter Lam 2008-03-26 18:17:31 UTC
has already been verified in NB 6.1 M1 Build 200801222102