diff options
author | Henri Sara <henri.sara@itmill.com> | 2010-06-01 12:20:44 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2010-06-01 12:20:44 +0000 |
commit | 466d005f0dfb62ce7cdc332832b18452980037e5 (patch) | |
tree | c20a578fe4ee5fb8a1a55f2cebb774505f58fa19 /src/com/vaadin | |
parent | 7671272aea711c3435d492ff0f14ece4b81ded5b (diff) | |
parent | 367fc17f832c1e94937a128a4b2322a5afd38ca1 (diff) | |
download | vaadin-framework-466d005f0dfb62ce7cdc332832b18452980037e5.tar.gz vaadin-framework-466d005f0dfb62ce7cdc332832b18452980037e5.zip |
Merged changes to 6.4 (FindBugs results, #5111, label and javadoc corrections)
svn changeset:13471/svn branch:6.4
Diffstat (limited to 'src/com/vaadin')
-rw-r--r-- | src/com/vaadin/event/dd/DropTarget.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/DateTimeService.java | 24 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/RenderInformation.java | 12 | ||||
-rwxr-xr-x | src/com/vaadin/terminal/gwt/client/VDebugConsole.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VMarginInfo.java | 5 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VPanel.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/DragAndDropService.java | 5 | ||||
-rw-r--r-- | src/com/vaadin/ui/AbstractField.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/Form.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/GridLayout.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/MenuBar.java | 3 | ||||
-rw-r--r-- | src/com/vaadin/ui/Panel.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/Table.java | 2 |
13 files changed, 36 insertions, 29 deletions
diff --git a/src/com/vaadin/event/dd/DropTarget.java b/src/com/vaadin/event/dd/DropTarget.java index fcb9670f6f..0d88bf2893 100644 --- a/src/com/vaadin/event/dd/DropTarget.java +++ b/src/com/vaadin/event/dd/DropTarget.java @@ -24,7 +24,7 @@ public interface DropTarget extends Component { /** * Called before the {@link DragAndDropEvent} is passed to - * {@link DropHandler}. Implementation may for exmaple translate the drop + * {@link DropHandler}. Implementation may for example translate the drop * target details provided by the client side (drop target) to meaningful * server side values. If null is returned the terminal implementation will * automatically create a {@link TargetDetails} with raw client side data. diff --git a/src/com/vaadin/terminal/gwt/client/DateTimeService.java b/src/com/vaadin/terminal/gwt/client/DateTimeService.java index 7bc8e8eba4..0693994a9e 100644 --- a/src/com/vaadin/terminal/gwt/client/DateTimeService.java +++ b/src/com/vaadin/terminal/gwt/client/DateTimeService.java @@ -195,27 +195,27 @@ public class DateTimeService { if (resolution == RESOLUTION_YEAR) {
return (start <= target && end >= target);
}
- start += s.getMonth() * 100000000;
- end += e.getMonth() * 100000000;
- target += date.getMonth() * 100000000;
+ start += s.getMonth() * 100000000l;
+ end += e.getMonth() * 100000000l;
+ target += date.getMonth() * 100000000l;
if (resolution == RESOLUTION_MONTH) {
return (start <= target && end >= target);
}
- start += s.getDate() * 1000000;
- end += e.getDate() * 1000000;
- target += date.getDate() * 1000000;
+ start += s.getDate() * 1000000l;
+ end += e.getDate() * 1000000l;
+ target += date.getDate() * 1000000l;
if (resolution == RESOLUTION_DAY) {
return (start <= target && end >= target);
}
- start += s.getHours() * 10000;
- end += e.getHours() * 10000;
- target += date.getHours() * 10000;
+ start += s.getHours() * 10000l;
+ end += e.getHours() * 10000l;
+ target += date.getHours() * 10000l;
if (resolution == RESOLUTION_HOUR) {
return (start <= target && end >= target);
}
- start += s.getMinutes() * 100;
- end += e.getMinutes() * 100;
- target += date.getMinutes() * 100;
+ start += s.getMinutes() * 100l;
+ end += e.getMinutes() * 100l;
+ target += date.getMinutes() * 100l;
if (resolution == RESOLUTION_MIN) {
return (start <= target && end >= target);
}
diff --git a/src/com/vaadin/terminal/gwt/client/RenderInformation.java b/src/com/vaadin/terminal/gwt/client/RenderInformation.java index a91c0d7e24..6fb92c63e4 100644 --- a/src/com/vaadin/terminal/gwt/client/RenderInformation.java +++ b/src/com/vaadin/terminal/gwt/client/RenderInformation.java @@ -3,7 +3,7 @@ */ package com.vaadin.terminal.gwt.client;
-import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.Element; /**
* Contains size information about a rendered container and its content area.
@@ -90,9 +90,17 @@ public class RenderInformation { private int width, height;
@Override
- public boolean equals(Object obj) {
+ public boolean equals(Object obj) { + if (!(obj instanceof Size)) { + return false; + }
Size other = (Size) obj;
return other.width == width && other.height == height;
+ } + + @Override + public int hashCode() { + return (width << 8) | height; }
public Size() {
diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java index dae9bdfa88..427cd097b1 100755 --- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java +++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java @@ -365,7 +365,7 @@ public final class VDebugConsole extends VOverlay implements Console { str = msg.toString(); } panel.add((new Label(str))); - consoleLog(msg.toString()); + consoleLog(str); } /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/VMarginInfo.java b/src/com/vaadin/terminal/gwt/client/ui/VMarginInfo.java index 961624dcd7..2fb047c007 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VMarginInfo.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VMarginInfo.java @@ -73,4 +73,9 @@ public class VMarginInfo implements Serializable { return ((VMarginInfo) obj).bitMask == bitMask; } + @Override + public int hashCode() { + return bitMask; + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java index d41a739655..dfceb55416 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VPanel.java @@ -394,7 +394,7 @@ public class VPanel extends SimplePanel implements Container { public void setHeight(String height) { this.height = height; super.setHeight(height); - if (height != null && height != "") { + if (height != null && !"".equals(height)) { final int targetHeight = getOffsetHeight(); int containerHeight = targetHeight - captionNode.getParentElement().getOffsetHeight() diff --git a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 9f8e3ba17e..4bc8d386b4 100644 --- a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -47,10 +47,7 @@ public class DragAndDropService implements VariableOwner { + " must implement DropTarget"); return; } - if (owner == null) { - System.err.println("DropHandler owner is null"); - return; - } + // owner cannot be null here DropTarget dropTarget = (DropTarget) owner; lastVisitId = (Integer) variables.get("visitId"); diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index f7d1ddd79e..8d02602aab 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -1232,7 +1232,7 @@ public abstract class AbstractField extends AbstractComponent implements Field, } public void removeShortcutListener(ShortcutListener shortcut) { - if (actionManager == null) { + if (actionManager != null) { actionManager.removeAction(shortcut); } } diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java index 0929c05b68..901d96db21 100644 --- a/src/com/vaadin/ui/Form.java +++ b/src/com/vaadin/ui/Form.java @@ -1325,7 +1325,7 @@ public class Form extends AbstractField implements Item.Editor, Buffered, Item, public <T extends Action & com.vaadin.event.Action.Listener> void removeAction( T action) { - if (ownActionManager == null) { + if (ownActionManager != null) { ownActionManager.removeAction(action); } } diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java index 18a602280b..b7e92402cc 100644 --- a/src/com/vaadin/ui/GridLayout.java +++ b/src/com/vaadin/ui/GridLayout.java @@ -572,7 +572,7 @@ public class GridLayout extends AbstractLayout implements // Removes the cellUsed key as it has become // obsolete - cellUsed.remove(new Integer(curx)); + cellUsed.remove(Integer.valueOf(curx)); } } else { diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java index 036aa1b718..f53c7469ee 100644 --- a/src/com/vaadin/ui/MenuBar.java +++ b/src/com/vaadin/ui/MenuBar.java @@ -55,9 +55,6 @@ public class MenuBar extends AbstractComponent { // Superclass writes any common attributes in the paint target. super.paintContent(target); - // Stack for list iterators - Stack<Iterator<MenuItem>> iteratorStack = new Stack<Iterator<MenuItem>>(); - target.startTag("options"); if (submenuIcon != null) { diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java index d4fb66deb6..ce3e8bb582 100644 --- a/src/com/vaadin/ui/Panel.java +++ b/src/com/vaadin/ui/Panel.java @@ -501,7 +501,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, public <T extends Action & com.vaadin.event.Action.Listener> void removeAction( T action) { - if (actionManager == null) { + if (actionManager != null) { actionManager.removeAction(action); } } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 03f2bd27e2..e7323af06b 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -729,7 +729,7 @@ public class Table extends AbstractSelect implements Action.Container, if (width < 0) { columnWidths.remove(columnId); } else { - columnWidths.put(columnId, new Integer(width)); + columnWidths.put(columnId, Integer.valueOf(width)); } } |