Closed mkoncek closed 2 years ago
The problem is with the class $Gson$Preconditions, someone thought it would be a good idea to use $ in a normal class name. Nevertheless it is completely legal to name your class with dollars.
What an interesting edge case! Will fix.
(CFR decompiler)
More broadly speaking it is any decompiler wrapper implementing the decompileWithInners(...)
method, probably.
@mkoncek, looking into it, I have no problem decompiling $Gson$Preconditions
with CFR, not even with CFR_old before 09a8933 fixing #96. What class were you trying to decompile? What is the version of Cfr.jar in your Cfr decompiler wrapper plugin? (Configure -> Plugins)
It was there before you edited it: Processing com.google.gson.JsonPrimitive
. It imports $Gson$Preconditions
.
Oops, misclicked on that one, my bad.
This probably also needs slight adjustments on CPLC side, but in order to play around with it I first need JRD not to crash. (Although maybe i can just catch the exception)
Can confirm that catching RuntimeException
on my side makes the file compile, but that is just an observation, not a solution.
Need more info to replicate the bug. With the latest CFR jar, CFR wrapper and JRD, I have no issue decompiling $Gson$Precondition
nor JsonPrimitive
in both CLI and GUI. (it is not lazy-loaded on startup)
Note that the PIDs of the target processes are different every time to not cross-contaminate.
https://github.com/pmikova/java-runtime-decompiler/pull/205 has probably fixed this, but it still floods stderr. Although i don't think yoou can do much about it.
Expanded stderr messages in #206 to be more explanatory.
However because the error logging happens much deeper than in either JrdClassesProvider
or Cli::obtainClass
/Cli::initClass
, we cannot outright remove the log calls.
One option would be to temporarily switch System.err
with a dummy PrintStream
, but that's worth considering in another issue. This one will close with #206.
(CFR decompiler)
The problem is with the class
$Gson$Preconditions
, someone thought it would be a good idea to use$
in a normal class name. Nevertheless it is completely legal to name your class with dollars. Problem then is, i have no way of knowing whether it actually is a nested class or not, i can only find out by requestinggetClass
from JRD. However if you don't find a class with the prefixed name, you end up throwing a genericRuntimeException
. I think it would be better to simply return an empty collection (or throw a more specific exception).