This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for 'paste'


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]