Generated value objects throws NullPointerException when using constructor with 
multiple parameters
---------------------------------------------------------------------------------------------------

         Key: XDT-1585
         URL: http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1585
     Project: XDoclet
        Type: Bug
  Components: EJB Module  
    Versions: 1.2.3    
 Environment: Windows XP, JDK 1.5, XDoclet 1.2.3.
 Reporter: Ivens Porto
 Assigned to: xdoclet-devel (Use for new issues) 


The value objects generated by XDoclet throw a NullPointerException when 
constructing value object objects using the constructor with multiple 
parameters.

For example, this is a value object generated by XDoclet (code that does not 
matter to the subject was removed):

------------------------------------------------------------------------------------------------------
public class OperationVO
   extends java.lang.Object
   implements java.io.Serializable, java.lang.Cloneable 
{

   private java.lang.Long operationId;
   private boolean operationIdHasBeenSet = false;

   private java.lang.String descr;
   private boolean descrHasBeenSet = false;

   private ejb.entity.OperationPK primaryKey;

   public OperationVO()
   {
          primaryKey = new ejb.entity.OperationPK();
   }

   public OperationVO( java.lang.Long operationId,java.lang.String descr)
   {
       setOperationId(operationId);
       setDescr(descr);
       primaryKey = new ejb.entity.OperationPK(this.getOperationId());
   }

   public void setOperationId( java.lang.Long operationId )
   {
          this.operationId = operationId;
          operationIdHasBeenSet = true;

          primaryKey.setoperationId(operationId);
   }

    // other methods removed
}
------------------------------------------------------------------------------------------------------

As can be seen the setOperationId() method will throw a NullPointerException 
when called from the constructor with multiple parameters, because the member 
'primaryKey' has not been created and is 'null'.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to