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 86770 - Source files are empty when generate code to existing Java Project
Summary: Source files are empty when generate code to existing Java Project
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Craig Conover
URL:
Keywords:
: 87030 (view as bug list)
Depends on: 87327
Blocks:
  Show dependency tree
 
Reported: 2006-10-09 13:46 UTC by Alexandr Scherbatiy
Modified: 2007-10-19 21:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (33.02 KB, text/plain)
2006-10-09 13:47 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2006-10-09 13:46:37 UTC
Steps to reproduce:

- Create an empty Java project
- Add 'pack' package into the Java project
- Add 'MyClass'  class under the package
- Reverse Engineer the 'MyClass' class into UML project
- Go to the UML project 
- Add 'public void op()' operation into the 'MyClass' element
- Generate code for the the 'MyClass' element into 'src' folder of Java project
  'Question' dialog asks: 'MyClass.java was modified externally. Reload it?'
- Press 'Yes' button.

  InvalidObjectException pops up:

  javax.swing.text.BadLocationException: Wrong insert position 1

  java.lang.IllegalStateException: The model was modified.
                                   Unable to return start offset.


- Go to the java project
  'MyClass.java' class is empty
Comment 1 Alexandr Scherbatiy 2006-10-09 13:47:36 UTC
Created attachment 35036 [details]
IDE log file
Comment 2 Craig Conover 2006-10-10 06:33:47 UTC
My last comment said "we can assume..." but should have read "we can NOT assume...".
Comment 3 Craig Conover 2006-10-10 06:35:46 UTC
my last comment was meant to be posted to the issue preceding this issue in
sequential order. 

<rant>This auto-advance of the issue # is really a P.I.T.A. and needs to be
pulled out. Hitting submit should redisplay the issue I was working on </rant>
Comment 4 Alexandr Scherbatiy 2006-10-11 10:25:06 UTC
Main functionality is broken.
It is also test stopper.

Steps to reproduce:
- Create a Java-Platform UML project
- Create a Class diagram
- Put a class elementy on the diagram and name it
- Generate code for the Class element
- Create a Java Project with Existing source
  Choose generated sources for the Java project
- Go to the UML project
- Insert an operation into the class element
- Generate code for the Class element
- Go to the Java project
- Open the generated java file   
  The file is empty.

 See previous IDE log file.
Comment 5 Alexandr Scherbatiy 2006-10-13 10:21:11 UTC
*** Issue 87030 has been marked as a duplicate of this issue. ***
Comment 6 Craig Conover 2006-10-16 22:24:15 UTC
*** Issue 87030 has been marked as a duplicate of this issue. ***
Comment 7 Craig Conover 2006-10-16 22:24:32 UTC
Changed the way the existing source file is backed up. Instead of doing a
rename, the existing source file is copied, and then the existing source file is
updated with new elements.
Comment 8 Alexandr Scherbatiy 2006-10-18 14:07:47 UTC
verified with all-nbms-griffin-061018_27.zip nbms