Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread
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.


Thread View

Thread Author Date
throw exception if instance is rewritexiao li2012-12-17 13:25
      RE: throw exception if instance is rewritexiao li2012-12-17 13:33
            RE: throw exception if instance is rewritearton Tajima2012-12-17 14:42
                  RE: throw exception if instance is rewritexiao li2012-12-18 07:41

Post a followup to this message