Skip to content

Commit 75d8221

Browse files
authored
[JavaTypeSystem] Add JavaFieldModel.ToString(). (#1144)
Context: https://discord.com/channels/732297728826277939/732297837953679412/1151531791069499524 A user reported the following output in their `java-resolution-report.log`: The field 'Java.Interop.Tools.JavaTypeSystem.Models.JavaFieldModel' was removed because its name contains a dollar sign. The class '[Class] com.google.android.libraries.navigation.internal.aac.ad' was removed because the Java base type 'com.google.android.libraries.navigation.internal.aad.ar<com.google.android.libraries.navigation.internal.aac.af<K, V>>' could not be found. We should be providing the user with the name of the removed field rather than the `JavaFieldModel` type name. To do this, add an appropriate `JavaFieldModel.ToString ()` method override.
1 parent eac0d58 commit 75d8221

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Java.Interop.Tools.JavaTypeSystem/JavaModels/JavaFieldModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,13 @@ public override void Resolve (JavaTypeCollection types, ICollection<JavaUnresolv
4343
return;
4444
}
4545
}
46+
47+
public override string ToString ()
48+
{
49+
if (DeclaringType != null)
50+
return $"[Field] {DeclaringType.FullName}.{Name}";
51+
52+
return $"[Field] {Name}";
53+
}
4654
}
4755
}

0 commit comments

Comments
 (0)