polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject polygene-java git commit: Fixing javadoc and warnings.
Date Wed, 12 Apr 2017 01:04:30 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 68f2ea567 -> f14eeb94c


Fixing javadoc and warnings.


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

Branch: refs/heads/develop
Commit: f14eeb94c2f0fa561838f4aa8275f1d07400bcb8
Parents: 68f2ea5
Author: niclas <niclas@spicter.com>
Authored: Wed Apr 12 09:04:23 2017 +0800
Committer: niclas <niclas@spicter.com>
Committed: Wed Apr 12 09:04:23 2017 +0800

----------------------------------------------------------------------
 .../apache/polygene/api/association/ManyAssociation.java |  9 +++++++++
 .../apache/polygene/api/metrics/MetricsHealthCheck.java  |  3 +++
 .../apache/polygene/api/serialization/Converters.java    |  1 +
 .../polygene/runtime/structure/ModuleInstance.java       |  4 +++-
 .../polygene/runtime/unitofwork/ModuleUnitOfWork.java    | 11 ++++++-----
 .../serialization/javaxjson/JavaxJsonSerializer.java     |  1 +
 6 files changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
index 93aa9f2..cac7613 100644
--- a/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
+++ b/core/api/src/main/java/org/apache/polygene/api/association/ManyAssociation.java
@@ -24,12 +24,20 @@ import java.util.List;
 import java.util.Set;
 import java.util.stream.Stream;
 import org.apache.polygene.api.entity.EntityReference;
+import org.apache.polygene.api.identity.Identity;
 
 /**
  * Association to a collection of entities.
  */
 public interface ManyAssociation<T> extends Iterable<T>, AbstractAssociation
 {
+    /**
+     * Check is the entity is part of this {@code ManyAssociation}.
+     *
+     * @param entity The entity to be checking for.
+     * @return true if there is an entity in this ManyAssociation with the same {@link Identity}
as the given
+     * entity , otherwise false.
+     */
     boolean contains( T entity );
 
     /** Adds an entity reference representing the given entity to the {@code index} slot
of this collection.
@@ -38,6 +46,7 @@ public interface ManyAssociation<T> extends Iterable<T>, AbstractAssociation
      *     than the length of the collection, the entity reference will be added to the end.
      * </p>
      * @param entity The entity whose entity reference is to be added to this collection.
+     * @param index the position for the entity to be inserted at.
      * @return true if the entity reference has been added, false otherwise.
      */
     boolean add( int index, T entity );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/core/api/src/main/java/org/apache/polygene/api/metrics/MetricsHealthCheck.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/metrics/MetricsHealthCheck.java
b/core/api/src/main/java/org/apache/polygene/api/metrics/MetricsHealthCheck.java
index 560667d..b3ee0d8 100644
--- a/core/api/src/main/java/org/apache/polygene/api/metrics/MetricsHealthCheck.java
+++ b/core/api/src/main/java/org/apache/polygene/api/metrics/MetricsHealthCheck.java
@@ -51,6 +51,7 @@ public interface MetricsHealthCheck extends Metric
 
         /** Factory method for reporting an unhealthy state.
          *
+         * @param message The message to relay in the result.
          * @return An unhealthy result.
          */
         public static Result unhealthy(String message) {
@@ -59,6 +60,8 @@ public interface MetricsHealthCheck extends Metric
 
         /** Factory method for reporting a state where an exception has occurred.
          *
+         * @param message The message to relay in the result.
+         * @param exception the exception that has occurred.
          * @return A failing health state.
          */
         public static Result exception(String message, Throwable exception) {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/core/api/src/main/java/org/apache/polygene/api/serialization/Converters.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/serialization/Converters.java
b/core/api/src/main/java/org/apache/polygene/api/serialization/Converters.java
index 6b8cbef..62e76a5 100644
--- a/core/api/src/main/java/org/apache/polygene/api/serialization/Converters.java
+++ b/core/api/src/main/java/org/apache/polygene/api/serialization/Converters.java
@@ -70,6 +70,7 @@ public interface Converters
         }
 
         @Override
+        @SuppressWarnings( "unchecked" )
         public <T> Converter<T> converterFor( ValueType valueType )
         {
             Converter<T> converter = castConverter( converters.keySet().stream()

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
index 64b5f72..09a3eb6 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
@@ -118,7 +118,7 @@ public class ModuleInstance
     private UnitOfWorkFactory uowf;
 
     @SuppressWarnings( "LeakingThisInConstructor" )
-    public ModuleInstance( ModuleModel moduleModel, LayerDescriptor layer, TypeLookup typeLookup,
+    ModuleInstance( ModuleModel moduleModel, LayerDescriptor layer, TypeLookup typeLookup,
                            ServicesModel servicesModel, ImportedServicesModel importedServicesModel
     )
     {
@@ -393,6 +393,7 @@ public class ModuleInstance
     }
 
     @Override
+    @SuppressWarnings( "unchecked" )
     public <T> Stream<ServiceReference<T>> findServices( final Type serviceType
)
     {
         List<? extends ModelDescriptor> serviceModels = typeLookup.lookupServiceModels(
serviceType );
@@ -408,6 +409,7 @@ public class ModuleInstance
                             .map( ref -> (ServiceReference<T>) ref );
     }
 
+    @SuppressWarnings( "unchecked" )
     private <T> ServiceReference<T> findServiceReferenceInstance( ModelDescriptor
model )
     {
         ModuleInstance moduleInstanceOfModel = (ModuleInstance) model.module().instance();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/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 122d096..c23d0c1 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
@@ -422,7 +422,7 @@ public class ModuleUnitOfWork
         return uow.toString();
     }
 
-    public void addEntity( EntityInstance instance )
+    void addEntity( EntityInstance instance )
     {
         uow.addEntity( instance );
     }
@@ -665,7 +665,7 @@ public class ModuleUnitOfWork
     {
         private Object entity;
 
-        public ToValuePropertyMappingFunction( Object entity )
+        ToValuePropertyMappingFunction( Object entity )
         {
             this.entity = entity;
         }
@@ -683,7 +683,7 @@ public class ModuleUnitOfWork
     {
         private final T entity;
 
-        public ToValueAssociationMappingFunction( T entity )
+        ToValueAssociationMappingFunction( T entity )
         {
             this.entity = entity;
         }
@@ -701,7 +701,7 @@ public class ModuleUnitOfWork
     {
         private final T entity;
 
-        public ToValueManyAssociationMappingFunction( T entity )
+        ToValueManyAssociationMappingFunction( T entity )
         {
             this.entity = entity;
         }
@@ -719,7 +719,7 @@ public class ModuleUnitOfWork
     {
         private final T entity;
 
-        public ToValueNameAssociationMappingFunction( T entity )
+        ToValueNameAssociationMappingFunction( T entity )
         {
             this.entity = entity;
         }
@@ -763,6 +763,7 @@ public class ModuleUnitOfWork
         }
 
         @Override
+        @SuppressWarnings( "unchecked" )
         public EntityReference apply( AssociationDescriptor associationDescriptor )
         {
             AssociationStateHolder state = ValueInstance.valueInstanceOf( (ValueComposite)
value ).state();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/f14eeb94/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
index 48aa511..1835dce 100644
--- a/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
+++ b/core/spi/src/main/java/org/apache/polygene/serialization/javaxjson/JavaxJsonSerializer.java
@@ -119,6 +119,7 @@ public class JavaxJsonSerializer extends AbstractTextSerializer
         return object -> doSerialize( options, object, true );
     }
 
+    @SuppressWarnings( "unchecked" )
     private JsonValue doSerialize( Options options, Object object, boolean root )
     {
         if( object == null )


Mime
View raw message