Skip to content

Commit

Permalink
Remove duplicate escaped-names property
Browse files Browse the repository at this point in the history
  • Loading branch information
NebelNidas committed May 13, 2023
1 parent 420e73c commit 48798f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ private static void read(ColumnFileReader reader, MappingVisitor visitor) throws
if (visitHeader || firstIteration) {
while (reader.nextLine(1)) {
if (!visitHeader) {
if (!escapeNames && reader.nextCol(Tiny2Util.escapedNamesProperty)) {
if (!escapeNames && reader.nextCol(TinyProperties.ESCAPED_NAMES)) {
escapeNames = true;
}
} else {
String key = reader.nextCol();
if (key == null) throw new IOException("missing property key in line "+reader.getLineNumber());
String value = reader.nextEscapedCol(); // may be missing -> null

if (key.equals(Tiny2Util.escapedNamesProperty)) {
if (key.equals(TinyProperties.ESCAPED_NAMES)) {
escapeNames = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void visitNamespaces(String srcNamespace, List<String> dstNamespaces) thr

@Override
public void visitMetadata(String key, String value) throws IOException {
if (key.equals(Tiny2Util.escapedNamesProperty)) {
if (key.equals(TinyProperties.ESCAPED_NAMES)) {
escapeNames = true;
wroteEscapedNamesProperty = true;
}
Expand All @@ -80,7 +80,7 @@ public void visitMetadata(String key, String value) throws IOException {
public boolean visitContent() throws IOException {
if (escapeNames && !wroteEscapedNamesProperty) {
write("\t");
write(Tiny2Util.escapedNamesProperty);
write(TinyProperties.ESCAPED_NAMES);
writeLn();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,4 @@ public static String unescape(String str) {

private static final String toEscape = "\\\n\r\0\t";
private static final String escaped = "\\nr0t";

static final String escapedNamesProperty = "escaped-names";
}

0 comments on commit 48798f9

Please sign in to comment.