polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [2/3] polygene-java git commit: Remove redundant casts and type parameters
Date Fri, 03 Feb 2017 07:57:41 GMT
Remove redundant casts and type parameters

Thank you Java 8


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

Branch: refs/heads/develop
Commit: 132a0b6edcb967b1e3bdfa6fe0ad7bd581ebc477
Parents: b675c1a
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Jan 22 17:32:31 2017 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Jan 22 17:32:31 2017 +0100

----------------------------------------------------------------------
 .../api/activation/PassivationExceptionTest.java    |  2 +-
 .../org/apache/polygene/api/util/ClassesTest.java   |  6 +++---
 .../runtime/association/AssociationsModel.java      |  2 +-
 .../runtime/bootstrap/CompositeAssemblyImpl.java    |  2 +-
 .../polygene/runtime/composite/ConcernsModel.java   |  2 +-
 .../runtime/composite/ConstraintsModel.java         |  2 +-
 .../runtime/composite/SideEffectsModel.java         |  2 +-
 .../runtime/composite/TransientBuilderInstance.java |  4 ++--
 .../service/ImportedServiceReferenceInstance.java   |  2 +-
 .../runtime/unitofwork/EntityBuilderInstance.java   |  2 +-
 .../runtime/value/ValueBuilderInstance.java         |  2 +-
 .../runtime/value/ValueBuilderWithPrototype.java    |  4 ++--
 .../runtime/value/ValueBuilderWithState.java        |  4 ++--
 .../org/apache/polygene/api/common/PluginTest.java  |  2 +-
 .../runtime/injection/StateInjectionTest.java       |  6 +++---
 .../polygene/spi/property/DefaultValuesTest.java    |  6 +++---
 .../polygene/library/alarm/AlarmServiceTest.java    |  6 +++---
 .../library/alarm/SimpleAlarmModelTest.java         | 12 ++++++------
 .../library/alarm/StandardAlarmModelTest.java       | 16 ++++++++--------
 .../BreaksCircuitOnThrowableTest.java               |  2 +-
 .../jmx/CircuitBreakerManagementSample.java         |  2 +-
 .../apache/polygene/library/http/ServletInfo.java   |  2 +-
 .../library/rdf/model/ApplicationSerializer.java    |  2 +-
 .../restlet/responsewriter/LinksResponseWriter.java |  2 +-
 .../apache/polygene/envisage/detail/MethodPane.java |  5 +----
 .../envisage/graph/StackedGraphDisplay.java         |  2 +-
 26 files changed, 49 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java
b/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java
index 1e4ee7d..ba7bca9 100644
--- a/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/activation/PassivationExceptionTest.java
@@ -52,7 +52,7 @@ public class PassivationExceptionTest
     @Test
     public void testEmptyPassivationException()
     {
-        PassivationException empty = new PassivationException( Collections.<Exception>emptyList()
);
+        PassivationException empty = new PassivationException( Collections.emptyList() );
         assertThat( empty.getMessage(), containsString( "has 0 cause" ) );
     }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java
----------------------------------------------------------------------
diff --git a/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java b/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java
index 24acbb5..834cc97 100644
--- a/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java
+++ b/core/api/src/test/java/org/apache/polygene/api/util/ClassesTest.java
@@ -100,13 +100,13 @@ public class ClassesTest
             switch( method.getName() )
             {
             case "type":
-                assertThat( resolvedType, equalTo( (Type) String.class ) );
+                assertThat( resolvedType, equalTo( String.class ) );
                 break;
             case "type1":
-                assertThat( resolvedType, equalTo( (Type) String.class ) );
+                assertThat( resolvedType, equalTo( String.class ) );
                 break;
             case "type2":
-                assertThat( resolvedType, equalTo( (Type) Long.class ) );
+                assertThat( resolvedType, equalTo( Long.class ) );
                 break;
             }
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/association/AssociationsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/association/AssociationsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/association/AssociationsModel.java
index aad7d83..a9a53a0 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/association/AssociationsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/association/AssociationsModel.java
@@ -111,7 +111,7 @@ public final class AssociationsModel
     {
         for( AssociationModel associationModel : mapAccessorAssociationModel.values() )
         {
-            Association<Object> association = state.<Object>associationFor( associationModel.accessor()
);
+            Association<Object> association = state.associationFor( associationModel.accessor()
);
             associationModel.checkAssociationConstraints( association );
             associationModel.checkConstraints( association.get() );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
index 1e0fb26..3158cff 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/bootstrap/CompositeAssemblyImpl.java
@@ -515,7 +515,7 @@ public abstract class CompositeAssemblyImpl
 
         if( !constrained )
         {
-            return new ConstraintsModel( Collections.<ValueConstraintsModel>emptyList()
);
+            return new ConstraintsModel( Collections.emptyList() );
         }
         else
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConcernsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConcernsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConcernsModel.java
index aa8d3ce..9c16505 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConcernsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConcernsModel.java
@@ -38,7 +38,7 @@ import org.apache.polygene.runtime.injection.DependencyModel;
 public final class ConcernsModel
     implements ConcernsDescriptor, Dependencies, VisitableHierarchy<Object, Object>
 {
-    public static final ConcernsModel EMPTY_CONCERNS = new ConcernsModel( Collections.<ConcernModel>emptyList()
);
+    public static final ConcernsModel EMPTY_CONCERNS = new ConcernsModel( Collections.emptyList()
);
 
     private List<ConcernModel> concernsFor;
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstraintsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstraintsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstraintsModel.java
index 542217e..e704464 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstraintsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ConstraintsModel.java
@@ -35,7 +35,7 @@ public final class ConstraintsModel
 {
     private List<ValueConstraintsModel> parameterConstraintModels;
 
-    private static ConstraintsInstance EMPTY_CONSTRAINTS = new ConstraintsInstance( Collections.<ValueConstraintsInstance>emptyList()
);
+    private static ConstraintsInstance EMPTY_CONSTRAINTS = new ConstraintsInstance( Collections.emptyList()
);
 
     public ConstraintsModel( List<ValueConstraintsModel> parameterConstraintModels
)
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/SideEffectsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/SideEffectsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/SideEffectsModel.java
index 73c910c..05a2c30 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/SideEffectsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/SideEffectsModel.java
@@ -39,7 +39,7 @@ import org.apache.polygene.runtime.injection.DependencyModel;
 public final class SideEffectsModel
     implements SideEffectsDescriptor, Dependencies, VisitableHierarchy<Object, Object>
 {
-    public static final SideEffectsModel EMPTY_SIDEEFFECTS = new SideEffectsModel( Collections.<SideEffectModel>emptyList()
);
+    public static final SideEffectsModel EMPTY_SIDEEFFECTS = new SideEffectsModel( Collections.emptyList()
);
 
     private List<SideEffectModel> sideEffectModels = null;
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientBuilderInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientBuilderInstance.java
index a622a57..d6312d4 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientBuilderInstance.java
@@ -68,7 +68,7 @@ public final class TransientBuilderInstance<T>
             prototypeInstance = model.newInstance( uses, state );
         }
 
-        return prototypeInstance.<T>proxy();
+        return prototypeInstance.proxy();
     }
 
     @Override
@@ -97,6 +97,6 @@ public final class TransientBuilderInstance<T>
         model.checkConstraints( state );
 
         CompositeInstance compositeInstance = model.newInstance( uses, state );
-        return compositeInstance.<T>proxy();
+        return compositeInstance.proxy();
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
index 328e26b..cf13122 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServiceReferenceInstance.java
@@ -156,7 +156,7 @@ public final class ImportedServiceReferenceInstance<T>
             {
                 if( serviceInstance == null )
                 {
-                    serviceInstance = serviceModel.<T>importInstance( module );
+                    serviceInstance = serviceModel.importInstance( module );
                     instance = serviceInstance.instance();
 
                     try

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/EntityBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/EntityBuilderInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/EntityBuilderInstance.java
index 5044ff6..5dedfa2 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/EntityBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/unitofwork/EntityBuilderInstance.java
@@ -86,7 +86,7 @@ public final class EntityBuilderInstance<T>
     public T instance()
     {
         checkValid();
-        return prototypeInstance.<T>proxy();
+        return prototypeInstance.proxy();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
index 7ecb745..248b97d 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
@@ -53,7 +53,7 @@ public final class ValueBuilderInstance<T>
     @Override
     public T prototype()
     {
-        return prototypeInstance.<T>proxy();
+        return prototypeInstance.proxy();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithPrototype.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithPrototype.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithPrototype.java
index c9a1023..9a786a3 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithPrototype.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithPrototype.java
@@ -84,7 +84,7 @@ public class ValueBuilderWithPrototype<T>
     public T prototype()
     {
         verifyUnderConstruction();
-        return prototypeInstance.<T>proxy();
+        return prototypeInstance.proxy();
     }
 
     @Override
@@ -115,7 +115,7 @@ public class ValueBuilderWithPrototype<T>
 
         try
         {
-            return prototypeInstance.<T>proxy();
+            return prototypeInstance.proxy();
         }
         finally
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithState.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithState.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithState.java
index 236e3b9..e371b04 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithState.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderWithState.java
@@ -46,7 +46,7 @@ public class ValueBuilderWithState<T> implements ValueBuilder<T>
     public T prototype()
     {
         verifyUnderConstruction();
-        return prototypeInstance.<T>proxy();
+        return prototypeInstance.proxy();
     }
 
     @Override
@@ -78,7 +78,7 @@ public class ValueBuilderWithState<T> implements ValueBuilder<T>
 
         try
         {
-            return prototypeInstance.<T>proxy();
+            return prototypeInstance.proxy();
         }
         finally
         {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/test/java/org/apache/polygene/api/common/PluginTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/api/common/PluginTest.java b/core/runtime/src/test/java/org/apache/polygene/api/common/PluginTest.java
index 03b4747..dcab32f 100644
--- a/core/runtime/src/test/java/org/apache/polygene/api/common/PluginTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/api/common/PluginTest.java
@@ -269,7 +269,7 @@ public class PluginTest
                     LayerAssembly layer = module.layer();
 
                     // In a real case you would "detect" the plugins somehow. Here the plugin
assembler is hardcoded
-                    List<Assembler> pluginAssemblers = Collections.<Assembler>singletonList(
new SimonAssembler() );
+                    List<Assembler> pluginAssemblers = Collections.singletonList( new
SimonAssembler() );
 
                     for( int i = 0; i < pluginAssemblers.size(); i++ )
                     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/runtime/src/test/java/org/apache/polygene/runtime/injection/StateInjectionTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/StateInjectionTest.java
b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/StateInjectionTest.java
index aac8dd6..f6a0663 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/injection/StateInjectionTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/injection/StateInjectionTest.java
@@ -63,9 +63,9 @@ public class StateInjectionTest
         PropertyFieldInjectionComposite pfic = pficBuilder.newInstance();
         assertThat( "Test field", pfic.testField().get(), is( equalTo( "X" ) ) );
         assertThat( "Named fieldX", pfic.namedField().get(), is( equalTo( "X" ) ) );
-        assertThat( "State", (String) pfic.getState()
-            .propertyFor( PropertyFieldInjectionComposite.class.getMethod( "testField" )
)
-            .get(), is( equalTo( "X" ) ) );
+        assertThat( "State", pfic.getState()
+                                 .propertyFor( PropertyFieldInjectionComposite.class.getMethod(
"testField" ) )
+                                 .get(), is( equalTo( "X" ) ) );
     }
 
     @Mixins( PropertyFieldInjectionMixin.class )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
----------------------------------------------------------------------
diff --git a/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
b/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
index 831d0f8..5b7fc91 100644
--- a/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
+++ b/core/spi/src/test/java/org/apache/polygene/spi/property/DefaultValuesTest.java
@@ -38,19 +38,19 @@ public class DefaultValuesTest
     @Test
     public void givenDefaultValuesWhenRequestStringThenGetEmptyString()
     {
-        assertThat( "Empty string", (String) DefaultValues.getDefaultValueOf( String.class
), equalTo( "" ) );
+        assertThat( "Empty string", DefaultValues.getDefaultValueOf( String.class ), equalTo(
"" ) );
     }
 
     @Test
     public void givenDefaultValuesWhenRequestListThenGetEmptyList()
     {
-        assertThat( "Empty list", (List<Object>) DefaultValues.getDefaultValueOf( List.class
), equalTo( Collections.emptyList() ) );
+        assertThat( "Empty list", DefaultValues.getDefaultValueOf( List.class ), equalTo(
Collections.emptyList() ) );
     }
 
     @Test
     public void givenDefaultValuesWhenRequestSetThenGetEmptySet()
     {
-        assertThat( "Empty set", (Set<Object>) DefaultValues.getDefaultValueOf( Set.class
), equalTo( Collections.emptySet() ) );
+        assertThat( "Empty set", DefaultValues.getDefaultValueOf( Set.class ), equalTo( Collections.emptySet()
) );
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmServiceTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmServiceTest.java
b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmServiceTest.java
index 3b5e79f..43af0b6 100644
--- a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmServiceTest.java
+++ b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/AlarmServiceTest.java
@@ -87,7 +87,7 @@ public class AlarmServiceTest
     @Test
     public void testGetAlarmModels()
     {
-        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class
).get();
+        AlarmSystem alarmService = serviceFinder.findService( AlarmSystem.class ).get();
         List<AlarmModelDescriptor> models = alarmService.alarmModels();
         assertNotNull( models );
         assertEquals( 2, models.size() );
@@ -97,7 +97,7 @@ public class AlarmServiceTest
     public void testDefaultModel()
         throws Exception
     {
-        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class
).get();
+        AlarmSystem alarmService = serviceFinder.findService( AlarmSystem.class ).get();
         List<AlarmModelDescriptor> models = alarmService.alarmModels();
         assertNotNull( models );
         assertEquals( 2, models.size() );
@@ -110,7 +110,7 @@ public class AlarmServiceTest
     public void testListeners()
         throws Exception
     {
-        AlarmSystem alarmService = (AlarmSystem) serviceFinder.findService( AlarmSystem.class
).get();
+        AlarmSystem alarmService = serviceFinder.findService( AlarmSystem.class ).get();
         AlarmPoint alarm = alarmService.createAlarm( "TestAlarm", createCategory("AlarmServiceTest")
);
 
         CountingListener listener1 = new CountingListener();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/SimpleAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/SimpleAlarmModelTest.java
b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/SimpleAlarmModelTest.java
index dd97c15..a4c402f 100644
--- a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/SimpleAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/SimpleAlarmModelTest.java
@@ -116,7 +116,7 @@ public class SimpleAlarmModelTest
     public void testTriggers()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
         List<String> triggers = provider.alarmTriggers();
         assertEquals( 2, triggers.size() );
@@ -160,7 +160,7 @@ public class SimpleAlarmModelTest
     public void testStateChangeFromNormal()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         AlarmEvent event1 = provider.evaluate( alarm, AlarmPoint.TRIGGER_ACTIVATE );
         assertEquals( AlarmPoint.EVENT_ACTIVATION, event1.systemName().get() );
@@ -186,7 +186,7 @@ public class SimpleAlarmModelTest
     public void testStateChangeFromActivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
 
@@ -205,7 +205,7 @@ public class SimpleAlarmModelTest
     {
         try
         {
-            AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class
).get();
+            AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
             AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
             provider.evaluate( underTest, "my-trigger" );
             fail( "IllegalArgumentException not thrown." );
@@ -304,7 +304,7 @@ public class SimpleAlarmModelTest
     public void testComputeCondition()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         assertFalse( provider.computeCondition( s1 ) );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
@@ -315,7 +315,7 @@ public class SimpleAlarmModelTest
     public void testComputeTrigger()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
         String trigger1 = provider.computeTrigger( s1, true );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/StandardAlarmModelTest.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/StandardAlarmModelTest.java
b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/StandardAlarmModelTest.java
index aa247cd..deaa8fe 100644
--- a/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/StandardAlarmModelTest.java
+++ b/libraries/alarm/src/test/java/org/apache/polygene/library/alarm/StandardAlarmModelTest.java
@@ -124,7 +124,7 @@ public class StandardAlarmModelTest
     public void testTriggers()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
         List<String> triggers = provider.alarmTriggers();
         assertEquals( 3, triggers.size() );
@@ -168,7 +168,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromNormal()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         AlarmEvent event1 = provider.evaluate( alarm, AlarmPoint.TRIGGER_ACTIVATE );
         assertEquals( AlarmPoint.EVENT_ACTIVATION, event1.systemName().get() );
@@ -186,7 +186,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromActivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
 
@@ -208,7 +208,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromAcknowledged()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.acknowledge();
@@ -233,7 +233,7 @@ public class StandardAlarmModelTest
     public void testStateChangeFromDeactivated()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmPoint alarm = createAlarm( "Another 1" );
         alarm.activate();
         alarm.deactivate();
@@ -259,7 +259,7 @@ public class StandardAlarmModelTest
     {
         try
         {
-            AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class
).get();
+            AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
             AlarmPoint underTest = createAlarm( "Test AlarmPoint" );
             provider.evaluate( underTest, "my-trigger" );
             fail( "IllegalArgumentException not thrown." );
@@ -417,7 +417,7 @@ public class StandardAlarmModelTest
     public void testComputeCondition()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         assertFalse( provider.computeCondition( s1 ) );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
@@ -432,7 +432,7 @@ public class StandardAlarmModelTest
     public void testComputeTrigger()
         throws Exception
     {
-        AlarmModel provider = (AlarmModel) serviceFinder.findService( AlarmModel.class ).get();
+        AlarmModel provider = serviceFinder.findService( AlarmModel.class ).get();
         AlarmStatus s1 = createStatus( AlarmPoint.STATUS_NORMAL );
         AlarmStatus s2 = createStatus( AlarmPoint.STATUS_ACTIVATED );
         AlarmStatus s3 = createStatus( AlarmPoint.STATUS_DEACTIVATED );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
b/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
index d186597..6d944d5 100644
--- a/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
+++ b/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/BreaksCircuitOnThrowableTest.java
@@ -49,7 +49,7 @@ public class BreaksCircuitOnThrowableTest
     @Test
     public void testSuccess()
     {
-        TestService service = ( TestService ) serviceFinder.findService( TestService.class
).get();
+        TestService service = serviceFinder.findService( TestService.class ).get();
         service.successfulMethod();
         service.successfulMethod();
         service.successfulMethod();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/jmx/CircuitBreakerManagementSample.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/jmx/CircuitBreakerManagementSample.java
b/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/jmx/CircuitBreakerManagementSample.java
index 2b2c027..2f4b6ed 100644
--- a/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/jmx/CircuitBreakerManagementSample.java
+++ b/libraries/circuitbreaker/src/test/java/org/apache/polygene/library/circuitbreaker/jmx/CircuitBreakerManagementSample.java
@@ -65,7 +65,7 @@ public class CircuitBreakerManagementSample
 
         };
 
-        TestService service = assembler.module().<TestService>findService( TestService.class
).get();
+        TestService service = assembler.module().findService( TestService.class ).get();
 
         int interval = 1; // Seconds
         System.out.println( "CircuitBreaker JMX Support sample is now started." );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/http/src/main/java/org/apache/polygene/library/http/ServletInfo.java
----------------------------------------------------------------------
diff --git a/libraries/http/src/main/java/org/apache/polygene/library/http/ServletInfo.java
b/libraries/http/src/main/java/org/apache/polygene/library/http/ServletInfo.java
index 4631430..5ad2136 100644
--- a/libraries/http/src/main/java/org/apache/polygene/library/http/ServletInfo.java
+++ b/libraries/http/src/main/java/org/apache/polygene/library/http/ServletInfo.java
@@ -37,7 +37,7 @@ public class ServletInfo
 
     public ServletInfo( String mountPath )
     {
-        this( mountPath, Collections.<String, String>emptyMap() );
+        this( mountPath, Collections.emptyMap() );
     }
 
     public ServletInfo( String mountPath, Map<String, String> initParams )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/ApplicationSerializer.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/ApplicationSerializer.java
b/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/ApplicationSerializer.java
index 6fa506b..7c65ae1 100644
--- a/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/ApplicationSerializer.java
+++ b/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/ApplicationSerializer.java
@@ -34,7 +34,7 @@ public class ApplicationSerializer
         Graph graph = new GraphImpl();
         SerializerContext context = new SerializerContext( graph );
         ApplicationVisitor applicationVisitor = new ApplicationVisitor( context );
-        ( (Application) app ).descriptor().accept( applicationVisitor );
+        app.descriptor().accept( applicationVisitor );
         return graph;
     }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/LinksResponseWriter.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/LinksResponseWriter.java
b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/LinksResponseWriter.java
index 26c810f..dea6f15 100644
--- a/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/LinksResponseWriter.java
+++ b/libraries/rest-server/src/main/java/org/apache/polygene/library/rest/server/restlet/responsewriter/LinksResponseWriter.java
@@ -61,7 +61,7 @@ public class LinksResponseWriter
             MediaType type = getVariant( response.getRequest(), ENGLISH, supportedLinkMediaTypes
).getMediaType();
             if( MediaType.APPLICATION_JSON.equals( type ) )
             {
-                response.setEntity( new StringRepresentation( ( (Link) result ).toString(),
MediaType.APPLICATION_JSON ) );
+                response.setEntity( new StringRepresentation( result.toString(), MediaType.APPLICATION_JSON
) );
                 return true;
             }
             else

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/tools/envisage/src/main/java/org/apache/polygene/envisage/detail/MethodPane.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/main/java/org/apache/polygene/envisage/detail/MethodPane.java
b/tools/envisage/src/main/java/org/apache/polygene/envisage/detail/MethodPane.java
index 38fbfb1..afc17b3 100644
--- a/tools/envisage/src/main/java/org/apache/polygene/envisage/detail/MethodPane.java
+++ b/tools/envisage/src/main/java/org/apache/polygene/envisage/detail/MethodPane.java
@@ -205,10 +205,7 @@ import org.apache.polygene.tools.model.util.DescriptorUtilities;
             clear();
 
             // mixin type
-            rows.add( new TableRow( 2, new Object[]
-            {
-                "return", Classes.simpleGenericNameOf( method.getGenericReturnType() )
-            } ) );
+            rows.add( new TableRow( 2, "return", Classes.simpleGenericNameOf( method.getGenericReturnType()
) ) );
 
             // method
             StringBuilder parameters = new StringBuilder();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/132a0b6e/tools/envisage/src/main/java/org/apache/polygene/envisage/graph/StackedGraphDisplay.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/main/java/org/apache/polygene/envisage/graph/StackedGraphDisplay.java
b/tools/envisage/src/main/java/org/apache/polygene/envisage/graph/StackedGraphDisplay.java
index d1cc7a4..b7ce32f 100644
--- a/tools/envisage/src/main/java/org/apache/polygene/envisage/graph/StackedGraphDisplay.java
+++ b/tools/envisage/src/main/java/org/apache/polygene/envisage/graph/StackedGraphDisplay.java
@@ -504,7 +504,7 @@ import prefuse.visual.sort.TreeDepthItemSorter;
             }
             else
             {
-                Dimension size = ( (Component) container ).getSize();
+                Dimension size = container.getSize();
                 displayBounds.setRect( 0, 0, size.getWidth(), size.getHeight() );
             }
 


Mime
View raw message