File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/main/java/org/truffleruby/parser/ast Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ public abstract class ListParseNode extends ParseNode {
48
48
*
49
49
* @param position where list is
50
50
* @param firstNode first element of the list */
51
+ @ SuppressWarnings ("this-escape" )
51
52
protected ListParseNode (SourceIndexLength position , ParseNode firstNode ) {
52
53
super (position );
53
54
@@ -66,7 +67,7 @@ public NodeType getNodeType() {
66
67
return NodeType .LISTNODE ;
67
68
}
68
69
69
- protected void growList (int mustBeDelta ) {
70
+ private void growList (int mustBeDelta ) {
70
71
int newSize = list .length * 2 ;
71
72
// Fairly arbitrary to scale 1.5 here but this means we are adding a lot so I think
72
73
// we can taper the multiplier
@@ -79,7 +80,7 @@ protected void growList(int mustBeDelta) {
79
80
list = newList ;
80
81
}
81
82
82
- protected void addInternal (ParseNode node ) {
83
+ private void addInternal (ParseNode node ) {
83
84
if (size >= list .length ) {
84
85
growList (1 );
85
86
}
Original file line number Diff line number Diff line change @@ -62,11 +62,11 @@ public ParseNode(SourceIndexLength position) {
62
62
this instanceof RequiredKeywordArgumentValueParseNode : this .getClass ();
63
63
}
64
64
65
- public void setNewline () {
65
+ public final void setNewline () {
66
66
this .newline = true ;
67
67
}
68
68
69
- public boolean isNewline () {
69
+ public final boolean isNewline () {
70
70
return newline ;
71
71
}
72
72
@@ -79,7 +79,7 @@ public final SourceIndexLength getPosition() {
79
79
return new SourceIndexLength (sourceCharIndex , sourceLength );
80
80
}
81
81
82
- public void extendPosition (ParseNode node ) {
82
+ public final void extendPosition (ParseNode node ) {
83
83
if (this .hasPosition () && node .hasPosition ()) {
84
84
int begin = Math .min (this .sourceCharIndex , node .sourceCharIndex );
85
85
int end = Math .max (this .sourceCharIndex + this .sourceLength , node .sourceCharIndex + node .sourceLength );
@@ -88,7 +88,7 @@ public void extendPosition(ParseNode node) {
88
88
}
89
89
}
90
90
91
- public void extendPosition (SourceIndexLength pos ) {
91
+ public final void extendPosition (SourceIndexLength pos ) {
92
92
if (this .hasPosition () && pos .isAvailable ()) {
93
93
int begin = Math .min (this .sourceCharIndex , pos .getCharIndex ());
94
94
int end = Math .max (this .sourceCharIndex + this .sourceLength , pos .getCharEnd ());
You can’t perform that action at this time.
0 commit comments