vladimir    2003/08/09 14:19:54

  Modified:    java/src/org/apache/xindice/core/indexer IndexPattern.java
                        IndexManager.java MemValueIndexer.java
                        IndexQuery.java ValueIndexer.java
               java/src/org/apache/xindice/xml/dom ContainerNodeImpl.java
                        ProcessingInstructionImpl.java DOMCompressor.java
                        NodeImpl.java NamedNodeMapImpl.java DOMParser.java
                        EntityReferenceImpl.java
               java/src/org/apache/xindice/xml SymbolTable.java
                        SymbolTableSymbols.java XMLCompressedInput.java
                        NodeSource.java NamespaceMap.java TextWriter.java
               java/src/org/apache/xindice/core MetaSystemCollection.java
                        DocumentCache.java Database.java Collection.java
               java/src/org/apache/xindice/server/rpc/messages
                        GetDocument.java RemoveDocument.java Query.java
               java/src/org/apache/xindice/tools XMLTools.java
               java/src/org/apache/xindice/server UglyBrowser.java
                        XindiceServlet.java
               java/src/org/apache/xindice/core/filer BTree.java
                        BTreeFiler.java Paged.java
               java/src/org/apache/xindice/core/data Variant.java
                        Types.java
               java/src/org/apache/xindice/xml/dom/traversal
                        TreeWalkerImpl.java
               java/src/org/apache/xindice/tools/command
                        ListCollections.java ImportTree.java
               java/src/org/apache/xindice/xml/sax SAXEventGenerator.java
               java/src/org/apache/xindice/core/request URIMapper.java
               java/src/org/apache/xindice/util ByteBuffer.java
                        LockManager.java
               java/src/org/apache/xindice/core/query QueryEngine.java
                        XPathQueryResolver.java
               java/src/org/apache/xindice/core/meta MetaData.java
  Log:
  - Boolean.valueOf -> new Boolean
  - minor cleanup (exceptions)
  
  Revision  Changes    Path
  1.8       +3 -3      
xml-xindice/java/src/org/apache/xindice/core/indexer/IndexPattern.java
  
  Index: IndexPattern.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/IndexPattern.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IndexPattern.java 9 Aug 2003 18:56:18 -0000       1.7
  +++ IndexPattern.java 9 Aug 2003 21:19:52 -0000       1.8
  @@ -106,7 +106,7 @@
               attrName = st.nextToken();
               if (attrName.equals("*")) {
                   attrID = PATTERN_WILDCARD;
  -                     } else {
  +            } else {
                   attrID = elemID == PATTERN_WILDCARD ? PATTERN_NAME
                           : SymbolTable.getNormalizedSymbol(symbols, attrName, 
nsMap, true);
               }
  
  
  
  1.20      +14 -14    
xml-xindice/java/src/org/apache/xindice/core/indexer/IndexManager.java
  
  Index: IndexManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/IndexManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- IndexManager.java 9 Aug 2003 19:47:33 -0000       1.19
  +++ IndexManager.java 9 Aug 2003 21:19:52 -0000       1.20
  @@ -415,9 +415,9 @@
                   try {
                       idxList[i].indexer.flush();
                   } catch (Exception e) {
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("ignored exception", 
e);
  -                                     }
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("ignored exception", e);
  +                    }
                   }
               }
           }
  @@ -430,9 +430,9 @@
                   try {
                       idxList[i].indexer.flush();
                   } catch (Exception e) {
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("ignored exception", 
e);
  -                                     }
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("ignored exception", e);
  +                    }
                   }
               }
           }
  @@ -488,9 +488,9 @@
                       try {
                           collection.flushSymbolTable();
                       } catch (Exception e) {
  -                                             if (log.isWarnEnabled()) {
  -                                                     log.warn("ignored 
exception", e);
  -                                             }
  +                        if (log.isWarnEnabled()) {
  +                            log.warn("ignored exception", e);
  +                        }
                       }
                   }
               } catch (Exception e) {
  @@ -546,9 +546,9 @@
                                   list[i].indexer.remove(value, key, pos, len, 
pattern.getElementID(), pattern.getAttributeID());
                                   break;
                               default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid action : " + action);
  -                             }    
  +                                if (log.isWarnEnabled()) {
  +                                    log.warn("invalid action : " + action);
  +                                }
                           }
                       } catch (Exception e) {
                           log.warn(e);
  
  
  
  1.6       +3 -3      
xml-xindice/java/src/org/apache/xindice/core/indexer/MemValueIndexer.java
  
  Index: MemValueIndexer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/MemValueIndexer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MemValueIndexer.java      8 Aug 2003 01:05:50 -0000       1.5
  +++ MemValueIndexer.java      9 Aug 2003 21:19:52 -0000       1.6
  @@ -1453,7 +1453,7 @@
            *
            * @param   theObject the Object to be compared.
            * @return  a negative integer, zero, or a positive integer as this 
object
  -         *           is less than, equal to, or greater than the specified 
object.
  +         *         is less than, equal to, or greater than the specified 
object.
            *
            * @throws ClassCastException if the specified object's type 
prevents it
            *         from being compared to this Object.
  
  
  
  1.6       +10 -10    
xml-xindice/java/src/org/apache/xindice/core/indexer/IndexQuery.java
  
  Index: IndexQuery.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/IndexQuery.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IndexQuery.java   9 Aug 2003 19:47:33 -0000       1.5
  +++ IndexQuery.java   9 Aug 2003 21:19:52 -0000       1.6
  @@ -74,10 +74,10 @@
    */
   public class IndexQuery {
   
  -     /**
  -      * Logger used by this class
  -      */
  -     private static final Log log = LogFactory.getLog(IndexQuery.class);
  +    /**
  +     * Logger used by this class
  +     */
  +    private static final Log log = LogFactory.getLog(IndexQuery.class);
   
       // No Operator
       public static final int ANY = 0;   // Any And All Matches
  @@ -263,10 +263,10 @@
               case NSW:
                   return value.startsWith(vals[0]) ? op == SW
                           : op == NSW;
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid operation : " + op);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid operation : " + op);
  +                }
           }
   
           return false;
  
  
  
  1.14      +7 -7      
xml-xindice/java/src/org/apache/xindice/core/indexer/ValueIndexer.java
  
  Index: ValueIndexer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/indexer/ValueIndexer.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ValueIndexer.java 9 Aug 2003 19:47:33 -0000       1.13
  +++ ValueIndexer.java 9 Aug 2003 21:19:52 -0000       1.14
  @@ -172,7 +172,7 @@
               } else {
                   if (pattern.indexOf('@') != -1) {
                       type = STRING;
  -                             } else {
  +                } else {
                       type = TRIMMED;
                   }
               }
  @@ -263,16 +263,16 @@
                       case BOOLEAN:
                           if ("[true][yes][1][y][on]".indexOf("[" + 
value.toString().toLowerCase() + "]") != -1) {
                               b[0] = 1;
  -                             } else if ("[false][no][0][n][off]".indexOf("[" 
+ value.toString().toLowerCase() + "]") != -1) {
  +                        } else if ("[false][no][0][n][off]".indexOf("[" + 
value.toString().toLowerCase() + "]") != -1) {
                               b[0] = 0;
                           } else {
                               return EmptyValue;
                           }
                           break;
                       default:
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("invalid type : " + type);
  -                     }
  +                        if (log.isWarnEnabled()) {
  +                            log.warn("invalid type : " + type);
  +                        }
                   }
                   return new Value(b);
               } catch (Exception e) {
  
  
  
  1.13      +13 -14    
xml-xindice/java/src/org/apache/xindice/xml/dom/ContainerNodeImpl.java
  
  Index: ContainerNodeImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/ContainerNodeImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ContainerNodeImpl.java    9 Aug 2003 19:47:32 -0000       1.12
  +++ ContainerNodeImpl.java    9 Aug 2003 21:19:52 -0000       1.13
  @@ -66,7 +66,6 @@
   import org.apache.xindice.xml.XMLCompressedInput;
   
   import org.w3c.dom.DOMException;
  -import org.w3c.dom.DocumentFragment;
   import org.w3c.dom.Element;
   import org.w3c.dom.Node;
   import org.w3c.dom.NodeList;
  @@ -197,10 +196,10 @@
                       childNodes.add(new NotationImpl(this, data, pos, len));
                       break;
                       
  -                             default:
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("invalid node type : " 
+ in.getNodeType());
  -                                     }
  +                default:
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("invalid node type : " + in.getNodeType());
  +                    }
               }
   
               bis.setPos(pos);
  @@ -277,7 +276,7 @@
           if (idx >= 0) {
               if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
                   childNodes.remove(idx);
  -                NodeList nl = ((DocumentFragment) newChild).getChildNodes();
  +                NodeList nl = newChild.getChildNodes();
                   for (int i = 0; i < nl.getLength(); i++) {
                       NodeImpl impl = (NodeImpl) nl.item(i);
                       impl.setParentNode(this);
  @@ -324,7 +323,7 @@
                   throw EX_HIERARCHY_REQUEST;
               }
               if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
  -                NodeList nl = ((DocumentFragment) newChild).getChildNodes();
  +                NodeList nl = newChild.getChildNodes();
                   for (int i = 0; i < nl.getLength(); i++) {
                       NodeImpl impl = (NodeImpl) nl.item(i);
                       impl.setParentNode(this);
  @@ -383,7 +382,7 @@
               throw EX_HIERARCHY_REQUEST;
           }
           if (newChild.getNodeType() == DOCUMENT_FRAGMENT_NODE) {
  -            NodeList nl = ((DocumentFragment) newChild).getChildNodes();
  +            NodeList nl = newChild.getChildNodes();
               for (int i = 0; i < nl.getLength(); i++) {
                   NodeImpl impl = (NodeImpl) nl.item(i);
                   impl.setParentNode(this);
  @@ -475,9 +474,9 @@
           NodeFilter filter = new NodeFilter() {
               public short acceptNode(Node node) {
                   if (node.getNodeName().equals(name)) {
  -                    return (short) NodeFilter.FILTER_ACCEPT;
  +                    return NodeFilter.FILTER_ACCEPT;
                   } else {
  -                    return (short) NodeFilter.FILTER_SKIP;
  +                    return NodeFilter.FILTER_SKIP;
                   }
               }
           };
  @@ -500,9 +499,9 @@
           NodeFilter filter = new NodeFilter() {
               public short acceptNode(Node node) {
                   if (node.getLocalName().equals(localName) && 
node.getNamespaceURI().equals(namespaceURI)) {
  -                    return (short) NodeFilter.FILTER_ACCEPT;
  +                    return NodeFilter.FILTER_ACCEPT;
                   } else {
  -                    return (short) NodeFilter.FILTER_SKIP;
  +                    return NodeFilter.FILTER_SKIP;
                   }
               }
           };
  
  
  
  1.11      +3 -3      
xml-xindice/java/src/org/apache/xindice/xml/dom/ProcessingInstructionImpl.java
  
  Index: ProcessingInstructionImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/ProcessingInstructionImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ProcessingInstructionImpl.java    9 Aug 2003 18:56:18 -0000       1.10
  +++ ProcessingInstructionImpl.java    9 Aug 2003 21:19:52 -0000       1.11
  @@ -99,7 +99,7 @@
       protected void checkLoaded() {
           if (loaded) {
               return;
  -             } else {
  +        } else {
               loaded = true;
           }
           
  
  
  
  1.9       +8 -8      
xml-xindice/java/src/org/apache/xindice/xml/dom/DOMCompressor.java
  
  Index: DOMCompressor.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/DOMCompressor.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DOMCompressor.java        9 Aug 2003 19:47:32 -0000       1.8
  +++ DOMCompressor.java        9 Aug 2003 21:19:52 -0000       1.9
  @@ -84,7 +84,7 @@
    */
   public final class DOMCompressor extends XMLCompressedOutput {
   
  -     private static final Log log = LogFactory.getLog(DOMCompressor.class);
  +    private static final Log log = LogFactory.getLog(DOMCompressor.class);
   
       public DOMCompressor(OutputStream os, SymbolTable st) {
           super(os, st);
  @@ -203,7 +203,7 @@
                           signature |= (byte) (Signatures.EntGt);
                       } else if (value.equals("&quot;")) {
                           signature |= (byte) (Signatures.EntQuot);
  -                     } else if (value.equals("&apos;")) {
  +                    } else if (value.equals("&apos;")) {
                           signature |= (byte) (Signatures.EntApos);
                       } else if (value.startsWith("&#x")) {
                           encoding = 1;
  @@ -280,10 +280,10 @@
                       break;
                   }
   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid node type : " + 
node.getNodeType());
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid node type : " + node.getNodeType());
  +                }
           }
           flush();
       }
  
  
  
  1.11      +15 -15    
xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- NodeImpl.java     9 Aug 2003 19:47:32 -0000       1.10
  +++ NodeImpl.java     9 Aug 2003 21:19:52 -0000       1.11
  @@ -80,7 +80,7 @@
    */
   public abstract class NodeImpl implements CompressedNode, DBNode {
   
  -     private static final Log log = LogFactory.getLog(NodeImpl.class);
  +    private static final Log log = LogFactory.getLog(NodeImpl.class);
   
       public static final String XMLNS_PREFIX = "xmlns";
   
  @@ -523,9 +523,9 @@
                       pos = 0;
                       len = data.length;
                   } catch (Exception e) {
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("ignored exception", 
e);
  -                                     }
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("ignored exception", e);
  +                    }
                   }
               }
   
  @@ -577,10 +577,10 @@
                       newNode = new TextImpl(this, data, pos, len);
                       break;
   
  -                             default:
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("invalid node type : " 
+ getNodeType());
  -                                     }
  +                default:
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("invalid node type : " + getNodeType());
  +                    }
               }
               if (newNode != null) {
                   return newNode;
  @@ -622,10 +622,10 @@
               case Node.TEXT_NODE:
                   return doc.createTextNode(nodeValue);
                   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid node type : " + 
getNodeType());
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid node type : " + getNodeType());
  +                }
           }
   
           return null;
  @@ -854,7 +854,7 @@
                   if (name.startsWith(XMLNS_PREFIX + ':')
                           && attr.getValue().equals(namespaceURI)) {
                       return name.substring(XMLNS_PREFIX.length() + 1);
  -                     }
  +                  }
               }
           }
           return parentNode != null ? 
parentNode.lookupNamespacePrefix(namespaceURI)
  
  
  
  1.7       +7 -8      
xml-xindice/java/src/org/apache/xindice/xml/dom/NamedNodeMapImpl.java
  
  Index: NamedNodeMapImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/NamedNodeMapImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NamedNodeMapImpl.java     9 Aug 2003 05:01:55 -0000       1.6
  +++ NamedNodeMapImpl.java     9 Aug 2003 21:19:52 -0000       1.7
  @@ -119,8 +119,9 @@
           if (node != null) {
               int idx = indexOf(node);
               set(idx, arg);
  -        } else
  +        } else {
               add(arg);
  +        }
           map.put(arg.getNodeName(), arg);
           return node;
       }
  @@ -143,9 +144,8 @@
       }
   
       public Node getNamedItemNS(String namespaceURI, String localName) {
  -        Iterator enum = iterator();
           Node node;
  -        for (int i = 0; enum.hasNext(); i++) {
  +        for (Iterator enum = iterator(); enum.hasNext(); ) {
               node = (Node) enum.next();
               String ns = node.getNamespaceURI();
               String ln = node.getLocalName();
  @@ -154,7 +154,7 @@
                       && ns.equals(namespaceURI)
                       && ln.equals(localName)) {
                   return node;
  -             }
  +            }
           }
           return null;
       }
  @@ -178,9 +178,8 @@
        * @param localName  The  local name of the attribute to remove.
        **/
       public Node removeNamedItemNS(String namespaceURI, String localName) 
throws DOMException {
  -        Iterator enum = iterator();
           Node node;
  -        for (int i = 0; enum.hasNext(); i++) {
  +        for (Iterator enum = iterator(); enum.hasNext(); ) {
               node = (Node) enum.next();
               if (localName.equals(node.getLocalName())) {
                   if ((namespaceURI == null && node.getNamespaceURI() == null) 
||
  
  
  
  1.12      +9 -9      
xml-xindice/java/src/org/apache/xindice/xml/dom/DOMParser.java
  
  Index: DOMParser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/DOMParser.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- DOMParser.java    9 Aug 2003 19:47:32 -0000       1.11
  +++ DOMParser.java    9 Aug 2003 21:19:52 -0000       1.12
  @@ -95,7 +95,7 @@
    */
   public final class DOMParser extends DefaultHandler implements DeclHandler, 
LexicalHandler {
   
  -     private static final Log log = LogFactory.getLog(DOMParser.class);
  +    private static final Log log = LogFactory.getLog(DOMParser.class);
   
       private SAXParser sp;
       private ErrorHandler errors = null;
  @@ -226,9 +226,9 @@
           try {
               xr.setProperty(name, value);
           } catch (Exception e) {
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           }
       }
   
  @@ -236,9 +236,9 @@
           try {
               xr.setFeature(name, value);
           } catch (Exception e) {
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           }
       }
   
  
  
  
  1.10      +6 -6      
xml-xindice/java/src/org/apache/xindice/xml/dom/EntityReferenceImpl.java
  
  Index: EntityReferenceImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/EntityReferenceImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EntityReferenceImpl.java  9 Aug 2003 19:47:32 -0000       1.9
  +++ EntityReferenceImpl.java  9 Aug 2003 21:19:52 -0000       1.10
  @@ -150,10 +150,10 @@
                           // TODO: This
                           break;
   
  -                                     default:
  -                                             if (log.isWarnEnabled()) {
  -                                                     log.warn("invalid 
entity type : " + entityType);
  -                                             }
  +                    default:
  +                        if (log.isWarnEnabled()) {
  +                            log.warn("invalid entity type : " + entityType);
  +                        }
                   }
               }
           } catch (Exception e) {
  
  
  
  1.9       +3 -3      
xml-xindice/java/src/org/apache/xindice/xml/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/SymbolTable.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SymbolTable.java  9 Aug 2003 18:56:18 -0000       1.8
  +++ SymbolTable.java  9 Aug 2003 21:19:52 -0000       1.9
  @@ -145,7 +145,7 @@
           int idx = qName.indexOf(':');
           if (idx != -1) {
               sb.append(qName.substring(idx + 1));
  -             } else {
  +        } else {
               sb.append(qName);
           }
           return sb.toString();
  
  
  
  1.7       +6 -6      
xml-xindice/java/src/org/apache/xindice/xml/SymbolTableSymbols.java
  
  Index: SymbolTableSymbols.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/SymbolTableSymbols.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SymbolTableSymbols.java   9 Aug 2003 19:47:33 -0000       1.6
  +++ SymbolTableSymbols.java   9 Aug 2003 21:19:52 -0000       1.7
  @@ -73,7 +73,7 @@
    */
   public final class SymbolTableSymbols extends SymbolTable {
   
  -     private static final Log log = 
LogFactory.getLog(SymbolTableSymbols.class);
  +    private static final Log log = 
LogFactory.getLog(SymbolTableSymbols.class);
   
       private static String SYMBOLS_DEFINITION
               = "<symbols>"
  @@ -90,9 +90,9 @@
           try {
               symbolsElem = 
DOMParser.toDocument(SYMBOLS_DEFINITION).getDocumentElement();
           } catch (Exception e) {
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           }
           streamFromXML(symbolsElem);
       }
  
  
  
  1.8       +23 -22    
xml-xindice/java/src/org/apache/xindice/xml/XMLCompressedInput.java
  
  Index: XMLCompressedInput.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/XMLCompressedInput.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- XMLCompressedInput.java   9 Aug 2003 19:47:33 -0000       1.7
  +++ XMLCompressedInput.java   9 Aug 2003 21:19:52 -0000       1.8
  @@ -74,10 +74,11 @@
    * @version CVS $Revision$, $Date$
    */
   public class XMLCompressedInput extends DataInputStream {
  -     
  -     private static final Log log = 
LogFactory.getLog(XMLCompressedInput.class);
  -     
  +
  +    private static final Log log = 
LogFactory.getLog(XMLCompressedInput.class);
  +
       private byte signature = 0;
  +    // TODO this variable is never accessed
       private SymbolTable st = null;
   
       public XMLCompressedInput(InputStream is, SymbolTable st) {
  @@ -120,7 +121,7 @@
                   type = (byte) ((signature & 0x20) >>> 0x5);
                   if (type == Signatures.CharText) {
                       return Node.TEXT_NODE;
  -                             } else {
  +                } else {
                       return Node.ENTITY_REFERENCE_NODE;
                   }
                   
  @@ -153,10 +154,10 @@
                           return Signatures.Unknown;
   
                   }
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid signature : " + type);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid signature : " + type);
  +                }
   
           }
           return Signatures.Unknown;
  @@ -188,10 +189,10 @@
               case Node.NOTATION_NODE:
                   sizeType = (byte) (signature & 0x03);
                   break;
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid node type : " + 
nodeType);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid node type : " + nodeType);
  +                }
           }
   
           switch (sizeType) {
  @@ -208,10 +209,10 @@
               case Signatures.NoContent:
                   // Do Nothing
   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid size : " + sizeType);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid size : " + sizeType);
  +                }
           }
           return 0;
       }
  @@ -243,10 +244,10 @@
               case Signatures.NoContent:
                   // Do Nothing
   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid signature type : " + 
countType);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid signature type : " + countType);
  +                }
           }
           return 0;
       }
  
  
  
  1.6       +3 -3      
xml-xindice/java/src/org/apache/xindice/xml/NodeSource.java
  
  Index: NodeSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/NodeSource.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NodeSource.java   9 Aug 2003 18:56:18 -0000       1.5
  +++ NodeSource.java   9 Aug 2003 21:19:52 -0000       1.6
  @@ -100,7 +100,7 @@
       public String getCanonicalName() {
           if (key != null) {
               return collection.getCanonicalDocumentName(key);
  -             } else {
  +        } else {
               return collection.getCanonicalName();
           }
       }
  
  
  
  1.8       +3 -3      
xml-xindice/java/src/org/apache/xindice/xml/NamespaceMap.java
  
  Index: NamespaceMap.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/NamespaceMap.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- NamespaceMap.java 9 Aug 2003 18:56:18 -0000       1.7
  +++ NamespaceMap.java 9 Aug 2003 21:19:52 -0000       1.8
  @@ -88,7 +88,7 @@
                   String pfx = (String) i.next();
                   if (pfx.equals("")) {
                       elem.setAttribute("xmlns", (String) get(pfx));
  -                             } else {
  +                } else {
                       elem.setAttribute("xmlns:" + pfx, (String) get(pfx));
                   }
               }
  
  
  
  1.13      +14 -16    
xml-xindice/java/src/org/apache/xindice/xml/TextWriter.java
  
  Index: TextWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/TextWriter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TextWriter.java   9 Aug 2003 19:47:33 -0000       1.12
  +++ TextWriter.java   9 Aug 2003 21:19:52 -0000       1.13
  @@ -99,7 +99,7 @@
        *
        * @param writer The Writer to write to
        */
  -    public void write(Writer writer) throws IOException {
  +    public void write(Writer writer) {
           write(node, writer);
       }
   
  @@ -108,7 +108,7 @@
        *
        * @param output The OutputStream to write to
        */
  -    public void write(OutputStream output) throws IOException {
  +    public void write(OutputStream output) {
           write(node, output);
       }
   
  @@ -223,10 +223,10 @@
                   writer.write("-->");
                   break;
                   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid node type : " + node);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid node type : " + node);
  +                }
           }
       }
   
  @@ -286,13 +286,15 @@
        * @param node The Node to write
        * @param writer The Writer to write to
        */
  -    public static void write(Node node, Writer writer) throws IOException {
  +    public static void write(Node node, Writer writer) {
           try {
               BufferedWriter buf = new BufferedWriter(writer, 4096);
               writeNode(buf, node);
               buf.flush();
           } catch (Exception e) {
  -            log.warn(e);
  +            if (log.isWarnEnabled()) {
  +                log.warn(e);
  +            }
           }
       }
   
  @@ -302,7 +304,7 @@
        * @param node The Node to write
        * @param output The OutputStream to write to
        */
  -    public static void write(Node node, OutputStream output) throws 
IOException {
  +    public static void write(Node node, OutputStream output) {
           try {
               OutputStreamWriter o = new OutputStreamWriter(output, "utf-8");
               write(node, o);
  @@ -319,11 +321,7 @@
        **/
       public static String toString(Node node) {
           StringWriter sw = new StringWriter();
  -        try {
  -            write(node, sw);
  -        } catch (IOException e) {
  -            log.warn(e);
  -        }
  +        write(node, sw);
           return sw.toString();
       }
   }
  
  
  
  1.11      +8 -8      
xml-xindice/java/src/org/apache/xindice/core/MetaSystemCollection.java
  
  Index: MetaSystemCollection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/MetaSystemCollection.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MetaSystemCollection.java 9 Aug 2003 19:47:32 -0000       1.10
  +++ MetaSystemCollection.java 9 Aug 2003 21:19:53 -0000       1.11
  @@ -192,9 +192,9 @@
               try {
                   dropCollection(mcol);
               } catch (DBException e) {
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("ignored exception", e);
  -                             }
  +                if (log.isWarnEnabled()) {
  +                    log.warn("ignored exception", e);
  +                }
               }
           }
       }
  @@ -257,9 +257,9 @@
               try {
                   mcol.remove(id);
               } catch (DBException e) {
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("ignored exception", e);
  -                             }
  +                if (log.isWarnEnabled()) {
  +                    log.warn("ignored exception", e);
  +                }
               }
           }
       }
  
  
  
  1.11      +8 -8      
xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java
  
  Index: DocumentCache.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/DocumentCache.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DocumentCache.java        9 Aug 2003 19:47:32 -0000       1.10
  +++ DocumentCache.java        9 Aug 2003 21:19:53 -0000       1.11
  @@ -81,9 +81,9 @@
    * @version CVS $Revision$, $Date$
    */
   public final class DocumentCache {
  -     
  -     private static final Log log = LogFactory.getLog(DocumentCache.class);
  -     
  +
  +    private static final Log log = LogFactory.getLog(DocumentCache.class);
  +
       private Map table = new WeakHashMap();
   
       /**
  @@ -103,9 +103,9 @@
                   NodeSource ns = new NodeSource(col, key);
                   doc = new DocumentImpl((byte[]) v, s, ns);
               } catch (Exception e) {
  -             if (log.isWarnEnabled()) {
  -                     log.warn("ignored exception", e);
  -             }
  +                if (log.isWarnEnabled()) {
  +                    log.warn("ignored exception", e);
  +                }
               }
           }
           return doc;
  
  
  
  1.28      +3 -3      
xml-xindice/java/src/org/apache/xindice/core/Database.java
  
  Index: Database.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Database.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Database.java     9 Aug 2003 18:56:19 -0000       1.27
  +++ Database.java     9 Aug 2003 21:19:53 -0000       1.28
  @@ -142,7 +142,7 @@
   
       /**
        * This will merely return an instance of a Database for the given
  -     *       name if one has already been loaded.
  +     *     name if one has already been loaded.
        *
        * @param name
        * @return Database
  
  
  
  1.33      +3 -3      
xml-xindice/java/src/org/apache/xindice/core/Collection.java
  
  Index: Collection.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Collection.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Collection.java   9 Aug 2003 18:56:19 -0000       1.32
  +++ Collection.java   9 Aug 2003 21:19:53 -0000       1.33
  @@ -1512,7 +1512,7 @@
           Document doc = getDocument(id);
           if (null == doc) {
               throw new DBException(FaultCodes.COL_DOCUMENT_NOT_FOUND, 
"Document " + id + " does not exist");
  -             }
  +           }
   
           if (null != meta) {
               if (meta.getType() == MetaData.UNKNOWN || meta.getType() == 
MetaData.COLLECTION) {
  
  
  
  1.6       +6 -6      
xml-xindice/java/src/org/apache/xindice/server/rpc/messages/GetDocument.java
  
  Index: GetDocument.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/rpc/messages/GetDocument.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GetDocument.java  9 Aug 2003 19:47:33 -0000       1.5
  +++ GetDocument.java  9 Aug 2003 21:19:53 -0000       1.6
  @@ -76,7 +76,7 @@
    */
   public class GetDocument extends RPCDefaultMessage {
   
  -     private static final Log log = LogFactory.getLog(GetDocument.class);
  +    private static final Log log = LogFactory.getLog(GetDocument.class);
   
       public Hashtable execute(Hashtable message) throws Exception {
           SymbolSerializer symbolSerializer = null;
  @@ -103,9 +103,9 @@
                   symbolSerializer = new SymbolSerializer(col.getSymbols());
               } catch (Exception e) {
                   // It's ok (in theory) for a Collection to have no symbol 
table
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("ignored exception", e);
  -                             }
  +                if (log.isWarnEnabled()) {
  +                    log.warn("ignored exception", e);
  +                }
               }
   
               long timestamp = 1;
  
  
  
  1.5       +3 -3      
xml-xindice/java/src/org/apache/xindice/server/rpc/messages/RemoveDocument.java
  
  Index: RemoveDocument.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/rpc/messages/RemoveDocument.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RemoveDocument.java       7 Aug 2003 20:13:23 -0000       1.4
  +++ RemoveDocument.java       9 Aug 2003 21:19:53 -0000       1.5
  @@ -82,7 +82,7 @@
   
           Collection col = getCollection((String) message.get(COLLECTION));
   
  -        col.remove((String) message.get(NAME));
  +        col.remove(message.get(NAME));
   
           Hashtable result = new Hashtable();
           result.put(RESULT, "yes");
  
  
  
  1.7       +3 -3      
xml-xindice/java/src/org/apache/xindice/server/rpc/messages/Query.java
  
  Index: Query.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/rpc/messages/Query.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Query.java        9 Aug 2003 02:33:30 -0000       1.6
  +++ Query.java        9 Aug 2003 21:19:53 -0000       1.7
  @@ -145,7 +145,7 @@
        * @return the result set as an XML document
        * @exception Exception
        */
  -    private String queryWrapper(NodeSet ns) throws Exception {
  +    private String queryWrapper(NodeSet ns) {
           // Turn the NodeSet into a document.
           DocumentImpl doc = new DocumentImpl();
   
  
  
  
  1.25      +3 -3      
xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java
  
  Index: XMLTools.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/XMLTools.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XMLTools.java     9 Aug 2003 18:56:19 -0000       1.24
  +++ XMLTools.java     9 Aug 2003 21:19:53 -0000       1.25
  @@ -306,7 +306,7 @@
       /**
        * This method is to carry out execution, after instance variables being 
setup by process( args )
        */
  -    public boolean execute() throws ClassNotFoundException, 
InstantiationException, IllegalAccessException, Exception {
  +    public boolean execute() throws Exception {
           init();
           String action = (String) table.get(ACTION);
   
  
  
  
  1.9       +70 -71    
xml-xindice/java/src/org/apache/xindice/server/UglyBrowser.java
  
  Index: UglyBrowser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/UglyBrowser.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- UglyBrowser.java  9 Aug 2003 19:47:33 -0000       1.8
  +++ UglyBrowser.java  9 Aug 2003 21:19:53 -0000       1.9
  @@ -71,7 +71,6 @@
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  -import java.io.IOException;
   import java.io.OutputStream;
   import java.util.StringTokenizer;
   
  @@ -83,7 +82,7 @@
    */
   public class UglyBrowser {
   
  -     private static final Log log = LogFactory.getLog(UglyBrowser.class);
  +    private static final Log log = LogFactory.getLog(UglyBrowser.class);
   
       /**
        *
  @@ -92,8 +91,8 @@
           super();
       }
   
  -    //       Get handling to provide simple HTTP access to the Xindice 
instance.
  -    public static void doGet(HttpServletRequest request, HttpServletResponse 
response, Database db) throws ServletException, IOException {
  +    //    Get handling to provide simple HTTP access to the Xindice instance.
  +    public static void doGet(HttpServletRequest request, HttpServletResponse 
response, Database db) throws ServletException {
           try {
               String contextPath = request.getContextPath();
               StringBuffer sb = new StringBuffer();
  @@ -167,20 +166,20 @@
           }
   
           String[] cols = col.listCollections();
  -             String dbLoc = parser.getDatabase();
  -             String parserPath = parser.getPath();
  -             StringBuffer baseHref = new StringBuffer();             
  -             baseHref.append("<a href=\"" + contextPath + "?" + dbLoc);      
      
  -             if(parserPath.startsWith("/") || dbLoc.endsWith("/")) {
  -                     baseHref.append(parserPath);
  -             } else {
  -                     baseHref.append("/" + parserPath);
  -             }
  +        String dbLoc = parser.getDatabase();
  +        String parserPath = parser.getPath();
  +        StringBuffer baseHref = new StringBuffer();
  +        baseHref.append("<a href=\"" + contextPath + "?" + dbLoc);
  +        if(parserPath.startsWith("/") || dbLoc.endsWith("/")) {
  +            baseHref.append(parserPath);
  +        } else {
  +            baseHref.append("/" + parserPath);
  +        }
   
           for (int i = 0; i < cols.length; i++) {
               result.append(baseHref);
               if(!baseHref.toString().endsWith("/")) {
  -             result.append("/");
  +                result.append("/");
               }
               result.append(cols[i]);
               result.append("\">");
  @@ -200,9 +199,9 @@
               }
           } catch (DBException e) {
               // do nothing but this collection cannot store documents.
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           }
   
           return result.toString();
  @@ -222,59 +221,59 @@
           }
   
           return "Document '" + document + "'<p>\n" 
  -             + escapeHtml(TextWriter.toString(doc));
  +            + escapeHtml(TextWriter.toString(doc));
       }
   
  -     /* simple function to escape the xml stuff that'll 
  -      * not be displayed correctly in html.
  -      */
  -     static public String escapeHtml(String value) {
  -             StringBuffer buf = new StringBuffer();
  -             for (int i = 0; i < value.length(); i++) {
  -                     char c = value.charAt(i);
  -                     switch (c) {
  -                             case '<' :
  -                                     buf.append("&lt;");
  -                                     break;
  -                             case '>' :
  -                                     buf.append("&gt;");
  -                                     break;
  -                             case '\'' :
  -                                     buf.append("&apos;");
  -                                     break;
  -                             case '\"' :
  -                                     buf.append("&quot;");
  -                                     break;
  -                             case '&' :
  -                                     buf.append("&amp;");
  -                                     break;
  -                             default :
  -                                     if (isLegalCharacter(c)) {
  -                                             buf.append(c);
  -                                     } else {
  -                                             buf.append("&#");
  -                                             buf.append(String.valueOf(c));
  -                                             buf.append(";");
  -                                     }
  -                                     break;
  -                     }
  -             }
  -             return buf.toString();
  -     }
  -
  -     /**
  -      * Is the given character allowed inside an HTML document?
  -      */
  -     static public boolean isLegalCharacter(char c) {
  -             return (c > 0x07) && (c < 0x80);
  -             /* TODO delete if the above works
  -             if ((c <= 0x07) || (c >= 0x80)) {
  -                     return false;
  -             } else {
  -                     return true;
  -             }
  -             */
  -     }
  +    /* simple function to escape the xml stuff that'll
  +     * not be displayed correctly in html.
  +     */
  +    static public String escapeHtml(String value) {
  +        StringBuffer buf = new StringBuffer();
  +        for (int i = 0; i < value.length(); i++) {
  +            char c = value.charAt(i);
  +            switch (c) {
  +                case '<' :
  +                    buf.append("&lt;");
  +                    break;
  +                case '>' :
  +                    buf.append("&gt;");
  +                    break;
  +                case '\'' :
  +                    buf.append("&apos;");
  +                    break;
  +                case '\"' :
  +                    buf.append("&quot;");
  +                    break;
  +                case '&' :
  +                    buf.append("&amp;");
  +                    break;
  +                default :
  +                    if (isLegalCharacter(c)) {
  +                        buf.append(c);
  +                    } else {
  +                        buf.append("&#");
  +                        buf.append(String.valueOf(c));
  +                        buf.append(";");
  +                    }
  +                    break;
  +            }
  +        }
  +        return buf.toString();
  +    }
  +
  +    /**
  +     * Is the given character allowed inside an HTML document?
  +     */
  +    static public boolean isLegalCharacter(char c) {
  +        return (c > 0x07) && (c < 0x80);
  +        /* TODO delete if the above works
  +        if ((c <= 0x07) || (c >= 0x80)) {
  +            return false;
  +        } else {
  +            return true;
  +        }
  +        */
  +    }
   
       public static class XPathPseudoParser {
   
  
  
  
  1.21      +10 -10    
xml-xindice/java/src/org/apache/xindice/server/XindiceServlet.java
  
  Index: XindiceServlet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/server/XindiceServlet.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- XindiceServlet.java       7 Aug 2003 20:13:23 -0000       1.20
  +++ XindiceServlet.java       9 Aug 2003 21:19:53 -0000       1.21
  @@ -154,12 +154,12 @@
   
                   //
                   // We need to ensure that the database points to a place 
where it makes
  -                //   sense. If the path in the system.xml file is an 
absolute path, then
  -                //   honor it. If it's not, we first check for the system 
property "xindice.db.home"
  -                //   and if the lookup is successful we use it as the 
database root parent. If
  -                //   the property is not set, we use /WEB-INF relative to 
the servlet context, unless
  -                //   the war has not been unpacked. In this case, we throw 
an exception and
  -                //   ask the user to specify the location of database root
  +                // sense. If the path in the system.xml file is an absolute 
path, then
  +                // honor it. If it's not, we first check for the system 
property "xindice.db.home"
  +                // and if the lookup is successful we use it as the database 
root parent. If
  +                // the property is not set, we use /WEB-INF relative to the 
servlet context, unless
  +                // the war has not been unpacked. In this case, we throw an 
exception and
  +                // ask the user to specify the location of database root
                   //
                   String dbRoot = 
rootCollectionConfiguration.getAttribute(Database.DBROOT, 
Database.DBROOT_DEFAULT);
   
  @@ -169,7 +169,7 @@
                   if (!new File(dbRoot).isAbsolute()) {
   
                       // Stupid hack but spec compliant.
  -                    //               If getRealPath() returns null the war 
archive has not been unpacked.
  +                    //        If getRealPath() returns null the war archive 
has not been unpacked.
                       //
                       String realPath = 
servletConfig.getServletContext().getRealPath("/WEB-INF");
   
  @@ -198,7 +198,7 @@
   
                   //
                   // We need to use this method to be consistent between 
deployments (embed, standalone, etc)
  -                //    and let the Database object maintain the set of 
Databases.
  +                //     and let the Database object maintain the set of 
Databases.
                   //
                   this.database = 
Database.getDatabase(rootCollectionConfiguration);
               }
  
  
  
  1.18      +4 -4      
xml-xindice/java/src/org/apache/xindice/core/filer/BTree.java
  
  Index: BTree.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/filer/BTree.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BTree.java        9 Aug 2003 18:56:18 -0000       1.17
  +++ BTree.java        9 Aug 2003 21:19:53 -0000       1.18
  @@ -542,7 +542,7 @@
           }
   
           public synchronized void write() throws IOException {
  -            ByteArrayOutputStream bos = new ByteArrayOutputStream((int) 
fileHeader.getWorkSize());
  +            ByteArrayOutputStream bos = new 
ByteArrayOutputStream(fileHeader.getWorkSize());
               DataOutputStream os = new DataOutputStream(bos);
   
               // Write out the Values
  @@ -561,7 +561,7 @@
               cache.put(new Long(page.getPageNum()), this);
           }
   
  -        public BTreeNode getChildNode(int idx) throws IOException {
  +        public BTreeNode getChildNode(int idx) {
               boolean load;
               BTreeRootInfo loadNode;
               long loadPtr;
  
  
  
  1.16      +5 -5      
xml-xindice/java/src/org/apache/xindice/core/filer/BTreeFiler.java
  
  Index: BTreeFiler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/filer/BTreeFiler.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BTreeFiler.java   9 Aug 2003 19:47:33 -0000       1.15
  +++ BTreeFiler.java   9 Aug 2003 21:19:53 -0000       1.16
  @@ -152,9 +152,9 @@
   
               return new Record(key, v, meta);
           } catch (BTreeNotFoundException e) {
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           } catch (BTreeException e) {
               throw e;
           } catch (Exception e) {
  
  
  
  1.20      +11 -11    
xml-xindice/java/src/org/apache/xindice/core/filer/Paged.java
  
  Index: Paged.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/filer/Paged.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Paged.java        9 Aug 2003 19:47:33 -0000       1.19
  +++ Paged.java        9 Aug 2003 21:19:53 -0000       1.20
  @@ -91,7 +91,7 @@
    */
   public abstract class Paged implements DBObject {
   
  -     private static final Log log = LogFactory.getLog(Paged.class);
  +    private static final Log log = LogFactory.getLog(Paged.class);
   
       // The maximum number of pages that will be held in the dirty cache.
       private static final int MAX_DIRTY_SIZE = 128;
  @@ -172,9 +172,9 @@
                           wait();
                           return (RandomAccessFile) descriptors.pop();
                       } catch (Exception e) {
  -                                             if (log.isWarnEnabled()) {
  -                                                     log.warn("ignored 
exception", e);
  -                                             }
  +                        if (log.isWarnEnabled()) {
  +                            log.warn("ignored exception", e);
  +                        }
                       }
                   }
               }
  @@ -248,7 +248,7 @@
        */
       protected final Value readValue(Page page) throws IOException {
           PageHeader sph = page.getPageHeader();
  -        ByteArrayOutputStream bos = new ByteArrayOutputStream((int) 
sph.getRecordLen());
  +        ByteArrayOutputStream bos = new 
ByteArrayOutputStream(sph.getRecordLen());
           Page p = page;
           PageHeader ph = null;
           long nextPage;
  @@ -264,7 +264,7 @@
               nextPage = ph.getNextPage();
               if (nextPage != NO_PAGE) {
                   p = getPage(nextPage);
  -                     } else {
  +            } else {
                   break;
               }
           }
  @@ -514,9 +514,9 @@
                           descCount -= 1;
                       } catch (Exception e) {
                           // TODO Hmmmm....
  -                                             if (log.isWarnEnabled()) {
  -                                                     log.warn("ignored 
exception", e);
  -                                             }
  +                        if (log.isWarnEnabled()) {
  +                            log.warn("ignored exception", e);
  +                        }
                       }
                   }
                   return true;
  
  
  
  1.8       +7 -7      
xml-xindice/java/src/org/apache/xindice/core/data/Variant.java
  
  Index: Variant.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/data/Variant.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Variant.java      9 Aug 2003 18:56:19 -0000       1.7
  +++ Variant.java      9 Aug 2003 21:19:53 -0000       1.8
  @@ -96,7 +96,7 @@
       }
   
       public Variant(boolean value) {
  -        this.value = Boolean.valueOf(value);
  +        this.value = new Boolean(value);
           type = Types.BOOLEAN;
       }
   
  @@ -187,7 +187,7 @@
        * @param value The value
        */
       public void set(boolean value) {
  -        this.value = Boolean.valueOf(value);
  +        this.value = new Boolean(value);
           type = Types.BOOLEAN;
       }
   
  @@ -427,7 +427,7 @@
       public Element getElement() {
           if (type == Types.ELEMENT) {
               return (Element) value;
  -             } else {
  +        } else {
               return null;
           }
       }
  @@ -440,7 +440,7 @@
       public Document getDocument() {
           if (type == Types.DOCUMENT) {
               return (Document) value;
  -             } else {
  +        } else {
               return null;
           }
       }
  @@ -453,7 +453,7 @@
       public DocumentFragment getDocumentFragment() {
           if (type == Types.DOCUMENTFRAGMENT) {
               return (DocumentFragment) value;
  -             } else {
  +        } else {
               return null;
           }
       }
  
  
  
  1.9       +12 -12    
xml-xindice/java/src/org/apache/xindice/core/data/Types.java
  
  Index: Types.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/data/Types.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Types.java        9 Aug 2003 19:47:33 -0000       1.8
  +++ Types.java        9 Aug 2003 21:19:53 -0000       1.9
  @@ -77,10 +77,10 @@
    */
   public final class Types {
   
  -     /**
  -      * Logger used by this class
  -      */
  -     private static final Log log = LogFactory.getLog(Types.class);
  +    /**
  +     * Logger used by this class
  +     */
  +    private static final Log log = LogFactory.getLog(Types.class);
   
       public final static int EMPTY = -1;
       public final static int UNKNOWN = -1;
  @@ -143,11 +143,11 @@
                   return STRING;
               } else if (c == Variant.class) {
                   return VARIANT;
  -             } else if (Element.class.isAssignableFrom(c)) {
  +            } else if (Element.class.isAssignableFrom(c)) {
                   return ELEMENT;
  -             } else if (Document.class.isAssignableFrom(c)) {
  +            } else if (Document.class.isAssignableFrom(c)) {
                   return DOCUMENT;
  -                     } else if (DocumentFragment.class.isAssignableFrom(c)) {
  +            } else if (DocumentFragment.class.isAssignableFrom(c)) {
                   return DOCUMENTFRAGMENT;
               }
           }
  @@ -197,9 +197,9 @@
               case VARIANT:
                   return "Variant";
               default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid type found : " + 
type);
  -                             }
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid type found : " + type);
  +                }
           }
           return "Invalid";
       }
  
  
  
  1.7       +4 -6      
xml-xindice/java/src/org/apache/xindice/xml/dom/traversal/TreeWalkerImpl.java
  
  Index: TreeWalkerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/traversal/TreeWalkerImpl.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TreeWalkerImpl.java       9 Aug 2003 18:56:19 -0000       1.6
  +++ TreeWalkerImpl.java       9 Aug 2003 21:19:53 -0000       1.7
  @@ -127,9 +127,7 @@
   
       public boolean acceptNode(Node node) {
           return ((getShowType(node) & whatToShow) > 0)
  -                && (filter == null
  -                || (filter != null
  -                && filter.acceptNode(node) == NodeFilter.FILTER_ACCEPT));
  +                && (filter == null || filter.acceptNode(node) == 
NodeFilter.FILTER_ACCEPT);
       }
   
       /**
  @@ -355,7 +353,7 @@
           Node result = null;
           if (next != null) {
               result = next;
  -             } else {
  +        } else {
               return null;
           }
           
  
  
  
  1.11      +3 -3      
xml-xindice/java/src/org/apache/xindice/tools/command/ListCollections.java
  
  Index: ListCollections.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/command/ListCollections.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ListCollections.java      7 Aug 2003 20:13:24 -0000       1.10
  +++ ListCollections.java      9 Aug 2003 21:19:53 -0000       1.11
  @@ -97,7 +97,7 @@
                                                  (String) 
table.get(XMLTools.LOCAL));
   
   
  -                     
  +
               // Get a Collection reference
               col = DatabaseManager.getCollection(colstring);
               if (col == null) {
  
  
  
  1.11      +3 -5      
xml-xindice/java/src/org/apache/xindice/tools/command/ImportTree.java
  
  Index: ImportTree.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/tools/command/ImportTree.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ImportTree.java   7 Aug 2003 20:13:24 -0000       1.10
  +++ ImportTree.java   9 Aug 2003 21:19:53 -0000       1.11
  @@ -132,9 +132,7 @@
       }
   
       // Recursive function to create collections/documents
  -    void process(File directory, String baseCollection, Hashtable table)
  -            throws Exception {
  -
  +    void process(File directory, String baseCollection, Hashtable table) {
           try {
               // The file extension to use for reading in files
               final String ext = (String) table.get(XMLTools.EXTENSION);
  
  
  
  1.26      +15 -14    
xml-xindice/java/src/org/apache/xindice/xml/sax/SAXEventGenerator.java
  
  Index: SAXEventGenerator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/sax/SAXEventGenerator.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- SAXEventGenerator.java    9 Aug 2003 19:47:32 -0000       1.25
  +++ SAXEventGenerator.java    9 Aug 2003 21:19:53 -0000       1.26
  @@ -232,7 +232,7 @@
           if (name.equals(CompressionHandler.HANDLER)
                   && value instanceof CompressionHandler) {
               comp = (CompressionHandler) value;
  -     }
  +        }
       }
   
       public void setEntityResolver(EntityResolver resolver) {
  @@ -277,7 +277,7 @@
           int idx = qname.indexOf(":");
           if (idx != -1) {
               return qname.substring(idx + 1);
  -             } else {
  +        } else {
               return qname;
           }
       }
  @@ -368,8 +368,9 @@
                   comp.dataLocation(pos, len);
               }
               content.startElement(nsURI != null ? nsURI : "", localName, 
elemName, attrs);
  -        } else
  +        } else {
               in.readInt();
  +        }
   
           while (!interrupt && bis.available() > 0) {
               pos = bis.getPos();
  @@ -399,7 +400,7 @@
                           tin.readSignature(); // Skip The Signature
                           if (type == Node.TEXT_NODE) {
                               tin.readContentSize();
  -                                             } else {
  +                        } else {
                               tin.readInt();
                           }
                           
  @@ -425,10 +426,10 @@
                                   // TODO: This
                                   break;
                                   
  -                                                     default:
  -                                                             if 
(log.isWarnEnabled()) {
  -                                                                     
log.warn("invalid type : " + type);
  -                                                             }
  +                            default:
  +                                if (log.isWarnEnabled()) {
  +                                    log.warn("invalid type : " + type);
  +                                }
                           }
   
                           break;
  @@ -441,10 +442,10 @@
                   case Node.NOTATION_NODE:
                       break;
                       
  -                             default:
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("invalid node type : " 
+ type);
  -                                     }
  +                default:
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("invalid node type : " + type);
  +                    }
               }
   
               bis.setPos(pos);
  
  
  
  1.17      +6 -6      
xml-xindice/java/src/org/apache/xindice/core/request/URIMapper.java
  
  Index: URIMapper.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/request/URIMapper.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- URIMapper.java    9 Aug 2003 19:47:33 -0000       1.16
  +++ URIMapper.java    9 Aug 2003 21:19:53 -0000       1.17
  @@ -412,10 +412,10 @@
                       return COLLECTION;
                   }
   
  -                     default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid object type : " + 
objType);
  -                             }
  +            default:
  +                if (log.isWarnEnabled()) {
  +                    log.warn("invalid object type : " + objType);
  +                }
           }
   
           return UNKNOWN;
  
  
  
  1.9       +6 -6      
xml-xindice/java/src/org/apache/xindice/util/ByteBuffer.java
  
  Index: ByteBuffer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/util/ByteBuffer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ByteBuffer.java   9 Aug 2003 19:47:33 -0000       1.8
  +++ ByteBuffer.java   9 Aug 2003 21:19:53 -0000       1.9
  @@ -87,7 +87,7 @@
    */
   public final class ByteBuffer extends OutputStream implements Serializable {
   
  -     private static final Log log = LogFactory.getLog(ByteBuffer.class);
  +    private static final Log log = LogFactory.getLog(ByteBuffer.class);
   
       static final long serialVersionUID = -3900903004630456844L;
   
  @@ -205,9 +205,9 @@
           try {
               value.writeTo(this);
           } catch (Exception e) {
  -                     if (log.isWarnEnabled()) {
  -                             log.warn("ignored exception", e);
  -                     }
  +            if (log.isWarnEnabled()) {
  +                log.warn("ignored exception", e);
  +            }
           }
       }
   
  
  
  
  1.7       +9 -10     
xml-xindice/java/src/org/apache/xindice/util/LockManager.java
  
  Index: LockManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/util/LockManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- LockManager.java  9 Aug 2003 19:47:33 -0000       1.6
  +++ LockManager.java  9 Aug 2003 21:19:53 -0000       1.7
  @@ -74,7 +74,7 @@
    */
   public final class LockManager {
   
  -     private static final Log log = LogFactory.getLog(LockManager.class);
  +    private static final Log log = LogFactory.getLog(LockManager.class);
   
       private int maxLocks = 0;
       private Map locks = new HashMap(); // Long to LockInfo
  @@ -109,9 +109,9 @@
                   try {
                       info.wait();
                   } catch (Exception e) {
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("ignored exception", 
e);
  -                                     }
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("ignored exception", e);
  +                    }
                   }
               }
               info.count++;
  @@ -178,9 +178,9 @@
                   try {
                       info.wait();
                   } catch (Exception e) {
  -                                     if (log.isWarnEnabled()) {
  -                                             log.warn("ignored exception", 
e);
  -                                     }
  +                    if (log.isWarnEnabled()) {
  +                        log.warn("ignored exception", e);
  +                    }
                   }
                   stolen = maxLocks - info.count;
                   total += stolen;
  @@ -220,7 +220,6 @@
               }
           }
       }
  -
   
       /**
        * LockInfo is just an int wrapper.
  
  
  
  1.9       +6 -6      
xml-xindice/java/src/org/apache/xindice/core/query/QueryEngine.java
  
  Index: QueryEngine.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/query/QueryEngine.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- QueryEngine.java  9 Aug 2003 05:01:56 -0000       1.8
  +++ QueryEngine.java  9 Aug 2003 21:19:53 -0000       1.9
  @@ -282,7 +282,7 @@
       public static Key[] orKeySets(Key[][] keySets) {
           if (keySets.length == 0) {
               return EmptyKeys;
  -     } else if (keySets.length == 1) {
  +        } else if (keySets.length == 1) {
               return keySets[0];
           } else if (keySets.length == 2) {
               // Optimization since most ORs will be 2 sets only
  @@ -357,7 +357,7 @@
                   
                   int end = value.indexOf(';', idx) + 1;
                   if (end == 0) {
  -                     // Some sort of error
  +                    // Some sort of error
                       return value;
                   }
   
  @@ -366,14 +366,14 @@
                       sb.append("'");
                   } else if (token.equals("quot")) {
                       sb.append("\"");
  -             } else if (token.equals("amp")) {
  +                } else if (token.equals("amp")) {
                       sb.append("&");
                   } else if (token.equals("lt")) {
                       sb.append("<");
                   } else if (token.equals("gt")) {
                       sb.append(">");
                   } else {
  -                     // Some sort of error
  +                    // Some sort of error
                       return value;
                   }
   
  
  
  
  1.22      +18 -17    
xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
  
  Index: XPathQueryResolver.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XPathQueryResolver.java   9 Aug 2003 19:47:33 -0000       1.21
  +++ XPathQueryResolver.java   9 Aug 2003 21:19:53 -0000       1.22
  @@ -161,6 +161,7 @@
       public static final int FUNC_SUBSTRING = 29;
       public static final int FUNC_STRING_LENGTH = 30;
   
  +    // TODO this variable is never accessed
       private QueryEngine engine;
       private DefaultErrorHandler errorListener = new DefaultErrorHandler();
       private boolean autoIndex = false;
  @@ -667,7 +668,7 @@
               return new NamedKeys(owner, (op == OpCodes.FROM_ATTRIBUTES), 
andKeys(ks));
           }
   
  -        private Object evalLiteral(String owner, int pos) throws Exception {
  +        private Object evalLiteral(String owner, int pos) {
               int idx = cmp.getOp(Compiler.getFirstChildPos(pos));
               switch (idx) {
                   case OpCodes.EMPTY :
  @@ -748,7 +749,7 @@
                   Object o = args.get(0);
                   if (o instanceof XObject) {
                       return new 
XString(QueryEngine.normalizeString(((XObject) o).str()));
  -                             } else {
  +                } else {
                       return o;
                   }
               }
  @@ -807,7 +808,7 @@
                       String ps;
                       if (nk.attribute && nk.name.indexOf('@') == -1) {
                           ps = owner + "@" + nk.name;
  -                                     } else {
  +                    } else {
                           ps = nk.name;
                       }
   
  @@ -828,7 +829,7 @@
                   Object o = args.get(0);
                   if (o instanceof XObject) {
                       return new XString(((XObject) o).str());
  -                             } else {
  +                } else {
                       return o;
                   }
               }
  @@ -872,7 +873,7 @@
                       int i = val.indexOf(sub);
                       if (i == -1) {
                           return new XString("");
  -                                     } else {
  +                    } else {
                           return new XString(val.substring(i + sub.length()));
                       }
                   }
  @@ -890,7 +891,7 @@
                       int i = val.indexOf(sub);
                       if (i == -1) {
                           return new XString("");
  -                                     } else {
  +                    } else {
                           return new XString(val.substring(0, i));
                       }
                   }
  @@ -955,14 +956,14 @@
                           case XObject.CLASS_STRING :
                               if (ps.indexOf('@') != -1) {
                                   type = "string";
  -                                                     } else {
  +                            } else {
                                   type = "trimmed";
                               }
                               break;
                           default:
  -                             if (log.isWarnEnabled()) {
  -                                     log.warn("invalid object type : " + 
objType);
  -                             }
  +                            if (log.isWarnEnabled()) {
  +                                log.warn("invalid object type : " + objType);
  +                            }
                       }
                       if (type != null) {
                           e.setAttribute("type", type);
  @@ -988,9 +989,9 @@
            */
           private Object queryComparison(int op, String owner, Object left, 
Object right) {
               if (!((left instanceof NamedKeys)
  -                     && (right instanceof XObject)
  -                     || (left instanceof XObject)
  -                     && (right instanceof NamedKeys))) {
  +                    && (right instanceof XObject)
  +                    || (left instanceof XObject)
  +                    && (right instanceof NamedKeys))) {
                   return null; // How'd we get here?
               }
   
  @@ -1013,7 +1014,7 @@
               String ps;
               if (nk.attribute && nk.name.indexOf('@') == -1) {
                   ps = owner + "@" + nk.name;
  -                     } else {
  +            } else {
                   ps = nk.name;
               }
   
  @@ -1149,7 +1150,7 @@
                           
                       case XObject.CLASS_BOOLEAN :
                           ni = EMPTY_NODE_ITERATOR;
  -                        node = Boolean.valueOf(xobject.bool());      
  +                        node = new Boolean(xobject.bool());
                           break;
   
                       case XObject.CLASS_STRING :
  
  
  
  1.11      +4 -4      
xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java
  
  Index: MetaData.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MetaData.java     9 Aug 2003 18:56:19 -0000       1.10
  +++ MetaData.java     9 Aug 2003 21:19:54 -0000       1.11
  @@ -255,7 +255,7 @@
   
           if (o instanceof Number) {
               Number n = (Number) o;
  -            return Boolean.valueOf(n.intValue() != 0);
  +            return new Boolean(n.intValue() != 0);
           }
   
           return Boolean.valueOf(o.toString());
  @@ -626,7 +626,7 @@
   
                       String attrName = e.getAttribute(A_NAME);
                       if (null == attrName) {
  -                     continue;
  +                        continue;
                       }
   
                       if (null == this.attrs) {
  
  
  

Reply via email to