Skip to content

Commit

Permalink
Bug fix. Set empty string if dump date is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ullenius committed Nov 5, 2022
1 parent 185747a commit b8f0dff
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Emulator emulatorUsed = myFacftory.orderEmulator(0x31, Type.JAPANESE) // Type.LE
```

## Changelog
* 0.3.5 - fix id666 dumped date output
* 0.3.4 - fix bug that crashed if dumped date was missing. Fix log warning
* 0.3.3 - fix id666 dumped date parsing (binary format)
* 0.3 - add xid6 support (extended tags). Update to Java 11. September 2021
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/se/anosh/spctag/TagReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
public final class TagReader {

private static final String VERSION ="spctag version 0.3.4";
private static final String VERSION ="spctag version 0.3.5";
private static final String ABOUT = "code by A. Ullenius 2019";
private static final String LICENCE = "Licence: Gnu General Public License - version 3.0 only";
private static final String TRIBUTE = "spctag is dedicated to my favourite OC remixer: Avien (1986-2004). RIP";
Expand Down Expand Up @@ -80,7 +80,7 @@ public void go(final CommandLine cmd) {
System.out.println("Name of dumper: " + myFile.getNameOfDumper());
System.out.println("Comments: " + myFile.getComments());

System.out.println("Date SPC was dumped:" + myFile.getDateDumpWasCreated());
System.out.println("Date SPC was dumped: " + myFile.getDateDumpWasCreated());
System.out.println("Emulator used to dump SPC: " + myFile.getEmulatorUsedToCreateDump().getName());

if (cmd.hasOption(VERBOSE) || cmd.hasOption(XID6)) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/se/anosh/spctag/dao/SpcFileReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalInt;
import java.util.function.Function;

import se.anosh.spctag.domain.Id666;
Expand Down Expand Up @@ -93,6 +91,9 @@ private void readDateDumpWasCreated() throws IOException {
else if (id666.isTextTagFormat()) {
id666.setDateDumpWasCreated(parse(Id666.Field.DUMP_DATE_TEXT_FORMAT));
}
else {
id666.setDateDumpWasCreated("");
}
}

private boolean hasBinaryDumpDate() throws IOException {
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/se/anosh/spctag/TestModelWithData.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void dumpedDateBinaryParsing() throws IOException {
public void binarySpcMissingDumpDate() throws IOException {
final Id666 id666 = new SpcFile(BINARY_SPC_WITHOUT_DUMPED_DATE).read();
assertEquals(Boolean.TRUE, id666.isBinaryTagFormat());
assertNull(id666.getDateDumpWasCreated());
assertEquals("", id666.getDateDumpWasCreated());
}

@Test
Expand Down

0 comments on commit b8f0dff

Please sign in to comment.