ReTrace
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
I'm seeing the exception below using ReTrace 5.2.1. It seems to be related to using %f in my regex.
java -jar ../tools/proguard/retrace.jar -regex "%f \(%c\)" mappingFile exceptionFile
Exception in thread "main" java.lang.ClassCastException: java.util.LinkedHashSet cannot be cast to java.util.List
at proguard.retrace.FrameRemapper.transformFieldInfo(FrameRemapper.java:97)
at proguard.retrace.FrameRemapper.transform(FrameRemapper.java:55)
at proguard.retrace.ReTrace.retrace(ReTrace.java:102)
at proguard.retrace.ReTrace.main(ReTrace.java:276)
My exception file looks like:
c (zM)
It's not clear if you need the mapping file to repro.
Cheers!
Oops, meant to provide a more specific title, sorry.
Unrelated to the issue above, but while I'm here: I'm also trying to match:
Where xx and yy are class names. It appears ReTrace can only replace one class name per line, is that right?
Thanks for your report. The type and cast on that line should be Set instead of List, just like in the method below. I've fixed it for the upcoming ProGuard 7.3.
The proponents of generics have a point. The generified code looks ugly though.
ReTrace only replaces one class per line indeed; more complex requirements are pretty rare...
Great, thank you!
Generics are OK, but only if used right. I omit RHS generics and disable the default BS warnings about raw types. ClassCastException was never a problem that warranted such a pervasive solution. Doing it my was the end result is less and safer casts, without pointy brackets everywhere.
Only downside is the rare times that use of raw type removes all generics, but that's a compilation error.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=492781