[PATCH] Fix for 'paste'
Fernando Nasser
fnasser@redhat.com
Mon Dec 8 22:52:00 GMT 2003
Tom Tromey wrote:
> Fernando> This patch fixes it by returning the object accordingly to the
> Fernando> DataFlavor specified by the caller.
>
> I forgot to mention: the best thing in a case like this, where the
> docs are confusing, is to try it out on the Sun JDK and see what
> happens.
>
Exactly. That is why I have an instance of the Accunia testsuite compiled and
running with the Sun SDK on the right and our libgcj/CLASSPATH one running on
the left. ;-) And with this patch the results become consistent.
I disagree that the documentation is not clear in this case though. Perhaps you
were looking in an old book? The documentation with JDK 1.4.2 clearly states
that getTransferData "Returns an object which represents the data to be
transferred. The class of the object returned is defined by the representation
class of the flavor." and for stringFlavor "representationClass =
java.lang.String" and for plainTextFlavor "representationClass = InputStream".
And these are the only two that we support (we throw an IllegalArgumentException
for others).
Regards,
Fernando
More information about the Java-patches
mailing list