Bitmasks seem to be using wrong operator ("anything | 1 != 0" is always true)

Note return value check was changed from != to == based on JavaDoc for return value and logic in overridden method in superclass.
This commit is contained in:
Daniel Gredler
2018-08-30 15:52:11 -04:00
parent cdde1c773c
commit ad6a08cdd3
@@ -79,11 +79,11 @@ public class StatusPanel extends JComponent
public boolean imageUpdate (Image img, int infoflags, int x, int y, int width, int height)
{
boolean updated = false;
if ((infoflags | WIDTH) != 0) {
if ((infoflags & WIDTH) != 0) {
_psize.width = width;
updated = true;
}
if ((infoflags | HEIGHT) != 0) {
if ((infoflags & HEIGHT) != 0) {
_psize.height = height;
updated = true;
}
@@ -92,7 +92,7 @@ public class StatusPanel extends JComponent
setSize(_psize);
getParent().setSize(_psize);
}
return (infoflags | ALLBITS) != 0;
return (infoflags & ALLBITS) == 0;
}
/**