You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2011/03/16 19:44:00 UTC

svn commit: r1082257 [1/4] - in /incubator/stanbol/trunk/entityhub: ./ generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ generic/core/src/main/java/org/apache/stanbo...

Author: rwesten
Date: Wed Mar 16 18:43:57 2011
New Revision: 1082257

URL: http://svn.apache.org/viewvc?rev=1082257&view=rev
Log:
Code cleanups base on Sonar violation drilldown and hotspots. 
Also organised imports and replaced different used JSON libs with Jettison.

There are several changes in unit tests because of switching to throw IllegalArgumentException instead of NullPointerExceptions in cases where NULL is parsed for parameters that do not allow null values. Such changes are also reflected in the Java doc of the affected Interfaces.

Excluded form this cleanups are:
 - "Cyclomatic Complexity" because it is not good to mix cleanups with refactoring and because dealing with this would require a lot more time.
 - Test coverage
 - Documentation
 

Added:
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/Resource2StringAdapter.java   (contents, props changed)
      - copied, changed from r1074432, incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/utils/Resource2StringAdapter.java
Removed:
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/utils/
Modified:
    incubator/stanbol/trunk/entityhub/   (props changed)
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubConfigurationImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferenceManagerImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/YardManagerImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/DefaultFieldMapperImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ValueConverterFactory.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultEntityMappingImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSignImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSymbolImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentation.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactory.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryResultListImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntityDereferencer.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntitySearcher.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/AdaptingIterator.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/FilteringIterator.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ModelUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/OsgiUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TextIterator.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TimeUtils.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ToStringIterator.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TypeSaveIterator.java
    incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/yard/AbstractYard.java
    incubator/stanbol/trunk/entityhub/generic/core/src/test/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentationTest.java
    incubator/stanbol/trunk/entityhub/generic/core/src/test/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactoryTest.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/DataTypeEnum.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/defaults/NamespaceEnum.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/mapping/FieldMapping.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/EntityMapping.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/Representation.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/Symbol.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/ValueFactory.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/model/rdf/RdfResourceEnum.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/query/ValueConstraint.java
    incubator/stanbol/trunk/entityhub/generic/servicesapi/src/main/java/org/apache/stanbol/entityhub/servicesapi/util/PatternUtils.java
    incubator/stanbol/trunk/entityhub/generic/test/src/main/java/org/apache/stanbol/entityhub/test/Utils.java
    incubator/stanbol/trunk/entityhub/generic/test/src/main/java/org/apache/stanbol/entityhub/test/model/RepresentationTest.java
    incubator/stanbol/trunk/entityhub/generic/test/src/main/java/org/apache/stanbol/entityhub/test/model/ValueFactoryTest.java
    incubator/stanbol/trunk/entityhub/generic/test/src/main/java/org/apache/stanbol/entityhub/test/yard/YardTest.java
    incubator/stanbol/trunk/entityhub/indexing/dbPedia/src/main/java/org/apache/stanbol/entityhub/indexing/dbPedia/cli/CommandLineRunner.java
    incubator/stanbol/trunk/entityhub/indexing/dblp/src/main/java/org/apache/stanbol/entityhub/indexing/dblp/cli/CommandLineRunner.java
    incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexer.java
    incubator/stanbol/trunk/entityhub/indexing/genericRdf/src/main/java/org/apache/stanbol/entityhub/indexing/rdf/RdfIndexerConfig.java
    incubator/stanbol/trunk/entityhub/indexing/geonames/src/main/java/org/apache/stanbol/entityhub/indexing/geonames/GeoNamesIndexer.java
    incubator/stanbol/trunk/entityhub/indexing/geonames/src/main/java/org/apache/stanbol/entityhub/indexing/geonames/cli/CommandLineRunner.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/JerseyEndpoint.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/JerseyEndpointApplication.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/parsers/JSONToFieldQuery.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/EntityMappingResource.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/NavigationMixin.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/ReferencedSiteRootResource.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/SiteManagerRootResource.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/resource/SymbolResource.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/JettisonWriter.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/QueryResultListWriter.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/SignToRDF.java
    incubator/stanbol/trunk/entityhub/jersey/src/main/java/org/apache/stanbol/entityhub/jersey/writers/SignWriter.java
    incubator/stanbol/trunk/entityhub/launchers/sling/src/main/bundles/list.xml
    incubator/stanbol/trunk/entityhub/model/clerezza/pom.xml
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/RdfReference.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/RdfRepresentation.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/RdfResourceUtils.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/RdfText.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/RdfValueFactory.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/Literal2TextAdapter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/LiteralAdapter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/NaturalTextFilter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/Resource2ValueAdapter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/UriRef2ReferenceAdapter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/main/java/org/apache/stanbol/entityhub/model/clerezza/impl/UriRefAdapter.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/test/java/org/apache/stanbol/entityhub/model/clerezza/RdfRepresentationTest.java
    incubator/stanbol/trunk/entityhub/model/clerezza/src/test/java/org/apache/stanbol/entityhub/model/clerezza/RdfValueFactoryTest.java
    incubator/stanbol/trunk/entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/RdfQueryResultList.java
    incubator/stanbol/trunk/entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlFieldQuery.java
    incubator/stanbol/trunk/entityhub/query/clerezza/src/main/java/org/apache/stanbol/entityhub/query/clerezza/SparqlQueryUtils.java
    incubator/stanbol/trunk/entityhub/site/linkedData/pom.xml
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/CoolUriDereferencer.java
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/LarqSearcher.java
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlDereferencer.java
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlEndpointUtils.java
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/SparqlSearcher.java
    incubator/stanbol/trunk/entityhub/site/linkedData/src/main/java/org/apache/stanbol/entityhub/site/linkedData/impl/VirtuosoSearcher.java
    incubator/stanbol/trunk/entityhub/yard/clerezza/src/main/java/org/apache/stanbol/entityhub/yard/clerezza/impl/ClerezzaYard.java
    incubator/stanbol/trunk/entityhub/yard/clerezza/src/test/java/org/apache/stanbol/entityhub/yard/clerezza/impl/ClerezzaYardTest.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/defaults/SolrConst.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/embedded/EmbeddedSolrPorovider.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/DefaultSolrServerProvider.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrFieldMapper.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrQueryFactory.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/DataTypeEncoder.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/queryencoders/LangEncoder.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/model/FieldMapper.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/model/IndexDataType.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/model/IndexField.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/model/IndexValue.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/model/IndexValueFactory.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/provider/SolrServerProvider.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/provider/SolrServerProviderManager.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/ConstraintTypePosition.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/EncodedConstraintParts.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/ConfigUtils.java
    incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/utils/SolrUtil.java

Propchange: incubator/stanbol/trunk/entityhub/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Mar 16 18:43:57 2011
@@ -1,3 +1,5 @@
 .project
 
 .classpath
+
+.settings

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubConfigurationImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubConfigurationImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubConfigurationImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubConfigurationImpl.java Wed Mar 16 18:43:57 2011
@@ -51,15 +51,15 @@ public class EntityhubConfigurationImpl 
     private final Logger log = LoggerFactory.getLogger(EntityhubConfigurationImpl.class);
 
     @Property(name=EntityhubConfiguration.ID,value="entityhub")
-    protected String entityhubID;
+    private String entityhubID;
     @Property(name=EntityhubConfiguration.NAME,value="<organisations> Entityhub")
-    protected String entityhubName;
+    private String entityhubName;
     @Property(name=EntityhubConfiguration.DESCRIPTION,value="The entityhub holding all entities of <organisation>")
-    protected String entityhubDescription;
+    private String entityhubDescription;
     @Property(name=EntityhubConfiguration.PREFIX,value="urn:org.apache.stanbol:entityhub:")
-    protected String entityhubPrefix;
+    private String entityhubPrefix;
     @Property(name=EntityhubConfiguration.ENTITYHUB_YARD_ID,value=EntityhubConfiguration.DEFAULT_ENTITYHUB_YARD_ID)
-    protected String entityhubYardId;
+    private String entityhubYardId;
     @Property(
             name=EntityhubConfiguration.FIELD_MAPPINGS,
             value ={ //This is the default config for well known Ontologies
@@ -111,7 +111,7 @@ public class EntityhubConfigurationImpl 
                 "foaf:logo | d=xsd:anyURI",
                 "foaf:page | d=xsd:anyURI" //page about the entity
             })
-    protected String[] fieldMappingConfig;
+    private String[] fieldMappingConfig;
     //NOTE: there is no other way than hard coding the names there!
     @Property(name=EntityhubConfiguration.DEFAULT_MAPPING_STATE,options={
             @PropertyOption( //seems, that name and value are exchanged ...
@@ -121,7 +121,7 @@ public class EntityhubConfigurationImpl 
                     value='%'+EntityhubConfiguration.DEFAULT_MAPPING_STATE+".option.confirmed",
                     name="confirmed")
             },value="proposed")
-    protected String defaultMappingStateString;
+    private String defaultMappingStateString;
     @Property(name=EntityhubConfiguration.DEFAULT_SYMBOL_STATE,options={
             @PropertyOption( //seems, that name and value are exchanged ...
                     value='%'+EntityhubConfiguration.DEFAULT_SYMBOL_STATE+".option.proposed",
@@ -130,7 +130,7 @@ public class EntityhubConfigurationImpl 
                     value='%'+EntityhubConfiguration.DEFAULT_SYMBOL_STATE+".option.active",
                     name="active")
             },value="proposed")
-    protected String defaultSymblStateString;
+    private String defaultSymblStateString;
 
     @Activate
     protected void activate(ComponentContext context) throws ConfigurationException {
@@ -140,8 +140,8 @@ public class EntityhubConfigurationImpl 
         log.info("entityhubName:{}",entityhubName);
         this.entityhubID = OsgiUtils.checkProperty(properties, EntityhubConfiguration.ID).toString();
         this.entityhubName = OsgiUtils.checkProperty(properties, EntityhubConfiguration.NAME, this.entityhubID).toString();
-        Object entityhubDescription = properties.get(EntityhubConfiguration.DESCRIPTION);
-        this.entityhubDescription = entityhubDescription==null?null:entityhubDescription.toString();
+        Object entityhubDescriptionObject = properties.get(EntityhubConfiguration.DESCRIPTION);
+        this.entityhubDescription = entityhubDescriptionObject==null?null:entityhubDescriptionObject.toString();
         this.entityhubPrefix = OsgiUtils.checkProperty(properties, EntityhubConfiguration.PREFIX).toString();
         this.entityhubYardId = OsgiUtils.checkProperty(properties, EntityhubConfiguration.ENTITYHUB_YARD_ID).toString();
         Object defaultSymbolState = properties.get(EntityhubConfiguration.DEFAULT_SYMBOL_STATE);
@@ -156,9 +156,9 @@ public class EntityhubConfigurationImpl 
         } else {
             this.defaultMappingStateString = defaultMappingState.toString();
         }
-        Object fieldMappingConfig = OsgiUtils.checkProperty(properties, EntityhubConfiguration.FIELD_MAPPINGS);
-        if(fieldMappingConfig instanceof String[]){
-            this.fieldMappingConfig = (String[])fieldMappingConfig;
+        Object fieldMappingConfigObject = OsgiUtils.checkProperty(properties, EntityhubConfiguration.FIELD_MAPPINGS);
+        if(fieldMappingConfigObject instanceof String[]){
+            this.fieldMappingConfig = (String[])fieldMappingConfigObject;
         } else {
             throw new ConfigurationException(EntityhubConfiguration.FIELD_MAPPINGS, "Values for this property must be of type Stirng[]!");
         }
@@ -180,7 +180,7 @@ public class EntityhubConfigurationImpl 
 
     @Override
     public String getEntityhubPrefix() {
-        return entityhubID;
+        return entityhubPrefix;
     }
 
     @Override

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/EntityhubImpl.java Wed Mar 16 18:43:57 2011
@@ -82,7 +82,7 @@ public final class EntityhubImpl impleme
      * The field mapper holding global mappings that are used for mapping
      * representations of entities for any referenced sites
      */
-    protected FieldMapper fieldMapper;
+    private FieldMapper fieldMapper;
 
     /**
      * The yard where this Entityhub instance stores its data
@@ -101,27 +101,27 @@ public final class EntityhubImpl impleme
      *      on an component that is in the "unsatisfied" state.
      * </ul>
      */
-    protected Yard entityhubYard; //reference initialised in the activate method
+    private Yard entityhubYard; //reference initialised in the activate method
     /*
      * TODO: The YardManager is currently not used.
      */
     @Reference // 1..1, static
-    protected YardManager yardManager;
+    private YardManager yardManager;
     /**
      * The Configuration of the Entityhub
      * TODO: Maybe refactor this implementation to implement this interface or
      * to extend the {@link EntityhubConfigurationImpl}.
      */
     @Reference // 1..1, static
-    protected EntityhubConfiguration config;
+    private EntityhubConfiguration config;
     /**
      * The site manager is used to search for entities within the Entityhub framework
      */
     @Reference // 1..1, static
-    protected ReferencedSiteManager siteManager;
+    private ReferencedSiteManager siteManager;
 
-    private String DEFAULT_SYMBOL_PREFIX = "symbol";
-    private String DEFAULT_MAPPING_PREFIX = "mapping";
+    private static final String DEFAULT_SYMBOL_PREFIX = "symbol";
+    private static final String DEFAULT_MAPPING_PREFIX = "mapping";
     /**
      * Activates the Entityhub (OSGI Lifecycle method)
      * @param context the OSGI component context (stored in {@link #context})

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferenceManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferenceManagerImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferenceManagerImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferenceManagerImpl.java Wed Mar 16 18:43:57 2011
@@ -58,9 +58,9 @@ import org.slf4j.LoggerFactory;
 })
 public class ReferenceManagerImpl implements ReferencedSiteManager {
 
-    protected final Logger log;
+    private final Logger log;
 
-    protected ComponentContext context;
+//    private ComponentContext context;
     public ReferenceManagerImpl(){
         super();
         log = LoggerFactory.getLogger(ReferenceManagerImpl.class);
@@ -98,13 +98,13 @@ public class ReferenceManagerImpl implem
 
     @Activate
     protected void activate(ComponentContext context) {
-        this.context = context;
+//        this.context = context;
         log.info("Activate ReferenceManager with context" + context);
     }
     @Deactivate
     protected void deactivate(ComponentContext context) {
         log.info("Deactivate ReferenceManager with context" + context);
-        this.context = null;
+//        this.context = null;
         synchronized (prefixMap) {
             this.prefixList.clear();
             this.prefixMap.clear();

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/ReferencedSiteImpl.java Wed Mar 16 18:43:57 2011
@@ -235,10 +235,10 @@ import org.slf4j.LoggerFactory;
         })
 public class ReferencedSiteImpl implements ReferencedSite {
     static final int maxInt = Integer.MAX_VALUE;
-    protected final Logger log;
-    protected ComponentContext context;
-    protected Dictionary<String,?> properties;
-    protected FieldMapper fieldMappings;
+    private final Logger log;
+    private ComponentContext context;
+    private Dictionary<String,?> properties;
+    private FieldMapper fieldMappings;
 
     private final Object searcherAndDereferencerLock = new Object();
     private Boolean dereferencerEqualsEntitySearcherComponent;
@@ -247,7 +247,7 @@ public class ReferencedSiteImpl implemen
 
     private String dereferencerComponentName;
     private ComponentInstance dereferencerComponentInstance;
-    protected EntityDereferencer dereferencer;
+    private EntityDereferencer dereferencer;
 
     private String entitySearcherComponentName;
     private EntitySearcher entitySearcher;
@@ -594,7 +594,7 @@ public class ReferencedSiteImpl implemen
     }
     @Override
     public boolean equals(Object obj) {
-        return obj != null && obj instanceof ReferencedSite && ((ReferencedSite)obj).getId().equals(getId());
+        return obj instanceof ReferencedSite && ((ReferencedSite)obj).getId().equals(getId());
     }
     @Override
     public FieldMapper getFieldMapper() {

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/YardManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/YardManagerImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/YardManagerImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/impl/YardManagerImpl.java Wed Mar 16 18:43:57 2011
@@ -30,14 +30,12 @@ import org.apache.felix.scr.annotations.
 import org.apache.stanbol.entityhub.servicesapi.yard.Cache;
 import org.apache.stanbol.entityhub.servicesapi.yard.Yard;
 import org.apache.stanbol.entityhub.servicesapi.yard.YardManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 @Component(immediate = true)
 @Service
 public class YardManagerImpl implements YardManager {
 
-    Logger log = LoggerFactory.getLogger(YardManagerImpl.class);
+//    private static final Logger log = LoggerFactory.getLogger(YardManagerImpl.class);
     @Reference(
             cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE,
             referenceInterface=Yard.class,
@@ -113,8 +111,7 @@ public class YardManagerImpl implements 
     }
     @Override
     public Cache getCache(String id) {
-        Cache cache = caches.get(id);
-        return cache;
+        return caches.get(id);
     }
     @Override
     public Collection<String> getCacheIDs() {

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/DefaultFieldMapperImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/DefaultFieldMapperImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/DefaultFieldMapperImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/DefaultFieldMapperImpl.java Wed Mar 16 18:43:57 2011
@@ -54,7 +54,7 @@ import org.slf4j.LoggerFactory;
  * @author Rupert Westenthaler
  *
  */
-public class DefaultFieldMapperImpl implements FieldMapper {
+public class DefaultFieldMapperImpl implements FieldMapper, Cloneable {
     private final Logger log = LoggerFactory.getLogger(DefaultFieldMapperImpl.class);
     private final Set<FieldMapping> mappings;
 //    private final Map<String,Collection<FieldMapping>> ignoreFieldMap;
@@ -62,7 +62,7 @@ public class DefaultFieldMapperImpl impl
     private final Map<String,Set<FieldMapping>> fieldMap;
     private final Map<Pattern,Set<FieldMapping>> wildcardMap;
     private Collection<FieldMapping> unmodMappings;
-    ValueConverterFactory valueConverter;
+    private ValueConverterFactory valueConverter;
     //private Map<String,FieldMapping> mappings = Collections.synchronizedMap(new HashMap<String, FieldMapping>());
     public DefaultFieldMapperImpl(ValueConverterFactory valueConverter) {
         super();
@@ -94,20 +94,20 @@ public class DefaultFieldMapperImpl impl
      * @return all the active Mappings
      */
     protected List<FieldMapping> getMappings(String field){
-        final List<FieldMapping> mappings = new ArrayList<FieldMapping>();
+        final List<FieldMapping> fieldMappings = new ArrayList<FieldMapping>();
         //first search the fieldMappings
         Collection<FieldMapping> tmp = fieldMap.get(field);
         if(tmp != null){
-            mappings.addAll(tmp);
+            fieldMappings.addAll(tmp);
         }
         //now iterate over the Wildcard Mappings
         for(Entry<Pattern,Set<FieldMapping>> entry : wildcardMap.entrySet()){
             if(entry.getKey().matcher(field).find()){
-                mappings.addAll(entry.getValue());
+                fieldMappings.addAll(entry.getValue());
             }
         }
-        Collections.sort(mappings, FieldMappingUtils.FIELD_MAPPING_COMPARATOR);
-        return mappings;
+        Collections.sort(fieldMappings, FieldMappingUtils.FIELD_MAPPING_COMPARATOR);
+        return fieldMappings;
     }
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapper#addMapping(org.apache.stanbol.entityhub.servicesapi.mapping.FieldMapping)
@@ -428,10 +428,11 @@ public class DefaultFieldMapperImpl impl
         Set<Object> needConversion = new HashSet<Object>();
         for(Iterator<Object> it = values.iterator();it.hasNext();){
             Object value = it.next();
-            if(accepted.contains(value.getClass())){
+//            if(accepted.contains(value.getClass())){
 //                log.info(String.format("   + value %s(type:%s) accepted by value filter",value,value.getClass()));
                 //nothing to do
-            } else if(rejected.contains(value.getClass())){
+//            } else 
+            if(rejected.contains(value.getClass())){
                 it.remove(); //remove also the current value of that type
                 needConversion.add(value); //save as value that need to be converted
 //                log.info(String.format("   - value %s(type:%s) rejected by value filter",value,value.getClass()));
@@ -479,7 +480,7 @@ public class DefaultFieldMapperImpl impl
     }
     @Override
     public boolean equals(Object o) {
-        return o != null && o instanceof DefaultFieldMapperImpl &&
+        return o instanceof DefaultFieldMapperImpl &&
             ((DefaultFieldMapperImpl)o).mappings.equals(mappings);
     }
 }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/FieldMappingUtils.java Wed Mar 16 18:43:57 2011
@@ -39,7 +39,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public class FieldMappingUtils {
+public final class FieldMappingUtils {
     /**
      * Comparator that sorts field mappings in a way that optimises the
      * processing.

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ValueConverterFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ValueConverterFactory.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ValueConverterFactory.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/mapping/ValueConverterFactory.java Wed Mar 16 18:43:57 2011
@@ -92,7 +92,7 @@ public class ValueConverterFactory {
      * The {@link ValueFactory} used by converters to create instances for converted
      * values.
      */
-    protected final ValueFactory valueFactory;
+    private final ValueFactory valueFactory;
     private boolean readonly = false;
     /**
      * Creates a new factory instance that supports conversions for all
@@ -229,7 +229,9 @@ public class ValueConverterFactory {
 
         @Override
         public Boolean convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Boolean){
                 return (Boolean)value;
             } else {
@@ -248,7 +250,9 @@ public class ValueConverterFactory {
     public class ByteConverter implements ValueConverter<Byte>{
         @Override
         public Byte convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Byte){
                 return (Byte)value;
             } else {
@@ -264,7 +268,9 @@ public class ValueConverterFactory {
     public class ShortConverter implements ValueConverter<Short>{
         @Override
         public Short convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Short){
                 return (Short)value;
             } else {
@@ -280,7 +286,9 @@ public class ValueConverterFactory {
     public class IntConverter implements ValueConverter<Integer>{
         @Override
         public Integer convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Integer){
                 return (Integer)value;
             } else {
@@ -296,7 +304,9 @@ public class ValueConverterFactory {
     public class LongConverter implements ValueConverter<Long>{
         @Override
         public Long convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Long){
                 return (Long)value;
             } else {
@@ -311,7 +321,9 @@ public class ValueConverterFactory {
     public class FloatConverter implements ValueConverter<Float>{
         @Override
         public Float convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Float){
                 return (Float)value;
             } else {
@@ -326,7 +338,9 @@ public class ValueConverterFactory {
     public class DoubleConverter implements ValueConverter<Double>{
         @Override
         public Double convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Double){
                 return (Double)value;
             } else {
@@ -341,7 +355,9 @@ public class ValueConverterFactory {
     public class IntegerConverter implements ValueConverter<BigInteger>{
         @Override
         public BigInteger convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof BigInteger){
                 return (BigInteger)value;
             } else {
@@ -356,7 +372,9 @@ public class ValueConverterFactory {
     public class DecimalConverter implements ValueConverter<BigDecimal>{
         @Override
         public BigDecimal convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof BigDecimal){
                 return (BigDecimal)value;
             } else {
@@ -371,7 +389,9 @@ public class ValueConverterFactory {
     public class AnyUriConverter implements ValueConverter<Reference>{
         @Override
         public Reference convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Reference){
                 return (Reference)value;
             } else if(value instanceof URI || value instanceof URL){
@@ -404,7 +424,9 @@ public class ValueConverterFactory {
         }
         @Override
         public Date convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Date){
                 return (Date)value;
             } else if(value instanceof XMLGregorianCalendar){
@@ -433,7 +455,9 @@ public class ValueConverterFactory {
     public class TextConverter implements ValueConverter<Text> {
         @Override
         public Text convert(Object value) {
-            if (value == null) return null;
+            if (value == null) {
+                return null;
+            }
             if(value instanceof Text){
                 return (Text)value;
             } else {

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultEntityMappingImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultEntityMappingImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultEntityMappingImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultEntityMappingImpl.java Wed Mar 16 18:43:57 2011
@@ -101,18 +101,18 @@ public class DefaultEntityMappingImpl ex
         }
     }
     @Override
-    public String getEntityId() {
+    public final String getEntityId() {
         Object id = representation.getFirst(EntityMapping.ENTITY_ID);
         return id != null?id.toString():null;
     }
 
     @Override
-    public Date getExpires() {
+    public final Date getExpires() {
         return representation.getFirst(EntityMapping.EXPIRES, Date.class);
     }
 
     @Override
-    public MappingState getState() {
+    public final MappingState getState() {
         Reference stateUri = representation.getFirstReference(EntityMapping.STATE);
         MappingState state;
         if(stateUri != null){
@@ -129,18 +129,18 @@ public class DefaultEntityMappingImpl ex
     }
 
     @Override
-    public String getSymbolId() {
+    public final String getSymbolId() {
         Object id =  representation.getFirst(EntityMapping.SYMBOL_ID);
         return id != null?id.toString():null;
     }
 
     @Override
-    public void setExpires(Date date) {
+    public final void setExpires(Date date) {
         representation.set(EntityMapping.EXPIRES, date);
     }
 
     @Override
-    public void setState(MappingState state) throws IllegalArgumentException {
+    public final void setState(MappingState state) throws IllegalArgumentException {
         if(state != null){
             representation.setReference(EntityMapping.STATE, state.getUri());
         } else {

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSignImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSignImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSignImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSignImpl.java Wed Mar 16 18:43:57 2011
@@ -18,17 +18,16 @@ package org.apache.stanbol.entityhub.cor
 
 import org.apache.stanbol.entityhub.servicesapi.model.Representation;
 import org.apache.stanbol.entityhub.servicesapi.model.Sign;
-import org.apache.stanbol.entityhub.servicesapi.model.rdf.RdfResourceEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class DefaultSignImpl implements Sign{
 
     Logger log = LoggerFactory.getLogger(DefaultSignImpl.class);
-
+    
     protected final Representation representation;
-    protected final String TYPE = RdfResourceEnum.signType.getUri();
-    protected final String signSite;
+//    private final String TYPE = RdfResourceEnum.signType.getUri();
+    private final String signSite;
 
 //    public DefaultSignImpl(Representation representation) {
 //        if(representation == null){

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSymbolImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSymbolImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSymbolImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/DefaultSymbolImpl.java Wed Mar 16 18:43:57 2011
@@ -100,38 +100,38 @@ public class DefaultSymbolImpl extends D
         this.defaultLanguage = defaultLanguage;
     }
     @Override
-    public void addDescription(String description) {
+    public final void addDescription(String description) {
         representation.addNaturalText(Symbol.DESCRIPTION, description,defaultLanguage);
     }
 
     @Override
-    public void addDescription(String description, String lanugage) {
+    public final void addDescription(String description, String lanugage) {
         representation.addNaturalText(Symbol.DESCRIPTION, description,lanugage);
     }
 
     @Override
-    public void addPredecessor(String predecessor) {
+    public final void addPredecessor(String predecessor) {
         representation.addReference(Symbol.PREDECESSOR, predecessor);
     }
 
     @Override
-    public void addSuccessor(String successor) {
+    public final void addSuccessor(String successor) {
         representation.addReference(Symbol.SUCCESSOR, successor);
 
     }
 
     @Override
-    public Iterator<Text> getDescriptions() {
+    public final Iterator<Text> getDescriptions() {
         return representation.getText(Symbol.DESCRIPTION);
     }
 
     @Override
-    public Iterator<Text> getDescriptions(String lang) {
+    public final Iterator<Text> getDescriptions(String lang) {
         return representation.get(Symbol.DESCRIPTION, lang);
     }
 
     @Override
-    public String getLabel() {
+    public final String getLabel() {
         String label = getLabel(defaultLanguage);
         if(label == null){ //no label for the default language
             //search labels in other languages
@@ -149,18 +149,18 @@ public class DefaultSymbolImpl extends D
     }
 
     @Override
-    public String getLabel(String lang) {
+    public final String getLabel(String lang) {
         Text label = representation.getFirst(Symbol.LABEL, lang);
         return label!=null?label.getText():null;
     }
 
     @Override
-    public Iterator<String> getPredecessors() {
+    public final Iterator<String> getPredecessors() {
         return new ToStringIterator(representation.get(Symbol.PREDECESSOR));
     }
 
     @Override
-    public SymbolState getState() {
+    public final SymbolState getState() {
         Reference stateUri = representation.getFirstReference(Symbol.STATE);
         SymbolState state;
         if(stateUri != null){
@@ -177,52 +177,52 @@ public class DefaultSymbolImpl extends D
     }
 
     @Override
-    public Iterator<String> getSuccessors() {
+    public final Iterator<String> getSuccessors() {
         return new ToStringIterator(representation.get(Symbol.SUCCESSOR));
     }
 
     @Override
-    public boolean isPredecessors() {
+    public final boolean isPredecessors() {
         return getPredecessors().hasNext();
     }
 
     @Override
-    public boolean isSuccessor() {
+    public final boolean isSuccessor() {
         return getSuccessors().hasNext();
     }
 
     @Override
-    public void removeDescription(String description) {
+    public final void removeDescription(String description) {
         representation.removeNaturalText(Symbol.DESCRIPTION,description,defaultLanguage);
     }
 
     @Override
-    public void removeDescription(String description, String language) {
+    public final void removeDescription(String description, String language) {
         representation.removeNaturalText(Symbol.DESCRIPTION,description,language);
     }
 
     @Override
-    public void removePredecessor(String predecessor) {
+    public final void removePredecessor(String predecessor) {
         representation.removeReference(Symbol.PREDECESSOR, predecessor);
     }
 
     @Override
-    public void removeSuccessor(String successor) {
+    public final void removeSuccessor(String successor) {
         representation.removeReference(Symbol.SUCCESSOR, successor);
     }
 
     @Override
-    public void setLabel(String label) {
+    public final void setLabel(String label) {
         representation.setNaturalText(Symbol.LABEL, label, defaultLanguage);
     }
 
     @Override
-    public void setLabel(String label, String language) {
+    public final void setLabel(String label, String language) {
         representation.setNaturalText(Symbol.LABEL, label, language);
     }
 
     @Override
-    public void setState(SymbolState state) throws IllegalArgumentException {
+    public final void setState(SymbolState state) throws IllegalArgumentException {
         representation.setReference(Symbol.STATE, state.getUri());
     }
 }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentation.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentation.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentation.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryRepresentation.java Wed Mar 16 18:43:57 2011
@@ -44,8 +44,8 @@ public class InMemoryRepresentation impl
     //private final Logger log = LoggerFactory.getLogger(InMemoryRepresentation.class);
     private static ValueFactory valueFactory = new InMemoryValueFactory();
 
-    protected final Map<String,Object> representation;
-    protected final Map<String,Object> unmodRepresentation;
+    private final Map<String,Object> representation;
+    private final Map<String,Object> unmodRepresentation;
     private final String id;
     /**
      * creates a new InMemoryRepresentation for the parsed ID
@@ -83,7 +83,7 @@ public class InMemoryRepresentation impl
     @Override
     public void add(String field, Object parsedValue) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -143,7 +143,7 @@ public class InMemoryRepresentation impl
     @SuppressWarnings("unchecked")
     private Collection<Object> getValuesAsCollection(String field){
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -165,7 +165,7 @@ public class InMemoryRepresentation impl
     @Override
     public Iterator<Object> get(String field) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -215,7 +215,7 @@ public class InMemoryRepresentation impl
     @Override
     public void remove(String field, Object parsedValue) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -245,7 +245,7 @@ public class InMemoryRepresentation impl
     @Override
     public void removeAll(String field) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -256,12 +256,14 @@ public class InMemoryRepresentation impl
     @Override
     public void removeAllNaturalText(String field, String... languages) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
         Object values = representation.get(field);
-        if(values == null) return;
+        if(values == null) {
+            return;
+        }
         if(values instanceof Collection<?>){
             int removed = 0;
             for(Iterator<Text> it = new TextIterator(valueFactory,
@@ -289,12 +291,14 @@ public class InMemoryRepresentation impl
     @Override
     public void removeNaturalText(String field, String text, String... languages) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
         Object values = representation.get(field);
-        if(values == null) return;
+        if(values == null) {
+            return;
+        }
         if(values instanceof Collection<?>){
             int removed = 0;
             for(Iterator<Text> it = new TextIterator(valueFactory,
@@ -333,7 +337,7 @@ public class InMemoryRepresentation impl
     @Override
     public void set(String field, Object value) {
         if(field == null){
-            throw new NullPointerException("The parsed field MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed field MUST NOT be NULL");
         } else if(field.isEmpty()){
             throw new IllegalArgumentException("The parsed field MUST NOT be Empty");
         }
@@ -428,6 +432,6 @@ public class InMemoryRepresentation impl
     }
     @Override
     public boolean equals(Object obj) {
-        return obj != null && obj instanceof Representation && ((Representation)obj).getId().equals(getId());
+        return obj instanceof Representation && ((Representation)obj).getId().equals(getId());
     }
 }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactory.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactory.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/model/InMemoryValueFactory.java Wed Mar 16 18:43:57 2011
@@ -40,7 +40,7 @@ public class InMemoryValueFactory implem
     @Override
     public Reference createReference(Object value) {
         if(value == null){
-            throw new NullPointerException("The parsed value MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed value MUST NOT be NULL");
         }
         return new ReferenceImpl(value.toString());
     }
@@ -48,7 +48,7 @@ public class InMemoryValueFactory implem
     @Override
     public Text createText(Object value) {
         if(value == null){
-            throw new NullPointerException("The parsed value MUST NOT be NULL");
+            throw new IllegalArgumentException("The parsed value MUST NOT be NULL");
         }
         return createText(value.toString(),null);
     }
@@ -87,7 +87,7 @@ public class InMemoryValueFactory implem
 
         @Override
         public boolean equals(Object obj) {
-            return obj != null && obj instanceof ReferenceImpl && ((ReferenceImpl)obj).value.equals(value);
+            return obj instanceof ReferenceImpl && ((ReferenceImpl)obj).value.equals(value);
         }
         @Override
         public String toString() {
@@ -107,13 +107,13 @@ public class InMemoryValueFactory implem
 
         private final String value;
         private final String language;
-        protected TextImpl(String value) throws NullPointerException {
+        protected TextImpl(String value) throws IllegalArgumentException {
             this(value,null);
         }
-        protected TextImpl(String value, String language) throws NullPointerException {
+        protected TextImpl(String value, String language) throws IllegalArgumentException {
             super();
             if(value == null){
-                throw new NullPointerException("The value of the Text MUST NOT be NULL!");
+                throw new IllegalArgumentException("The value of the Text MUST NOT be NULL!");
             }
             this.value = value;
             this.language = language;
@@ -134,7 +134,7 @@ public class InMemoryValueFactory implem
         }
         @Override
         public boolean equals(Object obj) {
-            if(obj != null && obj instanceof TextImpl && ((TextImpl)obj).value.equals(value)){
+            if(obj instanceof TextImpl && ((TextImpl)obj).value.equals(value)){
                 if(((TextImpl)obj).language == null){
                     return language == null;
                 } else {
@@ -152,7 +152,7 @@ public class InMemoryValueFactory implem
     @Override
     public Representation createRepresentation(String id) {
         if (id == null){
-            throw new NullPointerException("The parsed id MUST NOT be NULL!");
+            throw new IllegalArgumentException("The parsed id MUST NOT be NULL!");
          } else if(id.isEmpty()){
              throw new IllegalArgumentException("The parsed id MUST NOT be empty!");
          } else {

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/FieldQueryImpl.java Wed Mar 16 18:43:57 2011
@@ -43,10 +43,10 @@ public class FieldQueryImpl implements C
     @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(FieldQueryImpl.class);
 
-    protected final Map<String,Constraint> queryConstraint = new HashMap<String, Constraint>();
+    private final Map<String,Constraint> queryConstraint = new HashMap<String, Constraint>();
     private final Map<String,Constraint> unmodQueryElements = Collections.unmodifiableMap(queryConstraint);
 
-    protected final Set<String> selected = new HashSet<String>();
+    private final Set<String> selected = new HashSet<String>();
     private final Set<String> unmodSelected = Collections.unmodifiableSet(selected);
 
     private Integer limit;
@@ -190,4 +190,23 @@ public class FieldQueryImpl implements C
         }
         this.offset = offset;
     }
+    @Override
+    public int hashCode() {
+        return queryConstraint.hashCode()+selected.hashCode()+offset+(limit!=null?limit:0);
+    }
+    @Override
+    public boolean equals(Object obj) {
+        if(obj instanceof FieldQuery && 
+            ((FieldQuery)obj).getConstraints().equals(getConstraints()) &&
+            ((FieldQuery)obj).getSelectedFields().equals(getSelectedFields()) &&
+            ((FieldQuery)obj).getOffset() == getOffset()){
+            if(limit != null){
+                return limit.equals(((FieldQuery)obj).getLimit());
+            } else {
+                return ((FieldQuery)obj).getLimit() == null;
+            }
+        } else {
+            return false;
+        }
+    }
 }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryResultListImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryResultListImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryResultListImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryResultListImpl.java Wed Mar 16 18:43:57 2011
@@ -52,15 +52,15 @@ public class QueryResultListImpl<T> impl
         if(resultIterator == null || !resultIterator.hasNext()){
             this.results = Collections.emptyList();
         } else {
-            List<T> results = new ArrayList<T>();
+            List<T> resultList = new ArrayList<T>();
             while(resultIterator.hasNext()){
-                results.add(resultIterator.next());
+                resultList.add(resultIterator.next());
             }
-            this.results = Collections.unmodifiableList(results);
+            this.results = Collections.unmodifiableList(resultList);
         }
     }
     @Override
-    public Class<T> getType(){
+    public final Class<T> getType(){
         return type;
     }
     /**
@@ -88,32 +88,34 @@ public class QueryResultListImpl<T> impl
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.core.query.ResultList#getQuery()
      */
-    public FieldQuery getQuery(){
+    @Override
+    public final FieldQuery getQuery(){
         return query;
     }
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.core.query.ResultList#getSelectedFields()
      */
-    public Set<String> getSelectedFields(){
+    @Override
+    public final Set<String> getSelectedFields(){
         return query.getSelectedFields();
     }
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.core.query.ResultList#iterator()
      */
     @Override
-    public Iterator<T> iterator() {
+    public final Iterator<T> iterator() {
         return results.iterator();
     }
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.core.query.ResultList#isEmpty()
      */
-    public boolean isEmpty() {
+    public final boolean isEmpty() {
         return results.isEmpty();
     }
     /* (non-Javadoc)
      * @see org.apache.stanbol.entityhub.core.query.ResultList#size()
      */
-    public int size() {
+    public final int size() {
         return results.size(); //not supported :(
     }
 }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/query/QueryUtils.java Wed Mar 16 18:43:57 2011
@@ -24,8 +24,8 @@ import org.apache.stanbol.entityhub.serv
  * @author Rupert Westenthaler
  *
  */
-public class QueryUtils {
-
+public final class QueryUtils {
+    private QueryUtils(){}
     /**
      * Getter for the Limit calculated bye on the limit defined by the query
      * and the configuration of the default results (for queries that do not

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntityDereferencer.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntityDereferencer.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntityDereferencer.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntityDereferencer.java Wed Mar 16 18:43:57 2011
@@ -61,9 +61,9 @@ public abstract class AbstractEntityDere
         if (context != null && context.getProperties() != null) {
             this.context = context;
             Dictionary<String, ?> properties = context.getProperties();
-            Object baseUri = properties.get(EntityDereferencer.ACCESS_URI);
-            if (baseUri != null) {
-                this.baseUri = baseUri.toString();
+            Object baseUriObject = properties.get(EntityDereferencer.ACCESS_URI);
+            if (baseUriObject != null) {
+                this.baseUri = baseUriObject.toString();
                 //now set the new config
                 this.config = properties;
             } else {
@@ -72,18 +72,18 @@ public abstract class AbstractEntityDere
             //TODO: I am sure, there is some Utility, that supports getting multiple
             //      values from a OSGI Dictionary
             Object prefixObject = properties.get(ConfiguredSite.ENTITY_PREFIX);
-            ArrayList<String> prefixes = new ArrayList<String>();
+            ArrayList<String> prefixList = new ArrayList<String>();
             if (prefixObject == null) {
-                prefixes = null;
+                prefixList = null;
             } else if (prefixObject.getClass().isArray()) {
-                prefixes.addAll(Arrays.asList((String[]) prefixObject));
+                prefixList.addAll(Arrays.asList((String[]) prefixObject));
             } else if (prefixObject instanceof Collection<?>) {
-                prefixes.addAll((Collection<String>) prefixObject);
+                prefixList.addAll((Collection<String>) prefixObject);
             } else { //assuming a single value
-                prefixes.add(prefixObject.toString());
+                prefixList.add(prefixObject.toString());
             }
-            Collections.sort(prefixes); //sort the prefixes List
-            this.prefixes = Collections.unmodifiableList(prefixes); //use an unmodifiable wrapper for the member variable
+            Collections.sort(prefixList); //sort the prefixes List
+            this.prefixes = Collections.unmodifiableList(prefixList); //use an unmodifiable wrapper for the member variable
         } else {
             throw new IllegalArgumentException("The property " + EntityDereferencer.ACCESS_URI + " must be defined");
         }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntitySearcher.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntitySearcher.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntitySearcher.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/AbstractEntitySearcher.java Wed Mar 16 18:43:57 2011
@@ -53,14 +53,14 @@ public abstract class AbstractEntitySear
         if(context != null && context.getProperties() != null){
             this.context = context;
             Dictionary<String,?> properties = context.getProperties();
-            Object queryUri = properties.get(EntitySearcher.QUERY_URI);
-            Object accessUri = properties.get(ConfiguredSite.ACCESS_URI); //use as an fallback
-            if(queryUri != null){
-                this.queryUri = queryUri.toString();
+            Object queryUriObject = properties.get(EntitySearcher.QUERY_URI);
+            Object accessUriObject = properties.get(ConfiguredSite.ACCESS_URI); //use as an fallback
+            if(queryUriObject != null){
+                this.queryUri = queryUriObject.toString();
                 //now set the new config
-            } else if(accessUri != null){
-                log.info("Using AccessUri as fallback for missing QueryUri Proerty (accessUri="+accessUri);
-                this.queryUri = accessUri.toString();
+            } else if(accessUriObject != null){
+                log.info("Using AccessUri as fallback for missing QueryUri Proerty (accessUri="+accessUriObject);
+                this.queryUri = accessUriObject.toString();
             } else {
                 throw new IllegalArgumentException("The property "+EntitySearcher.QUERY_URI+" must be defined");
             }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheImpl.java Wed Mar 16 18:43:57 2011
@@ -84,11 +84,11 @@ public class CacheImpl implements Cache 
     //private Yard yard;
 
     private String yardId;
-    boolean initWithYard = false;
+    private boolean initWithYard = false;
 
     private FieldMapper baseMapper;
     private FieldMapper additionalMapper;
-    protected ComponentContext context;
+    private ComponentContext context;
 
     @Activate
     protected void activate(ComponentContext context) throws ConfigurationException, YardException, IllegalStateException, InvalidSyntaxException {
@@ -116,7 +116,7 @@ public class CacheImpl implements Cache 
         //(2) Init the additional mappings based on the configuration
         Object mappings = context.getProperties().get(Cache.ADDITIONAL_MAPPINGS);
         FieldMapper configuredMappings = null;
-        if (mappings != null && mappings instanceof String[] && ((String[]) mappings).length > 0) {
+        if (mappings instanceof String[] && ((String[]) mappings).length > 0) {
             configuredMappings = new DefaultFieldMapperImpl(ValueConverterFactory.getInstance(yard.getValueFactory()));
             for (String mappingString : (String[]) mappings) {
                 FieldMapping fieldMapping = FieldMappingUtils.parseFieldMapping(mappingString);

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/site/CacheUtils.java Wed Mar 16 18:43:57 2011
@@ -32,7 +32,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-public class CacheUtils {
+public final class CacheUtils {
+    private CacheUtils(){}
 
     private static Logger log = LoggerFactory.getLogger(CacheUtils.class);
 

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/AdaptingIterator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/AdaptingIterator.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/AdaptingIterator.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/AdaptingIterator.java Wed Mar 16 18:43:57 2011
@@ -65,9 +65,9 @@ public class AdaptingIterator<T,A> imple
         A adapt(T value, Class<A> type);
     }
     
-    protected final Adapter<T, A> adapter;
-    protected final Iterator<T> it;
-    protected final Class<A> type;
+    private final Adapter<T, A> adapter;
+    private final Iterator<T> it;
+    private final Class<A> type;
     private A next;
     private Boolean hasNext;
     /**

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/FilteringIterator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/FilteringIterator.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/FilteringIterator.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/FilteringIterator.java Wed Mar 16 18:43:57 2011
@@ -63,7 +63,7 @@ public class FilteringIterator<T> extend
         private Filter<A> filter;
         public FilterAdapter(Filter<A> filter) {
             if(filter == null){
-                throw new NullPointerException("The parsed Filter MUST NOT be NULL!");
+                throw new IllegalArgumentException("The parsed Filter MUST NOT be NULL!");
             }
             this.filter = filter;
         }

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ModelUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ModelUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ModelUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ModelUtils.java Wed Mar 16 18:43:57 2011
@@ -88,7 +88,7 @@ public final class ModelUtils {
      *
      * @return a new Random UUID
      */
-    protected static Random rng = new Random();
+    private static Random rng = new Random();
 
     /**
      * Do not allow instances of this class
@@ -203,18 +203,18 @@ public final class ModelUtils {
         String[] parts = new String[2];
         if(uri.startsWith("urn:")){
             if(uri.lastIndexOf(':')>3){
-                parts[1] = uri.substring(uri.lastIndexOf(":")+1);
-                parts[0] = uri.substring(0, uri.lastIndexOf(":")+1);
+                parts[1] = uri.substring(uri.lastIndexOf(':')+1);
+                parts[0] = uri.substring(0, uri.lastIndexOf(':')+1);
             } else {
                 parts[1] = uri;
                 parts[0] = null;
             }
-        } else if(uri.lastIndexOf("#")>=0){
-            parts[1] = uri.substring(uri.lastIndexOf("#")+1);
-            parts[0] = uri.substring(0, uri.lastIndexOf("#")+1);
-        } else if(uri.lastIndexOf("/")>=0){
-            parts[1] = uri.substring(uri.lastIndexOf("/")+1);
-            parts[0] = uri.substring(0, uri.lastIndexOf("/")+1);
+        } else if(uri.lastIndexOf('#')>=0){
+            parts[1] = uri.substring(uri.lastIndexOf('#')+1);
+            parts[0] = uri.substring(0, uri.lastIndexOf('#')+1);
+        } else if(uri.lastIndexOf('/')>=0){
+            parts[1] = uri.substring(uri.lastIndexOf('/')+1);
+            parts[0] = uri.substring(0, uri.lastIndexOf('/')+1);
         } else {
             parts[0] = null;
             parts[1] = uri;

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/OsgiUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/OsgiUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/OsgiUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/OsgiUtils.java Wed Mar 16 18:43:57 2011
@@ -118,67 +118,6 @@ public final class OsgiUtils {
             throw new ConfigurationException(propertyName,String.format("Property value %s is not a member of Enumeration %s!",value,enumeration.getName()), e);
         }
     }
-//    /**
-//     * search for a {@link ComponentFactory} that has the component.name property
-//     * as configured by {@link ConfiguredSite#DEREFERENCER_TYPE}. Than creates
-//     * an new instance of an {@link EntityDereferencer} and configures it with
-//     * all the properties present for this instance of {@link ReferencedSite} (
-//     * only component.* and service.* properties are ignored).<br>
-//     * The {@link ComponentInstance} and the {@link EntityDereferencer} are
-//     * stored in the according memeber variables.
-//     * @return the ComponentInstance of <code>null</code> if no ComponentFactory
-//     *    was found for the parsed componentService
-//     * @throws ConfigurationException if the {@link ConfiguredSite#DEREFERENCER_TYPE}
-//     * is not present or it's value does not allow to create a {@link EntityDereferencer}
-//     * instance.
-//     */
-//    public static ComponentInstance createComonentInstance(ComponentContext context, String property,Object componentName,Class<?> componentService) throws ConfigurationException {
-//        //Object value = checkProperty(DEREFERENCER_TYPE);
-//        final ServiceReference[] refs;
-//        try {
-//            refs = context.getBundleContext().getServiceReferences(
-//                    ComponentFactory.class.getName(),
-//                    "(component.name="+componentName+")");
-//
-//        } catch (InvalidSyntaxException e) {
-//            throw new ConfigurationException(property, "Unable to get ComponentFactory for parsed value "+componentName.toString(),e);
-//        }
-//        if(refs != null && refs.length>0){
-//            if(refs.length>1){ //log some warning if more than one Service Reference was found by the query!
-//                log.warn("Multiple ComponentFactories found for the property "+property+"="+componentName+"! -> First one was used to instantiate the "+componentService+" Service");
-//            }
-//            Object dereferencerFactorySerivceObject = context.getBundleContext().getService(refs[0]);
-//            if(dereferencerFactorySerivceObject != null){
-//                try {
-//                    // I trust the OSGI framework, that the returned service implements the requested Interface
-//                    ComponentFactory dereferencerFactory = (ComponentFactory)dereferencerFactorySerivceObject;
-//                    //log.debug("build configuration for "+EntityDereferencer.class.getSimpleName()+" "+componentName.toString());
-//                    Dictionary<String, Object> config = copyConfig(context.getProperties());
-//                    ComponentInstance dereferencerComponentInstance = dereferencerFactory.newInstance(config);
-//                    dereferencerFactory = null;
-//                    //now
-//                    if(dereferencerComponentInstance == null){
-//                        throw new IllegalStateException("Unable to create ComponentInstance for Property value "+componentName+"!");
-//                    }
-//                    if(componentService.isAssignableFrom(dereferencerComponentInstance.getInstance().getClass())){
-//                        return dereferencerComponentInstance;
-//                    } else {
-//                        dereferencerComponentInstance.dispose(); //we can not use it -> so dispose it!
-//                        dereferencerComponentInstance = null;
-//                        throw new IllegalStateException("ComponentInstance created for Property value "+componentName+" does not provide the "+componentService+" Service!");
-//                    }
-//                } finally {
-//                    //we need to unget the ComponentFactory!
-//                    context.getBundleContext().ungetService(refs[0]);
-//                    dereferencerFactorySerivceObject=null;
-//                }
-//            } else {
-//                return null;
-//            }
-//        } else {
-//            return null;
-//        }
-//    }
 
     /**
      * Copy all properties excluding "{@value Constants#OBJECTCLASS}",
@@ -193,10 +132,7 @@ public final class OsgiUtils {
             if(!key.startsWith("component.") &&
                     !key.startsWith("service.") &&
                     !key.equals(Constants.OBJECTCLASS)){
-                //log.debug(" > copy key" + key);
                 config.put(key, source.get(key));
-            } else {
-                //log.debug(" > ignore key" + key);
             }
         }
         return config;

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TextIterator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TextIterator.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TextIterator.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TextIterator.java Wed Mar 16 18:43:57 2011
@@ -26,12 +26,6 @@ import org.apache.stanbol.entityhub.serv
 import org.apache.stanbol.entityhub.servicesapi.model.ValueFactory;
 
 public class TextIterator extends AdaptingIterator<Object,Text> implements Iterator<Text> {
-//    protected final Iterator<?> it;
-//    private Text next;
-//    private Boolean hasNext;
-//    protected final Set<String> languages;
-//    private final boolean isNullLanguage;
-//    protected final ValueFactory valueFactory;
     /**
      * Creates an instance that iterates over values and returns {@link Text}
      * instances that confirm to the active languages. If no languages are parsed
@@ -43,26 +37,11 @@ public class TextIterator extends Adapti
      */
     public TextIterator(ValueFactory valueFactory,Iterator<Object> it,String...languages){
         super(it,new TextAdapter(valueFactory, languages),Text.class);
-//        if(it == null){
-//            throw new IllegalArgumentException("Parsed iterator MUST NOT be NULL!");
-//        }
-//        this.it = it;
-//        if(valueFactory == null){
-//            throw new IllegalArgumentException("Parsed ValueFactory MUST NOT be NULL!");
-//        }
-//        this.valueFactory = valueFactory;
-//        if(languages != null && languages.length>0){
-//            this.languages = Collections.unmodifiableSet(new HashSet<String>(Arrays.asList(languages)));
-//            isNullLanguage = this.languages.contains(null);
-//        } else {
-//            this.languages = null;
-//            isNullLanguage = true;
-//        }
     }
     private static class TextAdapter implements Adapter<Object,Text>{
-        protected final Set<String> languages;
+        private final Set<String> languages;
         private final boolean isNullLanguage;
-        protected final ValueFactory valueFactory;
+        private final ValueFactory valueFactory;
         
         public TextAdapter(ValueFactory valueFactory,String...languages) {
             if(valueFactory == null){

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TimeUtils.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TimeUtils.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TimeUtils.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/TimeUtils.java Wed Mar 16 18:43:57 2011
@@ -45,7 +45,9 @@ import org.slf4j.LoggerFactory;
  * @author Rupert Westenthaler
  *
  */
-public class TimeUtils {
+public final class TimeUtils {
+    private TimeUtils(){}
+
     protected static final Logger log = LoggerFactory.getLogger(TimeUtils.class);
     /**
      * Holds all the data types that represent a date or a time!
@@ -154,23 +156,24 @@ public class TimeUtils {
     /**
      * Lazy initialisation to avoid Exceptions if {@link DatatypeConfigurationException}
      * is thrown during initialisation of the Utility class.<p>
+     * Do not access directly! Use {@link #getXmlDataTypeFactory()} instead.
      */
-    private static DatatypeFactory __xmlDatatypeFactory;
+    private static DatatypeFactory xmlDatatypeFactory;
     /**
-     * Inits the {@link #__xmlDatatypeFactory} if not already done.<p>
+     * Inits the {@link #xmlDatatypeFactory} if not already done.<p>
      * @return the XML datatype factory
      * @throws IllegalStateException if a {@link DatatypeConfigurationException}
      * is encountered during {@link DatatypeFactory#newInstance()}
      */
     private static DatatypeFactory getXmlDataTypeFactory() throws IllegalStateException {
-        if(__xmlDatatypeFactory == null){
+        if(xmlDatatypeFactory == null){
             try {
-                __xmlDatatypeFactory = DatatypeFactory.newInstance();
+                xmlDatatypeFactory = DatatypeFactory.newInstance();
             } catch (DatatypeConfigurationException e) {
                 throw new IllegalStateException("Unable to instantiate XML Datatype Factory!",e);
             }
         }
-        return __xmlDatatypeFactory;
+        return xmlDatatypeFactory;
     }
 
     public static String toString(String dataTypeUri,Date value){

Modified: incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ToStringIterator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ToStringIterator.java?rev=1082257&r1=1082256&r2=1082257&view=diff
==============================================================================
--- incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ToStringIterator.java (original)
+++ incubator/stanbol/trunk/entityhub/generic/core/src/main/java/org/apache/stanbol/entityhub/core/utils/ToStringIterator.java Wed Mar 16 18:43:57 2011
@@ -31,7 +31,7 @@ import java.util.Iterator;
  */
 public class ToStringIterator implements Iterator<String> {
 
-    protected final Iterator<?> it;
+    private final Iterator<?> it;
     /**
      * Creates an string iterator over parsed parent
      * @param it the parent iterator
@@ -40,7 +40,7 @@ public class ToStringIterator implements
      */
     public ToStringIterator(Iterator<?> it) throws NullPointerException{
         if(it == null){
-            throw new NullPointerException("Parsed iterator MUST NOT be NULL!");
+            throw new IllegalArgumentException("Parsed iterator MUST NOT be NULL!");
         }
         this.it = it;
     }