diff --git a/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/jdtls/JdtLsIndex.java b/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/jdtls/JdtLsIndex.java index 857526555..04a269c04 100644 --- a/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/jdtls/JdtLsIndex.java +++ b/headless-services/commons/commons-java/src/main/java/org/springframework/ide/vscode/commons/jdtls/JdtLsIndex.java @@ -122,14 +122,15 @@ public class JdtLsIndex implements ClasspathIndex { sourceTypeCache.put(fqName, type); } else { type = Optional.of(toType(data)); - if (Classpath.isBinary(data.getClasspathEntry().getCpe())) { + if (data.getClasspathEntry() != null && Classpath.isBinary(data.getClasspathEntry().getCpe())) { binaryTypeCache.put(fqName, type); } else { sourceTypeCache.put(fqName, type); } } } catch (Exception e) { - log.error("{}", e); + log.error("Find type failed for `{}` with {}", fqName, e); + return null; } } return type.orElse(null); diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/metadata/types/TypeUtil.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/metadata/types/TypeUtil.java index 00e3e84f6..ffc51a5bc 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/metadata/types/TypeUtil.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/metadata/types/TypeUtil.java @@ -600,9 +600,11 @@ public class TypeUtil { public boolean isEnum(Type type) { try { - IType eclipseType = findType(type.getErasure()); - if (eclipseType!=null) { - return eclipseType.isEnum(); + if (!isArray(type)) { + IType eclipseType = findType(type.getErasure()); + if (eclipseType!=null) { + return eclipseType.isEnum(); + } } } catch (Exception e) { log.error("", e);