rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
return ((RubyModule) obj).op_le(this); }
return ((RubyModule) obj).op_le(this); }
public RubyBoolean op_ge(RubyObject obj) { if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); } return ((RubyModule) obj).op_le(this); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (this == obj) { return getRuby().getFalse(); } return op_ge(obj); }
if (this == obj) { return getRuby().getFalse(); } return op_ge(obj); }
public RubyBoolean op_gt(RubyObject obj) { if (this == obj) { return getRuby().getFalse(); } return op_ge(obj); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); }
if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); }
public RubyBoolean op_le(RubyObject obj) { if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); } RubyModule mod = this; while (mod != null) { if (mod.methods == ((RubyModule) obj).methods) { return getRuby().getTrue(); } mod = mod.getSuperClass(); } return getRuby().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
RubyModule mod = this; while (mod != null) { if (mod.methods == ((RubyModule) obj).methods) { return getRuby().getTrue(); } mod = mod.getSuperClass(); }
RubyModule mod = this; while (mod != null) { if (mod.methods == ((RubyModule) obj).methods) { return getRuby().getTrue(); } mod = mod.getSuperClass(); }
public RubyBoolean op_le(RubyObject obj) { if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); } RubyModule mod = this; while (mod != null) { if (mod.methods == ((RubyModule) obj).methods) { return getRuby().getTrue(); } mod = mod.getSuperClass(); } return getRuby().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
return getRuby().getFalse(); }
return getRuby().getFalse(); }
public RubyBoolean op_le(RubyObject obj) { if (!(obj instanceof RubyModule)) { throw new RubyTypeException(getRuby(), "compared with non class/module"); } RubyModule mod = this; while (mod != null) { if (mod.methods == ((RubyModule) obj).methods) { return getRuby().getTrue(); } mod = mod.getSuperClass(); } return getRuby().getFalse(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (obj == this) { return getRuby().getFalse(); } return op_le(obj); }
if (obj == this) { return getRuby().getFalse(); } return op_le(obj); }
public RubyBoolean op_lt(RubyObject obj) { if (obj == this) { return getRuby().getFalse(); } return op_le(obj); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
RubyId id = getRuby().toId(name);
RubyId id = getRuby().toId(name);
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); }
if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); }
if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); }
if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
RubyObject value = (RubyObject) getInstanceVariables().remove(id);
RubyObject value = (RubyObject) getInstanceVariables().remove(id);
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (value != null) { return value; }
if (value != null) { return value; }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); }
if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
public RubyObject removeCvar(RubyObject name) { // Wrong Parameter ? RubyId id = getRuby().toId(name); if (!id.isClassId()) { throw new RubyNameException(getRuby(), "wrong class variable name " + name); } if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't remove class variable"); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } RubyObject value = (RubyObject) getInstanceVariables().remove(id); if (value != null) { return value; } if (isClassVarDefined(id)) { throw new RubyNameException( getRuby(), "cannot remove " + id.toName() + " for " + toName()); } throw new RubyNameException( getRuby(), "class variable " + id.toName() + " not defined for " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't remove method"); } if (isFrozen()) { } if (methods.remove(methodId) == null) { throw new RubyNameException( getRuby(), "method '" + methodId.toName() + "' not defined in " + toName()); } }
if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't remove method"); } if (isFrozen()) { } if (methods.remove(methodId) == null) { throw new RubyNameException( getRuby(), "method '" + methodId.toName() + "' not defined in " + toName()); } }
public void removeMethod(RubyId methodId) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException(getRuby(), "Insecure: can't remove method"); } if (isFrozen()) { // rb_error_frozen("class/module"); } if (methods.remove(methodId) == null) { throw new RubyNameException( getRuby(), "method '" + methodId.toName() + "' not defined in " + toName()); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
removeMethod(name.toId());
removeMethod(name.toId());
public RubyModule remove_method(RubyObject name) { removeMethod(name.toId()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
return this; }
return this; }
public RubyModule remove_method(RubyObject name) { removeMethod(name.toId()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
MethodNode body = (MethodNode) methods.get(id); if (body == null) { if (getSuperClass() != null) { return getSuperClass().searchMethod(id); } else { return null; } } else { body.setMethodOrigin(this); return body; } }
MethodNode body = (MethodNode) methods.get(id); if (body == null) { if (getSuperClass() != null) { return getSuperClass().searchMethod(id); } else { return null; } } else { body.setMethodOrigin(this); return body; } }
public MethodNode searchMethod(RubyId id) { MethodNode body = (MethodNode) methods.get(id); if (body == null) { if (getSuperClass() != null) { return getSuperClass().searchMethod(id); } else { return null; } } else { body.setMethodOrigin(this); return body; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
String dest = constant ? "constant" : "class variable";
String dest = constant ? "constant" : "class variable";
protected void setAv(RubyId id, RubyObject value, boolean constant) { String dest = constant ? "constant" : "class variable"; if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { //getRuby().warn("already initialized " + dest + " " + name); } if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); } getInstanceVariables().put(id, value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { }
if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { }
protected void setAv(RubyId id, RubyObject value, boolean constant) { String dest = constant ? "constant" : "class variable"; if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { //getRuby().warn("already initialized " + dest + " " + name); } if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); } getInstanceVariables().put(id, value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); }
if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); }
protected void setAv(RubyId id, RubyObject value, boolean constant) { String dest = constant ? "constant" : "class variable"; if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { //getRuby().warn("already initialized " + dest + " " + name); } if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); } getInstanceVariables().put(id, value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
getInstanceVariables().put(id, value); }
getInstanceVariables().put(id, value); }
protected void setAv(RubyId id, RubyObject value, boolean constant) { String dest = constant ? "constant" : "class variable"; if (!isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException(getRuby(), "Insecure: can't set " + dest); } if (isFrozen()) { throw new RubyFrozenException(getRuby(), "class/module"); } if (constant && (getInstanceVariables().get(id) != null)) { //getRuby().warn("already initialized " + dest + " " + name); } if (getInstanceVariables() == null) { setInstanceVariables(new RubyHashMap()); } getInstanceVariables().put(id, value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
RubyString value = null;
RubyString value = null;
public void setClassPath(RubyModule under, String name) { RubyString value = null; if (under == getRuby().getClasses().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString) under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); } getInstanceVariables().put(getRuby().intern("__classpath__"), value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (under == getRuby().getClasses().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString) under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); }
if (under == getRuby().getClasses().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString) under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); }
public void setClassPath(RubyModule under, String name) { RubyString value = null; if (under == getRuby().getClasses().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString) under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); } getInstanceVariables().put(getRuby().intern("__classpath__"), value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
getInstanceVariables().put(getRuby().intern("__classpath__"), value); }
getInstanceVariables().put(getRuby().intern("__classpath__"), value); }
public void setClassPath(RubyModule under, String name) { RubyString value = null; if (under == getRuby().getClasses().getObjectClass()) { value = RubyString.m_newString(getRuby(), name); } else { value = (RubyString) under.getClassPath().m_dup(); value.m_cat("::"); value.m_cat(name); } getInstanceVariables().put(getRuby().intern("__classpath__"), value); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
RubyModule tmp = this; while (tmp != null) { if (tmp.getInstanceVariables() != null && tmp.getInstanceVariables().get(id) != null) { if (tmp.isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't modify class variable"); } tmp.getInstanceVariables().put(id, value); } tmp = tmp.getSuperClass(); } throw new RubyNameException( getRuby(), "uninitialized class variable " + id.toName() + " in " + toName()); }
RubyModule tmp = this; while (tmp != null) { if (tmp.getInstanceVariables() != null && tmp.getInstanceVariables().get(id) != null) { if (tmp.isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't modify class variable"); } tmp.getInstanceVariables().put(id, value); } tmp = tmp.getSuperClass(); } throw new RubyNameException( getRuby(), "uninitialized class variable " + id.toName() + " in " + toName()); }
public void setClassVar(RubyId id, RubyObject value) { RubyModule tmp = this; while (tmp != null) { if (tmp.getInstanceVariables() != null && tmp.getInstanceVariables().get(id) != null) { if (tmp.isTaint() && getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException( getRuby(), "Insecure: can't modify class variable"); } tmp.getInstanceVariables().put(id, value); } tmp = tmp.getSuperClass(); } throw new RubyNameException( getRuby(), "uninitialized class variable " + id.toName() + " in " + toName()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
setAv(id, value, true); }
setAv(id, value, true); }
public void setConstant(RubyId id, RubyObject value) { setAv(id, value, true); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
this.included = included; }
this.included = included; }
public void setIncluded(boolean included) { this.included = included; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException( getRuby(), "Insecure: can't change method visibility"); }
if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException( getRuby(), "Insecure: can't change method visibility"); }
public void setMethodVisibility(RubyObject[] methods, int noex) { if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException( getRuby(), "Insecure: can't change method visibility"); } for (int i = 0; i < methods.length; i++) { exportMethod(methods[i].toId(), noex); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
for (int i = 0; i < methods.length; i++) { exportMethod(methods[i].toId(), noex); } }
for (int i = 0; i < methods.length; i++) { exportMethod(methods[i].toId(), noex); } }
public void setMethodVisibility(RubyObject[] methods, int noex) { if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException( getRuby(), "Insecure: can't change method visibility"); } for (int i = 0; i < methods.length; i++) { exportMethod(methods[i].toId(), noex); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
this.methods = methods; }
this.methods = methods; }
public void setMethods(RubyMap methods) { this.methods = methods; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
getInstanceVariables().put(getRuby().intern("__classid__"), id); }
getInstanceVariables().put(getRuby().intern("__classid__"), id); }
public void setName(RubyId id) { getInstanceVariables().put(getRuby().intern("__classid__"), id); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
this.singleton = singleton; }
this.singleton = singleton; }
public void setSingleton(boolean singleton) { this.singleton = singleton; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
this.superClass = superClass; }
this.superClass = superClass; }
public void setSuperClass(RubyModule superClass) { this.superClass = superClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
String desc = "something(?!)"; if (isFrozen()) { if (isSingleton()) { desc = "object"; } else { if (isIncluded() || isModule()) { desc = "module"; } else if (isClass()) { desc = "class"; } } throw new RubyFrozenException(getRuby(), desc); } }
String desc = "something(?!)"; if (isFrozen()) { if (isSingleton()) { desc = "object"; } else { if (isIncluded() || isModule()) { desc = "module"; } else if (isClass()) { desc = "class"; } } throw new RubyFrozenException(getRuby(), desc); } }
protected void testFrozen() { String desc = "something(?!)"; if (isFrozen()) { if (isSingleton()) { desc = "object"; } else { if (isIncluded() || isModule()) { desc = "module"; } else if (isClass()) { desc = "class"; } } throw new RubyFrozenException(getRuby(), desc); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (this == getRuby().getClasses().getNilClass()) { return "nil"; } if (this == getRuby().getClasses().getTrueClass()) { return "true"; } if (this == getRuby().getClasses().getFalseClass()) { return "false"; }
if (this == getRuby().getClasses().getNilClass()) { return "nil"; } if (this == getRuby().getClasses().getTrueClass()) { return "true"; } if (this == getRuby().getClasses().getFalseClass()) { return "false"; }
public String toName() { if (this == getRuby().getClasses().getNilClass()) { return "nil"; } if (this == getRuby().getClasses().getTrueClass()) { return "true"; } if (this == getRuby().getClasses().getFalseClass()) { return "false"; } return ((RubyString) getClassPath()).getValue(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
return ((RubyString) getClassPath()).getValue(); }
return ((RubyString) getClassPath()).getValue(); }
public String toName() { if (this == getRuby().getClasses().getNilClass()) { return "nil"; } if (this == getRuby().getClasses().getTrueClass()) { return "true"; } if (this == getRuby().getClasses().getFalseClass()) { return "false"; } return ((RubyString) getClassPath()).getValue(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen(); if (id == getRuby().intern("__id__") || id == getRuby().intern("__send__")) { /*rb_warn("undefining `%s' may cause serious problem", rb_id2name( id ) );*/ } MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { String s0 = " class"; RubyModule c = this;
if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen(); if (id == getRuby().intern("__id__") || id == getRuby().intern("__send__")) { /*rb_warn("undefining `%s' may cause serious problem", rb_id2name( id ) );*/ } MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { String s0 = " class"; RubyModule c = this;
public void undef(RubyId id) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen(); if (id == getRuby().intern("__id__") || id == getRuby().intern("__send__")) { /*rb_warn("undefining `%s' may cause serious problem", rb_id2name( id ) );*/ } MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { String s0 = " class"; RubyModule c = this; if (c.isSingleton()) { RubyObject obj = getInstanceVar("__attached__"); if (obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw new RubyNameException( getRuby(), "undefined method " + id.toName() + " for" + s0 + " '" + c.toName() + "'"); } addMethod(id, null, Constants.NOEX_PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (c.isSingleton()) { RubyObject obj = getInstanceVar("__attached__");
if (c.isSingleton()) { RubyObject obj = getInstanceVar("__attached__");
public void undef(RubyId id) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen(); if (id == getRuby().intern("__id__") || id == getRuby().intern("__send__")) { /*rb_warn("undefining `%s' may cause serious problem", rb_id2name( id ) );*/ } MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { String s0 = " class"; RubyModule c = this; if (c.isSingleton()) { RubyObject obj = getInstanceVar("__attached__"); if (obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw new RubyNameException( getRuby(), "undefined method " + id.toName() + " for" + s0 + " '" + c.toName() + "'"); } addMethod(id, null, Constants.NOEX_PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
if (obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw new RubyNameException( getRuby(), "undefined method " + id.toName() + " for" + s0 + " '" + c.toName() + "'"); } addMethod(id, null, Constants.NOEX_PUBLIC); }
if (obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw new RubyNameException( getRuby(), "undefined method " + id.toName() + " for" + s0 + " '" + c.toName() + "'"); } addMethod(id, null, Constants.NOEX_PUBLIC); }
public void undef(RubyId id) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new SecurityException("Insecure: can't undef"); } testFrozen(); if (id == getRuby().intern("__id__") || id == getRuby().intern("__send__")) { /*rb_warn("undefining `%s' may cause serious problem", rb_id2name( id ) );*/ } MethodNode methodNode = searchMethod(id); if (methodNode == null || methodNode.getBodyNode() == null) { String s0 = " class"; RubyModule c = this; if (c.isSingleton()) { RubyObject obj = getInstanceVar("__attached__"); if (obj instanceof RubyModule) { c = (RubyModule) obj; s0 = ""; } } else if (c.isModule()) { s0 = " module"; } throw new RubyNameException( getRuby(), "undefined method " + id.toName() + " for" + s0 + " '" + c.toName() + "'"); } addMethod(id, null, Constants.NOEX_PUBLIC); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
addMethod(getRuby().intern(name), null, Constants.NOEX_UNDEF); }
addMethod(getRuby().intern(name), null, Constants.NOEX_UNDEF); }
public void undefMethod(String name) { addMethod(getRuby().intern(name), null, Constants.NOEX_UNDEF); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
undef(name.toId());
undef(name.toId());
public RubyModule undef_method(RubyObject name) { undef(name.toId()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
return this; }
return this; }
public RubyModule undef_method(RubyObject name) { undef(name.toId()); return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0a7181933af700ea8025a4197f3a5ebcc08333c3/RubyModule.java/buggy/org/jruby/RubyModule.java
setOptional(subordinateArgs);
setOptional(argCount);
public OptionalGroup(int argCount) { super(0, ArgType_GROUP); setOptional(subordinateArgs); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/d64f3905b97cbd4f3906e9abee2df9cd05a8ff42/Directive.java/clean/webmacro/src/org/webmacro/directive/Directive.java
ImageData i = (ImageData) it.next(); d.linkImage((Image) mapper.map(i));
ImageData id = (ImageData) it.next(); Image i = (Image) mapper.map( id ); if ( ! linked( i.findDatasetImageLink( d ))) d.linkImage( i );
public IObject fillIObject( IObject obj, ReverseModelMapper mapper) { if ( obj instanceof Dataset) { Dataset d = (Dataset) obj; if (super.fill(d)) { d.setName(this.getName()); d.setDescription(this.getDescription()); if (this.getImages() != null) { for (Iterator it = this.getImages().iterator(); it.hasNext();) { ImageData i = (ImageData) it.next(); d.linkImage((Image) mapper.map(i)); } } if (this.getProjects() != null) { for (Iterator it = this.getProjects().iterator(); it.hasNext();) { ProjectData p = (ProjectData) it.next(); d.linkProject((Project) mapper.map(p)); } } if (this.getAnnotations() != null) { for (Iterator it = this.getAnnotations().iterator(); it.hasNext();) { AnnotationData ann = (AnnotationData) it.next(); d.addToAnnotations( (DatasetAnnotation) mapper.map(ann)); } } } return d; } else { throw new IllegalArgumentException( "DatasetData can only fill Dataset."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/DatasetData.java/buggy/components/shoola-adapter/src/pojos/DatasetData.java
ProjectData p = (ProjectData) it.next(); d.linkProject((Project) mapper.map(p));
ProjectData pd = (ProjectData) it.next(); Project p = (Project) mapper.map( pd ); if ( ! linked( p.findProjectDatasetLink( d ))) d.linkProject( p );
public IObject fillIObject( IObject obj, ReverseModelMapper mapper) { if ( obj instanceof Dataset) { Dataset d = (Dataset) obj; if (super.fill(d)) { d.setName(this.getName()); d.setDescription(this.getDescription()); if (this.getImages() != null) { for (Iterator it = this.getImages().iterator(); it.hasNext();) { ImageData i = (ImageData) it.next(); d.linkImage((Image) mapper.map(i)); } } if (this.getProjects() != null) { for (Iterator it = this.getProjects().iterator(); it.hasNext();) { ProjectData p = (ProjectData) it.next(); d.linkProject((Project) mapper.map(p)); } } if (this.getAnnotations() != null) { for (Iterator it = this.getAnnotations().iterator(); it.hasNext();) { AnnotationData ann = (AnnotationData) it.next(); d.addToAnnotations( (DatasetAnnotation) mapper.map(ann)); } } } return d; } else { throw new IllegalArgumentException( "DatasetData can only fill Dataset."); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b7d44d4a82558acd2336a661072dda1f38cfc0b3/DatasetData.java/buggy/components/shoola-adapter/src/pojos/DatasetData.java
Thread.sleep(5000);
Thread.sleep(2000);
public void loadPlugins() { // Add presence and message listeners // we listen for these to force open a 1-1 peer chat window from other operators if // one isn't already open PacketFilter workspaceMessageFilter = new PacketTypeFilter(Message.class); // Add the packetListener to this instance SparkManager.getSessionManager().getConnection().addPacketListener(this, workspaceMessageFilter); // Make presence available to anonymous requests, if from anonymous user in the system. PacketListener workspacePresenceListener = new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getProperty("anonymous") != null) { boolean isAvailable = statusBox.getPresence().getMode() == Presence.Mode.available; Presence reply = new Presence(Presence.Type.available); if (!isAvailable) { reply.setType(Presence.Type.unavailable); } reply.setTo(presence.getFrom()); SparkManager.getSessionManager().getConnection().sendPacket(reply); } } }; SparkManager.getSessionManager().getConnection().addPacketListener(workspacePresenceListener, new PacketTypeFilter(Presence.class)); // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); // Load Plugins SwingWorker worker = new SwingWorker() { public Object construct() { try { Thread.sleep(5000); } catch (InterruptedException e) { Log.error("Unable to sleep thread.", e); } return "ok"; } public void finished() { final PluginManager pluginManager = PluginManager.getInstance(); pluginManager.loadPlugins(); pluginManager.initializePlugins(); } }; worker.start(); int numberOfMillisecondsInTheFuture = 10000; // 5 sec Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator offlineMessage = offlineMessages.iterator(); while (offlineMessage.hasNext()) { Message offline = (Message)offlineMessage.next(); handleOfflineMessage(offline); } } }); } }, timeToRun); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/293ca0665a0d37883c1db435594539c7b5a0e56e/Workspace.java/clean/src/java/org/jivesoftware/spark/Workspace.java
Thread.sleep(5000);
Thread.sleep(2000);
public Object construct() { try { Thread.sleep(5000); } catch (InterruptedException e) { Log.error("Unable to sleep thread.", e); } return "ok"; }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/293ca0665a0d37883c1db435594539c7b5a0e56e/Workspace.java/clean/src/java/org/jivesoftware/spark/Workspace.java
protected Integer getCount( String countName )
protected Long getCount( String countName )
protected Integer getCount( String countName ) { Object count = null; if (! nullDetails() && countName != null && getDetails().getCounts() != null) count = getDetails().getCounts().get( countName ); if ( count instanceof Integer ) return (Integer) count; return null; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5cf7600e57b91582faffc324a3d36ec6215ff803/DataObject.java/buggy/components/client/src/pojos/DataObject.java
if ( count instanceof Integer ) return (Integer) count;
if ( count instanceof Long ) return (Long) count;
protected Integer getCount( String countName ) { Object count = null; if (! nullDetails() && countName != null && getDetails().getCounts() != null) count = getDetails().getCounts().get( countName ); if ( count instanceof Integer ) return (Integer) count; return null; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5cf7600e57b91582faffc324a3d36ec6215ff803/DataObject.java/buggy/components/client/src/pojos/DataObject.java
{ System.err.println(camera.getViewScale()); System.err.println("offset="+camera.getViewBounds().getX()+ ","+camera.getViewBounds().getY());
{
public BrowserCamera(BrowserTopModel model, PCamera c) { if(model == null || c == null) { throw new NullPointerException("Null parameters passed to " + "BrowserCamera(model,camera)"); } this.model = model; this.camera = c; camera.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { // oh, this is a ticky-tack hack right here if(e.getPropertyName().equals("viewTransform")) { System.err.println(camera.getViewScale()); System.err.println("offset="+camera.getViewBounds().getX()+ ","+camera.getViewBounds().getY()); double x = camera.getViewBounds().getX(); double y = camera.getViewBounds().getY(); double extentX = camera.getViewBounds().getWidth(); double extentY = camera.getViewBounds().getHeight(); double width = activeRegion.getWidth(); double height = activeRegion.getHeight(); for(Iterator iter = boundsListeners.iterator(); iter.hasNext();) { CameraListener listener = (CameraListener)iter.next(); listener.cameraBoundsChanged(x,y,extentX,extentY, width,height); } } } }); model.addModelListener(this); init(); cameraResized(cameraBounds); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserCamera.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserCamera.java
{ System.err.println(camera.getViewScale()); System.err.println("offset="+camera.getViewBounds().getX()+ ","+camera.getViewBounds().getY());
{
public void propertyChange(PropertyChangeEvent e) { // oh, this is a ticky-tack hack right here if(e.getPropertyName().equals("viewTransform")) { System.err.println(camera.getViewScale()); System.err.println("offset="+camera.getViewBounds().getX()+ ","+camera.getViewBounds().getY()); double x = camera.getViewBounds().getX(); double y = camera.getViewBounds().getY(); double extentX = camera.getViewBounds().getWidth(); double extentY = camera.getViewBounds().getHeight(); double width = activeRegion.getWidth(); double height = activeRegion.getHeight(); for(Iterator iter = boundsListeners.iterator(); iter.hasNext();) { CameraListener listener = (CameraListener)iter.next(); listener.cameraBoundsChanged(x,y,extentX,extentY, width,height); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserCamera.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserCamera.java
System.err.println("setX: "+value);
public void setX(double value) { camera.translateView(getX()-value,0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserCamera.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserCamera.java
camera.translateView(getY()-value,0);
System.err.println("setY: "+value); camera.translateView(0,getY()-value);
public void setY(double value) { camera.translateView(getY()-value,0); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/186ead79c1ec71a6147b8b6e6e37ef46e68e9924/BrowserCamera.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/ui/BrowserCamera.java
d.invokeControllerMethod(MainController.CONTEXT_CHANGED, e);
public void removeNotes(Event e) { while (dd.getTree().getSelectedNotes().size() > 0) { DisplayedNote removeMe = dd.getTree().getSelectedNotes().get(0); removeMe.deleteSelfAndChildren(); } }
57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/070b419b009cdaec26992a4f38fa244f53d78efc/NoteMenuController.java/clean/trunk/src/de/berlios/koalanotes/display/menus/NoteMenuController.java
ListIterator i = list.listIterator(); while (i.hasNext()) { AgentEventListener listener = (AgentEventListener) i.next(); if (e.getSource() != listener) listener.eventFired(e); }
if (list != null) { ListIterator i = list.listIterator(); while (i.hasNext()) { AgentEventListener listener = (AgentEventListener) i.next(); if (e.getSource() != listener) listener.eventFired(e); } }
private void dispatch() { // grab the first event posted AgentEvent e = (AgentEvent) eventQueue.removeLast(); Class eventClass = e.getClass(); LinkedList list = (LinkedList) deMultiplexTable.get(eventClass); ListIterator i = list.listIterator(); while (i.hasNext()) { AgentEventListener listener = (AgentEventListener) i.next(); if (e.getSource() != listener) listener.eventFired(e); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/86eb1d37bb16046abcd5d0e2e8845afd4f5f93e2/EventBusImpl.java/buggy/SRC/org/openmicroscopy/shoola/env/event/EventBusImpl.java
int state = model.getState(); if (state == Browser.READY) { setEnabled(true); } else setEnabled(false);
setEnabled(model.getState() == Browser.READY );
protected void onStateChange() { int state = model.getState(); if (state == Browser.READY) { //if (model.getBrowserType() == Browser.IMAGES_EXPLORER) setEnabled(true); //else onDisplayChange(model.getLastSelectedDisplay()); } else setEnabled(false); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/146920a8791fff71320ced0f240b9d8f3d319a13/SortAction.java/buggy/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/SortAction.java
throw new RuntimeException();
throw new RangeError(getRuby(), this.toString() + " out of char range");
public RubyString chr() { if (getLongValue() < 0 || getLongValue() > 0xff) { // throw new RubyRangeException(); // HACK +++ throw new RuntimeException(); // HACK --- } return RubyString.newString(getRuby(), new String(new char[] {(char) getLongValue()})); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5505ec7f148e23ccef642f45d2ff27f7d7483c6/RubyInteger.java/buggy/org/jruby/RubyInteger.java
public RubyString chr() { if (getLongValue() < 0 || getLongValue() > 0xff) { // throw new RubyRangeException(); // HACK +++ throw new RuntimeException(); // HACK --- } return RubyString.newString(getRuby(), new String(new char[] {(char) getLongValue()})); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c5505ec7f148e23ccef642f45d2ff27f7d7483c6/RubyInteger.java/buggy/org/jruby/RubyInteger.java
_log.info("Loaded provider " + p);
public void addProvider(Provider p) throws InitException { p.init(this,_config); _providers.put(p.getType(),p); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/Broker.java/buggy/webmacro/src/org/webmacro/Broker.java
(strace.equalsIgnoreCase("true") || strace.equalsIgnoreCase("yes"));
("true".equalsIgnoreCase(strace) || "yes".equalsIgnoreCase(strace));
public LogManager(Properties config) { String fileName = config.getProperty("LogFile", null); if ( ("System.error").equalsIgnoreCase(fileName) || ("stderr").equalsIgnoreCase(fileName) || ("none").equalsIgnoreCase(fileName)) { fileName = null; } String format = config.getProperty("LogFormat", "{0,time,medium} {1}:{2} {3}"); String strace = config.getProperty("LogExceptions", null); if (strace == null) { strace = config.getProperty("LogTraceExceptions", "false"); } boolean trace = (strace.equalsIgnoreCase("true") || strace.equalsIgnoreCase("yes")); Enumeration e = config.propertyNames(); Properties levels = new Properties(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith("LogLevel.")) { String type = key.substring(9); String level = config.getProperty(key); levels.setProperty(type, level); } } LogFile lf; try { lf = new LogFile(fileName, format, levels, trace); } catch (IOException ioe) { lf = new LogFile(System.err, format, levels, trace); lf.log("LOG", "ERROR", "Unable to write to logfile: " + format, ioe); } addTarget(lf); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/LogManager.java/buggy/webmacro/src/org/webmacro/util/LogManager.java
lf = new LogFile(fileName, format, levels, trace);
lf = new LogFile(fileName, format, logLevel, levels, trace);
public LogManager(Properties config) { String fileName = config.getProperty("LogFile", null); if ( ("System.error").equalsIgnoreCase(fileName) || ("stderr").equalsIgnoreCase(fileName) || ("none").equalsIgnoreCase(fileName)) { fileName = null; } String format = config.getProperty("LogFormat", "{0,time,medium} {1}:{2} {3}"); String strace = config.getProperty("LogExceptions", null); if (strace == null) { strace = config.getProperty("LogTraceExceptions", "false"); } boolean trace = (strace.equalsIgnoreCase("true") || strace.equalsIgnoreCase("yes")); Enumeration e = config.propertyNames(); Properties levels = new Properties(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith("LogLevel.")) { String type = key.substring(9); String level = config.getProperty(key); levels.setProperty(type, level); } } LogFile lf; try { lf = new LogFile(fileName, format, levels, trace); } catch (IOException ioe) { lf = new LogFile(System.err, format, levels, trace); lf.log("LOG", "ERROR", "Unable to write to logfile: " + format, ioe); } addTarget(lf); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/LogManager.java/buggy/webmacro/src/org/webmacro/util/LogManager.java
lf = new LogFile(System.err, format, levels, trace);
lf = new LogFile("System.err", System.err, format, logLevel, levels, trace);
public LogManager(Properties config) { String fileName = config.getProperty("LogFile", null); if ( ("System.error").equalsIgnoreCase(fileName) || ("stderr").equalsIgnoreCase(fileName) || ("none").equalsIgnoreCase(fileName)) { fileName = null; } String format = config.getProperty("LogFormat", "{0,time,medium} {1}:{2} {3}"); String strace = config.getProperty("LogExceptions", null); if (strace == null) { strace = config.getProperty("LogTraceExceptions", "false"); } boolean trace = (strace.equalsIgnoreCase("true") || strace.equalsIgnoreCase("yes")); Enumeration e = config.propertyNames(); Properties levels = new Properties(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith("LogLevel.")) { String type = key.substring(9); String level = config.getProperty(key); levels.setProperty(type, level); } } LogFile lf; try { lf = new LogFile(fileName, format, levels, trace); } catch (IOException ioe) { lf = new LogFile(System.err, format, levels, trace); lf.log("LOG", "ERROR", "Unable to write to logfile: " + format, ioe); } addTarget(lf); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/LogManager.java/buggy/webmacro/src/org/webmacro/util/LogManager.java
public LogManager(Properties config) { String fileName = config.getProperty("LogFile", null); if ( ("System.error").equalsIgnoreCase(fileName) || ("stderr").equalsIgnoreCase(fileName) || ("none").equalsIgnoreCase(fileName)) { fileName = null; } String format = config.getProperty("LogFormat", "{0,time,medium} {1}:{2} {3}"); String strace = config.getProperty("LogExceptions", null); if (strace == null) { strace = config.getProperty("LogTraceExceptions", "false"); } boolean trace = (strace.equalsIgnoreCase("true") || strace.equalsIgnoreCase("yes")); Enumeration e = config.propertyNames(); Properties levels = new Properties(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); if (key.startsWith("LogLevel.")) { String type = key.substring(9); String level = config.getProperty(key); levels.setProperty(type, level); } } LogFile lf; try { lf = new LogFile(fileName, format, levels, trace); } catch (IOException ioe) { lf = new LogFile(System.err, format, levels, trace); lf.log("LOG", "ERROR", "Unable to write to logfile: " + format, ioe); } addTarget(lf); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/LogManager.java/buggy/webmacro/src/org/webmacro/util/LogManager.java
} if (_log != null) { _log.info("source: " + name);
public Log getLog(String name) { LogSource l = (LogSource) _sources.get(name); if (l != null) { return l; } l = new LogSource(name); _sources.put(name,l); Iterator t = _targets.iterator(); while (t.hasNext()) { LogTarget lt = (LogTarget) t.next(); lt.attach(l); } return l; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4f312fd00a74365a2671f796aeebcfbe9888b8cc/LogManager.java/buggy/webmacro/src/org/webmacro/util/LogManager.java
displayInformation(selectedNode); return;
elementName = selectedNode.getFQName(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); pathNode = parentNode; } SemanticType type = ((SemanticTypeTree.TypeNode)pathNode).getType(); attributeName = type.getName(); analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName);
public void run() { if(selectedNode == null) return; if(selectedNode.getFQName() == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode)) return; if(selectedNode.isLazilyInitialized()) { displayInformation(selectedNode); return; } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { System.err.println("retrieving "+selectedNode.getFQName() + " from " + name); List attributeList = sts.retrieveImageAttributes(name,selectedNode.getFQName(), imageIDList); System.err.println("got " + attributeList.size() + " records."); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); if(attrMap.getAttribute(name,attribute.getID()) == null) { attrMap.putAttribute(attribute); } } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
System.err.println("got " + attributeList.size() + " records.");
public void run() { if(selectedNode == null) return; if(selectedNode.getFQName() == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode)) return; if(selectedNode.isLazilyInitialized()) { displayInformation(selectedNode); return; } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { System.err.println("retrieving "+selectedNode.getFQName() + " from " + name); List attributeList = sts.retrieveImageAttributes(name,selectedNode.getFQName(), imageIDList); System.err.println("got " + attributeList.size() + " records."); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); if(attrMap.getAttribute(name,attribute.getID()) == null) { attrMap.putAttribute(attribute); } } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
analyzeInformation(attributeName,elementName); displayInformation(attributeName,elementName);
public void run() { if(selectedNode == null) return; if(selectedNode.getFQName() == null) return; if(!(selectedNode instanceof SemanticTypeTree.ElementNode)) return; if(selectedNode.isLazilyInitialized()) { displayInformation(selectedNode); return; } else { selectedNode.markAsInitialized(true); BrowserEnvironment env = BrowserEnvironment.getInstance(); BrowserAgent agent = env.getBrowserAgent(); SemanticTypesService sts = agent.getSemanticTypesService(); SemanticTypeTree.TreeNode pathNode = selectedNode; SemanticTypeTree.TypeNode parentNode = null; while(pathNode.getParent() instanceof SemanticTypeTree.TypeNode && pathNode.getParent() != null) { parentNode = (SemanticTypeTree.TypeNode)pathNode.getParent(); parentNode.markAsInitialized(true); Set children = parentNode.getChildren(); for(Iterator iter = children.iterator(); iter.hasNext();) { Object o = iter.next(); // NOTE: this depends on the contract that the STS // retrieves the attribute as a whole, which is correct // but hard to explicitly formalize and check if(o instanceof SemanticTypeTree.ElementNode) { ((SemanticTypeTree.ElementNode)o). markAsInitialized(true); } } pathNode = parentNode; } SemanticType parentType = parentNode.getType(); String name = parentType.getName(); attributeName = name; elementName = selectedNode.getFQName(); BrowserModel source = model.getInfoSource(); Map imageIDMap = source.getImageDataMap(); List imageIDList = new ArrayList(imageIDMap.keySet()); Collections.sort(imageIDList); if(status != null) { status.showMessage("Loading "+name+" attributes..."); } try { System.err.println("retrieving "+selectedNode.getFQName() + " from " + name); List attributeList = sts.retrieveImageAttributes(name,selectedNode.getFQName(), imageIDList); System.err.println("got " + attributeList.size() + " records."); for(Iterator iter = attributeList.iterator(); iter.hasNext();) { Attribute attribute = (Attribute)iter.next(); int imageID = attribute.getImage().getID(); ThumbnailDataModel tdm = (ThumbnailDataModel)imageIDMap.get(new Integer(imageID)); AttributeMap attrMap = tdm.getAttributeMap(); if(attrMap.getAttribute(name,attribute.getID()) == null) { attrMap.putAttribute(attribute); } } if(status != null) { status.showMessage("Loaded "+name+" attributes."); } } catch(DSOutOfServiceException dso) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } catch(DSAccessException dsa) { if(status != null) { status.showMessage("could not retrieve "+name+" data."); } } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
private void displayInformation(SemanticTypeTree.TreeNode node)
private void displayInformation(String attribute, String elementName)
private void displayInformation(SemanticTypeTree.TreeNode node) { System.err.println("display instead."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
System.err.println("display instead.");
if(model == null || attribute == null || elementName == null) { return; } BrowserModel browserModel = model.getInfoSource(); PaintMethod pm = HeatMapPMFactory.getPaintMethod(currentMode,attribute,elementName, currentScale,gradient.getMinColor(), gradient.getMaxColor()); for(Iterator iter = browserModel.getThumbnails().iterator(); iter.hasNext();) { Thumbnail t = (Thumbnail)iter.next(); if(currentMethod != null) { t.removeMiddlePaintMethod(currentMethod); } t.addMiddlePaintMethod(pm); } currentMethod = pm; browserModel.fireModelUpdated();
private void displayInformation(SemanticTypeTree.TreeNode node) { System.err.println("display instead."); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
System.err.println("mode change: "+newMode.toString());
setCurrentMode(newMode);
public void modeChanged(HeatMapMode newMode) { System.err.println("mode change: "+newMode.toString()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
if(model == null || node == null) { return; }
public void nodeSelected(SemanticTypeTree.TreeNode node) { LoaderThread thread = new LoaderThread(node); thread.start(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
public void scaleChanged(Scale newScale)
public void scaleChanged(String newScale)
public void scaleChanged(Scale newScale) { // TODO Auto-generated method stub }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
setCurrentScale(newScale);
public void scaleChanged(Scale newScale) { // TODO Auto-generated method stub }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapDispatcher.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapDispatcher.java
mainImage = model.getImage();
mainImage = model.getDisplayedImage();
private void showPreview(int savingType) { ImgSaverPreviewer preview = new ImgSaverPreviewer(this); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); switch (savingType) { default: case ImgSaverUI.IMAGE: mainImage = model.getImage(); imageComponents = null; break; case ImgSaverUI.IMAGE_AND_COMPONENTS: mainImage = model.getImage(); imageComponents = model.getImageComponents(); break; } setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); preview.initialize(); UIUtilities.centerAndShow(preview); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/ImgSaver.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java
mainImage = model.getImage();
mainImage = model.getDisplayedImage();
private void showPreview(int savingType) { ImgSaverPreviewer preview = new ImgSaverPreviewer(this); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); switch (savingType) { default: case ImgSaverUI.IMAGE: mainImage = model.getImage(); imageComponents = null; break; case ImgSaverUI.IMAGE_AND_COMPONENTS: mainImage = model.getImage(); imageComponents = model.getImageComponents(); break; } setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); preview.initialize(); UIUtilities.centerAndShow(preview); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/43f8c678f03aa7cac6a19865461c28a00cf7eb2b/ImgSaver.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/util/saver/ImgSaver.java
setThreadGroup((RubyThreadGroup)ruby.getClass("ThreadGroup").getConstant("Default"));
RubyThreadGroup defaultThreadGroup = (RubyThreadGroup)ruby.getClass("ThreadGroup").getConstant("Default"); defaultThreadGroup.add(this);
private ThreadClass(Ruby ruby, RubyClass type) { super(ruby, type); this.threadService = ruby.getThreadService(); // set to default thread group setThreadGroup((RubyThreadGroup)ruby.getClass("ThreadGroup").getConstant("Default")); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0dddc2281d031c27f48b5cb2519e375dfcf2196e/ThreadClass.java/clean/src/org/jruby/ThreadClass.java
currentThread.setThreadGroup((RubyThreadGroup)ruby.getClass("ThreadGroup").getConstant("Default"));
public static RubyClass createThreadClass(Ruby ruby) { RubyClass threadClass = ruby.defineClass("Thread", ruby.getClasses().getObjectClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); threadClass.defineMethod("[]", callbackFactory.getMethod(ThreadClass.class, "aref", IRubyObject.class)); threadClass.defineMethod("[]=", callbackFactory.getMethod(ThreadClass.class, "aset", IRubyObject.class, IRubyObject.class)); threadClass.defineMethod("abort_on_exception", callbackFactory.getMethod(ThreadClass.class, "abort_on_exception", IRubyObject.class)); threadClass.defineMethod("abort_on_exception=", callbackFactory.getMethod(ThreadClass.class, "abort_on_exception_set", IRubyObject.class, IRubyObject.class)); threadClass.defineMethod("alive?", callbackFactory.getMethod(ThreadClass.class, "is_alive")); threadClass.defineMethod("group", callbackFactory.getMethod(ThreadClass.class, "group")); threadClass.defineMethod("join", callbackFactory.getMethod(ThreadClass.class, "join")); threadClass.defineMethod("key?", callbackFactory.getMethod(ThreadClass.class, "has_key", IRubyObject.class)); threadClass.defineMethod("priority", callbackFactory.getMethod(ThreadClass.class, "priority")); threadClass.defineMethod("priority=", callbackFactory.getMethod(ThreadClass.class, "priority_set", IRubyObject.class)); threadClass.defineMethod("raise", callbackFactory.getMethod(ThreadClass.class, "raise", IRubyObject.class)); threadClass.defineMethod("run", callbackFactory.getMethod(ThreadClass.class, "run")); threadClass.defineMethod("status", callbackFactory.getMethod(ThreadClass.class, "status")); threadClass.defineMethod("stop?", callbackFactory.getMethod(ThreadClass.class, "isStopped")); threadClass.defineMethod("wakeup", callbackFactory.getMethod(ThreadClass.class, "wakeup")); threadClass.defineMethod("kill", callbackFactory.getMethod(ThreadClass.class, "kill")); threadClass.defineSingletonMethod("current", callbackFactory.getSingletonMethod(ThreadClass.class, "current")); threadClass.defineSingletonMethod("fork", callbackFactory.getOptSingletonMethod(ThreadClass.class, "newInstance")); threadClass.defineSingletonMethod("new", callbackFactory.getOptSingletonMethod(ThreadClass.class, "newInstance")); threadClass.defineSingletonMethod("list", callbackFactory.getSingletonMethod(ThreadClass.class, "list")); threadClass.defineSingletonMethod("pass", callbackFactory.getSingletonMethod(ThreadClass.class, "pass")); threadClass.defineSingletonMethod("start", callbackFactory.getOptSingletonMethod(ThreadClass.class, "start")); threadClass.defineSingletonMethod("critical=", callbackFactory.getSingletonMethod(ThreadClass.class, "critical_set", RubyBoolean.class)); threadClass.defineSingletonMethod("critical", callbackFactory.getSingletonMethod(ThreadClass.class, "critical")); threadClass.defineSingletonMethod("stop", callbackFactory.getSingletonMethod(ThreadClass.class, "stop")); ThreadClass currentThread = new ThreadClass(ruby, threadClass); // set hasStarted to true, otherwise Thread.main.status freezes currentThread.hasStarted = true; currentThread.jvmThread = Thread.currentThread(); ruby.getThreadService().setMainThread(currentThread); threadClass.defineSingletonMethod("main", callbackFactory.getSingletonMethod(ThreadClass.class, "main")); // set to default thread group currentThread.setThreadGroup((RubyThreadGroup)ruby.getClass("ThreadGroup").getConstant("Default")); return threadClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0dddc2281d031c27f48b5cb2519e375dfcf2196e/ThreadClass.java/clean/src/org/jruby/ThreadClass.java
return getRuntime().getNil();
jvmThread.interrupt(); return this;
public IRubyObject kill() { // TODO: stubbed for now, will need to implement kill hooks into call stack return getRuntime().getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/0dddc2281d031c27f48b5cb2519e375dfcf2196e/ThreadClass.java/clean/src/org/jruby/ThreadClass.java
final Long o = iObject.getDetails().getOwner().getId(); final Long g = iObject.getDetails().getGroup().getId();
final Long o = HibernateUtils.nullSafeOwnerId(iObject); final Long g = HibernateUtils.nullSafeGroupId(iObject);
public boolean isOwnerOrSupervisor( IObject iObject ) { if ( iObject == null ) throw new ApiUsageException("Object can't be null"); final Long o = iObject.getDetails().getOwner().getId(); final Long g = iObject.getDetails().getGroup().getId(); final EventContext ec = cd.getCurrentEventContext(); final boolean isAdmin = ec.isCurrentUserAdmin(); final boolean isPI = ec.getLeaderOfGroupsList().contains(g); final boolean isOwner = ec.getCurrentUserId().equals(o); if (isAdmin || isPI || isOwner) { return true; } return false; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/45821f6543f7eab739b589fd92a8f89432d69ee5/BasicSecuritySystem.java/buggy/components/server/src/ome/security/basic/BasicSecuritySystem.java
definePrivateMethod("remove_method", Arity.singleArgument());
definePrivateMethod("remove_method", Arity.optional());
public void initializeClass() { defineMethod("===", Arity.singleArgument(), "op_eqq"); defineMethod("<=>", Arity.singleArgument(), "op_cmp"); defineMethod("<", Arity.singleArgument(), "op_lt"); defineMethod("<=", Arity.singleArgument(), "op_le"); defineMethod(">", Arity.singleArgument(), "op_gt"); defineMethod(">=", Arity.singleArgument(), "op_ge"); defineMethod("ancestors", Arity.noArguments()); defineMethod("class_variables", Arity.noArguments()); defineMethod("clone", Arity.noArguments(), "rbClone"); defineMethod("const_defined?", Arity.singleArgument(), "const_defined"); defineMethod("const_get", Arity.singleArgument(), "const_get"); defineMethod("const_missing", Arity.singleArgument()); defineMethod("const_set", Arity.twoArguments()); defineMethod("constants", Arity.noArguments()); defineMethod("dup", Arity.noArguments()); defineMethod("extended", Arity.singleArgument()); defineMethod("included", Arity.singleArgument()); defineMethod("included_modules", Arity.noArguments()); defineMethod("initialize", Arity.optional()); defineMethod("instance_method", Arity.singleArgument()); defineMethod("instance_methods", Arity.optional()); defineMethod("method_defined?", Arity.singleArgument(), "method_defined"); defineMethod("module_eval", Arity.optional()); defineMethod("name", Arity.noArguments()); defineMethod("private_class_method", Arity.optional()); defineMethod("private_instance_methods", Arity.optional()); defineMethod("protected_instance_methods", Arity.optional()); defineMethod("public_class_method", Arity.optional()); defineMethod("public_instance_methods", Arity.optional()); defineMethod("to_s", Arity.noArguments()); defineAlias("class_eval", "module_eval"); definePrivateMethod("alias_method", Arity.twoArguments()); definePrivateMethod("append_features", Arity.singleArgument()); definePrivateMethod("attr", Arity.optional()); definePrivateMethod("attr_reader", Arity.optional()); definePrivateMethod("attr_writer", Arity.optional()); definePrivateMethod("attr_accessor", Arity.optional()); definePrivateMethod("define_method", Arity.optional()); definePrivateMethod("extend_object", Arity.singleArgument()); definePrivateMethod("include", Arity.optional()); definePrivateMethod("method_added", Arity.singleArgument()); definePrivateMethod("module_function", Arity.optional()); definePrivateMethod("public", Arity.optional(), "rbPublic"); definePrivateMethod("protected", Arity.optional(), "rbProtected"); definePrivateMethod("private", Arity.optional(), "rbPrivate"); definePrivateMethod("remove_class_variable", Arity.singleArgument()); definePrivateMethod("remove_const", Arity.singleArgument()); definePrivateMethod("remove_method", Arity.singleArgument()); definePrivateMethod("undef_method", Arity.singleArgument()); defineSingletonMethod("nesting", Arity.noArguments()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6f1403beec9694c559da08849101de395faccd1f/ModuleMetaClass.java/clean/src/org/jruby/runtime/builtin/meta/ModuleMetaClass.java
if (beginLong > endLong) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null;
if (beginLong > endLong && isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range.");
public long[] getBeginLength(long limit, boolean truncate, boolean isStrict) { long beginLong = RubyNumeric.num2long(begin); long endLong = RubyNumeric.num2long(end); if (! isExclusive) { endLong++; } if (beginLong < 0) { beginLong += limit; if (beginLong < 0) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } } if (truncate && beginLong > limit) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } if (truncate && endLong > limit) { endLong = limit; } if (endLong < 0 || (!isExclusive && endLong == 0)) { endLong += limit; if (endLong < 0) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } } if (beginLong > endLong) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } return new long[] { beginLong, endLong - beginLong }; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/60631867f8ea7a39c6966c08ea0adb7b49393e6a/RubyRange.java/buggy/src/org/jruby/RubyRange.java
return new long[] { beginLong, endLong - beginLong };
return new long[] { beginLong, Math.max(endLong - beginLong, 0L) };
public long[] getBeginLength(long limit, boolean truncate, boolean isStrict) { long beginLong = RubyNumeric.num2long(begin); long endLong = RubyNumeric.num2long(end); if (! isExclusive) { endLong++; } if (beginLong < 0) { beginLong += limit; if (beginLong < 0) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } } if (truncate && beginLong > limit) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } if (truncate && endLong > limit) { endLong = limit; } if (endLong < 0 || (!isExclusive && endLong == 0)) { endLong += limit; if (endLong < 0) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } } if (beginLong > endLong) { if (isStrict) { throw getRuntime().newRangeError(inspect().toString() + " out of range."); } return null; } return new long[] { beginLong, endLong - beginLong }; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/60631867f8ea7a39c6966c08ea0adb7b49393e6a/RubyRange.java/buggy/src/org/jruby/RubyRange.java
if (! threadLocalVariables.containsKey(name)) {
if (!threadLocalVariables.containsKey(name)) {
public IRubyObject aref(IRubyObject key) { String name = keyName(key); if (! threadLocalVariables.containsKey(name)) { return getRuntime().getNil(); } return (IRubyObject) threadLocalVariables.get(name); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
public static RubyClass createThreadClass(Ruby ruby) { RubyClass threadClass = ruby.defineClass("Thread", ruby.getClasses().getObjectClass()); // class methods threadClass.defineSingletonMethod( "abort_on_exception", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception", RubyString.class)); threadClass.defineSingletonMethod( "abort_on_exception=", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineSingletonMethod("critical", CallbackFactory.getSingletonMethod(RubyThread.class, "critical")); threadClass.defineSingletonMethod( "critical=", CallbackFactory.getSingletonMethod(RubyThread.class, "critical_set", RubyBoolean.class)); threadClass.defineSingletonMethod("current", CallbackFactory.getSingletonMethod(RubyThread.class, "current")); threadClass.defineSingletonMethod("exit", CallbackFactory.getSingletonMethod(RubyThread.class, "exit")); threadClass.defineSingletonMethod( "fork", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance"));// threadClass.defineSingletonMethod(// "kill",// CallbackFactory.getSingletonMethod(RubyThread.class, "kill", RubyThread.class)); threadClass.defineSingletonMethod("list", CallbackFactory.getSingletonMethod(RubyThread.class, "list"));// threadClass.defineSingletonMethod("main", CallbackFactory.getSingletonMethod(RubyThread.class, "main")); threadClass.defineSingletonMethod( "new", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance")); threadClass.defineSingletonMethod("pass", CallbackFactory.getSingletonMethod(RubyThread.class, "pass")); threadClass.defineSingletonMethod("start", CallbackFactory.getOptSingletonMethod(RubyThread.class, "start")); // threadClass.defineSingletonMethod("stop", CallbackFactory.getSingletonMethod(RubyThread.class, "stop")); // instance methods threadClass.defineMethod("[]", CallbackFactory.getMethod(RubyThread.class, "aref", IRubyObject.class)); threadClass.defineMethod( "[]=", CallbackFactory.getMethod(RubyThread.class, "aset", IRubyObject.class, IRubyObject.class)); threadClass.defineMethod( "abort_on_exception", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception")); threadClass.defineMethod( "abort_on_exception=", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineMethod("alive?", CallbackFactory.getMethod(RubyThread.class, "is_alive")); threadClass.defineMethod("exit", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("join", CallbackFactory.getMethod(RubyThread.class, "join")); threadClass.defineMethod("key?", CallbackFactory.getMethod(RubyThread.class, "has_key", IRubyObject.class)); threadClass.defineMethod("kill", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("priority", CallbackFactory.getMethod(RubyThread.class, "priority")); threadClass.defineMethod( "priority=", CallbackFactory.getMethod(RubyThread.class, "priority_set", RubyFixnum.class)); threadClass.defineMethod("raise", CallbackFactory.getMethod(RubyThread.class, "raise", RubyException.class)); threadClass.defineMethod("run", CallbackFactory.getMethod(RubyThread.class, "run")); threadClass.defineMethod("safe_level", CallbackFactory.getMethod(RubyThread.class, "safe_level")); threadClass.defineMethod("status", CallbackFactory.getMethod(RubyThread.class, "status")); threadClass.defineMethod("stop?", CallbackFactory.getMethod(RubyThread.class, "is_stopped")); threadClass.defineMethod("value", CallbackFactory.getMethod(RubyThread.class, "value")); threadClass.defineMethod("wakeup", CallbackFactory.getMethod(RubyThread.class, "wakeup")); Ruby runtime = threadClass.getRuntime(); RubyThread currentThread = new RubyThread(runtime, threadClass); currentThread.jvmThread = Thread.currentThread(); runtime.getCurrentContext().setCurrentThread(currentThread); return threadClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
public static RubyClass createThreadClass(Ruby ruby) { RubyClass threadClass = ruby.defineClass("Thread", ruby.getClasses().getObjectClass()); // class methods threadClass.defineSingletonMethod( "abort_on_exception", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception", RubyString.class)); threadClass.defineSingletonMethod( "abort_on_exception=", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineSingletonMethod("critical", CallbackFactory.getSingletonMethod(RubyThread.class, "critical")); threadClass.defineSingletonMethod( "critical=", CallbackFactory.getSingletonMethod(RubyThread.class, "critical_set", RubyBoolean.class)); threadClass.defineSingletonMethod("current", CallbackFactory.getSingletonMethod(RubyThread.class, "current")); threadClass.defineSingletonMethod("exit", CallbackFactory.getSingletonMethod(RubyThread.class, "exit")); threadClass.defineSingletonMethod( "fork", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance"));// threadClass.defineSingletonMethod(// "kill",// CallbackFactory.getSingletonMethod(RubyThread.class, "kill", RubyThread.class)); threadClass.defineSingletonMethod("list", CallbackFactory.getSingletonMethod(RubyThread.class, "list"));// threadClass.defineSingletonMethod("main", CallbackFactory.getSingletonMethod(RubyThread.class, "main")); threadClass.defineSingletonMethod( "new", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance")); threadClass.defineSingletonMethod("pass", CallbackFactory.getSingletonMethod(RubyThread.class, "pass")); threadClass.defineSingletonMethod("start", CallbackFactory.getOptSingletonMethod(RubyThread.class, "start")); // threadClass.defineSingletonMethod("stop", CallbackFactory.getSingletonMethod(RubyThread.class, "stop")); // instance methods threadClass.defineMethod("[]", CallbackFactory.getMethod(RubyThread.class, "aref", IRubyObject.class)); threadClass.defineMethod( "[]=", CallbackFactory.getMethod(RubyThread.class, "aset", IRubyObject.class, IRubyObject.class)); threadClass.defineMethod( "abort_on_exception", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception")); threadClass.defineMethod( "abort_on_exception=", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineMethod("alive?", CallbackFactory.getMethod(RubyThread.class, "is_alive")); threadClass.defineMethod("exit", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("join", CallbackFactory.getMethod(RubyThread.class, "join")); threadClass.defineMethod("key?", CallbackFactory.getMethod(RubyThread.class, "has_key", IRubyObject.class)); threadClass.defineMethod("kill", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("priority", CallbackFactory.getMethod(RubyThread.class, "priority")); threadClass.defineMethod( "priority=", CallbackFactory.getMethod(RubyThread.class, "priority_set", RubyFixnum.class)); threadClass.defineMethod("raise", CallbackFactory.getMethod(RubyThread.class, "raise", RubyException.class)); threadClass.defineMethod("run", CallbackFactory.getMethod(RubyThread.class, "run")); threadClass.defineMethod("safe_level", CallbackFactory.getMethod(RubyThread.class, "safe_level")); threadClass.defineMethod("status", CallbackFactory.getMethod(RubyThread.class, "status")); threadClass.defineMethod("stop?", CallbackFactory.getMethod(RubyThread.class, "is_stopped")); threadClass.defineMethod("value", CallbackFactory.getMethod(RubyThread.class, "value")); threadClass.defineMethod("wakeup", CallbackFactory.getMethod(RubyThread.class, "wakeup")); Ruby runtime = threadClass.getRuntime(); RubyThread currentThread = new RubyThread(runtime, threadClass); currentThread.jvmThread = Thread.currentThread(); runtime.getCurrentContext().setCurrentThread(currentThread); return threadClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
public static RubyClass createThreadClass(Ruby ruby) { RubyClass threadClass = ruby.defineClass("Thread", ruby.getClasses().getObjectClass()); // class methods threadClass.defineSingletonMethod( "abort_on_exception", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception", RubyString.class)); threadClass.defineSingletonMethod( "abort_on_exception=", CallbackFactory.getSingletonMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineSingletonMethod("critical", CallbackFactory.getSingletonMethod(RubyThread.class, "critical")); threadClass.defineSingletonMethod( "critical=", CallbackFactory.getSingletonMethod(RubyThread.class, "critical_set", RubyBoolean.class)); threadClass.defineSingletonMethod("current", CallbackFactory.getSingletonMethod(RubyThread.class, "current")); threadClass.defineSingletonMethod("exit", CallbackFactory.getSingletonMethod(RubyThread.class, "exit")); threadClass.defineSingletonMethod( "fork", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance"));// threadClass.defineSingletonMethod(// "kill",// CallbackFactory.getSingletonMethod(RubyThread.class, "kill", RubyThread.class)); threadClass.defineSingletonMethod("list", CallbackFactory.getSingletonMethod(RubyThread.class, "list"));// threadClass.defineSingletonMethod("main", CallbackFactory.getSingletonMethod(RubyThread.class, "main")); threadClass.defineSingletonMethod( "new", CallbackFactory.getOptSingletonMethod(RubyThread.class, "newInstance")); threadClass.defineSingletonMethod("pass", CallbackFactory.getSingletonMethod(RubyThread.class, "pass")); threadClass.defineSingletonMethod("start", CallbackFactory.getOptSingletonMethod(RubyThread.class, "start")); // threadClass.defineSingletonMethod("stop", CallbackFactory.getSingletonMethod(RubyThread.class, "stop")); // instance methods threadClass.defineMethod("[]", CallbackFactory.getMethod(RubyThread.class, "aref", IRubyObject.class)); threadClass.defineMethod( "[]=", CallbackFactory.getMethod(RubyThread.class, "aset", IRubyObject.class, IRubyObject.class)); threadClass.defineMethod( "abort_on_exception", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception")); threadClass.defineMethod( "abort_on_exception=", CallbackFactory.getMethod(RubyThread.class, "abort_on_exception_set", RubyBoolean.class)); threadClass.defineMethod("alive?", CallbackFactory.getMethod(RubyThread.class, "is_alive")); threadClass.defineMethod("exit", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("join", CallbackFactory.getMethod(RubyThread.class, "join")); threadClass.defineMethod("key?", CallbackFactory.getMethod(RubyThread.class, "has_key", IRubyObject.class)); threadClass.defineMethod("kill", CallbackFactory.getMethod(RubyThread.class, "exit")); threadClass.defineMethod("priority", CallbackFactory.getMethod(RubyThread.class, "priority")); threadClass.defineMethod( "priority=", CallbackFactory.getMethod(RubyThread.class, "priority_set", RubyFixnum.class)); threadClass.defineMethod("raise", CallbackFactory.getMethod(RubyThread.class, "raise", RubyException.class)); threadClass.defineMethod("run", CallbackFactory.getMethod(RubyThread.class, "run")); threadClass.defineMethod("safe_level", CallbackFactory.getMethod(RubyThread.class, "safe_level")); threadClass.defineMethod("status", CallbackFactory.getMethod(RubyThread.class, "status")); threadClass.defineMethod("stop?", CallbackFactory.getMethod(RubyThread.class, "is_stopped")); threadClass.defineMethod("value", CallbackFactory.getMethod(RubyThread.class, "value")); threadClass.defineMethod("wakeup", CallbackFactory.getMethod(RubyThread.class, "wakeup")); Ruby runtime = threadClass.getRuntime(); RubyThread currentThread = new RubyThread(runtime, threadClass); currentThread.jvmThread = Thread.currentThread(); runtime.getCurrentContext().setCurrentThread(currentThread); return threadClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
while (! hasStarted) { try { Thread.sleep(10); } catch (InterruptedException e) {
synchronized (hasStartedLock) { if (!hasStarted) { try { hasStartedLock.wait(); } catch (InterruptedException iExcptn) { Asserts.assertNotReached(); }
private void ensureStarted() { // Note: If this is required in too many places we can always // wait when we start a thread instead. But i imagine that // performance is more important there. -Anders while (! hasStarted) { // The JVM's join() may return directly if it is called // on a not-yet started thread. We give the thread // a chance to start before we proceed. try { Thread.sleep(10); } catch (InterruptedException e) { // FIXME: output warning } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
private void ensureStarted() { // Note: If this is required in too many places we can always // wait when we start a thread instead. But i imagine that // performance is more important there. -Anders while (! hasStarted) { // The JVM's join() may return directly if it is called // on a not-yet started thread. We give the thread // a chance to start before we proceed. try { Thread.sleep(10); } catch (InterruptedException e) { // FIXME: output warning } } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
if (jvmThread == Thread.currentThread()) { throw new ThreadError(getRuntime(), "thread tried to join itself"); }
public RubyThread join() { try { if (jvmThread == Thread.currentThread()) { throw new ThreadError(getRuntime(), "thread tried to join itself"); } ensureStarted(); jvmThread.join(); if (exitingException != null) { throw exitingException; } } catch (InterruptedException e) { // FIXME: output warning } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
public RubyThread join() { try { if (jvmThread == Thread.currentThread()) { throw new ThreadError(getRuntime(), "thread tried to join itself"); } ensureStarted(); jvmThread.join(); if (exitingException != null) { throw exitingException; } } catch (InterruptedException e) { // FIXME: output warning } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
if (exitingException != null) { throw exitingException; } } catch (InterruptedException e) {
} catch (InterruptedException iExcptn) { Asserts.assertNotReached(); } if (exitingException != null) { throw exitingException;
public RubyThread join() { try { if (jvmThread == Thread.currentThread()) { throw new ThreadError(getRuntime(), "thread tried to join itself"); } ensureStarted(); jvmThread.join(); if (exitingException != null) { throw exitingException; } } catch (InterruptedException e) { // FIXME: output warning } return this; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
if (! runtime.isBlockGiven()) {
if (!runtime.isBlockGiven()) {
private static RubyThread startThread(final IRubyObject recv, final IRubyObject[] args, boolean callInit) { final Ruby runtime = recv.getRuntime(); if (! runtime.isBlockGiven()) { throw new ThreadError(runtime, "must be called with a block"); } final RubyThread thread = new RubyThread(runtime, (RubyClass) recv); if (callInit) { thread.callInit(args); } final RubyProc proc = RubyProc.newProc(runtime, runtime.getClasses().getProcClass()); final Frame currentFrame = runtime.getCurrentFrame(); final Block currentBlock = runtime.getBlockStack().getCurrent(); thread.jvmThread = new Thread(new Runnable() { public void run() { thread.hasStarted = true; runtime.registerNewContext(thread); ThreadContext context = runtime.getCurrentContext(); context.getFrameStack().push(currentFrame); context.getBlockStack().setCurrent(currentBlock); // Call the thread's code try { proc.call(args); } catch (RaiseException e) { thread.exitingException = e; } } }); thread.jvmThread.start(); return thread; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
thread.hasStarted = true;
synchronized (thread.hasStartedLock) { thread.hasStarted = true; thread.hasStartedLock.notifyAll(); }
private static RubyThread startThread(final IRubyObject recv, final IRubyObject[] args, boolean callInit) { final Ruby runtime = recv.getRuntime(); if (! runtime.isBlockGiven()) { throw new ThreadError(runtime, "must be called with a block"); } final RubyThread thread = new RubyThread(runtime, (RubyClass) recv); if (callInit) { thread.callInit(args); } final RubyProc proc = RubyProc.newProc(runtime, runtime.getClasses().getProcClass()); final Frame currentFrame = runtime.getCurrentFrame(); final Block currentBlock = runtime.getBlockStack().getCurrent(); thread.jvmThread = new Thread(new Runnable() { public void run() { thread.hasStarted = true; runtime.registerNewContext(thread); ThreadContext context = runtime.getCurrentContext(); context.getFrameStack().push(currentFrame); context.getBlockStack().setCurrent(currentBlock); // Call the thread's code try { proc.call(args); } catch (RaiseException e) { thread.exitingException = e; } } }); thread.jvmThread.start(); return thread; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
thread.hasStarted = true;
synchronized (thread.hasStartedLock) { thread.hasStarted = true; thread.hasStartedLock.notifyAll(); }
public void run() { thread.hasStarted = true; runtime.registerNewContext(thread); ThreadContext context = runtime.getCurrentContext(); context.getFrameStack().push(currentFrame); context.getBlockStack().setCurrent(currentBlock); // Call the thread's code try { proc.call(args); } catch (RaiseException e) { thread.exitingException = e; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/76b67f896c21898620856bc161264cfbe0aa810b/RubyThread.java/buggy/org/jruby/RubyThread.java
System.out.println("2--- _buf now equal: " + _buf);
final public int rewind(int i) { if ((i < 0) || (i >= MAX_MARKS)) { return DUMMY_MARK; } Mark m = _marks[i]; if (m.isSet == false) { return DUMMY_MARK; } _buf = m.buf.toString();System.out.println("2--- _buf now equal: " + _buf); _pos = 0; _len = _buf.length(); _last = -1; _cur = m.last; _escaped = false; _marks[i].isSet = false; _marked--; read(); // recompute escaped, _pos, _cur, _last, etc. return DUMMY_MARK; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/f73b6db317ef8977ff59c43aca9fc2ed4bf47358/ParseTool.java/clean/webmacro/src/org/webmacro/engine/ParseTool.java
public RubyClass newSubClass(String name, RubyModule parent) { return new FixnumMetaClass(name, this, parent);
public RubyClass newSubClass(String name, SinglyLinkedList parentCRef) { return new FixnumMetaClass(name, this, parentCRef);
public RubyClass newSubClass(String name, RubyModule parent) { return new FixnumMetaClass(name, this, parent); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a1b8fc1d456e3d5c6e01579b88773383068aa85c/FixnumMetaClass.java/clean/src/org/jruby/runtime/builtin/meta/FixnumMetaClass.java
if (self.isInstanceVarDefined(iVisited.getName())) {
if (self.hasInstanceVariable(iVisited.getName())) {
public void visitInstVarNode(InstVarNode iVisited) { if (self.isInstanceVarDefined(iVisited.getName())) { definition = "instance-variable"; } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/095520dd469b76e5c1b4ca012804294c66855e55/DefinedVisitor.java/clean/org/jruby/evaluator/DefinedVisitor.java
articleItem.load(id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear");
articleItem.setResourcePath(id); articleItem.load(); ArticleItemBean bean = getArticleItemBean(); bean.clear(); Locale locale = new Locale("en"); bean.setLocale(locale); bean.setHeadline(articleItem.getHeadline()); bean.setTeaser(articleItem.getTeaser()); bean.setBody(articleItem.getBody()); bean.setAuthor(articleItem.getAuthor()); bean.setComment(articleItem.getComment()); bean.setDescription(articleItem.getDescription()); bean.setStatus(ContentItemCase.STATUS_PUBLISHED); bean.setBaseFolderLocation(articleItem.getBaseFolderLocation());
public void processAction(ActionEvent event) { if (event.getComponent().getId().equals(LIST_BUTTON_ID)) { WFUtil.invoke(LIST_ARTICLES_BEAN_ID, "list"); return; } else if (event.getComponent().getId().equals(VIEW_ARTICLE_BACK_BUTTON_ID)) { WFComponentSelector cs = (WFComponentSelector) event.getComponent().findComponent(DISPLAY_SELECTOR_ID); cs.setSelectedId(LIST_PANEL_ID, true); cs.setSelectedId(VIEW_ARTICLE_PANEL_ID, false); return; } UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); ArticleItemBean articleItem = new ArticleItemBean(); try { articleItem.load(id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "en"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setTeaser", notNull(articleItem.getTeaser())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", notNull(articleItem.getBody())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", notNull(articleItem.getAuthor())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", notNull(articleItem.getComment())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", notNull(articleItem.getDescription())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", // articleItem.getStatus() ContentItemCase.STATUS_PUBLISHED );// WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setFolderLocation", notNull(articleItem.getFolderLocation())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); //And one more time since it won't work after just setting the params once... WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setTeaser", notNull(articleItem.getTeaser())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", notNull(articleItem.getBody())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", notNull(articleItem.getAuthor())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setFolderLocation", notNull(articleItem.getFolderLocation())); WFComponentSelector cs = (WFComponentSelector) event.getComponent().getParent().getParent().getParent().findComponent(DISPLAY_SELECTOR_ID); cs.setSelectedId(LIST_PANEL_ID, false); cs.setSelectedId(VIEW_ARTICLE_PANEL_ID, true); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9dd8a7f9883fa3785baebfbed97ebf38eba1add9/ListArticlesBlock.java/buggy/src/java/com/idega/block/article/component/ListArticlesBlock.java
WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "en"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline()));
/*WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline()));
public void processAction(ActionEvent event) { if (event.getComponent().getId().equals(LIST_BUTTON_ID)) { WFUtil.invoke(LIST_ARTICLES_BEAN_ID, "list"); return; } else if (event.getComponent().getId().equals(VIEW_ARTICLE_BACK_BUTTON_ID)) { WFComponentSelector cs = (WFComponentSelector) event.getComponent().findComponent(DISPLAY_SELECTOR_ID); cs.setSelectedId(LIST_PANEL_ID, true); cs.setSelectedId(VIEW_ARTICLE_PANEL_ID, false); return; } UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); ArticleItemBean articleItem = new ArticleItemBean(); try { articleItem.load(id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "en"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setTeaser", notNull(articleItem.getTeaser())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", notNull(articleItem.getBody())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", notNull(articleItem.getAuthor())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", notNull(articleItem.getComment())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", notNull(articleItem.getDescription())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", // articleItem.getStatus() ContentItemCase.STATUS_PUBLISHED );// WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setFolderLocation", notNull(articleItem.getFolderLocation())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); //And one more time since it won't work after just setting the params once... WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setTeaser", notNull(articleItem.getTeaser())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", notNull(articleItem.getBody())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", notNull(articleItem.getAuthor())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setFolderLocation", notNull(articleItem.getFolderLocation())); WFComponentSelector cs = (WFComponentSelector) event.getComponent().getParent().getParent().getParent().findComponent(DISPLAY_SELECTOR_ID); cs.setSelectedId(LIST_PANEL_ID, false); cs.setSelectedId(VIEW_ARTICLE_PANEL_ID, true); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9dd8a7f9883fa3785baebfbed97ebf38eba1add9/ListArticlesBlock.java/buggy/src/java/com/idega/block/article/component/ListArticlesBlock.java