Actually use \n ... as specified in previous commit message.

pull/3/head
Bertrik Sikken 2020-02-05 23:54:34 +01:00
rodzic 313ef625d5
commit 19dbf5069a
2 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -11,6 +11,7 @@ dependencies {
implementation libraries.jackson
implementation libraries.xml_bind
implementation libraries.retrofit
compileOnly libraries.spotbugs_annotations
testImplementation libraries.retrofit_mock
}

Wyświetl plik

@ -9,6 +9,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Representation of a HAB telemetry sentence.
*/
@ -49,6 +51,7 @@ public final class Sentence {
*
* @return a sentence formatted according to the basic UKHAS convention
*/
@SuppressFBWarnings(value = "VA_FORMAT_STRING_USES_NEWLINE", justification = "use \n as specified")
public String format() {
// format time
LocalDateTime local = LocalDateTime.ofInstant(time, ZoneId.of("UTC"));
@ -67,7 +70,7 @@ public final class Sentence {
// append header, checksum, etc
byte[] bytes = basic.getBytes(StandardCharsets.US_ASCII);
int crcValue = crc16.calculate(bytes, 0xFFFF);
return String.format(Locale.ROOT, "$$%s*%04X%n", basic, crcValue);
return String.format(Locale.ROOT, "$$%s*%04X\n", basic, crcValue);
}
@Override