From: SourceForge.net <no...@so...> - 2007-07-30 02:45:40
|
Patches item #1761748, was opened at 2007-07-26 23:26 Message generated for change (Comment added) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1761748&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Rejected Priority: 5 Private: No Submitted By: keshav upadhyaya (ukeshav) Assigned to: Nobody/Anonymous (nobody) Summary: Patch for [ 1748817 ] Python __repr__ added to Java class is Initial Comment: Hi i have Done some changes in PyJavaInstance.java and it tried with test cases and it works fine now . Please look at the attached patch below. ---------------------------------------------------------------------- >Comment By: Charles Groves (cgroves) Date: 2007-07-29 21:45 Message: Logged In: YES user_id=1174327 Originator: NO Instead of using the code in this patch, I implemented this by having the superclass of PyJavaInstance, PyInstance, defer to a method makeDefaultRepr in its __repr__ if the class represented by that PyInstance doesn't define a custom __repr__ method. Then I overrode the new method in PyJavaInstance to provide the Java instance specific behavior of calling toString on the javaProxy. This has a couple benefits over the code in the patch. It doesn't recreate a lot of the code already in PyInstance to conditionally call a method on a class that the patch has in the __finditem__ then __finditem__.__call__ section. It also correctly chains calls from __str__ to __repr__ if __str__ doesn't exist instead of the other way around. This was wrong in PyJavaInstance as it stood, but it didn't matter up until now since __str__ and __repr__ were always identical. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=312867&aid=1761748&group_id=12867 |