Skip to content
Snippets Groups Projects
Commit 2156a1cc authored by dgelessus's avatar dgelessus
Browse files

Remove uses of deprecated boxed primitive constructors

parent 1ab81f06
Branches
Tags
No related merge requests found
......@@ -315,20 +315,19 @@ public class ConstructNFA extends DepthFirstAdapter
@Override
public void outACharChar(ACharChar node)
{
setOut(node, new Character(node.getChar().getText().charAt(1)));
setOut(node, node.getChar().getText().charAt(1));
}
@Override
public void outADecChar(ADecChar node)
{
setOut(node, new Character((char) Integer.parseInt(node.getDecChar().getText())));
setOut(node, (char)Integer.parseInt(node.getDecChar().getText()));
}
@Override
public void outAHexChar(AHexChar node)
{
setOut(node, new Character((char)
Integer.parseInt(node.getHexChar().getText().substring(2), 16)));
setOut(node, (char)Integer.parseInt(node.getHexChar().getText().substring(2), 16));
}
@Override
......@@ -338,7 +337,7 @@ public class ConstructNFA extends DepthFirstAdapter
{
CharSet cs1 = (CharSet) getOut(node.getLeft());
CharSet cs2 = (CharSet) getOut(node.getRight());
char binop = ((Character) getOut(node.getBinOp())).charValue();
char binop = (Character) getOut(node.getBinOp());
switch(binop)
{
......@@ -391,31 +390,31 @@ public class ConstructNFA extends DepthFirstAdapter
@Override
public void outAStarUnOp(AStarUnOp node)
{
setOut(node, new Character('*'));
setOut(node, '*');
}
@Override
public void outAQMarkUnOp(AQMarkUnOp node)
{
setOut(node, new Character('?'));
setOut(node, '?');
}
@Override
public void outAPlusUnOp(APlusUnOp node)
{
setOut(node, new Character('+'));
setOut(node, '+');
}
@Override
public void outAPlusBinOp(APlusBinOp node)
{
setOut(node, new Character('+'));
setOut(node, '+');
}
@Override
public void outAMinusBinOp(AMinusBinOp node)
{
setOut(node, new Character('-'));
setOut(node, '-');
}
@Override
......
......@@ -141,7 +141,7 @@ public class DFA
State state = new State(initial);
states.addElement(state);
finder.put(state.nfaStates, new Integer(0));
finder.put(state.nfaStates, 0);
int i = -1;
while(++i < states.size())
......@@ -228,7 +228,7 @@ public class DFA
{
State s = new State(destination);
states.addElement(s);
finder.put(s.nfaStates, new Integer(states.size() - 1));
finder.put(s.nfaStates, states.size() - 1);
state.transitions.addElement(
new Transition((CharSet.Interval) interval.clone(), states.size() - 1));
......
......@@ -293,7 +293,7 @@ public class GenLexer extends AnalysisAdapter
DFA.State state = (DFA.State) dfa.states.elementAt(j);
file.write(state.accept + ", ");
innerArray.addElement(new Integer(state.accept));
innerArray.addElement(state.accept);
}
file.write("}," + System.getProperty("line.separator"));
......
......@@ -681,8 +681,8 @@ public class GenParser extends DepthFirstAdapter
{
table.append("\t\t\t\"" + s + "\"," + System.getProperty("line.separator"));
outerArray.addElement(s.toString());
errorIndex.put(s.toString(), new Integer(nextIndex));
indexArray.addElement(new Integer(nextIndex));
errorIndex.put(s.toString(), nextIndex);
indexArray.addElement(nextIndex);
index.append(nextIndex++ + ", ");
}
}
......
......@@ -125,27 +125,27 @@ public class InternalTransformationsToGrammar extends DepthFirstAdapter
@Override
public void inAElem(AElem node)
{
InternalTransformationsToGrammar.this.setOut(node, new Integer(NONE));
InternalTransformationsToGrammar.this.setOut(node, NONE);
}
@Override
public void caseAStarUnOp(AStarUnOp node)
{
count *= 2;
InternalTransformationsToGrammar.this.setOut(node.parent(), new Integer(STAR));
InternalTransformationsToGrammar.this.setOut(node.parent(), STAR);
}
@Override
public void caseAQMarkUnOp(AQMarkUnOp node)
{
count *= 2;
InternalTransformationsToGrammar.this.setOut(node.parent(), new Integer(QMARK));
InternalTransformationsToGrammar.this.setOut(node.parent(), QMARK);
}
@Override
public void caseAPlusUnOp(APlusUnOp node)
{
InternalTransformationsToGrammar.this.setOut(node.parent(), new Integer(PLUS));
InternalTransformationsToGrammar.this.setOut(node.parent(), PLUS);
}
}
);
......
......@@ -48,7 +48,7 @@ final class LR0Collection
if(result == null)
{
result = new Integer(sets.size());
result = sets.size();
setIndices.put(set
, result);
......@@ -79,8 +79,7 @@ final class LR0Collection
{
if(!to.equals(empty))
{
((TreeMap) GOTO.elementAt(from)).put(symbol, new Integer(add
(to, from, symbol)));
((TreeMap) GOTO.elementAt(from)).put(symbol, add(to, from, symbol));
}
}
......
......@@ -133,7 +133,7 @@ final class SymbolSet implements Cloneable
@Override
public int hashCode()
{
return terminals.hashCode() + nonterminals.hashCode() + new Boolean(empty).hashCode();
return terminals.hashCode() + nonterminals.hashCode() + Boolean.valueOf(empty).hashCode();
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment