Minor: better message in assertion

This commit is contained in:
Pavel V. Talanov
2015-07-17 16:06:17 +03:00
parent e7f50982ca
commit 3412febe59
@@ -238,8 +238,8 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
@NotNull JetClassOrObject decompiledClassOrObject, @NotNull JetClassOrObject decompiledClassOrObject,
@NotNull PsiClass rootLightClassForDecompiledFile @NotNull PsiClass rootLightClassForDecompiledFile
) { ) {
List<Name> relativeClassNameSegments = getClassRelativeName(decompiledClassOrObject).pathSegments(); FqName relativeFqName = getClassRelativeName(decompiledClassOrObject);
Iterator<Name> iterator = relativeClassNameSegments.iterator(); Iterator<Name> iterator = relativeFqName.pathSegments().iterator();
Name base = iterator.next(); Name base = iterator.next();
assert rootLightClassForDecompiledFile.getName().equals(base.asString()) assert rootLightClassForDecompiledFile.getName().equals(base.asString())
: "Light class for file:\n" + decompiledClassOrObject.getContainingJetFile().getVirtualFile().getCanonicalPath() : "Light class for file:\n" + decompiledClassOrObject.getContainingJetFile().getVirtualFile().getCanonicalPath()
@@ -248,7 +248,8 @@ public class IDELightClassGenerationSupport extends LightClassGenerationSupport
while (iterator.hasNext()) { while (iterator.hasNext()) {
Name name = iterator.next(); Name name = iterator.next();
PsiClass innerClass = current.findInnerClassByName(name.asString(), false); PsiClass innerClass = current.findInnerClassByName(name.asString(), false);
assert innerClass != null : "Inner class should be found"; assert innerClass != null : "Could not find corresponding inner/nested class " + relativeFqName + "in class " + decompiledClassOrObject.getName() + "\n" +
"File: " + decompiledClassOrObject.getContainingJetFile().getVirtualFile().getName();
current = innerClass; current = innerClass;
} }
return current; return current;