Author: ogrisel
Date: Thu May 12 17:19:08 2011
New Revision: 1102388

URL: http://svn.apache.org/viewvc?rev=1102388&view=rev
Log:
more warning fixes

Modified:
    
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
    
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrDirectoryManager.java
    
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java

Modified: 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java?rev=1102388&r1=1102387&r2=1102388&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
 (original)
+++ 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/ConfigUtils.java
 Thu May 12 17:19:08 2011
@@ -197,9 +197,11 @@ public final class ConfigUtils {
             log.info(String.format("Copy Default Config from jar-file %s to %s 
(override=%s)",
                 sourceRoot.getName(),rootDir.getAbsolutePath(),override));
             try {
-                for(Enumeration<ZipArchiveEntry> entries = 
(Enumeration<ZipArchiveEntry>)archive.getEntries();entries.hasMoreElements();){
+                for (@SuppressWarnings("unchecked")
+                Enumeration<ZipArchiveEntry> entries = 
(Enumeration<ZipArchiveEntry>) archive.getEntries(); entries
+                        .hasMoreElements();) {
                     ZipArchiveEntry entry = entries.nextElement();
-                    if(entry.getName().startsWith(CONFIG_DIR)){
+                    if (entry.getName().startsWith(CONFIG_DIR)) {
                         copyResource(rootDir, archive, entry, CONFIG_DIR, 
override);
                     }
                 }
@@ -498,9 +500,11 @@ public final class ConfigUtils {
             log.info(String.format("Copy core %s config from jar-file %s to %s 
(override=%s)",
                 (coreName == 
null?"":coreName),sourceRoot.getName(),coreDir.getAbsolutePath(),override));
             try {
-                for(Enumeration<ZipArchiveEntry> entries = 
(Enumeration<ZipArchiveEntry>)archive.getEntries();entries.hasMoreElements();){
+                for (@SuppressWarnings("unchecked")
+                Enumeration<ZipArchiveEntry> entries = 
(Enumeration<ZipArchiveEntry>) archive.getEntries(); entries
+                        .hasMoreElements();) {
                     ZipArchiveEntry entry = entries.nextElement();
-                    if(entry.getName().startsWith(context)){
+                    if (entry.getName().startsWith(context)) {
                         copyResource(coreDir, archive, entry, context, 
override);
                     }
                 }

Modified: 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrDirectoryManager.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrDirectoryManager.java?rev=1102388&r1=1102387&r2=1102388&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrDirectoryManager.java
 (original)
+++ 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrDirectoryManager.java
 Thu May 12 17:19:08 2011
@@ -202,11 +202,6 @@ public class DefaultSolrDirectoryManager
      * a value for {@link #UNINITIALISED_INDEX_ARCHIVE_NAME_KEY}.
      */
     private ArchiveInputStream lookupIndexArchive(ComponentContext context, 
String solrIndexName,java.util.Properties properties) throws IOException, 
IllegalStateException {
-        String archiveName = 
properties.getProperty(UNINITIALISED_INDEX_ARCHIVE_NAME_KEY);
-        if(archiveName == null){
-            throw new IllegalStateException("Found uninitialised index config 
that does not contain the required "+
-                UNINITIALISED_INDEX_ARCHIVE_NAME_KEY+" property!");
-        }
         //we need to copy the properties to a map
         Map<String,String> propMap;
         if(properties == null){
@@ -218,6 +213,11 @@ public class DefaultSolrDirectoryManager
                 propMap.put(entry.getKey().toString(), 
entry.getValue()!=null?entry.getValue().toString():null);
             }
         }
+        String archiveName = 
properties.getProperty(UNINITIALISED_INDEX_ARCHIVE_NAME_KEY);
+        if(archiveName == null){
+            throw new IllegalStateException("Found uninitialised index config 
that does not contain the required "+
+                UNINITIALISED_INDEX_ARCHIVE_NAME_KEY+" property!");
+        }
         propMap.remove(UNINITIALISED_INDEX_ARCHIVE_NAME_KEY);//do not parse 
this internal property
         InputStream is = 
dataFileProvider.getInputStream(context.getBundleContext().getBundle().getSymbolicName(),
 archiveName, propMap);
         return is == null?null:ConfigUtils.getArchiveInputStream(archiveName, 
is);
@@ -285,9 +285,6 @@ public class DefaultSolrDirectoryManager
             throw new IllegalArgumentException("The parsed name of the Solr 
index MUST NOT be empty");
         }
         File managedCoreContainerDirectory = lookupManagedSolrDir(context);
-        if(solrIndexName == null){ //if the indexName is null
-            return managedCoreContainerDirectory; //return the root directory
-        }
         File coreDir = new File(managedCoreContainerDirectory,solrIndexName);
         if(!coreDir.exists()){
             //first add the index to the list of currently init cores
@@ -467,7 +464,6 @@ public class DefaultSolrDirectoryManager
     protected void activate(ComponentContext context) throws IOException {
         componentContext = context;
         withinOSGI = true;
-        Map<String,java.util.Properties> uninitIndexes;
         synchronized (uninitialisedCores) {
             
uninitialisedCores.putAll(loadUninitialisedIndexConfigs(componentContext));
         }

Modified: 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java?rev=1102388&r1=1102387&r2=1102388&view=diff
==============================================================================
--- 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java
 (original)
+++ 
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java
 Thu May 12 17:19:08 2011
@@ -537,7 +537,6 @@ public class SolrQueryFactory {
                 for(Set<String> andParts : orParts){
                     i++;
                     //add the and constraints to all or
-                    List<StringBuilder> andConstaints;
                     if(i == orParts.size()){
                         //for the last iteration, append the part to the 
existing constraints
                         for(int j=0;j<constraintsSize;j++){
@@ -549,7 +548,6 @@ public class SolrQueryFactory {
                         for(int j=0;j<constraintsSize;j++){
                             List<StringBuilder> additional = new 
ArrayList<StringBuilder>(constraints.get(j));
                             encodeAndParts(andParts, additional);
-//                            additional.append(part);
                             constraints.add(additional);
                         }
                     }


Reply via email to