EA-48802 - assert: JavaFileManagerBase.findClass

This commit is contained in:
Anna Kozlova
2013-08-28 21:39:03 +04:00
parent 1eafaae57e
commit cddbc285a2
4 changed files with 16 additions and 11 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@ public class ApplicationConfiguration extends ModuleBasedConfiguration<JavaRunCo
if (MAIN_CLASS_NAME == null) {
return null;
}
return JavaExecutionUtil.getPresentableClassName(MAIN_CLASS_NAME, getConfigurationModule());
return JavaExecutionUtil.getPresentableClassName(MAIN_CLASS_NAME);
}
@Override
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -140,13 +140,18 @@ public class JavaExecutionUtil {
return ClassUtil.getJVMClassName(aClass);
}
@Nullable
public static String getPresentableClassName(final String rtClassName) {
return getPresentableClassName(rtClassName, null);
}
/**
* {@link JavaExecutionUtil#getPresentableClassName(java.lang.String)}
*/
@Deprecated
@Nullable
public static String getPresentableClassName(final String rtClassName, final JavaRunConfigurationModule configurationModule) {
if (StringUtil.isEmpty(rtClassName)) return null;
final PsiClass psiClass = configurationModule.findClass(rtClassName);
if (psiClass != null) {
return psiClass.getName();
}
final int lastDot = rtClassName.lastIndexOf('.');
if (lastDot == -1 || lastDot == rtClassName.length() - 1) {
return rtClassName;