yu8440348 / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

Can't use $ in rules file #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
For example, if you try to create a rule like:

rule com.example.SomeClass$SomeNestedClass
com.example.internal.SomeClass$SomeNestedClass 

it won't rename the class because the $ ends up interpreted as the regex
end-of-line pattern, which causes the Wildcard object to fail the match.

I fixed this by adding code to Wildcard.java:

    private static Pattern dollar = Pattern.compile("\\$");

(then in the constructor after the other replaceAllLiteral calls)

        regex = replaceAllLiteral(dollar, regex, "\\$");

Original issue reported on code.google.com by paraq...@gmail.com on 23 Nov 2009 at 7:21

GoogleCodeExporter commented 8 years ago
Here is a patch that implements the above suggestion.

Original comment by mkos...@chromium.org on 13 Jun 2014 at 3:30

Attachments: