Skip to content

Commit

Permalink
[insteon] Fix Java 11 deprecation messages (openhab#7951)
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
  • Loading branch information
robnielsen authored and knikhilwiz committed Jul 12, 2020
1 parent d561c5c commit 3dcd8f0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public byte code() {
* @return clear text house code, i.e letter A-P
*/
public static String houseToString(byte c) {
String s = houseCodeToString.get(new Integer(c & 0xff));
String s = houseCodeToString.get(c & 0xff);
return (s == null) ? "X" : s;
}

Expand All @@ -80,7 +80,7 @@ public static String houseToString(byte c) {
* @return decoded integer, i.e. number 0-16
*/
public static int unitToInt(byte c) {
Integer i = unitCodeToInt.get(new Integer(c & 0xff));
Integer i = unitCodeToInt.get(c & 0xff);
return (i == null) ? -1 : i;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ private int dropBytes(byte[] buffer, int len) {
ArrayList<Byte> l = new ArrayList<>();
for (int i = 0; i < len; i++) {
if (rng.nextInt(100) >= dropRate) {
l.add(new Byte(buffer[i]));
l.add(buffer[i]);
}
}
for (int i = 0; i < l.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public int compare(@Nullable Field f1, @Nullable Field f2) {
* @return the length of the header to expect
*/
public static int getHeaderLength(byte cmd) {
Integer len = HEADER_MAP.get(new Integer(cmd));
Integer len = HEADER_MAP.get((int) cmd);
if (len == null) {
return (-1); // not found
}
Expand Down Expand Up @@ -603,15 +603,15 @@ private static int cmdToKey(byte cmd, boolean isExtended) {
private static void buildHeaderMap() {
for (Msg m : MSG_MAP.values()) {
if (m.getDirection() == Direction.FROM_MODEM) {
HEADER_MAP.put(new Integer(m.getCommandNumber()), m.getHeaderLength());
HEADER_MAP.put((int) m.getCommandNumber(), m.getHeaderLength());
}
}
}

private static void buildLengthMap() {
for (Msg m : MSG_MAP.values()) {
if (m.getDirection() == Direction.FROM_MODEM) {
Integer key = new Integer(cmdToKey(m.getCommandNumber(), m.isExtended()));
int key = cmdToKey(m.getCommandNumber(), m.isExtended());
REPLY_MAP.put(key, m);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public enum MsgType {

static {
for (MsgType t : MsgType.values()) {
Integer i = new Integer(t.getByteValue() & 0xff);
int i = t.getByteValue() & 0xff;
hash.put(i, t);
}
}
Expand All @@ -72,7 +72,7 @@ private int getByteValue() {
}

public static MsgType fromValue(byte b) throws IllegalArgumentException {
Integer i = new Integer((b & 0xe0));
int i = b & 0xe0;
@Nullable
MsgType mt = hash.get(i);
if (mt == null) {
Expand Down

0 comments on commit 3dcd8f0

Please sign in to comment.