From 285c4c9390c6a1aa435a002fb93dbb4f395f8455 Mon Sep 17 00:00:00 2001 From: Will Herrmann Date: Tue, 16 Oct 2018 16:34:01 -0500 Subject: [PATCH] Replacing IOUtils.toInputStream() with StringReader --- .../main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java b/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java index a4a6d0e14c..470c3b1cad 100644 --- a/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java +++ b/pmd-groovy/src/main/java/net/sourceforge/pmd/cpd/GroovyTokenizer.java @@ -4,9 +4,8 @@ package net.sourceforge.pmd.cpd; -import java.nio.charset.StandardCharsets; +import java.io.StringReader; -import org.apache.commons.io.IOUtils; import org.codehaus.groovy.antlr.parser.GroovyLexer; import net.sourceforge.pmd.lang.ast.TokenMgrError; @@ -24,7 +23,7 @@ public class GroovyTokenizer implements Tokenizer { public void tokenize(SourceCode sourceCode, Tokens tokenEntries) { StringBuilder buffer = sourceCode.getCodeBuffer(); - GroovyLexer lexer = new GroovyLexer(IOUtils.toInputStream(buffer.toString(), StandardCharsets.UTF_8)); + GroovyLexer lexer = new GroovyLexer(new StringReader(buffer.toString())); TokenStream tokenStream = lexer.plumb(); try {