| Message: 119224 |
 |
BY: arton Tajima (arton) DATE: 2012-12-17 14:42 SUBJECT: RE: throw exception if instance is rewrite I think you may add ! at end of the replace because it replace the instance it self.
class Jstr
JSTR = Rjb::import('java.lang.String')
def initialize(str)
@instance = JSTR.new_with_sig('...
end
def replace!(ori, other)
# replaceAll resturns Ruby string (not Rjb Proxy), so you may recreate Proxy instance
@instance = jSTR.new_with_sig('...', @instance._invoke ...)
end
def getStr
@instance.to_string
end
end
regards. | |