polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [05/50] [abbrv] polygene-java git commit: POLYGENE-184 - Removed NullArgumentException and replaced mostly with Objects.requireNonNull() and a few "if( x.isEmpty() ) throw new IllegalArgumentException(); "
Date Sun, 26 Feb 2017 22:47:27 GMT
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/InjectedParametersDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/InjectedParametersDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/InjectedParametersDetailDescriptor.java
index 539ff08..33d4b45 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/InjectedParametersDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/InjectedParametersDetailDescriptor.java
@@ -19,10 +19,9 @@
  */
 package org.apache.polygene.tools.model.descriptor;
 
+import java.util.Objects;
 import org.apache.polygene.api.composite.InjectedParametersDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public class InjectedParametersDetailDescriptor
 {
     private final InjectedParametersDescriptor descriptor;
@@ -32,8 +31,7 @@ public class InjectedParametersDetailDescriptor
     InjectedParametersDetailDescriptor( InjectedParametersDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         descriptor = aDescriptor;
     }
 
@@ -74,14 +72,14 @@ public class InjectedParametersDetailDescriptor
     final void setConstructor( ConstructorDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         constructor = aDescriptor;
     }
 
     final void setMethod( InjectedMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         method = aDescriptor;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/LayerDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/LayerDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/LayerDetailDescriptor.java
index 7387002..e312701 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/LayerDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/LayerDetailDescriptor.java
@@ -21,12 +21,11 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.structure.LayerDescriptor;
 import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 /**
  * Layer Detail Descriptor.
  * <p>
@@ -44,7 +43,7 @@ public final class LayerDetailDescriptor
     LayerDetailDescriptor( LayerDescriptor descriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "LayerDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "LayerDescriptor" );
         this.descriptor = descriptor;
     }
 
@@ -108,26 +107,26 @@ public final class LayerDetailDescriptor
 
     final void setApplication( ApplicationDetailDescriptor descriptor )
     {
-        validateNotNull( "ApplicationDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ApplicationDetailDescriptor" );
         application = descriptor;
     }
 
     final void addActivator( ActivatorDetailDescriptor descriptor )
     {
-        validateNotNull( "ActivatorDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ActivatorDetailDescriptor" );
         descriptor.setLayer( this );
         activators.add( descriptor );
     }
 
     final void addUsedLayer( LayerDetailDescriptor descriptor )
     {
-        validateNotNull( "LayerDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "LayerDetailDescriptor" );
         usedLayers.add( descriptor );
     }
 
     final void addModule( ModuleDetailDescriptor descriptor )
     {
-        validateNotNull( "ModuleDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ModuleDetailDescriptor" );
         descriptor.setLayer( this );
         modules.add( descriptor );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernDetailDescriptor.java
index d7cb494..82a6264 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.concern.ConcernDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodConcernDetailDescriptor
     implements InjectableDetailDescriptor
 {
@@ -38,7 +37,7 @@ public final class MethodConcernDetailDescriptor
     MethodConcernDetailDescriptor( ConcernDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         descriptor = aDescriptor;
 
@@ -109,14 +108,14 @@ public final class MethodConcernDetailDescriptor
    final void setConcerns( MethodConcernsDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         concerns = aDescriptor;
     }
 
     final void addConstructor( ConstructorDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodConcern( this );
         constructors.add( aDescriptor );
@@ -125,7 +124,7 @@ public final class MethodConcernDetailDescriptor
     final void addInjectedMethod( InjectedMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodConcern( this );
         injectedMethods.add( aDescriptor );
@@ -134,7 +133,7 @@ public final class MethodConcernDetailDescriptor
     final void addInjectedField( InjectedFieldDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodConcern( this );
         injectedFields.add( aDescriptor );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernsDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernsDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernsDetailDescriptor.java
index 3446035..0ff1479 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernsDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConcernsDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.concern.ConcernsDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodConcernsDetailDescriptor
 {
     private final ConcernsDescriptor descriptor;
@@ -34,7 +33,7 @@ public final class MethodConcernsDetailDescriptor
     MethodConcernsDetailDescriptor( ConcernsDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         descriptor = aDescriptor;
         concerns = new LinkedList<MethodConcernDetailDescriptor>();
     }
@@ -72,14 +71,14 @@ public final class MethodConcernsDetailDescriptor
     final void setMethod( CompositeMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         method = aDescriptor;
     }
 
     final void addConcern( MethodConcernDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         aDescriptor.setConcerns( this );
         concerns.add( aDescriptor );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintDetailDescriptor.java
index b31b041..7dc3102 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintDetailDescriptor.java
@@ -19,10 +19,9 @@
  */
 package org.apache.polygene.tools.model.descriptor;
 
+import java.util.Objects;
 import org.apache.polygene.api.constraint.ConstraintDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodConstraintDetailDescriptor
 {
     private final ConstraintDescriptor descriptor;
@@ -31,7 +30,7 @@ public final class MethodConstraintDetailDescriptor
     MethodConstraintDetailDescriptor( ConstraintDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         descriptor = aDescriptor;
     }
@@ -65,8 +64,7 @@ public final class MethodConstraintDetailDescriptor
    final void setConstraints( MethodConstraintsDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         constraints = aDescriptor;
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintsDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintsDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintsDetailDescriptor.java
index 604f1e2..87efc17 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintsDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodConstraintsDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.constraint.ConstraintsDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodConstraintsDetailDescriptor
 {
     private final ConstraintsDescriptor descriptor;
@@ -34,8 +33,7 @@ public final class MethodConstraintsDetailDescriptor
     MethodConstraintsDetailDescriptor( ConstraintsDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         descriptor = aDescriptor;
         constraints = new LinkedList<MethodConstraintDetailDescriptor>();
     }
@@ -73,14 +71,14 @@ public final class MethodConstraintsDetailDescriptor
     final void setMethod( CompositeMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         method = aDescriptor;
     }
 
     final void addConstraint( MethodConstraintDetailDescriptor aDescriptor )
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setConstraints( this );
         constraints.add( aDescriptor );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectDetailDescriptor.java
index 30360d8..a043ef8 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.sideeffect.SideEffectDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodSideEffectDetailDescriptor
     implements InjectableDetailDescriptor
 {
@@ -38,8 +37,7 @@ public final class MethodSideEffectDetailDescriptor
     MethodSideEffectDetailDescriptor( SideEffectDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         descriptor = aDescriptor;
         constructors = new LinkedList<ConstructorDetailDescriptor>();
         injectedMethods = new LinkedList<InjectedMethodDetailDescriptor>();
@@ -101,8 +99,7 @@ public final class MethodSideEffectDetailDescriptor
 
     final void setSideEffects( MethodSideEffectDetailDescriptor aDescriptor )
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         sideEffects = aDescriptor;
     }
 
@@ -115,7 +112,7 @@ public final class MethodSideEffectDetailDescriptor
    final void addConstructor( ConstructorDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodSideEffect( this );
         constructors.add( aDescriptor );
@@ -124,7 +121,7 @@ public final class MethodSideEffectDetailDescriptor
     final void addInjectedMethod( InjectedMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodSideEffect( this );
         injectedMethods.add( aDescriptor );
@@ -133,7 +130,7 @@ public final class MethodSideEffectDetailDescriptor
     final void addInjectedField( InjectedFieldDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMethodSideEffect( this );
         injectedFields.add( aDescriptor );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectsDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectsDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectsDetailDescriptor.java
index bdd4a6b..e8c321c 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectsDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MethodSideEffectsDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.sideeffect.SideEffectsDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MethodSideEffectsDetailDescriptor
 {
     private final SideEffectsDescriptor descriptor;
@@ -34,7 +33,7 @@ public final class MethodSideEffectsDetailDescriptor
     MethodSideEffectsDetailDescriptor( SideEffectsDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         descriptor = aDescriptor;
         sideEffects = new LinkedList<MethodSideEffectDetailDescriptor>();
@@ -73,14 +72,14 @@ public final class MethodSideEffectsDetailDescriptor
     final void setMethod( CompositeMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         method = aDescriptor;
     }
 
     final void addSideEffect( MethodSideEffectDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setSideEffects( aDescriptor );
         sideEffects.add( aDescriptor );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MixinDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MixinDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MixinDetailDescriptor.java
index ac1c90d..dfc1f6c 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MixinDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/MixinDetailDescriptor.java
@@ -21,10 +21,9 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.mixin.MixinDescriptor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 public final class MixinDetailDescriptor
     implements InjectableDetailDescriptor
 {
@@ -37,8 +36,7 @@ public final class MixinDetailDescriptor
     MixinDetailDescriptor( MixinDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
-
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         descriptor = aDescriptor;
         constructors = new LinkedList<ConstructorDetailDescriptor>();
         injectedMethods = new LinkedList<InjectedMethodDetailDescriptor>();
@@ -99,14 +97,14 @@ public final class MixinDetailDescriptor
     final void setComposite( CompositeDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
         composite = aDescriptor;
     }
 
     final void addConstructor( ConstructorDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMixin( this );
         constructors.add( aDescriptor );
@@ -115,7 +113,7 @@ public final class MixinDetailDescriptor
     final void addInjectedMethod( InjectedMethodDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMixin( this );
         injectedMethods.add( aDescriptor );
@@ -124,7 +122,7 @@ public final class MixinDetailDescriptor
     final void addInjectedField( InjectedFieldDetailDescriptor aDescriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "aDescriptor", aDescriptor );
+        Objects.requireNonNull( aDescriptor, "aDescriptor" );
 
         aDescriptor.setMixin( this );
         injectedFields.add( aDescriptor );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ModuleDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ModuleDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ModuleDetailDescriptor.java
index daf8dce..d956b13 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ModuleDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ModuleDetailDescriptor.java
@@ -21,12 +21,11 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.structure.ModuleDescriptor;
 import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 /**
  * Module Detail Descriptor.
  * <p>
@@ -48,7 +47,7 @@ public final class ModuleDetailDescriptor
     ModuleDetailDescriptor( ModuleDescriptor descriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "ModuleDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ModuleDescriptor" );
         this.descriptor = descriptor;
     }
 
@@ -125,55 +124,55 @@ public final class ModuleDetailDescriptor
     final void setLayer( LayerDetailDescriptor descriptor )
         throws IllegalArgumentException
     {
-        validateNotNull( "LayerDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "LayerDetailDescriptor" );
         layer = descriptor;
     }
 
     final void addActivator( ActivatorDetailDescriptor descriptor )
     {
-        validateNotNull( "ActivatorDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ActivatorDetailDescriptor" );
         descriptor.setModule( this );
         activators.add( descriptor );
     }
 
     final void addService( ServiceDetailDescriptor descriptor )
     {
-        validateNotNull( "ServiceDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ServiceDetailDescriptor" );
         descriptor.setModule( this );
         services.add( descriptor );
     }
 
     final void addImportedService( ImportedServiceDetailDescriptor descriptor )
     {
-        validateNotNull( "ImportedServiceDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ImportedServiceDetailDescriptor" );
         descriptor.setModule( this );
         importedServices.add( descriptor );
     }
 
     final void addEntity( EntityDetailDescriptor descriptor )
     {
-        validateNotNull( "EntityDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "EntityDetailDescriptor" );
         descriptor.setModule( this );
         entities.add( descriptor );
     }
 
     final void addValue( ValueDetailDescriptor descriptor )
     {
-        validateNotNull( "ValueDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ValueDetailDescriptor" );
         descriptor.setModule( this );
         values.add( descriptor );
     }
 
     final void addTransient( TransientDetailDescriptor descriptor )
     {
-        validateNotNull( "TransientDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "TransientDetailDescriptor" );
         descriptor.setModule( this );
         transients.add( descriptor );
     }
 
     final void addObject( ObjectDetailDescriptor descriptor )
     {
-        validateNotNull( "ObjectDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ObjectDetailDescriptor" );
         descriptor.setModule( this );
         objects.add( descriptor );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ObjectDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ObjectDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ObjectDetailDescriptor.java
index f60c026..7c90e58 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ObjectDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ObjectDetailDescriptor.java
@@ -21,12 +21,11 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.object.ObjectDescriptor;
 import org.apache.polygene.api.util.Visitable;
 import org.apache.polygene.api.util.Visitor;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 /**
  * Object Detail Descriptor.
  */
@@ -41,7 +40,7 @@ public final class ObjectDetailDescriptor
 
     ObjectDetailDescriptor( ObjectDescriptor descriptor )
     {
-        validateNotNull( "ObjectDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ObjectDescriptor" );
         this.descriptor = descriptor;
     }
 
@@ -90,27 +89,27 @@ public final class ObjectDetailDescriptor
 
     final void setModule( ModuleDetailDescriptor descriptor )
     {
-        validateNotNull( "ModuleDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ModuleDetailDescriptor" );
         module = descriptor;
     }
 
     final void addConstructor( ConstructorDetailDescriptor descriptor )
     {
-        validateNotNull( "ConstructorDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ConstructorDetailDescriptor" );
         descriptor.setObject( this );
         constructors.add( descriptor );
     }
 
     final void addInjectedMethod( InjectedMethodDetailDescriptor descriptor )
     {
-        validateNotNull( "InjectedMethodDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "InjectedMethodDetailDescriptor" );
         descriptor.setObject( this );
         injectedMethods.add( descriptor );
     }
 
     final void addInjectedField( InjectedFieldDetailDescriptor descriptor )
     {
-        validateNotNull( "InjectedFieldDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "InjectedFieldDetailDescriptor" );
         descriptor.setObject( this );
         injectedFields.add( descriptor );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/c71f1b24/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ServiceDetailDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ServiceDetailDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ServiceDetailDescriptor.java
index c066bdc..c2ab9f3 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ServiceDetailDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ServiceDetailDescriptor.java
@@ -21,13 +21,12 @@ package org.apache.polygene.tools.model.descriptor;
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Objects;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.service.ServiceDescriptor;
 import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
 
-import static org.apache.polygene.api.util.NullArgumentException.validateNotNull;
-
 /**
  * Service Detail Descriptor.
  * <p>
@@ -76,7 +75,7 @@ public final class ServiceDetailDescriptor
 
     final void addActivator( ActivatorDetailDescriptor descriptor )
     {
-        validateNotNull( "ActivatorDetailDescriptor", descriptor );
+        Objects.requireNonNull( descriptor, "ActivatorDetailDescriptor" );
         descriptor.setService( this );
         activators.add( descriptor );
     }


Mime
View raw message