Skip to content

Commit d26c7e1

Browse files
committed
Address SpotBugs warnings about confused inheritance
1 parent 9fce087 commit d26c7e1

24 files changed

+76
-76
lines changed

src/main/java/org/truffleruby/cext/ValueWrapperManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ public static final class ValueWrapperWeakReference extends WeakReference<ValueW
280280
}
281281

282282
public static final class HandleBlockHolder {
283-
protected HandleBlock handleBlock = null;
284-
protected HandleBlock sharedHandleBlock = null;
283+
private HandleBlock handleBlock = null;
284+
private HandleBlock sharedHandleBlock = null;
285285
}
286286

287287
@GenerateUncached

src/main/java/org/truffleruby/core/MarkingService.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ public static interface MarkerAction {
4141

4242
protected static final class ExtensionCallStackEntry {
4343

44-
protected final ExtensionCallStackEntry previous;
45-
protected ValueWrapper preservedObject;
46-
protected ArrayList<ValueWrapper> preservedObjects;
47-
protected final boolean keywordsGiven;
48-
protected Object specialVariables;
49-
protected final Object block;
50-
protected CapturedException capturedException;
51-
protected ValueWrapper markOnExitObject;
52-
protected ArrayList<ValueWrapper> markOnExitObjects;
53-
protected Object[] marks;
54-
protected int marksIndex = 0;
55-
56-
protected ExtensionCallStackEntry(
44+
private final ExtensionCallStackEntry previous;
45+
ValueWrapper preservedObject;
46+
ArrayList<ValueWrapper> preservedObjects;
47+
private final boolean keywordsGiven;
48+
private Object specialVariables;
49+
private final Object block;
50+
private CapturedException capturedException;
51+
private ValueWrapper markOnExitObject;
52+
private ArrayList<ValueWrapper> markOnExitObjects;
53+
private Object[] marks;
54+
private int marksIndex = 0;
55+
56+
private ExtensionCallStackEntry(
5757
ExtensionCallStackEntry previous,
5858
boolean keywordsGiven,
5959
Object specialVariables,
@@ -68,7 +68,7 @@ protected ExtensionCallStackEntry(
6868

6969
public static final class ExtensionCallStack {
7070

71-
protected ExtensionCallStackEntry current;
71+
ExtensionCallStackEntry current;
7272

7373
public ExtensionCallStack(Object specialVariables, Object block) {
7474
current = new ExtensionCallStackEntry(null, false, specialVariables, block);

src/main/java/org/truffleruby/core/array/ArrayBuilderNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
public abstract class ArrayBuilderNode extends RubyBaseNode {
3636

3737
public static final class BuilderState {
38-
protected int capacity;
39-
protected int nextIndex = 0;
40-
protected Object store;
38+
private int capacity;
39+
private int nextIndex = 0;
40+
Object store;
4141

4242
private BuilderState(Object store, int capacity) {
4343
this.capacity = capacity;

src/main/java/org/truffleruby/interop/ProxyForeignObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
@ExportLibrary(ReflectionLibrary.class)
2727
public final class ProxyForeignObject implements TruffleObject {
2828

29-
protected final Object delegate;
30-
protected final Object logger;
29+
final Object delegate;
30+
private final Object logger;
3131

3232
private static final Message EXECUTABLE = Message.resolve(InteropLibrary.class, "execute");
3333
private static final Message INVOKE = Message.resolve(InteropLibrary.class, "invokeMember");

src/main/java/org/truffleruby/language/arguments/SplatToArgsNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public final class SplatToArgsNode extends RubyBaseNode {
2020

21-
@Child protected ArrayStoreLibrary stores;
21+
@Child ArrayStoreLibrary stores;
2222
final IntValueProfile splatSizeProfile = IntValueProfile.create();
2323

2424
public SplatToArgsNode(RubyLanguage language) {

src/main/java/org/truffleruby/language/control/RaiseException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@ExportLibrary(value = InteropLibrary.class, delegateTo = "exception")
2323
public final class RaiseException extends AbstractTruffleException implements RubyThrowable {
2424

25-
protected final RubyException exception;
25+
final RubyException exception;
2626

2727
public RaiseException(RubyContext context, RubyException exception) {
2828
this(context, exception, null);

src/main/java/org/truffleruby/language/globals/ReadMatchReferenceNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static final class ReadNthMatchNode extends RubyContextSourceNode {
2828
@Child private DispatchNode getIndexNode;
2929
private final int index;
3030

31-
protected final ConditionProfile matchNilProfile = ConditionProfile.create();
31+
private final ConditionProfile matchNilProfile = ConditionProfile.create();
3232

3333
public ReadNthMatchNode(RubyNode readMatchNode, int index) {
3434
this.readMatchNode = readMatchNode;
@@ -79,7 +79,7 @@ public static final class SetNamedVariablesMatchNode extends RubyContextSourceNo
7979
@Children private final RubyNode[] setters;
8080
@Children private final RubyNode[] nilSetters;
8181

82-
protected final ConditionProfile matchNilProfile = ConditionProfile.create();
82+
private final ConditionProfile matchNilProfile = ConditionProfile.create();
8383

8484
public SetNamedVariablesMatchNode(
8585
RubyNode matchDataNode,

src/main/java/org/truffleruby/language/objects/DefineClassNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
public final class DefineClassNode extends RubyContextSourceNode {
2626

27-
protected final String name;
27+
private final String name;
2828

2929
@Child private RubyNode superClassNode;
3030
@Child private RubyNode lexicalParentModule;

src/main/java/org/truffleruby/parser/TranslatorEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public final class TranslatorEnvironment {
5757
private final boolean ownScopeForAssignments;
5858
private final boolean isModuleBody;
5959

60-
protected final TranslatorEnvironment parent;
60+
private final TranslatorEnvironment parent;
6161
private final SharedMethodInfo sharedMethodInfo;
6262

6363
public final String modulePath;

src/main/java/org/truffleruby/parser/ast/ArgsParseNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public final class ArgsParseNode extends ParseNode {
6262
* SyntaxError would have resulted. Can change as numbered parameters are encountered. */
6363
private boolean isNumbered = false;
6464

65-
protected final ArgumentParseNode restArgNode;
65+
private final ArgumentParseNode restArgNode;
6666
private final KeywordRestArgParseNode keyRest;
6767
private final BlockArgParseNode blockArgNode;
6868

0 commit comments

Comments
 (0)