]> source.dussan.org Git - vaadin-framework.git/commitdiff
Explicit type args can be inferred
authorPer-Åke Minborg <minborg@speedment.com>
Sat, 29 Oct 2016 04:57:58 +0000 (21:57 -0700)
committerHenri Sara <hesara@vaadin.com>
Sat, 5 Nov 2016 03:16:14 +0000 (03:16 +0000)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7231

server/src/test/java/com/vaadin/data/BinderConverterValidatorTest.java
server/src/test/java/com/vaadin/data/BinderMultiSelectTest.java
server/src/test/java/com/vaadin/data/ResultTest.java
server/src/test/java/com/vaadin/tests/event/EventRouterTest.java

index 0711ae24bf5a2bc14576f85de159546935805b68..ba3804ca8b955967d755246a2bb3c093836d3c15 100644 (file)
@@ -356,7 +356,7 @@ public class BinderConverterValidatorTest
         bindName();
 
         AtomicBoolean beanLevelValidationRun = new AtomicBoolean();
-        binder.withValidator(Validator.<Person> from(
+        binder.withValidator(Validator.from(
                 bean -> beanLevelValidationRun.getAndSet(true), ""));
 
         ageField.setValue("not a number");
@@ -373,7 +373,7 @@ public class BinderConverterValidatorTest
         bindName();
 
         AtomicBoolean beanLevelValidationRun = new AtomicBoolean();
-        binder.withValidator(Validator.<Person> from(
+        binder.withValidator(Validator.from(
                 bean -> beanLevelValidationRun.getAndSet(true), ""));
 
         ageField.setValue(String.valueOf(12));
@@ -496,7 +496,7 @@ public class BinderConverterValidatorTest
                 Person::setFirstName);
 
         String msg = "foo";
-        binder.withValidator(Validator.<Person> from(
+        binder.withValidator(Validator.from(
                 prsn -> prsn.getAddress() != null || prsn.getEmail() != null,
                 msg));
 
index c4725471da014312ad17acc6a14c8d2b7d1de348..3b35f86144a6fe73c392d8665afb86aa4c65d388 100644 (file)
@@ -67,8 +67,8 @@ public class BinderMultiSelectTest
 
         converterBinder.forField(select)
                 .withConverter(new TestEnumSetToStringConverter())
-                .bind(AtomicReference<String>::get,
-                        AtomicReference<String>::set);
+                .bind(AtomicReference::get,
+                        AtomicReference::set);
     }
 
     @Test
index 53412907cc37490bf413991312ac817ef2db3156..756746a4ff5b57d66726c0a034225aaad9a4d636 100644 (file)
@@ -57,7 +57,7 @@ public class ResultTest {
     @Test
     public void of_exception() {
         String message = "foo";
-        Result<String> result = Result.<String> of(() -> {
+        Result<String> result = Result.of(() -> {
             throw new RuntimeException();
         }, exception -> message);
         Assert.assertTrue(result instanceof SimpleResult);
index f9b93ccd048d62994bd18723248ff89d0f5a81be..7286b7ea2d8cf3c265cbd622ac3ee00c48323349 100644 (file)
@@ -55,7 +55,7 @@ public class EventRouterTest {
 
     @Test
     public void fireEvent_noException_eventReceived() {
-        listener.componentEvent(EasyMock.<Component.Event> anyObject());
+        listener.componentEvent(EasyMock.anyObject());
 
         EasyMock.replay(component, listener, errorHandler);
         router.fireEvent(new Component.Event(component), errorHandler);
@@ -64,7 +64,7 @@ public class EventRouterTest {
 
     @Test
     public void fireEvent_exceptionFromListenerAndNoHandler_exceptionPropagated() {
-        listener.componentEvent(EasyMock.<Component.Event> anyObject());
+        listener.componentEvent(EasyMock.anyObject());
         EasyMock.expectLastCall()
                 .andThrow(new RuntimeException("listener failed"));
 
@@ -81,10 +81,10 @@ public class EventRouterTest {
 
     @Test
     public void fireEvent_exceptionFromListener_errorHandlerCalled() {
-        listener.componentEvent(EasyMock.<Component.Event> anyObject());
+        listener.componentEvent(EasyMock.anyObject());
         EasyMock.expectLastCall()
                 .andThrow(new RuntimeException("listener failed"));
-        errorHandler.error(EasyMock.<ErrorEvent> anyObject());
+        errorHandler.error(EasyMock.anyObject());
 
         EasyMock.replay(component, listener, errorHandler);
         router.fireEvent(new Component.Event(component), errorHandler);
@@ -97,12 +97,12 @@ public class EventRouterTest {
         router.addListener(Component.Event.class, listener2,
                 COMPONENT_EVENT_METHOD);
 
-        listener.componentEvent(EasyMock.<Component.Event> anyObject());
+        listener.componentEvent(EasyMock.anyObject());
         EasyMock.expectLastCall()
                 .andThrow(new RuntimeException("listener failed"));
-        errorHandler.error(EasyMock.<ErrorEvent> anyObject());
+        errorHandler.error(EasyMock.anyObject());
         // second listener should be called despite an error in the first
-        listener2.componentEvent(EasyMock.<Component.Event> anyObject());
+        listener2.componentEvent(EasyMock.anyObject());
 
         EasyMock.replay(component, listener, listener2, errorHandler);
         router.fireEvent(new Component.Event(component), errorHandler);