juergen     02/05/28 04:13:37

  Modified:    src/share/org/apache/slide/content NodeProperty.java
  Log:
  use the defaults (live properties) in case of domain is not initialised yet.
  
  Revision  Changes    Path
  1.16      +18 -16    
jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java
  
  Index: NodeProperty.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- NodeProperty.java 21 May 2002 09:04:31 -0000      1.15
  +++ NodeProperty.java 28 May 2002 11:13:37 -0000      1.16
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v 1.15 
2002/05/21 09:04:31 pnever Exp $
  - * $Revision: 1.15 $
  - * $Date: 2002/05/21 09:04:31 $
  + * $Header: 
/home/cvs/jakarta-slide/src/share/org/apache/slide/content/NodeProperty.java,v 1.16 
2002/05/28 11:13:37 juergen Exp $
  + * $Revision: 1.16 $
  + * $Date: 2002/05/28 11:13:37 $
    *
    * ====================================================================
    *
  @@ -80,7 +80,7 @@
    * Node property class
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.15 $
  + * @version $Revision: 1.16 $
    */
   public final class NodeProperty implements Serializable, Cloneable {
       
  @@ -98,15 +98,17 @@
       
       static {
           try {
  -            Class slpc = Class.forName( 
Domain.getParameter("standardLivePropertiesClass") );
  +            if (Domain.isInitialized()) {
  +                Class slpc = Class.forName( 
Domain.getParameter("standardLivePropertiesClass") );
                   Method lp = slpc.getMethod( "getAllLiveProperties", new Class[]{} );
  -            allLiveProperties = (Set)lp.invoke( null, new Object[]{} ); // obj=null 
since method is static
  +                allLiveProperties = (Set)lp.invoke( null, new Object[]{} ); // 
obj=null since method is static
                   Method pp = slpc.getMethod( "getAllProtectedProperties", new 
Class[]{} );
  -            allProtectedProperties = (Set)pp.invoke( null, new Object[]{} ); // 
obj=null since method is static
  +                allProtectedProperties = (Set)pp.invoke( null, new Object[]{} ); // 
obj=null since method is static
                   Method cp = slpc.getMethod( "getAllComputedProperties", new 
Class[]{} );
  -            allComputedProperties = (Set)cp.invoke( null, new Object[]{} ); // 
obj=null since method is static
  +                allComputedProperties = (Set)cp.invoke( null, new Object[]{} ); // 
obj=null since method is static
  +            }
           }
  -            catch( Exception x ) {
  +        catch( Exception x ) {
               Domain.warn( "Loading of standard live properties class failed: 
"+x.getMessage() );
           }
           
  @@ -130,7 +132,7 @@
           this.type = new String();
           this.permissions = new Vector();
           this.kind = determineKind( namespace, name );
  -  }
  +    }
       
       
       /**
  @@ -246,7 +248,7 @@
        */
       private static Kind determineKind( String namespace, String name ) {
           Kind result = Kind.DEAD;
  -
  +        
           if( DEFAULT_NAMESPACE.equals(namespace) ) {
               if( allComputedProperties.contains(name) )
                   result = Kind.COMPUTED;
  @@ -285,7 +287,7 @@
        */
       public boolean isProtected() {
           return(
  -            (this.kind == Kind.PROTECTED) || (this.kind == Kind.COMPUTED) );
  +                  (this.kind == Kind.PROTECTED) || (this.kind == Kind.COMPUTED) );
       }
       
       
  @@ -296,7 +298,7 @@
        */
       public boolean isLiveProperty() {
           return(
  -            (this.kind == Kind.LIVE) || (this.kind == Kind.PROTECTED) || (this.kind 
== Kind.COMPUTED) );
  +                  (this.kind == Kind.LIVE) || (this.kind == Kind.PROTECTED) || 
(this.kind == Kind.COMPUTED) );
       }
       
       
  @@ -520,12 +522,12 @@
           if (namespace == null)
               throw new ObjectValidationFailedException
                   (Messages.message
  -                 (NodeProperty.class.getName() + ".nullNamespace"));
  +                     (NodeProperty.class.getName() + ".nullNamespace"));
           
           if (value == null)
               throw new ObjectValidationFailedException
                   (Messages.message
  -                 (NodeProperty.class.getName() + ".nullValue"));
  +                     (NodeProperty.class.getName() + ".nullValue"));
           
       }
       
  @@ -548,7 +550,7 @@
               COMPUTED     = new Kind( COMPUTED_ID );
           
           private int id = 0;
  -    
  +        
           /**
            * Private constructor
            */
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to