diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-15 13:54:44 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-05-15 13:54:54 +0200 |
commit | b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f (patch) | |
tree | 21efd2dbbd3492a6f518fcd57de4888e1bfb4c3b /sonar-duplications/src | |
parent | 6a19a67a23a39848c28ae3cf2d189bf926fadf9b (diff) | |
download | sonarqube-b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f.tar.gz sonarqube-b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f.zip |
Use StandardCharsets instead of Guava and commons-io
Diffstat (limited to 'sonar-duplications/src')
2 files changed, 9 insertions, 9 deletions
diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java index a60c04e86d3..904820856d8 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaStatementBuilderTest.java @@ -19,7 +19,6 @@ */ package org.sonar.duplications.java; -import com.google.common.base.Charsets; import org.apache.commons.io.IOUtils; import org.junit.Test; import org.sonar.duplications.DuplicationsTestUtil; @@ -32,6 +31,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.Reader; +import java.nio.charset.StandardCharsets; import java.util.List; import static org.assertj.core.api.Assertions.assertThat; @@ -327,7 +327,7 @@ public class JavaStatementBuilderTest { private List<Statement> chunk(File file) { Reader reader = null; try { - reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8); + reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); return statementChunker.chunk(tokenChunker.chunk(reader)); } catch (FileNotFoundException e) { throw new RuntimeException(e); diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java index 3a190a5e3be..1afeb632b9c 100644 --- a/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java +++ b/sonar-duplications/src/test/java/org/sonar/duplications/java/JavaTokenProducerTest.java @@ -19,7 +19,6 @@ */ package org.sonar.duplications.java; -import com.google.common.base.Charsets; import com.google.common.collect.Lists; import org.apache.commons.io.IOUtils; import org.hamcrest.Matcher; @@ -35,6 +34,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.Reader; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; @@ -284,11 +284,11 @@ public class JavaTokenProducerTest { @Test public void shouldPreserveSeparators() { assertThat(chunk("(){}[];,."), isTokens( - new Token("(", 1, 0), new Token(")", 1, 1), - new Token("{", 1, 2), new Token("}", 1, 3), - new Token("[", 1, 4), new Token("]", 1, 5), - new Token(";", 1, 6), new Token(",", 1, 7), - new Token(".", 1, 8))); + new Token("(", 1, 0), new Token(")", 1, 1), + new Token("{", 1, 2), new Token("}", 1, 3), + new Token("[", 1, 4), new Token("]", 1, 5), + new Token(";", 1, 6), new Token(",", 1, 7), + new Token(".", 1, 8))); } /** @@ -312,7 +312,7 @@ public class JavaTokenProducerTest { private TokenQueue chunk(File file) { Reader reader = null; try { - reader = new InputStreamReader(new FileInputStream(file), Charsets.UTF_8); + reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8); return chunker.chunk(reader); } catch (FileNotFoundException e) { throw new RuntimeException(e); |