]> source.dussan.org Git - vaadin-framework.git/commitdiff
Remove Boolean constructor invocation and add foreach
authorPer-Åke Minborg <minborg@speedment.com>
Fri, 28 Oct 2016 15:32:15 +0000 (08:32 -0700)
committerPekka Hyvönen <pekka@vaadin.com>
Wed, 2 Nov 2016 15:07:05 +0000 (15:07 +0000)
Change-Id: I80b73b653e97904605dc62484a7448f3bfbf7219

server/src/main/java/com/vaadin/server/CompositeErrorMessage.java
server/src/main/java/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java
server/src/test/java/com/vaadin/util/ReflectToolsGetFieldValueByTypeTest.java
server/src/test/java/com/vaadin/util/ReflectToolsGetPrimitiveFieldValueTest.java

index 429694a04f63c409590f9bf3ef72ac0b857bfe12..6e37a94c5e4926b6780faa73df39b38f36bf3eaa 100644 (file)
@@ -39,8 +39,8 @@ public class CompositeErrorMessage extends AbstractErrorMessage {
         super(null);
         setErrorLevel(ErrorLevel.INFORMATION);
 
-        for (int i = 0; i < errorMessages.length; i++) {
-            addErrorMessage(errorMessages[i]);
+        for (ErrorMessage errorMessage : errorMessages) {
+            addErrorMessage(errorMessage);
         }
 
         if (getCauses().size() == 0) {
index c86b139520dddcb867d084efd5723d88794816bf..521a131c4cfb11a8185e6d18cd39059d25d3ac89 100644 (file)
@@ -218,7 +218,7 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
 
         // Add the resize button for the history
         resize.addClickListener(this::resizeButtonClick);
-        resize.setData(new Boolean(false));
+        resize.setData(false);
         resize.setWidth("100%");
         resize.setHeight("10px");
         resize.setPrimaryStyleName("resize-button");
@@ -437,7 +437,7 @@ public class ColorPickerPopup extends Window implements HasValue<Color> {
             history.setHeight("85px");
         }
 
-        resize.setData(new Boolean(!minimize));
+        resize.setData(!minimize);
     }
 
     private void okButtonClick(ClickEvent event) {
index 7d15bcfc68a4c40134e7ee513a5c4707b690f736..8972bbb66ff9d05c253cb900dd7bd85312374985 100644 (file)
@@ -24,7 +24,7 @@ public class ReflectToolsGetFieldValueByTypeTest {
         MySubClass myInstance = new MySubClass();
 
         java.lang.reflect.Field memberField;
-        Object fieldValue = new Boolean(false);
+        Object fieldValue = false;
         try {
             memberField = myInstance.getClass().getField("field");
             // Should get a String value. Without the third parameter (calling
index d6362395da35b293a34e19b3828bc1fa6e276a84..167ab774f2dbe438969b0f8e40dc3184b0d6b204 100644 (file)
@@ -14,7 +14,7 @@ public class ReflectToolsGetPrimitiveFieldValueTest {
         MyClass myInstance = new MyClass();
 
         java.lang.reflect.Field memberField;
-        Object fieldValue = new Boolean(false);
+        Object fieldValue = false;
         try {
             memberField = myInstance.getClass().getField("field");
             fieldValue = ReflectTools.getJavaFieldValue(myInstance,