Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ def main() -> None:
forbidden_rules = {
"RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE",
"RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE",
"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"
"UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR",
"SF_SWITCH_NO_DEFAULT"
}
violations = [
f for f in spotbugs.findings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ protected void initTransition() {
case EASING_IN_OUT:
motion = Motion.createEaseInOutMotion(0, 100, getDuration());
break;
default:
motion = Motion.createLinearMotion(0, 100, getDuration());
break;
}
motion.start();
}
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/cloud/CloudObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ public void propertyChanged(Component source, String propertyName, Object oldVal
status = STATUS_MODIFIED;
CloudStorage.getInstance().save(CloudObject.this);
break;
default:
break;
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ public void actionPerformed(ActionEvent evt) {
pause.setEnabled(true);
revalidateLater();
break;
default:
break;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ private void disposeTo(int direction, final Runnable onFinish) {
case Component.BOTTOM:
setY(Display.getInstance().getDisplayHeight());
break;

default:
break;
}

if (animateShow) {
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/components/SliderBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ public void actionPerformed(ActionEvent evt) {
s.setInfinite(true);
}
break;
default:
break;
}
}
});
Expand Down
3 changes: 3 additions & 0 deletions CodenameOne/src/com/codename1/components/ToastBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ public void actionPerformed(NetworkEvent evt) {
} else {
s.setProgress(-1);
}
break;
default:
break;
}
}
};
Expand Down
54 changes: 36 additions & 18 deletions CodenameOne/src/com/codename1/impl/CodenameOneImplementation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2696,6 +2696,8 @@ protected boolean hasDragStarted(final int x, final int y) {
startX = Math.min(startX, 2f);
startY = Math.min(startY, 2f);
break;
default:
break;
}

// have we passed the motion threshold on the X axis?
Expand Down Expand Up @@ -5867,6 +5869,8 @@ public void actionPerformed(ActionEvent evt) {
});


break;
default:
break;
}
}
Expand Down Expand Up @@ -5926,6 +5930,8 @@ public boolean isGalleryTypeSupported(int type) {
case Display.GALLERY_VIDEO:
case Display.GALLERY_ALL:
return true;
default:
break;
}
return false;
}
Expand Down Expand Up @@ -7970,24 +7976,6 @@ public void paintComponentBackground(Object nativeGraphics, int x, int y, int wi
int iH = bgImageOrig.getHeight();
Object bgImage = bgImageOrig.getImage();
switch (s.getBackgroundType()) {
case Style.BACKGROUND_NONE:
if (s.getBgTransparency() != 0) {
setColor(nativeGraphics, s.getBgColor());
fillRect(nativeGraphics, x, y, width, height, s.getBgTransparency());
}
return;
case Style.BACKGROUND_IMAGE_SCALED:
if (isScaledImageDrawingSupported()) {
drawImage(nativeGraphics, bgImage, x, y, width, height);
} else {
if (iW != width || iH != height) {
bgImageOrig = bgImageOrig.scaled(width, height);
s.setBgImage(bgImageOrig, true);
bgImage = bgImageOrig.getImage();
}
drawImage(nativeGraphics, bgImage, x, y);
}
return;
case Style.BACKGROUND_IMAGE_SCALED_FILL:
float r = Math.max(((float) width) / ((float) iW), ((float) height) / ((float) iH));
int bwidth = (int) (((float) iW) * r);
Expand Down Expand Up @@ -8110,6 +8098,19 @@ public void paintComponentBackground(Object nativeGraphics, int x, int y, int wi
case Style.BACKGROUND_GRADIENT_LINEAR_VERTICAL:
case Style.BACKGROUND_GRADIENT_RADIAL:
drawGradientBackground(s, nativeGraphics, x, y, width, height);
return;
default:
// Style.BACKGROUND_IMAGE_SCALED:
if (isScaledImageDrawingSupported()) {
drawImage(nativeGraphics, bgImage, x, y, width, height);
} else {
if (iW != width || iH != height) {
bgImageOrig = bgImageOrig.scaled(width, height);
s.setBgImage(bgImageOrig, true);
bgImage = bgImageOrig.getImage();
}
drawImage(nativeGraphics, bgImage, x, y);
}
}
}
}
Expand All @@ -8129,6 +8130,13 @@ private void drawGradientBackground(Style s, Object nativeGraphics, int x, int y
x, y, width, height, s.getBackgroundGradientRelativeX(), s.getBackgroundGradientRelativeY(),
s.getBackgroundGradientRelativeSize());
return;
default:
// Style.BACKGROUND_NONE
if (s.getBgTransparency() != 0) {
setColor(nativeGraphics, s.getBgColor());
fillRect(nativeGraphics, x, y, width, height, s.getBgTransparency());
}
break;
}
setColor(nativeGraphics, s.getBgColor());
fillRect(nativeGraphics, x, y, width, height, s.getBgTransparency());
Expand Down Expand Up @@ -8237,6 +8245,8 @@ public void drawLabelComponent(Object nativeGraphics, int cmpX, int cmpY, int cm
case Label.TOP:
y = y + (cmpHeight - (topPadding + bottomPadding + ((icon != null) ? iconHeight + gap : 0) + fontHeight)) / 2;
break;
default:
break;
}
break;
case Component.CENTER:
Expand Down Expand Up @@ -8266,6 +8276,8 @@ public void drawLabelComponent(Object nativeGraphics, int cmpX, int cmpY, int cm
+ ((icon != null) ? iconHeight + gap : 0)
+ fontHeight)) / 2;
break;
default:
break;
}
break;
case Component.RIGHT:
Expand Down Expand Up @@ -8295,6 +8307,8 @@ public void drawLabelComponent(Object nativeGraphics, int cmpX, int cmpY, int cm
+ bottomPadding
+ ((icon != null) ? iconHeight + gap : 0) + fontHeight)) / 2;
break;
default:
break;
}
break;
default:
Expand Down Expand Up @@ -8381,6 +8395,8 @@ public void drawLabelComponent(Object nativeGraphics, int cmpX, int cmpY, int cm
drawImage(nativeGraphics, icon, x + iconStringWGap, y + fontHeight + gap);
}
break;
default:
break;
}
}
setAlpha(nativeGraphics, alpha);
Expand Down Expand Up @@ -8570,6 +8586,8 @@ private int reverseAlignForBidi(boolean rtl, int align) {
return Component.LEFT;
case Component.LEFT:
return Component.RIGHT;
default:
break;
}
}
return align;
Expand Down
5 changes: 5 additions & 0 deletions CodenameOne/src/com/codename1/io/NetworkManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,9 @@ void addToQueue(@Async.Schedule ConnectionRequest request, boolean retry) {
case ConnectionRequest.PRIORITY_REDUNDANT:
addSortedToQueue(request, i);
break;
default:
addSortedToQueue(request, i);
break;
}
LOCK.notify();
}
Expand Down Expand Up @@ -877,6 +880,8 @@ private boolean runCurrentRequest(@Async.Execute ConnectionRequest req) {
case ConnectionRequest.PRIORITY_REDUNDANT:
Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
break;
default:
break;
}

if (progressListeners != null) {
Expand Down
4 changes: 4 additions & 0 deletions CodenameOne/src/com/codename1/l10n/SimpleDateFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ String format(Date source, StringBuilder toAppendTo) {
v = ((calendar.get(Calendar.DAY_OF_WEEK) + 5) % 7) + 1;
toAppendTo.append(leftPad(v, len));
break;
default:
break;
}
}
return toAppendTo.toString();
Expand Down Expand Up @@ -615,6 +617,8 @@ public Date parse(String source) throws ParseException {
// v % 7 + 1
calendar.set(Calendar.DAY_OF_WEEK, (v % 7) + 1);
break;
default:
break;
}
if (s != null) {
startIndex += s.length();
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/properties/PropertyIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,8 @@ public void internalize(int version, DataInputStream in) throws IOException {
((MapProperty) pb).setMap((Map) data);
}
break;
default:
break;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion CodenameOne/src/com/codename1/properties/UiBinding.java
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,8 @@ public void assignTo(PropertyType value, Picker cmp) {
cmp.setSelectedString((String) toComponentType.convert(value));
}
break;
default:
break;
}
}

Expand All @@ -812,8 +814,9 @@ public PropertyType getFrom(Picker cmp) {
return (PropertyType) Integer.valueOf(cmp.getSelectedStringIndex());
}
return (PropertyType) toPropertyType.convert(cmp.getSelectedString());
default:
throw new RuntimeException("Illegal state for picker binding");
}
throw new RuntimeException("Illegal state for picker binding");
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/push/PushBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ public String build() {
case 102:
sb.append(badge).append(";").append(title).append(";").append(body);
break;
default:
break;
}

if (isRichPush()) {
Expand Down
4 changes: 4 additions & 0 deletions CodenameOne/src/com/codename1/ui/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ public Image getIconFromState() {
}
}
break;
default:
break;
}
return icon;
}
Expand Down Expand Up @@ -1004,6 +1006,8 @@ public boolean animate() {
case STATE_PRESSED:
a |= pressedIcon != null && pressedIcon.isAnimation() && pressedIcon.animate();
break;
default:
break;
}
}
return a;
Expand Down
6 changes: 4 additions & 2 deletions CodenameOne/src/com/codename1/ui/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -2441,7 +2441,8 @@ int calculateShadowOffsetX(int elevation) {
return dp2px(-42);
case 24:
return dp2px(-65);

default:
break;
}
return 0;
}
Expand Down Expand Up @@ -2658,7 +2659,8 @@ public void run() {
//drawShadow(g, img, relativeX, relativeY, 0, 9, 46, 8, 0, 0.12f);
//drawShadow(g, img, relativeX, relativeY, 0, 11, 15, -7, 0, 0.2f);
break;

default:
break;
}
synchronized (this) {
cachedShadowImage = shadowImage;
Expand Down
4 changes: 4 additions & 0 deletions CodenameOne/src/com/codename1/ui/Container.java
Original file line number Diff line number Diff line change
Expand Up @@ -2675,6 +2675,8 @@ boolean moveScrollTowards(int direction, Component next) {
x = 0;
}
break;
default:
break;
}
f.setCyclicFocus(cyclic);
//if the Form doesn't contain a focusable Component simply move the
Expand Down Expand Up @@ -4023,6 +4025,8 @@ public java.util.List<Component> getChildrenAsList(boolean includeQueued) {
case QueuedChange.TYPE_REMOVE:
out.remove(change.component);
break;
default:
break;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,8 @@ private int handleEvent(int offset, int[] inputEventStackTmp) {
offset++;
}
break;
default:
break;
case POINTER_PRESSED:
if (recursivePointerReleaseA) {
recursivePointerReleaseB = true;
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/Sheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ private void updateBorderForPosition() {
b.bottomLeftMode(true);
b.bottomRightMode(true);
break;
default:
break;

}
getStyle().setBorder(b);
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/Slider.java
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,8 @@ public void keyPressed(int code) {
fireClicked();
}
break;
default:
break;
}
} else {
if (!Display.getInstance().isThirdSoftButton() &&
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/SwipeableContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ public void actionPerformed(ActionEvent evt) {
}
break;
}
default:
break;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/Tabs.java
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,8 @@ public void actionPerformed(ActionEvent evt) {
dragStarted = false;
break;
}
default:
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/TextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -1869,6 +1869,8 @@ public void actionPerformed(ActionEvent ev) {
ev.consume();
editString();
break;
default:
break;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions CodenameOne/src/com/codename1/ui/Transform.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ private void initNativeTransform() {
case TYPE_IDENTITY:
impl.setTransformIdentity(nativeTransform);
break;
default:
break;
}

}
Expand Down
Loading
Loading