From b1e62699ff74c09b2cf7313ef8a33d5ea7b0ae5f Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Fri, 15 May 2015 13:54:44 +0200 Subject: Use StandardCharsets instead of Guava and commons-io --- .../sonar/duplications/java/JavaStatementBuilderTest.java | 4 ++-- .../org/sonar/duplications/java/JavaTokenProducerTest.java | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sonar-duplications/src') 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 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); -- cgit v1.2.3