This commit is contained in:
Clément Fournier 2020-03-17 15:53:19 +01:00
parent 7108a166d4
commit affb0461c9
2 changed files with 4 additions and 2 deletions

View File

@ -9,12 +9,13 @@ import org.apache.commons.io.input.CharSequenceReader;
import net.sourceforge.pmd.cpd.internal.JavaCCTokenizer;
import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.jsp.ast.JspTokenManager;
import net.sourceforge.pmd.util.IOUtil;
public class JSPTokenizer extends JavaCCTokenizer {
@Override
protected TokenManager getLexerForSource(SourceCode sourceCode) {
return new JspTokenManager(new CharSequenceReader(sourceCode.getCodeBuffer()));
return new JspTokenManager(IOUtil.skipBOM(new CharSequenceReader(sourceCode.getCodeBuffer())));
}
}

View File

@ -9,6 +9,7 @@ import org.apache.commons.io.input.CharSequenceReader;
import net.sourceforge.pmd.cpd.internal.JavaCCTokenizer;
import net.sourceforge.pmd.lang.TokenManager;
import net.sourceforge.pmd.lang.vf.ast.VfTokenManager;
import net.sourceforge.pmd.util.IOUtil;
/**
* @author sergey.gorbaty
@ -17,6 +18,6 @@ public class VfTokenizer extends JavaCCTokenizer {
@Override
protected TokenManager getLexerForSource(SourceCode sourceCode) {
return new VfTokenManager(new CharSequenceReader(sourceCode.getCodeBuffer()));
return new VfTokenManager(IOUtil.skipBOM(new CharSequenceReader(sourceCode.getCodeBuffer())));
}
}