Menu

#1114 CPD - Tokenizer not initialized with requested properties

PMD-5.0.5
closed
None
CPD
2-Critical
Bug
5.0.x
2013-08-03
2013-07-14
thelenko
No

Executing CPD by command line or ant task does not propagate the tokenizer options (ignoreIdentifiers/ignoreLiterals/ignoreAnnotations). I have tried multiple versions, and it appears to have quit working in 5.0.0 (it works in 5.0.0-alpha).

I took a quick look at the code of 5.0.4. The LanguageFactory for cpd has a method which takes a Properties object (public Language createLanguage(String language, Properties properties)), but it never actually uses the Properties object. For this reason the language tokenizer CPD uses always sets ignoreLiterals/ignoreIdentifiers/ignoreAnnotations to false.

Discussion

  • Andreas Dangel

    Andreas Dangel - 2013-08-03
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.0.5
     
  • Andreas Dangel

    Andreas Dangel - 2013-08-03

    I could reproduce this problem. We set the properties too late, after the tokenizer has been already initialized.

    I think it's worth a 5.0.5.

     
  • Andreas Dangel

    Andreas Dangel - 2013-08-03
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB