cziegeler    2002/10/29 05:16:12

  Modified:    src/java/org/apache/cocoon/components/treeprocessor/variables
                        PreparedVariableResolver.java
  Log:
  Minor performance improvement
  
  Revision  Changes    Path
  1.6       +11 -5     
xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java
  
  Index: PreparedVariableResolver.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PreparedVariableResolver.java     12 Oct 2002 05:11:40 -0000      1.5
  +++ PreparedVariableResolver.java     29 Oct 2002 13:16:12 -0000      1.6
  @@ -87,6 +87,12 @@
       static final int STATEFUL_MODULE = -3;
       static final int ANCHOR = -4;
   
  +    private static final Integer ROOT_OBJ = new Integer(ROOT);
  +    private static final Integer LITERAL_OBJ = new Integer(LITERAL);
  +    private static final Integer THREADSAFE_MODULE_OBJ = new 
Integer(THREADSAFE_MODULE);
  +    private static final Integer STATEFUL_MODULE_OBJ = new Integer(STATEFUL_MODULE);
  +    private static final Integer ANCHOR_OBJ = new Integer(ANCHOR);
  +    
       public PreparedVariableResolver(String expr, ComponentManager manager) throws 
PatternException {
           
           this.originalExpr = expr;
  @@ -156,13 +162,13 @@
       }
       
       private void addLiteral(String litteral) {
  -        this.items.add(new Integer(LITERAL));
  +        this.items.add(LITERAL_OBJ);
           this.items.add(litteral);
       }
       
       private void addSitemapVariable(String variable) {
           if (variable.startsWith("/")) {
  -            this.items.add(new Integer(ROOT));
  +            this.items.add(ROOT_OBJ);
               this.items.add(variable.substring(1));
           }
           else {
  @@ -179,7 +185,7 @@
       }
   
       private void addAnchorVariable(String anchor, String variable) throws 
PatternException {
  -        this.items.add(new Integer(ANCHOR));
  +        this.items.add(ANCHOR_OBJ);
           this.items.add(anchor);
           this.items.add(variable);
       }
  @@ -205,13 +211,13 @@
           
           // Is this module threadsafe ?
           if (module instanceof ThreadSafe) {
  -            this.items.add(new Integer(this.THREADSAFE_MODULE));
  +            this.items.add(THREADSAFE_MODULE_OBJ);
               this.items.add(module);
               this.items.add(variable);
           } else {
               // Statefull module : release it
               this.selector.release(module);
  -            this.items.add(new Integer(this.STATEFUL_MODULE));
  +            this.items.add(STATEFUL_MODULE_OBJ);
               this.items.add(moduleName);
               this.items.add(variable);
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to