diff --git a/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTTypeUtils.java b/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTTypeUtils.java index 06ffc77d0..54d6b9e7c 100644 --- a/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTTypeUtils.java +++ b/qute.jdt/com.redhat.qute.jdt/src/main/java/com/redhat/qute/jdt/utils/JDTTypeUtils.java @@ -49,7 +49,14 @@ public static String getSimpleClassName(String className) { public static IType findType(IJavaProject project, String className) { try { - return project.findType(className, new NullProgressMonitor()); + IType type = project.findType(className, new NullProgressMonitor()); + if (type != null && type.exists()) { + return type; + } + } catch (JavaModelException e) { + } + try { + return project.findType(className); } catch (JavaModelException e) { LOGGER.log(Level.SEVERE, "Error while finding type for '" + className + "'.", e); return null;