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
6 changes: 5 additions & 1 deletion .github/scripts/generate-quality-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,11 @@ def _is_exempt(f: Finding) -> bool:
"DoNotCallGarbageCollectionExplicitly",
"SuspiciousEqualsMethodName",
"UseUtilityClass",
"EmptyCatchBlock"
"EmptyCatchBlock",
"SimplifyBooleanReturns",
"UnusedLocalVariable",
"UnnecessaryConstructor",
"UnnecessaryImport"
}
violations = [f for f in pmd.findings if f.rule in forbidden_pmd_rules]
if violations:
Expand Down
39 changes: 7 additions & 32 deletions CodenameOne/src/com/codename1/ads/InnerActive.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ public class InnerActive extends AdsService { // PMD Fix: UnusedPrivateField rem
private String hid;
private boolean banner = true;

/**
* Empty constructor of the inner active ads service.
*/
public InnerActive() {
}

private static void addParam(ConnectionRequest req, String key, String val) {
if (val != null && val.length() > 0) {
req.addArgument(key, val);
Expand Down Expand Up @@ -157,37 +151,18 @@ public void initService(Ads ads) {
setDuplicateSupported(true);
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof InnerActive)) {
return false;
}
if (!super.equals(o)) {
return false;
}

InnerActive that = (InnerActive) o;

if (po != that.po) {
return false;
}
if (banner != that.banner) {
return false;
}
if (os != null ? !os.equals(that.os) : that.os != null) {
return false;
}
if (hid != null ? !hid.equals(that.hid) : that.hid != null) {
return false;
}

return true;
return super.equals(o) &&
po == that.po &&
banner == that.banner &&
REQUEST_URL.equals(that.REQUEST_URL) &&
(os == null ? that.os == null : os.equals(that.os)) &&
(hid == null ? that.hid == null : hid.equals(that.hid));
}

/**
Expand Down
16 changes: 5 additions & 11 deletions CodenameOne/src/com/codename1/components/RSSReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -485,21 +485,15 @@ public void actionPerformed(ActionEvent ev) {
sourceForm.showBack();
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
if (!(o instanceof BackCommand)) {
return false;
}
return true;
BackCommand that = (BackCommand) o;
return super.equals(o) &&
(sourceForm == null ? that.sourceForm == null :
sourceForm.equals(that.sourceForm));
}

@Override
Expand Down
6 changes: 0 additions & 6 deletions CodenameOne/src/com/codename1/contacts/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ public class Address {
private String postalCode;
private String country;

/**
* Empty Constructor
*/
public Address() {
}

/**
* Gets Address Country
*
Expand Down
6 changes: 0 additions & 6 deletions CodenameOne/src/com/codename1/contacts/Contact.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ public class Contact {

private String[] linkedIds;

/**
* Empty Constructor
*/
public Contact() {
}

/**
* Gets the Contact Addresses, the Hashtable contains key/value pairs where
* the key is a String which represents the type of the Address, types can
Expand Down
31 changes: 8 additions & 23 deletions CodenameOne/src/com/codename1/facebook/FacebookRESTService.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,34 +297,19 @@ public void longToken(long tok) {
public void booleanToken(boolean tok) {
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof FacebookRESTService)) {
return false;
}
if (!super.equals(o)) {
return false;
}

FacebookRESTService that = (FacebookRESTService) o;

if (responseOffset != that.responseOffset) {
return false;
}
if (connectionType != null ? !connectionType.equals(that.connectionType) : that.connectionType != null) {
return false;
}
if (root != null ? !root.equals(that.root) : that.root != null) {
return false;
}

return true;
return super.equals(o) && responseOffset == that.responseOffset &&
entry.equals(that.entry) &&
stack.equals(that.stack) &&
(currentData == null ? that.currentData == null : currentData.equals(that.currentData)) &&
(connectionType == null ? that.connectionType == null : connectionType.equals(that.connectionType)) &&
(responseDestination == null ? that.responseDestination == null : responseDestination.equals(that.responseDestination)) &&
(root == null ? that.root == null : root.equals(that.root));
}

/**
Expand Down
1 change: 0 additions & 1 deletion CodenameOne/src/com/codename1/io/JSONParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,6 @@ public void setStrict(boolean strict) {
@Override
public void startArray(String arrayName) {
java.util.List<Object> currentVector;
Map newOne;
if (modern) {
currentVector = new ArrayList<Object>();
} else {
Expand Down
31 changes: 11 additions & 20 deletions CodenameOne/src/com/codename1/io/MultipartRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -513,31 +513,22 @@ public void setBase64Binaries(boolean base64Binaries) {
this.base64Binaries = base64Binaries;
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof MultipartRequest)) {
return false;
}
if (!super.equals(o)) {
return false;
}

MultipartRequest that = (MultipartRequest) o;

if (boundary != null ? !boundary.equals(that.boundary) : that.boundary != null) {
return false;
}
if (args != null ? !args.equals(that.args) : that.args != null) {
return false;
}

return true;
return super.equals(o) &&
contentLength == that.contentLength &&
manualRedirect == that.manualRedirect &&
base64Binaries == that.base64Binaries &&
(boundary == null ? that.boundary == null : boundary.equals(that.boundary)) &&
(args == null ? that.args == null : args.equals(that.args)) &&
(filenames == null ? that.filenames == null : filenames.equals(that.filenames)) &&
(filesizes == null ? that.filesizes == null : filesizes.equals(that.filesizes)) &&
(mimeTypes == null ? that.mimeTypes == null : mimeTypes.equals(that.mimeTypes)) &&
(ignoreEncoding == null ? that.ignoreEncoding == null : ignoreEncoding.equals(that.ignoreEncoding));
}

/**
Expand Down
1 change: 0 additions & 1 deletion CodenameOne/src/com/codename1/io/Oauth2.java
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ class TokenRequest extends ConnectionRequest {
protected void readResponse(InputStream input) throws IOException {
byte[] tok = Util.readInputStream(input);
String t = StringUtil.newString(tok);
boolean expiresRelative = true;
if (t.startsWith("{")) {
JSONParser p = new JSONParser();
Map map = p.parseJSON(new StringReader(t));
Expand Down
1 change: 0 additions & 1 deletion CodenameOne/src/com/codename1/io/gzip/Deflate.java
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,6 @@ void copyBlock(int buf, // the input data
int len, // its length
boolean header // true if block header must be written
) {
int index = 0;
biWindup(); // align on byte boundary
lastEobLen = 8; // enough lookahead for inflate

Expand Down
19 changes: 2 additions & 17 deletions CodenameOne/src/com/codename1/io/gzip/GZConnectionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,13 @@
public class GZConnectionRequest extends ConnectionRequest {
private boolean isGzipped;

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
if (!(o instanceof GZConnectionRequest)) {
return false;
}

GZConnectionRequest that = (GZConnectionRequest) o;

if (isGzipped != that.isGzipped) {
return false;
}

return true;
return super.equals(o) && isGzipped == that.isGzipped;
}

/**
Expand Down
3 changes: 0 additions & 3 deletions CodenameOne/src/com/codename1/io/gzip/Inflate.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ int inflateInit(int w) {

@SuppressWarnings("PMD.UnnecessaryLocalBeforeReturn")
int inflate(int f) {
int hold = 0;

int r;
int b;

Expand Down Expand Up @@ -622,7 +620,6 @@ int inflateSetDictionary(byte[] dictionary, int dictLength) {
int inflateSync() {
int n; // number of bytes to look at
int p; // pointer to bytes
int m; // number of marker bytes found in a row
long r; // temporaries to save total_in and total_out
long w;

Expand Down
24 changes: 7 additions & 17 deletions CodenameOne/src/com/codename1/io/rest/RequestBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1073,28 +1073,18 @@ public Connection(boolean parseJSON) {
this.parseJSON = parseJSON;
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
if (!(o instanceof Connection)) {
return false;
}

Connection that = (Connection) o;

if (parseJSON != that.parseJSON) {
return false;
}

return true;
return super.equals(o) &&
errorCode == that.errorCode &&
parseJSON == that.parseJSON &&
(json == null ? that.json == null : json.equals(that.json)) &&
(errorHandler == null ? that.errorHandler == null : errorHandler.equals(that.errorHandler)) &&
(errorObject == null ? that.errorObject == null : errorObject.equals(that.errorObject));
}

/**
Expand Down
16 changes: 5 additions & 11 deletions CodenameOne/src/com/codename1/io/services/CachedDataService.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,15 @@ public static void updateData(CachedData d, ActionListener callback) {
NetworkManager.getInstance().addToQueue(c);
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
if (!(o instanceof CachedDataService)) {
return false;
}
return true;
CachedDataService that = (CachedDataService) o;
return super.equals(o) &&
responseProcessed == that.responseProcessed &&
data.equals(that.data);
}

@Override
Expand Down
34 changes: 8 additions & 26 deletions CodenameOne/src/com/codename1/io/services/RSSService.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,37 +90,19 @@ public RSSService(String url, int limit, int startOffset) {
setDuplicateSupported(true);
}

/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
if (!(o instanceof RSSService)) {
return false;
}
if (!super.equals(o)) {
return false;
}

RSSService that = (RSSService) o;

if (limit != that.limit) {
return false;
}
if (startOffset != that.startOffset) {
return false;
}
if (createPlainTextDetails != that.createPlainTextDetails) {
return false;
}
if (iconPlaceholder != null ? !iconPlaceholder.equals(that.iconPlaceholder) : that.iconPlaceholder != null) {
return false;
}

return true;
return super.equals(o) &&
limit == that.limit &&
startOffset == that.startOffset &&
hasMore == that.hasMore &&
createPlainTextDetails == that.createPlainTextDetails &&
(results == null ? that.results == null : results.equals(that.results)) &&
(iconPlaceholder == null ? that.iconPlaceholder == null : iconPlaceholder.equals(that.iconPlaceholder));
}

/**
Expand Down
Loading
Loading