Skip to content

Commit

Permalink
Remove a bunch of Integer boxing (thanks, #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
erinzm committed Aug 21, 2015
1 parent 9fb54f8 commit 7ac2b82
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/j3d/loaders/stl/STLASCIIParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private boolean parse( final BufferedReader reader )
}
// watch order of if: solid contained also in endsolid
else if( line.indexOf( "endsolid" ) >= 0 ) {
facetsPerObject.add( new Integer( numOfFacets ) );
facetsPerObject.add(numOfFacets);
numOfFacets = 0;
numOfObjects ++;
} else if( line.indexOf( "solid" ) >= 0 ) {
Expand Down Expand Up @@ -279,4 +279,4 @@ private void skipObjectName( final StreamTokenizer tokenizer )
}
itsTokenizer.eolIsSignificant( false );
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/replicatorg/app/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -2822,7 +2822,7 @@ protected void checkModified(int checkModifiedMode) {
// option
// away from the others at the lefthand side
pane.putClientProperty("Quaqua.OptionPane.destructiveOption",
new Integer(2));
2);

JDialog dialog = pane.createDialog(this, null);
dialog.setVisible(true);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/replicatorg/app/ui/PreferencesWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void propertyChange(PropertyChangeEvent evt) {
content.add(sfTimeoutLabel,"split, gap unrelated");
int value = Base.preferences.getInt("replicatorg.skeinforge.timeout", -1);
JFormattedTextField sfTimeoutField = new JFormattedTextField(Base.getLocalFormat());
sfTimeoutField.setValue(new Integer(value));
sfTimeoutField.setValue(value);
content.add(sfTimeoutField,"wrap 10px, growx");
String sfTimeoutHelp = "<html><small><em>" +
"The Skeinforge timeout is the number of seconds that replicatorg will wait while the<br>" +
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/replicatorg/app/ui/RealtimePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public RealtimePanel(MachineInterface machine2) {
feedrateControl = new ControlSlider("Feedrate","%",5,800,100,speedPanel);
//feedrateControl.getSlider().setMajorTickSpacing(10);
Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();
labelTable.put( new Integer( 10 ), new JLabel("Slow") );
labelTable.put( new Integer( 100 ), new JLabel("") );
labelTable.put( new Integer( 300 ), new JLabel("Fast") );
labelTable.put( new Integer( 500 ), new JLabel("Insane!") );
labelTable.put(10, new JLabel("Slow") );
labelTable.put(100, new JLabel("") );
labelTable.put(300, new JLabel("Fast") );
labelTable.put(500, new JLabel("Insane!") );
feedrateControl.slider.setLabelTable( labelTable );

// add(new JLabel("Travel feedrate (no extrusion"),"growx,wrap");
// add(new JLabel("Travel feedrate (no extrusion"),"growx,wrap");
travelFeedrateControl = new ControlSlider("Travel feedrate","%",5,800,100,speedPanel);
travelFeedrateControl.slider.setLabelTable( labelTable );

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/replicatorg/app/ui/ToolheadIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ToolheadIndexer(Frame parent, final Driver d) {

final JFormattedTextField toolIndexField = new JFormattedTextField(NumberFormat.getIntegerInstance());
toolIndexField.setColumns(4);
toolIndexField.setValue(new Integer(0));
toolIndexField.setValue(0);
c.add(toolIndexField);
JButton cancelButton = new JButton("Cancel");
cancelButton.addActionListener(new ActionListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ private static final JFormattedTextField PositiveTextFieldInt(NumberFormat nf, S
Object fmtr = textField.getFormatter();
if (fmtr instanceof InternationalFormatter) {
InternationalFormatter ifr = (InternationalFormatter)fmtr;
ifr.setMinimum(new Integer(0));
ifr.setMinimum(0);
}
if (tip != null) textField.setToolTipText(wrap2HTML(defaultToolTipWidth, tip));
return textField;
Expand All @@ -615,8 +615,8 @@ private static final JFormattedTextField PositiveTextFieldInt(NumberFormat nf, i
Object fmtr = textField.getFormatter();
if (fmtr instanceof InternationalFormatter) {
InternationalFormatter ifr = (InternationalFormatter)fmtr;
ifr.setMinimum(new Integer(0));
ifr.setMaximum(new Integer(max));
ifr.setMinimum(0);
ifr.setMaximum(max);
}
if (tip != null) textField.setToolTipText(wrap2HTML(defaultToolTipWidth, tip, max));
return textField;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/replicatorg/drivers/gen3/MightyBoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ private void getStepperValues() {
int vRef = getStoredStepperVoltage(i);
Base.logger.fine("Caching inital Stepper vRef from bot");
Base.logger.finer("Stepper i = " + i + " vRef =" + vRef);
stepperValues.put(new Integer(i), new Integer(vRef) );
stepperValues.put(i, vRef);
}
}

Expand Down Expand Up @@ -411,7 +411,7 @@ public void setStepperVoltage(int stepperId, int referenceValue) throws RetryExc
PacketResponse pr = runCommand(pb.getPacket());

if( pr.isOK() ) {
stepperValues.put(new Integer(stepperId), new Integer(referenceValue));
stepperValues.put(stepperId, referenceValue);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public List<Integer> toolheadsWithStoredData() {
Vector<ToolModel> tools = this.getMachine().getTools();
Vector<Integer> toolsList = new Vector<Integer>();
for( ToolModel t : tools ) {
toolsList.add(new Integer(t.getIndex()));
toolsList.add(t.getIndex());
}
return toolsList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ else if( currentSlicer.startsWith("Miracle"))
newMessage = doSkeinforge33Update(newMessage);

if(showProgress) {
String j = new Integer(layerTotal).toString();
String j = Integer.toString(layerTotal);
double completion = ((double) layerIndex/layerTotal);
if((layerIndex>0) && (processName == "")) {
newMessage += " ("+j+" layers)";//
Expand Down

0 comments on commit 7ac2b82

Please sign in to comment.