From c3b4a23fdb936b4df130f49ac5674f8b484a26e7 Mon Sep 17 00:00:00 2001 From: Stiver Date: Sun, 1 Mar 2015 12:13:04 +0100 Subject: [PATCH] Fixed 'IDEA-135314: Inner classes constructors calls decompiled incorrectly' --- .../java/decompiler/main/collectors/ImportCollector.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java b/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java index aa9031c..c7d8317 100644 --- a/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java +++ b/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java @@ -89,9 +89,13 @@ public class ImportCollector { StructContext context = DecompilerContext.getStructContext(); + // check for another class which could 'shadow' this one. Two cases: + // 1) class with the same short name in the current package + // 2) class with the same short name in the default package boolean existsDefaultClass = (context.getClass(currentPackageSlash + nshort) != null && !npackage.equals(currentPackagePoint)) // current package - || (context.getClass(nshort) != null); // default package + || (context.getClass(nshort) != null + && !currentPackagePoint.isEmpty()); // default package if (existsDefaultClass || (mapSimpleNames.containsKey(nshort) && !npackage.equals(mapSimpleNames.get(nshort)))) {