User: vharcq  
  Date: 02/04/02 03:41:06

  Modified:    core/resources/xdoclet/ejb entitypk.j
  Log:
  Use a StringBuffer in toString() construct to avoid CCE when handling primitive (int 
id for example)
  
  Revision  Changes    Path
  1.21      +5 -5      xdoclet/core/resources/xdoclet/ejb/entitypk.j
  
  Index: entitypk.j
  ===================================================================
  RCS file: /cvsroot/xdoclet/xdoclet/core/resources/xdoclet/ejb/entitypk.j,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -r1.20 -r1.21
  --- entitypk.j        30 Mar 2002 10:37:42 -0000      1.20
  +++ entitypk.j        2 Apr 2002 11:41:06 -0000       1.21
  @@ -19,7 +19,7 @@
      static final long serialVersionUID = <XDtEjbPk:serialVersionUID/>;
     </XDtClass:ifDoesntHaveClassTag>
      transient private int _hashCode = Integer.MIN_VALUE;
  -   transient private String _toStringValue = null;
  +   transient private StringBuffer _toStringValue = null;
   
     <XDtEjbPersistent:forAllPersistentFields superclasses="false" only-pk="true">
      public <XDtMethod:methodType/> <XDtMethod:propertyName/>;
  @@ -122,14 +122,14 @@
      {
         if( _toStringValue == null )
         {
  -         _toStringValue = "[";
  +         _toStringValue = new StringBuffer("[.");
           <XDtEjbPersistent:forAllPersistentFields superclasses="false" 
only-pk="true">
  -         _toStringValue += this.<XDtMethod:propertyName/> + '.';
  +         _toStringValue.append(this.<XDtMethod:propertyName/>).append(".");
           </XDtEjbPersistent:forAllPersistentFields>
  -         _toStringValue += "]";
  +         _toStringValue.append("]");
         }
   
  -      return _toStringValue;
  +      return _toStringValue.toString();
      }
   
     <XDtMerge:merge file="entitypk-custom.j">
  
  
  

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to