Skip to content

Commit e88d39d

Browse files
idodeclareVladimir Kotal
authored andcommitted
Share TAGS_SEPARATOR named literal
1 parent 5c5eb0c commit e88d39d

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/BazaarTagParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@
1919

2020
/*
2121
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
22+
* Portions Copyright (c) 2019, Chris Fraire <cfraire@me.com>.
2223
*/
2324
package org.opengrok.indexer.history;
2425

26+
import static org.opengrok.indexer.history.HistoryEntry.TAGS_SEPARATOR;
27+
2528
import java.io.BufferedReader;
2629
import java.io.IOException;
2730
import java.io.InputStream;
@@ -70,7 +73,7 @@ public void processStream(InputStream input) throws IOException {
7073
if (higher != null && higher.equals(tagEntry)) {
7174
// Found in the tree, merge tags
7275
entries.remove(higher);
73-
tagEntry.setTags(higher.getTags() + ", " + tag);
76+
tagEntry.setTags(higher.getTags() + TAGS_SEPARATOR + tag);
7477
}
7578
entries.add(tagEntry);
7679
}

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitTagParser.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919

2020
/*
2121
* Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2020, Chris Fraire <cfraire@me.com>.
22+
* Portions Copyright (c) 2019-2020, Chris Fraire <cfraire@me.com>.
2323
*/
2424
package org.opengrok.indexer.history;
2525

26+
import static org.opengrok.indexer.history.HistoryEntry.TAGS_SEPARATOR;
27+
2628
import java.io.BufferedReader;
2729
import java.io.IOException;
2830
import java.io.InputStream;
@@ -114,7 +116,7 @@ public void processStream(InputStream input) throws IOException {
114116
* See Repository assignTagsInHistory() where multiple
115117
* identified tags are joined with comma-space.
116118
*/
117-
String joinedTagNames = String.join(", ", tagNames);
119+
String joinedTagNames = String.join(TAGS_SEPARATOR, tagNames);
118120
GitTagEntry tagEntry = new GitTagEntry(hash, date, joinedTagNames);
119121
entries.add(tagEntry);
120122
}

opengrok-indexer/src/main/java/org/opengrok/indexer/history/HistoryEntry.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
22+
* Portions Copyright (c) 2019, Chris Fraire <cfraire@me.com>.
2223
*/
2324
/*
2425
* Copyright 2006 Trond Norbye. All rights reserved.
@@ -30,6 +31,7 @@
3031
import java.util.TreeSet;
3132
import java.util.logging.Level;
3233
import java.util.logging.Logger;
34+
3335
import org.opengrok.indexer.logger.LoggerFactory;
3436

3537
/**
@@ -39,6 +41,8 @@
3941
*/
4042
public class HistoryEntry {
4143

44+
static final String TAGS_SEPARATOR = ", ";
45+
4246
private static final Logger LOGGER = LoggerFactory.getLogger(HistoryEntry.class);
4347

4448
private String revision;

0 commit comments

Comments
 (0)