@@ -188,13 +188,15 @@ public void visit(
188
188
189
189
// Add references to each of the interfaces.
190
190
for (String iface : interfaces ) {
191
- addReference (
192
- new Reference .Builder (iface )
193
- .withSource (
194
- refSourceClassName ,
195
- UNDEFINED_LINE ) // We don't have a specific line number to use.
196
- .withFlag (Reference .EXPECTS_PUBLIC )
197
- .build ());
191
+ if (!ignoreReference (iface )) {
192
+ addReference (
193
+ new Reference .Builder (iface )
194
+ .withSource (
195
+ refSourceClassName ,
196
+ UNDEFINED_LINE ) // We don't have a specific line number to use.
197
+ .withFlag (Reference .EXPECTS_PUBLIC )
198
+ .build ());
199
+ }
198
200
}
199
201
// the super type is handled by the method visitor to the constructor.
200
202
super .visit (version , access , name , signature , superName , interfaces );
@@ -286,7 +288,8 @@ public void visitFieldInsn(
286
288
287
289
final Type underlyingFieldType = underlyingType (fieldType );
288
290
String underlyingFieldTypeInternalName = underlyingFieldType .getInternalName ();
289
- if (underlyingFieldType .getSort () == Type .OBJECT ) {
291
+ if (underlyingFieldType .getSort () == Type .OBJECT
292
+ && !ignoreReference (underlyingFieldTypeInternalName )) {
290
293
addReference (
291
294
new Reference .Builder (underlyingFieldTypeInternalName )
292
295
.withSource (refSourceClassName , currentLineNumber )
@@ -323,7 +326,7 @@ public void visitMethodInsn(
323
326
{ // ref for method return type
324
327
final Type returnType = underlyingType (methodType .getReturnType ());
325
328
String returnTypeInternalName = returnType .getInternalName ();
326
- if (returnType .getSort () == Type .OBJECT ) {
329
+ if (returnType .getSort () == Type .OBJECT && ! ignoreReference ( returnTypeInternalName ) ) {
327
330
addReference (
328
331
new Reference .Builder (returnTypeInternalName )
329
332
.withSource (refSourceClassName , currentLineNumber )
@@ -336,7 +339,7 @@ public void visitMethodInsn(
336
339
for (Type paramType : methodType .getArgumentTypes ()) {
337
340
paramType = underlyingType (paramType );
338
341
String paramTypeInternalName = paramType .getInternalName ();
339
- if (paramType .getSort () == Type .OBJECT ) {
342
+ if (paramType .getSort () == Type .OBJECT && ! ignoreReference ( paramTypeInternalName ) ) {
340
343
addReference (
341
344
new Reference .Builder (paramTypeInternalName )
342
345
.withSource (refSourceClassName , currentLineNumber )
@@ -425,7 +428,7 @@ public void visitLdcInsn(final Object value) {
425
428
if (value instanceof Type ) {
426
429
final Type type = underlyingType ((Type ) value );
427
430
String typeInternalName = type .getInternalName ();
428
- if (type .getSort () == Type .OBJECT ) {
431
+ if (type .getSort () == Type .OBJECT && ! ignoreReference ( typeInternalName ) ) {
429
432
addReference (
430
433
new Reference .Builder (typeInternalName )
431
434
.withSource (refSourceClassName , currentLineNumber )
0 commit comments