You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
However, sometimes the desired fix is "none of the above". For example, there may not be a method to override, however the class is sealed so virtual is not a valid option either. Both keywords must be omitted.
The question is how to "reabstract" IAnnotatedType.AnnotatedOwnerType within generator & Metadata? A plausible answer may be to use propertyName to change AnnotatedArrayType.getAnnotatedOwnerType() to IAnnotatedType.AnnotatedOwnerType:
<attrpath="/api/package[@name='java.lang.reflect']/interface[@name='AnnotatedArrayType']/method[@name='getAnnotatedOwnerType' and count(parameter)=0]"name="propertyName">IAnnotatedType.AnnotatedOwnerType</attr>
This partially works:
publicpartialinterfaceIAnnotatedArrayType:global::Java.Lang.Reflect.IAnnotatedType{global::Java.Lang.Reflect.IAnnotatedType?IAnnotatedType.AnnotatedOwnerType{// Metadata.xml XPath method reference: path="/api/package[@name='java.lang.reflect']/interface[@name='AnnotatedArrayType']/method[@name='getAnnotatedOwnerType' and count(parameter)=0]"[global::Java.Interop.JniMethodSignature("getAnnotatedOwnerType","()Ljava/lang/reflect/AnnotatedType;")]get;}}
However, it fails to compile:
Java.Lang.Reflect.IAnnotatedArrayType.cs(19,4): error CS0501:
'IAnnotatedArrayType.IAnnotatedType.AnnotatedOwnerType.get' must declare a body because it is not marked abstract, extern, or partial
Thus, a fourthmanagedOverride value of abstract could be useful:
<attrpath="/api/package[@name='java.lang.reflect']/interface[@name='AnnotatedArrayType']/method[@name='getAnnotatedOwnerType' and count(parameter)=0]"name="managedOverride">abstract</attr>
Which, in combination with the propertyName override, would emit:
publicpartialinterfaceIAnnotatedArrayType:global::Java.Lang.Reflect.IAnnotatedType{abstractglobal::Java.Lang.Reflect.IAnnotatedType?IAnnotatedType.AnnotatedOwnerType{// Metadata.xml XPath method reference: path="/api/package[@name='java.lang.reflect']/interface[@name='AnnotatedArrayType']/method[@name='getAnnotatedOwnerType' and count(parameter)=0]"[global::Java.Interop.JniMethodSignature("getAnnotatedOwnerType","()Ljava/lang/reflect/AnnotatedType;")]get;}}
(Another question on our call earlier today was whether or not this would be "enough". These two fixes are "enough" to get the current src/Java.Base to build, which is a data point, but I don't know for certain if setting propertyName to IAnnotatedType.AnnotatedOwnerType will always work.)
Thus, a fourth managedOverride value of abstract could be useful:
Is this not fixed by setting abstract to true?
<attrpath="/api/package[@name='java.lang.reflect']/interface[@name='AnnotatedArrayType']/method[@name='getAnnotatedOwnerType' and count(parameter)=0]"name="abstract">true</attr>
I went with reabstract to denote this is only needed/supported for interface methods/properties. Normal class members should be controlled with the usual abstract='true' XML.
Activity
jonpryor commentedon May 10, 2022
Tangentially related is this TODO from a65d6fb:
The solution is to "reabstract" the member:
The question is how to "reabstract"
IAnnotatedType.AnnotatedOwnerTypewithingenerator& Metadata? A plausible answer may be to usepropertyNameto changeAnnotatedArrayType.getAnnotatedOwnerType()toIAnnotatedType.AnnotatedOwnerType:This partially works:
However, it fails to compile:
Thus, a fourth
managedOverridevalue ofabstractcould be useful:Which, in combination with the
propertyNameoverride, would emit:(Another question on our call earlier today was whether or not this would be "enough". These two fixes are "enough" to get the current
src/Java.Baseto build, which is a data point, but I don't know for certain if settingpropertyNametoIAnnotatedType.AnnotatedOwnerTypewill always work.)jpobst commentedon May 10, 2022
Is this not fixed by setting
abstracttotrue?jonpryor commentedon May 10, 2022
@jpobst asked:
It's already
true;obj/Debug-net6.0/mcw/api.xml.adjusted.fixedcontains:Yet
abstractisn't emitted, presumably because this is on aninterface, and thus members are already assumed to be implicitlyabstract?jpobst commentedon Jun 28, 2022
I went with
reabstractto denote this is only needed/supported forinterfacemethods/properties. Normal class members should be controlled with the usualabstract='true'XML.[generator] Add `@managedOverride` values `none` and `reabstract`. (#…
Bump to xamarin/java.interop/main@c942ab68 (#7157)
[generator] Add `@managedOverride` values `none` and `reabstract`. (#…