String (String fullName, boolean imported) { ClassNode node = DecompilerContext.getClassProcessor().getMapRootClasses().get(fullName.replace('.', '/')); //todo[r.sh] anonymous classes? String nestedName; if (node != null && node.classStruct.isOwn()) { nestedName = node.simpleName; while (node.parent != null && node.type == ClassNode.CLASS_MEMBER) { //noinspection StringConcatenationInLoop nestedName = node.parent.simpleName + '.' + nestedName; node = node.parent; } if (node.type == ClassNode.CLASS_ROOT) { fullName = node.classStruct.qualifiedName; fullName = fullName.replace('/', '.'); } else { return nestedName; } } else { fullName = fullName.replace('/', '.'); int lastDot = fullName.lastIndexOf('.'); if (lastDot != -1) { nestedName = fullName.substring(lastDot + 1).replace("$", "."); } else { nestedName = fullName; } } String outerShortName = fullName; String packageName = ""; int lastDot = fullName.lastIndexOf('.'); if (lastDot >= 0) { int firstNestedDot = nestedName.indexOf("."); if (firstNestedDot >= 0) { outerShortName = nestedName.substring(0, firstNestedDot); } else { outerShortName = nestedName; } packageName = fullName.substring(0, lastDot); } StructContext context = DecompilerContext.getStructContext(); // check for another class which could 'shadow' this one. Three cases: // 1) class with the same short name in the current package // 2) class with the same short name in the default package // 3) inner class with the same short name in the current class, a super class, or an implemented interface boolean existsDefaultClass = (context.getClass(currentPackageSlash + outerShortName) != null && !packageName.equals(currentPackagePoint)) || // current package (context.getClass(outerShortName) != null && !currentPackagePoint.isEmpty()) || // default package setInnerClassNames.contains(outerShortName); // inner class if (existsDefaultClass || (mapSimpleNames.containsKey(outerShortName) && !packageName.equals(mapSimpleNames.get(outerShortName)))) { return packageName + "." + nestedName; } else if (!mapSimpleNames.containsKey(outerShortName)) { mapSimpleNames.put(outerShortName, packageName); if (!imported) { setNotImportedNames.add(outerShortName); } } return nestedName; }