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