Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[insteon] Fix Java 11 deprecation messages #7951

Merged
merged 1 commit into from
Jun 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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