rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
meta
stringlengths
141
403
if (jj_3R_24()) return true;
if (jj_3R_28()) return true;
final private boolean jj_3_11() { Token xsp; xsp = jj_scanpos; if (jj_3R_20()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_21()) { jj_scanpos = xsp; if (jj_3R_22()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_23()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_24()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_25()) jj_scanpos = xsp;
if (jj_3R_29()) jj_scanpos = xsp;
final private boolean jj_3_12() { Token xsp; xsp = jj_scanpos; if (jj_3R_25()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_26()) { jj_scanpos = xsp; if (jj_3R_27()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_28()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_29()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_26()) { jj_scanpos = xsp; if (jj_3R_27()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_28()) jj_scanpos = xsp;
if (jj_3R_31()) jj_scanpos = xsp;
final private boolean jj_3_12() { Token xsp; xsp = jj_scanpos; if (jj_3R_25()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_26()) { jj_scanpos = xsp; if (jj_3R_27()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_28()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_29()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_29()) return true;
if (jj_3R_32()) return true;
final private boolean jj_3_12() { Token xsp; xsp = jj_scanpos; if (jj_3R_25()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_26()) { jj_scanpos = xsp; if (jj_3R_27()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_28()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_29()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_30()) jj_scanpos = xsp;
if (jj_3R_33()) jj_scanpos = xsp;
final private boolean jj_3_13() { Token xsp; xsp = jj_scanpos; if (jj_3R_30()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_31()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_32()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_33()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_31()) return true;
if (jj_scan_token(OP_AND)) return true;
final private boolean jj_3_13() { Token xsp; xsp = jj_scanpos; if (jj_3R_30()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_31()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_32()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_33()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_32()) jj_scanpos = xsp;
if (jj_3R_34()) jj_scanpos = xsp;
final private boolean jj_3_13() { Token xsp; xsp = jj_scanpos; if (jj_3R_30()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_31()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_32()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_33()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_33()) return true;
if (jj_3R_35()) return true;
final private boolean jj_3_13() { Token xsp; xsp = jj_scanpos; if (jj_3R_30()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_31()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_32()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_33()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_34()) jj_scanpos = xsp;
if (jj_3R_36()) jj_scanpos = xsp;
final private boolean jj_3_14() { Token xsp; xsp = jj_scanpos; if (jj_3R_34()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_AND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_35()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_36()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(OP_AND)) return true;
if (jj_scan_token(OP_OR)) return true;
final private boolean jj_3_14() { Token xsp; xsp = jj_scanpos; if (jj_3R_34()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_AND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_35()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_36()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_35()) jj_scanpos = xsp;
if (jj_3R_37()) jj_scanpos = xsp;
final private boolean jj_3_14() { Token xsp; xsp = jj_scanpos; if (jj_3R_34()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_AND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_35()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_36()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_3R_36()) return true;
if (jj_3R_38()) return true;
final private boolean jj_3_14() { Token xsp; xsp = jj_scanpos; if (jj_3R_34()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_AND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_35()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_36()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_37()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_OR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_38()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_39()) return true;
if (jj_scan_token(WORD)) return true;
final private boolean jj_3_15() { Token xsp; xsp = jj_scanpos; if (jj_3R_37()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(OP_OR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_38()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_3R_39()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; xsp = jj_scanpos; if (jj_3R_39()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_40()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3_16() { if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_40()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_41()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3_17() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; Token xsp; xsp = jj_scanpos; if (jj_3R_40()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; xsp = jj_scanpos; if (jj_3R_41()) jj_scanpos = xsp; else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(DOLLAR)) return true;
if (jj_scan_token(LBRACE)) return true;
final private boolean jj_3_19() { if (jj_scan_token(DOLLAR)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(LBRACE)) return true;
Token xsp; xsp = jj_scanpos; if (jj_3R_41()) { jj_scanpos = xsp; if (jj_3R_42()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_43()) return true;
final private boolean jj_3_20() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3_20() { if (jj_scan_token(LBRACE)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_44()) return true;
if (jj_scan_token(POUND)) return true;
final private boolean jj_3_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_44()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
} else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3_21() { Token xsp; xsp = jj_scanpos; if (jj_3R_42()) { jj_scanpos = xsp; if (jj_3R_43()) { jj_scanpos = xsp; lookingAhead = true; jj_semLA = lookahead_not_breaking_subd(); lookingAhead = false; if (!jj_semLA || jj_3R_44()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(POUND)) return true;
if (jj_scan_token(LBRACE)) return true;
final private boolean jj_3_22() { if (jj_scan_token(POUND)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
Token xsp; if (jj_3R_19()) return true;
if (jj_scan_token(DOT)) return true;
final private boolean jj_3_6() { Token xsp; if (jj_3R_19()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; while (true) { xsp = jj_scanpos; if (jj_3R_19()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
while (true) { xsp = jj_scanpos; if (jj_3R_19()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; }
if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
final private boolean jj_3_6() { Token xsp; if (jj_3R_19()) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; while (true) { xsp = jj_scanpos; if (jj_3R_19()) { jj_scanpos = xsp; break; } if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; } return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(DOT)) return true;
if (jj_scan_token(WORD)) return true;
final private boolean jj_3_7() { if (jj_scan_token(DOT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WORD)) return true;
if (jj_scan_token(SEMI)) return true;
final private boolean jj_3_7() { if (jj_scan_token(DOT)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(SEMI)) return true;
if (jj_scan_token(DOLLAR)) return true;
final private boolean jj_3_8() { if (jj_scan_token(WORD)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; if (jj_scan_token(SEMI)) return true; if (jj_la == 0 && jj_scanpos == jj_lastpos) return false; return false; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/c9a4de4264062f93d661ef3eb940e728297306c8/WMParser_impl.java/clean/webmacro/src/org/webmacro/parser/WMParser_impl.java
try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; }
l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l;
public Object evaluate(Context context) throws PropertyException { Object l, r; try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } if (!isTrue(l)) return FALSE; try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; } if (!isTrue(r)) return FALSE; return TRUE; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2a732af6347caef331bbf5ad7353790dce990292/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java
try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; }
r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r;
public Object evaluate(Context context) throws PropertyException { Object l, r; try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } if (!isTrue(l)) return FALSE; try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; } if (!isTrue(r)) return FALSE; return TRUE; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2a732af6347caef331bbf5ad7353790dce990292/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java
try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; }
l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r;
public Object evaluate(Context context) throws PropertyException { Object l, r; try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; } return operate(l, r); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2a732af6347caef331bbf5ad7353790dce990292/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java
try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; }
l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l;
public Object evaluate(Context context) throws PropertyException { Object l, r; try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } if (isTrue(l)) return TRUE; try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; } if (isTrue(r)) return TRUE; return FALSE; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2a732af6347caef331bbf5ad7353790dce990292/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java
try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; }
r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r;
public Object evaluate(Context context) throws PropertyException { Object l, r; try { l = (_l instanceof Macro) ? ((Macro) _l).evaluate(context) : _l; } catch (Exception e) { l = null; } if (isTrue(l)) return TRUE; try { r = (_r instanceof Macro) ? ((Macro) _r).evaluate(context) : _r; } catch (Exception e) { r = null; } if (isTrue(r)) return TRUE; return FALSE; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/2a732af6347caef331bbf5ad7353790dce990292/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java
_bwriter = new BufferedWriter(new OutputStreamWriter(_bstream, encoding));
_bwriter = new OutputStreamWriter(_bstream, encoding);
public FastWriter(OutputStream out, String encoding) throws java.io.UnsupportedEncodingException { _encoding = encoding; _bstream = new ByteBufferOutputStream(4096); _bwriter = new BufferedWriter(new OutputStreamWriter(_bstream, encoding)); _cache = EncodingCache.getInstance(encoding); _encodeProperly = true; _buffered = false; _out = out; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/84fef1ba20715e29ebecf0e390cbce1c2ef3b8f3/FastWriter.java/clean/webmacro/src/org/webmacro/FastWriter.java
return _bstream.toByteArray();
return _bstream.getBytes();
public byte[] toByteArray() { bflush(); return _bstream.toByteArray(); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/84fef1ba20715e29ebecf0e390cbce1c2ef3b8f3/FastWriter.java/clean/webmacro/src/org/webmacro/FastWriter.java
try { if (_encodeProperly) { bflush(); _bstream.write(_cache.getEncoding(s)); } else { write(s,0,s.length()); } } catch (IOException e) { e.printStackTrace();
if (_encodeProperly) { bflush(); _bstream.write(_cache.getEncoding(s)); } else { write(s,0,s.length());
public void writeStatic(String s) { try { if (_encodeProperly) { bflush(); _bstream.write(_cache.getEncoding(s)); } else { write(s,0,s.length()); } } catch (IOException e) { e.printStackTrace(); // never happens } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/84fef1ba20715e29ebecf0e390cbce1c2ef3b8f3/FastWriter.java/clean/webmacro/src/org/webmacro/FastWriter.java
Ice.Object object = new test.TI();
Ice.Object object = new mono.TI();
main(String[] args) { int status = 0; Ice.Communicator ic = null; try { // Server implementation here... ic = Ice.Util.initialize(args); Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints( "TAdapter", "default -p 10000"); Ice.Object object = new test.TI(); adapter.add( object, Ice.Util.stringToIdentity("T")); adapter.activate(); ic.waitForShutdown(); } catch (Ice.LocalException e) { e.printStackTrace(); status = 1; } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } if (ic != null) { // Clean up // try { ic.destroy(); } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } } System.exit(status); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d075eea85d4fb93ed40f6b4f476d90a0bccaf12a/Server.java/buggy/components/common/test/mono/Server.java
e.printStackTrace();
main(String[] args) { int status = 0; Ice.Communicator ic = null; try { // Server implementation here... ic = Ice.Util.initialize(args); Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints( "TAdapter", "default -p 10000"); Ice.Object object = new test.TI(); adapter.add( object, Ice.Util.stringToIdentity("T")); adapter.activate(); ic.waitForShutdown(); } catch (Ice.LocalException e) { e.printStackTrace(); status = 1; } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } if (ic != null) { // Clean up // try { ic.destroy(); } catch (Exception e) { System.err.println(e.getMessage()); status = 1; } } System.exit(status); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d075eea85d4fb93ed40f6b4f476d90a0bccaf12a/Server.java/buggy/components/common/test/mono/Server.java
data[i][0] = (DatasetData) datasets[i];
data[i][0] = ((DatasetData) datasets[i]).getName();
private DatasetsTableModel() { for (int i = 0; i < datasets.length; i++) { data[i][0] = (DatasetData) datasets[i]; data[i][1] = new Boolean(false); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1ed79437fda6d8f6b2566c6fe677bfaaf3352055/ProjectDatasetsDiffPane.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/editors/project/ProjectDatasetsDiffPane.java
0, 0, 0, 255, false);
255, 0, 0, 255, false);
private RenderingDef createDefaultRenderingDef(PixelsDimensions dims, PixelsStats stats, int pixelType) { QuantumDef qDef = new QuantumDef(QuantumFactory.LINEAR, pixelType, 1, 0, QuantumFactory.DEPTH_8BIT, QuantumFactory.DEPTH_8BIT); ChannelBindings[] waves = new ChannelBindings[dims.sizeW]; PixelsGlobalStatsEntry wGlobal; for (int w = 0; w < dims.sizeW; ++w) { wGlobal = stats.getGlobalEntry(w); //TODO: calcultate default interval using sigma, etc. waves[w] = new ChannelBindings(w, wGlobal.getGlobalMin(), wGlobal.getGlobalMax(), 0, 0, 0, 255, false); } waves[0].setActive(true); //NOTE: ImageDimensions enforces 1 < sizeW. return new RenderingDef(dims.sizeZ/2+dims.sizeZ%2-1, 0, RenderingDef.GS, qDef, waves); //NOTE: middle of stack is z=1 if szZ==3, z=1 if szZ==4, etc. }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/1af109c95da3a7c178aa582fbdc0a6c825b00e8c/Renderer.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/Renderer.java
System.err.println("xxx"); for (String id : types.keySet()) { System.err.println(id); }
public Set<SemanticType> process(){ for (String id : types.keySet()) { // "ome...Pixels" SemanticType t = types.get(id); // Pixels for (Property p : t.getProperties()) { // thumbnails String rev = p.getType(); // "ome...Thumbnail" String inv = p.getInverse(); // "pixels" if ( inv != null ) { if (types.containsKey(rev)) { SemanticType reverse = types.get(rev); // Thumbail for (Property inverse : reverse.getProperties()) { if ( inverse.getType().equals(id)) { // "ome...Pixels" inverse.setInverse(p.getName()); } } } } } } System.err.println("xxx"); for (String id : types.keySet()) { System.err.println(id); } return new HashSet<SemanticType>(types.values()); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3a956977ffa0572625f43255a57d6d52664bd7e7/SaxReader.java/clean/components/dsl/src/ome/dsl/SaxReader.java
for (String nick : invitees.keySet()) { String jid = SparkManager.getUserManager().getJIDFromNickname(nick); Occupant occ = chat.getOccupant(participantJID); if (occ != null) { String actualJID = occ.getJid(); if (actualJID.equals(jid)) { int index = getIndex(nick); if (index != -1) { model.removeElementAt(index); } } } }
private void addParticipant(String participantJID, Presence presence) { String nickname = StringUtils.parseResource(participantJID); Occupant occupant = SparkManager.getUserManager().getOccupant(groupChatRoom, nickname); boolean isOwnerOrAdmin = SparkManager.getUserManager().isOwnerOrAdmin(occupant); boolean isModerator = SparkManager.getUserManager().isModerator(occupant); if (!exists(nickname)) { ImageIcon icon = SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE); if (!isOwnerOrAdmin) { if (isModerator) { icon = SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE); } else { StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); StatusItem item = statusBar.getItemFromPresence(presence); if (item != null) { icon = new ImageIcon(item.getImageIcon().getImage()); } else { icon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); } } } icon.setDescription(nickname); model.addElement(icon); } else { ImageIcon icon = SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE); if (!isOwnerOrAdmin) { if (isModerator) { icon = SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE); } else { StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); StatusItem item = statusBar.getItemFromPresence(presence); if (item != null) { icon = new ImageIcon(item.getImageIcon().getImage()); } else { icon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); } } } icon.setDescription(nickname); int index = getIndex(nickname); if (index != -1) { model.removeElementAt(index); model.insertElementAt(icon, index); } } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
boolean isMe = groupJIDNickname.equals(nickname);
boolean isMe = nickname.equals(groupJIDNickname);
private void checkPopup(MouseEvent evt) { final int index = list.locationToIndex(evt.getPoint()); list.setSelectedIndex(index); final String selectedUser = getSelectedUser(); final String groupJID = (String)userMap.get(selectedUser); String groupJIDNickname = StringUtils.parseResource(groupJID); final String nickname = groupChatRoom.getNickname(); final Occupant occupant = userManager.getOccupant(groupChatRoom, selectedUser); final boolean admin = SparkManager.getUserManager().isOwnerOrAdmin(groupChatRoom, chat.getNickname()); final boolean moderator = SparkManager.getUserManager().isModerator(groupChatRoom, chat.getNickname()); final boolean userIsAdmin = userManager.isOwnerOrAdmin(occupant); final boolean userIsModerator = userManager.isModerator(occupant); boolean isMe = groupJIDNickname.equals(nickname); JPopupMenu popup = new JPopupMenu(); if (isMe) { Action changeNicknameAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } } }; changeNicknameAction.putValue(Action.NAME, Res.getString("menuitem.change.nickname")); changeNicknameAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); if (allowNicknameChange) { popup.add(changeNicknameAction); } } Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); } }; chatAction.putValue(Action.NAME, Res.getString("menuitem.start.a.chat")); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); if (!isMe) { popup.add(chatAction); } Action blockAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } } }; blockAction.putValue(Action.NAME, Res.getString("menuitem.block.user")); blockAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE)); if (!isMe) { if (groupChatRoom.isBlocked(groupJID)) { blockAction.putValue(Action.NAME, Res.getString("menuitem.unblock.user")); } popup.add(blockAction); } Action kickAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { kickUser(selectedUser); } }; kickAction.putValue(Action.NAME, Res.getString("menuitem.kick.user")); kickAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); if (moderator && !userIsAdmin && !isMe) { popup.add(kickAction); } // Handle Voice Operations Action voiceAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); } } }; voiceAction.putValue(Action.NAME, Res.getString("menuitem.voice")); voiceAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MEGAPHONE_16x16)); if (moderator && !userIsModerator && !isMe) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { voiceAction.putValue(Action.NAME, Res.getString("menuitem.revoke.voice")); } else { voiceAction.putValue(Action.NAME, Res.getString("menuitem.grant.voice")); } popup.add(voiceAction); } Action banAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser); } }; banAction.putValue(Action.NAME, Res.getString("menuitem.ban.user")); banAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.RED_FLAG_16x16)); if (admin && !userIsModerator && !isMe) { popup.add(banAction); } Action moderatorAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); } } }; moderatorAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE)); if (admin && !userIsModerator) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.grant.moderator")); popup.add(moderatorAction); } else if (admin && userIsModerator && !isMe) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.revoke.moderator")); popup.add(moderatorAction); } // Handle Unbanning of users. Action unbanAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid); } }; if (admin) { JMenu unbanMenu = new JMenu(Res.getString("menuitem.unban")); Iterator bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = (Affiliate)bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.RED_BALL); JMenuItem bannedItem = new JMenuItem(bannedUser.getJid(), icon); unbanMenu.add(bannedItem); bannedItem.addActionListener(unbanAction); } if (unbanMenu.getMenuComponentCount() > 0) { popup.add(unbanMenu); } } Action inviteAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null); } }; inviteAction.putValue(Action.NAME, Res.getString("menuitem.invite.users")); inviteAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.CONFERENCE_IMAGE_16x16)); popup.addSeparator(); popup.add(inviteAction); popup.show(list, evt.getX(), evt.getY()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
if (groupJIDNickname == null) { Action inviteAgainAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String message = invitees.get(selectedUser); String jid = userManager.getJIDFromNickname(selectedUser); chat.invite(jid, message); } }; inviteAgainAction.putValue(Action.NAME, "Invite Again"); popup.add(inviteAgainAction); Action removeInvite = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { int index = getIndex(selectedUser); if (index != -1) { model.removeElementAt(index); } } }; removeInvite.putValue(Action.NAME, "Remove"); popup.add(removeInvite); popup.show(list, evt.getX(), evt.getY()); return; }
private void checkPopup(MouseEvent evt) { final int index = list.locationToIndex(evt.getPoint()); list.setSelectedIndex(index); final String selectedUser = getSelectedUser(); final String groupJID = (String)userMap.get(selectedUser); String groupJIDNickname = StringUtils.parseResource(groupJID); final String nickname = groupChatRoom.getNickname(); final Occupant occupant = userManager.getOccupant(groupChatRoom, selectedUser); final boolean admin = SparkManager.getUserManager().isOwnerOrAdmin(groupChatRoom, chat.getNickname()); final boolean moderator = SparkManager.getUserManager().isModerator(groupChatRoom, chat.getNickname()); final boolean userIsAdmin = userManager.isOwnerOrAdmin(occupant); final boolean userIsModerator = userManager.isModerator(occupant); boolean isMe = groupJIDNickname.equals(nickname); JPopupMenu popup = new JPopupMenu(); if (isMe) { Action changeNicknameAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } } }; changeNicknameAction.putValue(Action.NAME, Res.getString("menuitem.change.nickname")); changeNicknameAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); if (allowNicknameChange) { popup.add(changeNicknameAction); } } Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); } }; chatAction.putValue(Action.NAME, Res.getString("menuitem.start.a.chat")); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); if (!isMe) { popup.add(chatAction); } Action blockAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } } }; blockAction.putValue(Action.NAME, Res.getString("menuitem.block.user")); blockAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE)); if (!isMe) { if (groupChatRoom.isBlocked(groupJID)) { blockAction.putValue(Action.NAME, Res.getString("menuitem.unblock.user")); } popup.add(blockAction); } Action kickAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { kickUser(selectedUser); } }; kickAction.putValue(Action.NAME, Res.getString("menuitem.kick.user")); kickAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); if (moderator && !userIsAdmin && !isMe) { popup.add(kickAction); } // Handle Voice Operations Action voiceAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); } } }; voiceAction.putValue(Action.NAME, Res.getString("menuitem.voice")); voiceAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MEGAPHONE_16x16)); if (moderator && !userIsModerator && !isMe) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { voiceAction.putValue(Action.NAME, Res.getString("menuitem.revoke.voice")); } else { voiceAction.putValue(Action.NAME, Res.getString("menuitem.grant.voice")); } popup.add(voiceAction); } Action banAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser); } }; banAction.putValue(Action.NAME, Res.getString("menuitem.ban.user")); banAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.RED_FLAG_16x16)); if (admin && !userIsModerator && !isMe) { popup.add(banAction); } Action moderatorAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); } } }; moderatorAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE)); if (admin && !userIsModerator) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.grant.moderator")); popup.add(moderatorAction); } else if (admin && userIsModerator && !isMe) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.revoke.moderator")); popup.add(moderatorAction); } // Handle Unbanning of users. Action unbanAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid); } }; if (admin) { JMenu unbanMenu = new JMenu(Res.getString("menuitem.unban")); Iterator bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = (Affiliate)bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.RED_BALL); JMenuItem bannedItem = new JMenuItem(bannedUser.getJid(), icon); unbanMenu.add(bannedItem); bannedItem.addActionListener(unbanAction); } if (unbanMenu.getMenuComponentCount() > 0) { popup.add(unbanMenu); } } Action inviteAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null); } }; inviteAction.putValue(Action.NAME, Res.getString("menuitem.invite.users")); inviteAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.CONFERENCE_IMAGE_16x16)); popup.addSeparator(); popup.add(inviteAction); popup.show(list, evt.getX(), evt.getY()); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser);
public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); }
public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); }
kickUser(selectedUser);
public void actionPerformed(ActionEvent actionEvent) { if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid);
if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); }
public void actionPerformed(ActionEvent actionEvent) { String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null);
banUser(selectedUser);
public void actionPerformed(ActionEvent actionEvent) { ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); }
String message = invitees.get(selectedUser); String jid = userManager.getJIDFromNickname(selectedUser); chat.invite(jid, message); }
public void actionPerformed(ActionEvent actionEvent) { String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index);
public void actionPerformed(ActionEvent actionEvent) { int index = getIndex(selectedUser); if (index != -1) { model.removeElementAt(index); }
public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } }
public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
kickUser(selectedUser); }
String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } }
public void actionPerformed(ActionEvent actionEvent) { kickUser(selectedUser); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); }
String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser));
public void actionPerformed(ActionEvent actionEvent) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
ServiceDiscoveryManager disco = ServiceDiscoveryManager.getInstanceFor(SparkManager.getConnection()); try { roomInformation = disco.discoverInfo(chat.getRoom()); } catch (XMPPException e) { Log.debug("Unable to retrieve room informatino for " + chat.getRoom()); }
public void setChatRoom(final ChatRoom chatRoom) { this.groupChatRoom = (GroupChatRoom)chatRoom; chatManager.addChatRoomListener(this); chat = groupChatRoom.getMultiUserChat(); listener = new PacketListener() { public void processPacket(final Packet packet) { SwingUtilities.invokeLater(new Runnable() { public void run() { Presence p = (Presence)packet; final String userid = p.getFrom(); String nickname = StringUtils.parseResource(userid); userMap.put(nickname, userid); if (p.getType() == Presence.Type.available) { addParticipant(userid, p); agentInfoPanel.setVisible(true); } else { model.removeElement(nickname); } } }); } }; chat.addParticipantListener(listener); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
userMap.remove(userid);
public void userHasLeft(ChatRoom room, String userid) { if (room != groupChatRoom) { return; } int index = getIndex(userid); if (index != -1) { model.removeElementAt(index); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/d039de56513c7dd0e3c5c2762f184ca886fb4900/ConferenceRoomInfo.java/clean/src/java/org/jivesoftware/spark/ui/conferences/ConferenceRoomInfo.java
if ( RootException.class.isAssignableFrom( t.getClass() ) )
if ( RootException.class.isAssignableFrom( t.getClass() ) )
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; // Wrap all non-RootExceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6426050670456648cb4588aee083d5fefb30d71b/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re;
else if ( IllegalArgumentException.class.isAssignableFrom( t.getClass() )) { ApiUsageException aue = new ApiUsageException( t.getMessage() ); aue.setStackTrace( t.getStackTrace() ); log.warn("IllegalArgumentException thrown:\n"+aue.getStackTrace()); return aue; } else { InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; }
protected Throwable getAndLogException(Throwable t){ if (null == t) { log.error("Exception thrown. (null)"); return new InternalException("Exception thrown with null message"); } else { String msg = " Wrapped Exception: (" + t.getClass().getName()+"):\n" + t.getMessage(); log.error("Exception thrown: "+msg); if ( RootException.class.isAssignableFrom( t.getClass() ) ) return t; // Wrap all non-RootExceptions in InternalException InternalException re = new InternalException(msg); re.setStackTrace(t.getStackTrace()); return re; } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6426050670456648cb4588aee083d5fefb30d71b/ServiceHandler.java/buggy/components/server/src/ome/services/util/ServiceHandler.java
wc.put ("PageName", wc.getForm ("edit"));
String pageName = wc.getForm("edit"); pageName = WikiUtil.formatAsWikiTitle(pageName); wc.put ("PageName", pageName);
public void perform(WikiSystem wiki, WebContext wc, WikiUser user, WikiPage page) throws PageAction.PageActionException { if (page != null && page.getIsModerated() && !user.getIsModerator()) throw new PageAction.PageActionException ("This page can only be edited by moderators"); wc.put ("PageName", wc.getForm ("edit")); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/63e182a593c47d9b882560d480b0bab109616dc8/EditPageAction.java/buggy/wiki/src/org/tcdi/opensource/wiki/servlet/EditPageAction.java
if (modes.isReadable()) {
if (modes.isReadable() && input != System.in) {
public void close() throws IOException, BadDescriptorException { if (!isOpen()) { throw new BadDescriptorException(); } isOpen = false; if (modes.isReadable()) { input.close(); } if (modes.isWriteable()) { output.close(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/24fc00ac9f647542a77f440ea686cea2d209f347/IOHandlerUnseekable.java/buggy/src/org/jruby/util/IOHandlerUnseekable.java
if (modes.isWriteable()) {
if (modes.isWriteable() && output != System.out && output != System.err) {
public void close() throws IOException, BadDescriptorException { if (!isOpen()) { throw new BadDescriptorException(); } isOpen = false; if (modes.isReadable()) { input.close(); } if (modes.isWriteable()) { output.close(); } }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/24fc00ac9f647542a77f440ea686cea2d209f347/IOHandlerUnseekable.java/buggy/src/org/jruby/util/IOHandlerUnseekable.java
lStream = (RubyIO) ruby.getGlobalVariables().get("$stderr"); lStream.reopen(new RubyIO(ruby, out), null);
ruby.getGlobalVariables().set("$stderr", lStream);
protected String eval(String script) throws Exception { ByteArrayOutputStream result = new ByteArrayOutputStream(); out = new PrintStream(result); RubyIO lStream = new RubyIO(ruby, out); ruby.getGlobalVariables().set("$stdout", lStream); ruby.getGlobalVariables().set("$>", lStream); lStream = (RubyIO) ruby.getGlobalVariables().get("$stderr"); lStream.reopen(new RubyIO(ruby, out), null); ruby.loadScript("test", new StringReader(script), false); StringBuffer sb = new StringBuffer(new String(result.toByteArray())); for (int idx = sb.indexOf("\n"); idx != -1; idx = sb.indexOf("\n")) { sb.deleteCharAt(idx); } return sb.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e861cae108c2a87229f94b4f781699719c6ced9/TestRubyBase.java/clean/test/org/jruby/test/TestRubyBase.java
protected String eval(String script) throws Exception { ByteArrayOutputStream result = new ByteArrayOutputStream(); out = new PrintStream(result); RubyIO lStream = new RubyIO(ruby, out); ruby.getGlobalVariables().set("$stdout", lStream); ruby.getGlobalVariables().set("$>", lStream); lStream = (RubyIO) ruby.getGlobalVariables().get("$stderr"); lStream.reopen(new RubyIO(ruby, out), null); ruby.loadScript("test", new StringReader(script), false); StringBuffer sb = new StringBuffer(new String(result.toByteArray())); for (int idx = sb.indexOf("\n"); idx != -1; idx = sb.indexOf("\n")) { sb.deleteCharAt(idx); } return sb.toString(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/8e861cae108c2a87229f94b4f781699719c6ced9/TestRubyBase.java/clean/test/org/jruby/test/TestRubyBase.java
objectClass.defineMethod("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", IRubyObject.class));
objectClass.defineMethod("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing"));
public static void createObjectClass(RubyModule objectClass) { objectClass.defineMethod("==", CallbackFactory.getMethod(RubyObject.class, "equal", IRubyObject.class)); objectClass.defineMethod("=~", CallbackFactory.getFalseMethod(1)); objectClass.defineMethod("clone", CallbackFactory.getMethod(RubyObject.class, "rbClone")); objectClass.defineMethod("dup", CallbackFactory.getMethod(RubyObject.class, "dup")); objectClass.defineMethod("eql?", CallbackFactory.getMethod(RubyObject.class, "equal", IRubyObject.class)); objectClass.defineMethod("respond_to?", CallbackFactory.getOptMethod(RubyObject.class, "respond_to")); objectClass.defineMethod("extend", CallbackFactory.getOptMethod(RubyObject.class, "extend")); objectClass.defineMethod("freeze", CallbackFactory.getMethod(RubyObject.class, "freeze")); objectClass.defineMethod("frozen?", CallbackFactory.getMethod(RubyObject.class, "frozen")); objectClass.defineMethod("id", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("hash", CallbackFactory.getMethod(RubyObject.class, "hash")); objectClass.defineMethod("__id__", CallbackFactory.getMethod(RubyObject.class, "id")); objectClass.defineMethod("inspect", CallbackFactory.getMethod(RubyObject.class, "inspect")); objectClass.defineMethod("instance_eval", CallbackFactory.getOptMethod(RubyObject.class, "instance_eval")); objectClass.defineMethod("instance_of?", CallbackFactory.getMethod(RubyObject.class, "instance_of", RubyModule.class)); objectClass.defineMethod("instance_variables", CallbackFactory.getMethod(RubyObject.class, "instance_variables")); objectClass.defineMethod("is_a?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("kind_of?", CallbackFactory.getMethod(RubyObject.class, "kind_of", RubyModule.class)); objectClass.defineMethod("method", CallbackFactory.getMethod(RubyObject.class, "method", IRubyObject.class)); objectClass.defineMethod("methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("nil?", CallbackFactory.getFalseMethod(0)); objectClass.defineMethod("private_methods", CallbackFactory.getMethod(RubyObject.class, "private_methods")); objectClass.defineMethod("protected_methods", CallbackFactory.getMethod(RubyObject.class, "protected_methods")); objectClass.defineMethod("public_methods", CallbackFactory.getMethod(RubyObject.class, "methods")); objectClass.defineMethod("send", CallbackFactory.getOptMethod(RubyObject.class, "send", IRubyObject.class)); objectClass.defineMethod("__send__", CallbackFactory.getOptMethod(RubyObject.class, "send", IRubyObject.class)); objectClass.defineMethod("taint", CallbackFactory.getMethod(RubyObject.class, "taint")); objectClass.defineMethod("tainted?", CallbackFactory.getMethod(RubyObject.class, "tainted")); objectClass.defineMethod("to_a", CallbackFactory.getMethod(RubyObject.class, "to_a")); objectClass.defineMethod("to_s", CallbackFactory.getMethod(RubyObject.class, "to_s")); objectClass.defineMethod("type", CallbackFactory.getMethod(RubyObject.class, "type")); objectClass.defineMethod("untaint", CallbackFactory.getMethod(RubyObject.class, "untaint")); objectClass.defineMethod("method_missing", CallbackFactory.getOptMethod(RubyObject.class, "method_missing", IRubyObject.class)); objectClass.defineAlias("===", "=="); objectClass.defineAlias("class", "type"); objectClass.defineAlias("equal?", "=="); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cfb1b4132c30e5186c41e9dbf0b92acca72fcf81/RubyObject.java/buggy/org/jruby/RubyObject.java
public IRubyObject method_missing(IRubyObject symbol, IRubyObject[] args) { throw new NameError(getRuntime(), "Undefined local variable or method '" + symbol.toId() + "' for " + inspect().getValue());
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw new ArgumentError(getRuntime(), "no id given"); } String name = args[0].toId(); String description = callMethod("inspect").toString(); boolean noClass = description.charAt(0) == '#'; if (isNil()) { noClass = true; description = "nil"; } else if (this == ruby.getTrue()) { noClass = true; description = "true"; } else if (this == ruby.getFalse()) { noClass = true; description = "false"; } String format = "Undefined method '%s' for %s%s%s"; if (ruby.getLastCallStatus().isPrivate()) { format = "private method '%s' called for %s%s%s"; } else if (ruby.getLastCallStatus().isProtected()) { format = "protected method '%s' called for %s%s%s"; } else if (ruby.getLastCallStatus().isVariable()) { if (IdUtil.isLocal(name)) { format = "Undefined local variable or method '%s' for %s%s%s"; } } String msg = new PrintfFormat(format).sprintf( new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().toName()}); ruby.getFrameStack().push(ruby.getFrameStack().getPrevious()); try { throw new NameError(getRuntime(), msg); } finally { ruby.getFrameStack().pop(); }
public IRubyObject method_missing(IRubyObject symbol, IRubyObject[] args) { throw new NameError(getRuntime(), "Undefined local variable or method '" + symbol.toId() + "' for " + inspect().getValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cfb1b4132c30e5186c41e9dbf0b92acca72fcf81/RubyObject.java/buggy/org/jruby/RubyObject.java
JAnnotation annotation = property.getAnnotation("org.xbean.Alias");
JAnnotation annotation = property.getAnnotation(PROPERTY_ANNOTATION);
protected void generatePropertiesFilePropertyAlias(PrintWriter out, String namespace, SchemaElement element, JProperty property) { JAnnotation annotation = property.getAnnotation("org.xbean.Alias"); if (annotation != null) { String text = getStringValue(annotation, "value"); if (text != null) { String name = decapitalise(property.getSimpleName()); out.println(element.getLocalName() + "." + text + " = " +name); } } }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/b05052e52d5df78c860e248c9008c7e71be70d95/SchemaGenerator.java/clean/spring/src/java/org/xbean/spring/task/SchemaGenerator.java
String text = getStringValue(annotation, "value");
String text = getStringValue(annotation, "alias");
protected void generatePropertiesFilePropertyAlias(PrintWriter out, String namespace, SchemaElement element, JProperty property) { JAnnotation annotation = property.getAnnotation("org.xbean.Alias"); if (annotation != null) { String text = getStringValue(annotation, "value"); if (text != null) { String name = decapitalise(property.getSimpleName()); out.println(element.getLocalName() + "." + text + " = " +name); } } }
52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/b05052e52d5df78c860e248c9008c7e71be70d95/SchemaGenerator.java/clean/spring/src/java/org/xbean/spring/task/SchemaGenerator.java
checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); if (((ReadableByteChannel) channel).read(buffer) < 0) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret);
return sysread(length);
public String recv(int length) throws EOFException, BadDescriptorException, IOException { checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); if (((ReadableByteChannel) channel).read(buffer) < 0) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/404fdac0a79f1b57c3fb97914fbafb91618ca119/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java
boolean eof = false; while (buffer.hasRemaining()) { int bytesRead = ((ReadableByteChannel) channel).read(buffer); if (bytesRead < 0) { eof = true; break;
int bytes_read = 0; do { bytes_read = ((ReadableByteChannel) channel).read(buffer); if (bytes_read < 0) { throw new EOFException();
public String sysread(int length) throws EOFException, BadDescriptorException, IOException { checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); boolean eof = false; while (buffer.hasRemaining()) { int bytesRead = ((ReadableByteChannel) channel).read(buffer); if (bytesRead < 0) { eof = true; break; } if (bytesRead == 0) { // only should happen for nonblocking IO...break and allow the next call to try again break; } } if (buffer.position() == 0 && eof == true) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/404fdac0a79f1b57c3fb97914fbafb91618ca119/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java
if (bytesRead == 0) { break; } } if (buffer.position() == 0 && eof == true) { throw new EOFException(); }
} while (blocking && (bytes_read == 0));
public String sysread(int length) throws EOFException, BadDescriptorException, IOException { checkReadable(); checkBuffered(); ByteBuffer buffer = ByteBuffer.allocate(length); boolean eof = false; while (buffer.hasRemaining()) { int bytesRead = ((ReadableByteChannel) channel).read(buffer); if (bytesRead < 0) { eof = true; break; } if (bytesRead == 0) { // only should happen for nonblocking IO...break and allow the next call to try again break; } } if (buffer.position() == 0 && eof == true) { throw new EOFException(); } byte[] ret; if (buffer.hasRemaining()) { buffer.flip(); ret = new byte[buffer.remaining()]; buffer.get(ret); } else { ret = buffer.array(); } return RubyString.bytesToString(ret); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/404fdac0a79f1b57c3fb97914fbafb91618ca119/IOHandlerNio.java/clean/src/org/jruby/util/IOHandlerNio.java
Form (final HttpServletRequest r)
Form(final HttpServletRequest r)
Form (final HttpServletRequest r) { _request = r; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
final public Object get (String field)
final public Object get(String field)
final public Object get (String field) { try { return _request.getParameterValues(field)[0]; } catch (NullPointerException ne) { return null; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
return _request.getParameterValues(field)[0];
return values[0];
final public Object get (String field) { try { return _request.getParameterValues(field)[0]; } catch (NullPointerException ne) { return null; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
catch (ArrayIndexOutOfBoundsException e) { return null; }
final public Object get (String field) { try { return _request.getParameterValues(field)[0]; } catch (NullPointerException ne) { return null; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
final public Object[] getList (String field)
final public Object[] getList(String field)
final public Object[] getList (String field) { try { return _request.getParameterValues(field); } catch (NullPointerException ne) { return null; } }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
final public Object getPossibleForm (String strKey)
final public Object getPossibleForm(String strKey)
final public Object getPossibleForm (String strKey) { String strElement; Object obValue; Enumeration obEnumeration; //--- end of var's declaration ---// obValue = get(strKey); if (obValue == null) { obEnumeration = _request.getParameterNames(); while (obEnumeration.hasMoreElements()) { strElement = obEnumeration.nextElement().toString(); if (strElement.equalsIgnoreCase(strKey)) { obValue = get(strElement); break; } } } return obValue; }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
final public void put (String key, Object value)
final public void put(String key, Object value)
final public void put (String key, Object value) throws UnsettableException { throw new UnsettableException("Cannot set a form property"); }
52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/bc35d8a9d0ae8b2a47b1c1a5cfd579791e53fc98/Form.java/buggy/webmacro/src/org/webmacro/servlet/Form.java
}
}
void reverse(boolean b) { double yStart, yEnd; double xStaticStart, xStart; reverseIntensity = b; yEnd = endPt.getY(); yStart = startPt.getY(); setCursorOutputStart((int) yStart); setCursorOutputEnd((int) yEnd); manager.setOutputRectangles((int) yStart, (int) yEnd); xStaticStart = staticStartPt.getX(); xStart = startPt.getX(); startPt.setLocation(endPt.getX(), yStart); endPt.setLocation(xStart, yEnd); if (reverseIntensity) { if (type == QuantumFactory.EXPONENTIAL) { staticStartPt.setLocation(staticEndPt.getX(), yStart); staticEndPt.setLocation(xStaticStart, yEnd); controlPt.setLocation(controlPt.getX(), yEnd); repaintCurve(); } else { staticStartPt.setLocation((double) lS, yStart); staticEndPt.setLocation((double) leftBorder, yEnd); setControlLocation(coefficient); } } else { if (type == QuantumFactory.EXPONENTIAL) { staticStartPt.setLocation(staticEndPt.getX(), yStart); staticEndPt.setLocation(xStaticStart, yEnd); controlPt.setLocation(controlPt.getX(), yStart); repaintCurve(); } else { staticStartPt.setLocation((double) leftBorder, yStart); staticEndPt.setLocation((double) lS, yEnd); setControlLocation(coefficient); } } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5f198f3677f9aa6bbdd6719a3abfc6406f1479/GraphicsRepresentation.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/GraphicsRepresentation.java
range = lS2;
range = square/2;
void setControlsPoints(int t) { type = t; double xStaticEnd, xStaticStart, xEnd, xStart; xStaticEnd = 0; xStaticStart = 0; xEnd = 0; xStart = 0; if (type == QuantumFactory.EXPONENTIAL) { xControl = lS2; range = lS2; binMin = (int) ((square-40)/(2*rangeMinExpo)); binMax = (int) ((square-40)/(2*rangeMaxExpo)); if (reverseIntensity) { xStaticStart = (double) lS2; xStaticEnd = (double) leftBorder; xEnd = (endPt.getX()+leftBorder)/2; xStart = (startPt.getX()+leftBorder)/2; } else { xEnd = (endPt.getX()+leftBorder)/2; xStart = (startPt.getX()+leftBorder)/2; xStaticEnd = (double) lS2; xStaticStart = (double) leftBorder; } } else { xControl = lS; range = lS; double a; binMin = (int) (square/rangeMin); binMax = (int) (square/rangeMax); if (reverseIntensity) { a = (double) square/(staticStartPt.getX()-leftBorder); xStaticStart = (double) lS; xStaticEnd = (double) leftBorder; xEnd = a*(endPt.getX()-leftBorder)+leftBorder; xStart = a*(startPt.getX()-leftBorder)+leftBorder; } else { a = (double) square/(staticEndPt.getX()-leftBorder); xEnd = a*(endPt.getX()-leftBorder)+leftBorder; xStart = a*(startPt.getX()-leftBorder)+leftBorder; xStaticEnd = (double) lS; xStaticStart = (double) leftBorder; } } manager.setType(type, xControl); staticEndPt.setLocation(xStaticEnd, staticEndPt.getY()); staticStartPt.setLocation(xStaticStart, staticStartPt.getY()); endPt.setLocation(xEnd, endPt.getY()); startPt.setLocation(xStart, startPt.getY()); //Set Cursor location if (reverseIntensity) { setCursorStart((int) xEnd); setCursorEnd((int) xStart); manager.setInputRectangles((int) xEnd, (int) xStart); } else { setCursorStart((int) xStart); setCursorEnd((int) xEnd); manager.setInputRectangles((int) xStart, (int) xEnd); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5f198f3677f9aa6bbdd6719a3abfc6406f1479/GraphicsRepresentation.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/GraphicsRepresentation.java
range = lS;
range = square;
void setControlsPoints(int t) { type = t; double xStaticEnd, xStaticStart, xEnd, xStart; xStaticEnd = 0; xStaticStart = 0; xEnd = 0; xStart = 0; if (type == QuantumFactory.EXPONENTIAL) { xControl = lS2; range = lS2; binMin = (int) ((square-40)/(2*rangeMinExpo)); binMax = (int) ((square-40)/(2*rangeMaxExpo)); if (reverseIntensity) { xStaticStart = (double) lS2; xStaticEnd = (double) leftBorder; xEnd = (endPt.getX()+leftBorder)/2; xStart = (startPt.getX()+leftBorder)/2; } else { xEnd = (endPt.getX()+leftBorder)/2; xStart = (startPt.getX()+leftBorder)/2; xStaticEnd = (double) lS2; xStaticStart = (double) leftBorder; } } else { xControl = lS; range = lS; double a; binMin = (int) (square/rangeMin); binMax = (int) (square/rangeMax); if (reverseIntensity) { a = (double) square/(staticStartPt.getX()-leftBorder); xStaticStart = (double) lS; xStaticEnd = (double) leftBorder; xEnd = a*(endPt.getX()-leftBorder)+leftBorder; xStart = a*(startPt.getX()-leftBorder)+leftBorder; } else { a = (double) square/(staticEndPt.getX()-leftBorder); xEnd = a*(endPt.getX()-leftBorder)+leftBorder; xStart = a*(startPt.getX()-leftBorder)+leftBorder; xStaticEnd = (double) lS; xStaticStart = (double) leftBorder; } } manager.setType(type, xControl); staticEndPt.setLocation(xStaticEnd, staticEndPt.getY()); staticStartPt.setLocation(xStaticStart, staticStartPt.getY()); endPt.setLocation(xEnd, endPt.getY()); startPt.setLocation(xStart, startPt.getY()); //Set Cursor location if (reverseIntensity) { setCursorStart((int) xEnd); setCursorEnd((int) xStart); manager.setInputRectangles((int) xEnd, (int) xStart); } else { setCursorStart((int) xStart); setCursorEnd((int) xEnd); manager.setInputRectangles((int) xStart, (int) xEnd); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5f198f3677f9aa6bbdd6719a3abfc6406f1479/GraphicsRepresentation.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/GraphicsRepresentation.java
if (b) super.repaint();
if (b) repaint(0, tS+bottomBorder, width, bottomBorderSupp);
void updateInputEnd(int x, int xReal) { curEnd = "end: "+xReal; /* limit control b/c the method can be called via the histogram Dialog widget */ boolean b = true; /* control to synchronize the display of real value using the Histogram widget the user can still size the inputWindow but for graphics reasons the cursor in the curvePanel cannot be repainted (cf. limit control below.). */ int limit; if (reverseIntensity) limit = (int) endPt.getX()-triangleW; else limit = (int) startPt.getX()+triangleW; if (x >= limit) { setCursorEnd(x); b = false; if (reverseIntensity) startPt.setLocation((double) x, startPt.getY()); else endPt.setLocation((double) x, endPt.getY()); if (type == QuantumFactory.EXPONENTIAL) { if (reverseIntensity) controlPt.setLocation((double) x, endPt.getY()); else controlPt.setLocation((double) x, startPt.getY()); repaintCurve(); } else { setControlLocation(coefficient); } } //if (b) repaint(0, tS+bottomBorder, width, bottomBorderSupp); if (b) super.repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5f198f3677f9aa6bbdd6719a3abfc6406f1479/GraphicsRepresentation.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/GraphicsRepresentation.java
if (b) super.repaint();
if (b) repaint(0, tS+bottomBorder, width, bottomBorderSupp);
void updateInputStart(int x, int xReal) { curStart = "start: "+xReal; /* limit control b/c the method can be called via the histogram Dialog widget */ boolean b = true; /* control to synchronize the display of real value using the Histogram widget the user can still size the inputWindow but for graphics reasons the cursor in the curvePanel cannot be repainted (cf. limit control below.). */ int limit; if (reverseIntensity) limit = (int) startPt.getX()-triangleW; else limit = (int) endPt.getX()-triangleW; if (x <= limit) { xStartMax = x; b = false; setCursorStart(x); if (reverseIntensity) endPt.setLocation((double) x, endPt.getY()); else startPt.setLocation((double) x, startPt.getY()); if (type == QuantumFactory.EXPONENTIAL) repaintCurve(); else setControlLocation(coefficient); } //if (b) repaint(0, tS+bottomBorder, width, bottomBorderSupp); if (b) super.repaint(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/de5f198f3677f9aa6bbdd6719a3abfc6406f1479/GraphicsRepresentation.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/pane/GraphicsRepresentation.java
runtime.getGlobalVariables().set("$!", runtime.getNil());
if (!anotherExceptionRaised) runtime.getGlobalVariables().set("$!", globalExceptionState);
private static IRubyObject evalInternal(ThreadContext context, Node node, IRubyObject self) { IRuby runtime = context.getRuntime(); bigloop: do { if (node == null) return runtime.getNil(); switch (node.nodeId) { case NodeTypes.ALIASNODE: { AliasNode iVisited = (AliasNode) node; if (context.getRubyClass() == null) { throw runtime.newTypeError("no class to make alias"); } context.getRubyClass().defineAlias(iVisited.getNewName(), iVisited.getOldName()); context.getRubyClass().callMethod(context, "method_added", runtime.newSymbol(iVisited.getNewName())); return runtime.getNil(); } case NodeTypes.ANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.ARGSCATNODE: { ArgsCatNode iVisited = (ArgsCatNode) node; IRubyObject args = evalInternal(context, iVisited.getFirstNode(), self); IRubyObject secondArgs = splatValue(evalInternal(context, iVisited.getSecondNode(), self)); RubyArray list = args instanceof RubyArray ? (RubyArray) args : runtime.newArray(args); return list.concat(secondArgs); } // case NodeTypes.ARGSNODE: // EvaluateVisitor.argsNodeVisitor.execute(this, node); // break; // case NodeTypes.ARGUMENTNODE: // EvaluateVisitor.argumentNodeVisitor.execute(this, node); // break; case NodeTypes.ARRAYNODE: { ArrayNode iVisited = (ArrayNode) node; IRubyObject[] array = new IRubyObject[iVisited.size()]; int i = 0; for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node next = (Node) iterator.next(); array[i++] = evalInternal(context, next, self); } return runtime.newArray(array); } // case NodeTypes.ASSIGNABLENODE: // EvaluateVisitor.assignableNodeVisitor.execute(this, node); // break; case NodeTypes.BACKREFNODE: { BackRefNode iVisited = (BackRefNode) node; IRubyObject backref = context.getBackref(); switch (iVisited.getType()) { case '~': return backref; case '&': return RubyRegexp.last_match(backref); case '`': return RubyRegexp.match_pre(backref); case '\'': return RubyRegexp.match_post(backref); case '+': return RubyRegexp.match_last(backref); } break; } case NodeTypes.BEGINNODE: { BeginNode iVisited = (BeginNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.BIGNUMNODE: { BignumNode iVisited = (BignumNode) node; return RubyBignum.newBignum(runtime, iVisited.getValue()); } // case NodeTypes.BINARYOPERATORNODE: // EvaluateVisitor.binaryOperatorNodeVisitor.execute(this, node); // break; // case NodeTypes.BLOCKARGNODE: // EvaluateVisitor.blockArgNodeVisitor.execute(this, node); // break; case NodeTypes.BLOCKNODE: { BlockNode iVisited = (BlockNode) node; IRubyObject result = runtime.getNil(); for (Iterator iter = iVisited.iterator(); iter.hasNext();) { result = evalInternal(context, (Node) iter.next(), self); } return result; } case NodeTypes.BLOCKPASSNODE: { BlockPassNode iVisited = (BlockPassNode) node; IRubyObject proc = evalInternal(context, iVisited.getBodyNode(), self); if (proc.isNil()) { context.setNoBlock(); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearNoBlock(); } } // If not already a proc then we should try and make it one. if (!(proc instanceof RubyProc)) { proc = proc.convertToType("Proc", "to_proc", false); if (!(proc instanceof RubyProc)) { throw runtime.newTypeError("wrong argument type " + proc.getMetaClass().getName() + " (expected Proc)"); } } // TODO: Add safety check for taintedness Block block = (Block) context.getCurrentBlock(); if (block != null) { IRubyObject blockObject = block.getBlockObject(); // The current block is already associated with the proc. No need to create new // block for it. Just eval! if (blockObject != null && blockObject == proc) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } finally { context.clearBlockAvailable(); } } } context.preBlockPassEval(((RubyProc) proc).getBlock()); try { return evalInternal(context, iVisited.getIterNode(), self); } finally { context.postBlockPassEval(); } } case NodeTypes.BREAKNODE: { BreakNode iVisited = (BreakNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.BreakJump); je.setPrimaryData(result); je.setSecondaryData(node); throw je; } case NodeTypes.CALLNODE: { CallNode iVisited = (CallNode) node; IterNode iterNode = iVisited.getIterNode(); IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); assert receiver.getMetaClass() != null : receiver.getClass().getName(); // If reciever is self then we do the call the same way as vcall CallType callType = (receiver == self ? CallType.VARIABLE : CallType.NORMAL); // if no block passed, do a simple call if (iterNode == null) { return receiver.callMethod(context, iVisited.getName(), args, callType); } // if block passed, prepare the block and then do the call, handling breaks and retries correctly context.preIterEval(Block.createBlock(context, iterNode.getVarNode(), new DynamicScope(iterNode.getScope(), context.getCurrentScope()), iterNode.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return receiver.callMethod(context, iVisited.getName(), args, callType); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.CASENODE: { CaseNode iVisited = (CaseNode) node; IRubyObject expression = null; if (iVisited.getCaseNode() != null) { expression = evalInternal(context, iVisited.getCaseNode(), self); } context.pollThreadEvents(); IRubyObject result = runtime.getNil(); Node firstWhenNode = iVisited.getFirstWhenNode(); while (firstWhenNode != null) { if (!(firstWhenNode instanceof WhenNode)) { node = firstWhenNode; continue bigloop; } WhenNode whenNode = (WhenNode) firstWhenNode; if (whenNode.getExpressionNodes() instanceof ArrayNode) { for (Iterator iter = ((ArrayNode) whenNode.getExpressionNodes()).iterator(); iter .hasNext();) { Node tag = (Node) iter.next(); context.setPosition(tag.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // Ruby grammar has nested whens in a case body because of // productions case_body and when_args. if (tag instanceof WhenNode) { RubyArray expressions = (RubyArray) evalInternal(context, ((WhenNode) tag) .getExpressionNodes(), self); for (int j = 0; j < expressions.getLength(); j++) { IRubyObject condition = expressions.entry(j); if ((expression != null && condition.callMethod(context, "===", expression) .isTrue()) || (expression == null && condition.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } continue; } result = evalInternal(context, tag, self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = whenNode.getBodyNode(); continue bigloop; } } } else { result = evalInternal(context, whenNode.getExpressionNodes(), self); if ((expression != null && result.callMethod(context, "===", expression).isTrue()) || (expression == null && result.isTrue())) { node = ((WhenNode) firstWhenNode).getBodyNode(); continue bigloop; } } context.pollThreadEvents(); firstWhenNode = whenNode.getNextCase(); } return runtime.getNil(); } case NodeTypes.CLASSNODE: { ClassNode iVisited = (ClassNode) node; Node superNode = iVisited.getSuperNode(); RubyClass superClass = superNode == null ? null : (RubyClass) evalInternal(context, superNode, self); Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingClass = getEnclosingModule(context, classNameNode, self); RubyClass rubyClass = enclosingClass.defineOrGetClassUnder(name, superClass); if (context.getWrapper() != null) { rubyClass.extendObject(context.getWrapper()); rubyClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), rubyClass, self); } case NodeTypes.CLASSVARASGNNODE: { ClassVarAsgnNode iVisited = (ClassVarAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule) rubyClass.getInstanceVariable("__attached__"); } rubyClass.setClassVar(iVisited.getName(), result); return result; } case NodeTypes.CLASSVARDECLNODE: { ClassVarDeclNode iVisited = (ClassVarDeclNode) node; // FIXME: shouldn't we use cref here? if (context.getRubyClass() == null) { throw runtime.newTypeError("no class/module to define class variable"); } IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); ((RubyModule) context.peekCRef().getValue()).setClassVar(iVisited.getName(), result); return runtime.getNil(); } case NodeTypes.CLASSVARNODE: { ClassVarNode iVisited = (ClassVarNode) node; RubyModule rubyClass = (RubyModule) context.peekCRef().getValue(); if (rubyClass == null) { rubyClass = self.getMetaClass(); } else if (rubyClass.isSingleton()) { rubyClass = (RubyModule)rubyClass.getInstanceVariable("__attached__"); } return rubyClass.getClassVar(iVisited.getName()); } case NodeTypes.COLON2NODE: { Colon2Node iVisited = (Colon2Node) node; Node leftNode = iVisited.getLeftNode(); // TODO: Made this more colon3 friendly because of cpath production // rule in grammar (it is convenient to think of them as the same thing // at a grammar level even though evaluation is). if (leftNode == null) { return runtime.getObject().getConstantFrom(iVisited.getName()); } else { IRubyObject result = evalInternal(context, iVisited.getLeftNode(), self); if (result instanceof RubyModule) { return ((RubyModule) result).getConstantFrom(iVisited.getName()); } else { return result.callMethod(context, iVisited.getName()); } } } case NodeTypes.COLON3NODE: { Colon3Node iVisited = (Colon3Node) node; return runtime.getObject().getConstantFrom(iVisited.getName()); } case NodeTypes.CONSTDECLNODE: { ConstDeclNode iVisited = (ConstDeclNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); IRubyObject module; if (iVisited.getPathNode() != null) { module = evalInternal(context, iVisited.getPathNode(), self); } else { // FIXME: why do we check RubyClass and then use CRef? if (context.getRubyClass() == null) { // TODO: wire into new exception handling mechanism throw runtime.newTypeError("no class/module to define constant"); } module = (RubyModule) context.peekCRef().getValue(); } // FIXME: shouldn't we use the result of this set in setResult? ((RubyModule) module).setConstant(iVisited.getName(), result); return result; } case NodeTypes.CONSTNODE: { ConstNode iVisited = (ConstNode) node; return context.getConstant(iVisited.getName()); } case NodeTypes.DASGNNODE: { DAsgnNode iVisited = (DAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("DSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.DEFINEDNODE: { DefinedNode iVisited = (DefinedNode) node; String definition = getDefinition(context, iVisited.getExpressionNode(), self); if (definition != null) { return runtime.newString(definition); } else { return runtime.getNil(); } } case NodeTypes.DEFNNODE: { DefnNode iVisited = (DefnNode) node; RubyModule containingClass = context.getRubyClass(); if (containingClass == null) { throw runtime.newTypeError("No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getObject() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = context.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); containingClass.addMethod(name, newMethod); if (context.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod( name, new WrapperCallable(containingClass.getSingletonClass(), newMethod, Visibility.PUBLIC)); containingClass.callMethod(context, "singleton_method_added", runtime.newSymbol(name)); } // 'class << state.self' and 'class << obj' uses defn as opposed to defs if (containingClass.isSingleton()) { ((MetaClass) containingClass).getAttachedObject().callMethod( context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); } else { containingClass.callMethod(context, "method_added", runtime.newSymbol(name)); } return runtime.getNil(); } case NodeTypes.DEFSNODE: { DefsNode iVisited = (DefsNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass rubyClass; if (receiver.isNil()) { rubyClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { rubyClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { rubyClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure; can't define singleton method."); } if (receiver.isFrozen()) { throw runtime.newFrozenError("object"); } if (!receiver.singletonMethodsAllowed()) { throw runtime.newTypeError("can't define singleton method \"" + iVisited.getName() + "\" for " + receiver.getType()); } rubyClass = receiver.getSingletonClass(); } if (runtime.getSafeLevel() >= 4) { ICallable method = (ICallable) rubyClass.getMethods().get(iVisited.getName()); if (method != null) { throw runtime.newSecurityError("Redefining method prohibited."); } } DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), Visibility.PUBLIC, context.peekCRef()); rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); return runtime.getNil(); } case NodeTypes.DOTNODE: { DotNode iVisited = (DotNode) node; return RubyRange.newRange(runtime, evalInternal(context, iVisited.getBeginNode(), self), evalInternal(context, iVisited .getEndNode(), self), iVisited.isExclusive()); } case NodeTypes.DREGEXPNODE: { DRegexpNode iVisited = (DRegexpNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } return RubyRegexp.newRegexp(runtime, sb.toString(), iVisited.getOptions(), lang); } case NodeTypes.DSTRNODE: { DStrNode iVisited = (DStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newString(sb.toString()); } case NodeTypes.DSYMBOLNODE: { DSymbolNode iVisited = (DSymbolNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.getNode().iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return runtime.newSymbol(sb.toString()); } case NodeTypes.DVARNODE: { DVarNode iVisited = (DVarNode) node; // System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject obj = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); // FIXME: null check is removable once we figure out how to assign to unset named block args return obj == null ? runtime.getNil() : obj; } case NodeTypes.DXSTRNODE: { DXStrNode iVisited = (DXStrNode) node; StringBuffer sb = new StringBuffer(); for (Iterator iterator = iVisited.iterator(); iterator.hasNext();) { Node iterNode = (Node) iterator.next(); sb.append(evalInternal(context, iterNode, self).toString()); } return self.callMethod(context, "`", runtime.newString(sb.toString())); } case NodeTypes.ENSURENODE: { EnsureNode iVisited = (EnsureNode) node; // save entering the try if there's nothing to ensure if (iVisited.getEnsureNode() != null) { IRubyObject result = runtime.getNil(); try { result = evalInternal(context, iVisited.getBodyNode(), self); } finally { evalInternal(context, iVisited.getEnsureNode(), self); } return result; } node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.EVSTRNODE: { EvStrNode iVisited = (EvStrNode) node; node = iVisited.getBody(); continue bigloop; } case NodeTypes.FALSENODE: { context.pollThreadEvents(); return runtime.getFalse(); } case NodeTypes.FCALLNODE: { FCallNode iVisited = (FCallNode) node; IterNode iterNode = iVisited.getIterNode(); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); // if no block passed, do a simple call if (iterNode == null) { return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } // if block passed, prepare the block and then do the call, handling breaks and retries correctly context.preIterEval(Block.createBlock(context, iterNode.getVarNode(), new DynamicScope(iterNode.getScope(), context.getCurrentScope()), iterNode.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return self.callMethod(context, iVisited.getName(), args, CallType.FUNCTIONAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.FIXNUMNODE: { FixnumNode iVisited = (FixnumNode) node; return iVisited.getFixnum(runtime); } case NodeTypes.FLIPNODE: { FlipNode iVisited = (FlipNode) node; IRubyObject result = runtime.getNil(); if (iVisited.isExclusive()) { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { result = evalInternal(context, iVisited.getBeginNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } else { if (!context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()).isTrue()) { if (evalInternal(context, iVisited.getBeginNode(), self).isTrue()) { context.getCurrentScope().setValue( iVisited.getIndex(), evalInternal(context, iVisited.getEndNode(), self).isTrue() ? runtime.getFalse() : runtime.getTrue(), iVisited.getDepth()); return runtime.getTrue(); } else { return runtime.getFalse(); } } else { if (evalInternal(context, iVisited.getEndNode(), self).isTrue()) { context.getCurrentScope().setValue(iVisited.getIndex(), runtime.getFalse(), iVisited.getDepth()); } return runtime.getTrue(); } } } case NodeTypes.FLOATNODE: { FloatNode iVisited = (FloatNode) node; return RubyFloat.newFloat(runtime, iVisited.getValue()); } case NodeTypes.FORNODE: { ForNode iVisited = (ForNode) node; // For nodes do not have to create an addition scope so we just pass null context.preForLoopEval(Block.createBlock(context, iVisited.getVarNode(), null, iVisited.getCallable(), self)); try { while (true) { try { ISourcePosition position = context.getPosition(); context.beginCallArgs(); IRubyObject recv = null; try { recv = evalInternal(context, iVisited.getIterNode(), self); } finally { context.setPosition(position); context.endCallArgs(); } return recv.callMethod(context, "each", IRubyObject.NULL_ARRAY, CallType.NORMAL); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // do nothing, allow loop to retry break; default: throw je; } } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postForLoopEval(); } } case NodeTypes.GLOBALASGNNODE: { GlobalAsgnNode iVisited = (GlobalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); runtime.getGlobalVariables().set(iVisited.getName(), result); return result; } case NodeTypes.GLOBALVARNODE: { GlobalVarNode iVisited = (GlobalVarNode) node; return runtime.getGlobalVariables().get(iVisited.getName()); } case NodeTypes.HASHNODE: { HashNode iVisited = (HashNode) node; Map hash = null; if (iVisited.getListNode() != null) { hash = new HashMap(iVisited.getListNode().size() / 2); for (Iterator iterator = iVisited.getListNode().iterator(); iterator.hasNext();) { // insert all nodes in sequence, hash them in the final instruction // KEY IRubyObject key = evalInternal(context, (Node) iterator.next(), self); IRubyObject value = evalInternal(context, (Node) iterator.next(), self); hash.put(key, value); } } if (hash == null) { return RubyHash.newHash(runtime); } return RubyHash.newHash(runtime, hash, runtime.getNil()); } case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; IRubyObject result = evalInternal(context, iVisited.getCondition(), self); if (result.isTrue()) { node = iVisited.getThenBody(); continue bigloop; } else { node = iVisited.getElseBody(); continue bigloop; } } case NodeTypes.INSTASGNNODE: { InstAsgnNode iVisited = (InstAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); self.setInstanceVariable(iVisited.getName(), result); return result; } case NodeTypes.INSTVARNODE: { InstVarNode iVisited = (InstVarNode) node; IRubyObject variable = self.getInstanceVariable(iVisited.getName()); return variable == null ? runtime.getNil() : variable; } // case NodeTypes.ISCOPINGNODE: // EvaluateVisitor.iScopingNodeVisitor.execute(this, node); // break; case NodeTypes.ITERNODE: { IterNode iVisited = (IterNode) node; // new-style handling of blocks, for nodes that support it // don't process the block until it's needed, to avoid nasty iter tricks if (iVisited.getIterNode() instanceof BlockAcceptingNode) { ((BlockAcceptingNode)iVisited.getIterNode()).setIterNode(iVisited); node = iVisited.getIterNode(); continue bigloop; } // otherwise do it the same as the old way context.preIterEval(Block.createBlock(context, iVisited.getVarNode(), new DynamicScope(iVisited.getScope(), context.getCurrentScope()), iVisited.getCallable(), self)); try { while (true) { try { context.setBlockAvailable(); return evalInternal(context, iVisited.getIterNode(), self); } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.RETRY: // allow loop to retry break; default: throw je; } } finally { context.clearBlockAvailable(); } } } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.BREAK: IRubyObject breakValue = (IRubyObject) je.getPrimaryData(); return breakValue == null ? runtime.getNil() : breakValue; default: throw je; } } finally { context.postIterEval(); } } case NodeTypes.LOCALASGNNODE: { LocalAsgnNode iVisited = (LocalAsgnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // System.out.println("LSetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth() + " and set " + result); context.getCurrentScope().setValue(iVisited.getIndex(), result, iVisited.getDepth()); return result; } case NodeTypes.LOCALVARNODE: { LocalVarNode iVisited = (LocalVarNode) node; //System.out.println("DGetting: " + iVisited.getName() + " at index " + iVisited.getIndex() + " and at depth " + iVisited.getDepth()); IRubyObject result = context.getCurrentScope().getValue(iVisited.getIndex(), iVisited.getDepth()); return result == null ? runtime.getNil() : result; } case NodeTypes.MATCH2NODE: { Match2Node iVisited = (Match2Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); return ((RubyRegexp) recv).match(value); } case NodeTypes.MATCH3NODE: { Match3Node iVisited = (Match3Node) node; IRubyObject recv = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = evalInternal(context, iVisited.getValueNode(), self); if (value instanceof RubyString) { return ((RubyRegexp) recv).match(value); } else { return value.callMethod(context, "=~", recv); } } case NodeTypes.MATCHNODE: { MatchNode iVisited = (MatchNode) node; return ((RubyRegexp) evalInternal(context, iVisited.getRegexpNode(), self)).match2(); } case NodeTypes.MODULENODE: { ModuleNode iVisited = (ModuleNode) node; Node classNameNode = iVisited.getCPath(); String name = ((INameNode) classNameNode).getName(); RubyModule enclosingModule = getEnclosingModule(context, classNameNode, self); if (enclosingModule == null) { throw runtime.newTypeError("no outer class/module"); } RubyModule module; if (enclosingModule == runtime.getObject()) { module = runtime.getOrCreateModule(name); } else { module = enclosingModule.defineModuleUnder(name); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), module, self); } case NodeTypes.MULTIPLEASGNNODE: { MultipleAsgnNode iVisited = (MultipleAsgnNode) node; return AssignmentVisitor.assign(context, self, iVisited, evalInternal(context, iVisited.getValueNode(), self), false); } case NodeTypes.NEWLINENODE: { NewlineNode iVisited = (NewlineNode) node; // something in here is used to build up ruby stack trace... context.setPosition(iVisited.getPosition()); if (isTrace(runtime)) { callTraceFunction(context, "line", self); } // TODO: do above but not below for additional newline nodes node = iVisited.getNextNode(); continue bigloop; } case NodeTypes.NEXTNODE: { NextNode iVisited = (NextNode) node; context.pollThreadEvents(); IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.NextJump); je.setPrimaryData(result); je.setSecondaryData(iVisited); //state.setCurrentException(je); throw je; } case NodeTypes.NILNODE: return runtime.getNil(); case NodeTypes.NOTNODE: { NotNode iVisited = (NotNode) node; IRubyObject result = evalInternal(context, iVisited.getConditionNode(), self); return result.isTrue() ? runtime.getFalse() : runtime.getTrue(); } case NodeTypes.NTHREFNODE: { NthRefNode iVisited = (NthRefNode) node; return RubyRegexp.nth_match(iVisited.getMatchNumber(), context.getBackref()); } case NodeTypes.OPASGNANDNODE: { BinaryOperatorNode iVisited = (BinaryOperatorNode) node; // add in reverse order IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) return result; node = iVisited.getSecondNode(); continue bigloop; } case NodeTypes.OPASGNNODE: { OpAsgnNode iVisited = (OpAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject value = receiver.callMethod(context, iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { return value; } value = evalInternal(context, iVisited.getValueNode(), self); } else { value = value.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited.getValueNode(), self)); } receiver.callMethod(context, iVisited.getVariableName() + "=", value); context.pollThreadEvents(); return value; } case NodeTypes.OPASGNORNODE: { OpAsgnOrNode iVisited = (OpAsgnOrNode) node; String def = getDefinition(context, iVisited.getFirstNode(), self); IRubyObject result = runtime.getNil(); if (def != null) { result = evalInternal(context, iVisited.getFirstNode(), self); } if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } case NodeTypes.OPELEMENTASGNNODE: { OpElementAsgnNode iVisited = (OpElementAsgnNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); IRubyObject[] args = setupArgs(context, iVisited.getArgsNode(), self); IRubyObject firstValue = receiver.callMethod(context, "[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { return firstValue; } firstValue = evalInternal(context, iVisited.getValueNode(), self); } else { firstValue = firstValue.callMethod(context, iVisited.getOperatorName(), evalInternal(context, iVisited .getValueNode(), self)); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; return receiver.callMethod(context, "[]=", expandedArgs); } case NodeTypes.OPTNNODE: { OptNNode iVisited = (OptNNode) node; IRubyObject result = runtime.getNil(); while (RubyKernel.gets(runtime.getTopSelf(), IRubyObject.NULL_ARRAY).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: // do nothing, this iteration restarts break; case JumpType.NEXT: // recheck condition break loop; case JumpType.BREAK: // end loop return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.ORNODE: { OrNode iVisited = (OrNode) node; IRubyObject result = evalInternal(context, iVisited.getFirstNode(), self); if (!result.isTrue()) { result = evalInternal(context, iVisited.getSecondNode(), self); } return result; } // case NodeTypes.POSTEXENODE: // EvaluateVisitor.postExeNodeVisitor.execute(this, node); // break; case NodeTypes.REDONODE: { context.pollThreadEvents(); // now used as an interpreter event JumpException je = new JumpException(JumpException.JumpType.RedoJump); je.setSecondaryData(node); throw je; } case NodeTypes.REGEXPNODE: { RegexpNode iVisited = (RegexpNode) node; String lang = null; int opts = iVisited.getOptions(); if((opts & 16) != 0) { // param n lang = "n"; } else if((opts & 48) != 0) { // param s lang = "s"; } else if((opts & 64) != 0) { // param s lang = "u"; } try { return RubyRegexp.newRegexp(runtime, iVisited.getPattern(), lang); } catch(java.util.regex.PatternSyntaxException e) { throw runtime.newSyntaxError(e.getMessage()); } } case NodeTypes.RESCUEBODYNODE: { RescueBodyNode iVisited = (RescueBodyNode) node; node = iVisited.getBodyNode(); continue bigloop; } case NodeTypes.RESCUENODE: { RescueNode iVisited = (RescueNode)node; RescuedBlock : while (true) { try { // Execute rescue block IRubyObject result = evalInternal(context, iVisited.getBodyNode(), self); // If no exception is thrown execute else block if (iVisited.getElseNode() != null) { if (iVisited.getRescueNode() == null) { runtime.getWarnings().warn(iVisited.getElseNode().getPosition(), "else without rescue is useless"); } result = evalInternal(context, iVisited.getElseNode(), self); } return result; } catch (RaiseException raiseJump) { RubyException raisedException = raiseJump.getException(); // TODO: Rubicon TestKernel dies without this line. A cursory glance implies we // falsely set $! to nil and this sets it back to something valid. This should // get fixed at the same time we address bug #1296484. runtime.getGlobalVariables().set("$!", raisedException); RescueBodyNode rescueNode = iVisited.getRescueNode(); while (rescueNode != null) { Node exceptionNodes = rescueNode.getExceptionNodes(); ListNode exceptionNodesList; if (exceptionNodes instanceof SplatNode) { exceptionNodesList = (ListNode) evalInternal(context, exceptionNodes, self); } else { exceptionNodesList = (ListNode) exceptionNodes; } if (isRescueHandled(context, raisedException, exceptionNodesList, self)) { try { return evalInternal(context, rescueNode, self); } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RetryJump) { // should be handled in the finally block below //state.runtime.getGlobalVariables().set("$!", state.runtime.getNil()); //state.threadContext.setRaisedException(null); continue RescuedBlock; } else { throw je; } } } rescueNode = rescueNode.getOptRescueNode(); } // no takers; bubble up throw raiseJump; } finally { // clear exception when handled or retried runtime.getGlobalVariables().set("$!", runtime.getNil()); } } } case NodeTypes.RETRYNODE: { context.pollThreadEvents(); JumpException je = new JumpException(JumpException.JumpType.RetryJump); throw je; } case NodeTypes.RETURNNODE: { ReturnNode iVisited = (ReturnNode) node; IRubyObject result = evalInternal(context, iVisited.getValueNode(), self); JumpException je = new JumpException(JumpException.JumpType.ReturnJump); je.setPrimaryData(iVisited.getTarget()); je.setSecondaryData(result); je.setTertiaryData(iVisited); throw je; } case NodeTypes.ROOTNODE: { RootNode iVisited = (RootNode) node; DynamicScope scope = iVisited.getScope(); // Serialization killed our dynamic scope. We can just create an empty one // since serialization cannot serialize an eval (which is the only thing // which is capable of having a non-empty dynamic scope). if (scope == null) { scope = new DynamicScope(iVisited.getStaticScope(), null); } // Each root node has a top-level scope that we need to push context.preRootNode(scope); // FIXME: Wire up BEGIN and END nodes try { return eval(context, iVisited.getBodyNode(), self); } finally { context.postRootNode(); } } case NodeTypes.SCLASSNODE: { SClassNode iVisited = (SClassNode) node; IRubyObject receiver = evalInternal(context, iVisited.getReceiverNode(), self); RubyClass singletonClass; if (receiver.isNil()) { singletonClass = runtime.getNilClass(); } else if (receiver == runtime.getTrue()) { singletonClass = runtime.getClass("TrueClass"); } else if (receiver == runtime.getFalse()) { singletonClass = runtime.getClass("FalseClass"); } else { if (runtime.getSafeLevel() >= 4 && !receiver.isTaint()) { throw runtime.newSecurityError("Insecure: can't extend object."); } singletonClass = receiver.getSingletonClass(); } if (context.getWrapper() != null) { singletonClass.extendObject(context.getWrapper()); singletonClass.includeModule(context.getWrapper()); } return evalClassDefinitionBody(context, iVisited.getScope(), iVisited.getBodyNode(), singletonClass, self); } case NodeTypes.SELFNODE: return self; case NodeTypes.SPLATNODE: { SplatNode iVisited = (SplatNode) node; return splatValue(evalInternal(context, iVisited.getValue(), self)); } //// case NodeTypes.STARNODE: //// EvaluateVisitor.starNodeVisitor.execute(this, node); //// break; case NodeTypes.STRNODE: { StrNode iVisited = (StrNode) node; return runtime.newString(iVisited.getValue()); } case NodeTypes.SUPERNODE: { SuperNode iVisited = (SuperNode) node; if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("Superclass method '" + name + "' disabled.", name); } context.beginCallArgs(); IRubyObject[] args = null; try { args = setupArgs(context, iVisited.getArgsNode(), self); } finally { context.endCallArgs(); } return context.callSuper(args); } case NodeTypes.SVALUENODE: { SValueNode iVisited = (SValueNode) node; return aValueSplat(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.SYMBOLNODE: { SymbolNode iVisited = (SymbolNode) node; return runtime.newSymbol(iVisited.getName()); } case NodeTypes.TOARYNODE: { ToAryNode iVisited = (ToAryNode) node; return aryToAry(evalInternal(context, iVisited.getValue(), self)); } case NodeTypes.TRUENODE: { context.pollThreadEvents(); return runtime.getTrue(); } case NodeTypes.UNDEFNODE: { UndefNode iVisited = (UndefNode) node; if (context.getRubyClass() == null) { throw runtime .newTypeError("No class to undef method '" + iVisited.getName() + "'."); } context.getRubyClass().undef(iVisited.getName()); return runtime.getNil(); } case NodeTypes.UNTILNODE: { UntilNode iVisited = (UntilNode) node; IRubyObject result = runtime.getNil(); while (!(result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { loop: while (true) { // Used for the 'redo' command try { result = evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return (IRubyObject) je.getPrimaryData(); default: throw je; } } } } return result; } case NodeTypes.VALIASNODE: { VAliasNode iVisited = (VAliasNode) node; runtime.getGlobalVariables().alias(iVisited.getNewName(), iVisited.getOldName()); return runtime.getNil(); } case NodeTypes.VCALLNODE: { VCallNode iVisited = (VCallNode) node; return self.callMethod(context, iVisited.getName(), IRubyObject.NULL_ARRAY, CallType.VARIABLE); } case NodeTypes.WHENNODE: assert false; return null; case NodeTypes.WHILENODE: { WhileNode iVisited = (WhileNode) node; IRubyObject result = runtime.getNil(); boolean firstTest = iVisited.evaluateAtStart(); while (!firstTest || (result = evalInternal(context, iVisited.getConditionNode(), self)).isTrue()) { firstTest = true; loop: while (true) { // Used for the 'redo' command try { evalInternal(context, iVisited.getBodyNode(), self); break loop; } catch (JumpException je) { switch (je.getJumpType().getTypeId()) { case JumpType.REDO: continue; case JumpType.NEXT: break loop; case JumpType.BREAK: return result; default: throw je; } } } } return result; } case NodeTypes.XSTRNODE: { XStrNode iVisited = (XStrNode) node; return self.callMethod(context, "`", runtime.newString(iVisited.getValue())); } case NodeTypes.YIELDNODE: { YieldNode iVisited = (YieldNode) node; IRubyObject result = evalInternal(context, iVisited.getArgsNode(), self); if (iVisited.getArgsNode() == null) { result = null; } return context.yieldCurrentBlock(result, null, null, iVisited.getCheckState()); } case NodeTypes.ZARRAYNODE: { return runtime.newArray(); } case NodeTypes.ZSUPERNODE: { if (context.getFrameLastClass() == null) { String name = context.getFrameLastFunc(); throw runtime.newNameError("superclass method '" + name + "' disabled", name); } return context.callSuper(context.getFrameArgs(), true); } } } while (true); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c020e7590a91dff92205546b4efb598482585345/EvaluationState.java/buggy/src/org/jruby/evaluator/EvaluationState.java
ConferenceUtils.autoJoinConferenceRoom(conferenceJID, conferenceJID, null);
Iterator iter = bookmarks.iterator(); while (iter.hasNext()) { Bookmark bookmark = (Bookmark)iter.next(); if (bookmark.getRoomJID().equals(conferenceJID)) { ConferenceUtils.autoJoinConferenceRoom(bookmark.getRoomName(), conferenceJID, null); } }
private void joinTaggedRooms(Collection autoJoins) { Iterator joins = autoJoins.iterator(); while (joins.hasNext()) { Element autoJoin = (Element)joins.next(); String conferenceJID = autoJoin.getText(); autoJoinRooms.add(conferenceJID); ConferenceUtils.autoJoinConferenceRoom(conferenceJID, conferenceJID, null); } }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/028cde13fc23ea5cbdaa0191963cf1624ef656d0/BookmarkedConferences.java/buggy/src/java/org/jivesoftware/spark/ui/conferences/BookmarkedConferences.java
private void setComponentsEnabled(boolean b)
void setComponentsEnabled(boolean b)
private void setComponentsEnabled(boolean b) { saveButton.setEnabled(b); deleteBox.setEnabled(b); annotationArea.setEditable(b); if (b) { annotationArea.requestFocus(); annotationArea.selectAll(); } }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fa3d7c2352dfbc9f73f26510e5aed556f4c86872/AnnotationPaneUI.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPaneUI.java
deleteBox.setSelected(false);
void showAnnotations() { ExperimenterData userDetails = model.getUserDetails(); if (userDetails == null) return; Map annotations = model.getAnnotations(); String[] owners = new String[annotations.size()]; Iterator i = annotations.keySet().iterator(); Long id; int index = 0; ownersMap = new HashMap(); List list; ExperimenterData data; while (i.hasNext()) { id = (Long) i.next(); list = (List) annotations.get(id); data = ((AnnotationData) list.get(0)).getOwner(); if (userDetails.getId() == id.intValue()) userIndex = index; owners[index] = data.getLastName(); ownersMap.put(new Integer(index), id); index++; } //No annotation for the current user, so allow creation. if (userIndex != -1) annotatedByList.setSelectedIndex(userIndex); setComponentsEnabled(true); formatUsersList(owners); annotatedByList.clearSelection(); annotatedByList.setSelectedIndex(userIndex); showSingleAnnotation(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/fa3d7c2352dfbc9f73f26510e5aed556f4c86872/AnnotationPaneUI.java/clean/SRC/org/openmicroscopy/shoola/agents/hiviewer/clipboard/annotator/AnnotationPaneUI.java
kernelModule.defineMethod("puts", new ReflectionCallbackMethod(RBKernel.class, "m_puts", RubyObject[].class, true, true)); kernelModule.defineMethod("print", new ReflectionCallbackMethod(RBKernel.class, "m_print", RubyObject[].class, true, true)); kernelModule.defineMethod("to_s", getMethodToS());
kernelModule.defineMethod("puts", getKernelMethod("m_puts")); kernelModule.defineMethod("print", getKernelMethod("m_print")); kernelModule.defineMethod("to_s", getObjectMethod("m_to_s")); kernelModule.defineModuleFunction("singleton_method_added", getDummyMethod());
public static RubyModule createKernelModule(Ruby ruby) { RubyModule kernelModule = ruby.defineModule("Kernel"); kernelModule.defineMethod("puts", new ReflectionCallbackMethod(RBKernel.class, "m_puts", RubyObject[].class, true, true)); kernelModule.defineMethod("print", new ReflectionCallbackMethod(RBKernel.class, "m_print", RubyObject[].class, true, true)); kernelModule.defineMethod("to_s", getMethodToS()); return kernelModule; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12847c6fd28fea4e223d132ced46eb1b4cb9de9a/RBKernel.java/buggy/org/jruby/core/RBKernel.java
public RubyObject execute(RubyObject recv, RubyObject args[], Ruby ruby) { return recv.m_to_s(); }
public RubyObject execute(RubyObject recv, RubyObject[] args, Ruby ruby) { return ruby.getNil(); }
public RubyObject execute(RubyObject recv, RubyObject args[], Ruby ruby) { return recv.m_to_s(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12847c6fd28fea4e223d132ced46eb1b4cb9de9a/RBKernel.java/buggy/org/jruby/core/RBKernel.java
} for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString());
} else { for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); }
public static RubyObject m_puts(Ruby ruby, RubyObject args[]) { if (args.length == 0) { System.out.println(); } for (int i = 0; i < args.length; i++) { if (args[i] != null) { System.out.println(((RubyString)args[i].funcall(ruby.intern("to_s"))).getString()); } } return ruby.getNil(); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/12847c6fd28fea4e223d132ced46eb1b4cb9de9a/RBKernel.java/buggy/org/jruby/core/RBKernel.java
}
}
public Set findCGCIHierarchies(final Set arg0) { // CONTRACT if (null == arg0 || arg0.size() == 0) { return new HashSet(); } List result = containerDao.findCGCIHierarchies(arg0); Set imagesAll = new HashSet(result); if (null == imagesAll || imagesAll.size() == 0) { return new HashSet(); } // LOGIC Set hierarchies = new HashSet(); Iterator i = imagesAll.iterator(); while (i.hasNext()) { Image img = (Image) i.next(); Set classifications = img.getClassifications(); Set categories = new HashSet(); for (Iterator c = classifications.iterator(); c.hasNext();) { Classification cla = (Classification) c.next(); if (cla.getValid().booleanValue()) { // TODO do this in query categories.add(cla.getCategory()); } } if (categories == null || categories.size() < 1) { hierarchies.add(img); } else { Iterator c = categories.iterator(); while (c.hasNext()) { // OPTIMAL TODO looping over get!! // ??? Integer cId = (Integer) c.next(); Category2 ca = new Category2();//containerDao.loadC(cId));// TODO hql if (null == ca.images) ca.images = new HashSet(); ca.images.add(img); Integer cgId = ca.getCategoryGroup(); // and HERE ?? // FIXME CategoryGroup2 cg = new CategoryGroup2();//containerDao.loadCG(cgId)); // not a // collection?? if (cg == null) { hierarchies.add(ca); } else { if (null == cg.categories) cg.categories = new HashSet(); cg.categories.add(ca); hierarchies.add(cg); } } } } return (Set) clean(hierarchies); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0dcf955580c9394058b7f3452a6050bc8c49e5a0/HierarchyBrowsingImpl.java/clean/components/server/src/org/openmicroscopy/omero/logic/HierarchyBrowsingImpl.java
pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml")));
File file = new File(destinationDir, "coverage.xml"); pw = new PrintWriter(new PrintStream(new FileOutputStream(file), false, "UTF-8"));
public XMLReport(ProjectData projectData, File destinationDir, FileFinder finder, ComplexityCalculator complexity) throws IOException { this.complexity = complexity; this.finder = finder; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/84e7aec08b6ae2534d7a85ebb3c07a0ec1dec0c8/XMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/xml/XMLReport.java
public IRubyObject at(IRubyObject obj) { return entry(RubyNumeric.numericValue(obj).getLongValue());
public IRubyObject at(RubyNumeric pos) { return entry(pos.getLongValue());
public IRubyObject at(IRubyObject obj) { return entry(RubyNumeric.numericValue(obj).getLongValue()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyArray.java/clean/src/org/jruby/RubyArray.java
arrayClass.defineMethod("at", callbackFactory.getMethod(RubyArray.class, "at", IRubyObject.class));
arrayClass.defineMethod("at", callbackFactory.getMethod(RubyArray.class, "at", RubyNumeric.class));
public static RubyClass createArrayClass(Ruby ruby) { RubyClass arrayClass = ruby.defineClass("Array", ruby.getClasses().getObjectClass()); arrayClass.includeModule(ruby.getModule("Enumerable")); CallbackFactory callbackFactory = ruby.callbackFactory(); arrayClass.defineSingletonMethod("new", callbackFactory.getOptSingletonMethod(RubyArray.class, "newInstance")); arrayClass.defineSingletonMethod("[]", callbackFactory.getOptSingletonMethod(RubyArray.class, "create")); arrayClass.defineMethod("initialize", callbackFactory.getOptMethod(RubyArray.class, "initialize")); arrayClass.defineMethod("inspect", callbackFactory.getMethod(RubyArray.class, "inspect")); arrayClass.defineMethod("to_s", callbackFactory.getMethod(RubyArray.class, "to_s")); arrayClass.defineMethod("to_a", callbackFactory.getSelfMethod(0)); arrayClass.defineMethod("to_ary", callbackFactory.getSelfMethod(0)); arrayClass.defineMethod("frozen?", callbackFactory.getMethod(RubyArray.class, "frozen")); arrayClass.defineMethod("==", callbackFactory.getMethod(RubyArray.class, "equal", IRubyObject.class)); arrayClass.defineMethod("eql?", callbackFactory.getMethod(RubyArray.class, "eql", IRubyObject.class)); arrayClass.defineMethod("===", callbackFactory.getMethod(RubyArray.class, "equal", IRubyObject.class)); arrayClass.defineMethod("hash", callbackFactory.getMethod(RubyArray.class, "hash")); arrayClass.defineMethod("[]", callbackFactory.getOptMethod(RubyArray.class, "aref")); arrayClass.defineMethod("[]=", callbackFactory.getOptMethod(RubyArray.class, "aset")); arrayClass.defineMethod("at", callbackFactory.getMethod(RubyArray.class, "at", IRubyObject.class)); arrayClass.defineMethod("first", callbackFactory.getMethod(RubyArray.class, "first")); arrayClass.defineMethod("last", callbackFactory.getMethod(RubyArray.class, "last")); arrayClass.defineMethod("concat", callbackFactory.getMethod(RubyArray.class, "concat", IRubyObject.class)); arrayClass.defineMethod("<<", callbackFactory.getMethod(RubyArray.class, "append", IRubyObject.class)); arrayClass.defineMethod("push", callbackFactory.getOptMethod(RubyArray.class, "push")); arrayClass.defineMethod("pop", callbackFactory.getMethod(RubyArray.class, "pop")); arrayClass.defineMethod("shift", callbackFactory.getMethod(RubyArray.class, "shift")); arrayClass.defineMethod("unshift", callbackFactory.getOptMethod(RubyArray.class, "unshift")); arrayClass.defineMethod("each", callbackFactory.getMethod(RubyArray.class, "each")); arrayClass.defineMethod("each_index", callbackFactory.getMethod(RubyArray.class, "each_index")); arrayClass.defineMethod("reverse_each", callbackFactory.getMethod(RubyArray.class, "reverse_each")); arrayClass.defineMethod("length", callbackFactory.getMethod(RubyArray.class, "length")); arrayClass.defineMethod("size", callbackFactory.getMethod(RubyArray.class, "length")); arrayClass.defineMethod("empty?", callbackFactory.getMethod(RubyArray.class, "empty_p")); arrayClass.defineMethod("index", callbackFactory.getMethod(RubyArray.class, "index", IRubyObject.class)); arrayClass.defineMethod("rindex", callbackFactory.getMethod(RubyArray.class, "rindex", IRubyObject.class)); arrayClass.defineMethod("indexes", callbackFactory.getOptMethod(RubyArray.class, "indices")); arrayClass.defineMethod("indices", callbackFactory.getOptMethod(RubyArray.class, "indices")); arrayClass.defineMethod("clone", callbackFactory.getMethod(RubyArray.class, "rbClone")); arrayClass.defineMethod("join", callbackFactory.getOptMethod(RubyArray.class, "join")); arrayClass.defineMethod("reverse", callbackFactory.getMethod(RubyArray.class, "reverse")); arrayClass.defineMethod("reverse!", callbackFactory.getMethod(RubyArray.class, "reverse_bang")); arrayClass.defineMethod("sort", callbackFactory.getMethod(RubyArray.class, "sort")); arrayClass.defineMethod("sort!", callbackFactory.getMethod(RubyArray.class, "sort_bang")); arrayClass.defineMethod("collect", callbackFactory.getMethod(RubyArray.class, "collect")); arrayClass.defineMethod("collect!", callbackFactory.getMethod(RubyArray.class, "collect_bang")); arrayClass.defineMethod("map!", callbackFactory.getMethod(RubyArray.class, "collect_bang")); arrayClass.defineMethod("filter", callbackFactory.getMethod(RubyArray.class, "collect_bang")); arrayClass.defineMethod("delete", callbackFactory.getMethod(RubyArray.class, "delete", IRubyObject.class)); arrayClass.defineMethod("delete_at", callbackFactory.getMethod(RubyArray.class, "delete_at", IRubyObject.class)); arrayClass.defineMethod("delete_if", callbackFactory.getMethod(RubyArray.class, "delete_if")); arrayClass.defineMethod("reject!", callbackFactory.getMethod(RubyArray.class, "reject_bang")); arrayClass.defineMethod("replace", callbackFactory.getMethod(RubyArray.class, "replace", IRubyObject.class)); arrayClass.defineMethod("clear", callbackFactory.getMethod(RubyArray.class, "clear")); arrayClass.defineMethod("fill", callbackFactory.getOptMethod(RubyArray.class, "fill")); arrayClass.defineMethod("include?", callbackFactory.getMethod(RubyArray.class, "include_p", IRubyObject.class)); arrayClass.defineMethod("<=>", callbackFactory.getMethod(RubyArray.class, "op_cmp", IRubyObject.class)); arrayClass.defineMethod("slice", callbackFactory.getOptMethod(RubyArray.class, "aref")); arrayClass.defineMethod("slice!", callbackFactory.getOptMethod(RubyArray.class, "slice_bang")); arrayClass.defineMethod("assoc", callbackFactory.getMethod(RubyArray.class, "assoc", IRubyObject.class)); arrayClass.defineMethod("rassoc", callbackFactory.getMethod(RubyArray.class, "rassoc", IRubyObject.class)); arrayClass.defineMethod("+", callbackFactory.getMethod(RubyArray.class, "op_plus", IRubyObject.class)); arrayClass.defineMethod("*", callbackFactory.getMethod(RubyArray.class, "op_times", IRubyObject.class)); arrayClass.defineMethod("-", callbackFactory.getMethod(RubyArray.class, "op_diff", IRubyObject.class)); arrayClass.defineMethod("&", callbackFactory.getMethod(RubyArray.class, "op_and", IRubyObject.class)); arrayClass.defineMethod("|", callbackFactory.getMethod(RubyArray.class, "op_or", IRubyObject.class)); arrayClass.defineMethod("uniq", callbackFactory.getMethod(RubyArray.class, "uniq")); arrayClass.defineMethod("uniq!", callbackFactory.getMethod(RubyArray.class, "uniq_bang")); arrayClass.defineMethod("compact", callbackFactory.getMethod(RubyArray.class, "compact")); arrayClass.defineMethod("compact!", callbackFactory.getMethod(RubyArray.class, "compact_bang")); arrayClass.defineMethod("flatten", callbackFactory.getMethod(RubyArray.class, "flatten")); arrayClass.defineMethod("flatten!", callbackFactory.getMethod(RubyArray.class, "flatten_bang")); arrayClass.defineMethod("nitems", callbackFactory.getMethod(RubyArray.class, "nitems")); arrayClass.defineMethod("pack", callbackFactory.getMethod(RubyArray.class, "pack", IRubyObject.class)); return arrayClass; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1c602493a83e2050f401fa6925ec7e9269b45e4e/RubyArray.java/clean/src/org/jruby/RubyArray.java
TI() { s1.add(r4); s1.add(r4_); r5.setRoi4ds(s1); s2.add(r3); s3.add(r3); r4.setRoi3ds(s2); r4_.setRoi3ds(s3); }
public TI(){ Roi5D h5 = new Roi5D(); Roi4D h4 = new Roi4D(); Roi4D h4_ = new Roi4D(); Roi3D h3 = new Roi3D(); Roi3D h3_ = new Roi3D(); Event ev = new Event(); s1.add(h4); s1.add(h4_); h5.setRoi4ds(s1); h5.setCreationEvent(ev); s2.add(h3); s3.add(r3); h4.setRoi3ds(s2); h4_.setRoi3ds(s3); r5 = (Roi5DRemote) new Model2IceMapper().mapWithReflection(h5); }
TI() { s1.add(r4); s1.add(r4_); r5.setRoi4ds(s1); s2.add(r3); s3.add(r3); r4.setRoi3ds(s2); r4_.setRoi3ds(s3); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/d075eea85d4fb93ed40f6b4f476d90a0bccaf12a/TI.java/clean/components/common/test/mono/TI.java
ccManager = new ColorChooserManager(this, hsbManager, rgba, v, index);
ccManager = new ColorChooserManager(this, hsbManager, rgba, index);
public ColorChooser(HSBPaneManager hsbManager, int[] rgba, int index) { super(hsbManager.getReferenceFrame(), "ColorChooser", true); int v = (int) (rgba[ALPHA]*100/255); Color c = new Color(rgba[RED], rgba[GREEN], rgba[BLUE], rgba[ALPHA]); ccManager = new ColorChooserManager(this, hsbManager, rgba, v, index); cp = new ColorPalette(ccManager); Container contentPane = super.getContentPane(); initButtons(); initSlider(v); initTextBoxes(rgba, v); initColorPanel(c); buildGUI(); contents.setSize(WIN_W, WIN_H); contentPane.add(contents); ccManager.attachListeners(); //setResizable(false); setSize(WIN_W+W_EXTRA, WIN_H+H_EXTRA); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5bb26faa9c073c259106cdbdd8e0f710624321f0/ColorChooser.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java
label.setBounds(2*BORDER+ColorPalette.WIDTH_PANEL+HSPACE, 15, 45, 10);
label.setBounds(2*BORDER+ColorPalette.WIDTH_PANEL+HSPACE, 15, 55, 10);
private JLabel buildLabel() { JLabel label = new JLabel("Preview"); label.setBounds(2*BORDER+ColorPalette.WIDTH_PANEL+HSPACE, 15, 45, 10); return label; }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5bb26faa9c073c259106cdbdd8e0f710624321f0/ColorChooser.java/clean/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooser.java
ColorChooserManager(ColorChooser view, int[] rgba, int alpha)
ColorChooserManager(ColorChooser view, HSBPaneManager hsbManager, int[] rgba, int alpha)
ColorChooserManager(ColorChooser view, int[] rgba, int alpha) { this.view = view; this.alpha = alpha; this.rgba = rgba; buildColor(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooserManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java
this.hsbManager = hsbManager;
ColorChooserManager(ColorChooser view, int[] rgba, int alpha) { this.view = view; this.alpha = alpha; this.rgba = rgba; buildColor(); }
54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0c2418384f5c30e274953927e006a71647a24f1b/ColorChooserManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/rnd/model/ColorChooserManager.java
return newRegexp(str.getRuntime(), str.getValue(), options, lang);
return newRegexp(str.getRuntime(), str.toString(), options, lang);
public static RubyRegexp newRegexp(RubyString str, int options, String lang) { return newRegexp(str.getRuntime(), str.getValue(), options, lang); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java
String repl = RubyString.stringValue(str).getValue();
String repl = RubyString.stringValue(str).toString();
public IRubyObject regsub(IRubyObject str, RubyMatchData match) { String repl = RubyString.stringValue(str).getValue(); StringBuffer sb = new StringBuffer(""); int pos = 0; int end = repl.length(); char c; IRubyObject ins; while (pos < end) { c = repl.charAt(pos++); if (c == '\\' && pos < end) { c = repl.charAt(pos++); switch (c) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : ins = match.group(c - '0'); break; case '&' : ins = match.group(0); break; case '`' : ins = match.pre_match(); break; case '\'' : ins = match.post_match(); break; case '+' : ins = match_last(match); break; case '\\' : sb.append(c); continue; default : sb.append('\\').append(c); continue; } if (!ins.isNil()) { sb.append(((RubyString) ins).getValue()); } } else { sb.append(c); } } return getRuntime().newString(sb.toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java
String str = RubyString.stringValue(target).getValue();
String str = RubyString.stringValue(target).toString();
public int search(IRubyObject target, int pos) { String str = RubyString.stringValue(target).getValue(); if (pos > str.length()) { return -1; } recompileIfNeeded(); // If nothing match then nil will be returned IRubyObject result = match(str, pos); getRuntime().getCurrentContext().setBackref(result); // If nothing match then -1 will be returned return result instanceof RubyMatchData ? ((RubyMatchData) result).matchStartPosition() : -1; }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java
return new RubyString(getRuntime(), toString());
return getRuntime().newString(toString());
public RubyString to_s() { return new RubyString(getRuntime(), toString()); }
50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyRegexp.java/clean/src/org/jruby/RubyRegexp.java
cl.show(mainPanel, tab.getActualText());
Component comp = getComponentInTab(tab); cl.show(mainPanel, Integer.toString(comp.hashCode()));
public void setSelectedTab(SparkTab tab) { CardLayout cl = (CardLayout)mainPanel.getLayout(); cl.show(mainPanel, tab.getActualText()); tab.setBoldWhenActive(isActiveButtonBold()); deselectAllTabsExcept(tab); tab.setSelected(true); fireTabSelected(tab, getSelectedComponent(), getIndex(tab)); }
52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/47bff7fdd91c90a93378d233575b70142cdc05d5/SparkTabbedPane.java/buggy/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTabbedPane.java