diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-22 12:23:12 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-22 13:23:12 +0300 |
commit | 60ff3d6c3428b2e353ecc0df90296cecc3e840e0 (patch) | |
tree | a88cd5b672417440f57ec786b3c2c3c2bdac6adb | |
parent | 23718371f820fb3babca2c57072a62137aa2c01d (diff) | |
download | vaadin-framework-60ff3d6c3428b2e353ecc0df90296cecc3e840e0.tar.gz vaadin-framework-60ff3d6c3428b2e353ecc0df90296cecc3e840e0.zip |
Format curly brackets correctly for checkstyle (#10066)
21 files changed, 108 insertions, 237 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java index 8fce2651ab..f503c4689a 100644 --- a/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java +++ b/client/src/main/java/com/vaadin/client/ui/VAbstractCalendarPanel.java @@ -1260,24 +1260,16 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> // Ctrl and Shift selection not supported if (ctrl || shift) { return false; - } - - else if (keycode == getPreviousKey()) { + } else if (keycode == getPreviousKey()) { focusNextYear(10); // Add 10 years return true; - } - - else if (keycode == getForwardKey()) { + } else if (keycode == getForwardKey()) { focusNextYear(1); // Add 1 year return true; - } - - else if (keycode == getNextKey()) { + } else if (keycode == getNextKey()) { focusPreviousYear(10); // Subtract 10 years return true; - } - - else if (keycode == getBackwardKey()) { + } else if (keycode == getBackwardKey()) { focusPreviousYear(1); // Subtract 1 year return true; @@ -1479,21 +1471,13 @@ public abstract class VAbstractCalendarPanel<R extends Enum<R>> boolean shift) { if (!isEnabled() || isReadonly()) { return false; - } - - else if (isYear(getResolution())) { + } else if (isYear(getResolution())) { return handleNavigationYearMode(keycode, ctrl, shift); - } - - else if (isMonth(getResolution())) { + } else if (isMonth(getResolution())) { return handleNavigationMonthMode(keycode, ctrl, shift); - } - - else if (isDay(getResolution())) { + } else if (isDay(getResolution())) { return handleNavigationDayMode(keycode, ctrl, shift); - } - - else { + } else { return handleNavigationDayMode(keycode, ctrl, shift); } diff --git a/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index 7ec6e5fd10..5ab5f5fcda 100644 --- a/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -541,14 +541,10 @@ public abstract class AbstractOrderedLayoutConnector if (isVertical) { // Doesn't need height fix for vertical layouts return false; - } - - else if (!isUndefinedHeight()) { + } else if (!isUndefinedHeight()) { // Fix not needed unless the height is undefined return false; - } - - else if (!hasChildrenWithRelativeHeight + } else if (!hasChildrenWithRelativeHeight && !hasChildrenWithMiddleAlignment) { // Already works if there are no relative heights or middle aligned // children diff --git a/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java b/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java index 826105d623..6ff77a2c88 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/AutoScroller.java @@ -294,14 +294,10 @@ public class AutoScroller { if (pointerPageCordinate < startBound) { final double distance = pointerPageCordinate - startBound; ratio = Math.max(-1, distance / gradientArea); - } - - else if (pointerPageCordinate > endBound) { + } else if (pointerPageCordinate > endBound) { final double distance = pointerPageCordinate - endBound; ratio = Math.min(1, distance / gradientArea); - } - - else { + } else { ratio = 0; } @@ -358,13 +354,11 @@ public class AutoScroller { if (startBound == -1) { startBound = Math.min(finalStartBound, pageCordinate); endBound = Math.max(finalEndBound, pageCordinate); - } - - /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. - */ - else { + } else { + /* + * Subsequent runs make sure that the scroll area grows (but doesn't + * shrink) with the finger, but no further than the final bound. + */ int oldTopBound = startBound; if (startBound < finalStartBound) { startBound = Math.max(startBound, diff --git a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java index b7059c035f..75c80a4082 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/DefaultEditorEventHandler.java @@ -145,9 +145,7 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, cell.getRowIndex(), cell.getColumnIndexDOM()); return true; - } - - else if (e.getTypeInt() == Event.ONKEYDOWN) { + } else if (e.getTypeInt() == Event.ONKEYDOWN) { int rowDelta = 0; int colDelta = 0; diff --git a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java index 8ccd4373c2..ba27d96afa 100644 --- a/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java +++ b/client/src/main/java/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java @@ -380,14 +380,10 @@ public class MultiSelectionRenderer<T> if (pointerPageY < topBound) { final double distance = pointerPageY - topBound; ratio = Math.max(-1, distance / gradientArea); - } - - else if (pointerPageY > bottomBound) { + } else if (pointerPageY > bottomBound) { final double distance = pointerPageY - bottomBound; ratio = Math.min(1, distance / gradientArea); - } - - else { + } else { ratio = 0; } @@ -447,13 +443,11 @@ public class MultiSelectionRenderer<T> if (topBound == -1) { topBound = Math.min(finalTopBound, pageY); bottomBound = Math.max(finalBottomBound, pageY); - } - - /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. - */ - else { + } else { + /* + * Subsequent runs make sure that the scroll area grows (but doesn't + * shrink) with the finger, but no further than the final bound. + */ int oldTopBound = topBound; if (topBound < finalTopBound) { topBound = Math.max(topBound, diff --git a/client/src/main/java/com/vaadin/client/widgets/Escalator.java b/client/src/main/java/com/vaadin/client/widgets/Escalator.java index bfff4ad6ae..ee432e0892 100644 --- a/client/src/main/java/com/vaadin/client/widgets/Escalator.java +++ b/client/src/main/java/com/vaadin/client/widgets/Escalator.java @@ -2581,9 +2581,7 @@ public class Escalator extends Widget setTopRowLogicalIndex(logicalRowIndex); rowsWereMoved = true; - } - - else if (viewportOffset + nextRowBottomOffset <= 0) { + } else if (viewportOffset + nextRowBottomOffset <= 0) { /* * the viewport has been scrolled more than the topmost visual * row. @@ -2756,14 +2754,10 @@ public class Escalator extends Widget final double yDelta = numberOfRows * getDefaultRowHeight(); moveViewportAndContent(yDelta); updateTopRowLogicalIndex(numberOfRows); - } - - else if (addedRowsBelowCurrentViewport) { + } else if (addedRowsBelowCurrentViewport) { // NOOP, we already recalculated scrollbars. - } - - else { // some rows were added inside the current viewport - + } else { + // some rows were added inside the current viewport final int unupdatedLogicalStart = index + addedRows.size(); final int visualOffset = getLogicalRowIndex( visualRowOrder.getFirst()); @@ -2774,7 +2768,7 @@ public class Escalator extends Widget * * If more rows were added than the new escalator rows can * account for, we need to start to spin the escalator to update - * the remaining rows aswell. + * the remaining rows as well. */ final int rowsStillNeeded = numberOfRows - addedRows.size(); @@ -3181,9 +3175,7 @@ public class Escalator extends Widget fireRowVisibilityChangeEvent(); return; - } - - else { + } else { // No escalator rows need to be removed. /* @@ -3215,9 +3207,7 @@ public class Escalator extends Widget */ paintRemoveRowsAtMiddle(removedLogicalInside, removedVisualInside, 0); - } - - else if (removedVisualInside.contains(0) + } else if (removedVisualInside.contains(0) && numberOfRows >= visualRowOrder.size()) { /* * We're removing so many rows that the viewport is @@ -3257,9 +3247,7 @@ public class Escalator extends Widget * TODO [[optimize]]: This might lead to a double body * refresh. Needs investigation. */ - } - - else if (contentBottom + } else if (contentBottom + (numberOfRows * getDefaultRowHeight()) - viewportBottom < getDefaultRowHeight()) { /* @@ -3277,9 +3265,7 @@ public class Escalator extends Widget removedVisualInside); updateTopRowLogicalIndex( -removedLogicalInside.length()); - } - - else { + } else { /* * We're in a combination, where we need to both scroll * up AND show new rows at the bottom. @@ -3715,9 +3701,7 @@ public class Escalator extends Widget setScrollTop(oldScrollTop); scroller.onScroll(); } - } - - else if (neededEscalatorRowsDiff < 0) { + } else if (neededEscalatorRowsDiff < 0) { // needs less final ListIterator<TableRowElement> iter = visualRowOrder @@ -5174,9 +5158,7 @@ public class Escalator extends Widget continue; } else if (topIsBelowRange) { return heights; - } - - else if (topIsAboveRange && bottomIsInRange) { + } else if (topIsAboveRange && bottomIsInRange) { switch (topInclusion) { case PARTIAL: heights += bottom - rangeTop; @@ -5187,9 +5169,7 @@ public class Escalator extends Widget default: break; } - } - - else if (topIsAboveRange && bottomIsBelowRange) { + } else if (topIsAboveRange && bottomIsBelowRange) { /* * Here we arbitrarily decide that the top inclusion will @@ -5210,9 +5190,7 @@ public class Escalator extends Widget } else if (topIsInRange && bottomIsInRange) { heights += height; - } - - else if (topIsInRange && bottomIsBelowRange) { + } else if (topIsInRange && bottomIsBelowRange) { switch (bottomInclusion) { case PARTIAL: heights += rangeBottom - top; @@ -5225,9 +5203,7 @@ public class Escalator extends Widget } return heights; - } - - else { + } else { assert false : "Unnaccounted-for situation"; } } diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 9b04100d48..8d65052aa2 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -4356,10 +4356,9 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, && rightBoundaryForDrag < dropMarkerLeft && dropMarkerLeft <= escalator.getInnerWidth()) { dropMarkerLeft = rightBoundaryForDrag - dropMarkerWidthOffset; - } - - // Check if the drop marker shouldn't be shown at all - else if (dropMarkerLeft < frozenColumnsWidth + } else if ( + // Check if the drop marker shouldn't be shown at all + dropMarkerLeft < frozenColumnsWidth || dropMarkerLeft > Math.min(rightBoundaryForDrag, escalator.getInnerWidth()) || dropMarkerLeft < 0) { @@ -4641,9 +4640,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, rightBound = cellColumnRightIndex; } cellColumnIndex = cellColumnRightIndex - 1; - } - - else { + } else { // can't drop inside a spanned cell, or this is the // dragged cell while (colspan > 1) { diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java index 12d76bec9f..a550272f61 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTree.java @@ -1729,13 +1729,11 @@ public class VTree extends FocusElementPanel if (!focusedNode.isLeaf() && focusedNode.getState() && focusedNode.getChildren().size() > 0) { node = focusedNode.getChildren().get(0); - } - - // Else move down to the next sibling - else { + } else { + // Move down to the next sibling node = getNextSibling(focusedNode); if (node == null) { - // Else jump to the parent and try to select the next + // Jump to the parent and try to select the next // sibling there TreeNode current = focusedNode; while (node == null && current.getParentNode() != null) { diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java index 500d616bc4..4b7ccef837 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/AutoScroller.java @@ -293,14 +293,10 @@ public class AutoScroller { if (pointerPageCordinate < startBound) { final double distance = pointerPageCordinate - startBound; ratio = Math.max(-1, distance / gradientArea); - } - - else if (pointerPageCordinate > endBound) { + } else if (pointerPageCordinate > endBound) { final double distance = pointerPageCordinate - endBound; ratio = Math.min(1, distance / gradientArea); - } - - else { + } else { ratio = 0; } @@ -357,13 +353,11 @@ public class AutoScroller { if (startBound == -1) { startBound = Math.min(finalStartBound, pageCordinate); endBound = Math.max(finalEndBound, pageCordinate); - } - - /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. - */ - else { + } else { + /* + * Subsequent runs make sure that the scroll area grows (but doesn't + * shrink) with the finger, but no further than the final bound. + */ int oldTopBound = startBound; if (startBound < finalStartBound) { startBound = Math.max(startBound, diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java index 9f4eace77c..b163680230 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/DefaultEditorEventHandler.java @@ -145,9 +145,7 @@ public class DefaultEditorEventHandler<T> implements Editor.EventHandler<T> { editRow(event, cell.getRowIndex(), cell.getColumnIndexDOM()); return true; - } - - else if (e.getTypeInt() == Event.ONKEYDOWN) { + } else if (e.getTypeInt() == Event.ONKEYDOWN) { int rowDelta = 0; int colDelta = 0; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java index 86d5e0a323..94bef07c8b 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/grid/selection/MultiSelectionRenderer.java @@ -369,14 +369,10 @@ public class MultiSelectionRenderer<T> if (pointerPageY < topBound) { final double distance = pointerPageY - topBound; ratio = Math.max(-1, distance / gradientArea); - } - - else if (pointerPageY > bottomBound) { + } else if (pointerPageY > bottomBound) { final double distance = pointerPageY - bottomBound; ratio = Math.min(1, distance / gradientArea); - } - - else { + } else { ratio = 0; } @@ -436,13 +432,11 @@ public class MultiSelectionRenderer<T> if (topBound == -1) { topBound = Math.min(finalTopBound, pageY); bottomBound = Math.max(finalBottomBound, pageY); - } - - /* - * Subsequent runs make sure that the scroll area grows (but doesn't - * shrink) with the finger, but no further than the final bound. - */ - else { + } else { + /* + * Subsequent runs make sure that the scroll area grows (but doesn't + * shrink) with the finger, but no further than the final bound. + */ int oldTopBound = topBound; if (topBound < finalTopBound) { topBound = Math.max(topBound, diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java index 94882e0507..e11e0d11aa 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java @@ -2581,9 +2581,7 @@ public class Escalator extends Widget setTopRowLogicalIndex(logicalRowIndex); rowsWereMoved = true; - } - - else if (viewportOffset + nextRowBottomOffset <= 0) { + } else if (viewportOffset + nextRowBottomOffset <= 0) { /* * the viewport has been scrolled more than the topmost visual * row. @@ -2738,13 +2736,10 @@ public class Escalator extends Widget final double yDelta = numberOfRows * getDefaultRowHeight(); moveViewportAndContent(yDelta); updateTopRowLogicalIndex(numberOfRows); - } - - else if (addedRowsBelowCurrentViewport) { + } else if (addedRowsBelowCurrentViewport) { // NOOP, we already recalculated scrollbars. - } - - else { // some rows were added inside the current viewport + } else { + // some rows were added inside the current viewport final int unupdatedLogicalStart = index + addedRows.size(); final int visualOffset = getLogicalRowIndex( @@ -3181,9 +3176,7 @@ public class Escalator extends Widget final TableRowElement tr = visualRowOrder.get(i); refreshRow(tr, i); } - } - - else { + } else { // No escalator rows need to be removed. /* @@ -3215,9 +3208,7 @@ public class Escalator extends Widget */ paintRemoveRowsAtMiddle(removedLogicalInside, removedVisualInside, 0); - } - - else if (removedVisualInside.contains(0) + } else if (removedVisualInside.contains(0) && numberOfRows >= visualRowOrder.size()) { /* * We're removing so many rows that the viewport is @@ -3257,9 +3248,7 @@ public class Escalator extends Widget * TODO [[optimize]]: This might lead to a double body * refresh. Needs investigation. */ - } - - else if (contentBottom + } else if (contentBottom + (numberOfRows * getDefaultRowHeight()) - viewportBottom < getDefaultRowHeight()) { /* @@ -3277,9 +3266,7 @@ public class Escalator extends Widget removedVisualInside); updateTopRowLogicalIndex( -removedLogicalInside.length()); - } - - else { + } else { /* * We're in a combination, where we need to both scroll * up AND show new rows at the bottom. @@ -3715,9 +3702,7 @@ public class Escalator extends Widget setScrollTop(oldScrollTop); scroller.onScroll(); } - } - - else if (neededEscalatorRowsDiff < 0) { + } else if (neededEscalatorRowsDiff < 0) { // needs less final ListIterator<TableRowElement> iter = visualRowOrder @@ -5141,9 +5126,7 @@ public class Escalator extends Widget continue; } else if (topIsBelowRange) { return heights; - } - - else if (topIsAboveRange && bottomIsInRange) { + } else if (topIsAboveRange && bottomIsInRange) { switch (topInclusion) { case PARTIAL: heights += bottom - rangeTop; @@ -5154,9 +5137,7 @@ public class Escalator extends Widget default: break; } - } - - else if (topIsAboveRange && bottomIsBelowRange) { + } else if (topIsAboveRange && bottomIsBelowRange) { /* * Here we arbitrarily decide that the top inclusion will @@ -5177,9 +5158,7 @@ public class Escalator extends Widget } else if (topIsInRange && bottomIsInRange) { heights += height; - } - - else if (topIsInRange && bottomIsBelowRange) { + } else if (topIsInRange && bottomIsBelowRange) { switch (bottomInclusion) { case PARTIAL: heights += rangeBottom - top; @@ -5192,9 +5171,7 @@ public class Escalator extends Widget } return heights; - } - - else { + } else { assert false : "Unnaccounted-for situation"; } } diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java index 1fa352faf2..fbd1b2a0cc 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java @@ -4330,10 +4330,9 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, && rightBoundaryForDrag < dropMarkerLeft && dropMarkerLeft <= escalator.getInnerWidth()) { dropMarkerLeft = rightBoundaryForDrag - dropMarkerWidthOffset; - } - - // Check if the drop marker shouldn't be shown at all - else if (dropMarkerLeft < frozenColumnsWidth + } else if ( + // Check if the drop marker shouldn't be shown at all + dropMarkerLeft < frozenColumnsWidth || dropMarkerLeft > Math.min(rightBoundaryForDrag, escalator.getInnerWidth()) || dropMarkerLeft < 0) { @@ -4609,9 +4608,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, rightBound = cellColumnRightIndex; } cellColumnIndex = cellColumnRightIndex - 1; - } - - else { // can't drop inside a spanned cell, or this is the + } else { // can't drop inside a spanned cell, or this is the // dragged cell while (colspan > 1) { cellColumnIndex++; @@ -9083,9 +9080,7 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, if (visible && !isVisible) { escalator.getBody().setSpacer(rowIndex, DETAILS_ROW_INITIAL_HEIGHT); visibleDetails.add(rowIndexInteger); - } - - else if (!visible && isVisible) { + } else if (!visible && isVisible) { escalator.getBody().setSpacer(rowIndex, -1); visibleDetails.remove(rowIndexInteger); } diff --git a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java index a7b5f737ac..5ad3cee4c7 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/data/util/ContainerHierarchicalWrapper.java @@ -150,10 +150,8 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, parent = new Hashtable<Object, Object>(); children = new Hashtable<Object, LinkedList<Object>>(); roots = new LinkedHashSet<Object>(container.getItemIds()); - } - - // Check that the hierarchy is up-to-date - else { + } else { + // Check that the hierarchy is up-to-date // ensure order of root and child lists is same as in wrapped // container diff --git a/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java b/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java index 85d3014b0b..5d1b8ffee3 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/server/communication/data/RpcDataProviderExtension.java @@ -236,16 +236,12 @@ public class RpcDataProviderExtension extends AbstractExtension { int firstIndex = addEvent.getFirstIndex(); int count = addEvent.getAddedItemsCount(); insertRowData(firstIndex, count); - } - - else if (event instanceof ItemRemoveEvent) { + } else if (event instanceof ItemRemoveEvent) { ItemRemoveEvent removeEvent = (ItemRemoveEvent) event; int firstIndex = removeEvent.getFirstIndex(); int count = removeEvent.getRemovedItemsCount(); removeRowData(firstIndex, count); - } - - else { + } else { // Remove obsolete value change listeners. Set<Object> keySet = new HashSet<Object>( activeItemHandler.activeItemMap.keySet()); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java index c4e7c42107..caef040d25 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Grid.java @@ -3711,9 +3711,7 @@ public class Grid extends AbstractComponent + getRenderer().getPresentationType() + " (in " + toString() + ")"); } - } - - else { + } else { /* * Since the converter is null (i.e. will be removed), we need * to know that the renderer and model are compatible. If not, diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java index ee38b2bcb3..dac43ba923 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Table.java @@ -2928,13 +2928,12 @@ public class Table extends AbstractSelect implements Action.Container, // TODO could be optimized. variables = new HashMap<String, Object>(variables); variables.remove("selected"); - } - - /* - * The AbstractSelect cannot handle the multiselection properly, instead - * we handle it ourself - */ - else if (isSelectable() && isMultiSelect() + } else if ( + /* + * The AbstractSelect cannot handle the multiselection properly, instead + * we handle it ourself + */ + isSelectable() && isMultiSelect() && variables.containsKey("selected") && multiSelectMode == MultiSelectMode.DEFAULT) { handleSelectedItems(variables); @@ -3128,10 +3127,9 @@ public class Table extends AbstractSelect implements Action.Container, fireEvent(new ItemClickEvent(this, item, itemId, propertyId, evt)); } - } - - // Header click event - else if (variables.containsKey("headerClickEvent")) { + } else if ( + // Header click event + variables.containsKey("headerClickEvent")) { MouseEventDetails details = MouseEventDetails .deSerialize((String) variables.get("headerClickEvent")); @@ -3142,10 +3140,9 @@ public class Table extends AbstractSelect implements Action.Container, propertyId = columnIdMap.get(cid.toString()); } fireEvent(new HeaderClickEvent(this, propertyId, details)); - } - - // Footer click event - else if (variables.containsKey("footerClickEvent")) { + } else if ( + // Footer click event + variables.containsKey("footerClickEvent")) { MouseEventDetails details = MouseEventDetails .deSerialize((String) variables.get("footerClickEvent")); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java index ccf4d6e460..0dc1772f65 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/Tree.java @@ -723,10 +723,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, if (!iteratorStack.isEmpty()) { target.endTag("node"); } - } - - // Adds the item on current level - else { + } else { + // Adds the item on current level final Object itemId = i.next(); // Starts the item / node @@ -1309,10 +1307,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, // Removes used iterator from the stack iteratorStack.pop(); - } - - // Adds the item on current level - else { + } else { + // Adds the item on current level final Object itemId = i.next(); visible.add(itemId); diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java index befadf5a77..306c4e78aa 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerPopup.java @@ -479,20 +479,15 @@ public class ColorPickerPopup extends Window } resize.setData(new Boolean(!state)); - } - - // Ok button was clicked - else if (event.getButton() == ok) { + } else if (event.getButton() == ok) { + // Ok button was clicked history.setColor(getColor()); fireColorChanged(); close(); - } - - // Cancel button was clicked - else if (event.getButton() == cancel) { + } else if (event.getButton() == cancel) { + // Cancel button was clicked close(); } - } /** diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java index 57d5a6735f..8e957a59ba 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/components/colorpicker/ColorPickerSelect.java @@ -128,10 +128,8 @@ public class ColorPickerSelect extends CustomComponent colors[row][col] = new Color( Color.HSVtoRGB(hue, saturation, value)); - } - - // The last row should have the black&white gradient - else { + } else { + // The last row should have the black&white gradient float hue = 0f; float saturation = 0f; float value = 1f - ((float) col / (float) columns); diff --git a/server/src/main/java/com/vaadin/server/UIProvider.java b/server/src/main/java/com/vaadin/server/UIProvider.java index 11d5d43109..ea587cadc1 100644 --- a/server/src/main/java/com/vaadin/server/UIProvider.java +++ b/server/src/main/java/com/vaadin/server/UIProvider.java @@ -186,10 +186,8 @@ public abstract class UIProvider implements Serializable { // Third case: we have a generated class called APP_WIDGETSET_NAME if (info != null) { return info; - } - - // Fourth case: we have an AppWidgetset.gwt.xml file - else { + } else { + // Fourth case: we have an AppWidgetset.gwt.xml file InputStream resource = event.getUIClass() .getResourceAsStream("/" + APP_WIDGETSET_NAME + ".gwt.xml"); if (resource != null) { |