rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3);
result = getRubyFrame().getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3);
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject value = null; RubyObject result = null; RubyModule rubyClass = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N: while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { eval(self, node.nd_body()); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: rubyBlock.push(node.nd_var(), node.nd_body(), self); rubyIter.push(Iter.ITER_PRE); while (true) { try { if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = rubyBlock.flags &= ~RubyBlock.BLOCK_D_SCOPE; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_iter()); endCallArgs(tmpBlock); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } break; } catch (RetryException rExcptn) { } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { result = ruby.getNil(); break; } } rubyIter.pop(); rubyBlock.pop(); return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { if (eval(self, node.nd_beg()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), eval(self, node.nd_end()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_FLIP3: /* like SED */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { result = eval(self, node.nd_beg()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.rubyScope.setLocalVars(node.nd_cnt(), result); } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: NODE saved_cref = null; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby.rubyScope.push(); if (node.nd_rval() != null) { saved_cref = ruby_cref; ruby_cref = (NODE)node.nd_rval(); rubyFrame.setCbase(node.nd_rval()); } if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } result = eval(self, node.nd_next()); ruby.rubyScope.pop(); rubyFrame = frame.getTmp(); if (saved_cref != null) { ruby_cref = saved_cref; } return result; case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // HACK +++ val = (RubyBoolean)recv.funcall((RubyId)node.nd_next().nd_aid(), val); // HACK --- return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: value = eval(self, node.nd_head()); if (value instanceof RubyModule) { return ((RubyModule)value).getConstant((RubyId)node.nd_mid()); } else { return value.funcall((RubyId)node.nd_mid()); } case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH: RubyHash hash = RubyHash.m_newHash(ruby); NODE list = node.nd_head(); while(list != null) { RubyObject key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { // HACK +++ throw new RubyArgumentException("odd number list for Hash"); // HACK --- } value = eval(self, list.nd_head()); hash.m_aset(key, value); list = list.nd_next(); } return hash; case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: ArrayList ary = new ArrayList(node.nd_alen()); for (; node != null ; node = node.nd_next()) { ary.add(eval(self, node.nd_head())); } return RubyArray.m_newArray(getRuby(), ary); case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: RubyGlobalEntry.getGlobalEntry((RubyId)node.nd_old()).alias((RubyId)node.nd_new()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); // end goto } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
Frame frame = rubyFrame; frame.setTmp(rubyFrame);
Frame frame = getRubyFrame(); frame.setTmp(getRubyFrame());
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject value = null; RubyObject result = null; RubyModule rubyClass = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N: while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { eval(self, node.nd_body()); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: rubyBlock.push(node.nd_var(), node.nd_body(), self); rubyIter.push(Iter.ITER_PRE); while (true) { try { if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = rubyBlock.flags &= ~RubyBlock.BLOCK_D_SCOPE; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_iter()); endCallArgs(tmpBlock); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } break; } catch (RetryException rExcptn) { } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { result = ruby.getNil(); break; } } rubyIter.pop(); rubyBlock.pop(); return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { if (eval(self, node.nd_beg()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), eval(self, node.nd_end()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_FLIP3: /* like SED */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { result = eval(self, node.nd_beg()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.rubyScope.setLocalVars(node.nd_cnt(), result); } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: NODE saved_cref = null; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby.rubyScope.push(); if (node.nd_rval() != null) { saved_cref = ruby_cref; ruby_cref = (NODE)node.nd_rval(); rubyFrame.setCbase(node.nd_rval()); } if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } result = eval(self, node.nd_next()); ruby.rubyScope.pop(); rubyFrame = frame.getTmp(); if (saved_cref != null) { ruby_cref = saved_cref; } return result; case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // HACK +++ val = (RubyBoolean)recv.funcall((RubyId)node.nd_next().nd_aid(), val); // HACK --- return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: value = eval(self, node.nd_head()); if (value instanceof RubyModule) { return ((RubyModule)value).getConstant((RubyId)node.nd_mid()); } else { return value.funcall((RubyId)node.nd_mid()); } case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH: RubyHash hash = RubyHash.m_newHash(ruby); NODE list = node.nd_head(); while(list != null) { RubyObject key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { // HACK +++ throw new RubyArgumentException("odd number list for Hash"); // HACK --- } value = eval(self, list.nd_head()); hash.m_aset(key, value); list = list.nd_next(); } return hash; case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: ArrayList ary = new ArrayList(node.nd_alen()); for (; node != null ; node = node.nd_next()) { ary.add(eval(self, node.nd_head())); } return RubyArray.m_newArray(getRuby(), ary); case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: RubyGlobalEntry.getGlobalEntry((RubyId)node.nd_old()).alias((RubyId)node.nd_new()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); // end goto } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
rubyFrame.setCbase(node.nd_rval());
getRubyFrame().setCbase(node.nd_rval());
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject value = null; RubyObject result = null; RubyModule rubyClass = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N: while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { eval(self, node.nd_body()); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: rubyBlock.push(node.nd_var(), node.nd_body(), self); rubyIter.push(Iter.ITER_PRE); while (true) { try { if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = rubyBlock.flags &= ~RubyBlock.BLOCK_D_SCOPE; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_iter()); endCallArgs(tmpBlock); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } break; } catch (RetryException rExcptn) { } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { result = ruby.getNil(); break; } } rubyIter.pop(); rubyBlock.pop(); return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { if (eval(self, node.nd_beg()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), eval(self, node.nd_end()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_FLIP3: /* like SED */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { result = eval(self, node.nd_beg()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.rubyScope.setLocalVars(node.nd_cnt(), result); } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: NODE saved_cref = null; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby.rubyScope.push(); if (node.nd_rval() != null) { saved_cref = ruby_cref; ruby_cref = (NODE)node.nd_rval(); rubyFrame.setCbase(node.nd_rval()); } if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } result = eval(self, node.nd_next()); ruby.rubyScope.pop(); rubyFrame = frame.getTmp(); if (saved_cref != null) { ruby_cref = saved_cref; } return result; case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // HACK +++ val = (RubyBoolean)recv.funcall((RubyId)node.nd_next().nd_aid(), val); // HACK --- return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: value = eval(self, node.nd_head()); if (value instanceof RubyModule) { return ((RubyModule)value).getConstant((RubyId)node.nd_mid()); } else { return value.funcall((RubyId)node.nd_mid()); } case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH: RubyHash hash = RubyHash.m_newHash(ruby); NODE list = node.nd_head(); while(list != null) { RubyObject key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { // HACK +++ throw new RubyArgumentException("odd number list for Hash"); // HACK --- } value = eval(self, list.nd_head()); hash.m_aset(key, value); list = list.nd_next(); } return hash; case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: ArrayList ary = new ArrayList(node.nd_alen()); for (; node != null ; node = node.nd_next()) { ary.add(eval(self, node.nd_head())); } return RubyArray.m_newArray(getRuby(), ary); case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: RubyGlobalEntry.getGlobalEntry((RubyId)node.nd_old()).alias((RubyId)node.nd_new()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); // end goto } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self);
return getConstant((NODE)getRubyFrame().getCbase(), (RubyId)node.nd_vid(), self);
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject value = null; RubyObject result = null; RubyModule rubyClass = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N: while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { eval(self, node.nd_body()); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: rubyBlock.push(node.nd_var(), node.nd_body(), self); rubyIter.push(Iter.ITER_PRE); while (true) { try { if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = rubyBlock.flags &= ~RubyBlock.BLOCK_D_SCOPE; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_iter()); endCallArgs(tmpBlock); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } break; } catch (RetryException rExcptn) { } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { result = ruby.getNil(); break; } } rubyIter.pop(); rubyBlock.pop(); return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { if (eval(self, node.nd_beg()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), eval(self, node.nd_end()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_FLIP3: /* like SED */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { result = eval(self, node.nd_beg()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.rubyScope.setLocalVars(node.nd_cnt(), result); } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: NODE saved_cref = null; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby.rubyScope.push(); if (node.nd_rval() != null) { saved_cref = ruby_cref; ruby_cref = (NODE)node.nd_rval(); rubyFrame.setCbase(node.nd_rval()); } if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } result = eval(self, node.nd_next()); ruby.rubyScope.pop(); rubyFrame = frame.getTmp(); if (saved_cref != null) { ruby_cref = saved_cref; } return result; case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // HACK +++ val = (RubyBoolean)recv.funcall((RubyId)node.nd_next().nd_aid(), val); // HACK --- return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: value = eval(self, node.nd_head()); if (value instanceof RubyModule) { return ((RubyModule)value).getConstant((RubyId)node.nd_mid()); } else { return value.funcall((RubyId)node.nd_mid()); } case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH: RubyHash hash = RubyHash.m_newHash(ruby); NODE list = node.nd_head(); while(list != null) { RubyObject key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { // HACK +++ throw new RubyArgumentException("odd number list for Hash"); // HACK --- } value = eval(self, list.nd_head()); hash.m_aset(key, value); list = list.nd_next(); } return hash; case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: ArrayList ary = new ArrayList(node.nd_alen()); for (; node != null ; node = node.nd_next()) { ary.add(eval(self, node.nd_head())); } return RubyArray.m_newArray(getRuby(), ary); case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: RubyGlobalEntry.getGlobalEntry((RubyId)node.nd_old()).alias((RubyId)node.nd_new()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); // end goto } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
if (rubyFrame.getArgs().size() != 1) {
if (getRubyFrame().getArgs().size() != 1) {
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject value = null; RubyObject result = null; RubyModule rubyClass = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N: while (true) { try { // while (!rb_gets().isNil() false) { // HACK +++ if (true) { // HACK --- try { eval(self, node.nd_body()); } catch (RedoException rExcptn) { } } break; } catch (NextException nExcptn) { } catch (BreakException bExcptn) { break; } } return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: rubyBlock.push(node.nd_var(), node.nd_body(), self); rubyIter.push(Iter.ITER_PRE); while (true) { try { if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = rubyBlock.flags &= ~RubyBlock.BLOCK_D_SCOPE; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_iter()); endCallArgs(tmpBlock); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } break; } catch (RetryException rExcptn) { } catch (ReturnException rExcptn) { result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { result = ruby.getNil(); break; } } rubyIter.pop(); rubyBlock.pop(); return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { if (eval(self, node.nd_beg()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), eval(self, node.nd_end()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_FLIP3: /* like SED */ /*if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); }*/ if (ruby.rubyScope.getLocalVars(node.nd_cnt()).isFalse()) { result = eval(self, node.nd_beg()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.rubyScope.setLocalVars(node.nd_cnt(), result); } else { if (eval(self, node.nd_end()).isTrue()) { ruby.rubyScope.setLocalVars(node.nd_cnt(), ruby.getFalse()); } result = ruby.getTrue(); } return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; RubyBlock tmpBlock = beginCallargs(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = beginCallargs(); args = setupArgs(self, node.nd_args()); endCallArgs(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: NODE saved_cref = null; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby.rubyScope.push(); if (node.nd_rval() != null) { saved_cref = ruby_cref; ruby_cref = (NODE)node.nd_rval(); rubyFrame.setCbase(node.nd_rval()); } if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } result = eval(self, node.nd_next()); ruby.rubyScope.pop(); rubyFrame = frame.getTmp(); if (saved_cref != null) { ruby_cref = saved_cref; } return result; case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // HACK +++ val = (RubyBoolean)recv.funcall((RubyId)node.nd_next().nd_aid(), val); // HACK --- return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: value = eval(self, node.nd_head()); if (value instanceof RubyModule) { return ((RubyModule)value).getConstant((RubyId)node.nd_mid()); } else { return value.funcall((RubyId)node.nd_mid()); } case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH: RubyHash hash = RubyHash.m_newHash(ruby); NODE list = node.nd_head(); while(list != null) { RubyObject key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { // HACK +++ throw new RubyArgumentException("odd number list for Hash"); // HACK --- } value = eval(self, list.nd_head()); hash.m_aset(key, value); list = list.nd_next(); } return hash; case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: ArrayList ary = new ArrayList(node.nd_alen()); for (; node != null ; node = node.nd_next()) { ary.add(eval(self, node.nd_head())); } return RubyArray.m_newArray(getRuby(), ary); case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: RubyGlobalEntry.getGlobalEntry((RubyId)node.nd_old()).alias((RubyId)node.nd_new()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); // end goto } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
rubyFrame.setCbase((VALUE)ruby_cref);
getRubyFrame().setCbase((VALUE)ruby_cref);
public void init() { int state; if (initialized) { return; } initialized = true; topFrame = getRubyFrame(); rubyIter = new Iter(); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); getRuby().rubyScope.push();// PUSH_SCOPE(); getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalVars(null); // top_scope = getRuby().ruby_scope; /* default visibility is private at toplevel */ // SET_SCOPE(SCOPE_PRIVATE); // PUSH_TAG( PROT_NONE ); // if ((state = EXEC_TAG()) == 0) { // rb_call_inits(); ruby_class = getRuby().getObjectClass(); // ruby_frame.self = ruby_top_self; top_cref = new NODE(NODE_CREF, getRuby().getObjectClass(), null, null); ruby_cref = top_cref; rubyFrame.setCbase((VALUE)ruby_cref); // rb_define_global_const( "TOPLEVEL_BINDING", rb_f_binding( ruby_top_self ) ); // ruby_prog_init(); // } // POP_TAG(); // if (state != 0) { // error_print(); // } getRuby().rubyScope.pop();// POP_SCOPE(); // ruby_scope = top_scope; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
return rubyFrame.getIter() != Iter.ITER_NOT;
return getRubyFrame().getIter() != Iter.ITER_NOT;
public boolean isBlockGiven() { return rubyFrame.getIter() != Iter.ITER_NOT; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
return (rubyFrame.getPrev() != null) && (rubyFrame.getPrev().getIter() != Iter.ITER_NOT);
return (getRubyFrame().getPrev() != null) && (getRubyFrame().getPrev().getIter() != Iter.ITER_NOT);
public boolean isFBlockGiven() { return (rubyFrame.getPrev() != null) && (rubyFrame.getPrev().getIter() != Iter.ITER_NOT); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
Frame frame = rubyFrame; frame.setTmp(rubyFrame);
Frame frame = getRubyFrame(); frame.setTmp(getRubyFrame());
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; pushClass(); ruby_class = module; getRuby().rubyScope.push(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); POP_CREF(); RubyVarmap.pop(ruby); getRuby().rubyScope.pop(); popClass(); rubyFrame = frame.getTmp();// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
rubyFrame.setCbase((VALUE)ruby_cref);
getRubyFrame().setCbase((VALUE)ruby_cref);
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; pushClass(); ruby_class = module; getRuby().rubyScope.push(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); POP_CREF(); RubyVarmap.pop(ruby); getRuby().rubyScope.pop(); popClass(); rubyFrame = frame.getTmp();// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
frame.setPrev(rubyFrame);
frame.setPrev(getRubyFrame());
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { RubyObject result = ruby.getNil(); if (!(isBlockGiven() || isFBlockGiven()) || (rubyBlock == null)) { throw new RuntimeException("yield called out of block"); } RubyVarmap.push(ruby); pushClass(); RubyBlock block = rubyBlock.getTmp(); Frame frame = block.frame; frame.setPrev(rubyFrame); rubyFrame = frame; VALUE old_cref = ruby_cref; ruby_cref = (NODE)rubyFrame.getCbase(); RubyScope oldScope = ruby.rubyScope; ruby.rubyScope = block.scope; rubyBlock.pop(); if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { dynamicVars = new RubyVarmap(null, null, block.dynamicVars); } else { dynamicVars = block.dynamicVars; } ruby_class = (klass != null) ? klass : block.klass; if (klass == null) { self = (RubyObject)block.self; } NODE node = block.body; if (block.var != null) { // try { if (block.var == NODE.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() != 0) { throw new RubyArgumentException("wrong # of arguments ("+ ((RubyArray)value).length() + " for 0)"); } } else { if (block.var.nd_type() == NODE_MASGN) { massign(self, block.var, value, acheck); } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } assign(self, block.var, value, acheck); } } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } } rubyIter.push(block.iter); while (true) { try { if (node == null) { result = ruby.getNil(); } else if (node.nd_type() == NODE_CFUNC || node.nd_type() == NODE_IFUNC) { if (value == null) { value = RubyArray.m_newArray(ruby, 0); } result = ((RubyCallbackMethod)node.nd_cfnc()).execute(value, new RubyObject[] {(RubyObject)node.nd_tval(), self}, ruby); } else { result = eval(self, node); } break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { result = ruby.getNil(); break; } catch (BreakException bExcptn) { break; } catch (ReturnException rExcptn) { break; } } // pop_state: rubyIter.pop(); popClass(); RubyVarmap.pop(ruby); rubyBlock.setTmp(block); rubyFrame = rubyFrame.getPrev(); ruby_cref = (NODE)old_cref; // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); ruby.rubyScope = oldScope; /* * if (state) { * if (!block->tag) { * switch (state & TAG_MASK) { * case TAG_BREAK: * case TAG_RETURN: * jump_tag_but_local_jump(state & TAG_MASK); * break; * } * } * JUMP_TAG(state); * } */ return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
ruby_cref = (NODE)rubyFrame.getCbase();
ruby_cref = (NODE)getRubyFrame().getCbase();
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { RubyObject result = ruby.getNil(); if (!(isBlockGiven() || isFBlockGiven()) || (rubyBlock == null)) { throw new RuntimeException("yield called out of block"); } RubyVarmap.push(ruby); pushClass(); RubyBlock block = rubyBlock.getTmp(); Frame frame = block.frame; frame.setPrev(rubyFrame); rubyFrame = frame; VALUE old_cref = ruby_cref; ruby_cref = (NODE)rubyFrame.getCbase(); RubyScope oldScope = ruby.rubyScope; ruby.rubyScope = block.scope; rubyBlock.pop(); if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { dynamicVars = new RubyVarmap(null, null, block.dynamicVars); } else { dynamicVars = block.dynamicVars; } ruby_class = (klass != null) ? klass : block.klass; if (klass == null) { self = (RubyObject)block.self; } NODE node = block.body; if (block.var != null) { // try { if (block.var == NODE.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() != 0) { throw new RubyArgumentException("wrong # of arguments ("+ ((RubyArray)value).length() + " for 0)"); } } else { if (block.var.nd_type() == NODE_MASGN) { massign(self, block.var, value, acheck); } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } assign(self, block.var, value, acheck); } } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } } rubyIter.push(block.iter); while (true) { try { if (node == null) { result = ruby.getNil(); } else if (node.nd_type() == NODE_CFUNC || node.nd_type() == NODE_IFUNC) { if (value == null) { value = RubyArray.m_newArray(ruby, 0); } result = ((RubyCallbackMethod)node.nd_cfnc()).execute(value, new RubyObject[] {(RubyObject)node.nd_tval(), self}, ruby); } else { result = eval(self, node); } break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { result = ruby.getNil(); break; } catch (BreakException bExcptn) { break; } catch (ReturnException rExcptn) { break; } } // pop_state: rubyIter.pop(); popClass(); RubyVarmap.pop(ruby); rubyBlock.setTmp(block); rubyFrame = rubyFrame.getPrev(); ruby_cref = (NODE)old_cref; // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); ruby.rubyScope = oldScope; /* * if (state) { * if (!block->tag) { * switch (state & TAG_MASK) { * case TAG_BREAK: * case TAG_RETURN: * jump_tag_but_local_jump(state & TAG_MASK); * break; * } * } * JUMP_TAG(state); * } */ return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
rubyFrame = rubyFrame.getPrev();
rubyFrame = getRubyFrame().getPrev();
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { RubyObject result = ruby.getNil(); if (!(isBlockGiven() || isFBlockGiven()) || (rubyBlock == null)) { throw new RuntimeException("yield called out of block"); } RubyVarmap.push(ruby); pushClass(); RubyBlock block = rubyBlock.getTmp(); Frame frame = block.frame; frame.setPrev(rubyFrame); rubyFrame = frame; VALUE old_cref = ruby_cref; ruby_cref = (NODE)rubyFrame.getCbase(); RubyScope oldScope = ruby.rubyScope; ruby.rubyScope = block.scope; rubyBlock.pop(); if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { dynamicVars = new RubyVarmap(null, null, block.dynamicVars); } else { dynamicVars = block.dynamicVars; } ruby_class = (klass != null) ? klass : block.klass; if (klass == null) { self = (RubyObject)block.self; } NODE node = block.body; if (block.var != null) { // try { if (block.var == NODE.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() != 0) { throw new RubyArgumentException("wrong # of arguments ("+ ((RubyArray)value).length() + " for 0)"); } } else { if (block.var.nd_type() == NODE_MASGN) { massign(self, block.var, value, acheck); } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } assign(self, block.var, value, acheck); } } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } } rubyIter.push(block.iter); while (true) { try { if (node == null) { result = ruby.getNil(); } else if (node.nd_type() == NODE_CFUNC || node.nd_type() == NODE_IFUNC) { if (value == null) { value = RubyArray.m_newArray(ruby, 0); } result = ((RubyCallbackMethod)node.nd_cfnc()).execute(value, new RubyObject[] {(RubyObject)node.nd_tval(), self}, ruby); } else { result = eval(self, node); } break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { result = ruby.getNil(); break; } catch (BreakException bExcptn) { break; } catch (ReturnException rExcptn) { break; } } // pop_state: rubyIter.pop(); popClass(); RubyVarmap.pop(ruby); rubyBlock.setTmp(block); rubyFrame = rubyFrame.getPrev(); ruby_cref = (NODE)old_cref; // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); ruby.rubyScope = oldScope; /* * if (state) { * if (!block->tag) { * switch (state & TAG_MASK) { * case TAG_BREAK: * case TAG_RETURN: * jump_tag_but_local_jump(state & TAG_MASK); * break; * } * } * JUMP_TAG(state); * } */ return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f220dcff8a7e427e32a7f1f1bc78f38876b83620/RubyInterpreter.java/clean/org/jruby/interpreter/RubyInterpreter.java
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) {
public static RubyObject m_load_class(Ruby ruby, RubyObject recv, RubyString className, RubyObject[] args) {
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) { String javaName = className.getString(); String rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); if (args.length > 0) { rubyName = ((RubyString)args[0]).getString(); } try { final Class c = Class.forName(javaName); final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (methods[i].getDeclaringClass() != Object.class) { newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i])); } } newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } }); return newRubyClass; } catch (ClassNotFoundException cnfExcptn) { throw new RubyNameException("cannot found Java class: " + javaName); } catch (SecurityException sExcptn) { } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/241a0fe060c8d239aa9e5d2519e98cf44d69a201/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java
final Class c = Class.forName(javaName);
Class c = Class.forName(javaName);
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) { String javaName = className.getString(); String rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); if (args.length > 0) { rubyName = ((RubyString)args[0]).getString(); } try { final Class c = Class.forName(javaName); final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (methods[i].getDeclaringClass() != Object.class) { newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i])); } } newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } }); return newRubyClass; } catch (ClassNotFoundException cnfExcptn) { throw new RubyNameException("cannot found Java class: " + javaName); } catch (SecurityException sExcptn) { } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/241a0fe060c8d239aa9e5d2519e98cf44d69a201/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java
final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject"));
Map methodMap = new HashMap(); Map singletonMethodMap = new HashMap();
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) { String javaName = className.getString(); String rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); if (args.length > 0) { rubyName = ((RubyString)args[0]).getString(); } try { final Class c = Class.forName(javaName); final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (methods[i].getDeclaringClass() != Object.class) { newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i])); } } newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } }); return newRubyClass; } catch (ClassNotFoundException cnfExcptn) { throw new RubyNameException("cannot found Java class: " + javaName); } catch (SecurityException sExcptn) { } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/241a0fe060c8d239aa9e5d2519e98cf44d69a201/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java
newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i]));
if (Modifier.isStatic(methods[i].getModifiers())) { if (singletonMethodMap.get(methods[i].getName()) == null) { singletonMethodMap.put(methods[i].getName(), new LinkedList()); } ((List)singletonMethodMap.get(methods[i].getName())).add(methods[i]); } else { if (methodMap.get(methods[i].getName()) == null) { methodMap.put(methods[i].getName(), new LinkedList()); } ((List)methodMap.get(methods[i].getName())).add(methods[i]); }
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) { String javaName = className.getString(); String rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); if (args.length > 0) { rubyName = ((RubyString)args[0]).getString(); } try { final Class c = Class.forName(javaName); final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (methods[i].getDeclaringClass() != Object.class) { newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i])); } } newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } }); return newRubyClass; } catch (ClassNotFoundException cnfExcptn) { throw new RubyNameException("cannot found Java class: " + javaName); } catch (SecurityException sExcptn) { } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/241a0fe060c8d239aa9e5d2519e98cf44d69a201/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java
newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } });
RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); newRubyClass.defineSingletonMethod("new", new JavaConstructor(c.getConstructors())); Iterator iter = methodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); methods = (Method[])((List)entry.getValue()).toArray(new Method[((List)entry.getValue()).size()]); newRubyClass.defineMethod((String)entry.getKey(), new JavaMethod(methods)); } iter = singletonMethodMap.entrySet().iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry)iter.next(); methods = (Method[])((List)entry.getValue()).toArray(new Method[((List)entry.getValue()).size()]); newRubyClass.defineSingletonMethod((String)entry.getKey(), new JavaMethod(methods, true)); }
public static RubyObject m_load_class(Ruby ruby, RubyModule rubyClass, RubyString className, RubyObject[] args) { String javaName = className.getString(); String rubyName = javaName.substring(javaName.lastIndexOf('.') + 1); if (args.length > 0) { rubyName = ((RubyString)args[0]).getString(); } try { final Class c = Class.forName(javaName); final RubyClass newRubyClass = ruby.defineClass(rubyName, (RubyClass)ruby.getRubyClass("JavaObject")); Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { String methodName = methods[i].getName(); if (methods[i].getDeclaringClass() != Object.class) { newRubyClass.defineMethod(methodName, new JavaReflectionMethod(methods[i])); } } newRubyClass.defineSingletonMethod("new", new RubyCallbackMethod() { public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { try { Object value = c.newInstance(); RubyJavaObject javaObject = new RubyJavaObject(ruby, (RubyModule)recv, value); javaObject.callInit(args); return javaObject; } catch (Exception excptn) { } return ruby.getNil(); } }); return newRubyClass; } catch (ClassNotFoundException cnfExcptn) { throw new RubyNameException("cannot found Java class: " + javaName); } catch (SecurityException sExcptn) { } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/241a0fe060c8d239aa9e5d2519e98cf44d69a201/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java
Iterator i = categories.iterator(); while (i.hasNext()) group.addChildDisplay(transformCategory((CategoryData) i.next())); group.setNumberItems(categories.size());
if (categories != null) { Iterator i = categories.iterator(); while (i.hasNext()) group.addChildDisplay(transformCategory( (CategoryData) i.next())); group.setNumberItems(categories.size()); } else group.setNumberItems(0);
private static TreeImageDisplay transformCategoryGroup(CategoryGroupData data) { if (data == null) throw new IllegalArgumentException("Cannot be null"); TreeImageSet group = new TreeImageSet(data); Set categories = data.getCategories(); Iterator i = categories.iterator(); while (i.hasNext()) group.addChildDisplay(transformCategory((CategoryData) i.next())); group.setNumberItems(categories.size()); return group; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/TreeViewerTranslator.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/TreeViewerTranslator.java
Iterator i = datasets.iterator(); while (i.hasNext()) project.addChildDisplay(transformDataset((DatasetData) i.next())); project.setNumberItems(datasets.size());
if (datasets != null) { Iterator i = datasets.iterator(); while (i.hasNext()) project.addChildDisplay(transformDataset( (DatasetData) i.next())); project.setNumberItems(datasets.size()); } else project.setNumberItems(0);
private static TreeImageDisplay transformProject(ProjectData data) { if (data == null) throw new IllegalArgumentException("Cannot be null"); TreeImageSet project = new TreeImageSet(data); Set datasets = data.getDatasets(); Iterator i = datasets.iterator(); while (i.hasNext()) project.addChildDisplay(transformDataset((DatasetData) i.next())); project.setNumberItems(datasets.size()); return project; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64ee7ec527da3cc538fcd8d0a21183719f854676/TreeViewerTranslator.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/TreeViewerTranslator.java
public int getChannelFamily(int w);
public Family getChannelFamily(int w);
public int getChannelFamily(int w);
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingEngine.java/buggy/components/common/src/omeis/providers/re/RenderingEngine.java
public int getModel();
public RenderingModel getModel();
public int getModel();
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingEngine.java/buggy/components/common/src/omeis/providers/re/RenderingEngine.java
public void setModel(int model);
public void setModel(RenderingModel model);
public void setModel(int model);
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingEngine.java/buggy/components/common/src/omeis/providers/re/RenderingEngine.java
public void setQuantizationMap(int w, int family, double coefficient,
public void setQuantizationMap(int w, Family family, double coefficient,
public void setQuantizationMap(int w, int family, double coefficient, boolean noiseReduction);
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/RenderingEngine.java/buggy/components/common/src/omeis/providers/re/RenderingEngine.java
private static void defineGlobal(IRuby runtime, String name, boolean value) {
private void defineGlobal(IRuby runtime, String name, boolean value) {
private static void defineGlobal(IRuby runtime, String name, boolean value) { runtime.getGlobalVariables().defineReadonly(name, new ValueAccessor(value ? runtime.getTrue() : runtime.getNil())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
private static void defineGlobalVERBOSE(final IRuby runtime) {
private void defineGlobalVERBOSE(final IRuby runtime) {
private static void defineGlobalVERBOSE(final IRuby runtime) { // $VERBOSE can be true, false, or nil. Any non-false-nil value will get stored as true runtime.getGlobalVariables().define("$VERBOSE", new IAccessor() { public IRubyObject getValue() { return runtime.getVerbose(); } public IRubyObject setValue(IRubyObject newValue) { if (newValue.isNil()) { runtime.setVerbose(newValue); } else { runtime.setVerbose(runtime.newBoolean(newValue != runtime.getFalse())); } return newValue; } }); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
private static Node getParsedScript(IRuby runtime, Reader reader, String filename) {
private Node getParsedScript(IRuby runtime, Reader reader, String filename) {
private static Node getParsedScript(IRuby runtime, Reader reader, String filename) { Node result = runtime.parse(reader, filename); if (commandline.isAssumePrinting()) { result = new ParserSupport().appendPrintToBlock(result); } if (commandline.isAssumeLoop()) { result = new ParserSupport().appendWhileLoopToBlock(result, commandline.isProcessLineEnds(), commandline.isSplit()); } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
private static void initializeRuntime(final IRuby runtime, String filename) {
private void initializeRuntime(final IRuby runtime, String filename) {
private static void initializeRuntime(final IRuby runtime, String filename) { IRubyObject argumentArray = runtime.newArray(JavaUtil.convertJavaArrayToRuby(runtime, commandline.getScriptArguments())); runtime.setVerbose(runtime.newBoolean(commandline.isVerbose())); defineGlobalVERBOSE(runtime); runtime.getObject().setConstant("$VERBOSE", commandline.isVerbose() ? runtime.getTrue() : runtime.getNil()); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.isAssumePrinting()); defineGlobal(runtime, "$-n", commandline.isAssumeLoop()); defineGlobal(runtime, "$-a", commandline.isSplit()); defineGlobal(runtime, "$-l", commandline.isProcessLineEnds()); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); // TODO this is a fake cause we have no real process number in Java runtime.getGlobalVariables().defineReadonly("$$", new ValueAccessor(runtime.newFixnum(runtime.hashCode()))); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", runtime.newString(filename))); runtime.getLoadService().init(commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); RubyKernel.require(runtime.getTopSelf(), runtime.newString(scriptName)); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
commandline = new CommandlineParser(args, System.out); if (commandline.isShowVersion()) { showVersion(); } if (! commandline.shouldRunInterpreter()) { return; } long now = -1; if (commandline.isBenchmarking()) { now = System.currentTimeMillis(); } int status = runInterpreter(commandline.getScriptSource(), commandline.displayedFileName()); if (commandline.isBenchmarking()) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } if (status != 0) { System.exit(status); }
Main main = new Main(); try { main.run(args); } catch (MainExitException mee) { main.err.println(mee.getMessage()); if (mee.isUsageError()) { main.printUsage(); } System.exit(mee.getStatus()); }
public static void main(String[] args) { commandline = new CommandlineParser(args, System.out); if (commandline.isShowVersion()) { showVersion(); } if (! commandline.shouldRunInterpreter()) { return; } long now = -1; if (commandline.isBenchmarking()) { now = System.currentTimeMillis(); } int status = runInterpreter(commandline.getScriptSource(), commandline.displayedFileName()); if (commandline.isBenchmarking()) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } // Only do an explicit exit if the interpreter has had an error. We // do not want to exit on non-errors since the interpreter may have // started background threads (ala samples/swing2.rb) if (status != 0) { System.exit(status); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
public static void printUsage(PrintStream printStream) {
public void printUsage() {
public static void printUsage(PrintStream printStream) { if (!hasPrintedUsage) { printStream.println("Usage: jruby [switches] [--] [rubyfile.rb] [arguments]"); printStream.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); printStream.println(" -b benchmark mode, times the script execution"); printStream.println(" -Idirectory specify $LOAD_PATH directory (may be used more than once)"); printStream.println(" -- optional -- before rubyfile.rb for compatibility with ruby"); hasPrintedUsage = true; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
printStream.println("Usage: jruby [switches] [--] [rubyfile.rb] [arguments]"); printStream.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); printStream.println(" -b benchmark mode, times the script execution"); printStream.println(" -Idirectory specify $LOAD_PATH directory (may be used more than once)"); printStream.println(" -- optional -- before rubyfile.rb for compatibility with ruby");
out.println("Usage: jruby [switches] [--] [rubyfile.rb] [arguments]"); out.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); out.println(" -b benchmark mode, times the script execution"); out.println(" -Idirectory specify $LOAD_PATH directory (may be used more than once)"); out.println(" -- optional -- before rubyfile.rb for compatibility with ruby");
public static void printUsage(PrintStream printStream) { if (!hasPrintedUsage) { printStream.println("Usage: jruby [switches] [--] [rubyfile.rb] [arguments]"); printStream.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); printStream.println(" -b benchmark mode, times the script execution"); printStream.println(" -Idirectory specify $LOAD_PATH directory (may be used more than once)"); printStream.println(" -- optional -- before rubyfile.rb for compatibility with ruby"); hasPrintedUsage = true; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
private static int runInterpreter(Reader reader, String filename) { IRuby runtime = Ruby.getDefaultInstance();
private int runInterpreter(Reader reader, String filename) { IRuby runtime = Ruby.newInstance(in, out, err);
private static int runInterpreter(Reader reader, String filename) { IRuby runtime = Ruby.getDefaultInstance(); try { runInterpreter(runtime, reader, filename); return 0; } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RaiseJump) { RubyException raisedException = ((RaiseException)je).getException(); if (raisedException.isKindOf(runtime.getClass("SystemExit"))) { RubyFixnum status = (RubyFixnum)raisedException.getInstanceVariable("status"); if (status != null) { return RubyNumeric.fix2int(status); } else { return 0; } } else { runtime.printError(raisedException); return 1; } } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { runtime.printError((RubyException)je.getTertiaryData()); return 1; } else { throw je; } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
private static void showVersion() { System.out.print("ruby "); System.out.print(Constants.RUBY_VERSION); System.out.print(" ("); System.out.print(Constants.COMPILE_DATE); System.out.print(") ["); System.out.print("java"); System.out.println("]");
private void showVersion() { out.print("ruby "); out.print(Constants.RUBY_VERSION); out.print(" ("); out.print(Constants.COMPILE_DATE); out.print(") ["); out.print("java"); out.println("]");
private static void showVersion() { System.out.print("ruby "); System.out.print(Constants.RUBY_VERSION); System.out.print(" ("); System.out.print(Constants.COMPILE_DATE); System.out.print(") ["); System.out.print("java"); System.out.println("]"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/Main.java/buggy/src/org/jruby/Main.java
return self.getRuntime().newFixnum(self.getValue().hashCode());
return self.getRuntime().newFixnum(self.toString().hashCode());
public IRubyObject invoke(RubyString self, IRubyObject[] args) { return self.getRuntime().newFixnum(self.getValue().hashCode()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
return self.getRuntime().getNil();
return self.getRuntime().getFalse();
public IRubyObject invoke(RubyString self, IRubyObject[] args) { IRubyObject other = args[0]; if (other == self) { return self.getRuntime().getTrue(); } else if (!(other instanceof RubyString)) { return self.getRuntime().getNil(); } /* use Java implementation if both different String instances */ return self.getRuntime().newBoolean( self.getValue().equals(((RubyString) other).getValue())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
self.getValue().equals(((RubyString) other).getValue()));
self.toString().equals(((RubyString) other).toString()));
public IRubyObject invoke(RubyString self, IRubyObject[] args) { IRubyObject other = args[0]; if (other == self) { return self.getRuntime().getTrue(); } else if (!(other instanceof RubyString)) { return self.getRuntime().getNil(); } /* use Java implementation if both different String instances */ return self.getRuntime().newBoolean( self.getValue().equals(((RubyString) other).getValue())); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
return (RubyString) self.newString(self.getValue() + str.getValue()).infectBy(str);
return (RubyString) self.newString(self.toString() + str.toString()).infectBy(str);
public IRubyObject invoke(RubyString self, IRubyObject[] args) { IRubyObject other = args[0]; RubyString str = RubyString.stringValue(other); return (RubyString) self.newString(self.getValue() + str.getValue()).infectBy(str); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(args2));
return self.getRuntime().newString(new PrintfFormat(Locale.US, self.toString()).sprintf(args2));
public IRubyObject invoke(RubyString self, IRubyObject[] args) { IRubyObject arg = args[0]; if (arg instanceof RubyArray) { Object[] args2 = new Object[((RubyArray) arg).getLength()]; for (int i = 0; i < args2.length; i++) { args2[i] = JavaUtil.convertRubyToJava(((RubyArray) arg).entry(i)); } return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(args2)); } return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(JavaUtil.convertRubyToJava(arg))); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(JavaUtil.convertRubyToJava(arg)));
return self.getRuntime().newString(new PrintfFormat(Locale.US, self.toString()).sprintf(JavaUtil.convertRubyToJava(arg)));
public IRubyObject invoke(RubyString self, IRubyObject[] args) { IRubyObject arg = args[0]; if (arg instanceof RubyArray) { Object[] args2 = new Object[((RubyArray) arg).getLength()]; for (int i = 0; i < args2.length; i++) { args2[i] = JavaUtil.convertRubyToJava(((RubyArray) arg).entry(i)); } return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(args2)); } return self.getRuntime().newString(new PrintfFormat(Locale.US, self.getValue()).sprintf(JavaUtil.convertRubyToJava(arg))); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
defineMethod("center", Arity.singleArgument());
defineMethod("center", Arity.optional());
protected void initializeClass() { includeModule(getRuntime().getModule("Comparable")); includeModule(getRuntime().getModule("Enumerable")); addMethod("<=>", op_cmp); addMethod("==", equal); addMethod("===", veryEqual); addMethod("+", op_plus); addMethod("*", op_mul); addMethod("%", format); addMethod("hash", hash); addMethod("to_s", to_s); defineMethod("[]", Arity.optional(), "aref"); defineMethod("[]=", Arity.optional(), "aset"); defineMethod("=~", Arity.singleArgument(), "match"); defineMethod("~", Arity.noArguments(), "match2"); defineMethod("capitalize", Arity.noArguments()); defineMethod("capitalize!", Arity.noArguments(), "capitalize_bang"); defineMethod("casecmp", Arity.singleArgument()); defineMethod("center", Arity.singleArgument()); defineMethod("chop", Arity.noArguments()); defineMethod("chop!", Arity.noArguments(), "chop_bang"); defineMethod("chomp", Arity.optional()); defineMethod("chomp!", Arity.optional(), "chomp_bang"); defineMethod("clone", Arity.noArguments(), "rbClone"); defineMethod("concat", Arity.singleArgument()); defineMethod("count", Arity.optional()); defineMethod("delete", Arity.optional()); defineMethod("delete!", Arity.optional(), "delete_bang"); defineMethod("downcase", Arity.noArguments()); defineMethod("downcase!", Arity.noArguments(), "downcase_bang"); defineMethod("dump", Arity.noArguments()); defineMethod("dup", Arity.noArguments()); defineMethod("each_line", Arity.optional()); defineMethod("each_byte", Arity.noArguments()); defineMethod("empty?", Arity.noArguments(), "empty"); defineMethod("gsub", Arity.optional()); defineMethod("gsub!", Arity.optional(), "gsub_bang"); defineMethod("hex", Arity.noArguments()); defineMethod("include?", Arity.singleArgument(), "include"); defineMethod("index", Arity.optional()); defineMethod("initialize", Arity.optional(), "initialize"); defineMethod("initialize_copy", Arity.singleArgument(), "replace"); defineMethod("inspect", Arity.noArguments()); defineMethod("length", Arity.noArguments()); defineMethod("ljust", Arity.singleArgument()); defineMethod("lstrip", Arity.noArguments()); defineMethod("lstrip!", Arity.noArguments(), "lstrip_bang"); defineMethod("match", Arity.singleArgument(), "match3"); defineMethod("oct", Arity.noArguments()); defineMethod("replace", Arity.singleArgument()); defineMethod("reverse", Arity.noArguments()); defineMethod("reverse!", Arity.noArguments(), "reverse_bang"); defineMethod("rindex", Arity.optional()); defineMethod("rjust", Arity.singleArgument()); defineMethod("rstrip", Arity.noArguments()); defineMethod("rstrip!", Arity.noArguments(), "rstrip_bang"); defineMethod("scan", Arity.singleArgument()); defineMethod("slice!", Arity.optional(), "slice_bang"); defineMethod("split", Arity.optional()); defineMethod("strip", Arity.noArguments()); defineMethod("strip!", Arity.noArguments(), "strip_bang"); defineMethod("succ", Arity.noArguments()); defineMethod("succ!", Arity.noArguments(), "succ_bang"); defineMethod("squeeze", Arity.optional()); defineMethod("squeeze!", Arity.optional(), "squeeze_bang"); defineMethod("sub", Arity.optional()); defineMethod("sub!", Arity.optional(), "sub_bang"); defineMethod("sum", Arity.optional()); defineMethod("swapcase", Arity.noArguments()); defineMethod("swapcase!", Arity.noArguments(), "swapcase_bang"); defineMethod("to_f", Arity.noArguments()); defineMethod("to_i", Arity.noArguments()); defineMethod("to_str", Arity.noArguments()); defineMethod("to_sym", Arity.noArguments()); defineMethod("tr", Arity.twoArguments()); defineMethod("tr!", Arity.twoArguments(), "tr_bang"); defineMethod("tr_s", Arity.twoArguments()); defineMethod("tr_s!", Arity.twoArguments(), "tr_s_bang"); defineMethod("unpack", Arity.singleArgument()); defineMethod("upcase", Arity.noArguments()); defineMethod("upcase!", Arity.noArguments(), "upcase_bang"); defineMethod("upto", Arity.singleArgument()); defineAlias("<<", "concat"); defineAlias("each", "each_line"); defineAlias("eql?", "=="); defineAlias("intern", "to_sym"); defineAlias("next", "succ"); defineAlias("next!", "succ!"); defineAlias("size", "length"); defineAlias("slice", "[]"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/StringMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/StringMetaClass.java
boolean noClass = description.charAt(0) == '#';
boolean noClass = description.length() > 0 && description.charAt(0) == '#';
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod("inspect").toString(); boolean noClass = description.charAt(0) == '#'; LastCallStatus lastCallStatus = getRuntime().getLastCallStatus(); String format = lastCallStatus.errorMessageFormat(name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallStatus.isVariable()) { throw getRuntime().newNameError(msg); } throw getRuntime().newNoMethodError(msg); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ff1f8480e5c43948fe1413203c38e90b2d381c29/RubyObject.java/buggy/src/org/jruby/RubyObject.java
protected void setUp(){ super.setUp(); hbw = (HierarchyBrowsingView) registry.getDataServicesView(HierarchyBrowsingView.class); dms = registry.getDataManagementService(); sts = registry.getSemanticTypesService(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fe14dc19a3cb8aef0082070000d68b42a88ac770/ShoolaGrinderTest.java/buggy/components/test/src/org/openmicroscopy/shoola/env/data/t/ShoolaGrinderTest.java
if ( entity instanceof IObject )
if ( entity instanceof IObject && ! secSys.isDisabled(UPDATE_EVENT))
public boolean onPreUpdate(PreUpdateEvent event) { Object entity = event.getEntity(); if ( entity instanceof IObject ) { int[] dirty = event.getPersister().findDirty( event.getState(), event.getOldState(), event.getEntity(), event.getSource()); if (dirty == null||dirty.length==0) { // return true; // veto. } else { // otherwise change update event (last modification) IObject obj = (IObject) entity; obj.getDetails().setUpdateEvent( secSys.currentEvent() ); } } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2e0d4e007ffb79260681f7450fc94ac7be51414/UpdateEventListener.java/clean/components/server/src/ome/security/basic/UpdateEventListener.java
return 0;
return -1;
public int getArity() { return 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7b4144d109e833088b99fef35098efa1ab482436/TopSelfFactory.java/clean/org/jruby/TopSelfFactory.java
return 0;
return -1;
public int getArity() { return 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7b4144d109e833088b99fef35098efa1ab482436/TopSelfFactory.java/clean/org/jruby/TopSelfFactory.java
return 0;
return -1;
public int getArity() { return 0; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7b4144d109e833088b99fef35098efa1ab482436/TopSelfFactory.java/clean/org/jruby/TopSelfFactory.java
public RubyClass newSubClass(String name, RubyModule parent) { return new BignumMetaClass(name, this, parent);
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new BignumMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { return new BignumMetaClass(name, this, parent); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/BignumMetaClass.java/clean/src/org/jruby/runtime/builtin/meta/BignumMetaClass.java
public static RubyObject stderr(Ruby ruby, RubyClass rubyClass) {
public static RubyObject stderr(Ruby ruby, RubyClass rubyClass, OutputStream errStream) {
public static RubyObject stderr(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.outStream = ruby.getRuntime().getErrorStream(); io.writeable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
io.outStream = ruby.getRuntime().getErrorStream();
io.outStream = errStream;
public static RubyObject stderr(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.outStream = ruby.getRuntime().getErrorStream(); io.writeable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
public static RubyObject stdin(Ruby ruby, RubyClass rubyClass) {
public static RubyObject stdin(Ruby ruby, RubyClass rubyClass, InputStream inStream) {
public static RubyObject stdin(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.inStream = new RubyInputStream(ruby.getRuntime().getInputStream()); io.readable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
io.inStream = new RubyInputStream(ruby.getRuntime().getInputStream());
io.inStream = new RubyInputStream(inStream);
public static RubyObject stdin(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.inStream = new RubyInputStream(ruby.getRuntime().getInputStream()); io.readable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
public static RubyObject stdout(Ruby ruby, RubyClass rubyClass) {
public static RubyObject stdout(Ruby ruby, RubyClass rubyClass, OutputStream outStream) {
public static RubyObject stdout(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.outStream = ruby.getRuntime().getOutputStream(); io.writeable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
io.outStream = ruby.getRuntime().getOutputStream();
io.outStream = outStream;
public static RubyObject stdout(Ruby ruby, RubyClass rubyClass) { RubyIO io = new RubyIO(ruby, rubyClass); io.outStream = ruby.getRuntime().getOutputStream(); io.writeable = true; return io; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/RubyIO.java/buggy/org/jruby/RubyIO.java
public static void main(String[] args) { wf(); }
53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/wordfreq.java/clean/tests/shootout/java-start/wordfreq.java
System.err.println("click...");
public void respondMouseClick(PInputEvent event) { if(sticky) { if(activated) { setActivated(false); } else { setActivated(true); } } PiccoloAction action = mouseDownActions.getMouseClickAction(PiccoloModifiers.getModifier(event)); action.execute(event); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9ad2d2709e2cdefc9a414f2e51f6a883a2403c7a/BIcon.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/ui/BIcon.java
private int generateID(DBRow row) throws Exception { Integer id = (Integer) idGenerationMap.get(row.getClass()); if (id == null) { DBManager dbm = DBManager.getInstance(); PreparedStatement ps = dbm.getPreparedStatement(MAX_ID_QUERY); //ps.setString(1, row.getIDColumnName()); //ps.setString(2, row.getTableName()); ResultSet rs = ps.executeQuery(); rs.next(); id = new Integer(rs.getInt(1)); rs.close(); } id = new Integer(id.intValue()+1); idGenerationMap.put(row.getClass(), id); return id.intValue(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/573df7087912a67672c1e083613af66bdbf3486e/DBFixture.java/clean/TEST/omeds/DBFixture.java
fillBasic(c, g, id);
c.addWantedField("Valid"); String column = (String) STSMapper.granularities.get(g); if (column != null) c.addFilter(column, new Integer(id));
public static Criteria buildBasicCriteria(String g, int id) { Criteria c = new Criteria(); fillBasic(c, g, id); return c; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
c.addWantedField("Timestamp"); c.addWantedField("Experimenter");
c.addWantedField("module_execution"); c.addWantedField("module_execution", "timestamp"); c.addWantedField("module_execution", "experimenter");
public static void fillAnnotationCriteria(Criteria c) { //c.addWantedField("id"); c.addWantedField("Content"); c.addWantedField("Timestamp"); c.addWantedField("Experimenter"); //Specify which fields we want for the owner. c.addWantedField("Experimenter", "id"); c.addWantedField("Experimenter", "FirstName"); c.addWantedField("Experimenter", "LastName"); c.addFilter("Valid", Boolean.TRUE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
c.addWantedField("Experimenter", "id"); c.addWantedField("Experimenter", "FirstName"); c.addWantedField("Experimenter", "LastName");
c.addWantedField("module_execution.experimenter", "id"); c.addWantedField("module_execution.experimenter", "FirstName"); c.addWantedField("module_execution.experimenter", "LastName");
public static void fillAnnotationCriteria(Criteria c) { //c.addWantedField("id"); c.addWantedField("Content"); c.addWantedField("Timestamp"); c.addWantedField("Experimenter"); //Specify which fields we want for the owner. c.addWantedField("Experimenter", "id"); c.addWantedField("Experimenter", "FirstName"); c.addWantedField("Experimenter", "LastName"); c.addFilter("Valid", Boolean.TRUE); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
DatasetAnnotation imgA;
DatasetAnnotation da;
public static void fillDatasetAnnotations(List l, Map map) { Iterator i = l.iterator(); DatasetAnnotation imgA; AnnotationData data; int ownerID; List list; Timestamp time = null; while (i.hasNext()) { imgA = (DatasetAnnotation) i.next(); list = new ArrayList(); if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); Experimenter experimenter = imgA.getExperimenter(); ownerID = experimenter.getID(); data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent()); data.setOwnerFirstName(experimenter.getFirstName()); data.setOwnerLastName(experimenter.getLastName()); list.add(data); map.put(new Integer(ownerID), list); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
imgA = (DatasetAnnotation) i.next();
da = (DatasetAnnotation) i.next();
public static void fillDatasetAnnotations(List l, Map map) { Iterator i = l.iterator(); DatasetAnnotation imgA; AnnotationData data; int ownerID; List list; Timestamp time = null; while (i.hasNext()) { imgA = (DatasetAnnotation) i.next(); list = new ArrayList(); if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); Experimenter experimenter = imgA.getExperimenter(); ownerID = experimenter.getID(); data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent()); data.setOwnerFirstName(experimenter.getFirstName()); data.setOwnerLastName(experimenter.getLastName()); list.add(data); map.put(new Integer(ownerID), list); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); Experimenter experimenter = imgA.getExperimenter();
mex = da.getModuleExecution(); if (mex.getTimestamp() != null) time = PrimitiveTypesMapper.getTimestamp(mex.getTimestamp()); else time = PrimitiveTypesMapper.getDefaultTimestamp(); Experimenter experimenter = mex.getExperimenter();
public static void fillDatasetAnnotations(List l, Map map) { Iterator i = l.iterator(); DatasetAnnotation imgA; AnnotationData data; int ownerID; List list; Timestamp time = null; while (i.hasNext()) { imgA = (DatasetAnnotation) i.next(); list = new ArrayList(); if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); Experimenter experimenter = imgA.getExperimenter(); ownerID = experimenter.getID(); data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent()); data.setOwnerFirstName(experimenter.getFirstName()); data.setOwnerLastName(experimenter.getLastName()); list.add(data); map.put(new Integer(ownerID), list); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent());
data = new AnnotationData(da.getID(), ownerID, time); data.setAnnotation(da.getContent());
public static void fillDatasetAnnotations(List l, Map map) { Iterator i = l.iterator(); DatasetAnnotation imgA; AnnotationData data; int ownerID; List list; Timestamp time = null; while (i.hasNext()) { imgA = (DatasetAnnotation) i.next(); list = new ArrayList(); if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); Experimenter experimenter = imgA.getExperimenter(); ownerID = experimenter.getID(); data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent()); data.setOwnerFirstName(experimenter.getFirstName()); data.setOwnerLastName(experimenter.getLastName()); list.add(data); map.put(new Integer(ownerID), list); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp();
mex = imgA.getModuleExecution(); if (mex.getTimestamp() != null) time = PrimitiveTypesMapper.getTimestamp(mex.getTimestamp()); else time = PrimitiveTypesMapper.getDefaultTimestamp();
public static Map fillImageAnnotations(List l, TreeMap map) { Iterator i = l.iterator(); ImageAnnotation imgA; AnnotationData data; int ownerID; List list; Timestamp time = null; Experimenter experimenter; while (i.hasNext()) { imgA = (ImageAnnotation) i.next(); list = new ArrayList(); if (imgA.getTimestamp() != null) time = new Timestamp(imgA.getTimestamp().longValue()); else time = getTimestamp(); experimenter = imgA.getExperimenter(); ownerID = experimenter.getID(); data = new AnnotationData(imgA.getID(), ownerID, time); data.setAnnotation(imgA.getContent()); data.setOwnerFirstName(experimenter.getFirstName()); data.setOwnerLastName(experimenter.getLastName()); if (imgA.getTheZ() != null) data.setTheZ(imgA.getTheZ().intValue()); if (imgA.getTheT() != null) data.setTheT(imgA.getTheT().intValue()); list.add(data); map.put(new Integer(ownerID), list); } return map; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5dbbc3e7786c9d237cda00632eddf9d6b5a29870/AnnotationMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/map/AnnotationMapper.java
private byte[] getColorBand(RGBBuffer dataBuf, Color color)
private int getColorBand(Color color)
private byte[] getColorBand(RGBBuffer dataBuf, Color color) { byte[] band = dataBuf.getRedBand(); if (color.getGreen().intValue() == 255) band = dataBuf.getGreenBand(); else if (color.getBlue().intValue() == 255) band = dataBuf.getBlueBand(); //Else it must have been red. return band; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
byte[] band = dataBuf.getRedBand();
private byte[] getColorBand(RGBBuffer dataBuf, Color color) { byte[] band = dataBuf.getRedBand(); if (color.getGreen().intValue() == 255) band = dataBuf.getGreenBand(); else if (color.getBlue().intValue() == 255) band = dataBuf.getBlueBand(); //Else it must have been red. return band; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
band = dataBuf.getGreenBand();
return RGBBuffer.G_BAND;
private byte[] getColorBand(RGBBuffer dataBuf, Color color) { byte[] band = dataBuf.getRedBand(); if (color.getGreen().intValue() == 255) band = dataBuf.getGreenBand(); else if (color.getBlue().intValue() == 255) band = dataBuf.getBlueBand(); //Else it must have been red. return band; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
band = dataBuf.getBlueBand(); return band;
return RGBBuffer.B_BAND; return RGBBuffer.R_BAND;
private byte[] getColorBand(RGBBuffer dataBuf, Color color) { byte[] band = dataBuf.getRedBand(); if (color.getGreen().intValue() == 255) band = dataBuf.getGreenBand(); else if (color.getBlue().intValue() == 255) band = dataBuf.getBlueBand(); //Else it must have been red. return band; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
getColorBand(renderedDataBuf, cBindings[w].getColor()),
renderedDataBuf, getColorBand(cBindings[w].getColor()),
private RenderRGBWaveTask[] makeRndTasks(PlaneDef planeDef, RGBBuffer renderedDataBuf) { ArrayList tasks = new ArrayList(3); //Get all objects we need to create the tasks. Plane2D wData; QuantumManager qManager = renderer.getQuantumManager(); ChannelBinding[] cBindings = renderer.getChannelBindings(); CodomainChain cc = renderer.getCodomainChain(); PixelBuffer pixels = renderer.getPixels(); Pixels metadata = renderer.getMetadata(); RenderingStats performanceStats = renderer.getStats(); //Create a task for each active wavelength. for (int w = 0; w < cBindings.length; w++) { if (tasks.size() == 3) break; //We only render 3 w at most. if (cBindings[w].getActive().booleanValue()) { //Get the raw data. performanceStats.startIO(w); wData = PlaneFactory.createPlane(planeDef, w, metadata, pixels); performanceStats.endIO(w); //Create a rendering task for this wavelength. tasks.add(new RenderRGBWaveTask( getColorBand(renderedDataBuf, cBindings[w].getColor()), wData, qManager.getStrategyFor(w), cc, cBindings[w].getColor().getAlpha().intValue(), sizeX1, sizeX2)); } } //Turn the list into an array an return it. RenderRGBWaveTask[] t = new RenderRGBWaveTask[tasks.size()]; return (RenderRGBWaveTask[]) tasks.toArray(t); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
*/
private RenderRGBWaveTask[] makeRndTasks(PlaneDef planeDef, RGBBuffer renderedDataBuf) { ArrayList tasks = new ArrayList(3); //Get all objects we need to create the tasks. Plane2D wData; QuantumManager qManager = renderer.getQuantumManager(); ChannelBinding[] cBindings = renderer.getChannelBindings(); CodomainChain cc = renderer.getCodomainChain(); PixelBuffer pixels = renderer.getPixels(); Pixels metadata = renderer.getMetadata(); RenderingStats performanceStats = renderer.getStats(); //Create a task for each active wavelength. for (int w = 0; w < cBindings.length; w++) { if (tasks.size() == 3) break; //We only render 3 w at most. if (cBindings[w].getActive().booleanValue()) { //Get the raw data. performanceStats.startIO(w); wData = PlaneFactory.createPlane(planeDef, w, metadata, pixels); performanceStats.endIO(w); //Create a rendering task for this wavelength. tasks.add(new RenderRGBWaveTask( getColorBand(renderedDataBuf, cBindings[w].getColor()), wData, qManager.getStrategyFor(w), cc, cBindings[w].getColor().getAlpha().intValue(), sizeX1, sizeX2)); } } //Turn the list into an array an return it. RenderRGBWaveTask[] t = new RenderRGBWaveTask[tasks.size()]; return (RenderRGBWaveTask[]) tasks.toArray(t); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
throws IOException, QuantizationException {
throws IOException, QuantizationException {
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane definition and //create the RGB buffer. initAxesSize(planeDef, renderer.getMetadata()); performanceStats.startMalloc(); RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2); performanceStats.endMalloc(); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. ExecutorService processor = Executors.newCachedThreadPool();//FIXME fast enough? while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); //Wait for all forked tasks (if any) to complete. processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); //Done. return renderedDataBuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
RenderingStats performanceStats = renderer.getStats();
RenderingStats performanceStats = renderer.getStats(); Pixels metadata = renderer.getMetadata();
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane definition and //create the RGB buffer. initAxesSize(planeDef, renderer.getMetadata()); performanceStats.startMalloc(); RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2); performanceStats.endMalloc(); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. ExecutorService processor = Executors.newCachedThreadPool();//FIXME fast enough? while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); //Wait for all forked tasks (if any) to complete. processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); //Done. return renderedDataBuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
initAxesSize(planeDef, renderer.getMetadata());
initAxesSize(planeDef, metadata);
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane definition and //create the RGB buffer. initAxesSize(planeDef, renderer.getMetadata()); performanceStats.startMalloc(); RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2); performanceStats.endMalloc(); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. ExecutorService processor = Executors.newCachedThreadPool();//FIXME fast enough? while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); //Wait for all forked tasks (if any) to complete. processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); //Done. return renderedDataBuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2);
RGBBuffer buf = new RGBBuffer(sizeX1, sizeX2);
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane definition and //create the RGB buffer. initAxesSize(planeDef, renderer.getMetadata()); performanceStats.startMalloc(); RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2); performanceStats.endMalloc(); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. ExecutorService processor = Executors.newCachedThreadPool();//FIXME fast enough? while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); //Wait for all forked tasks (if any) to complete. processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); //Done. return renderedDataBuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; ExecutorService processor = Executors.newCachedThreadPool(); while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; } } performanceStats.endRendering(); return renderedDataBuf; }
render(buf, planeDef); return buf; }
RGBBuffer render(Renderer ctx, PlaneDef planeDef) throws IOException, QuantizationException { //Set the rendering context for the current invocation. renderer = ctx; RenderingStats performanceStats = renderer.getStats(); //Initialize sizeX1 and sizeX2 according to the plane definition and //create the RGB buffer. initAxesSize(planeDef, renderer.getMetadata()); performanceStats.startMalloc(); RGBBuffer renderedDataBuf = new RGBBuffer(sizeX1, sizeX2); performanceStats.endMalloc(); //Process each active wavelength. If their number N > 1, then //process N-1 async and one in the current thread. If N = 1, //just use the current thread. RenderRGBWaveTask[] tasks = makeRndTasks(planeDef, renderedDataBuf); performanceStats.startRendering(); int n = tasks.length; Future[] rndTskFutures = new Future[n]; //[0] unused. ExecutorService processor = Executors.newCachedThreadPool();//FIXME fast enough? while (0 < --n) rndTskFutures[n] = processor.submit(tasks[n]); if (n == 0) tasks[0].call(); //Wait for all forked tasks (if any) to complete. processor.shutdown(); for (n = 1; n < rndTskFutures.length; ++n) { try { rndTskFutures[n].get(); } catch (Exception e) { if (e instanceof QuantizationException) throw (QuantizationException) e; throw (RuntimeException) e; //B/c call() only throws QuantizationException, it must be RE. } } performanceStats.endRendering(); //Done. return renderedDataBuf; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/RGBStrategy.java/clean/components/rendering/src/omeis/providers/re/RGBStrategy.java
setExperimenters( new HashSet(grp.collectFromExperimenterLinks( block )));
setExperimenters( new HashSet(grp.eachLinkedExperimenter( block )));
public void copy(IObject model, ModelMapper mapper) { if (model instanceof ExperimenterGroup) { ExperimenterGroup grp = (ExperimenterGroup) model; super.copy(model,mapper); // Details if (grp.getDetails() != null){ this.setOwner((ExperimenterData) mapper.findTarget(grp.getDetails().getOwner())); } // Fields this.setName(grp.getName()); // Collections MapperBlock block = new MapperBlock( mapper ); setExperimenters( new HashSet(grp.collectFromExperimenterLinks( block ))); } else { throw new IllegalArgumentException( "GroupData can only copy from Group, not "+ model.getClass().getName()); // TODO all errors like this. } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/GroupData.java/clean/components/shoola-adapter/src/pojos/GroupData.java
Permissions p = new Permissions( ZERO );
Permissions p = new Permissions( EMPTY );
public static Permissions parseString( String rwrwrw ) { Permissions p = new Permissions( ZERO ); String regex = "([Rr_][Ww_]){3}"; if ( rwrwrw == null || ! rwrwrw.matches(regex) ) throw new ApiUsageException( "Permissions are of the form: "+regex); char c; c = rwrwrw.charAt(0); if ( c == 'r' || c == 'R' ) p.grant( USER, READ ); c = rwrwrw.charAt(1); if ( c == 'w' || c == 'W' ) p.grant( USER, WRITE ); c = rwrwrw.charAt(2); if ( c == 'r' || c == 'R' ) p.grant( GROUP, READ ); c = rwrwrw.charAt(3); if ( c == 'w' || c == 'W' ) p.grant( GROUP, WRITE ); c = rwrwrw.charAt(4); if ( c == 'r' || c == 'R' ) p.grant( WORLD, READ ); c = rwrwrw.charAt(5); if ( c == 'w' || c == 'W' ) p.grant( WORLD, WRITE ); return p; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ef6436b412344c22aec4fc69cd3a0dab5bcd6249/Permissions.java/clean/components/common/src/ome/model/internal/Permissions.java
IconManager im = IconManager.getInstance(); JButton button = createButton(im.getIcon(IconManager.RENDERER),
JButton button = new JButton(
private void createControlsBar() { bar = new JToolBar(); bar.setFloatable(false); bar.setRollover(true); bar.setBorder(null); IconManager im = IconManager.getInstance(); JButton button = createButton(im.getIcon(IconManager.RENDERER), controller.getAction(ImViewerControl.RENDERER)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.MOVIE), controller.getAction(ImViewerControl.MOVIE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.LENS), controller.getAction(ImViewerControl.LENS)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); bar.add(new JSeparator(SwingConstants.VERTICAL)); button = createButton(im.getIcon(IconManager.SAVE), controller.getAction(ImViewerControl.SAVE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ToolBar.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ToolBar.java
button = createButton(im.getIcon(IconManager.MOVIE), controller.getAction(ImViewerControl.MOVIE));
button = new JButton(controller.getAction(ImViewerControl.MOVIE));
private void createControlsBar() { bar = new JToolBar(); bar.setFloatable(false); bar.setRollover(true); bar.setBorder(null); IconManager im = IconManager.getInstance(); JButton button = createButton(im.getIcon(IconManager.RENDERER), controller.getAction(ImViewerControl.RENDERER)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.MOVIE), controller.getAction(ImViewerControl.MOVIE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.LENS), controller.getAction(ImViewerControl.LENS)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); bar.add(new JSeparator(SwingConstants.VERTICAL)); button = createButton(im.getIcon(IconManager.SAVE), controller.getAction(ImViewerControl.SAVE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ToolBar.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ToolBar.java
button = createButton(im.getIcon(IconManager.LENS), controller.getAction(ImViewerControl.LENS));
button = new JButton(controller.getAction(ImViewerControl.LENS));
private void createControlsBar() { bar = new JToolBar(); bar.setFloatable(false); bar.setRollover(true); bar.setBorder(null); IconManager im = IconManager.getInstance(); JButton button = createButton(im.getIcon(IconManager.RENDERER), controller.getAction(ImViewerControl.RENDERER)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.MOVIE), controller.getAction(ImViewerControl.MOVIE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.LENS), controller.getAction(ImViewerControl.LENS)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); bar.add(new JSeparator(SwingConstants.VERTICAL)); button = createButton(im.getIcon(IconManager.SAVE), controller.getAction(ImViewerControl.SAVE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ToolBar.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ToolBar.java
button = createButton(im.getIcon(IconManager.SAVE), controller.getAction(ImViewerControl.SAVE));
button = new JButton(controller.getAction(ImViewerControl.SAVE));
private void createControlsBar() { bar = new JToolBar(); bar.setFloatable(false); bar.setRollover(true); bar.setBorder(null); IconManager im = IconManager.getInstance(); JButton button = createButton(im.getIcon(IconManager.RENDERER), controller.getAction(ImViewerControl.RENDERER)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.MOVIE), controller.getAction(ImViewerControl.MOVIE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); button = createButton(im.getIcon(IconManager.LENS), controller.getAction(ImViewerControl.LENS)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); bar.add(new JSeparator(SwingConstants.VERTICAL)); button = createButton(im.getIcon(IconManager.SAVE), controller.getAction(ImViewerControl.SAVE)); UIUtilities.unifiedButtonLookAndFeel(button); bar.add(button); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/ToolBar.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ToolBar.java
this.roomTitle = participantNickname + " - Started " + formatter.format(new Date());
this.roomTitle = participantNickname;
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(this.participantJID)); // Register PacketListeners AndFilter messageFilter = new AndFilter(new PacketTypeFilter(Message.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(this, messageFilter); SparkManager.getConnection().addPacketListener(this, presenceFilter); // The roomname will be the participantJID this.roomname = participantJID; // Use the agents username as the Tab Title this.tabTitle = title; // The name of the room will be the node of the user jid + conversation. final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); this.roomTitle = participantNickname + " - Started " + formatter.format(new Date()); // Add RoomInfo this.getSplitPane().setRightComponent(null); getSplitPane().setDividerSize(0); roster = SparkManager.getConnection().getRoster(); presence = roster.getPresence(participantJID); StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(presence); RosterEntry entry = roster.getEntry(participantJID); if (statusItem == null) { tabIcon = SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON); } else { String status = presence.getStatus(); if (status != null && status.indexOf("phone") != -1) { tabIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); } else { tabIcon = statusItem.getIcon(); } } Icon icon = SparkManager.getChatManager().getPresenceIconForContactHandler(presence); if (icon != null) { tabIcon = icon; } PacketFilter filter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(participantJID)); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { presence = (Presence)packet; } }, filter); // Create toolbar buttons. ChatRoomButton infoButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.PROFILE_IMAGE_24x24)); infoButton.setToolTipText("View information about this user"); // Create basic toolbar. getToolBar().addChatRoomButton(infoButton); // If the user is not in the roster, then allow user to add them. if (entry == null && !StringUtils.parseResource(participantJID).equals(participantNickname)) { ChatRoomButton addToRosterButton = new ChatRoomButton("", SparkRes.getImageIcon(SparkRes.ADD_IMAGE_24x24)); addToRosterButton.setToolTipText("Add this user to your roster."); getToolBar().addChatRoomButton(addToRosterButton); addToRosterButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(participantJID); rosterDialog.setDefaultNickname(getParticipantNickname()); rosterDialog.showRosterDialog(SparkManager.getChatManager().getChatContainer().getChatFrame()); } }); } // Show VCard. infoButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { VCardManager vcard = SparkManager.getVCardManager(); vcard.viewProfile(participantJID, SparkManager.getChatManager().getChatContainer()); } }); // If this is a private chat from a group chat room, do not show toolbar. if (StringUtils.parseResource(participantJID).equals(participantNickname)) { getToolBar().setVisible(false); } typingTimer = new Timer(2000, new ActionListener() { public void actionPerformed(ActionEvent e) { long now = System.currentTimeMillis(); if (now - lastTypedCharTime > 2000) { if (!sendNotification) { // send cancel SparkManager.getMessageEventManager().sendCancelledNotification(getParticipantJID(), threadID); sendNotification = true; } } } }); typingTimer.start(); // Add message event request listener messageEventRequestListener = new ChatMessageEventRequestListener(); SparkManager.getMessageEventManager().addMessageEventRequestListener(messageEventRequestListener); lastActivity = System.currentTimeMillis(); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e51fe7fc839fd9898d56e3951ad79de91d48b592/ChatRoomImpl.java/buggy/src/java/org/jivesoftware/spark/ui/rooms/ChatRoomImpl.java
System.out.println("Return CLASS: " + returnType); System.out.println("Iterator CLASS: " + Iterator.class);
private PropertyOperator(final Class target) throws SecurityException, PropertyException { if (_debug) { _log.debug("new PropertyOperator(" + target + ")"); } Accessor acc; // introspect fields first Field[] fields = target.getFields(); for (int i = 0; i < fields.length; i++) { if (Modifier.isPublic(fields[i].getModifiers())) { if (_debug) { _log.debug("Adding field: " + fields[i]); } acc = new FieldAccessor(fields[i]); _unaryAccessors.put(acc.getName(),acc); } else if (_debug) { _log.debug("Skipped non-public field: " + fields[i]); } } // introspect methods second Method[] methods = target.getMethods(); Method meth; Class[] params; String name,propName; for (int i = 0; i < methods.length; i++) { meth = methods[i]; // don't look at non-public methods if (! Modifier.isPublic(meth.getModifiers())) { if (_debug) { _log.debug("Skipped non-public method: " + meth); } continue; } /*if (_debug) { * _log.debug("Checking " + meth); *} */ name = meth.getName(); params = meth.getParameterTypes(); int plength = params.length; // add direct accessor acc = (Accessor) _directAccessors.get(name); if (acc != null) { ((DirectAccessor) acc).addMethod(meth,params); } else { acc = new DirectAccessor(name,meth,params); _directAccessors.put(name,acc); } // check for get/set/put method if ((name.startsWith("get") || name.startsWith("set")) || name.equals("put")) { propName = name.substring(3); if ( ((plength == 0) && name.startsWith("get")) || ((plength == 1) && name.startsWith("set")) ) { // unary get/set method acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { if (acc instanceof MethodAccessor) { if (_debug) { _log.debug("Updating existing accessor: " + meth); } ((MethodAccessor) acc).addMethod(meth,params); } else if (_debug) { _log.debug("Superceded by a field: " + meth); } } else { if (_debug) { _log.debug("Adding new accessor: " + meth); } acc = new UnaryMethodAccessor(propName,meth,params); _unaryAccessors.put(propName,acc); } } else if ( (plength > 0) && ( (params[0].isInstance("string") && ((plength == 2) && name.equals("put"))) || ((plength == 1) && name.equals("get")))) { // hashtable get/put if (hashAccessor != null) { if (_debug) { _log.debug("Updating hash accessor: " + meth); } hashAccessor.addMethod(meth,params); } else { if (_debug) { _log.debug("Creating a new hash accessor: " + meth); } hashAccessor = new BinaryMethodAccessor(propName,meth,params); } } else if ((plength > 0) && (params[0].isInstance("string")) && (((plength == 1) && name.startsWith("get")) || ((plength == 2) && name.startsWith("set")))) { // binary get/set method acc = (Accessor) _binaryAccessors.get(propName); if (acc != null) { if (_debug) { _log.debug("Updating binary accessor: " + meth); } ((MethodAccessor) acc).addMethod(meth,params); } else { if (_debug) { _log.debug("Creating a new binary accessor: " + meth); } acc = new BinaryMethodAccessor(propName,meth,params); _binaryAccessors.put(propName,acc); } } } else if (name.equals("elements") || name.equals("enumeration") || name.equals("iterator") || name.equals("toArray")) { if (params.length == 0) { Class returnType = meth.getReturnType(); // iterator supercedes enumeration supercedes Object[] System.out.println("Return CLASS: " + returnType); System.out.println("Iterator CLASS: " + Iterator.class); Class iterClass = Iterator.class; boolean iterA = iterClass.isAssignableFrom(returnType); if ( iterA || (((iteratorMethod == null) || iteratorMethod.getName().equals("toArray")) && Object[].class.isAssignableFrom(returnType) || Enumeration.class.isAssignableFrom(returnType))) { if (_debug) { _log.debug("Setting iterator method: " + meth); } iteratorMethod = meth; } } } } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/ffc13d6b20bc97f7b59543dc406ca84c7437281e/PropertyOperator.java/buggy/webmacro/src/org/webmacro/util/PropertyOperator.java
char ch = (char) ((String) o).charAt(0);
char ch = s.charAt(0);
public static Character toChar(Object o) throws org.webmacro.PropertyException { Character c = null; if (o == null || o == "") return null; if (o instanceof Character) return (Character) o; if (o instanceof Number) { try { c = new Character((char) ((Number) o).intValue()); } catch (Exception e) { throw new IllegalArgumentException("Not a valid char: " + o); } } else if (o instanceof String) { String s = (String) o; if (s.startsWith("\\u") && s.length() == 6) { // unicode char int i = Integer.parseInt(s.substring(2), 16); c = new Character((char) i); } else { // use the first character of the string char ch = (char) ((String) o).charAt(0); c = new Character(ch); } } else { // throw exception throw new org.webmacro.PropertyException( "$Type.toChar() is unable to convert the supplied value to a Character. The argument" + " must be a number or a String. The supplied argument was " + o + ((o == null) ? "." : " of type " + o.getClass().getName())); } return c; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/CastUtil.java/clean/webmacro/src/org/webmacro/util/CastUtil.java
+ o + ((o == null) ? "." : " of type " + o.getClass().getName()));
+ o + " of type " + o.getClass().getName());
public static Character toChar(Object o) throws org.webmacro.PropertyException { Character c = null; if (o == null || o == "") return null; if (o instanceof Character) return (Character) o; if (o instanceof Number) { try { c = new Character((char) ((Number) o).intValue()); } catch (Exception e) { throw new IllegalArgumentException("Not a valid char: " + o); } } else if (o instanceof String) { String s = (String) o; if (s.startsWith("\\u") && s.length() == 6) { // unicode char int i = Integer.parseInt(s.substring(2), 16); c = new Character((char) i); } else { // use the first character of the string char ch = (char) ((String) o).charAt(0); c = new Character(ch); } } else { // throw exception throw new org.webmacro.PropertyException( "$Type.toChar() is unable to convert the supplied value to a Character. The argument" + " must be a number or a String. The supplied argument was " + o + ((o == null) ? "." : " of type " + o.getClass().getName())); } return c; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8f5880751893a7e5dd9da25d036747a39c9b25b5/CastUtil.java/clean/webmacro/src/org/webmacro/util/CastUtil.java
internal.append(((RubyString)args[0]).getValue());
internal.append(args[0].convertToString().getValue());
public IRubyObject initialize(IRubyObject[] args) { internal = new StringBuffer(); if (checkArgumentCount(args, 0, 2) > 0) { internal.append(((RubyString)args[0]).getValue()); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ea4e25f1262c817873877b14c2a82825f1420dd0/RubyStringIO.java/buggy/src/org/jruby/RubyStringIO.java
str = (RubyString)args[0];
str = args[0].convertToString();
public static IRubyObject open(IRubyObject recv, IRubyObject[] args) { RubyString str = recv.getRuntime().newString(""); IRubyObject mode = recv.getRuntime().getNil(); if (args.length > 0) { str = (RubyString)args[0]; if (args.length > 1) { mode = args[1]; } } RubyStringIO strio = (RubyStringIO)newInstance(recv,new IRubyObject[]{str,mode}); IRubyObject val = strio; ThreadContext tc = recv.getRuntime().getCurrentContext(); if (tc.isBlockGiven()) { try { val = tc.yield(strio); } finally { strio.close(); } } return val; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ea4e25f1262c817873877b14c2a82825f1420dd0/RubyStringIO.java/buggy/src/org/jruby/RubyStringIO.java
((RubyString)args[1]).cat(buf); ret = args[1];
ret = args[1].convertToString(); ((RubyString)ret).setValue(buf);
public IRubyObject read(IRubyObject[] args) { String buf = null; if (!(pos >= internal.length() || eof)) { if (args.length > 0 && !args[0].isNil()) { int end = ((int)pos) + RubyNumeric.fix2int(args[0]); if (end > internal.length()) { buf = internal.substring((int)pos); } else { buf = internal.substring((int)pos,end); } } else { buf = internal.substring((int)pos); } pos+= buf.length(); } IRubyObject ret = null; if (buf == null) { if (args.length > 0) { return getRuntime().getNil(); } return getRuntime().newString(""); } else { if (args.length>1) { ((RubyString)args[1]).cat(buf); ret = args[1]; } else { ret = getRuntime().newString(buf); } } return ret; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ea4e25f1262c817873877b14c2a82825f1420dd0/RubyStringIO.java/buggy/src/org/jruby/RubyStringIO.java
internal.append(((RubyString)str).getValue());
internal.append(str.convertToString().getValue());
public IRubyObject reopen(IRubyObject str) { if (str instanceof RubyStringIO) { pos = ((RubyStringIO)str).pos; lineno = ((RubyStringIO)str).lineno; eof = ((RubyStringIO)str).eof; closedRead = ((RubyStringIO)str).closedRead; closedWrite = ((RubyStringIO)str).closedWrite; internal = new StringBuffer(((RubyStringIO)str).internal.toString()); } else { pos = 0L; lineno = 0; eof = false; internal = new StringBuffer(); internal.append(((RubyString)str).getValue()); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/ea4e25f1262c817873877b14c2a82825f1420dd0/RubyStringIO.java/buggy/src/org/jruby/RubyStringIO.java
int[] rows = tree.getSelectionRows(); boolean mask = me.isShiftDown(); if (!mask) mask = me.isControlDown() || (me.getModifiers() == 20); if (rows != null) { if (mask) { int[] newRows = new int[rows.length+1]; for (int i = 0; i < rows.length; i++) { newRows[i] = rows[i]; } newRows[rows.length] = row; tree.setSelectionRows(newRows); } else tree.setSelectionRow(row); } else tree.setSelectionRow(row);
private void onClick(MouseEvent me, boolean released) { Point p = me.getPoint(); JTree tree = getSelectedTree(); int row = tree.getRowForLocation(p.x, p.y); if (row != -1) { if (me.getClickCount() == 1) { int[] rows = tree.getSelectionRows(); boolean mask = me.isShiftDown(); if (!mask) mask = me.isControlDown() || (me.getModifiers() == 20); //tmp solution if (rows != null) { if (mask) { int[] newRows = new int[rows.length+1]; for (int i = 0; i < rows.length; i++) { newRows[i] = rows[i]; } newRows[rows.length] = row; tree.setSelectionRows(newRows); } else tree.setSelectionRow(row); } else tree.setSelectionRow(row); model.setClickPoint(p); if (me.isPopupTrigger()) controller.showPopupMenu(); //if (!released) controller.onClick(); } else if (me.getClickCount() == 2 && released) { model.viewDataObject(); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/BrowserUI.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java
if (node.getType() == Constants.NODE_BLOCK_PASS) {
if (node.getType() == Constants.NODE_ARRAY && node.getNextNode() == null) { return node.getHeadNode(); } else if (node.getType() == Constants.NODE_BLOCK_PASS) {
public Node ret_args(Node node) { if (node != null) { if (node.getType() == Constants.NODE_BLOCK_PASS) { rb_compile_error("block argument should not be given"); } } return node; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/ParserHelper.java/clean/org/jruby/parser/ParserHelper.java
iVisitor.visitFlip2Node(this);
iVisitor.visitFlipNode(this);
public void accept(NodeVisitor iVisitor) { iVisitor.visitFlip2Node(this); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d31a76ee29d5978a9bec41e3ac9134cee024bcab/FlipNode.java/buggy/org/jruby/nodes/FlipNode.java
mainPane.setDividerLocation(lastMove); mainPane.setResizeWeight(0);
if (lastMove != -1) { mainPane.setDividerLocation(lastMove); mainPane.setResizeWeight(0); }
void showClipBoard(boolean b) { JComponent cb = model.getClipBoard().getUI(); if (cb == null) return; if (b) { mainPane.setRightComponent(cb); mainPane.setDividerLocation(lastMove); mainPane.setResizeWeight(0); } else { lastMove = mainPane.getDividerLocation(); mainPane.remove(cb); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/39bb6f0c93c9752d3daacd9753b8402e6d393a78/HiViewerWin.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/view/HiViewerWin.java
public RubyClass newSubClass(String name, RubyModule parent) { return new FileMetaClass(name, this, parent);
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new FileMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { return new FileMetaClass(name, this, parent); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/FileMetaClass.java/buggy/src/org/jruby/runtime/builtin/meta/FileMetaClass.java
return t;
try { return t.evaluateAsString(bc); } catch (PropertyException e) { return ""; }
public final Object build (DirectiveBuilder builder, BuildContext bc) throws BuildException { Broker broker = bc.getBroker(); _log = bc.getLog("IncludeDirective"); // build configuration key names, since they're based // on the configured name of this directive _directiveName = builder.getName(); TEMPLATE_EXTENSIONS_NAME = _directiveName + TEMPLATE_EXTENSIONS_NAME; // determine what type of file we need to deal with if (builder.getArg(PARSE_TEXT_K, bc) != null) { _type = TYPE_TEXT; } else if (builder.getArg(PARSE_TEMPLATE_K, bc) != null) { _type = TYPE_TEMPLATE; } else if (builder.getArg(PARSE_MACRO_K, bc) != null) { _type = TYPE_MACRO; } else { _type = TYPE_DYNAMIC; } // if the filename passed to us was a Macro (needs to be evaluated later) // then store it as _macFilename. Otherwise, assume it's a String // and we'll just use that string as the filename Object o = builder.getArg(PARSE_FILENAME, bc); if (o instanceof Macro) { if (_type == TYPE_TEXT || _type == TYPE_MACRO) { _log.warning("Included a 'static' file type using a dynamic filename. " + "File will be included, but any included #macro's will not at " + bc.getCurrentLocation()); } _macFilename = (Macro) o; } else { _strFilename = o.toString(); if (_strFilename == null || _strFilename.length() == 0) throw makeBuildException("Filename cannot be null or empty"); if (_type == TYPE_TEXT) { // we're a static type, need to // include the file (by returning it) now, // during build time try { return getThingToInclude(broker, _type, _strFilename); } catch (Exception e) { throw makeBuildException("Unable to include as text", e); } } else if (_type == TYPE_MACRO) { // we're a template type. ned to get the template (already parsed) // and merge its macros into our build context. // then we return the template so its contents can also be included Template t = null; try { t = getTemplate(broker, _strFilename); bc.mergeConstants(t); } catch (Exception e) { throw makeBuildException("Unable to include as macro", e); } return t; } else if (_type == TYPE_DYNAMIC) { // being dynamic means we need to guess the // file type based on the file's extension // and take care of finding the file during runtime _type = guessType(broker, _strFilename); } } // we are configured to be lazy, or we couldn't determine the filename // during the build() process (b/c it is a Macro) return this; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c816d9dab5db9c3849b03ba88ced1fec9e4d75d3/IncludeDirective.java/buggy/webmacro/src/org/webmacro/directive/IncludeDirective.java
return self.getRuntime().newString("tag:yaml.org,2002:timestamp");
return self.getRuntime().newString("tag:yaml.org,2002:timestamp#ymd");
public IRubyObject method7(ThreadContext context, IRubyObject self, IRubyObject[] args) { return self.getRuntime().newString("tag:yaml.org,2002:timestamp"); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d645af1c42370aae4840042fffc1cc04acdc41f1/RubyYAML.java/clean/src/org/jruby/RubyYAML.java
loadPath.add(runtime.newString(path));
loadPath.add(runtime.newString(path.replace('\\', '/')));
private void addPath(String path) { loadPath.add(runtime.newString(path)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/LoadService.java/buggy/src/org/jruby/runtime/load/LoadService.java
IAutoloadMethod loadMethod = (IAutoloadMethod)autoloadMap.get(name);
IAutoloadMethod loadMethod = (IAutoloadMethod)autoloadMap.remove(name);
public IRubyObject autoload(String name) { IAutoloadMethod loadMethod = (IAutoloadMethod)autoloadMap.get(name); if (loadMethod != null) { return loadMethod.load(runtime, name); } return null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/LoadService.java/buggy/src/org/jruby/runtime/load/LoadService.java
378, 19, 15, 16, 21, 375, 19, 41, 6, 7, 392, 398, 27, 15, 16, 27, 342, 19, 43, 44, 10, 3, 693, 370, 49, 50, 10, 52, 53, 27, 10, 410, 50, 101, 21, 292, 44, 32, 47, 296, 10, 4, 5, 369, 71, 10, 51, 54, 50, 263, 280, 14, 106, 10, 280, 10, 54, 506, 507, 306, 41, 387, 11, 10, 11, 444, 313, 314, 693, 59, 695, 41, 310, 310, 58, 59, 402, 94, 343, 44, 61, 263, 264, 100, 269, 91, 271, 269, 51, 44, 10, 53, 2, 3, 4, 5, 113, 41, 8, 9, 10, 11, 59, 10, 14, 15, 16, 94, 0, 19, 15, 16, 310, 343, 19, 310, 26, 61, 10, 2, 320, 10, 71, 10, 310, 328, 343, 90, 454, 10, 10, 44, 362, 371, 371, 349, 362, 47, 48, 49, 10, 51, 304, 53, 49, 10, 308, 10, 61, 349, 10, 58, 59, 353, 354, 44, 359, 44, 829, 108, 10, 41, 308, 269, 47, 271, 10, 59, 125, 58, 59, 369, 370, 371, 369, 370, 371, 58, 59, 59, 90, 41, 10, 369, 370, 371, 311, 312, 10, 559, 10, 218, 310, 200, 59, 105, 59, 107, 545, 267, 10, 269, 200, 310, 829, 41, 231, 232, 233, 59, 467, 10, 590, 41, 58, 59, 44, 362, 565, 244, 41, 246, 247, 10, 107, 61, 244, 91, 246, 247, 41, 244, 681, 246, 247, 364, 58, 59, 58, 59, 61, 282, 244, 268, 246, 247, 93, 91, 58, 59, 61, 369, 370, 371, 263, 32, 290, 291, 16, 340, 59, 19, 369, 370, 371, 91, 256, 91, 61, 218, 331, 32, 59, 10, 666, 222, 223, 338, 125, 671, 269, 91, 271, 267, 309, 310, 311, 312, 313, 314,
378, 19, 15, 16, 21, 375, 19, 71, 6, 7, 392, 51, 27, 15, 16, 27, 342, 19, 43, 44, 10, 3, 398, 370, 49, 50, 10, 52, 53, 27, 44, 410, 50, 101, 21, 91, 292, 32, 47, 693, 296, 4, 5, 369, 10, 522, 523, 54, 50, 570, 571, 14, 10, 10, 106, 10, 54, 506, 507, 280, 41, 387, 11, 10, 11, 444, 666, 263, 693, 59, 695, 671, 10, 310, 58, 59, 402, 94, 44, 342, 61, 10, 342, 100, 10, 280, 10, 10, 51, 44, 361, 53, 2, 3, 4, 5, 113, 10, 8, 9, 10, 11, 59, 10, 14, 15, 16, 94, 310, 19, 15, 16, 32, 0, 19, 44, 26, 310, 93, 2, 58, 59, 71, 10, 10, 10, 310, 90, 454, 58, 59, 315, 44, 59, 371, 59, 10, 47, 48, 49, 361, 51, 10, 53, 49, 58, 59, 342, 10, 61, 125, 58, 59, 349, 218, 330, 41, 327, 269, 108, 271, 10, 337, 10, 47, 10, 361, 10, 125, 371, 308, 348, 59, 59, 10, 829, 369, 370, 371, 304, 90, 32, 44, 308, 91, 369, 370, 10, 358, 559, 58, 59, 10, 200, 41, 105, 41, 107, 545, 267, 377, 269, 200, 364, 829, 41, 231, 232, 233, 58, 59, 467, 590, 282, 59, 58, 59, 339, 565, 244, 41, 246, 247, 91, 107, 10, 244, 10, 246, 247, 10, 244, 681, 246, 247, 58, 59, 41, 339, 330, 61, 59, 244, 268, 246, 247, 337, 91, 91, 269, 41, 271, 41, 41, 263, 61, 41, 61, 41, 44, 737, 738, 783, 784, 61, 786, 256, 44, 91, 218, 61, 44, 61, 10, 330, 222, 223, 91, 269, 59, 271, 337, 262, 267, 309, 310, 311, 312, 313, 314,
private static final short[] yyCheck1() { return new short[] { 15, 16, 215, 14, 19, 7, 247, 15, 16, 6, 378, 19, 15, 16, 21, 375, 19, 41, 6, 7, 392, 398, 27, 15, 16, 27, 342, 19, 43, 44, 10, 3, 693, 370, 49, 50, 10, 52, 53, 27, 10, 410, 50, 101, 21, 292, 44, 32, 47, 296, 10, 4, 5, 369, 71, 10, 51, 54, 50, 263, 280, 14, 106, 10, 280, 10, 54, 506, 507, 306, 41, 387, 11, 10, 11, 444, 313, 314, 693, 59, 695, 41, 310, 310, 58, 59, 402, 94, 343, 44, 61, 263, 264, 100, 269, 91, 271, 269, 51, 44, 10, 53, 2, 3, 4, 5, 113, 41, 8, 9, 10, 11, 59, 10, 14, 15, 16, 94, 0, 19, 15, 16, 310, 343, 19, 310, 26, 61, 10, 2, 320, 10, 71, 10, 310, 328, 343, 90, 454, 10, 10, 44, 362, 371, 371, 349, 362, 47, 48, 49, 10, 51, 304, 53, 49, 10, 308, 10, 61, 349, 10, 58, 59, 353, 354, 44, 359, 44, 829, 108, 10, 41, 308, 269, 47, 271, 10, 59, 125, 58, 59, 369, 370, 371, 369, 370, 371, 58, 59, 59, 90, 41, 10, 369, 370, 371, 311, 312, 10, 559, 10, 218, 310, 200, 59, 105, 59, 107, 545, 267, 10, 269, 200, 310, 829, 41, 231, 232, 233, 59, 467, 10, 590, 41, 58, 59, 44, 362, 565, 244, 41, 246, 247, 10, 107, 61, 244, 91, 246, 247, 41, 244, 681, 246, 247, 364, 58, 59, 58, 59, 61, 282, 244, 268, 246, 247, 93, 91, 58, 59, 61, 369, 370, 371, 263, 32, 290, 291, 16, 340, 59, 19, 369, 370, 371, 91, 256, 91, 61, 218, 331, 32, 59, 10, 666, 222, 223, 338, 125, 671, 269, 91, 271, 267, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 290, 291, 222, 223, 368, 310, 10, 342, 91, 301, 345, 346, 59, 348, 306, 331, 44, 352, 346, 269, 348, 271, 338, 341, 244, 279, 246, 247, 725, 244, 349, 246, 247, 341, 369, 350, 256, 41, 727, 61, 418, 419, 377, 263, 733, 302, 303, 304, 305, 377, 267, 331, 387, 388, 389, 390, 279, 357, 338, 394, 368, 439, 595, 256, 369, 370, 394, 402, 267, 630, 263, 406, 407, 345, 346, 410, 348, 350, 386, 414, 352, 301, 302, 303, 304, 305, 306, 307, 308, 264, 281, 414, 427, 401, 269, 407, 776, 432, 433, 434, 425, 331, 414, 425, 363, 359, 441, 799, 338, 444, 44, 799, 447, 267, 340, 772, 10, 425, 91, 454, 262, 91, 342, 431, 341, 345, 346, 342, 348, 349, 350, 10, 352, 279, 10, 267, 359, 267, 397, 398, 340, 341, 341, 343, 344, 453, 264, 267, 279, 369, 370, 371, 290, 291, 369, 264, 349, 331, 279, 44, 849, 308, 41, 383, 338, 59, 61, 387, 368, 826, 703, 391, 387, 393, 10, 553, 244, 331, 246, 247, 59, 310, 402, 59, 338, 385, 386, 402, 877, 516, 383, 526, 522, 523, 414, 331, 10, 331, 391, 835, 393, 401, 338, 341, 338, 41, 91, 348, 428, 310, 59, 331, 340, 359, 511, 316, 263, 264, 338, 516, 290, 291, 549, 343, 340, 522, 523, 41, 359, 279, 44, 431, 311, 312, 454, 428, 377, 554, 359, 454, 369, 370, 371, 350, 351, 59, 554, 41, 331, 574, 44, 10, 574, 453, 240, 338, 44, 272, 593, 274, 275, 794, 308, 320, 2, 3, 574, 61, 369, 370, 8, 9, 10, 11, 268, 269, 611, 15, 16, 341, 615, 19, 41, 542, 619, 44, 10, 544, 26, 263, 264, 10, 349, 56, 57, 630, 353, 354, 355, 356, 59, 44, 44, 91, 44, 343, 331, 566, 643, 47, 48, 49, 690, 338, 362, 53, 340, 320, 630, 320, 655, 320, 93, 41, 544, 545, 657, 662, 663, 41, 125, 308, 371, 668, 669, 59, 304, 371, 44, 58, 59, 347, 269, 678, 679, 565, 267, 271, 91, 264, 607, 44, 41, 44, 689, 41, 125, 41, 331, 579, 41, 331, 32, 741, 340, 338, 744, 105, 338, 107, 264, 340, 91, 340, 268, 269, 340, 712, 713, 714, 348, 349, 350, 351, 657, 720, 579, 607, 264, 93, 662, 663, 727, 269, 279, 271, 668, 732, 733, 44, 2, 3, 4, 5, 732, 41, 8, 737, 738, 732, 630, 10, 14, 633, 93, 630, 264, 61, 404, 44, 732, 44, 44, 304, 683, 341, 304, 627, 628, 702, 650, 263, 767, 340, 769, 340, 340, 657, 658, 93, 660, 661, 662, 663, 41, 47, 331, 44, 668, 51, 10, 264, 709, 338, 264, 44, 93, 650, 343, 58, 59, 796, 350, 798, 61, 658, 725, 660, 661, 804, 44, 44, 44, 808, 359, 2, 3, 812, 41, 41, 41, 8, 702, 125, 222, 223, 706, 14, 90, 709, 93, 279, 91, 340, 91, 767, 570, 571, 58, 59, 835, 721, 722, 723, 264, 107, 244, 41, 246, 247, 264, 10, 847, 706, 849, 264, 340, 91, 256, 264, 47, 41, 359, 264, 41, 263, 834, 125, 721, 722, 723, 91, 867, 264, 869, 847, 279, 125, 262, 263, 264, 44, 877, 331, 308, 269, 881, 767, 267, 264, 338, 771, 772, 264, 306, 307, 44, 309, 44, 41, 59, 313, 314, 301, 302, 303, 304, 305, 306, 307, 308, 359, 792, 125, 264, 93, 44, 264, 771, 264, 107, 2, 3, 4, 5, 6, 44, 8, 331, 93, 125, 271, 343, 14, 44, 338, 41, 41, 10, 792, 93, 93, 125, 41, 342, 264, 826, 345, 346, 93, 348, 349, 331, 125, 352, 835, 359, 837, 41, 338, 835, 61, 5, 91, 844, 863, 47, 44, 614, 6, 51, 369, 370, 371, 834, 78, 776, 559, 624, 657, 836, 91, 90, 247, 837, 383, 58, 59, -1, 387, 695, 844, 695, 391, 256, 393, 2, 3, 71, 10, -1, 263, 8, -1, 402, -1, -1, -1, 267, 90, -1, -1, -1, -1, 91, -1, 414, -1, -1, 91, -1, -1, 279, 280, -1, -1, 107, -1, -1, -1, 428, -1, 293, 294, 295, 296, 297, -1, -1, 301, -1, 47, -1, -1, 306, 279, 280, 267, 59, 783, 784, -1, 786, -1, -1, -1, 454, -1, 10, -1, 280, 9, 10, 11, -1, -1, -1, -1, -1, 256, -1, -1, 331, -1, 331, -1, 263, -1, 26, 338, 726, 338, -1, 729, 730, -1, 343, 349, 350, 49, -1, 304, 10, -1, 307, 308, 309, 331, -1, -1, 48, 107, 359, -1, 338, 362, 58, 59, 370, 343, -1, 331, -1, -1, 301, -1, -1, -1, 338, 306, -1, 383, 856, 343, -1, 359, -1, -1, 362, 391, 343, 393, -1, -1, -1, 348, 349, 350, 351, 91, 58, 59, 362, -1, -1, 304, 544, 545, 307, 308, 309, 279, 280, -1, -1, -1, -1, 105, -1, -1, -1, -1, 349, -1, 810, 811, 428, 565, 41, 279, -1, 44, 331, 91, -1, 256, -1, -1, -1, 338, -1, 579, 263, 370, 343, -1, -1, -1, 61, 348, 349, 350, 351, -1, -1, 267, 383, -1, -1, 845, 846, -1, 279, 331, 391, 851, 393, -1, 280, 607, 338, -1, -1, -1, -1, 343, -1, -1, 91, -1, 301, 331, 868, -1, -1, 306, -1, 10, 338, -1, 876, 359, 630, 879, 362, 633, -1, 883, -1, -1, 304, 428, -1, 307, 308, 309, -1, -1, -1, 359, 256, -1, 650, -1, 331, -1, -1, 263, -1, 331, 658, 338, 660, 661, 662, 663, 338, -1, 349, 350, 668, 343, -1, -1, 222, 223, 59, -1, -1, -1, -1, -1, 359, 545, 348, 349, 350, 351, -1, 370, 362, -1, -1, 304, -1, 301, 307, 308, 309, -1, 306, -1, 383, 565, 231, 232, -1, -1, 706, -1, 391, 709, 393, -1, -1, 267, -1, 579, -1, -1, 331, -1, -1, 721, 722, 723, 0, 338, 280, -1, -1, -1, 343, -1, -1, 10, -1, 348, 349, 350, 351, -1, -1, 349, -1, -1, -1, 428, -1, 267, -1, -1, -1, -1, 302, 303, 304, 305, 545, 307, 308, -1, -1, -1, 370, -1, -1, 41, -1, 767, -1, -1, -1, 771, 772, -1, -1, 383, 565, 331, -1, -1, 342, -1, 59, 391, 338, 393, 650, 651, -1, 343, 579, -1, 792, 657, 658, -1, 660, 661, -1, -1, -1, -1, -1, -1, 279, -1, 10, 369, 362, -1, -1, 331, -1, -1, -1, 377, 378, 346, 338, 348, 428, 371, -1, 44, -1, 387, 826, -1, -1, -1, -1, -1, -1, -1, -1, 835, -1, 837, 702, -1, 402, -1, 706, -1, 844, -1, -1, -1, 377, 125, -1, -1, -1, -1, -1, 59, 331, 721, 722, 723, -1, 650, 545, 338, 414, 394, -1, -1, 657, 658, 91, 660, 661, -1, -1, -1, -1, 406, 407, -1, -1, 410, 565, -1, 359, 414, -1, -1, -1, -1, 41, -1, 454, 44, -1, -1, 579, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 771, 772, -1, 61, -1, 441, 702, -1, 444, -1, 706, 447, 304, -1, -1, 307, 308, 309, -1, -1, 10, 792, -1, -1, -1, 721, 722, 723, -1, -1, 545, -1, -1, 91, -1, -1, 505, 506, 507, 331, -1, -1, 511, -1, -1, 41, 338, -1, 44, -1, 565, 343, -1, 522, 523, 826, 348, 349, 350, 351, 650, -1, -1, -1, 579, 61, 837, 657, 658, 59, 660, 661, -1, 844, -1, 771, 772, 546, -1, 262, 263, 264, -1, -1, -1, 268, 269, 544, 271, -1, 526, -1, -1, -1, 41, 91, 792, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 578, -1, 580, 702, 582, 61, -1, 706, -1, -1, 41, 304, 590, 44, 307, 308, 309, -1, -1, -1, -1, 826, 721, 722, 723, -1, 650, 0, -1, -1, 61, -1, 837, -1, 658, 91, 660, 661, 331, 844, -1, 607, 279, 280, -1, 338, -1, -1, 593, -1, 343, -1, -1, -1, -1, 348, 349, 350, 351, -1, 91, -1, -1, -1, -1, -1, 611, 633, 41, -1, 615, -1, 771, 772, 619, -1, -1, -1, -1, -1, -1, -1, 706, -1, 304, 630, -1, 307, 308, 309, -1, -1, 0, 792, 331, -1, -1, 721, 722, 723, -1, 338, 10, 681, -1, -1, 343, -1, -1, -1, -1, 331, 279, 280, -1, -1, -1, -1, 338, -1, -1, -1, 359, 343, -1, 362, -1, 826, 348, 349, 350, 351, -1, 41, 679, -1, 44, -1, 837, -1, -1, -1, -1, 709, 689, 844, -1, 771, 772, -1, 58, 59, 125, 61, -1, 63, -1, -1, -1, 737, 738, -1, -1, -1, 331, -1, -1, -1, 792, -1, -1, 338, -1, -1, 279, 720, 343, -1, -1, -1, -1, -1, 727, 91, -1, 93, -1, -1, 733, -1, -1, -1, 359, -1, -1, 362, -1, -1, -1, -1, -1, -1, 826, -1, -1, 304, -1, -1, 307, 308, 309, -1, -1, 837, -1, 0, -1, 125, -1, -1, 844, 799, -1, 279, 769, 10, 331, -1, -1, -1, -1, -1, 331, 338, -1, -1, -1, -1, 343, 338, -1, -1, -1, -1, 343, -1, -1, -1, 279, 348, 349, 350, 351, 798, 359, -1, 41, 835, -1, 44, -1, -1, -1, 808, -1, -1, -1, 812, -1, -1, -1, -1, -1, 58, 59, 331, 61, -1, 63, -1, -1, -1, 338, -1, -1, 863, -1, -1, 10, 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, -1, 331, -1, 847, 359, 849, -1, 91, 338, 93, 320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 867, -1, 869, 336, 337, -1, 359, -1, -1, -1, 877, -1, -1, -1, 881, -1, 349, -1, 125, 63, 353, 354, 355, 356, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, 63, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 59, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 297, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 58, 59, -1, 61, -1, 63, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 304, 305, 0, -1, 308, -1, -1, -1, -1, -1, -1, 315, 10, 317, 318, 125, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 320, 41, 348, 349, 44, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, 336, 337, 58, 59, -1, 61, 304, 63, -1, 307, 308, 309, -1, 349, -1, 351, -1, 353, 354, 355, 356, -1, 10, -1, -1, 320, -1, -1, -1, -1, 325, 326, -1, 331, -1, 91, -1, 93, -1, -1, 338, 336, 337, -1, -1, 343, -1, -1, -1, -1, 348, 349, 350, 351, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 125, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 63, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, 304, -1, -1, 307, 308, 309, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331, -1, -1, -1, -1, -1, -1, 338, -1, -1, -1, 41, 343, -1, 44, -1, -1, 348, 349, 350, 351, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, 91, -1, 93, -1, -1, -1, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 0, -1, 308, -1, -1, -1, -1, -1, -1, 315, 10, 317, 318, 125, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 348, 349, 44, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 58, 59, -1, -1, -1, 63, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, 91, -1, 93, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 125, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 58, 59, 308, -1, -1, 63, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, 91, -1, 93, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, 361, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, 41, 329, -1, 44, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 348, 349, 63, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, 58, -1, -1, -1, 125, 63, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 58, 59, 308, -1, -1, 63, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, 91, -1, 93, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, 361, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, 41, 329, -1, 44, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 348, 349, 63, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, 41, 325, 326, 44, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, 0, 334, 335, 336, 337, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, 41, -1, -1, 44, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, 58, 59, 329, -1, -1, 63, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 91, 361, 93, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, 125, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, 363, 364, 365, 366, 367, 368, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 59, -1, 61, -1, 63, 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, 320, 361, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, 336, 337, 10, -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, 349, -1, 351, -1, 353, 354, 355, 356, -1, -1, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, 61, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a404cb04ade8bbc527b55cf473199686102428e1/YyTables.java/clean/src/org/jruby/parser/YyTables.java
290, 291, 222, 223, 368, 310, 10, 342, 91, 301, 345, 346, 59, 348, 306, 331, 44, 352, 346, 269, 348, 271, 338, 341, 244, 279, 246, 247, 725, 244, 349, 246, 247, 341, 369, 350, 256, 41, 727, 61,
350, 264, 222, 223, 308, 310, 368, 342, 61, 301, 345, 346, 59, 348, 306, 59, 340, 352, 346, 267, 348, 91, 290, 291, 244, 856, 246, 247, 267, 244, 349, 246, 247, 341, 369, 279, 256, 339, 727, 725,
private static final short[] yyCheck1() { return new short[] { 15, 16, 215, 14, 19, 7, 247, 15, 16, 6, 378, 19, 15, 16, 21, 375, 19, 41, 6, 7, 392, 398, 27, 15, 16, 27, 342, 19, 43, 44, 10, 3, 693, 370, 49, 50, 10, 52, 53, 27, 10, 410, 50, 101, 21, 292, 44, 32, 47, 296, 10, 4, 5, 369, 71, 10, 51, 54, 50, 263, 280, 14, 106, 10, 280, 10, 54, 506, 507, 306, 41, 387, 11, 10, 11, 444, 313, 314, 693, 59, 695, 41, 310, 310, 58, 59, 402, 94, 343, 44, 61, 263, 264, 100, 269, 91, 271, 269, 51, 44, 10, 53, 2, 3, 4, 5, 113, 41, 8, 9, 10, 11, 59, 10, 14, 15, 16, 94, 0, 19, 15, 16, 310, 343, 19, 310, 26, 61, 10, 2, 320, 10, 71, 10, 310, 328, 343, 90, 454, 10, 10, 44, 362, 371, 371, 349, 362, 47, 48, 49, 10, 51, 304, 53, 49, 10, 308, 10, 61, 349, 10, 58, 59, 353, 354, 44, 359, 44, 829, 108, 10, 41, 308, 269, 47, 271, 10, 59, 125, 58, 59, 369, 370, 371, 369, 370, 371, 58, 59, 59, 90, 41, 10, 369, 370, 371, 311, 312, 10, 559, 10, 218, 310, 200, 59, 105, 59, 107, 545, 267, 10, 269, 200, 310, 829, 41, 231, 232, 233, 59, 467, 10, 590, 41, 58, 59, 44, 362, 565, 244, 41, 246, 247, 10, 107, 61, 244, 91, 246, 247, 41, 244, 681, 246, 247, 364, 58, 59, 58, 59, 61, 282, 244, 268, 246, 247, 93, 91, 58, 59, 61, 369, 370, 371, 263, 32, 290, 291, 16, 340, 59, 19, 369, 370, 371, 91, 256, 91, 61, 218, 331, 32, 59, 10, 666, 222, 223, 338, 125, 671, 269, 91, 271, 267, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 290, 291, 222, 223, 368, 310, 10, 342, 91, 301, 345, 346, 59, 348, 306, 331, 44, 352, 346, 269, 348, 271, 338, 341, 244, 279, 246, 247, 725, 244, 349, 246, 247, 341, 369, 350, 256, 41, 727, 61, 418, 419, 377, 263, 733, 302, 303, 304, 305, 377, 267, 331, 387, 388, 389, 390, 279, 357, 338, 394, 368, 439, 595, 256, 369, 370, 394, 402, 267, 630, 263, 406, 407, 345, 346, 410, 348, 350, 386, 414, 352, 301, 302, 303, 304, 305, 306, 307, 308, 264, 281, 414, 427, 401, 269, 407, 776, 432, 433, 434, 425, 331, 414, 425, 363, 359, 441, 799, 338, 444, 44, 799, 447, 267, 340, 772, 10, 425, 91, 454, 262, 91, 342, 431, 341, 345, 346, 342, 348, 349, 350, 10, 352, 279, 10, 267, 359, 267, 397, 398, 340, 341, 341, 343, 344, 453, 264, 267, 279, 369, 370, 371, 290, 291, 369, 264, 349, 331, 279, 44, 849, 308, 41, 383, 338, 59, 61, 387, 368, 826, 703, 391, 387, 393, 10, 553, 244, 331, 246, 247, 59, 310, 402, 59, 338, 385, 386, 402, 877, 516, 383, 526, 522, 523, 414, 331, 10, 331, 391, 835, 393, 401, 338, 341, 338, 41, 91, 348, 428, 310, 59, 331, 340, 359, 511, 316, 263, 264, 338, 516, 290, 291, 549, 343, 340, 522, 523, 41, 359, 279, 44, 431, 311, 312, 454, 428, 377, 554, 359, 454, 369, 370, 371, 350, 351, 59, 554, 41, 331, 574, 44, 10, 574, 453, 240, 338, 44, 272, 593, 274, 275, 794, 308, 320, 2, 3, 574, 61, 369, 370, 8, 9, 10, 11, 268, 269, 611, 15, 16, 341, 615, 19, 41, 542, 619, 44, 10, 544, 26, 263, 264, 10, 349, 56, 57, 630, 353, 354, 355, 356, 59, 44, 44, 91, 44, 343, 331, 566, 643, 47, 48, 49, 690, 338, 362, 53, 340, 320, 630, 320, 655, 320, 93, 41, 544, 545, 657, 662, 663, 41, 125, 308, 371, 668, 669, 59, 304, 371, 44, 58, 59, 347, 269, 678, 679, 565, 267, 271, 91, 264, 607, 44, 41, 44, 689, 41, 125, 41, 331, 579, 41, 331, 32, 741, 340, 338, 744, 105, 338, 107, 264, 340, 91, 340, 268, 269, 340, 712, 713, 714, 348, 349, 350, 351, 657, 720, 579, 607, 264, 93, 662, 663, 727, 269, 279, 271, 668, 732, 733, 44, 2, 3, 4, 5, 732, 41, 8, 737, 738, 732, 630, 10, 14, 633, 93, 630, 264, 61, 404, 44, 732, 44, 44, 304, 683, 341, 304, 627, 628, 702, 650, 263, 767, 340, 769, 340, 340, 657, 658, 93, 660, 661, 662, 663, 41, 47, 331, 44, 668, 51, 10, 264, 709, 338, 264, 44, 93, 650, 343, 58, 59, 796, 350, 798, 61, 658, 725, 660, 661, 804, 44, 44, 44, 808, 359, 2, 3, 812, 41, 41, 41, 8, 702, 125, 222, 223, 706, 14, 90, 709, 93, 279, 91, 340, 91, 767, 570, 571, 58, 59, 835, 721, 722, 723, 264, 107, 244, 41, 246, 247, 264, 10, 847, 706, 849, 264, 340, 91, 256, 264, 47, 41, 359, 264, 41, 263, 834, 125, 721, 722, 723, 91, 867, 264, 869, 847, 279, 125, 262, 263, 264, 44, 877, 331, 308, 269, 881, 767, 267, 264, 338, 771, 772, 264, 306, 307, 44, 309, 44, 41, 59, 313, 314, 301, 302, 303, 304, 305, 306, 307, 308, 359, 792, 125, 264, 93, 44, 264, 771, 264, 107, 2, 3, 4, 5, 6, 44, 8, 331, 93, 125, 271, 343, 14, 44, 338, 41, 41, 10, 792, 93, 93, 125, 41, 342, 264, 826, 345, 346, 93, 348, 349, 331, 125, 352, 835, 359, 837, 41, 338, 835, 61, 5, 91, 844, 863, 47, 44, 614, 6, 51, 369, 370, 371, 834, 78, 776, 559, 624, 657, 836, 91, 90, 247, 837, 383, 58, 59, -1, 387, 695, 844, 695, 391, 256, 393, 2, 3, 71, 10, -1, 263, 8, -1, 402, -1, -1, -1, 267, 90, -1, -1, -1, -1, 91, -1, 414, -1, -1, 91, -1, -1, 279, 280, -1, -1, 107, -1, -1, -1, 428, -1, 293, 294, 295, 296, 297, -1, -1, 301, -1, 47, -1, -1, 306, 279, 280, 267, 59, 783, 784, -1, 786, -1, -1, -1, 454, -1, 10, -1, 280, 9, 10, 11, -1, -1, -1, -1, -1, 256, -1, -1, 331, -1, 331, -1, 263, -1, 26, 338, 726, 338, -1, 729, 730, -1, 343, 349, 350, 49, -1, 304, 10, -1, 307, 308, 309, 331, -1, -1, 48, 107, 359, -1, 338, 362, 58, 59, 370, 343, -1, 331, -1, -1, 301, -1, -1, -1, 338, 306, -1, 383, 856, 343, -1, 359, -1, -1, 362, 391, 343, 393, -1, -1, -1, 348, 349, 350, 351, 91, 58, 59, 362, -1, -1, 304, 544, 545, 307, 308, 309, 279, 280, -1, -1, -1, -1, 105, -1, -1, -1, -1, 349, -1, 810, 811, 428, 565, 41, 279, -1, 44, 331, 91, -1, 256, -1, -1, -1, 338, -1, 579, 263, 370, 343, -1, -1, -1, 61, 348, 349, 350, 351, -1, -1, 267, 383, -1, -1, 845, 846, -1, 279, 331, 391, 851, 393, -1, 280, 607, 338, -1, -1, -1, -1, 343, -1, -1, 91, -1, 301, 331, 868, -1, -1, 306, -1, 10, 338, -1, 876, 359, 630, 879, 362, 633, -1, 883, -1, -1, 304, 428, -1, 307, 308, 309, -1, -1, -1, 359, 256, -1, 650, -1, 331, -1, -1, 263, -1, 331, 658, 338, 660, 661, 662, 663, 338, -1, 349, 350, 668, 343, -1, -1, 222, 223, 59, -1, -1, -1, -1, -1, 359, 545, 348, 349, 350, 351, -1, 370, 362, -1, -1, 304, -1, 301, 307, 308, 309, -1, 306, -1, 383, 565, 231, 232, -1, -1, 706, -1, 391, 709, 393, -1, -1, 267, -1, 579, -1, -1, 331, -1, -1, 721, 722, 723, 0, 338, 280, -1, -1, -1, 343, -1, -1, 10, -1, 348, 349, 350, 351, -1, -1, 349, -1, -1, -1, 428, -1, 267, -1, -1, -1, -1, 302, 303, 304, 305, 545, 307, 308, -1, -1, -1, 370, -1, -1, 41, -1, 767, -1, -1, -1, 771, 772, -1, -1, 383, 565, 331, -1, -1, 342, -1, 59, 391, 338, 393, 650, 651, -1, 343, 579, -1, 792, 657, 658, -1, 660, 661, -1, -1, -1, -1, -1, -1, 279, -1, 10, 369, 362, -1, -1, 331, -1, -1, -1, 377, 378, 346, 338, 348, 428, 371, -1, 44, -1, 387, 826, -1, -1, -1, -1, -1, -1, -1, -1, 835, -1, 837, 702, -1, 402, -1, 706, -1, 844, -1, -1, -1, 377, 125, -1, -1, -1, -1, -1, 59, 331, 721, 722, 723, -1, 650, 545, 338, 414, 394, -1, -1, 657, 658, 91, 660, 661, -1, -1, -1, -1, 406, 407, -1, -1, 410, 565, -1, 359, 414, -1, -1, -1, -1, 41, -1, 454, 44, -1, -1, 579, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 771, 772, -1, 61, -1, 441, 702, -1, 444, -1, 706, 447, 304, -1, -1, 307, 308, 309, -1, -1, 10, 792, -1, -1, -1, 721, 722, 723, -1, -1, 545, -1, -1, 91, -1, -1, 505, 506, 507, 331, -1, -1, 511, -1, -1, 41, 338, -1, 44, -1, 565, 343, -1, 522, 523, 826, 348, 349, 350, 351, 650, -1, -1, -1, 579, 61, 837, 657, 658, 59, 660, 661, -1, 844, -1, 771, 772, 546, -1, 262, 263, 264, -1, -1, -1, 268, 269, 544, 271, -1, 526, -1, -1, -1, 41, 91, 792, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 578, -1, 580, 702, 582, 61, -1, 706, -1, -1, 41, 304, 590, 44, 307, 308, 309, -1, -1, -1, -1, 826, 721, 722, 723, -1, 650, 0, -1, -1, 61, -1, 837, -1, 658, 91, 660, 661, 331, 844, -1, 607, 279, 280, -1, 338, -1, -1, 593, -1, 343, -1, -1, -1, -1, 348, 349, 350, 351, -1, 91, -1, -1, -1, -1, -1, 611, 633, 41, -1, 615, -1, 771, 772, 619, -1, -1, -1, -1, -1, -1, -1, 706, -1, 304, 630, -1, 307, 308, 309, -1, -1, 0, 792, 331, -1, -1, 721, 722, 723, -1, 338, 10, 681, -1, -1, 343, -1, -1, -1, -1, 331, 279, 280, -1, -1, -1, -1, 338, -1, -1, -1, 359, 343, -1, 362, -1, 826, 348, 349, 350, 351, -1, 41, 679, -1, 44, -1, 837, -1, -1, -1, -1, 709, 689, 844, -1, 771, 772, -1, 58, 59, 125, 61, -1, 63, -1, -1, -1, 737, 738, -1, -1, -1, 331, -1, -1, -1, 792, -1, -1, 338, -1, -1, 279, 720, 343, -1, -1, -1, -1, -1, 727, 91, -1, 93, -1, -1, 733, -1, -1, -1, 359, -1, -1, 362, -1, -1, -1, -1, -1, -1, 826, -1, -1, 304, -1, -1, 307, 308, 309, -1, -1, 837, -1, 0, -1, 125, -1, -1, 844, 799, -1, 279, 769, 10, 331, -1, -1, -1, -1, -1, 331, 338, -1, -1, -1, -1, 343, 338, -1, -1, -1, -1, 343, -1, -1, -1, 279, 348, 349, 350, 351, 798, 359, -1, 41, 835, -1, 44, -1, -1, -1, 808, -1, -1, -1, 812, -1, -1, -1, -1, -1, 58, 59, 331, 61, -1, 63, -1, -1, -1, 338, -1, -1, 863, -1, -1, 10, 262, 263, 264, -1, -1, -1, 268, 269, -1, 271, -1, 331, -1, 847, 359, 849, -1, 91, 338, 93, 320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 867, -1, 869, 336, 337, -1, 359, -1, -1, -1, 877, -1, -1, -1, 881, -1, 349, -1, 125, 63, 353, 354, 355, 356, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, 63, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, 59, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 297, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 58, 59, -1, 61, -1, 63, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 93, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 304, 305, 0, -1, 308, -1, -1, -1, -1, -1, -1, 315, 10, 317, 318, 125, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 320, 41, 348, 349, 44, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, 336, 337, 58, 59, -1, 61, 304, 63, -1, 307, 308, 309, -1, 349, -1, 351, -1, 353, 354, 355, 356, -1, 10, -1, -1, 320, -1, -1, -1, -1, 325, 326, -1, 331, -1, 91, -1, 93, -1, -1, 338, 336, 337, -1, -1, 343, -1, -1, -1, -1, 348, 349, 350, 351, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 125, -1, 59, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 63, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, 304, -1, -1, 307, 308, 309, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 331, -1, -1, -1, -1, -1, -1, 338, -1, -1, -1, 41, 343, -1, 44, -1, -1, 348, 349, 350, 351, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, 91, -1, 93, -1, -1, -1, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 0, -1, 308, -1, -1, -1, -1, -1, -1, 315, 10, 317, 318, 125, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, 348, 349, 44, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, 58, 59, -1, -1, -1, 63, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, 91, -1, 93, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 44, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 125, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 58, 59, 308, -1, -1, 63, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, 91, -1, 93, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, 361, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, 41, 329, -1, 44, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 348, 349, 63, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, 58, -1, -1, -1, 125, 63, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, 332, 333, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, 304, 305, 58, 59, 308, -1, -1, 63, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, 91, -1, 93, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 0, 361, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, 41, 329, -1, 44, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, 348, 349, 63, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, -1, -1, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, 41, 325, 326, 44, -1, 329, -1, -1, -1, -1, 334, 335, 336, 337, -1, -1, -1, 58, 59, -1, 61, -1, 63, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, -1, -1, 91, -1, 93, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, -1, -1, 329, -1, -1, -1, 0, 334, 335, 336, 337, -1, -1, -1, -1, -1, 10, -1, -1, 125, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, 304, 305, -1, -1, 308, -1, 41, -1, -1, 44, -1, 315, -1, 317, 318, -1, 320, 321, 322, 323, -1, 325, 326, 58, 59, 329, -1, -1, 63, -1, 334, 335, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, 352, 353, 354, 355, 356, 357, 358, 359, 91, 361, 93, -1, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, 125, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, -1, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, 364, 365, 366, 367, 368, 257, 258, 259, -1, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, -1, -1, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, -1, 293, 294, 295, 296, 297, -1, 299, -1, -1, 302, 303, 304, 305, 306, 307, 308, 309, -1, 311, 312, 313, 314, -1, -1, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, -1, -1, 336, 337, 338, 339, -1, 341, 342, -1, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 0, 363, 364, 365, 366, 367, 368, -1, -1, -1, 10, -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, 327, -1, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, 349, 44, 351, -1, 353, 354, 355, 356, 357, 358, 359, -1, 361, -1, -1, -1, 59, -1, 61, -1, 63, 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, 336, 337, -1, -1, -1, -1, -1, -1, -1, -1, -1, 91, -1, 349, -1, 351, -1, 353, 354, 355, 356, 357, 358, 359, 320, 361, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, 336, 337, 10, -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, 349, -1, 351, -1, 353, 354, 355, 356, -1, -1, 359, -1, 361, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, 61, -1, 63, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a404cb04ade8bbc527b55cf473199686102428e1/YyTables.java/clean/src/org/jruby/parser/YyTables.java