removed use of methods deprecated in java 11

pull/11/head
Stefan Feuerhahn 7 years ago
parent 2419583978
commit 72494fb83d

@ -880,9 +880,9 @@ public class SclParser {
BdaBoolean bda = new BdaBoolean(new ObjectReference(ref), fc, sAddr, dchg, dupd); BdaBoolean bda = new BdaBoolean(new ObjectReference(ref), fc, sAddr, dchg, dupd);
if (val != null) { if (val != null) {
if (val.equalsIgnoreCase("true") || val.equals("1")) { if (val.equalsIgnoreCase("true") || val.equals("1")) {
bda.setValue(new Boolean(true)); bda.setValue(true);
} else if (val.equalsIgnoreCase("false") || val.equals("0")) { } else if (val.equalsIgnoreCase("false") || val.equals("0")) {
bda.setValue(new Boolean(false)); bda.setValue(false);
} else { } else {
throw new SclParseException("invalid boolean configured value: " + val); throw new SclParseException("invalid boolean configured value: " + val);
} }
@ -1071,7 +1071,7 @@ public class SclParser {
if (val != null) { if (val != null) {
for (EnumVal enumVal : enumType.getValues()) { for (EnumVal enumVal : enumType.getValues()) {
if (val.equals(enumVal.getId())) { if (val.equals(enumVal.getId())) {
bda.setValue(new Short((short) enumVal.getOrd())); bda.setValue((short) enumVal.getOrd());
return bda; return bda;
} }
} }
@ -1083,7 +1083,7 @@ public class SclParser {
if (val != null) { if (val != null) {
for (EnumVal enumVal : enumType.getValues()) { for (EnumVal enumVal : enumType.getValues()) {
if (val.equals(enumVal.getId())) { if (val.equals(enumVal.getId())) {
bda.setValue(new Byte((byte) enumVal.getOrd())); bda.setValue((byte) enumVal.getOrd());
return bda; return bda;
} }
} }

@ -26,7 +26,7 @@ public class Int16DataBind extends TextFieldDataBind<BdaInt16> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Short(data.getValue()).toString()); inputField.setText(Short.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int16UDataBind extends TextFieldDataBind<BdaInt16U> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Integer(data.getValue()).toString()); inputField.setText(Integer.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int32DataBind extends TextFieldDataBind<BdaInt32> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Integer(data.getValue()).toString()); inputField.setText(Integer.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int32UDataBind extends TextFieldDataBind<BdaInt32U> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Long(data.getValue()).toString()); inputField.setText(Long.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int64DataBind extends TextFieldDataBind<BdaInt64> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Long(data.getValue()).toString()); inputField.setText(Long.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int8DataBind extends TextFieldDataBind<BdaInt8> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Byte(data.getValue()).toString()); inputField.setText(Byte.toString(data.getValue()));
} }
@Override @Override

@ -26,7 +26,7 @@ public class Int8UDataBind extends TextFieldDataBind<BdaInt8U> {
@Override @Override
protected void resetImpl() { protected void resetImpl() {
inputField.setText(new Short(data.getValue()).toString()); inputField.setText(Short.toString(data.getValue()));
} }
@Override @Override

@ -105,7 +105,7 @@ public class ReportingTest implements ClientEventListener {
Assert.assertNotNull(mag); Assert.assertNotNull(mag);
Assert.assertEquals(0, this.reportCounter); Assert.assertEquals(0, this.reportCounter);
mag.setFloat(new Float(3.0)); mag.setFloat(3.0f);
List<BasicDataAttribute> bdas = new ArrayList<>(); List<BasicDataAttribute> bdas = new ArrayList<>();
bdas.add(mag); bdas.add(mag);
this.serverSap.setValues(bdas); this.serverSap.setValues(bdas);
@ -161,7 +161,7 @@ public class ReportingTest implements ClientEventListener {
Assert.assertNotNull(mag); Assert.assertNotNull(mag);
Assert.assertEquals(0, this.reportCounter); Assert.assertEquals(0, this.reportCounter);
mag.setFloat(new Float(3.0)); mag.setFloat(3.0f);
List<BasicDataAttribute> bdas = new ArrayList<>(); List<BasicDataAttribute> bdas = new ArrayList<>();
bdas.add(mag); bdas.add(mag);
this.serverSap.setValues(bdas); this.serverSap.setValues(bdas);

Loading…
Cancel
Save