This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Fix for 'paste'
>>>>> "Fernando" == Fernando Nasser <fnasser@redhat.com> writes:
Fernando> Exactly. That is why I have an instance of the Accunia
Fernando> testsuite compiled and running with the Sun SDK on the right
Fernando> and our libgcj/CLASSPATH one running on the left. ;-) And
Fernando> with this patch the results become consistent.
Cool, thanks.
Fernando> I disagree that the documentation is not clear in this case
Fernando> though. Perhaps you were looking in an old book? The documentation
Fernando> with JDK 1.4.2 clearly states that getTransferData "Returns an object
Fernando> which represents the data to be transferred. The class of the object
Fernando> returned is defined by the representation class of the flavor." and
Fernando> for stringFlavor "representationClass = java.lang.String" and for
Fernando> plainTextFlavor "representationClass = InputStream".
Fernando> And these are the only two that we support (we throw an
Fernando> IllegalArgumentException for others).
I looked here:
http://java.sun.com/j2se/1.4.2/docs/api/java/awt/datatransfer/StringSelection.html#getTransferData(java.awt.datatransfer.DataFlavor)
That's where the bit about Reader and the inconsistency with the
definition of plainTextFlavor comes from.
If the test suite works ok, though, then perhaps the URL above is
incorrect and Sun really does return an InputStream. In which case
the patch is fine, thanks. It might be helpful to have a comment
explaining the situation, up to you.
Tom