D:\pmd_reports>call java -Djava.ext.dirs=pmd-bin-5.1.0\lib\ net.sourceforge.pmd.PMD -d d:\pmd_reports\test.pkb -f text -R rulesets/plsql/dates.xml -debug
Loaded rule TO_DATEWithoutDateFormat
Loaded rule TO_DATE_TO_CHAR
Loaded rule TO_TIMESTAMPWithoutDateFormat
Using PLSQL version: PLSQL
Processing D:\pmd_reports\test.pkb
Error while processing file: D:\pmd_reports\test.pkb
net.sourceforge.pmd.lang.ast.TokenMgrError: Lexical error in file D:\pmd_reports\test.pkb at line 1, column 1. Encountered: "\ufeff" (65279), after : ""
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParserTokenManager.getNextToken(PLSQLParserTokenManager.java:4454)
at net.sourceforge.pmd.lang.plsql.ast.PLSQLParser.<init>(PLSQLParser.java:39580)
at net.sourceforge.pmd.lang.plsql.PLSQLParser.createPLSQLParser(PLSQLParser.java:42)
at net.sourceforge.pmd.lang.plsql.PLSQLParser.parse(PLSQLParser.java:53)
at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:95)
at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:142)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:80)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:47)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:78)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:25)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)</init>
D:\pmd_reports\test.pkb - Error while processing D:\pmd_reports\test.pkb
test.pkb seems to contain a BOM.
There are religious wars about whether UTF-8 files should or should not contain BOMs, and even the Java authors have changed their minds - see Java Bug 4508058.
By default Microsoft applications seem to add a BOM to the file.
Also, by default Java does not perform any special processing with a BOM.
A common way of coping with the possibility of a BOM is to use a custom Reader, such as BOMInputStream -
a quick attempt to add the BOM character to the PLSQL parser was not successful.
Until a robust solution is implemented, a workaround would be so save the file(s) without a BOM
Will be fixed with the next PMD release.