Replaced deprecated Interger constuctors with Integer.valueOf

This commit is contained in:
Andras Fuchs 2020-01-25 11:46:32 +01:00
parent 033f985ead
commit 7f6bf0895d
21 changed files with 29 additions and 29 deletions

View File

@ -118,7 +118,7 @@ public class BatchOptRoute
{
java.util.ResourceBundle resources =
java.util.ResourceBundle.getBundle("eu.mihosoft.freerouting.interactive.InteractiveState", this.thread.hdlg.get_locale());
String start_message = resources.getString("batch_optimizer") + " " + resources.getString("stop_message") + " " + resources.getString("pass") + " " + (new Integer(p_pass_no)).toString() + ": ";
String start_message = resources.getString("batch_optimizer") + " " + resources.getString("stop_message") + " " + resources.getString("pass") + " " + (Integer.valueOf(p_pass_no)).toString() + ": ";
this.thread.hdlg.screen_messages.set_status_message(start_message);
this.thread.hdlg.remove_ratsnest();
int incomplete_count_before = this.thread.hdlg.get_ratsnest().incomplete_count();

View File

@ -1310,7 +1310,7 @@ public class BasicBoard implements java.io.Serializable
{
for (int i = 0; i < curr_item.net_count(); ++i)
{
p_changed_nets.add(new Integer(curr_item.get_net_no(i)));
p_changed_nets.add(Integer.valueOf(curr_item.get_net_no(i)));
}
}
}
@ -1327,7 +1327,7 @@ public class BasicBoard implements java.io.Serializable
{
for (int i = 0; i < curr_item.net_count(); ++i)
{
p_changed_nets.add(new Integer(curr_item.get_net_no(i)));
p_changed_nets.add(Integer.valueOf(curr_item.get_net_no(i)));
}
}
}

View File

@ -68,7 +68,7 @@ public class Components implements java.io.Serializable
*/
public Component add(Point p_location, double p_rotation, boolean p_on_front, Package p_package)
{
String component_name = "Component#" + (new Integer(component_arr.size() + 1)).toString();
String component_name = "Component#" + (Integer.valueOf(component_arr.size() + 1)).toString();
return add(component_name, p_location, p_rotation, p_on_front, p_package, p_package, false);
}

View File

@ -115,7 +115,7 @@ public class Component extends ScopeKeyword
p_par.file.write(" back ");
}
int rotation = (int) Math.round(p_component.get_rotation_in_degree());
p_par.file.write((new Integer(rotation).toString()));
p_par.file.write((Integer.valueOf(rotation).toString()));
}
if (p_component.position_fixed)
{

View File

@ -194,7 +194,7 @@ public class Package
if (rotation != 0)
{
p_par.file.write("(rotate ");
p_par.file.write((new Integer(rotation)).toString());
p_par.file.write((Integer.valueOf(rotation)).toString());
p_par.file.write(")");
}
p_par.file.write(")");

View File

@ -107,7 +107,7 @@ public class Polygon extends Shape
p_file.write("polygon ");
p_identifier_type.write(this.layer.name, p_file);
p_file.write(" ");
p_file.write((new Integer(0)).toString());
p_file.write((Integer.valueOf(0)).toString());
int corner_count = coor.length/ 2;
for (int i = 0; i < corner_count; ++i)
{
@ -125,7 +125,7 @@ public class Polygon extends Shape
p_file.write("polygon ");
p_identifier_type.write(this.layer.name, p_file);
p_file.write(" ");
p_file.write((new Integer(0)).toString());
p_file.write((Integer.valueOf(0)).toString());
int corner_count = coor.length/ 2;
for (int i = 0; i < corner_count; ++i)
{

View File

@ -84,7 +84,7 @@ public class Resolution extends ScopeKeyword
p_file.write("(resolution ");
p_file.write(p_board_communication.unit.toString());
p_file.write(" ");
p_file.write((new Integer(p_board_communication.resolution)).toString());
p_file.write((Integer.valueOf(p_board_communication.resolution)).toString());
p_file.write(")");
}

View File

@ -185,7 +185,7 @@ public class SessionFile
p_file.write(" back ");
}
int rotation = (int) Math.round(p_component.get_rotation_in_degree());
p_file.write((new Integer(rotation).toString()));
p_file.write((Integer.valueOf(rotation).toString()));
if (p_component.position_fixed)
{
p_file.new_line();
@ -470,14 +470,14 @@ public class SessionFile
p_file.write("path ");
p_identifier_type.write(p_layer_name, p_file);
p_file.write(" ");
p_file.write((new Integer(p_width)).toString());
p_file.write((Integer.valueOf(p_width)).toString());
int corner_count = p_coors.length/ 2;
for (int i = 0; i < corner_count; ++i)
{
p_file.new_line();
p_file.write(new Integer(p_coors[2 * i]).toString());
p_file.write(Integer.valueOf(p_coors[2 * i]).toString());
p_file.write(" ");
p_file.write(new Integer(p_coors[2 * i + 1]).toString());
p_file.write(Integer.valueOf(p_coors[2 * i + 1]).toString());
}
p_file.end_scope();
}

View File

@ -1424,7 +1424,7 @@ class SpecctraFileScanner implements Scanner {
}
case 235: break;
case 5:
{ return new Integer(yytext());
{ return Integer.valueOf(yytext());
}
case 236: break;
case 25:

View File

@ -1656,7 +1656,7 @@ class GUIDefaultsScanner {
}
case 165: break;
case 4:
{ return new Integer(yytext());
{ return Integer.valueOf(yytext());
}
case 166: break;
case 13:

View File

@ -154,7 +154,7 @@ public class WindowSnapshot extends BoardSavableSubWindow
this.snapshot_count = saved_attributes.snapshot_count;
this.list_model = saved_attributes.list_model;
this.list.setModel(this.list_model);
String next_default_name = "snapshot " + (new Integer(snapshot_count + 1)).toString();
String next_default_name = "snapshot " + (Integer.valueOf(snapshot_count + 1)).toString();
this.name_field.setText(next_default_name);
this.setLocation(saved_attributes.location);
this.setVisible(saved_attributes.is_visible);
@ -251,7 +251,7 @@ public class WindowSnapshot extends BoardSavableSubWindow
{
++snapshot_count;
list_model.addElement(new_snapshot);
String next_default_name = resources.getString("snapshot") + " " + (new Integer(snapshot_count + 1)).toString();
String next_default_name = resources.getString("snapshot") + " " + (Integer.valueOf(snapshot_count + 1)).toString();
name_field.setText(next_default_name);
}
}

View File

@ -434,7 +434,7 @@ public class BoardHandling extends BoardHandlingImpl
if (clearance_violations == null)
{
clearance_violations = new ClearanceViolations(this.board.get_items());
Integer violation_count = new Integer((clearance_violations.list.size() + 1) / 2);
Integer violation_count = Integer.valueOf((clearance_violations.list.size() + 1) / 2);
String curr_message = violation_count.toString() + " " + resources.getString("clearance_violations_found");
screen_messages.set_status_message(curr_message);
}

View File

@ -181,7 +181,7 @@ public class CopyItemState extends InteractiveState
{
//This item belongs to a component
int new_cmp_no;
Integer curr_key = new Integer(curr_cmp_no);
Integer curr_key = Integer.valueOf(curr_cmp_no);
if (cmp_no_pairs.containsKey(curr_key))
{
// the new component for this pin is already created
@ -225,7 +225,7 @@ public class CopyItemState extends InteractiveState
old_component.placed_on_front(), new_package);
copied_components.add(new_component);
new_cmp_no = new_component.no;
cmp_no_pairs.put(new Integer(curr_cmp_no), new Integer(new_cmp_no));
cmp_no_pairs.put(Integer.valueOf(curr_cmp_no), Integer.valueOf(new_cmp_no));
}
curr_item.assign_component_no(new_cmp_no);
}

View File

@ -170,7 +170,7 @@ public class DragItemState extends DragState
Item curr_moved_item = it.next();
for (int i = 0; i < curr_moved_item.net_count(); ++i)
{
changed_nets.add(new Integer(curr_moved_item.get_net_no(i)));
changed_nets.add(Integer.valueOf(curr_moved_item.get_net_no(i)));
}
}
for (Integer curr_net_no : changed_nets)

View File

@ -203,7 +203,7 @@ public class Logfile
{
try
{
this.file_writer.write((new Integer(p_int)).toString());
this.file_writer.write((Integer.valueOf(p_int)).toString());
this.file_writer.write("\n");
}
catch (IOException e2)

View File

@ -510,7 +510,7 @@ class LogfileScanner {
}
case 6: break;
case 4:
{ return new Integer(yytext());
{ return Integer.valueOf(yytext());
}
case 7: break;
case 2:

View File

@ -98,7 +98,7 @@ public class ScreenMessages
public void set_batch_fanout_info(int p_pass_no, int p_components_to_go)
{
Integer components_to_go = p_components_to_go;
Integer pass_no = new Integer(p_pass_no);
Integer pass_no = Integer.valueOf(p_pass_no);
add_field.setText(resources.getString("fanout_pass") + " " + pass_no.toString() + ": ");
layer_field.setText(resources.getString("still") + " "
+ components_to_go.toString() + " " + resources.getString("components"));

View File

@ -304,7 +304,7 @@ public class SelectedItemState extends InteractiveState
{
Via curr_via = (Via) it.next();
Vector rel_coor = curr_via.get_center().difference_by(gravity_point);
String pin_name = (new Integer(i + 1)).toString();
String pin_name = (Integer.valueOf(i + 1)).toString();
pin_arr[i] = new Package.Pin(pin_name, curr_via.get_padstack().no, rel_coor, 0);
}
Package new_package = board.library.packages.add(pin_arr);
@ -873,7 +873,7 @@ public class SelectedItemState extends InteractiveState
if (clearance_violations == null)
{
clearance_violations = new ClearanceViolations(this.item_list);
Integer violation_count = new Integer(clearance_violations.list.size());
Integer violation_count = Integer.valueOf(clearance_violations.list.size());
String curr_message = violation_count.toString() + " " + resources.getString("clearance_violations_found");
hdlg.screen_messages.set_status_message(curr_message);
}

View File

@ -109,7 +109,7 @@ public class Packages implements java.io.Serializable
*/
public Package add(Package.Pin [] p_pin_arr)
{
String package_name = "Package#" + (new Integer(package_arr.size() + 1)).toString();
String package_name = "Package#" + (Integer.valueOf(package_arr.size() + 1)).toString();
return add(package_name, p_pin_arr, null, new Package.Keepout [0], new Package.Keepout [0],
new Package.Keepout [0], true);

View File

@ -108,7 +108,7 @@ public class Padstacks implements java.io.Serializable
*/
public Padstack add(ConvexShape [] p_shapes)
{
String new_name = "padstack#" + (new Integer(padstack_arr.size() + 1).toString());
String new_name = "padstack#" + (Integer.valueOf(padstack_arr.size() + 1).toString());
return add(new_name, p_shapes, false, false);
}

View File

@ -102,7 +102,7 @@ public class Nets implements java.io.Serializable
public Net new_net(java.util.Locale p_locale)
{
java.util.ResourceBundle resources = java.util.ResourceBundle.getBundle("eu.mihosoft.freerouting.rules.Default", p_locale);
String net_name = resources.getString("net#") + (new Integer(net_arr.size() + 1)).toString();
String net_name = resources.getString("net#") + (Integer.valueOf(net_arr.size() + 1)).toString();
return add(net_name, 1, false);
}