Author: vgritsenko
Date: Thu Dec 15 13:50:11 2005
New Revision: 357073

URL: http://svn.apache.org/viewcvs?rev=357073&view=rev
Log:
cleanup

Modified:
    xml/xindice/trunk/java/src/org/apache/xindice/core/query/QueryEngine.java
    
xml/xindice/trunk/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
    
xml/xindice/trunk/java/src/org/apache/xindice/core/xupdate/XUpdateQueryResolver.java

Modified: 
xml/xindice/trunk/java/src/org/apache/xindice/core/query/QueryEngine.java
URL: 
http://svn.apache.org/viewcvs/xml/xindice/trunk/java/src/org/apache/xindice/core/query/QueryEngine.java?rev=357073&r1=357072&r2=357073&view=diff
==============================================================================
--- xml/xindice/trunk/java/src/org/apache/xindice/core/query/QueryEngine.java 
(original)
+++ xml/xindice/trunk/java/src/org/apache/xindice/core/query/QueryEngine.java 
Thu Dec 15 13:50:11 2005
@@ -57,18 +57,20 @@
     private static final String RESOLVER = "resolver";
     private static final String CLASS = "class";
 
-    private Database db;
-    private Map resolvers = new HashMap();
+    private final Database db;
+    private final Map resolvers;
+
 
     public QueryEngine(Database db) {
         this.db = db;
+        this.resolvers = new HashMap();
     }
 
     public void setConfig(Configuration config) throws XindiceException {
         super.setConfig(config);
         config.processChildren(RESOLVER, new ConfigurationCallback() {
             public void process(Configuration cfg) {
-                String className = cfg.getAttribute(CLASS);
+                final String className = cfg.getAttribute(CLASS);
                 try {
                     QueryResolver res = (QueryResolver) 
Class.forName(className).newInstance();
                     res.setConfig(cfg);
@@ -76,7 +78,8 @@
                     resolvers.put(res.getQueryStyle(), res);
                 } catch (Exception e) {
                     if (log.isWarnEnabled()) {
-                        log.warn("ignored exception", e);
+                        log.warn("Unable to load query resolver: " + className 
+ ". " +
+                                 "This query resolver will not be available.", 
e);
                     }
                 }
             }
@@ -255,7 +258,6 @@
         }
 
         SortedSet set = new TreeSet();
-
         for (int i = 0; i < keySets.length; i++) {
             for (int j = 0; j < keySets[i].length; j++) {
                 set.add(keySets[i][j]);
@@ -291,7 +293,7 @@
         if (white && pos > 0) {
             pos--;
         }
-        
+
         return new String(n, 0, pos);
     }
 
@@ -307,7 +309,7 @@
         if (idx == -1) {
             return value;
         }
-        
+
         StringBuffer sb = new StringBuffer(value.length());
         int pos = 0;
         while (pos < value.length()) {
@@ -315,7 +317,7 @@
                 if (idx > pos) {
                     sb.append(value.substring(pos, idx));
                 }
-                
+
                 int end = value.indexOf(';', idx) + 1;
                 if (end == 0) {
                     // Some sort of error
@@ -347,5 +349,4 @@
         }
         return sb.toString();
     }
-
 }

Modified: 
xml/xindice/trunk/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
URL: 
http://svn.apache.org/viewcvs/xml/xindice/trunk/java/src/org/apache/xindice/core/query/XPathQueryResolver.java?rev=357073&r1=357072&r2=357073&view=diff
==============================================================================
--- 
xml/xindice/trunk/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
 (original)
+++ 
xml/xindice/trunk/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
 Thu Dec 15 13:50:11 2005
@@ -152,7 +152,7 @@
     }
 
     public void setQueryEngine(QueryEngine engine) {
-        // Not used: this.engine = engine;
+        // FIXME Not used: this.engine = engine;
     }
 
     public Query compileQuery(Collection context, String query, NamespaceMap 
nsMap, Key[] keys)

Modified: 
xml/xindice/trunk/java/src/org/apache/xindice/core/xupdate/XUpdateQueryResolver.java
URL: 
http://svn.apache.org/viewcvs/xml/xindice/trunk/java/src/org/apache/xindice/core/xupdate/XUpdateQueryResolver.java?rev=357073&r1=357072&r2=357073&view=diff
==============================================================================
--- 
xml/xindice/trunk/java/src/org/apache/xindice/core/xupdate/XUpdateQueryResolver.java
 (original)
+++ 
xml/xindice/trunk/java/src/org/apache/xindice/core/xupdate/XUpdateQueryResolver.java
 Thu Dec 15 13:50:11 2005
@@ -60,8 +60,6 @@
 
     public static final String STYLE_XUPDATE = "XUpdate";
 
-    private QueryEngine engine;
-
 
     public void setConfig(Configuration config) throws XindiceException {
         super.setConfig(config);
@@ -72,7 +70,7 @@
     }
 
     public void setQueryEngine(QueryEngine engine) {
-        this.engine = engine;
+        // FIXME Not used this.engine = engine;
     }
 
     public Query compileQuery(Collection context, String query, NamespaceMap 
nsMap, Key[] keys) throws QueryException {


Reply via email to