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
12 changes: 12 additions & 0 deletions .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,18 @@ def _is_exempt(f: Finding) -> bool:
print(f" - {v.rule}: {v.location} - {v.message}")
exit(1)

pmd = parse_pmd()
if pmd:
forbidden_pmd_rules = {
"ClassWithOnlyPrivateConstructorsShouldBeFinal",
}
violations = [f for f in pmd.findings if f.rule in forbidden_pmd_rules]
if violations:
print("\n❌ Build failed due to forbidden PMD violations:")
for v in violations:
print(f" - {v.rule}: {v.location} - {v.message}")
exit(1)


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/charts/util/MathHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/**
* Utility class for math operations.
*/
public class MathHelper {
public final class MathHelper {
/** A value that is used a null value. */
public static final double NULL_VALUE = -Double.MAX_VALUE + 1;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @author Shai Almog
*/
public class ClearableTextField extends Container {
public final class ClearableTextField extends Container {
private ClearableTextField() {
super(new BorderLayout());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* @author Shai Almog
*/
public class FileEncodedImage extends EncodedImage {
public final class FileEncodedImage extends EncodedImage {
private final String fileName;
private final boolean keep;
private byte[] data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* @author Shai Almog
*/
public class FileEncodedImageAsync extends EncodedImage {
public final class FileEncodedImageAsync extends EncodedImage {
private static final Object LOCK = new Object();
private final String fileName;
private boolean changePending;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* @author Shai Almog
*/
public class InfiniteScrollAdapter {
public final class InfiniteScrollAdapter {
private Container infiniteContainer;
private Runnable fetchMore;
private final Component ip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @author Shai Almog
*/
public class ReplaceableImage extends EncodedImage {
public final class ReplaceableImage extends EncodedImage {
private boolean replaced;
private byte[] data;
private final boolean opaque;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/components/StorageImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author Shai Almog
*/
public class StorageImage extends EncodedImage {
public final class StorageImage extends EncodedImage {
private final String fileName;
private final boolean keep;
private byte[] data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*
* @author Shai Almog
*/
public class StorageImageAsync extends EncodedImage {
public final class StorageImageAsync extends EncodedImage {
private static final Object LOCK = new Object();
private final String fileName;
private boolean changePending;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/components/ToastBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
*
* @author shannah
*/
public class ToastBar {
public final class ToastBar {

/**
* The default timeout for info/error messages
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/facebook/FaceBookAccess.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
*
* @author Chen Fishbein
*/
public class FaceBookAccess {
public final class FaceBookAccess {

private static final String TEMP_STORAGE = "FaceBookAccesstmp";
private static String clientId = "132970916828080";
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/io/FileSystemStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*
* @author Shai Almog
*/
public class FileSystemStorage {
public final class FileSystemStorage {
/**
* Represents the type for the get root type method, this type generally represents the main
* phone memory
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/io/NetworkManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
*
* @author Shai Almog
*/
public class NetworkManager {
public final class NetworkManager {
/**
* Indicates an unknown access point type
*/
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/io/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @author Shai Almog
*/
public class Socket {
public final class Socket {
private Socket() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* @author Shai Almog
*/
public class CachedDataService extends ConnectionRequest {
public final class CachedDataService extends ConnectionRequest {
private final CachedData data = new CachedData();
private boolean responseProcessed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
*
* @author shannah
*/
public class GeofenceManager implements Iterable<Geofence> {
public final class GeofenceManager implements Iterable<Geofence> {
//private GeoStreamerAsyncDataSource dataSource;
private static final String STORAGE_KEY = "$AsyncGeoStreamer.geofences$";
private static final String ACTIVE_FENCES_KEY = "$AsyncGeoStreamer.activegeofences$";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*
* @author Eric Coolman (2012-03 - derivative work from original Sun source).
*/
class PrettyPrinter {
final class PrettyPrinter {
Map<?, ?> myHashMap;

private PrettyPrinter(Map<?, ?> h) {
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/processing/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
*
* @author Eric Coolman (2012-03 - derivative work from original Sun source).
*/
public class Result {
public final class Result {

public static final String JSON = "json";
public static final String XML = "xml";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @author Shai Almog
*/
public class PreferencesObject {
public final class PreferencesObject {
private PropertyBusinessObject bo;
private String prefix;
private boolean bound;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/properties/SQLMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*
* @author Shai Almog
*/
public class SQLMap {
public final class SQLMap {
private boolean verbose = true;
private Database db;

Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/push/PushContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @author Steve Hannah
*/
public class PushContent {
public final class PushContent {
private static final String PROP_PREFIX = "com.codename1.push.prop.";

private final String title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*
* @author Shai Almog
*/
public class DefaultCrashReporter implements CrashReport {
public final class DefaultCrashReporter implements CrashReport {
private static String errorText = "The application encountered an error, do you wish to report it?";
private static String sendButtonText = "Send";
private static String dontSendButtonText = "Don't Send";
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/system/NativeLookup.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*
* @author Shai Almog
*/
public class NativeLookup {
public final class NativeLookup {
/**
* Indicates whether stack traces should be printed when lookup fails
*/
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/testing/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
* @author Shai Almog
*/
public class TestUtils {
public final class TestUtils {
private static boolean verbose;

private TestUtils() {
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/FontImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
*
* @author Shai Almog
*/
public class FontImage extends Image {
public final class FontImage extends Image {
/**
* Material design icon font character code see
* https://www.material.io/resources/icons/ for full list
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/UIFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
* @author shannah
* @since 7.0
*/
public class UIFragment {
public final class UIFragment {


// The root element of this template
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/URLImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
*
* @author Shai Almog
*/
public class URLImage extends EncodedImage {
public final class URLImage extends EncodedImage {

/**
* Flag used by {@link #createCachedImage(java.lang.String, java.lang.String, com.codename1.ui.Image, int) }.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*
* @author Shai Almog
*/
public class MorphTransition extends Transition {
public final class MorphTransition extends Transition {
private int duration;
private final HashMap<String, String> fromTo = new HashMap<String, String>();
private CC[] fromToComponents;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/html/HTMLInputFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
*
* @author Ofir Leitner
*/
class HTMLInputFormat {
final class HTMLInputFormat {

/**
* The allowed literals in an input format defintion
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/html/HTMLUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author Ofir Leitner
* @deprecated the HTML package is no longer used or maintained and may be removed in a future revision
*/
public class HTMLUtils {
public final class HTMLUtils {

/**
* The char entities strings supported in XML. When a char entity is found these will be compared against first.
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/plaf/RoundBorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*
* @author Shai Almog
*/
public class RoundBorder extends Border {
public final class RoundBorder extends Border {
private static final String CACHE_KEY = "cn1$$-rbcache";
// these allow us to have more than one border per component in cache which is important for selected/unselected/pressed values
private static int instanceCounter;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/plaf/RoundRectBorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*
* @author Shai Almog
*/
public class RoundRectBorder extends Border {
public final class RoundRectBorder extends Border {
private static final String CACHE_KEY = "cn1$$-rrbcache";
// these allow us to have more than one border per component in cache which is important for selected/unselected/pressed values
private static int instanceCounter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* @author Shai Almog
* @deprecated use Picker instead
*/
class DateTimeRenderer extends SpinnerRenderer<Object> {
final class DateTimeRenderer extends SpinnerRenderer<Object> {
static final String[] MONTHS = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/ui/util/Effects.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author Shai Almog
*/
public class Effects {
public final class Effects {
private Effects() {
}

Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/CallbackDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @author shannah
*/
public class CallbackDispatcher<T> implements Runnable {
public final class CallbackDispatcher<T> implements Runnable {
private SuccessCallback<T> success;
private FailureCallback<T> failure;
private T arg;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/EasyThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @author Shai Almog
*/
public class EasyThread {
public final class EasyThread {
private static final List<ErrorListener> globalErrorListenenrs = new ArrayList<ErrorListener>();
private final Object LOCK = new Object();
private List<ErrorListener> errorListenenrs;
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TBitLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* All operations are provided in immutable way, and some in both mutable and
* immutable.
*/
class TBitLevel {
final class TBitLevel {

/**
* Just to denote that this class can't be instantiated.
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TConversion.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Static library that provides {@link TBigInteger} base conversion from/to any
* integer represented in an {@link java.lang.String} Object.
*/
class TConversion {
final class TConversion {

/**
* Holds the maximal exponent for each radix, so that radix<sup>digitFitInInt[radix]</sup>
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TElementary.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* In addition to this, some <i><b>Inplace</b></i> (mutable) methods are
* provided.
*/
class TElementary {
final class TElementary {

/**
* Just to denote that this class can't be instantiated
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TLogical.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* <li>xor</li>
* </ul>
*/
class TLogical {
final class TLogical {

/**
* Just to denote that this class can't be instantiated.
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TMultiplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/**
* Static library that provides all multiplication of {@link TBigInteger} methods.
*/
class TMultiplication {
final class TMultiplication {

/**
* Break point in digits (number of {@code int} elements)
Expand Down
2 changes: 1 addition & 1 deletion CodenameOne/src/com/codename1/util/TPrimality.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* Provides primality probabilistic methods.
*/
class TPrimality {
final class TPrimality {

/**
* All prime numbers with bit length lesser than 10 bits.
Expand Down
Loading