Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7e5e039
Initial work on improving spotless fixes
shai-almog Dec 30, 2025
ce41dd3
Fixed compilation issues and hardened build
shai-almog Dec 30, 2025
5391953
Fixed path
shai-almog Dec 30, 2025
91c799c
Improved CI build validation
shai-almog Dec 30, 2025
4802879
Fixed unit test issues
shai-almog Dec 30, 2025
aeb7815
Fixed a bug and excluded some spotbugs tests
shai-almog Dec 30, 2025
430d720
Removed additional settings
shai-almog Dec 30, 2025
ee18824
Fixing exclusion logic
shai-almog Dec 31, 2025
79e5e42
Refined rules
shai-almog Dec 31, 2025
2ddd886
Additional improvements
shai-almog Dec 31, 2025
b3bae00
Fixing exclusions to include inner classes
shai-almog Dec 31, 2025
49a02fe
Removed cloud storage package and further improvements
shai-almog Dec 31, 2025
26edf9a
BindTarget was still used. Restored it and deprecated code
shai-almog Dec 31, 2025
f0fb3e5
Trying again for TarEntry
shai-almog Dec 31, 2025
431d0cd
WTF
shai-almog Dec 31, 2025
c5730b5
Trying source name
shai-almog Dec 31, 2025
da30271
Fixed python script to ignore the tags failure
shai-almog Dec 31, 2025
841668f
Major fixes for calls from constructors
shai-almog Dec 31, 2025
a7d864c
Additional fixes and exclusions
shai-almog Dec 31, 2025
add990c
Enabled getResourceAsStream
shai-almog Dec 31, 2025
8628ad9
Further fixes
shai-almog Dec 31, 2025
f5ee076
Further refactorings to reduce warnings
shai-almog Dec 31, 2025
da144c7
Additional round of fixes
shai-almog Dec 31, 2025
2665620
Updated code
shai-almog Jan 1, 2026
bf4c042
Multiple fixes and removed call in constructor
shai-almog Jan 1, 2026
c9ac07a
Further fixes
shai-almog Jan 1, 2026
b163ebb
Fixed most issues
shai-almog Jan 1, 2026
3b6b67f
Added missing null check in SimpleDateFormat parse() (#4377)
ThomasH99 Jan 2, 2026
fc491b4
Update corevm.jar reference path in project.properties
shai-almog Jan 2, 2026
e5f712e
Uncomment getResourceAsStream method in Class.java
shai-almog Jan 2, 2026
7198cdd
Implement durationMode in TimeSpinner3D (#4379)
google-labs-jules[bot] Jan 2, 2026
486c2b9
Initial work on improving spotless fixes
shai-almog Dec 30, 2025
d7266e3
Fixed compilation issues and hardened build
shai-almog Dec 30, 2025
7ae5f29
Improved CI build validation
shai-almog Dec 30, 2025
a0423c6
Fixed unit test issues
shai-almog Dec 30, 2025
eb29eb0
Fixed a bug and excluded some spotbugs tests
shai-almog Dec 30, 2025
475a5ef
Removed additional settings
shai-almog Dec 30, 2025
068aead
Fixing exclusion logic
shai-almog Dec 31, 2025
fb3fe56
Refined rules
shai-almog Dec 31, 2025
dfe0123
Additional improvements
shai-almog Dec 31, 2025
e601654
Fixing exclusions to include inner classes
shai-almog Dec 31, 2025
66b3358
Removed cloud storage package and further improvements
shai-almog Dec 31, 2025
25bdfc1
BindTarget was still used. Restored it and deprecated code
shai-almog Dec 31, 2025
93c13e4
Trying again for TarEntry
shai-almog Dec 31, 2025
35b21ac
WTF
shai-almog Dec 31, 2025
ac345b3
Trying source name
shai-almog Dec 31, 2025
a3b6aa4
Fixed python script to ignore the tags failure
shai-almog Dec 31, 2025
61b68f4
Major fixes for calls from constructors
shai-almog Dec 31, 2025
aa627a0
Additional fixes and exclusions
shai-almog Dec 31, 2025
aa890ff
Further fixes
shai-almog Dec 31, 2025
2ab2b08
Further refactorings to reduce warnings
shai-almog Dec 31, 2025
f5ec645
Additional round of fixes
shai-almog Dec 31, 2025
8903b5b
Updated code
shai-almog Jan 1, 2026
f428c5e
Multiple fixes and removed call in constructor
shai-almog Jan 1, 2026
fa99f27
Further fixes
shai-almog Jan 1, 2026
a3869a2
Fixed most issues
shai-almog Jan 1, 2026
5eb12b1
Fixed a few more bugs but didn't exclude yet
shai-almog Jan 3, 2026
50be5e4
Merge branch 'Fixing-spotless-warnings' of https://github.com/codenam…
shai-almog Jan 3, 2026
89d106a
Deleted bad test code
shai-almog Jan 3, 2026
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
47 changes: 44 additions & 3 deletions .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,53 @@ def main() -> None:
"EQ_ALWAYS_FALSE",
"SBSC_USE_STRINGBUFFER_CONCATENATION",
"SIC_INNER_SHOULD_BE_STATIC",
"EQ_DOESNT_OVERRIDE_EQUALS"
"EQ_DOESNT_OVERRIDE_EQUALS",
"CO_COMPARETO_INCORRECT_FLOATING",
"DL_SYNCHRONIZATION_ON_SHARED_CONSTANT",
"DLS_DEAD_LOCAL_STORE",
"DM_NUMBER_CTOR",
"DMI_INVOKING_TOSTRING_ON_ARRAY",
"EC_NULL_ARG",
"EC_UNRELATED_TYPES_USING_POINTER_EQUALITY",
"EQ_GETCLASS_AND_CLASS_CONSTANT",
"EQ_UNUSUAL",
"ES_COMPARING_STRINGS_WITH_EQ",
"FI_EMPTY",
"ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
"DM_GC",
"CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE",
"BC_UNCONFIRMED_CAST",
"BC_UNCONFIRMED_CAST_OF_RETURN_VALUE",
"CN_IDIOM_NO_SUPER_CALL",
"DM_BOOLEAN_CTOR",
"DM_EXIT",
"EI_EXPOSE_REP",
"EI_EXPOSE_REP2",
"EI_EXPOSE_STATIC_REP2",
"EQ_COMPARETO_USE_OBJECT_EQUALS",
"MS_EXPOSE_REP",
"NM_CONFUSING",
"NO_NOTIFY_NOT_NOTIFYALL",
"NP_BOOLEAN_RETURN_NULL",
"REFLC_REFLECTION_MAY_INCREASE_ACCESSIBILITY_OF_CLASS",
"UI_INHERITANCE_UNSAFE_GETRESOURCE",
"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD",
"UW_UNCOND_WAIT",
"SIC_INNER_SHOULD_BE_STATIC_ANON"
}

def _is_exempt(f: Finding) -> bool:
loc = f.path or f.location or ""
if f.rule == "SA_FIELD_SELF_ASSIGNMENT" and "InfBlocks.java" in loc:
return True
if f.rule == "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" and "TarEntry.java" in loc:
return True
return False


violations = [
f for f in spotbugs.findings
if f.rule in forbidden_rules
and not (f.rule == "SA_FIELD_SELF_ASSIGNMENT" and "InfBlocks.java" in f.location)
if f.rule in forbidden_rules and not _is_exempt(f)
]
if violations:
print("\n❌ Build failed due to forbidden SpotBugs violations:")
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/designer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:

- name: Build core dependencies
run: |
xvfb-run -a ant -noinput -buildfile Ports/CLDC11/build.xml jar
xvfb-run -a ant -noinput -buildfile Ports/JavaSE/build.xml jar
xvfb-run -a ant -noinput -buildfile Ports/JavaSEWithSVGSupport/build.xml jar
xvfb-run -a ant -noinput -buildfile CodenameOne/build.xml jar
Expand Down
4 changes: 2 additions & 2 deletions CodenameOne/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dist.jar=${dist.dir}/CodenameOne.jar
dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.corevm.jar=../../cn1-binaries/corevm.jar
file.reference.corevm.jar=../Ports/CLDC11/dist/CLDC11.jar
includes=**
jar.compress=false
javac.classpath=\
Expand Down Expand Up @@ -76,4 +76,4 @@ source.encoding=windows-1252
src.dir=src
test.src.dir=test
endorsed.classpath.cmd.line.arg=-bootclasspath ${file.reference.corevm.jar}
codenameone.dir=../../CodenameOne
codenameone.dir=../../CodenameOne
19 changes: 11 additions & 8 deletions CodenameOne/src/com/codename1/capture/Capture.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static boolean hasCamera() {
* @param response a callback Object to retrieve the file path
* @throws RuntimeException if this feature failed or unsupported on the platform
*/
public static void capturePhoto(ActionListener response) {
public static void capturePhoto(ActionListener<ActionEvent> response) {
Display.getInstance().capturePhoto(response);
}

Expand Down Expand Up @@ -193,7 +193,7 @@ public static String capturePhoto(int width, int height) {
* @param response a callback Object to retrieve the file path
* @throws RuntimeException if this feature failed or unsupported on the platform
*/
public static void captureAudio(ActionListener response) {
public static void captureAudio(ActionListener<ActionEvent> response) {
Display.getInstance().captureAudio(response);
}

Expand All @@ -210,7 +210,7 @@ public static void captureAudio(ActionListener response) {
* @throws RuntimeException if this feature failed or unsupported on the platform
* @since 7.0
*/
public static void captureAudio(MediaRecorderBuilder recorderOptions, ActionListener response) {
public static void captureAudio(MediaRecorderBuilder recorderOptions, ActionListener<ActionEvent> response) {
Display.getInstance().captureAudio(recorderOptions, response);
}

Expand All @@ -224,7 +224,7 @@ public static void captureAudio(MediaRecorderBuilder recorderOptions, ActionList
* @param response a callback Object to retrieve the file path
* @since 7.0
*/
public static void captureVideo(VideoCaptureConstraints constraints, ActionListener response) {
public static void captureVideo(VideoCaptureConstraints constraints, ActionListener<ActionEvent> response) {
Display.getInstance().captureVideo(constraints, response);
}

Expand All @@ -241,11 +241,11 @@ public static void captureVideo(VideoCaptureConstraints constraints, ActionListe
* @throws RuntimeException if this feature failed or unsupported on the platform
* @see #captureVideo(com.codename1.capture.VideoCaptureConstraints, com.codename1.ui.events.ActionListener)
*/
public static void captureVideo(ActionListener response) {
public static void captureVideo(ActionListener<ActionEvent> response) {
Display.getInstance().captureVideo(response);
}

static class CallBack implements ActionListener, Runnable {
static class CallBack implements ActionListener<ActionEvent>, Runnable {
String url;
private boolean completed;
private int targetWidth = -1;
Expand All @@ -259,15 +259,18 @@ public void actionPerformed(ActionEvent evt) {
}
completed = true;
synchronized (this) {
this.notify();
this.notifyAll();
}
}

public void run() {
while (!completed) {
synchronized (this) {
try {
this.wait();
// we need to recheck the condition within the synchronized block (double locking)
if(!completed) {
this.wait();
}
} catch (InterruptedException ex) {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private String getMaxFileSizeString() {

@Override
public boolean equals(Object obj) {
if (obj.getClass() == VideoCaptureConstraints.class) {
if (obj instanceof VideoCaptureConstraints) {
VideoCaptureConstraints c = (VideoCaptureConstraints) obj;
return c.preferredHeight == preferredHeight &&
c.preferredWidth == preferredWidth &&
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/charts/ChartComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public class ChartComponent extends Component {
* @param chart The chart to be displayed in this component.
*/
public ChartComponent(AbstractChart chart) {
setUIID("ChartComponent");
setUIIDFinal("ChartComponent");
this.chart = chart;
if (chart != null && chart instanceof XYChart) {
XYChart xyChart = (XYChart) chart;
Expand Down
26 changes: 13 additions & 13 deletions CodenameOne/src/com/codename1/charts/views/BubbleChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
import java.util.List;


/**
* Displays series of {@link XYValueSeries} entries as proportional bubbles on
* top of an {@link XYChart} plot.
* <p>
* Combine the chart with an {@link XYMultipleSeriesDataset} that contains one
* or more {@link XYValueSeries} instances and supply an
* {@link XYMultipleSeriesRenderer}. The resulting {@code BubbleChart} can be
* wrapped in a {@link com.codename1.charts.ChartComponent} to embed it inside a
* Codename One UI.
*/
public class BubbleChart extends XYChart {
/**
* Displays series of {@link XYValueSeries} entries as proportional bubbles on
* top of an {@link XYChart} plot.
* <p>
* Combine the chart with an {@link XYMultipleSeriesDataset} that contains one
* or more {@link XYValueSeries} instances and supply an
* {@link XYMultipleSeriesRenderer}. The resulting {@code BubbleChart} can be
* wrapped in a {@link com.codename1.charts.ChartComponent} to embed it inside a
* Codename One UI.
*/
public class BubbleChart extends XYChart {
/** The constant to identify this chart type. */
public static final String TYPE = "Bubble";
/** The legend shape width. */
Expand Down Expand Up @@ -66,8 +66,8 @@ public BubbleChart(XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer ren
* @param canvas the canvas to paint to
* @param paint the paint to be used for drawing
* @param points the array of points to be used for drawing the series
* @param seriesRenderer the series renderer
* @param yAxisValue the minimum value of the y axis
* @param renderer the series renderer
* @param yAxisValue the minimum value of the y-axis
* @param seriesIndex the index of the series currently being drawn
* @param startIndex the start index of the rendering points
*/
Expand Down
3 changes: 2 additions & 1 deletion CodenameOne/src/com/codename1/charts/views/LineChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float
* @param renderer the series renderer
*/
public boolean isRenderPoints(SimpleSeriesRenderer renderer) {
return ((XYSeriesRenderer) renderer).getPointStyle() != PointStyle.POINT;
return renderer instanceof XYSeriesRenderer &&
((XYSeriesRenderer) renderer).getPointStyle() != PointStyle.POINT;
}

/**
Expand Down
21 changes: 11 additions & 10 deletions CodenameOne/src/com/codename1/charts/views/ScatterChart.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
import java.util.List;


/**
* Renders discrete X/Y points without connecting lines.
* <p>
* Configure the marker style through {@link XYSeriesRenderer#setPointStyle} and
* related options on the {@link XYMultipleSeriesRenderer}. As with other
* charts, wrap the instance in a {@link com.codename1.charts.ChartComponent} to
* place it on a form.
*/
public class ScatterChart extends XYChart {
/**
* Renders discrete X/Y points without connecting lines.
* <p>
* Configure the marker style through {@link XYSeriesRenderer#setPointStyle} and
* related options on the {@link XYMultipleSeriesRenderer}. As with other
* charts, wrap the instance in a {@link com.codename1.charts.ChartComponent} to
* place it on a form.
*/
public class ScatterChart extends XYChart {
/** The constant to identify this chart type. */
public static final String TYPE = "Scatter";
/** The default point shape size. */
Expand Down Expand Up @@ -203,7 +203,8 @@ public int getLegendShapeWidth(int seriesIndex) {
*/
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y,
int seriesIndex, Paint paint) {
if (((XYSeriesRenderer) renderer).isFillPoints()) {
if (renderer instanceof XYSeriesRenderer &&
((XYSeriesRenderer) renderer).isFillPoints()) {
paint.setStyle(Style.FILL);
} else {
paint.setStyle(Style.STROKE);
Expand Down
52 changes: 0 additions & 52 deletions CodenameOne/src/com/codename1/cloud/CloudException.java

This file was deleted.

Loading
Loading