rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return RubyModule.newModule(getRuntime(), getBaseName(), cref.getNext());
return RubyModule.newModule(getRuntime(), getBaseName(), cref.getNext());
protected IRubyObject doClone() { return RubyModule.newModule(getRuntime(), getBaseName(), cref.getNext()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject executeUnder(Callback method, IRubyObject[] args) { ThreadContext context = getRuntime().getCurrentContext(); context.preExecuteUnder(this); try { return method.execute(this, args); } finally { context.postExecuteUnder(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'");
throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'", name);
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); }
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); }
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public Arity getArity() { return Arity.optional(); } }, visibility));
public Arity getArity() { return Arity.optional(); } }, visibility));
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return context.callSuper(context.getFrameArgs()); }
return context.callSuper(context.getFrameArgs()); }
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return Arity.optional(); }
return Arity.optional(); }
public Arity getArity() { return Arity.optional(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null;
IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null;
public RubyClass getClass(String name) { IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
IRubyObject variable = module.getInstanceVariable(name);
IRubyObject variable = module.getInstanceVariable(name);
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName());
throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName(), name);
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return getInstanceVariable(name);
return getInstanceVariable(name);
public IRubyObject getConstantAt(String name) { return getInstanceVariable(name); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
retry: while (true) {
retry: while (true) {
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
getRuntime().getWarnings().warn("toplevel constant " + name +
getRuntime().getWarnings().warn("toplevel constant " + name +
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
if (isClass()) {
if (isClass()) {
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
} else {
} else {
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
}
}
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public boolean hasModuleInHierarchy(RubyModule type) { // XXX: This check previously used callMethod("==") to check for equality between classes // when scanning the hierarchy. However the == check may be safe; we should only ever have // one instance bound to a given type/constant. If it's found to be unsafe, examine ways // to avoid the == call. for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.getNonIncludedClass() == type) return true; } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public RubyModule include(IRubyObject[] modules) { ThreadContext context = getRuntime().getCurrentContext(); for (int i = modules.length - 1; i >= 0; i--) { modules[i].callMethod(context, "append_features", this); modules[i].callMethod(context, "included", this); } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return; }
return; }
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
boolean superclassSeen = false;
boolean superclassSeen = false;
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(),
c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(),
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator();
for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator();
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
RubyModule realType = type.getNonIncludedClass();
RubyModule realType = type.getNonIncludedClass();
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
undefinedMethods.put(methodName, Boolean.TRUE); continue;
undefinedMethods.put(methodName, Boolean.TRUE); continue;
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
if (method.getImplementationClass() == realType &&
if (method.getImplementationClass() == realType &&
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
RubyString name = getRuntime().newString(methodName);
RubyString name = getRuntime().newString(methodName);
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
if (!ary.includes(name)) { ary.append(name); } }
if (!ary.includes(name)) { ary.append(name); } }
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
for (RubyModule p = this; p != null; p = p.getSuperClass()) {
for (RubyModule p = this; p != null; p = p.getSuperClass()) {
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return getRuntime().getNil();
return getRuntime().getNil();
public IRubyObject method_added(IRubyObject nothing) { return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public RubyModule module_function(IRubyObject[] args) { if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't change method visibility"); } ThreadContext context = getRuntime().getCurrentContext(); if (args.length == 0) { context.setCurrentVisibility(Visibility.MODULE_FUNCTION); } else { setMethodVisibility(args, Visibility.PRIVATE); for (int i = 0; i < args.length; i++) { String name = args[i].asSymbol(); ICallable method = searchMethod(name); assert !method.isUndefined() : "undefined method '" + name + "'"; getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), method, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", RubySymbol.newSymbol(getRuntime(), name)); } } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return getRuntime().newString(getBaseName() == null ? "" : getName());
return getRuntime().newString(getBaseName() == null ? "" : getName());
public RubyString name() { return getRuntime().newString(getBaseName() == null ? "" : getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("undefined method `" + name + "' for class `" + this.getName() + "'");
throw getRuntime().newNameError("undefined method `" + name + "' for class `" + this.getName() + "'", name);
public IRubyObject newMethod(IRubyObject receiver, String name, boolean bound) { ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method `" + name + "' for class `" + this.getName() + "'"); } RubyMethod newMethod = null; if (bound) { newMethod = RubyMethod.newMethod(method.getImplementationClass(), name, this, name, method, receiver); } else { newMethod = RubyUnboundMethod.newUnboundMethod(method.getImplementationClass(), name, this, name, method); } newMethod.infectBy(this); return newMethod; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject op_cmp(IRubyObject obj) { if (this == obj) { return getRuntime().newFixnum(0); } if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError( "<=> requires Class or Module (" + getMetaClass().getName() + " given)"); } RubyModule module = (RubyModule)obj; if (module.isKindOfModule(this)) { return getRuntime().newFixnum(1); } else if (this.isKindOfModule(module)) { return getRuntime().newFixnum(-1); } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject op_cmp(IRubyObject obj) { if (this == obj) { return getRuntime().newFixnum(0); } if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError( "<=> requires Class or Module (" + getMetaClass().getName() + " given)"); } RubyModule module = (RubyModule)obj; if (module.isKindOfModule(this)) { return getRuntime().newFixnum(1); } else if (this.isKindOfModule(module)) { return getRuntime().newFixnum(-1); } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject op_cmp(IRubyObject obj) { if (this == obj) { return getRuntime().newFixnum(0); } if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError( "<=> requires Class or Module (" + getMetaClass().getName() + " given)"); } RubyModule module = (RubyModule)obj; if (module.isKindOfModule(this)) { return getRuntime().newFixnum(1); } else if (this.isKindOfModule(module)) { return getRuntime().newFixnum(-1); } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject op_le(IRubyObject obj) { if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError("compared with non class/module"); } if (isKindOfModule((RubyModule)obj)) { return getRuntime().getTrue(); } else if (((RubyModule)obj).isKindOfModule(this)) { return getRuntime().getFalse(); } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject op_le(IRubyObject obj) { if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError("compared with non class/module"); } if (isKindOfModule((RubyModule)obj)) { return getRuntime().getTrue(); } else if (((RubyModule)obj).isKindOfModule(this)) { return getRuntime().getFalse(); } return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return obj == this ? getRuntime().getFalse() : op_le(obj);
return obj == this ? getRuntime().getFalse() : op_le(obj);
public IRubyObject op_lt(IRubyObject obj) { return obj == this ? getRuntime().getFalse() : op_le(obj); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
return instance_methods(args, Visibility.PUBLIC);
return instance_methods(args, Visibility.PUBLIC);
public RubyArray public_instance_methods(IRubyObject[] args) { return instance_methods(args, Visibility.PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
getMethods().remove(name);
getMethods().remove(name);
public void removeCachedMethod(String name) { getMethods().remove(name); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("wrong class variable name " + name.asSymbol());
throw getRuntime().newNameError("wrong class variable name " + name.asSymbol(), name.asSymbol());
public IRubyObject removeCvar(IRubyObject name) { // Wrong Parameter ? if (!IdUtil.isClassVariable(name.asSymbol())) { throw getRuntime().newNameError("wrong class variable name " + name.asSymbol()); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject value = removeInstanceVariable(name.asSymbol()); if (value != null) { return value; } if (isClassVarDefined(name.asSymbol())) { throw getRuntime().newNameError("cannot remove " + name.asSymbol() + " for " + getName()); } throw getRuntime().newNameError("class variable " + name.asSymbol() + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("cannot remove " + name.asSymbol() + " for " + getName());
throw cannotRemoveError(name.asSymbol());
public IRubyObject removeCvar(IRubyObject name) { // Wrong Parameter ? if (!IdUtil.isClassVariable(name.asSymbol())) { throw getRuntime().newNameError("wrong class variable name " + name.asSymbol()); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject value = removeInstanceVariable(name.asSymbol()); if (value != null) { return value; } if (isClassVarDefined(name.asSymbol())) { throw getRuntime().newNameError("cannot remove " + name.asSymbol() + " for " + getName()); } throw getRuntime().newNameError("class variable " + name.asSymbol() + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("class variable " + name.asSymbol() + " not defined for " + getName());
throw getRuntime().newNameError("class variable " + name.asSymbol() + " not defined for " + getName(), name.asSymbol());
public IRubyObject removeCvar(IRubyObject name) { // Wrong Parameter ? if (!IdUtil.isClassVariable(name.asSymbol())) { throw getRuntime().newNameError("wrong class variable name " + name.asSymbol()); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject value = removeInstanceVariable(name.asSymbol()); if (value != null) { return value; } if (isClassVarDefined(name.asSymbol())) { throw getRuntime().newNameError("cannot remove " + name.asSymbol() + " for " + getName()); } throw getRuntime().newNameError("class variable " + name.asSymbol() + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("method '" + name + "' not defined in " + getName());
throw getRuntime().newNameError("method '" + name + "' not defined in " + getName(), name);
public void removeMethod(String name) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't remove method"); } testFrozen("class/module"); // We can safely reference methods here instead of doing getMethods() since if we // are adding we are not using a IncludedModuleWrapper. synchronized(getMethods()) { ICallable method = (ICallable) getMethods().remove(name); if (method == null) { throw getRuntime().newNameError("method '" + name + "' not defined in " + getName()); } getRuntime().getCacheMap().remove(name, method); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public void removeMethod(String name) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't remove method"); } testFrozen("class/module"); // We can safely reference methods here instead of doing getMethods() since if we // are adding we are not using a IncludedModuleWrapper. synchronized(getMethods()) { ICallable method = (ICallable) getMethods().remove(name); if (method == null) { throw getRuntime().newNameError("method '" + name + "' not defined in " + getName()); } getRuntime().getCacheMap().remove(name, method); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("wrong class variable name " + id);
throw getRuntime().newNameError("wrong class variable name " + id, id);
public IRubyObject remove_class_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isClassVariable(id)) { throw getRuntime().newNameError("wrong class variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("class variable " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
IRubyObject variable = removeInstanceVariable(id);
IRubyObject variable = removeInstanceVariable(id);
public IRubyObject remove_class_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isClassVariable(id)) { throw getRuntime().newNameError("wrong class variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("class variable " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("cannot remove " + id + " for " + getName());
throw cannotRemoveError(id);
public IRubyObject remove_class_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isClassVariable(id)) { throw getRuntime().newNameError("wrong class variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("class variable " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("class variable " + id + " not defined for " + getName());
throw getRuntime().newNameError("class variable " + id + " not defined for " + getName(), id);
public IRubyObject remove_class_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isClassVariable(id)) { throw getRuntime().newNameError("wrong class variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("class variable " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("wrong constant name " + id);
throw wrongConstantNameError(id);
public IRubyObject remove_const(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isConstant(id)) { throw getRuntime().newNameError("wrong constant name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = getInstanceVariable(id); if (variable != null) { return removeInstanceVariable(id); } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("constant " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("cannot remove " + id + " for " + getName());
throw cannotRemoveError(id);
public IRubyObject remove_const(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isConstant(id)) { throw getRuntime().newNameError("wrong constant name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = getInstanceVariable(id); if (variable != null) { return removeInstanceVariable(id); } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("constant " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("constant " + id + " not defined for " + getName());
throw getRuntime().newNameError("constant " + id + " not defined for " + getName(), id);
public IRubyObject remove_const(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isConstant(id)) { throw getRuntime().newNameError("wrong constant name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove class variable"); } testFrozen("class/module"); IRubyObject variable = getInstanceVariable(id); if (variable != null) { return removeInstanceVariable(id); } if (isClassVarDefined(id)) { throw getRuntime().newNameError("cannot remove " + id + " for " + getName()); } throw getRuntime().newNameError("constant " + id + " not defined for " + getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public ICallable searchMethod(String name) { for (RubyModule searchModule = this; searchModule != null; searchModule = searchModule.getSuperClass()) { // included modules use delegates methods for we need to synchronize on result of getMethods synchronized(searchModule.getMethods()) { // See if current class has method or if it has been cached here already ICallable method = (ICallable) searchModule.getMethods().get(name); if (method != null) { if (searchModule != this) { addCachedMethod(name, method); } return method; } } } return UndefinedMethod.getInstance(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject setClassVar(String name, IRubyObject value) { RubyModule module = getModuleWithInstanceVar(name); if (module == null) { module = this; } return module.setInstanceVariable(name, value, CVAR_TAINT_ERROR, CVAR_FREEZE_ERROR); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
IRubyObject result = setInstanceVariable(name, value, "Insecure: can't set constant",
IRubyObject result = setInstanceVariable(name, value, "Insecure: can't set constant",
public IRubyObject setConstant(String name, IRubyObject value) { IRubyObject result = setInstanceVariable(name, value, "Insecure: can't set constant", "class/module"); // if adding a module under a constant name, set that module's basename to the constant name if (value instanceof RubyModule) { RubyModule module = (RubyModule)value; if (module.getBaseName() == null) { module.setBaseName(name); module.setParent(this); } /* module.setParent(this); */ } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
public IRubyObject setConstant(String name, IRubyObject value) { IRubyObject result = setInstanceVariable(name, value, "Insecure: can't set constant", "class/module"); // if adding a module under a constant name, set that module's basename to the constant name if (value instanceof RubyModule) { RubyModule module = (RubyModule)value; if (module.getBaseName() == null) { module.setBaseName(name); module.setParent(this); } /* module.setParent(this); */ } return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw getRuntime().newNameError("Undefined method " + name + " for" + s0 + " '" + c.getName() + "'");
throw getRuntime().newNameError("Undefined method " + name + " for" + s0 + " '" + c.getName() + "'", name);
public void undef(String name) { IRuby runtime = getRuntime(); if (this == runtime.getObject()) { runtime.secure(4); } if (runtime.getSafeLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen("module"); if (name.equals("__id__") || name.equals("__send__")) { getRuntime().getWarnings().warn("undefining `"+ name +"' may cause serious problem"); } ICallable method = searchMethod(name); if (method.isUndefined()) { String s0 = " class"; RubyModule c = this; if (c.isSingleton()) { IRubyObject obj = getInstanceVariable("__attached__"); if (obj != null && obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw getRuntime().newNameError("Undefined method " + name + " for" + s0 + " '" + c.getName() + "'"); } addMethod(name, UndefinedMethod.getInstance()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
throw runtime.newNameError("uninitialized constant " + name);
throw runtime.newNameError("uninitialized constant " + name, name);
public static RubyModule unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = input.unmarshalString(); IRuby runtime = input.getRuntime(); RubyModule result = runtime.getClassFromPath(name); if (result == null) { throw runtime.newNameError("uninitialized constant " + name); } input.registerLinkTarget(result); return result; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/RubyModule.java/clean/src/org/jruby/RubyModule.java
objectClass.defineMethod("=~", CallbackFactory.getFalseMethod());
objectClass.defineMethod("=~", CallbackFactory.getFalseMethod(1));
public static void createObjectClass(RubyModule objectClass) { objectClass.defineMethod("==", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("=~", CallbackFactory.getFalseMethod()); objectClass.defineMethod("clone", CallbackFactory.getMethod(RubyObject.class, "rbClone")); objectClass.defineMethod("dup", CallbackFactory.getMethod(RubyObject.class, "dup")); objectClass.defineMethod("eql?", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("respond_to?", CallbackFactory.getMethod(RubyObject.class, "respond_to", RubyObject.class)); objectClass.defineMethod("extend", CallbackFactory.getOptMethod(RubyObject.class, "extend")); objectClass.defineMethod("freeze", CallbackFactory.getMethod(RubyObject.class, "freeze")); objectClass.defineMethod("frozen?", CallbackFactory.getMethod(RubyObject.class, "frozen")); objectClass.defineMethod("id", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("hash", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("__id__", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("inspect", CallbackFactory.getMethod(RubyObject.class, "inspect")); objectClass.defineMethod("instance_eval", CallbackFactory.getOptMethod(RubyObject.class, "instance_eval")); objectClass.defineMethod("instance_of?", CallbackFactory.getMethod(RubyObject.class, "instance_of", RubyModule.class)); objectClass.defineMethod("instance_variables", CallbackFactory.getMethod(RubyObject.class, "instance_variables")); objectClass.defineMethod("is_a?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("kind_of?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("method", CallbackFactory.getMethod(RubyObject.class, "method", RubyObject.class)); objectClass.defineMethod("methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod()); objectClass.defineMethod("private_methods", CallbackFactory.getMethod(RubyObject.class, "private_methods")); objectClass.defineMethod("protected_methods", CallbackFactory.getMethod(RubyObject.class, "protected_methods")); objectClass.defineMethod("public_methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("taint", CallbackFactory.getMethod(RubyObject.class, "taint")); objectClass.defineMethod("tainted?", CallbackFactory.getMethod(RubyObject.class, "tainted")); objectClass.defineMethod("to_a", CallbackFactory.getMethod(RubyObject.class, "to_a")); objectClass.defineMethod("to_s", CallbackFactory.getMethod(RubyObject.class, "to_s")); objectClass.defineMethod("type", CallbackFactory.getMethod(RubyObject.class, "type")); objectClass.defineMethod("untaint", CallbackFactory.getMethod(RubyObject.class, "untaint")); objectClass.defineAlias("===", "=="); objectClass.defineAlias("class", "type"); objectClass.defineAlias("equal?", "=="); Ruby ruby = objectClass.getRuby(); ruby.defineGlobalFunction("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", RubyObject.class)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
objectClass.defineMethod("respond_to?", CallbackFactory.getMethod(RubyObject.class, "respond_to", RubyObject.class));
objectClass.defineMethod("respond_to?", CallbackFactory.getOptMethod(RubyObject.class, "respond_to"));
public static void createObjectClass(RubyModule objectClass) { objectClass.defineMethod("==", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("=~", CallbackFactory.getFalseMethod()); objectClass.defineMethod("clone", CallbackFactory.getMethod(RubyObject.class, "rbClone")); objectClass.defineMethod("dup", CallbackFactory.getMethod(RubyObject.class, "dup")); objectClass.defineMethod("eql?", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("respond_to?", CallbackFactory.getMethod(RubyObject.class, "respond_to", RubyObject.class)); objectClass.defineMethod("extend", CallbackFactory.getOptMethod(RubyObject.class, "extend")); objectClass.defineMethod("freeze", CallbackFactory.getMethod(RubyObject.class, "freeze")); objectClass.defineMethod("frozen?", CallbackFactory.getMethod(RubyObject.class, "frozen")); objectClass.defineMethod("id", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("hash", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("__id__", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("inspect", CallbackFactory.getMethod(RubyObject.class, "inspect")); objectClass.defineMethod("instance_eval", CallbackFactory.getOptMethod(RubyObject.class, "instance_eval")); objectClass.defineMethod("instance_of?", CallbackFactory.getMethod(RubyObject.class, "instance_of", RubyModule.class)); objectClass.defineMethod("instance_variables", CallbackFactory.getMethod(RubyObject.class, "instance_variables")); objectClass.defineMethod("is_a?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("kind_of?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("method", CallbackFactory.getMethod(RubyObject.class, "method", RubyObject.class)); objectClass.defineMethod("methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod()); objectClass.defineMethod("private_methods", CallbackFactory.getMethod(RubyObject.class, "private_methods")); objectClass.defineMethod("protected_methods", CallbackFactory.getMethod(RubyObject.class, "protected_methods")); objectClass.defineMethod("public_methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("taint", CallbackFactory.getMethod(RubyObject.class, "taint")); objectClass.defineMethod("tainted?", CallbackFactory.getMethod(RubyObject.class, "tainted")); objectClass.defineMethod("to_a", CallbackFactory.getMethod(RubyObject.class, "to_a")); objectClass.defineMethod("to_s", CallbackFactory.getMethod(RubyObject.class, "to_s")); objectClass.defineMethod("type", CallbackFactory.getMethod(RubyObject.class, "type")); objectClass.defineMethod("untaint", CallbackFactory.getMethod(RubyObject.class, "untaint")); objectClass.defineAlias("===", "=="); objectClass.defineAlias("class", "type"); objectClass.defineAlias("equal?", "=="); Ruby ruby = objectClass.getRuby(); ruby.defineGlobalFunction("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", RubyObject.class)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod());
objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod(0));
public static void createObjectClass(RubyModule objectClass) { objectClass.defineMethod("==", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("=~", CallbackFactory.getFalseMethod()); objectClass.defineMethod("clone", CallbackFactory.getMethod(RubyObject.class, "rbClone")); objectClass.defineMethod("dup", CallbackFactory.getMethod(RubyObject.class, "dup")); objectClass.defineMethod("eql?", CallbackFactory.getMethod(RubyObject.class, "equal", RubyObject.class)); objectClass.defineMethod("respond_to?", CallbackFactory.getMethod(RubyObject.class, "respond_to", RubyObject.class)); objectClass.defineMethod("extend", CallbackFactory.getOptMethod(RubyObject.class, "extend")); objectClass.defineMethod("freeze", CallbackFactory.getMethod(RubyObject.class, "freeze")); objectClass.defineMethod("frozen?", CallbackFactory.getMethod(RubyObject.class, "frozen")); objectClass.defineMethod("id", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("hash", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("__id__", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("inspect", CallbackFactory.getMethod(RubyObject.class, "inspect")); objectClass.defineMethod("instance_eval", CallbackFactory.getOptMethod(RubyObject.class, "instance_eval")); objectClass.defineMethod("instance_of?", CallbackFactory.getMethod(RubyObject.class, "instance_of", RubyModule.class)); objectClass.defineMethod("instance_variables", CallbackFactory.getMethod(RubyObject.class, "instance_variables")); objectClass.defineMethod("is_a?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("kind_of?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("method", CallbackFactory.getMethod(RubyObject.class, "method", RubyObject.class)); objectClass.defineMethod("methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod()); objectClass.defineMethod("private_methods", CallbackFactory.getMethod(RubyObject.class, "private_methods")); objectClass.defineMethod("protected_methods", CallbackFactory.getMethod(RubyObject.class, "protected_methods")); objectClass.defineMethod("public_methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", RubyObject.class)); objectClass.defineMethod("taint", CallbackFactory.getMethod(RubyObject.class, "taint")); objectClass.defineMethod("tainted?", CallbackFactory.getMethod(RubyObject.class, "tainted")); objectClass.defineMethod("to_a", CallbackFactory.getMethod(RubyObject.class, "to_a")); objectClass.defineMethod("to_s", CallbackFactory.getMethod(RubyObject.class, "to_s")); objectClass.defineMethod("type", CallbackFactory.getMethod(RubyObject.class, "type")); objectClass.defineMethod("untaint", CallbackFactory.getMethod(RubyObject.class, "untaint")); objectClass.defineAlias("===", "=="); objectClass.defineAlias("class", "type"); objectClass.defineAlias("equal?", "=="); Ruby ruby = objectClass.getRuby(); ruby.defineGlobalFunction("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", RubyObject.class)); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
public int getArity() { return -1; }
public RubyObject evalUnder(RubyModule under, RubyObject src, RubyObject file, RubyObject line) { /* if (ruby_safe_level >= 4) { Check_Type(src, T_STRING); } else { Check_SafeStr(src); } */ return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { return args[0].eval(args[1], ruby.getNil(), ((RubyString) args[2]).getValue(), RubyNumeric.fix2int(args[3])); } }, new RubyObject[] { this, src, file, line }); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
public RubyBoolean respond_to(RubyObject methodName) { String name; if (methodName instanceof RubySymbol) { name = ((RubySymbol) methodName).toId(); } else if (methodName instanceof RubyString) { name = ((RubyString) methodName).getValue(); } else { throw new ArgumentError(getRuby(), "not a symbol"); }
public RubyBoolean respond_to(RubyObject[] args) { argCount(args, 1, 2); String name = args[0].toId();
public RubyBoolean respond_to(RubyObject methodName) { String name; if (methodName instanceof RubySymbol) { name = ((RubySymbol) methodName).toId(); } else if (methodName instanceof RubyString) { name = ((RubyString) methodName).getValue(); } else { throw new ArgumentError(getRuby(), "not a symbol"); } //Look in cache CacheEntry ent = getRuby().getMethodCache().getEntry(getRubyClass(), name); if (ent != null) { //Check to see if it's private and we're not including privates(return false) //otherwise return true return ruby.getTrue(); } //Get from instance IMethod method = getRubyClass().searchMethod(name); if (method != null) { return ruby.getTrue(); } return ruby.getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
return respond_to(RubySymbol.newSymbol(getRuby(), methodName)).isTrue();
return respond_to(new RubyObject[]{RubySymbol.newSymbol(getRuby(), methodName)}).isTrue();
public boolean respondsTo(String methodName) { return respond_to(RubySymbol.newSymbol(getRuby(), methodName)).isTrue(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
public int getArity() { return -1; }
public RubyObject yieldUnder(RubyModule under) { return under.executeUnder(new Callback() { public RubyObject execute(RubyObject self, RubyObject[] args, Ruby ruby) { // if () { Block oldBlock = ruby.getBlock().getAct().cloneBlock(); /* copy the block to avoid modifying global data. */ ruby.getBlock().getAct().getFrame().setNamespace(ruby.getActFrame().getNamespace()); RubyObject result = null; try { result = ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } finally { ruby.getBlock().setAct(oldBlock); } return result; // } /* static block, no need to restore */ // ruby.getBlock().frame.setNamespace(ruby.getRubyFrame().getNamespace()); // return ruby.yield0(args[0], args[0], ruby.getRubyClass(), false); } }, new RubyObject[] { this }); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyObject.java/clean/org/jruby/RubyObject.java
result = ((RubyModule) result).getConstant(iVisited.getName());
result = ((RubyModule) result).getConstantAtOrConstantMissing(iVisited.getName());
public void visitColon2Node(Colon2Node iVisited) { Node node = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (node == null) { result = runtime.getClasses().getObjectClass().getConstant(iVisited.getName()); } else { eval(iVisited.getLeftNode()); if (result instanceof RubyModule) { result = ((RubyModule) result).getConstant(iVisited.getName()); } else { result = result.callMethod(iVisited.getName()); } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/750e66982e97bcb72545a39ceacf6ee32a52a135/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
result = runtime.getClasses().getObjectClass().getConstant(iVisited.getName());
result = runtime.getClasses().getClass(iVisited.getName()); if (result == null) { result = runtime.getClasses().getObjectClass().getConstant(iVisited.getName()); }
public void visitColon3Node(Colon3Node iVisited) { result = runtime.getClasses().getObjectClass().getConstant(iVisited.getName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/750e66982e97bcb72545a39ceacf6ee32a52a135/EvaluateVisitor.java/clean/src/org/jruby/evaluator/EvaluateVisitor.java
final public Broker getBroker() { // this method can be unsynch. because the broker manages its own // state, plus the only time the _broker will be shutdown or null // is after the last servlet has shutdown--so why would anyone be // accessing us then? if they do the _broker will throw exceptions // complaining that it has been shut down, or they'll get a null here. return _broker; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
final public String getConfig(String key)
final public String getConfig(String key)
final public String getConfig(String key) throws NotFoundException { try { return (String) _broker.get("config", key); } catch (NotFoundException e) { throw e; } catch (ResourceException e) { throw new NotFoundException(e.toString(), e); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
catch (ResourceException e) { throw new NotFoundException(e.toString(), e);
catch (ResourceException e) { throw new NotFoundException(e.toString(), e);
final public String getConfig(String key) throws NotFoundException { try { return (String) _broker.get("config", key); } catch (NotFoundException e) { throw e; } catch (ResourceException e) { throw new NotFoundException(e.toString(), e); } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
final public Template getTemplate(String key)
final public Template getTemplate(String key)
final public Template getTemplate(String key) throws ResourceException { return (Template) _tmplProvider.get(key); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
return (Template) _tmplProvider.get(key);
return (Template) _tmplProvider.get(key);
final public Template getTemplate(String key) throws ResourceException { return (Template) _tmplProvider.get(key); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
final public String getURL(String url)
final public String getURL(String url)
final public String getURL(String url) throws ResourceException { return (String) _urlProvider.get(url); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
final public WebContext getWebContext(HttpServletRequest req, HttpServletResponse resp)
final public WebContext getWebContext(HttpServletRequest req, HttpServletResponse resp)
final public WebContext getWebContext(HttpServletRequest req, HttpServletResponse resp) { Pool cpool = (Pool) _webContextCache.get(); WebContext c = (WebContext) cpool.get(); if (c == null) { c = _webContext.newInstance(req,resp); c.setPool(cpool); } else c.reinitialize(req, resp); return c; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
return c;
return c;
final public WebContext getWebContext(HttpServletRequest req, HttpServletResponse resp) { Pool cpool = (Pool) _webContextCache.get(); WebContext c = (WebContext) cpool.get(); if (c == null) { c = _webContext.newInstance(req,resp); c.setPool(cpool); } else c.reinitialize(req, resp); return c; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
writeTemplate (templateName, out, getConfig (WMConstants.TEMPLATE_OUTPUT_ENCODING), context);
writeTemplate (templateName, out, getConfig (WMConstants.TEMPLATE_OUTPUT_ENCODING), context);
final public void writeTemplate (String templateName, java.io.OutputStream out, Context context) throws java.io.IOException, ResourceException, PropertyException { writeTemplate (templateName, out, getConfig (WMConstants.TEMPLATE_OUTPUT_ENCODING), context); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/8b2dc7118fa92a5ccbf90431cc20bbc7de453b1c/WM.java/buggy/webmacro/src/org/webmacro/WM.java
public ServiceName load(String location) throws Exception { String resolvedLocation = baseDir.toURI().resolve(location).getPath(); String configLocation = "/" + resolvedLocation + ".xml"; SpringApplicationContext applicationContext = new FileSystemXmlApplicationContext( new String[] {configLocation}, false, xmlPreprocessors); applicationContext.setDisplayName(location); ClassLoader classLoader = applicationContext.getClassLoader(); if (classLoader == null) { classLoader = Thread.currentThread().getContextClassLoader(); } if (classLoader == null) { classLoader = SpringLoader.class.getClassLoader(); } ServiceName serviceName = new StringServiceName("configuration:" + location); ServiceFactory springConfigurationServiceFactory = new SpringConfigurationServiceFactory(applicationContext); kernel.registerService(serviceName, springConfigurationServiceFactory, classLoader); return serviceName; }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/8c4b10c7539271fd58e482930eb1c78190efe56b/SpringLoader.java/clean/server/src/main/java/org/apache/xbean/server/spring/loader/SpringLoader.java
return Collections.EMPTY_LIST;
return EMPTY_LIST;
public List childNodes() { return Collections.EMPTY_LIST; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/DVarNode.java/buggy/src/org/jruby/ast/DVarNode.java