Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primitives should not be boxed just for "String" conversion #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected void renderCellBackground(Graphics g, int xCell, int yCell) {
} else {
int nScore = onScoreboard(xCell, yCell);
if(nScore >= 0) {
CommonGraphics.fillWithString(g, "" + nScore, 1.2);
CommonGraphics.fillWithString(g, String.valueOf(nScore), 1.2);
} else if(nScore == -2) {
CommonGraphics.fillWithString(g, "T", 1.2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void renderCellContent(Graphics g, String theFact) {
g.setColor(Color.BLACK);
}

CommonGraphics.fillWithString(g, "" + cellValue, 1.2);
CommonGraphics.fillWithString(g, String.valueOf(cellValue), 1.2);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/ggp/base/apps/kiosk/games/FFACanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void renderCellContent(Graphics g, Set<String> theFacts) {
}

g.setColor(myColor);
CommonGraphics.fillWithString(g, "" + score, 1.5);
CommonGraphics.fillWithString(g, String.valueOf(score), 1.5);
} else {
String cellType = cellFacts[4];
if(!cellType.equals("b")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ protected final void renderCellBackground(Graphics g, int xCell, int yCell) {

// This function only works properly when coordinates start at one.
public final static String coordinateToLetter(int x) {
return "" + ((char) ('a' + x - 1));
return String.valueOf((char) ('a' + x - 1));
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/ggp/base/apps/research/Counter.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public double getValue() {

@Override
public String toString() {
return "" + ((int)(getValue() * 1000.0)/1000.0);
return String.valueOf((int)(getValue() * 1000.0)/1000.0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public double getWeight() {

@Override
public String toString() {
return "" + ((int)(getValue() * 1000.0)/1000.0) + " [" + getWeight() + "]";
return String.valueOf((int)(getValue() * 1000.0)/1000.0) + " [" + getWeight() + "]";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public void observe(Event event) {
boolean atEnd = (tabs.getSelectedIndex() == tabs.getTabCount()-1);

for(int i = tabs.getTabCount(); i < stepNum; i++)
tabs.add(new Integer(i+1).toString(), new JPanel());
tabs.add(String.valueOf(i+1), new JPanel());
tabs.setComponentAt(stepNum-1, statePanel);
tabs.setTitleAt(stepNum-1, new Integer(stepNum).toString());
tabs.setTitleAt(stepNum-1, String.valueOf(stepNum));

if(atEnd) {
tabs.setSelectedIndex(tabs.getTabCount()-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ public void render() {
boolean atEnd = (tabs.getSelectedIndex() == tabs.getTabCount()-1);
try {
for(int i = tabs.getTabCount(); i < stepNum; i++)
tabs.add(new Integer(i+1).toString(), new JPanel());
tabs.add(String.valueOf(i+1), new JPanel());
tabs.setComponentAt(stepNum-1, newPanel);
tabs.setTitleAt(stepNum-1, new Integer(stepNum).toString());
tabs.setTitleAt(stepNum-1, String.valueOf(stepNum));

if(atEnd) {
tabs.setSelectedIndex(tabs.getTabCount()-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public ClientManager(Thread parentThread) {
processArgs.add(System.getProperty("java.class.path"));
processArgs.add("org.ggp.base.player.proxy.ProxyGamePlayerClient");
processArgs.add(gamerName);
processArgs.add("" + clientListener.getLocalPort());
processArgs.add(String.valueOf(clientListener.getLocalPort()));
if(GamerConfiguration.runningOnLinux()) {
processArgs.add(0, "nice");
}
Expand Down