diff options
author | Henri Sara <henri.sara@itmill.com> | 2010-06-01 10:53:07 +0000 |
---|---|---|
committer | Henri Sara <henri.sara@itmill.com> | 2010-06-01 10:53:07 +0000 |
commit | e4efbe682e49bcb3f473df2a9d28237450ec2682 (patch) | |
tree | 49fab02cf377b05f10725e2160d03951f0c54c8b /src/com | |
parent | 734b4fa1a99835b1270549d482cf4b2f0f7c9428 (diff) | |
download | vaadin-framework-e4efbe682e49bcb3f473df2a9d28237450ec2682.tar.gz vaadin-framework-e4efbe682e49bcb3f473df2a9d28237450ec2682.zip |
Fixed some high priority warnings by FindBugs
svn changeset:13459/svn branch:6.3
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/DateTimeService.java | 6 | ||||
-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/ui/AbstractField.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/Form.java | 2 | ||||
-rw-r--r-- | src/com/vaadin/ui/MenuBar.java | 3 |
8 files changed, 22 insertions, 12 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/DateTimeService.java b/src/com/vaadin/terminal/gwt/client/DateTimeService.java index 7bc8e8eba4..c2b44f2e20 100644 --- a/src/com/vaadin/terminal/gwt/client/DateTimeService.java +++ b/src/com/vaadin/terminal/gwt/client/DateTimeService.java @@ -195,9 +195,9 @@ 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);
}
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/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/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) { |