Permalink
Browse files

Rewrite to avoid require module java.logging

  • Loading branch information...
tbsalling committed Nov 6, 2018
1 parent b93c06a commit 4c197d39e0f2e0cb00349b252c619f0a6b5c4ac2
@@ -33,7 +33,6 @@
import java.util.Map;
import java.util.TreeMap;
import java.util.function.BiFunction;
import java.util.logging.Logger;
import java.util.stream.Stream;

import static dk.tbsalling.aismessages.ais.Decoders.UNSIGNED_INTEGER_DECODER;
@@ -50,18 +50,18 @@ public static SOTDMACommunicationState fromBitString(String bitString) {
if (slotTimeout == 3 || slotTimeout == 5 || slotTimeout == 7) {
numberOfReceivedStations = UNSIGNED_INTEGER_DECODER.apply(bitString.substring(5, 19));
if (numberOfReceivedStations > 16383)
LOG.warning("numberOfReceivedStations: " + numberOfReceivedStations + ": Out of range.");
LOG.log(WARNING,"numberOfReceivedStations: " + numberOfReceivedStations + ": Out of range.");
} else if (slotTimeout == 2 || slotTimeout == 4 || slotTimeout == 6) {
slotNumber = UNSIGNED_INTEGER_DECODER.apply(bitString.substring(5, 19));
if (slotNumber > 2249)
LOG.warning("slotNumber: " + slotNumber + ": Out of range.");
LOG.log(WARNING,"slotNumber: " + slotNumber + ": Out of range.");
} else if (slotTimeout == 1) {
utcHour = UNSIGNED_INTEGER_DECODER.apply(bitString.substring(5, 10));
if (utcHour > 23)
LOG.warning("utcHour: " + utcHour + ": Out of range.");
LOG.log(WARNING,"utcHour: " + utcHour + ": Out of range.");
utcMinute = UNSIGNED_INTEGER_DECODER.apply(bitString.substring(10, 17));
if (utcMinute > 59)
LOG.warning("utcMinute: " + utcMinute + ": Out of range.");
LOG.log(WARNING,"utcMinute: " + utcMinute + ": Out of range.");
} else if (slotTimeout == 0) {
slotOffset = UNSIGNED_INTEGER_DECODER.apply(bitString.substring(5, 19));
}
@@ -1,4 +1,3 @@
module dk.tbsalling.ais.aismessages {
exports dk.tbsalling.aismessages;
requires java.logging;
}

0 comments on commit 4c197d3

Please sign in to comment.