Skip to content

Commit 41f61c8

Browse files
authored
Fix SpotBugs unused/null field warnings (#4411)
1 parent 070019e commit 41f61c8

File tree

14 files changed

+21
-25
lines changed

14 files changed

+21
-25
lines changed

.github/scripts/generate-quality-report.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,8 @@ def main() -> None:
821821
"UI_INHERITANCE_UNSAFE_GETRESOURCE",
822822
"URF_UNREAD_FIELD",
823823
"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD",
824+
"UUF_UNUSED_FIELD",
825+
"UWF_NULL_FIELD",
824826
"UW_UNCOND_WAIT",
825827
"SIC_INNER_SHOULD_BE_STATIC_ANON",
826828
"SS_SHOULD_BE_STATIC",

CodenameOne/src/com/codename1/charts/compat/Paint.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
* @deprecated
3737
*/
3838
public class Paint { // PMD Fix: UnusedPrivateField removed redundant antiAlias flag
39-
40-
41-
static Graphics g;
4239
private Font typeface = Font.createSystemFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_SMALL);
4340
private int strokeCap = Cap.BUTT;
4441
private int strokeJoin = Join.BEVEL;

CodenameOne/src/com/codename1/charts/views/BarChart.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,4 @@ public enum Type {
380380
DEFAULT, STACKED, HEAPED
381381
}
382382

383-
private static class Point {
384-
int seriesIndex;
385-
float yval;
386-
}
387-
}
383+
}

CodenameOne/src/com/codename1/components/ToastBar.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ public void actionPerformed(NetworkEvent evt) {
270270
};
271271
NetworkManager.getInstance().addErrorListener(errorListener);
272272
progListener[0] = new ActionListener<NetworkEvent>() {
273-
private int soFar;
274-
275273
public void actionPerformed(NetworkEvent evt) {
276274
switch (evt.getProgressType()) {
277275
case NetworkEvent.PROGRESS_TYPE_INITIALIZING:

CodenameOne/src/com/codename1/io/services/RSSService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ private XMLParser getXmlParser() {
208208
XMLParser p = new XMLParser() {
209209
private String lastTag;
210210
private Hashtable current;
211-
private String url;
212211

213212
protected boolean startTag(String tag) {
214213
if ("item".equalsIgnoreCase(tag) || "entry".equalsIgnoreCase(tag)) {

CodenameOne/src/com/codename1/social/FacebookConnect.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ public class FacebookConnect extends Login {
4949
private static final Object INSTANCE_LOCK = new Object();
5050
private final String[] permissions = new String[]{"public_profile", "email", "user_friends"};
5151

52-
static {
53-
implClass = null;
54-
}
55-
5652
FacebookConnect() {
5753
setOauth2URL("https://www.facebook.com/dialog/oauth");
5854
}
@@ -82,6 +78,10 @@ public static FacebookConnect getInstance() {
8278
}
8379
}
8480

81+
static void setImplClass(Class<?> implClass) {
82+
FacebookConnect.implClass = implClass;
83+
}
84+
8585
/**
8686
* Indicates whether the native platform supports native facebook login
8787
*

CodenameOne/src/com/codename1/social/GoogleConnect.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,11 @@
4545
*/
4646
public class GoogleConnect extends Login {
4747

48-
static Class implClass;
48+
static Class<?> implClass;
4949
private static final String tokenURL = "https://www.googleapis.com/oauth2/v3/token";
5050
private static GoogleConnect instance;
5151
private static final Object INSTANCE_LOCK = new Object();
5252

53-
static {
54-
implClass = null;
55-
}
5653

5754
GoogleConnect() {
5855
setOauth2URL("https://accounts.google.com/o/oauth2/auth");
@@ -82,6 +79,10 @@ public static GoogleConnect getInstance() {
8279
}
8380
}
8481

82+
static void setImplClass(Class<?> implClass) {
83+
GoogleConnect.implClass = implClass;
84+
}
85+
8586
@Override
8687
public boolean isNativeLoginSupported() {
8788
return false;

CodenameOne/src/com/codename1/ui/BrowserComponent.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ public class BrowserComponent extends Container {
138138
private Vector<BrowserNavigationCallback> browserNavigationCallbacks;
139139
private Hashtable<Integer, SuccessCallback<JSRef>> returnValueCallbacks;
140140
private int nextReturnValueCallbackId = 0;
141-
private JSONParser returnValueParser;
142141
private final Container placeholder = new Container();
143142
private final LinkedList<Runnable> onReady = new LinkedList<Runnable>();
144143
private String tmpUrl;

CodenameOne/src/com/codename1/ui/Command.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public class Command implements ActionListener<ActionEvent> {
4040
private boolean disposesDialog = true;
4141
private Image icon;
4242
private char materialIcon;
43-
private char fontIcon;
4443
private Font iconFont;
4544
private Image pressedIcon;
4645
private Image rolloverIcon;

CodenameOne/src/com/codename1/ui/Container.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4254,7 +4254,6 @@ static class MorphAnimation extends ComponentAnimation {
42544254
boolean dontRevalidate;
42554255
private final long startTime;
42564256
private int duration;
4257-
private Transition t;
42584257
private final Container thisContainer;
42594258
private boolean finished = false;
42604259
private final Motion[][] motions;

0 commit comments

Comments
 (0)