Skip to content

Commit 9d7940b

Browse files
johnmayegonw
authored andcommitted
Joiner -> String.join, since JDK 1.8
1 parent 4d20c4f commit 9d7940b

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

app/depict/src/main/java/org/openscience/cdk/depict/SvgDrawVisitor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
package org.openscience.cdk.depict;
2525

26-
import com.google.common.base.Joiner;
2726
import com.google.common.xml.XmlEscapers;
2827
import org.openscience.cdk.renderer.RendererModel;
2928
import org.openscience.cdk.renderer.elements.Bounds;
@@ -356,7 +355,7 @@ private void visit(String id, String cls, LineElement elem) {
356355
private void visit(MarkedElement elem) {
357356
String id = elem.getId();
358357
List<String> classes = elem.getClasses();
359-
String cls = classes.isEmpty() ? null : Joiner.on(" ").join(classes);
358+
String cls = classes.isEmpty() ? null : String.join(" ", classes);
360359

361360
IRenderingElement marked = elem.element();
362361

display/renderbasic/src/test/java/org/openscience/cdk/renderer/generators/standard/AbbreviationLabelTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
package org.openscience.cdk.renderer.generators.standard;
2525

26-
import com.google.common.base.Joiner;
2726
import org.junit.Test;
2827

2928
import java.util.ArrayList;
@@ -145,7 +144,7 @@ public void reversingBrackets() {
145144
List<String> tokens = new ArrayList<>();
146145
assertTrue(AbbreviationLabel.parse("N(CH2CH2O)CH2", tokens));
147146
AbbreviationLabel.reverse(tokens);
148-
assertThat(Joiner.on("").join(tokens), is("H2C(OH2CH2C)N"));
147+
assertThat(String.join("", tokens), is("H2C(OH2CH2C)N"));
149148
}
150149

151150
@Test
@@ -154,15 +153,15 @@ public void reversingFormatPOOHOEt() {
154153
assertTrue(AbbreviationLabel.parse("PO(OH)OEt", tokens));
155154
AbbreviationLabel.reverse(tokens);
156155
AbbreviationLabel.format(tokens);
157-
assertThat(Joiner.on("").join(tokens), is("EtO(HO)OP"));
156+
assertThat(String.join("", tokens), is("EtO(HO)OP"));
158157
}
159158

160159
@Test
161160
public void reversingBracketsWithNumbers() {
162161
List<String> tokens = new ArrayList<>();
163162
assertTrue(AbbreviationLabel.parse("B(OH)2", tokens));
164163
AbbreviationLabel.reverse(tokens);
165-
assertThat(Joiner.on("").join(tokens), is("(HO)2B"));
164+
assertThat(String.join("", tokens), is("(HO)2B"));
166165
}
167166

168167
@Test

storage/inchi/src/test/java/org/openscience/cdk/smiles/AbsoluteSMILESTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
package org.openscience.cdk.smiles;
2626

27-
import com.google.common.base.Joiner;
2827
import org.junit.Assert;
2928
import org.junit.Ignore;
3029
import org.junit.Test;
@@ -139,7 +138,7 @@ static void test(String... inputs) throws Exception {
139138
for (String input : inputs)
140139
output.add(sg.create(sp.parseSmiles(input)));
141140

142-
org.hamcrest.MatcherAssert.assertThat(Joiner.on(".").join(inputs) + " were not canonicalised, outputs were " + output,
141+
org.hamcrest.MatcherAssert.assertThat(String.join(".", inputs) + " were not canonicalised, outputs were " + output,
143142
output.size(), is(1));
144143

145144
}

0 commit comments

Comments
 (0)