Menu

#1167 Error while processing PLSQL file with BOM

PMD-5.1.1
closed
plsql (3)
PMD
3-Major
Bug
2014-04-27
2014-02-17
safebuster2
No

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

1 Attachments

Discussion

  • Stuart Turton

    Stuart Turton - 2014-02-18

    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

     
  • Andreas Dangel

    Andreas Dangel - 2014-04-13
    • summary: Error while processing file --> Error while processing PLSQL file with BOM
    • status: open --> in-progress
    • assigned_to: Andreas Dangel
    • Milestone: PMD-5.1.x --> PMD-Next
     
  • Andreas Dangel

    Andreas Dangel - 2014-04-25
    • status: in-progress --> closed
     
  • Andreas Dangel

    Andreas Dangel - 2014-04-25

    Will be fixed with the next PMD release.

     

Log in to post a comment.

MongoDB Logo MongoDB