Skip to content

Commit

Permalink
fix: don't use deprecated way to convert string to Integer/Double
Browse files Browse the repository at this point in the history
  • Loading branch information
stempler committed Dec 4, 2024
1 parent 4c0f0bc commit edd8dd8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/json/converter/csv/builder/ColumnBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public String format(String[] iRow){

String aVal = iRow[_key];
switch (_type) {
case INTEGER: return String.format(_format,new Integer(aVal.equals("")?"0":aVal));
case INTEGER: return String.format(_format,Integer.valueOf(aVal.equals("")?"0":aVal));
case STRING: return String.format(_format,aVal);
}
return "";
Expand Down
2 changes: 1 addition & 1 deletion src/json/converter/shp/ShpFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public void readRecord(){
}
}

_groupRecord._shapes.put(new Integer(aRecordNumber), aFeature);
_groupRecord._shapes.put(Integer.valueOf(aRecordNumber), aFeature);

} else {

Expand Down
8 changes: 4 additions & 4 deletions src/json/geojson/FeatureCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public FeatureCollection processTileElement(TileElement iTileE){
}
}

aGroupRecord._meta_properties.put("x", new Integer(iTileE.x));
aGroupRecord._meta_properties.put("y", new Integer(iTileE.y));
aGroupRecord._meta_properties.put("x", Integer.valueOf(iTileE.x));
aGroupRecord._meta_properties.put("y", Integer.valueOf(iTileE.y));

return aGroupRecord;

Expand Down Expand Up @@ -253,8 +253,8 @@ public FeatureCollection[][] groupGridDivide(int iZoom/*int iN, int iM*/){
}

aDividedResult[i][j] = aGroupRecord;
aGroupRecord._meta_properties.put("x", new Integer(x));
aGroupRecord._meta_properties.put("y", new Integer(y));
aGroupRecord._meta_properties.put("x", Integer.valueOf(x));
aGroupRecord._meta_properties.put("y", Integer.valueOf(y));

}

Expand Down
4 changes: 2 additions & 2 deletions src/json/graphic/JenksColorifierGeojson.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void init(){

if (toconvert!=null) {
try {
aArrayProp.add(new Double((String) toconvert));
aArrayProp.add(Double.valueOf((String) toconvert));
} catch (java.lang.NumberFormatException e){
// Unable to decode this string
}
Expand Down Expand Up @@ -83,7 +83,7 @@ public Color getColor(java.lang.Object properties) {

try {

double value = new Double((String) aProp.get(_param));
double value = Double.valueOf((String) aProp.get(_param));

for (int i=0;i<Colors.length; i++) {
if ((_ranges[i]<=value) && (_ranges[i+1]>value)){
Expand Down
8 changes: 4 additions & 4 deletions src/json/topojson/topology/Topology.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public void setArcs(ArcMap iArcMap){

for (int i=0; i<aArc._points.length; i++){
arcs[na][i] = new java.lang.Object[2];
arcs[na][i][0] = new Double( aArc._points[i]._x );
arcs[na][i][1] = new Double( aArc._points[i]._y );
arcs[na][i][0] = Double.valueOf( aArc._points[i]._x );
arcs[na][i][1] = Double.valueOf( aArc._points[i]._y );
}

na++;
Expand Down Expand Up @@ -180,8 +180,8 @@ public void quantize(double iPowTen){
double scale = Math.pow(10, iPowTen);
for (java.lang.Object[][] arc:arcs){
for (java.lang.Object[] position:arc){
position[0] = new Integer((int) (((Double) position[0] - aX)*scale));
position[1] = new Integer((int) (((Double) position[1] - aY)*scale));
position[0] = Integer.valueOf((int) (((Double) position[0] - aX)*scale));
position[1] = Integer.valueOf((int) (((Double) position[1] - aY)*scale));
n++;
}
}
Expand Down
4 changes: 2 additions & 2 deletions unittest/graphics/CensusColorifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void init(){

if (toconvert!=null) {
try {
aArrayProp.add(new Double((String) toconvert));
aArrayProp.add(Double.valueOf((String) toconvert));
} catch (java.lang.NumberFormatException e){
// Unable to decode this string
}
Expand Down Expand Up @@ -98,7 +98,7 @@ public Color getColor(java.lang.Object properties) {

try {

double value = new Double((String) aProp.get(_param));
double value = Double.valueOf((String) aProp.get(_param));

for (int i=0;i<Colors.length; i++) {
if ((_ranges[i]<=value) && (_ranges[i+1]>value)){
Expand Down

0 comments on commit edd8dd8

Please sign in to comment.