Menu

#613 ReTrace

v5.2
closed-fixed
None
7
2016-10-23
2016-06-18
No

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!

Discussion

  • Nathan Sweet

    Nathan Sweet - 2016-06-18

    Oops, meant to provide a more specific title, sorry.

     
  • Nathan Sweet

    Nathan Sweet - 2016-06-18

    Unrelated to the issue above, but while I'm here: I'm also trying to match:

    Caused by: xx: Some error message: 123 (yy)
    

    Where xx and yy are class names. It appears ReTrace can only replace one class name per line, is that right?

     
  • Eric Lafortune

    Eric Lafortune - 2016-06-18

    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...

     
  • Eric Lafortune

    Eric Lafortune - 2016-06-18
    • status: open --> open-fixed
     
  • Nathan Sweet

    Nathan Sweet - 2016-06-27

    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

     
  • Eric Lafortune

    Eric Lafortune - 2016-10-23
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.