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 134878 - Generating source from template "Java/CompilationUnit.java" ...ERROR: java.lang.NullPointerException
Summary: Generating source from template "Java/CompilationUnit.java" ...ERROR: java.l...
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:
: 142718 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-12 19:04 UTC by shche123
Modified: 2008-08-04 22:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Java and UML projects (43.07 KB, text/plain)
2008-05-12 19:05 UTC, shche123
Details

Note You need to log in before you can comment on or make changes to this bug.
Description shche123 2008-05-12 19:04:47 UTC
Processing element 1 of 2: Class Account ... 
  Generating source from template "Java/CompilationUnit.java" ...ERROR:  java.lang.NullPointerException


Generates Account class with no code...
Comment 1 shche123 2008-05-12 19:05:27 UTC
Created attachment 61278 [details]
Java and UML projects
Comment 2 shche123 2008-05-12 19:21:08 UTC
My settings do not auto add Constructor to the the Class diagram.
When I do add it and then gen the code, I get the runtime error...
Comment 3 Peter Lam 2008-05-22 00:46:59 UTC
still exists in 6.5 as well as in 6.1. Not sure what's happening but I do get the error when generating code.
Comment 4 Viktor Lapitski 2008-07-18 03:05:29 UTC
The project is somehow got into incorrect state:

1. there is a method that should be constructor, yet is doens't have 
isConstructor="true"
2. it has return parameter specified with empty type ( type="" )

<UML:Operation xmi.id="DCE.5F662313-A306-DE8D-5A84-F47F16E896A2" name="Account"
owner="DCE.0DB1A5E7-8868-EDAD-8AED-4DCA686961A0"><UML:Element.ownedElement>
<UML:Parameter xmi.id="DCE.74380533-7A08-99C3-CC16-7E20D9F16619" type="" direction="result"
owner="DCE.5F662313-A306-DE8D-5A84-F47F16E896A2">

This is, for example, how a constructor is supposed to look like:

<UML:Operation xmi.id="DCE.14EB7F16-7818-912F-A03E-B5B9D72BB2E0" name="cl3" isConstructor="true"
owner="DCE.5FEDABB3-A0D0-18FB-8016-8EFCE9D9A9E0"><UML:Element.presentation>
</UML:Element.presentation></UML:Operation>


A defensive code will be added to continue work in this situation as well.
Comment 5 Viktor Lapitski 2008-07-18 03:51:55 UTC
http://hg.netbeans.org/uml-main/rev/2c9c6ad6509d
Comment 6 Peter Lam 2008-07-18 17:51:47 UTC
this issue can't be verified yet in build 20080717 due to blocking issue 140788
Comment 7 Trey Spiva 2008-07-18 20:07:07 UTC
reviewd
Comment 8 Peter Lam 2008-07-18 22:46:22 UTC
verified in 6.5 build 20080718. exception no longer occurs.
Comment 9 Viktor Lapitski 2008-08-04 22:29:51 UTC
*** Issue 142718 has been marked as a duplicate of this issue. ***