Issue #20 new

need condition to identify class or package of match/fix

Ernie Rael
created an issue

(this was discussed in issue 16, but that issue's about something else)

Conditions like {{{ inClass("org.x.y.Z") inPackage("org.x.y") }}} are needed in many cases (maybe isFile() as well?).

And a way for specifying a regex pattern would be nice.

Comments (3)

  1. Jan Lahoda repo owner

    Thanks for reporting this separately. I have added new conditions "inClass"/"inPackage" and "enclosingClasses"/"enclosingPackage" methods to Context. Originally, I was also thinking about allowing some patterns (more like glob patterns, probably), but I realized that I do not know strong usecase for such patterns. So, for now, the names are matched exactly (but any enclosing class will match and there may be more than one FQN), and the patterns can be added once there is a clear usecase.

    in trunk: https://bitbucket.org/jlahoda/jackpot30/changeset/58e6fd71691f in release701: https://bitbucket.org/jlahoda/jackpot30/changeset/c054e29f22cb

  2. Ernie Rael reporter

    I added these to the supplementary doc in wiki.

    Question: for "inClass", if I want to specify an inner class only (but not the outer class), do I use '$'? As in com.foo.Outer$Inner

    BTW, I couldn't really see a need for the pattern capability (other than it would be cool) ;-)

  3. Log in to comment