geirm       01/05/20 14:09:05

  Modified:    src/java/org/apache/velocity/app/event EventCartridge.java
                        NullSetEventHandler.java
  Log:
  Changed the method for NullSetEventHandler to something more sensical
  (thanks, paulo), and added a second arg, so you know both LHS and RHS
  a
  
  Revision  Changes    Path
  1.2       +4 -4      
jakarta-velocity/src/java/org/apache/velocity/app/event/EventCartridge.java
  
  Index: EventCartridge.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/app/event/EventCartridge.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EventCartridge.java       2001/05/20 19:48:55     1.1
  +++ EventCartridge.java       2001/05/20 21:09:04     1.2
  @@ -64,7 +64,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Geir Magnusson Jr.</a>
    * @author <a href="mailto:[EMAIL PROTECTED]";>Jose Alberto Fernandez</a>
  - * @version $Id: EventCartridge.java,v 1.1 2001/05/20 19:48:55 geirm Exp $
  + * @version $Id: EventCartridge.java,v 1.2 2001/05/20 21:09:04 geirm Exp $
    */
   public class EventCartridge implements ReferenceInsertionEventHandler,
                                          NullSetEventHandler,
  @@ -173,7 +173,7 @@
   
       /**
        *  Implementation of NullSetEventHandler method
  -     *  <code>nullSetLogMessage()</code>.
  +     *  <code>shouldLogOnNullSet()</code>.
        *
        *  Called during Velocity merge to determine if when
        *  a #set() results in a null assignment, a warning
  @@ -182,14 +182,14 @@
        *  @param reference reference from template about to be inserted
        *  @return true if to be logged, false otherwise
        */
  -    public boolean nullSetLogMessage( String reference )
  +    public boolean shouldLogOnNullSet( String lhs, String rhs )
       {
           if ( nseh == null)
           {
               return true;
           }
   
  -        return nseh.nullSetLogMessage( reference );
  +        return nseh.shouldLogOnNullSet( lhs, rhs );
       }
       
       /**
  
  
  
  1.2       +12 -5     
jakarta-velocity/src/java/org/apache/velocity/app/event/NullSetEventHandler.java
  
  Index: NullSetEventHandler.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/app/event/NullSetEventHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NullSetEventHandler.java  2001/05/20 19:48:56     1.1
  +++ NullSetEventHandler.java  2001/05/20 21:09:04     1.2
  @@ -55,14 +55,21 @@
    */
   
   /**
  - *  Called when the RHS of a #set() is null
  + *  Event handler : lets an app approve / veto
  + *  writing a log message when RHS of #set() is null.
    *
  - *  Please return what you want rendered into the output stream.
  - *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Geir Magnusson Jr.</a>
  - * @version $Id: NullSetEventHandler.java,v 1.1 2001/05/20 19:48:56 geirm Exp $
  + * @version $Id: NullSetEventHandler.java,v 1.2 2001/05/20 21:09:04 geirm Exp $
    */
   public interface NullSetEventHandler extends EventHandler
   {
  -    public boolean nullSetLogMessage( String reference );
  +    /**
  +     *  Called when the RHS of a #set() is null, which will result
  +     *  in a null LHS.
  +     *
  +     *  @param lhs  reference literal of left-hand-side of set statement
  +     *  @param rhs  reference literal of right-hand-side of set statement
  +     *  @return true if log message should be written, false otherwise
  +     */
  +    public boolean shouldLogOnNullSet( String lhs, String rhs );
   }
  
  
  

Reply via email to