Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SableCC STUPS
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
SableCC STUPS
Commits
78de827b
Commit
78de827b
authored
3 years ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Fix unchecked/rawtypes warnings in Node where possible
parent
d865567c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/sablecc/sablecc/node/Node.java
+5
-5
5 additions, 5 deletions
src/main/java/org/sablecc/sablecc/node/Node.java
src/main/resources/org/sablecc/sablecc/utils.txt
+5
-5
5 additions, 5 deletions
src/main/resources/org/sablecc/sablecc/utils.txt
with
10 additions
and
10 deletions
src/main/java/org/sablecc/sablecc/node/Node.java
+
5
−
5
View file @
78de827b
...
@@ -5,7 +5,6 @@ package org.sablecc.sablecc.node;
...
@@ -5,7 +5,6 @@ package org.sablecc.sablecc.node;
import
java.util.*
;
import
java.util.*
;
import
de.hhu.stups.sablecc.patch.PositionedNode
;
import
de.hhu.stups.sablecc.patch.PositionedNode
;
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
public
abstract
class
Node
extends
PositionedNode
implements
Switchable
,
Cloneable
public
abstract
class
Node
extends
PositionedNode
implements
Switchable
,
Cloneable
{
{
private
Node
parent
;
private
Node
parent
;
...
@@ -52,19 +51,19 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
...
@@ -52,19 +51,19 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return
""
;
return
""
;
}
}
protected
String
toString
(
List
list
)
protected
String
toString
(
List
<?>
list
)
{
{
StringBuffer
s
=
new
StringBuffer
();
StringBuffer
s
=
new
StringBuffer
();
for
(
Iterator
i
=
list
.
iterator
();
i
.
hasNext
();
)
for
(
Object
o
:
list
)
{
{
s
.
append
(
i
.
next
()
);
s
.
append
(
o
);
}
}
return
s
.
toString
();
return
s
.
toString
();
}
}
@SuppressWarnings
(
"unchecked"
)
protected
<
T
extends
Node
>
T
cloneNode
(
T
node
)
protected
<
T
extends
Node
>
T
cloneNode
(
T
node
)
{
{
if
(
node
!=
null
)
if
(
node
!=
null
)
...
@@ -75,6 +74,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
...
@@ -75,6 +74,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return
null
;
return
null
;
}
}
@SuppressWarnings
(
"unchecked"
)
protected
<
T
extends
Node
>
List
<
T
>
cloneList
(
List
<
T
>
list
)
protected
<
T
extends
Node
>
List
<
T
>
cloneList
(
List
<
T
>
list
)
{
{
List
<
T
>
clone
=
new
LinkedList
<
T
>();
List
<
T
>
clone
=
new
LinkedList
<
T
>();
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/org/sablecc/sablecc/utils.txt
+
5
−
5
View file @
78de827b
...
@@ -326,7 +326,6 @@ package $0$;
...
@@ -326,7 +326,6 @@ package $0$;
import java.util.*;
import java.util.*;
import de.hhu.stups.sablecc.patch.PositionedNode;
import de.hhu.stups.sablecc.patch.PositionedNode;
@SuppressWarnings({"rawtypes","unchecked"})
public abstract class Node extends PositionedNode implements Switchable, Cloneable
public abstract class Node extends PositionedNode implements Switchable, Cloneable
{
{
private Node parent;
private Node parent;
...
@@ -373,19 +372,19 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
...
@@ -373,19 +372,19 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return "";
return "";
}
}
protected String toString(List list)
protected String toString(List
<?>
list)
{
{
StringBuffer s = new StringBuffer();
StringBuffer s = new StringBuffer();
for(
Iterator i = list.iterator(); i.hasNext();
)
for(
Object o : list
)
{
{
s.append(
i.next()
);
s.append(
o
);
}
}
return s.toString();
return s.toString();
}
}
@SuppressWarnings("unchecked")
protected <T extends Node> T cloneNode(T node)
protected <T extends Node> T cloneNode(T node)
{
{
if(node != null)
if(node != null)
...
@@ -396,6 +395,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
...
@@ -396,6 +395,7 @@ public abstract class Node extends PositionedNode implements Switchable, Cloneab
return null;
return null;
}
}
@SuppressWarnings("unchecked")
protected <T extends Node> List<T> cloneList(List<T> list)
protected <T extends Node> List<T> cloneList(List<T> list)
{
{
List<T> clone = new LinkedList<T>();
List<T> clone = new LinkedList<T>();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment