IDEA-106381 GUI Designer: JComboBoxes list does not populated under JDK7 and works fine under JDK6

This commit is contained in:
Alexander Lobas
2014-08-06 11:54:42 +04:00
parent 052a5df703
commit e2e32e60de
2 changed files with 7 additions and 1 deletions
@@ -923,6 +923,10 @@ public class StringUtil extends StringUtilRt {
}
}
public static String defaultIfEmpty(@Nullable String value, String defaultValue) {
return isEmpty(value) ? defaultValue : value;
}
@Contract("null -> false")
public static boolean isNotEmpty(@Nullable String s) {
return s != null && !s.isEmpty();
@@ -16,6 +16,7 @@
package com.intellij.uiDesigner;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.util.ClassUtil;
@@ -74,7 +75,8 @@ public final class PsiPropertiesProvider implements PropertiesProvider {
}
final PsiType type = getter.getReturnType();
final String propertyClassName = type.getCanonicalText();
String propertyClassName =
StringUtil.defaultIfEmpty(StringUtil.substringBefore(type.getCanonicalText(), "<"), type.getCanonicalText());
LwIntrospectedProperty property = CompiledClassPropertiesProvider.propertyFromClassName(propertyClassName, name);
if (property == null) {