Skip to content

Commit de0a019

Browse files
committed
Confusing statement renamed to isNotValid
1 parent e64dbae commit de0a019

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/main/java/aero/t2s/modes/decoder/Common.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public static short[] getParity(short[] data) {
105105
return Arrays.copyOf(parity, CRC_POLYNOMIAL.length);
106106
}
107107

108-
public static boolean isValid(short[] data) {
108+
public static boolean isNotValid(short[] data) {
109109
short[] payload = Arrays.copyOfRange(data, 0, data.length - 3);
110110
short[] parity = Arrays.copyOfRange(data, data.length - 3, data.length);
111111

src/main/java/aero/t2s/modes/decoder/Decoder.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
import aero.t2s.modes.Track;
44
import aero.t2s.modes.database.ModeSDatabase;
55
import aero.t2s.modes.decoder.df.*;
6-
import org.slf4j.Logger;
7-
import org.slf4j.LoggerFactory;
86

9-
import java.util.HashMap;
107
import java.util.Map;
118

129
public class Decoder {
@@ -24,8 +21,7 @@ public Decoder(Map<String, Track> tracks, double originLat, double originLon, Mo
2421
}
2522

2623
public DownlinkFormat decode(short[] data) throws UnknownDownlinkFormatException {
27-
// @Todo: Confusing statement this should probably be refactored to return inverse or renamed to invalid
28-
if (Common.isValid(data)) {
24+
if (Common.isNotValid(data)) {
2925
return null;
3026
}
3127

0 commit comments

Comments
 (0)