polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [2/5] polygene-java git commit: Removed access to StringIdentity constructor.
Date Thu, 15 Jun 2017 06:06:00 GMT
Removed access to StringIdentity constructor.

Signed-off-by: niclas <niclas@hedhman.org>


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/24fe6039
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/24fe6039
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/24fe6039

Branch: refs/heads/develop
Commit: 24fe60399f57690f1353c068d8f5ef21b72eae15
Parents: 0a0c6e4
Author: niclas <niclas@hedhman.org>
Authored: Mon Jun 12 09:29:32 2017 +0800
Committer: niclas <niclas@hedhman.org>
Committed: Mon Jun 12 09:29:32 2017 +0800

----------------------------------------------------------------------
 .../polygene/api/entity/EntityReference.java     |  2 +-
 .../polygene/api/identity/StringIdentity.java    |  2 +-
 .../org/apache/polygene/api/OperatorsTest.java   |  2 +-
 .../polygene/api/type/ValueTypeFactoryTest.java  |  2 +-
 .../polygene/api/unitofwork/RemovalTest.java     |  6 +++---
 .../api/unitofwork/ToEntityConversionTest.java   |  2 +-
 .../api/unitofwork/ToValueConversionTest.java    | 12 ++++++------
 .../bootstrap/ImportedServiceAssemblyImpl.java   |  6 +++---
 .../runtime/bootstrap/ModuleAssemblyImpl.java    |  4 ++--
 .../bootstrap/ServiceDeclarationImpl.java        |  2 +-
 .../runtime/unitofwork/ModuleUnitOfWork.java     |  2 +-
 .../apache/polygene/api/common/RemovalTest.java  |  6 +++---
 .../qi377/SetAssociationInSideEffectTest.java    |  8 ++++----
 ...ValueCollisionWithRelatedReturnTypesTest.java | 10 +++++-----
 .../polygene/regression/qi382/Qi382Test.java     |  4 ++--
 .../polygene/regression/qi383/Qi383Test.java     |  6 +++---
 .../ImportedServiceActivationTest.java           |  2 +-
 .../polygene/runtime/entity/EntityTypeTest.java  | 12 ++++++------
 .../runtime/entity/EntityVisibilityTest.java     |  2 +-
 .../runtime/injection/ServiceInjectionTest.java  |  2 +-
 .../injection/UnitOfWorkInjectionTest.java       |  6 +++---
 .../runtime/mixin/AssemblyMixinTest.java         | 10 +++++-----
 .../polygene/runtime/mixin/AssemblyRoleTest.java |  8 ++++----
 .../polygene/runtime/mixin/JDKMixinTest.java     |  4 ++--
 .../runtime/objects/ObjectVisibilityTest.java    |  2 +-
 .../runtime/query/IterableQuerySourceTest.java   |  2 +-
 .../apache/polygene/runtime/query/Network.java   |  4 ++--
 .../runtime/service/ServiceVisibilityTest.java   |  2 +-
 .../transients/TransientVisibilityTest.java      |  2 +-
 .../unitofwork/PrivateEntityUnitOfWorkTest.java  |  2 +-
 .../polygene/runtime/unitofwork/RemovalTest.java |  8 ++++----
 .../runtime/value/AssociationToValueTest.java    |  4 ++--
 .../value/ValueSerializationRegressionTest.java  |  2 +-
 .../runtime/value/ValueVisibilityTest.java       |  2 +-
 .../runtime/value/ValueWithAssociationTest.java  |  6 +++---
 .../visibility/VisibilityInUnitOfWorkTest.java   |  4 ++--
 .../importer/ServiceInstanceImporterTest.java    | 10 +++++-----
 .../helpers/JSONMapEntityStoreMixin.java         |  2 +-
 .../entitystore/helpers/MapEntityStoreMixin.java |  2 +-
 .../spi/entitystore/Polygene142Test.java         |  4 ++--
 .../test/entity/AbstractEntityStoreTest.java     |  1 -
 .../test/indexing/AbstractQueryTest.java         |  6 +++---
 .../apache/polygene/test/indexing/TestData.java  |  8 ++++----
 .../cassandra/CassandraEntityStoreMixin.java     |  2 +-
 .../AbstractSQLEntityStoreAssembler.java         |  2 +-
 .../polygene/index/rdf/RDFPerformanceTest.java   |  4 ++--
 .../assembly/AbstractSQLIndexQueryAssembler.java |  2 +-
 .../polygene/library/alarm/AlarmSystem.java      |  2 +-
 .../polygene/library/alarm/AlarmProxyTest.java   |  6 +++---
 .../library/jmx/ConfigurationManagerService.java |  2 +-
 .../library/rdf/entity/EntitySerializerTest.java |  4 ++--
 .../rdf/entity/EntityTypeSerializerTest.java     | 19 +++++++++----------
 .../server/restlet/RequestReaderDelegator.java   |  2 +-
 .../server/restlet/ResponseWriterDelegator.java  |  2 +-
 .../requestreader/DefaultRequestReader.java      |  4 ++--
 .../library/rest/admin/EntityResource.java       |  2 +-
 .../library/rest/admin/DummyDataService.java     |  8 ++++----
 .../polygene/library/rest/admin/RestTest.java    |  8 ++++----
 .../library/restlet/crud/EntityResource.java     |  4 ++--
 .../restlet/identity/IdentityManager.java        |  4 ++--
 .../restlet/resource/EntryPointResource.java     |  6 +++---
 .../restlet/resource/ResourceBuilder.java        |  2 +-
 .../sql/assembly/DataSourceAssembler.java        |  2 +-
 .../assembly/ExternalDataSourceAssembler.java    |  2 +-
 .../DataSourceConfigurationManagerService.java   |  2 +-
 .../moneytransfer/context/PayBillsContext.java   |  4 ++--
 .../moneytransfer/context/PayBillsContext2.java  |  4 ++--
 .../dci/moneytransfer/test/AccountIds.java       |  8 ++++----
 .../sample/forum/data/entity/Forums.java         |  4 ++--
 .../polygene/sample/forum/data/entity/Users.java |  2 +-
 .../forum/rest/resource/forum/BoardResource.java |  2 +-
 .../forum/rest/resource/forum/ForumResource.java |  2 +-
 .../rest/resource/forum/ForumsResource.java      |  2 +-
 .../sample/rental/domain/dev/InitialData.java    |  2 +-
 .../polygene/sample/rental/web/BookingPage.java  |  4 ++--
 .../polygene/sample/rental/web/MainPage.java     |  2 +-
 .../AbstractEntityStorePerformanceTest.java      |  4 ++--
 .../initialdata/SamplePersonInitialData.java     |  2 +-
 .../polygene/tutorials/hello/HelloTest4.java     |  2 +-
 79 files changed, 164 insertions(+), 166 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java b/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
index 3bc557e..9952994 100644
--- a/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
+++ b/core/api/src/main/java/org/apache/polygene/api/entity/EntityReference.java
@@ -41,7 +41,7 @@ public final class EntityReference
     public static EntityReference parseEntityReference(String identityString)
     {
         Objects.requireNonNull( identityString, "identityString must not be null" );
-        return new EntityReference( new StringIdentity( identityString ) );
+        return new EntityReference( StringIdentity.fromString( identityString ) );
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/main/java/org/apache/polygene/api/identity/StringIdentity.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/identity/StringIdentity.java b/core/api/src/main/java/org/apache/polygene/api/identity/StringIdentity.java
index d5c43f9..7d85381 100644
--- a/core/api/src/main/java/org/apache/polygene/api/identity/StringIdentity.java
+++ b/core/api/src/main/java/org/apache/polygene/api/identity/StringIdentity.java
@@ -27,7 +27,7 @@ public class StringIdentity
 {
     private final String value;
 
-    public StringIdentity(String value)
+    private StringIdentity(String value)
     {
         Objects.requireNonNull( value, "Identity can not be null." );
         this.value = value;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java b/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java
index 025f987..72f8c7f 100644
--- a/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/OperatorsTest.java
@@ -63,7 +63,7 @@ public class OperatorsTest
 
         try
         {
-            EntityBuilder<TestEntity> entityBuilder = uow.newEntityBuilder( TestEntity.class, new StringIdentity( "123" ) );
+            EntityBuilder<TestEntity> entityBuilder = uow.newEntityBuilder( TestEntity.class, StringIdentity.fromString( "123" ) );
             entityBuilder.instance().value().set( assembler.module().newValue( TestValue.class ) );
             TestEntity testEntity = entityBuilder.newInstance();
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java b/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java
index 7f093af..bd9ce3b 100644
--- a/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/type/ValueTypeFactoryTest.java
@@ -125,7 +125,7 @@ public class ValueTypeFactoryTest extends AbstractPolygeneTest
         try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork() )
         {
             assertThat(
-                valueTypeFactory.valueTypeOf( module, uow.newEntity( SomeState.class, new StringIdentity( "abc" ) ) ),
+                valueTypeFactory.valueTypeOf( module, uow.newEntity( SomeState.class, StringIdentity.fromString( "abc" ) ) ),
                 instanceOf( EntityCompositeType.class ) );
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java
index 87d609c..97b78db 100644
--- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/RemovalTest.java
@@ -20,16 +20,16 @@
 
 package org.apache.polygene.api.unitofwork;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.common.Optional;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.property.Property;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 public class RemovalTest
     extends AbstractPolygeneTest
@@ -49,7 +49,7 @@ public class RemovalTest
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
         try
         {
-            EntityBuilder<TestEntity> builder = uow.newEntityBuilder( TestEntity.class, new StringIdentity( "123" ) );
+            EntityBuilder<TestEntity> builder = uow.newEntityBuilder( TestEntity.class, StringIdentity.fromString( "123" ) );
             builder.instance().test().set( "habba" );
             TestEntity test = builder.newInstance();
             uow.remove( test );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java
index 5f5a5b5..055a1db 100644
--- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToEntityConversionTest.java
@@ -65,7 +65,7 @@ public class ToEntityConversionTest
     public void testPropertyConversionToEntity()
         throws Exception
     {
-        Identity identity = new StringIdentity( "Niclas" );
+        Identity identity = StringIdentity.fromString( "Niclas" );
         ValueBuilder<SomeType> vb = valueBuilderFactory.newValueBuilder( SomeType.class );
         SomeType prototype = vb.prototype();
         prototype.identity().set( identity );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java
index 08751d4..ae9c7c2 100644
--- a/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/unitofwork/ToValueConversionTest.java
@@ -73,11 +73,11 @@ public class ToValueConversionTest
         SomeType value;
         try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork(usecase) )
         {
-            SomeType entity1 = createEntity( uow, new StringIdentity( "Niclas" ) );
-            SomeType entity2 = createEntity( uow, new StringIdentity( "Paul" ) );
-            SomeType entity3 = createEntity( uow, new StringIdentity( "Jiri" ) );
-            SomeType entity4 = createEntity( uow, new StringIdentity( "Kent" ) );
-            SomeType entity5 = createEntity( uow, new StringIdentity( "Stan" ) );
+            SomeType entity1 = createEntity( uow, StringIdentity.fromString( "Niclas" ) );
+            SomeType entity2 = createEntity( uow, StringIdentity.fromString( "Paul" ) );
+            SomeType entity3 = createEntity( uow, StringIdentity.fromString( "Jiri" ) );
+            SomeType entity4 = createEntity( uow, StringIdentity.fromString( "Kent" ) );
+            SomeType entity5 = createEntity( uow, StringIdentity.fromString( "Stan" ) );
             entity1.assoc().set( entity2 );
             entity1.many().add( entity3 );
             entity1.named().put( "kent", entity4 );
@@ -89,7 +89,7 @@ public class ToValueConversionTest
         }
         try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork(usecase) )
         {
-            assertThat( value.identity().get(), equalTo( new StringIdentity( "Niclas" ) ) );
+            assertThat( value.identity().get(), equalTo( StringIdentity.fromString( "Niclas" ) ) );
             assertThat( value.name().get(), equalTo( "[Niclas]" ) );
 
             assertThat( uow.toValue( SomeType.class, value.assoc().get()).name().get(), equalTo( "[Paul]" ));

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ImportedServiceAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ImportedServiceAssemblyImpl.java b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ImportedServiceAssemblyImpl.java
index c455aed..2c7905b 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ImportedServiceAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ImportedServiceAssemblyImpl.java
@@ -78,7 +78,7 @@ public final class ImportedServiceAssemblyImpl
             }
             else
             {
-                id = new StringIdentity( identity );
+                id = StringIdentity.fromString( identity );
             }
 
             ImportedServiceModel serviceModel = new ImportedServiceModel( module,
@@ -103,7 +103,7 @@ public final class ImportedServiceAssemblyImpl
     {
         // Find reference that is not yet used
         int idx = 0;
-        Identity id = new StringIdentity( serviceType.getSimpleName() );
+        Identity id = StringIdentity.fromString( serviceType.getSimpleName() );
         boolean invalid;
         do
         {
@@ -113,7 +113,7 @@ public final class ImportedServiceAssemblyImpl
                 if( serviceModel.identity().equals( id ) )
                 {
                     idx++;
-                    id = new StringIdentity( serviceType.getSimpleName() + "_" + idx );
+                    id = StringIdentity.fromString( serviceType.getSimpleName() + "_" + idx );
                     invalid = true;
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ModuleAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ModuleAssemblyImpl.java b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ModuleAssemblyImpl.java
index 2c5b3bf..f69fe9f 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ModuleAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ModuleAssemblyImpl.java
@@ -708,7 +708,7 @@ final class ModuleAssemblyImpl
         Class<?> serviceType = serviceTypes.findFirst()
                 .orElse(null); // Use the first, which *SHOULD* be the main serviceType
         int idx = 0;
-        Identity id = new StringIdentity(serviceType.getSimpleName());
+        Identity id = StringIdentity.fromString(serviceType.getSimpleName());
         boolean invalid;
         do
         {
@@ -718,7 +718,7 @@ final class ModuleAssemblyImpl
                 if (serviceAssembly.identity() != null && serviceAssembly.identity().equals(id))
                 {
                     idx++;
-                    id = new StringIdentity(serviceType.getSimpleName() + "_" + idx);
+                    id = StringIdentity.fromString(serviceType.getSimpleName() + "_" + idx);
                     invalid = true;
                     break;
                 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ServiceDeclarationImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ServiceDeclarationImpl.java b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ServiceDeclarationImpl.java
index 7740d37..e5e17bb 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ServiceDeclarationImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/ServiceDeclarationImpl.java
@@ -59,7 +59,7 @@ public final class ServiceDeclarationImpl
         for( ServiceAssemblyImpl serviceAssembly : serviceAssemblies )
         {
             if( identity != null ) {
-                serviceAssembly.identity = new StringIdentity( identity );
+                serviceAssembly.identity = StringIdentity.fromString( identity );
             }
         }
         return this;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/ModuleUnitOfWork.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/ModuleUnitOfWork.java b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/ModuleUnitOfWork.java
index 4787aa5..b836f67 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/ModuleUnitOfWork.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/ModuleUnitOfWork.java
@@ -264,7 +264,7 @@ public class ModuleUnitOfWork
             }
             else
             {
-                identity = new StringIdentity( propertyState );
+                identity = StringIdentity.fromString( propertyState );
             }
         }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/api/common/RemovalTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/api/common/RemovalTest.java b/core/runtime/src/test/java/org/apache/polygene/api/common/RemovalTest.java
index a900a4f..0c67baa 100644
--- a/core/runtime/src/test/java/org/apache/polygene/api/common/RemovalTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/api/common/RemovalTest.java
@@ -20,10 +20,9 @@
 
 package org.apache.polygene.api.common;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.property.Property;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
@@ -31,6 +30,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 public class RemovalTest
     extends AbstractPolygeneTest
@@ -48,7 +48,7 @@ public class RemovalTest
         throws Exception
     {
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
-        EntityBuilder<TestEntity> builder = uow.newEntityBuilder( TestEntity.class, new StringIdentity( "123" ) );
+        EntityBuilder<TestEntity> builder = uow.newEntityBuilder( TestEntity.class, StringIdentity.fromString( "123" ) );
         builder.instance().test().set( "habba" );
         TestEntity test = builder.newInstance();
         uow.remove( test );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/regression/qi377/SetAssociationInSideEffectTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/regression/qi377/SetAssociationInSideEffectTest.java b/core/runtime/src/test/java/org/apache/polygene/regression/qi377/SetAssociationInSideEffectTest.java
index bcb7654..941099b 100644
--- a/core/runtime/src/test/java/org/apache/polygene/regression/qi377/SetAssociationInSideEffectTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/regression/qi377/SetAssociationInSideEffectTest.java
@@ -22,12 +22,11 @@ package org.apache.polygene.regression.qi377;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.reflect.Method;
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.association.Association;
 import org.apache.polygene.api.common.AppliesTo;
 import org.apache.polygene.api.common.Optional;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.This;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.sideeffect.GenericSideEffect;
@@ -38,6 +37,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.hamcrest.core.Is.is;
 import static org.hamcrest.core.IsNull.nullValue;
@@ -61,8 +61,8 @@ public class SetAssociationInSideEffectTest
     {
         try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork( UsecaseBuilder.newUsecase( "Purchase Steinway" ) ) )
         {
-            Pianist chris = uow.newEntity( Pianist.class, new StringIdentity( "Chris" ) );
-            Steinway modelD = uow.newEntity( Steinway.class, new StringIdentity( "ModelD-274" ) );
+            Pianist chris = uow.newEntity( Pianist.class, StringIdentity.fromString( "Chris" ) );
+            Steinway modelD = uow.newEntity( Steinway.class, StringIdentity.fromString( "ModelD-274" ) );
 
             assertThat( modelD.owner().get(), is( nullValue() ) );
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java b/core/runtime/src/test/java/org/apache/polygene/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
index 1163024..5e49acf 100644
--- a/core/runtime/src/test/java/org/apache/polygene/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
@@ -19,24 +19,24 @@
  */
 package org.apache.polygene.regression.qi377;
 
-import org.apache.polygene.api.identity.HasIdentity;
-import org.apache.polygene.api.identity.Identity;
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.association.Association;
 import org.apache.polygene.api.association.ManyAssociation;
 import org.apache.polygene.api.common.Optional;
+import org.apache.polygene.api.identity.HasIdentity;
+import org.apache.polygene.api.identity.Identity;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.property.Property;
 import org.apache.polygene.api.value.ValueBuilder;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
+import org.junit.Test;
 
 public class ValueCollisionWithRelatedReturnTypesTest
     extends AbstractPolygeneTest
 {
 
-    public static final Identity NICLAS = new StringIdentity( "niclas" );
+    public static final Identity NICLAS = StringIdentity.fromString( "niclas" );
 
     @Override
     public void assemble( ModuleAssembly module )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/regression/qi382/Qi382Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/regression/qi382/Qi382Test.java b/core/runtime/src/test/java/org/apache/polygene/regression/qi382/Qi382Test.java
index 2dd99e2..dd818f9 100644
--- a/core/runtime/src/test/java/org/apache/polygene/regression/qi382/Qi382Test.java
+++ b/core/runtime/src/test/java/org/apache/polygene/regression/qi382/Qi382Test.java
@@ -44,8 +44,8 @@ import static org.junit.Assert.assertThat;
 public class Qi382Test extends AbstractPolygeneTest
 {
 
-    public static final Identity FERRARI = new StringIdentity( "Ferrari" );
-    public static final Identity NICLAS = new StringIdentity( "Niclas" );
+    public static final Identity FERRARI = StringIdentity.fromString( "Ferrari" );
+    public static final Identity NICLAS = StringIdentity.fromString( "Niclas" );
 
     @Override
     public void assemble( ModuleAssembly module )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/regression/qi383/Qi383Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/regression/qi383/Qi383Test.java b/core/runtime/src/test/java/org/apache/polygene/regression/qi383/Qi383Test.java
index 8ec0369..ea15a4f 100644
--- a/core/runtime/src/test/java/org/apache/polygene/regression/qi383/Qi383Test.java
+++ b/core/runtime/src/test/java/org/apache/polygene/regression/qi383/Qi383Test.java
@@ -47,9 +47,9 @@ public class Qi383Test extends AbstractPolygeneTest
     {
         try( UnitOfWork unitOfWork = unitOfWorkFactory.newUnitOfWork() )
         {
-            unitOfWork.newEntity( Car.class, new StringIdentity( "Ferrari" ) );
-            unitOfWork.newEntity( Car.class, new StringIdentity( "Ford" ) );
-            unitOfWork.newEntity( Car.class, new StringIdentity( "Ferrari" ) );
+            unitOfWork.newEntity( Car.class, StringIdentity.fromString( "Ferrari" ) );
+            unitOfWork.newEntity( Car.class, StringIdentity.fromString( "Ford" ) );
+            unitOfWork.newEntity( Car.class, StringIdentity.fromString( "Ferrari" ) );
             unitOfWork.complete();
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/activation/ImportedServiceActivationTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/activation/ImportedServiceActivationTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/activation/ImportedServiceActivationTest.java
index 5848403..db3cca8 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/activation/ImportedServiceActivationTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/activation/ImportedServiceActivationTest.java
@@ -179,7 +179,7 @@ public class ImportedServiceActivationTest
             module -> {
                 module.importedServices( TestedService.class ).
                     importedBy( ImportedServiceDeclaration.SERVICE_IMPORTER ).
-                          setMetaInfo( new StringIdentity( "testimporter" ) ).
+                          setMetaInfo( StringIdentity.fromString( "testimporter" ) ).
                           withActivators( TestedActivator.class ).
                           importOnStartup();
                 module.services( TestedServiceImporterService.class ).identifiedBy( "testimporter" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityTypeTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityTypeTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityTypeTest.java
index c5ef312..ab7bf79 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityTypeTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityTypeTest.java
@@ -20,15 +20,15 @@
 
 package org.apache.polygene.runtime.entity;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 public class EntityTypeTest
     extends AbstractPolygeneTest
@@ -40,9 +40,9 @@ public class EntityTypeTest
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
         try
         {
-            EntityBuilder<Rst> builder3 = uow.newEntityBuilder( Rst.class, new StringIdentity( "123" ) );
-            EntityBuilder<Def> builder2 = uow.newEntityBuilder( Def.class, new StringIdentity( "456" ) );
-            EntityBuilder<Abc> builder1 = uow.newEntityBuilder( Abc.class, new StringIdentity( "789" ) );
+            EntityBuilder<Rst> builder3 = uow.newEntityBuilder( Rst.class, StringIdentity.fromString( "123" ) );
+            EntityBuilder<Def> builder2 = uow.newEntityBuilder( Def.class, StringIdentity.fromString( "456" ) );
+            EntityBuilder<Abc> builder1 = uow.newEntityBuilder( Abc.class, StringIdentity.fromString( "789" ) );
         }
         finally
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityVisibilityTest.java
index e2e466f..908e8f2 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/entity/EntityVisibilityTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
 public class EntityVisibilityTest
 {
 
-    public static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+    public static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
 
     private Energy4Java polygene;
     private Module module;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/injection/ServiceInjectionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/ServiceInjectionTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/ServiceInjectionTest.java
index 10d47b9..9fa6411 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/ServiceInjectionTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/ServiceInjectionTest.java
@@ -82,7 +82,7 @@ public class ServiceInjectionTest
         ServiceUser user = factory.newObject( ServiceUser.class );
 
         assertEquals( "X", user.testSingle() );
-        assertThat( user.testIdentity(), equalTo( new StringIdentity( "Foo" ) ) );
+        assertThat( user.testIdentity(), equalTo( StringIdentity.fromString( "Foo" ) ) );
         assertEquals( "FooX", user.testServiceReference() );
         assertEquals( "Bar", user.testQualifier() );
         assertEquals( "A", user.testStringIterable() );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/injection/UnitOfWorkInjectionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/UnitOfWorkInjectionTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/UnitOfWorkInjectionTest.java
index 8a38d17..105a698 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/UnitOfWorkInjectionTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/UnitOfWorkInjectionTest.java
@@ -20,9 +20,8 @@
 
 package org.apache.polygene.runtime.injection;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.State;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
@@ -32,6 +31,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 
@@ -53,7 +53,7 @@ public class UnitOfWorkInjectionTest
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork( usecase );
         try
         {
-            Trial trial = uow.newEntity( Trial.class, new StringIdentity( "123" ) );
+            Trial trial = uow.newEntity( Trial.class, StringIdentity.fromString( "123" ) );
             trial.doSomething();
             uow.complete();
             uow = unitOfWorkFactory.newUnitOfWork( usecase );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyMixinTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyMixinTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyMixinTest.java
index e0ed2ba..6432ccb 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyMixinTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyMixinTest.java
@@ -20,16 +20,16 @@
 
 package org.apache.polygene.runtime.mixin;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Test;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
@@ -62,11 +62,11 @@ public class AssemblyMixinTest
         throws UnitOfWorkCompletionException
     {
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
-        FooEntity entity = uow.newEntity( FooEntity.class, new StringIdentity( "123" ) );
+        FooEntity entity = uow.newEntity( FooEntity.class, StringIdentity.fromString( "123" ) );
         uow.complete();
 
         uow = unitOfWorkFactory.newUnitOfWork();
-        Foo foo = uow.get( Foo.class, new StringIdentity( "123" ) );
+        Foo foo = uow.get( Foo.class, StringIdentity.fromString( "123" ) );
 
         try
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyRoleTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyRoleTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyRoleTest.java
index 0f1f3b9..965d8a8 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyRoleTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/AssemblyRoleTest.java
@@ -20,10 +20,9 @@
 
 package org.apache.polygene.runtime.mixin;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.unitofwork.UnitOfWorkCompletionException;
@@ -31,6 +30,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.junit.Assert.assertThat;
@@ -71,11 +71,11 @@ public class AssemblyRoleTest
         throws UnitOfWorkCompletionException
     {
         UnitOfWork uow = unitOfWorkFactory.newUnitOfWork();
-        uow.newEntity( FooEntity.class, new StringIdentity( "123" ) );
+        uow.newEntity( FooEntity.class, StringIdentity.fromString( "123" ) );
         uow.complete();
 
         uow = unitOfWorkFactory.newUnitOfWork();
-        Foo foo = uow.get( Foo.class, new StringIdentity( "123" ) );
+        Foo foo = uow.get( Foo.class, StringIdentity.fromString( "123" ) );
 
         try
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/JDKMixinTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/JDKMixinTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/JDKMixinTest.java
index fc4937a..8bf7e41 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/JDKMixinTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/mixin/JDKMixinTest.java
@@ -98,8 +98,8 @@ public class JDKMixinTest extends AbstractPolygeneTest
         }
     }
 
-    private static final Identity EXTENDS_IDENTITY = new StringIdentity( ExtendsJDKMixin.class.getName() );
-    private static final Identity COMPOSE_IDENTITY = new StringIdentity( ComposeWithJDKMixin.class.getName() );
+    private static final Identity EXTENDS_IDENTITY = StringIdentity.fromString( ExtendsJDKMixin.class.getName() );
+    private static final Identity COMPOSE_IDENTITY = StringIdentity.fromString( ComposeWithJDKMixin.class.getName() );
     private static final Predicate<ServiceReference<?>> EXTENDS_IDENTITY_SPEC = new ServiceIdentitySpec(
         EXTENDS_IDENTITY );
     private static final Predicate<ServiceReference<?>> COMPOSE_IDENTITY_SPEC = new ServiceIdentitySpec(

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
index be787ef..33785ea 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
 public class ObjectVisibilityTest
 {
 
-    public static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+    public static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
 
     private Energy4Java polygene;
     private Module module;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/query/IterableQuerySourceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/query/IterableQuerySourceTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/query/IterableQuerySourceTest.java
index d14780b..9f93dbd 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/query/IterableQuerySourceTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/query/IterableQuerySourceTest.java
@@ -214,7 +214,7 @@ public class IterableQuerySourceTest
     {
         QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
-        City kl = uow.get( City.class, new StringIdentity( "kualalumpur" ));
+        City kl = uow.get( City.class, StringIdentity.fromString( "kualalumpur" ));
         Query<Person> query = qb.where(
             eq( person.mother().get().placeOfBirth(), kl )
         ).newQuery( Network.persons() );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/query/Network.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/query/Network.java b/core/runtime/src/test/java/org/apache/polygene/runtime/query/Network.java
index 8930654..a84aca2 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/query/Network.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/query/Network.java
@@ -44,8 +44,8 @@ import org.apache.polygene.runtime.query.model.values.ContactsValue;
  */
 class Network
 {
-    public static final Identity KUALALUMPUR = new StringIdentity( "kualalumpur" );
-    public static final Identity PENANG = new StringIdentity( "penang" );
+    public static final Identity KUALALUMPUR = StringIdentity.fromString( "kualalumpur" );
+    public static final Identity PENANG = StringIdentity.fromString( "penang" );
     private static List<Domain> domains;
     private static List<Person> persons;
     private static List<Male> males;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
index 84b6f43..f1d2f5c 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
@@ -46,7 +46,7 @@ import org.junit.Test;
 
 public class ServiceVisibilityTest
 {
-    public static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+    public static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
 
     private Energy4Java polygene;
     private Module module;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
index 1231e21..2a80ff1 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
@@ -47,7 +47,7 @@ import org.junit.Test;
 
 public class TransientVisibilityTest
 {
-    public static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+    public static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
     private Energy4Java polygene;
     private Module module;
     private Application app;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
index 26148ee..8ee0fb0 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/PrivateEntityUnitOfWorkTest.java
@@ -52,7 +52,7 @@ import static org.junit.Assert.fail;
  */
 public class PrivateEntityUnitOfWorkTest
 {
-    private static final Identity TEST_IDENTITY = new StringIdentity( "1" );
+    private static final Identity TEST_IDENTITY = StringIdentity.fromString( "1" );
 
     @Structure
     private UnitOfWorkFactory uowf;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
index 843c103..765fe6a 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/unitofwork/RemovalTest.java
@@ -20,11 +20,10 @@
 
 package org.apache.polygene.runtime.unitofwork;
 
-import org.apache.polygene.api.identity.Identity;
-import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityComposite;
+import org.apache.polygene.api.identity.Identity;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.property.Property;
 import org.apache.polygene.api.unitofwork.NoSuchEntityException;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
@@ -32,6 +31,7 @@ import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
@@ -40,7 +40,7 @@ public class RemovalTest
     extends AbstractPolygeneTest
 {
 
-    private static final Identity TEST_IDENTITY = new StringIdentity( "123" );
+    private static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
 
     public void assemble(ModuleAssembly module )
         throws AssemblyException

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
index 3c49336..2966ea5 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/AssociationToValueTest.java
@@ -151,7 +151,7 @@ public class AssociationToValueTest extends AbstractPolygeneTest
         public Person findPersonByName( String name )
         {
             UnitOfWork uow = unitOfWorkFactory.currentUnitOfWork();
-            return uow.toValue( Person.class, uow.get( Person.class, new StringIdentity( name ) ) );
+            return uow.toValue( Person.class, uow.get( Person.class, StringIdentity.fromString( name ) ) );
         }
     }
 
@@ -206,7 +206,7 @@ public class AssociationToValueTest extends AbstractPolygeneTest
         private Person createPerson( String name )
         {
             UnitOfWork uow = uowf.currentUnitOfWork();
-            return uow.newEntity( Person.class, new StringIdentity( name ) );
+            return uow.newEntity( Person.class, StringIdentity.fromString( name ) );
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
index fe8cdd8..f29895d 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueSerializationRegressionTest.java
@@ -50,7 +50,7 @@ public class ValueSerializationRegressionTest extends AbstractPolygeneTest
         throws UnitOfWorkCompletionException
     {
         ValueBuilder<DualFaced> builder = valueBuilderFactory.newValueBuilder( DualFaced.class );
-        builder.prototype().identity().set( new StringIdentity( "1234" ) );
+        builder.prototype().identity().set( StringIdentity.fromString( "1234" ) );
         builder.prototype().name().set( "Hedhman" );
         DualFaced value = builder.newInstance();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
index 4c83a45..b0d7336 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueVisibilityTest.java
@@ -48,7 +48,7 @@ import org.junit.Test;
 public class ValueVisibilityTest
 {
 
-    public static final Identity TEST_IDENTIY = new StringIdentity( "123" );
+    public static final Identity TEST_IDENTIY = StringIdentity.fromString( "123" );
     private Energy4Java polygene;
     private Module module;
     private Application app;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
index db3d02f..02067e5 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/value/ValueWithAssociationTest.java
@@ -113,7 +113,7 @@ public class ValueWithAssociationTest extends AbstractPolygeneTest
         throws UnitOfWorkCompletionException
     {
         ValueBuilder<DualFaced> builder = valueBuilderFactory.newValueBuilder( DualFaced.class );
-        builder.prototype().identity().set( new StringIdentity( "1234" ) );
+        builder.prototype().identity().set( StringIdentity.fromString( "1234" ) );
         builder.prototype().name().set( "Hedhman" );
         DualFaced value = builder.newInstance();
 
@@ -125,8 +125,8 @@ public class ValueWithAssociationTest extends AbstractPolygeneTest
 
         try (UnitOfWork uow = unitOfWorkFactory.newUnitOfWork())
         {
-            DualFaced entity = uow.get( DualFaced.class, new StringIdentity( "1234" ) );
-            assertThat( entity.identity().get(), equalTo( new StringIdentity( "1234" ) ) );
+            DualFaced entity = uow.get( DualFaced.class, StringIdentity.fromString( "1234" ) );
+            assertThat( entity.identity().get(), equalTo( StringIdentity.fromString( "1234" ) ) );
             assertThat( entity.name().get(), equalTo( "Hedhman" ) );
             uow.complete();
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
index 2fb301b..559605f 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/visibility/VisibilityInUnitOfWorkTest.java
@@ -41,8 +41,8 @@ import org.junit.Test;
 public class VisibilityInUnitOfWorkTest
 {
 
-    public static final Identity TEST_IDENTITY1 = new StringIdentity( "123" );
-    public static final Identity TEST_IDENTITY2 = new StringIdentity( "345" );
+    public static final Identity TEST_IDENTITY1 = StringIdentity.fromString( "123" );
+    public static final Identity TEST_IDENTITY2 = StringIdentity.fromString( "345" );
 
     @Test
     public void givenTwoModulesWithServiceAndEntityInOneAndEntityInOtherWhenOtherEntityAccessServiceWhichUsesItsEntityExpectServiceToHaveVisibility()

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
index 6a891c4..2c566b4 100644
--- a/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/spi/service/importer/ServiceInstanceImporterTest.java
@@ -21,10 +21,6 @@
 package org.apache.polygene.spi.service.importer;
 
 import org.apache.polygene.api.identity.StringIdentity;
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.hamcrest.CoreMatchers;
-import org.junit.Assert;
-import org.junit.Test;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.service.ImportedServiceDescriptor;
@@ -34,6 +30,10 @@ import org.apache.polygene.api.service.ServiceImporterException;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ImportedServiceDeclaration;
 import org.apache.polygene.bootstrap.ModuleAssembly;
+import org.apache.polygene.test.AbstractPolygeneTest;
+import org.hamcrest.CoreMatchers;
+import org.junit.Assert;
+import org.junit.Test;
 
 /**
  * JAVADOC
@@ -46,7 +46,7 @@ public class ServiceInstanceImporterTest
     {
         module.importedServices( TestService.class ).
             identifiedBy( "test" ).
-            setMetaInfo( new StringIdentity( "testimporter" ) ).
+            setMetaInfo( StringIdentity.fromString( "testimporter" ) ).
             importedBy( ImportedServiceDeclaration.SERVICE_IMPORTER );
         module.services( TestImporterService.class ).identifiedBy( "testimporter" );
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
index bc715b7..b88c189 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/JSONMapEntityStoreMixin.java
@@ -419,7 +419,7 @@ public class JSONMapEntityStoreMixin
 
             String version = parsedState.getString( JSONKeys.VERSION );
             Instant modified = Instant.ofEpochMilli( parsedState.getJsonNumber( JSONKeys.MODIFIED ).longValueExact() );
-            Identity identity = new StringIdentity( parsedState.getString( JSONKeys.IDENTITY ) );
+            Identity identity = StringIdentity.fromString( parsedState.getString( JSONKeys.IDENTITY ) );
 
             // Check if version is correct
             JsonObject state;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
index c8bd163..5e784f7 100644
--- a/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
+++ b/core/spi/src/main/java/org/apache/polygene/spi/entitystore/helpers/MapEntityStoreMixin.java
@@ -382,7 +382,7 @@ public class MapEntityStoreMixin
 
             String version = parsedState.getString( JSONKeys.VERSION );
             Instant modified = Instant.ofEpochMilli( parsedState.getJsonNumber( JSONKeys.MODIFIED ).longValueExact() );
-            Identity identity = new StringIdentity( parsedState.getString( JSONKeys.IDENTITY ) );
+            Identity identity = StringIdentity.fromString( parsedState.getString( JSONKeys.IDENTITY ) );
 
             // Check if version is correct
             JsonObject state;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
index 935d2ee..85bc744 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/entitystore/Polygene142Test.java
@@ -22,8 +22,8 @@ import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.property.Property;
-import org.apache.polygene.api.service.qualifier.Tagged;
 import org.apache.polygene.api.serialization.Serialization;
+import org.apache.polygene.api.service.qualifier.Tagged;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.api.usecase.UsecaseBuilder;
 import org.apache.polygene.api.value.ValueBuilder;
@@ -61,7 +61,7 @@ public class Polygene142Test extends AbstractPolygeneTest
             value = serialization.deserialize( module, Regression142Type.class, serialized ); // ok
         }
         {
-            Identity valueId = new StringIdentity( "abcdefg" );
+            Identity valueId = StringIdentity.fromString( "abcdefg" );
             {
                 try( UnitOfWork uow = unitOfWorkFactory.newUnitOfWork( UsecaseBuilder.newUsecase( "create" ) ) )
                 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
index 2bb6abb..e936c1a 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/entity/AbstractEntityStoreTest.java
@@ -426,7 +426,6 @@ public abstract class AbstractEntityStoreTest
             assertThat( "many association cleared", testEntity.manyAssociation().count(), is( 0 ) );
             assertThat( "named association cleared", testEntity.namedAssociation().count(), is( 0 ) );
             assertThat( "version has not changed", newVersion, not( equalTo( version ) ) );
-
             unitOfWork.complete();
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractQueryTest.java
index f005398..08abae0 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractQueryTest.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/AbstractQueryTest.java
@@ -465,7 +465,7 @@ public abstract class AbstractQueryTest
     {
         QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
-        Domain gaming = unitOfWork.get( Domain.class, new StringIdentity( "Gaming" ) );
+        Domain gaming = unitOfWork.get( Domain.class, StringIdentity.fromString( "Gaming" ) );
         Query<Person> query = unitOfWork.newQuery( qb.where( contains( person.interests(), gaming ) ) );
         System.out.println( "*** script33: " + query );
 
@@ -477,7 +477,7 @@ public abstract class AbstractQueryTest
     {
         QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
-        Female annDoe = unitOfWork.get( Female.class, new StringIdentity( "anndoe" ) );
+        Female annDoe = unitOfWork.get( Female.class, StringIdentity.fromString( "anndoe" ) );
         Query<Person> query = unitOfWork.newQuery( qb.where( eq( person.mother(), annDoe ) ) );
         System.out.println( "*** script34: " + query );
 
@@ -500,7 +500,7 @@ public abstract class AbstractQueryTest
     {
         QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
         Person person = templateFor( Person.class );
-        Account anns = unitOfWork.get( Account.class, new StringIdentity( "accountOfAnnDoe" ) );
+        Account anns = unitOfWork.get( Account.class, StringIdentity.fromString( "accountOfAnnDoe" ) );
         Query<Person> query = unitOfWork.newQuery( qb.where( contains( person.accounts(), anns ) ) );
         System.out.println( "*** script36: " + query );
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/core/testsupport/src/main/java/org/apache/polygene/test/indexing/TestData.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/TestData.java b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/TestData.java
index aaa8bac..bc275bb 100644
--- a/core/testsupport/src/main/java/org/apache/polygene/test/indexing/TestData.java
+++ b/core/testsupport/src/main/java/org/apache/polygene/test/indexing/TestData.java
@@ -59,7 +59,7 @@ public class TestData
             NameableAssert.clear();
             Domain gaming;
             {
-                EntityBuilder<Domain> domainBuilder = unitOfWork.newEntityBuilder( Domain.class, new StringIdentity( "Gaming" ) );
+                EntityBuilder<Domain> domainBuilder = unitOfWork.newEntityBuilder( Domain.class, StringIdentity.fromString( "Gaming" ) );
                 gaming = domainBuilder.instance();
                 gaming.name().set( "Gaming" );
                 gaming.description().set( "Gaming domain" );
@@ -121,7 +121,7 @@ public class TestData
 
             Account annsAccount;
             {
-                EntityBuilder<Account> accountBuilder = unitOfWork.newEntityBuilder( Account.class, new StringIdentity( "accountOfAnnDoe" ) );
+                EntityBuilder<Account> accountBuilder = unitOfWork.newEntityBuilder( Account.class, StringIdentity.fromString( "accountOfAnnDoe" ) );
                 annsAccount = accountBuilder.instance();
                 annsAccount.number().set( "accountOfAnnDoe" );
                 annsAccount = accountBuilder.newInstance();
@@ -129,7 +129,7 @@ public class TestData
 
             Account jacksAccount;
             {
-                EntityBuilder<Account> accountBuilder = unitOfWork.newEntityBuilder( Account.class, new StringIdentity( "accountOfJackDoe" ) );
+                EntityBuilder<Account> accountBuilder = unitOfWork.newEntityBuilder( Account.class, StringIdentity.fromString( "accountOfJackDoe" ) );
                 jacksAccount = accountBuilder.instance();
                 jacksAccount.number().set( "accountOfJackDoe" );
                 jacksAccount = accountBuilder.newInstance();
@@ -143,7 +143,7 @@ public class TestData
 
             Female annDoe;
             {
-                EntityBuilder<Female> femaleBuilder = unitOfWork.newEntityBuilder( Female.class, new StringIdentity( "anndoe" ) );
+                EntityBuilder<Female> femaleBuilder = unitOfWork.newEntityBuilder( Female.class, StringIdentity.fromString( "anndoe" ) );
                 annDoe = femaleBuilder.instance();
                 annDoe.name().set( "Ann Doe" );
                 annDoe.title().set( Person.Title.MRS );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
index fe078d5..cde443c 100644
--- a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
@@ -427,7 +427,7 @@ public class CassandraEntityStoreMixin
         Identity newIdentity;
         if( idGenerator == null )
         {
-            newIdentity = new StringIdentity( UUID.randomUUID().toString() );
+            newIdentity = StringIdentity.fromString( UUID.randomUUID().toString() );
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/assembly/AbstractSQLEntityStoreAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/assembly/AbstractSQLEntityStoreAssembler.java b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/assembly/AbstractSQLEntityStoreAssembler.java
index b23d678..36fe4ee 100644
--- a/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/assembly/AbstractSQLEntityStoreAssembler.java
+++ b/extensions/entitystore-sql/src/main/java/org/apache/polygene/entitystore/sql/assembly/AbstractSQLEntityStoreAssembler.java
@@ -36,7 +36,7 @@ import org.jooq.conf.Settings;
 public abstract class AbstractSQLEntityStoreAssembler<AssemblerType>
     extends Assemblers.VisibilityIdentityConfig<AssemblerType>
 {
-    public static final Identity DEFAULT_ENTITYSTORE_IDENTITY = new StringIdentity( "entitystore-sql" );
+    public static final Identity DEFAULT_ENTITYSTORE_IDENTITY = StringIdentity.fromString( "entitystore-sql" );
     private static final String DEFAULT_CHANGELOG_PATH = "org/apache/polygene/entitystore/sql/changelog.xml";
 
     private String changelogPath = DEFAULT_CHANGELOG_PATH;

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RDFPerformanceTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RDFPerformanceTest.java b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RDFPerformanceTest.java
index 014d8fb..96abf69 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RDFPerformanceTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/polygene/index/rdf/RDFPerformanceTest.java
@@ -102,7 +102,7 @@ public class RDFPerformanceTest extends AbstractPolygeneTest
         List<ExampleEntity> entities = new ArrayList<ExampleEntity>();
         for (Integer x = 0; x < howMany; ++x)
         {
-            ExampleEntity exampleEntity = this.unitOfWorkFactory.currentUnitOfWork().newEntity( ExampleEntity.class, new StringIdentity( "entity" + x ) );
+            ExampleEntity exampleEntity = this.unitOfWorkFactory.currentUnitOfWork().newEntity( ExampleEntity.class, StringIdentity.fromString( "entity" + x ) );
 
             for (ExampleEntity entity : entities)
             {
@@ -188,7 +188,7 @@ public class RDFPerformanceTest extends AbstractPolygeneTest
         UnitOfWork uow = this.unitOfWorkFactory.newUnitOfWork();
         for (int i = 0; i < 1000; i++)
         {
-            ExampleEntity entity50 = uow.get(ExampleEntity.class, new StringIdentity( "entity50" ) );
+            ExampleEntity entity50 = uow.get(ExampleEntity.class, StringIdentity.fromString( "entity50" ) );
             Query<ExampleEntity> query = uow.newQuery( this.queryBuilderFactory.newQueryBuilder( ExampleEntity.class ).
                     where( QueryExpressions.contains( QueryExpressions.templateFor( ExampleEntity.class ).manyAssoc(), entity50) ));
             System.out.println(query.count());

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/assembly/AbstractSQLIndexQueryAssembler.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/assembly/AbstractSQLIndexQueryAssembler.java b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/assembly/AbstractSQLIndexQueryAssembler.java
index 7fd3ec0..d3675a3 100644
--- a/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/assembly/AbstractSQLIndexQueryAssembler.java
+++ b/extensions/indexing-sql/src/main/java/org/apache/polygene/index/sql/assembly/AbstractSQLIndexQueryAssembler.java
@@ -35,7 +35,7 @@ import org.apache.polygene.library.sql.generator.vendor.SQLVendorProvider;
 
 public abstract class AbstractSQLIndexQueryAssembler<AssemblerType> extends Assemblers.VisibilityIdentityConfig<AssemblerType>
 {
-    public static final Identity DEFAULT_IDENTITY = new StringIdentity( "indexing-sql" );
+    public static final Identity DEFAULT_IDENTITY = StringIdentity.fromString( "indexing-sql" );
 
     private Class<? extends ReindexingStrategy> reindexingStrategy = ReindexingStrategy.NeverNeed.class;
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/alarm/src/main/java/org/apache/polygene/library/alarm/AlarmSystem.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/apache/polygene/library/alarm/AlarmSystem.java b/libraries/alarm/src/main/java/org/apache/polygene/library/alarm/AlarmSystem.java
index c205f64..b275943 100644
--- a/libraries/alarm/src/main/java/org/apache/polygene/library/alarm/AlarmSystem.java
+++ b/libraries/alarm/src/main/java/org/apache/polygene/library/alarm/AlarmSystem.java
@@ -214,7 +214,7 @@ public interface AlarmSystem
         public AlarmPoint createAlarm( String name, AlarmCategory category )
         {
             UnitOfWork uow = uowf.currentUnitOfWork();
-            EntityBuilder<AlarmPoint> builder = uow.newEntityBuilder( AlarmPoint.class, new StringIdentity( name ) );
+            EntityBuilder<AlarmPoint> builder = uow.newEntityBuilder( AlarmPoint.class, StringIdentity.fromString( name ) );
             builder.instance().category().set( category );
             AlarmPoint.AlarmState state = builder.instanceFor( AlarmPoint.AlarmState.class );
             state.systemName().set( name );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmProxyTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmProxyTest.java b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmProxyTest.java
index 478ef93..30e9c35 100644
--- a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmProxyTest.java
+++ b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmProxyTest.java
@@ -21,13 +21,13 @@
 package org.apache.polygene.library.alarm;
 
 import org.apache.polygene.api.identity.StringIdentity;
-import org.junit.Test;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
 import org.apache.polygene.bootstrap.AssemblyException;
 import org.apache.polygene.bootstrap.ModuleAssembly;
 import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.notNullValue;
@@ -60,7 +60,7 @@ public class AlarmProxyTest extends AbstractPolygeneTest
         try
         {
 // START SNIPPET: documentation
-            myAlarmPoint = factory.create( new StringIdentity( "This Alarm Identity" ), "ProActiveCRM", "Sales", AlarmClass.B );
+            myAlarmPoint = factory.create( StringIdentity.fromString( "This Alarm Identity" ), "ProActiveCRM", "Sales", AlarmClass.B );
             myAlarmPoint.history().maxSize().set( 20 );
 // END SNIPPET: documentation
 
@@ -71,7 +71,7 @@ public class AlarmProxyTest extends AbstractPolygeneTest
             assertThat( myAlarmPoint.history().activateCounter(), equalTo( 1 ) );
             AlarmEvent event = myAlarmPoint.history().firstEvent();
             assertThat( event, notNullValue() );
-            assertThat( event.identity().get(), equalTo( new StringIdentity( "This Alarm Identity" ) ) );
+            assertThat( event.identity().get(), equalTo( StringIdentity.fromString( "This Alarm Identity" ) ) );
             assertThat( event.newStatus().get().name( null ), equalTo( "Activated" ) );
             assertThat( event.oldStatus().get().name( null ), equalTo( "Normal" ) );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/jmx/src/main/java/org/apache/polygene/library/jmx/ConfigurationManagerService.java
----------------------------------------------------------------------
diff --git a/libraries/jmx/src/main/java/org/apache/polygene/library/jmx/ConfigurationManagerService.java b/libraries/jmx/src/main/java/org/apache/polygene/library/jmx/ConfigurationManagerService.java
index 50485d1..a8ce3bf 100644
--- a/libraries/jmx/src/main/java/org/apache/polygene/library/jmx/ConfigurationManagerService.java
+++ b/libraries/jmx/src/main/java/org/apache/polygene/library/jmx/ConfigurationManagerService.java
@@ -243,7 +243,7 @@ public interface ConfigurationManagerService
             EditableConfiguration( MBeanInfo info, String identity, Map<String, AccessibleObject> propertyNames )
             {
                 this.info = info;
-                this.identity = new StringIdentity(identity);
+                this.identity = StringIdentity.fromString(identity);
                 this.propertyNames = propertyNames;
             }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntitySerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntitySerializerTest.java b/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntitySerializerTest.java
index fb5b0c3..59528e2 100644
--- a/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntitySerializerTest.java
+++ b/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntitySerializerTest.java
@@ -109,14 +109,14 @@ public class EntitySerializerTest
             valueBuilder.prototype().test3().set( valueBuilder2.newInstance() );
             TestValue testValue = valueBuilder.newInstance();
 
-            EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder( TestEntity.class, new StringIdentity( "test1" ) );
+            EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder( TestEntity.class, StringIdentity.fromString( "test1" ) );
             TestEntity rickardTemplate = builder.instance();
             rickardTemplate.name().set( "Rickard" );
             rickardTemplate.title().set( "Mr" );
             rickardTemplate.value().set( testValue );
             TestEntity testEntity = builder.newInstance();
 
-            EntityBuilder<TestEntity> builder2 = unitOfWork.newEntityBuilder( TestEntity.class, new StringIdentity( "test2" ) );
+            EntityBuilder<TestEntity> builder2 = unitOfWork.newEntityBuilder( TestEntity.class, StringIdentity.fromString( "test2" ) );
             TestEntity niclasTemplate = builder2.instance();
             niclasTemplate.name().set( "Niclas" );
             niclasTemplate.title().set( "Mr" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntityTypeSerializerTest.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntityTypeSerializerTest.java b/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntityTypeSerializerTest.java
index 6c1d279..e4a7efe 100644
--- a/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntityTypeSerializerTest.java
+++ b/libraries/rdf/src/test/java/org/apache/polygene/library/rdf/entity/EntityTypeSerializerTest.java
@@ -20,14 +20,10 @@
 
 package org.apache.polygene.library.rdf.entity;
 
-import org.apache.polygene.api.identity.StringIdentity;
-import org.apache.polygene.test.AbstractPolygeneTest;
-import org.junit.Before;
-import org.junit.Test;
-import org.openrdf.model.Statement;
-import org.openrdf.rio.RDFHandlerException;
+import java.io.PrintWriter;
 import org.apache.polygene.api.entity.EntityBuilder;
 import org.apache.polygene.api.entity.EntityDescriptor;
+import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.Service;
 import org.apache.polygene.api.injection.scope.Uses;
 import org.apache.polygene.api.unitofwork.UnitOfWork;
@@ -40,9 +36,12 @@ import org.apache.polygene.library.rdf.PolygeneEntityType;
 import org.apache.polygene.library.rdf.Rdfs;
 import org.apache.polygene.library.rdf.serializer.RdfXmlSerializer;
 import org.apache.polygene.spi.entitystore.EntityStore;
-
-import java.io.PrintWriter;
+import org.apache.polygene.test.AbstractPolygeneTest;
 import org.apache.polygene.test.EntityTestAssembler;
+import org.junit.Before;
+import org.junit.Test;
+import org.openrdf.model.Statement;
+import org.openrdf.rio.RDFHandlerException;
 
 
 /**
@@ -96,14 +95,14 @@ public class EntityTypeSerializerTest
             valueBuilder.prototype().test3().set( vb2.newInstance() );
             TestValue testValue = valueBuilder.newInstance();
 
-            EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder(TestEntity.class, new StringIdentity( "test1") );
+            EntityBuilder<TestEntity> builder = unitOfWork.newEntityBuilder(TestEntity.class, StringIdentity.fromString( "test1") );
             TestEntity rickardTemplate = builder.instance();
             rickardTemplate.name().set( "Rickard" );
             rickardTemplate.title().set( "Mr" );
             rickardTemplate.value().set( testValue );
             TestEntity testEntity = builder.newInstance();
 
-            EntityBuilder<TestEntity> builder2 = unitOfWork.newEntityBuilder(TestEntity.class, new StringIdentity( "test2") );
+            EntityBuilder<TestEntity> builder2 = unitOfWork.newEntityBuilder(TestEntity.class, StringIdentity.fromString( "test2") );
             TestEntity niclasTemplate = builder2.instance();
             niclasTemplate.name().set( "Niclas" );
             niclasTemplate.title().set( "Mr" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/RequestReaderDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/RequestReaderDelegator.java b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/RequestReaderDelegator.java
index db767ff..7bfc77b 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/RequestReaderDelegator.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/RequestReaderDelegator.java
@@ -51,7 +51,7 @@ public class RequestReaderDelegator
     public void init( @Service Iterable<ServiceReference<RequestReader>> requestReaderReferences )
     {
         Logger logger = LoggerFactory.getLogger( getClass() );
-        Identity requestreaderdelegator = new StringIdentity("requestreaderdelegator");
+        Identity requestreaderdelegator = StringIdentity.fromString("requestreaderdelegator");
 
         // Add custom readers first
         for( ServiceReference<RequestReader> requestReader : requestReaderReferences )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/ResponseWriterDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/ResponseWriterDelegator.java b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/ResponseWriterDelegator.java
index 18fd7fa..14279c8 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/ResponseWriterDelegator.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/ResponseWriterDelegator.java
@@ -48,7 +48,7 @@ public class ResponseWriterDelegator
     public void init( @Service Iterable<ServiceReference<ResponseWriter>> resultWriters )
     {
         Logger logger = LoggerFactory.getLogger( getClass() );
-        Identity responsewriterdelegator = new StringIdentity( "responsewriterdelegator" );
+        Identity responsewriterdelegator = StringIdentity.fromString( "responsewriterdelegator" );
 
         // Add custom writers first
         for( ServiceReference<ResponseWriter> resultWriter : resultWriters )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/requestreader/DefaultRequestReader.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/requestreader/DefaultRequestReader.java b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/requestreader/DefaultRequestReader.java
index b968da4..8ed1666 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/requestreader/DefaultRequestReader.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/requestreader/DefaultRequestReader.java
@@ -251,7 +251,7 @@ public class DefaultRequestReader
                         entityAsForm = new Form();
                     }
 
-                    Identity entityIdentity = new StringIdentity( getValue( "entity", queryAsForm, entityAsForm ) );
+                    Identity entityIdentity = StringIdentity.fromString( getValue( "entity", queryAsForm, entityAsForm ) );
                     args[0] = uowf.currentUnitOfWork().get( method.getParameterTypes()[0], entityIdentity );
 
                     return args;
@@ -480,7 +480,7 @@ public class DefaultRequestReader
             }
             else if( parameterType.isInterface() )
             {
-                arg = uowf.currentUnitOfWork().get( parameterType, new StringIdentity( argString ) );
+                arg = uowf.currentUnitOfWork().get( parameterType, StringIdentity.fromString( argString ) );
             }
             else
             {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/24fe6039/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
----------------------------------------------------------------------
diff --git a/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java b/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
index 99a538c..5401a54 100644
--- a/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
+++ b/libraries/rest/src/main/java/org/apache/polygene/library/rest/admin/EntityResource.java
@@ -106,7 +106,7 @@ public class EntityResource
     {
         // /entity/{reference}
         Map<String, Object> attributes = getRequest().getAttributes();
-        identity = new StringIdentity( (String) attributes.get( "reference" ) );
+        identity = StringIdentity.fromString( (String) attributes.get( "reference" ) );
     }
 
     @Override


Mime
View raw message