Issue details
When decompiling a method marked static synchronized, the JADX output looks like this:
public static synchronized void preload() {
synchronized (AppCompatDrawableManager.class) {
//method body
}
}
Whereas the original source code (see AndroidX sources) looks like:
public static synchronized void preload() {
//method body
}
This is in contrast to non-static synchronized methods, such as onConfigurationChanged in the same class, which looks "correct" in JADX as well:
public synchronized void onConfigurationChanged(Context context) {
this.mResourceManager.onConfigurationChanged(context);
}
It seems that on static synchronized methods, JADX both interprets the declared-synchronized modifier and the compiler-generated monitor-enter/monitor-exit, which results in the "doubled" redundant locking pattern. I don't think this is more than a cosmetic issue, but the inconsistency with non-static methods leads me to believe that it could be a bug.
Relevant log output or stacktrace
Provide sample and class/method full name
Any class with a static synchronized and non-static synchronized method, such as those in AppCompat:
https://github.com/androidx/androidx/blob/androidx-main/appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java
Jadx version
Nightly r2441.ec726d6
Issue details
When decompiling a method marked
static synchronized, the JADX output looks like this:Whereas the original source code (see AndroidX sources) looks like:
This is in contrast to non-static synchronized methods, such as
onConfigurationChangedin the same class, which looks "correct" in JADX as well:It seems that on
static synchronizedmethods, JADX both interprets thedeclared-synchronizedmodifier and the compiler-generatedmonitor-enter/monitor-exit, which results in the "doubled" redundant locking pattern. I don't think this is more than a cosmetic issue, but the inconsistency with non-static methods leads me to believe that it could be a bug.Relevant log output or stacktrace
Provide sample and class/method full name
Any class with a static synchronized and non-static synchronized method, such as those in AppCompat:
https://github.com/androidx/androidx/blob/androidx-main/appcompat/appcompat/src/main/java/androidx/appcompat/widget/AppCompatDrawableManager.java
Jadx version
Nightly r2441.ec726d6