Skip to content

Commit

Permalink
[JavaTypeSystem] Add JavaFieldModel.ToString(). (#1144)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jpobst authored Sep 14, 2023
1 parent eac0d58 commit 75d8221
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,13 @@ public override void Resolve (JavaTypeCollection types, ICollection<JavaUnresolv
return;
}
}

public override string ToString ()
{
if (DeclaringType != null)
return $"[Field] {DeclaringType.FullName}.{Name}";

return $"[Field] {Name}";
}
}
}

0 comments on commit 75d8221

Please sign in to comment.