polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [12/13] polygene-java git commit: Remove unneeded null checks on service lookups in ModuleUnitOfWork
Date Fri, 26 May 2017 15:00:27 GMT
Remove unneeded null checks on service lookups in ModuleUnitOfWork


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

Branch: refs/heads/develop
Commit: 8208bd3ebba8af62d9717611d8c5705139f267e6
Parents: b31e727
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Fri May 26 16:47:12 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Fri May 26 16:47:12 2017 +0200

----------------------------------------------------------------------
 .../polygene/runtime/unitofwork/ModuleUnitOfWork.java    | 11 -----------
 1 file changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/8208bd3e/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 7f4dedf..4787aa5 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
@@ -55,7 +55,6 @@ import org.apache.polygene.api.query.Query;
 import org.apache.polygene.api.query.QueryBuilder;
 import org.apache.polygene.api.query.QueryExecutionException;
 import org.apache.polygene.api.query.grammar.OrderBy;
-import org.apache.polygene.api.service.NoSuchServiceException;
 import org.apache.polygene.api.structure.ModuleDescriptor;
 import org.apache.polygene.api.unitofwork.ConcurrentEntityModificationException;
 import org.apache.polygene.api.unitofwork.NoSuchEntityException;
@@ -192,11 +191,6 @@ public class ModuleUnitOfWork
         if( identity == null )
         {
             IdentityGenerator idGen = ( (ModuleSpi) modelModule.instance() ).identityGenerator();
-            if( idGen == null )
-            {
-                throw new NoSuchServiceException( IdentityGenerator.class.getName(), modelModule
-                    .name(), modelModule.typeLookup() );
-            }
             identity = idGen.generate( model.types().findFirst().orElse( null ) );
         }
         EntityBuilder<T> builder;
@@ -266,11 +260,6 @@ public class ModuleUnitOfWork
             {
                 // Generate reference
                 IdentityGenerator idGen = moduleSpi.identityGenerator();
-                if( idGen == null )
-                {
-                    String typeName = IdentityGenerator.class.getName();
-                    throw new NoSuchServiceException( typeName, modelModule.name(), modelModule.typeLookup()
);
-                }
                 identity = idGen.generate( model.types().findFirst().orElse( null ) );
             }
             else


Mime
View raw message