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 105379 - To handle case of non-parseable (and thus non-mergeable) file
Summary: To handle case of non-parseable (and thus non-mergeable) file
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: Code Generation (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Viktor Lapitski
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2007-06-01 11:10 UTC by Alexandr Scherbatiy
Modified: 2007-06-19 13:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (52.42 KB, text/plain)
2007-06-01 11:36 UTC, Alexandr Scherbatiy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandr Scherbatiy 2007-06-01 11:10:42 UTC
Steps to reproduce:

- Create 'A' Class element
- Create 'B' Class element
- Draw a Navigable Aggregation link from 'A' to 'B'
- Generate code for the UML project
  the code for the aggregation link is not
  correctly added ( see issue 104956)
- Insert 'int a' attribute to 'A' class element
- Insert 'void op()' operation to 'A' class element
- Generate code for the UML project
  The code for the attribute and the operation is not generated
Comment 1 Alexandr Scherbatiy 2007-06-01 11:11:18 UTC
build netbeans-6.0-nightly-200705310000-full-windows.exe
Comment 2 Alexandr Scherbatiy 2007-06-01 11:35:58 UTC
The root issue is that attributes and operations are not generated if
code generation is invoked the second time

Steps to reproduce:
- Create 'A' Class element
- Create 'B' Class element
- Generate code for the UML project

- Insert 'int a' attribute to 'A' class element
- Insert 'void op()' operation to 'A' class element
- Generate code for the UML project
  Leave the checkboxes on the Generate Code dialog as selected
  The code for the attribute and the operation is not generated
  The IDE log file contains the following exception:
     java.lang.IllegalArgumentException: Prefix string too short
  
Comment 3 Alexandr Scherbatiy 2007-06-01 11:36:51 UTC
Created attachment 43106 [details]
IDE log file
Comment 4 Viktor Lapitski 2007-06-08 04:00:56 UTC
The 2nd issue with java.lang.IllegalArgumentException: is fixed.

The first issue is still here in the sense that merging is 
practically impossible if the source file isn't a syntactically 
correct Java file. In this case the file will be just 
overwritten without merge (backup copy - as usually depending 
on the checkbox). The parser error and the fact of overwriting 
will be logged. 


Comment 5 Viktor Lapitski 2007-06-14 12:23:09 UTC
In case if existing file is non-parseable :
- the back up copy will _always_ be created, 
- new version will replace the existing file
- the warning like this will be logged:
....
  Generating source from template "CompilationUnit.java" ... Ok
  Existing Source File -  C:\tmp\wrk\wss\NetBeansProjects\UMLProject11Sources\src\pack3\cll11Node.java
  WARNING: The existing source file couldn't be parsed. It was overwritten by new version, and backup copy was created.
...
Comment 6 Alexandr Scherbatiy 2007-06-19 13:42:12 UTC
verified in netbeans-hudson-trunk-923-full.zip