@@ -284,6 +284,7 @@ protected Object loadReferenceTypeLock() {
284
284
285
285
@ Override
286
286
protected void maybeEagerlyResolve (int cpi , int bytecode ) {
287
+ lastUnresolvedElementException = null ;
287
288
try {
288
289
super .maybeEagerlyResolve (cpi , bytecode );
289
290
} catch (UnresolvedElementException e ) {
@@ -294,12 +295,19 @@ protected void maybeEagerlyResolve(int cpi, int bytecode) {
294
295
* ConstantPool.lookupType() which should return an UnresolvedJavaType which we
295
296
* know how to deal with.
296
297
*/
298
+ lastUnresolvedElementException = e ;
297
299
} else {
298
300
throw e ;
299
301
}
300
302
}
301
303
}
302
304
305
+ /**
306
+ * The type resolution error, if any, encountered in the last call to
307
+ * {@link #maybeEagerlyResolve}.
308
+ */
309
+ UnresolvedElementException lastUnresolvedElementException ;
310
+
303
311
@ Override
304
312
protected JavaType maybeEagerlyResolve (JavaType type , ResolvedJavaType accessingClass ) {
305
313
try {
@@ -594,7 +602,7 @@ private static Class<?>[] signatureToClasses(JavaMethod method) {
594
602
}
595
603
596
604
private void reportUnresolvedElement (String elementKind , String elementAsString ) {
597
- reportUnresolvedElement (elementKind , elementAsString , null );
605
+ reportUnresolvedElement (elementKind , elementAsString , lastUnresolvedElementException );
598
606
}
599
607
600
608
private void reportUnresolvedElement (String elementKind , String elementAsString , Throwable cause ) {
0 commit comments