Skip to content

Commit ee4b29a

Browse files
committed
Throw exception with better message for telemetry
1 parent e71091b commit ee4b29a

File tree

1 file changed

+8
-5
lines changed
  • headless-services/jdt-ls-extension/org.springframework.tooling.jdt.ls.commons/src/org/springframework/tooling/jdt/ls/commons/java

1 file changed

+8
-5
lines changed

headless-services/jdt-ls-extension/org.springframework.tooling.jdt.ls.commons/src/org/springframework/tooling/jdt/ls/commons/java/JavaData.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ private MethodData createMethodData(IType type, IMethod method) {
238238
data.setBindingKey(method.getKey());
239239
ImmutableList.Builder<AnnotationData> annotationsBuilder = ImmutableList.builder();
240240
ImmutableList.Builder<JavaTypeData> parametersBuilder = ImmutableList.builder();
241-
ImmutableList.Builder<String> paramNamesBuilder = ImmutableList.builder();
242241
try {
243242
data.setConstructor(method.isConstructor());
244243
data.setReturnType(createFromSignature(type, method.getReturnType()));
@@ -527,11 +526,15 @@ private String[] resolveFQNames(IType type, String[] names) {
527526

528527
private String resolveFQName(IType type, String name) throws JavaModelException {
529528
if (name!=null) {
530-
String[][] resolution = type.resolveType(name);
531-
if (resolution != null && resolution.length > 0 && resolution[0].length > 1) {
532-
return resolution[0][0] + "." + resolution[0][1].replace('.', '$');
529+
try {
530+
String[][] resolution = type.resolveType(name);
531+
if (resolution != null && resolution.length > 0 && resolution[0].length > 1) {
532+
return resolution[0][0] + "." + resolution[0][1].replace('.', '$');
533+
}
534+
return name;
535+
} catch (Throwable t) {
536+
throw new IllegalStateException("Failed to resolve `%s` from resolved type `%s`".formatted(name, type.getElementName()), t);
533537
}
534-
return name;
535538
}
536539
return null;
537540
}

0 commit comments

Comments
 (0)