-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Labels
bugComponent does not function as intendedComponent does not function as intendedgeneratorIssues binding a Java library (generator, class-parse, etc.)Issues binding a Java library (generator, class-parse, etc.)
Milestone
Description
Context:
In bindings we generate cb_* (delegates, etc ) stuff based on native types.
Now in the case when 2 methods with the same name and the same parameters, but different return types exist, renaming managedName does not help because there are 2 sets of cb_* variables.
There are 2 potentional workarounds:
-
generating
cb_*based on managed names and types -
addding return type to
cb_*
Curently user has to remove both methods.
<method abstract="false" deprecated="not deprecated" final="false" name="setDetectorMode" jni-signature="(I)Lcom/google/mlkit/vision/objects/defaults/ObjectDetectorOptions$Builder;" bridge="false" native="false" return="com.google.mlkit.vision.objects.defaults.ObjectDetectorOptions.Builder" jni-return="Lcom/google/mlkit/vision/objects/defaults/ObjectDetectorOptions$Builder;" static="false" synchronized="false" synthetic="false" visibility="public" return-not-null="true">
<parameter name="detectorMode" type="int" jni-type="I" />
</method>
<method abstract="false" deprecated="not deprecated" final="true" name="setDetectorMode" jni-signature="(I)Lcom/google/mlkit/vision/objects/ObjectDetectorOptionsBase$Builder;" bridge="true" native="false" return="java.lang.Object" jni-return="Lcom/google/mlkit/vision/objects/ObjectDetectorOptionsBase$Builder;" static="false" synchronized="false" synthetic="true" visibility="public" return-not-null="true">
<parameter name="p0" type="int" jni-type="I" />
</method>Discord comments:
jpobst — Today at 8:40 PM
hmm, i guess generator doesn't even read in the bridge info, so it would treat them as regular methods:
https://github.com/xamarin/java.interop/blob/main/tools/generator/Java.Interop.Tools.Generator.Importers/XmlApiImporter.cs#L363
while adding the return type to the cb_ would fix this one, it probably wouldn't fix all the cases, we may need to use the managed name instead of the java name
Jonathan Pryor — Today at 8:48 PM
except in this case the method signature would be identical, which would result in C# errors anyway
jpobst — Today at 8:48 PM
if the user has changed the managed name both could coexist
Jonathan Pryor — Today at 8:48 PM
fair
so the cb_* fields should really include managedName somehow
Metadata
Metadata
Assignees
Labels
bugComponent does not function as intendedComponent does not function as intendedgeneratorIssues binding a Java library (generator, class-parse, etc.)Issues binding a Java library (generator, class-parse, etc.)