зеркало из https://github.com/mono/mail-archives.git
187 строки
9.4 KiB
HTML
187 строки
9.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [mono-android] Binding classes don't implement Java.Lang.IComparable
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:monodroid%40lists.ximian.com?Subject=Re%3A%20%5Bmono-android%5D%20Binding%20classes%0A%09don%27t%09implement%09Java.Lang.IComparable&In-Reply-To=%3C509234E3.70409%40veritas-vos-liberabit.com%3E">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<style type="text/css">
|
|
pre {
|
|
white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */
|
|
}
|
|
</style>
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
|
|
<LINK REL="Next" HREF="012758.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[mono-android] Binding classes don't implement Java.Lang.IComparable</H1>
|
|
<B>Atsushi Eno</B>
|
|
<A HREF="mailto:monodroid%40lists.ximian.com?Subject=Re%3A%20%5Bmono-android%5D%20Binding%20classes%0A%09don%27t%09implement%09Java.Lang.IComparable&In-Reply-To=%3C509234E3.70409%40veritas-vos-liberabit.com%3E"
|
|
TITLE="[mono-android] Binding classes don't implement Java.Lang.IComparable">atsushieno at veritas-vos-liberabit.com
|
|
</A><BR>
|
|
<I>Thu Nov 1 08:37:55 UTC 2012</I>
|
|
<P><UL>
|
|
|
|
<LI>Next message: <A HREF="012758.html">[mono-android] 4.2.8: Provider fails to include authorities in AndroidManifest.xml
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#12757">[ date ]</a>
|
|
<a href="thread.html#12757">[ thread ]</a>
|
|
<a href="subject.html#12757">[ subject ]</a>
|
|
<a href="author.html#12757">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Oh, OK. I discovered that things are much more complicated than it seemed.
|
|
|
|
First, you were right, Comparable<T> is (actually Comparable<T> and
|
|
Comarator<T> are) *special* case that *dropped* compareTo() method from
|
|
the API description XML. It is to be consistent with the existing AOSP's
|
|
API definition.
|
|
|
|
That have been special (at least, regarded so) and as a result it
|
|
becomes *mandatory* to get CompareTo() method.
|
|
|
|
And altering interface <implements> element by <attr> in Metadata.xml
|
|
doesn't work for this case, because unlike binding android.jar
|
|
java.lang.Comparable<T> cannot be looked up (it needs more investigation
|
|
to know precise situation, but as a general rule generics don't exist in
|
|
jar).
|
|
|
|
Hence, some Metadata.xml fixup has to be done manually, like:
|
|
|
|
<add-node
|
|
path="/api/package[@name='com.lowagie.text']/class[@name='Font']">
|
|
<method name="compareTo" return="int" abstract="false"
|
|
native="false" synchronized="false" static="false" final="false"
|
|
deprecated="not deprecated" visibility="public">
|
|
<parameter name="o" type="java.lang.Object" />
|
|
</method>
|
|
</add-node>
|
|
|
|
It in general falls to "generics only partially supported" category of
|
|
binding limitations, but the recipe to deal with is slightly different,
|
|
which we weren't fully aware. So far please take this as a normative
|
|
way. Sorry for the missing information.
|
|
|
|
Apart from that, you will have to rename "harmony.java.lang" to
|
|
something different, because it brings conflict between "Java.Lang" and
|
|
"Harmony.Java.Lang" which has never been expected. This is hopefully
|
|
fixed in the next release but so far this is a limitation.
|
|
|
|
Thanks,
|
|
Atsushi Eno
|
|
|
|
|
|
Jeremy A. Kolb - ARA/NED wrote:
|
|
><i> No it definitely implements compateTo(java.lang.Object: "public int compareTo(Object object)"
|
|
</I>><i>
|
|
</I>><i> -----Original Message-----
|
|
</I>><i> From: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A> [mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>] On Behalf Of Atsushi Eno
|
|
</I>><i> Sent: Wednesday, October 31, 2012 3:40 PM
|
|
</I>><i> To: Discussions related to Mono for Android
|
|
</I>><i> Subject: Re: [mono-android] Binding classes don't implement Java.Lang.IComparable
|
|
</I>><i>
|
|
</I>><i> The implemented class doesn't contain compareTo(java.lang.Object) but compareTo(SomeSpecificType), whose type don't match and hence not regarded as implementation.
|
|
</I>><i>
|
|
</I>><i> If that's not about that, it is not likely about Comparable but different issue.
|
|
</I>><i>
|
|
</I>><i> Atsushi Eno
|
|
</I>><i>
|
|
</I>><i> Jeremy A. Kolb - ARA/NED wrote:
|
|
</I>>><i> That doesn't make sense to me. IComparable.compareTo takes in an Object not another type so it shouldn't care about generics.
|
|
</I>>><i>
|
|
</I>>><i> -----Original Message-----
|
|
</I>>><i> From: <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>
|
|
</I>>><i> [mailto:<A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">monodroid-bounces at lists.ximian.com</A>] On Behalf Of Atsushi Eno
|
|
</I>>><i> Sent: Wednesday, October 31, 2012 3:25 PM
|
|
</I>>><i> To: Discussions related to Mono for Android
|
|
</I>>><i> Subject: Re: [mono-android] Binding classes don't implement
|
|
</I>>><i> Java.Lang.IComparable
|
|
</I>>><i>
|
|
</I>>><i> Hello,
|
|
</I>>><i>
|
|
</I>>><i> That is a known limitation. The thing is, *generics don't really exist* in compiled java classes and we always need to explicitly supply which class the Comparable compares.
|
|
</I>>><i>
|
|
</I>>><i> Hence the solution is, you add appropriate instantiated generic interface to Metadata.xml. This is an example:
|
|
</I>>><i>
|
|
</I>>><i> <attr
|
|
</I>>><i> path="/api/package[@name='android.content']/class[@name='ComponentName']/implements[@name='java.lang.Comparable']"
|
|
</I>>><i> name="name">java.lang.Comparable<android.content.ComponentName><
|
|
</I>>><i> /attr>
|
|
</I>>><i>
|
|
</I>>><i> Atsushi Eno
|
|
</I>>><i>
|
|
</I>>><i> Jeremy A. Kolb - ARA/NED wrote:
|
|
</I>>>><i> I'm trying to bind droidtext (<A HREF="http://code.google.com/p/droidtext">http://code.google.com/p/droidtext</A>) and
|
|
</I>>>><i> having a lot of trouble with classes not implementing
|
|
</I>>>><i> Java.Lang.IComparable.CompareTo. I can look at the java files and see
|
|
</I>>>><i> that the functions are implemented and public but bindings aren't
|
|
</I>>>><i> being generated for them. Has anyone seen this before? I don't see
|
|
</I>>>><i> anything in the logs about why this function isn't being picked up.
|
|
</I>>>><i>
|
|
</I>>>><i>
|
|
</I>>>><i>
|
|
</I>>>><i> _______________________________________________
|
|
</I>>>><i> Monodroid mailing list
|
|
</I>>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>>><i>
|
|
</I>>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>>><i> _______________________________________________
|
|
</I>>><i> Monodroid mailing list
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>><i>
|
|
</I>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>>><i> _______________________________________________
|
|
</I>>><i> Monodroid mailing list
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>>><i>
|
|
</I>>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>>><i>
|
|
</I>>><i>
|
|
</I>>><i>
|
|
</I>><i> _______________________________________________
|
|
</I>><i> Monodroid mailing list
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>><i>
|
|
</I>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>><i> _______________________________________________
|
|
</I>><i> Monodroid mailing list
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">Monodroid at lists.ximian.com</A>
|
|
</I>><i>
|
|
</I>><i> UNSUBSCRIBE INFORMATION:
|
|
</I>><i> <A HREF="http://lists.ximian.com/mailman/listinfo/monodroid">http://lists.ximian.com/mailman/listinfo/monodroid</A>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>><i>
|
|
</I>
|
|
</PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
|
|
<LI>Next message: <A HREF="012758.html">[mono-android] 4.2.8: Provider fails to include authorities in AndroidManifest.xml
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#12757">[ date ]</a>
|
|
<a href="thread.html#12757">[ thread ]</a>
|
|
<a href="subject.html#12757">[ subject ]</a>
|
|
<a href="author.html#12757">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/monodroid">More information about the Monodroid
|
|
mailing list</a><br>
|
|
</body></html>
|