rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
public boolean isClassDefined(String id) { return false; | public boolean isClassDefined(String name) { return classes.getClassMap().get(name) != null; | public boolean isClassDefined(String id) { return false; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/Ruby.java/clean/org/jruby/Ruby.java |
} catch (BreakException bExcptn) { | /* catch (BreakException bExcptn) { | public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); Scope oldScope = (Scope)getScope().getTop(); getScope().setTop(tmpBlock.scope); // getScope().push(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } catch (BreakException bExcptn) { // +++ throw new ReturnException(getNil()); // --- } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); getScope().setTop(oldScope); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/Ruby.java/clean/org/jruby/Ruby.java |
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); Scope oldScope = (Scope)getScope().getTop(); getScope().setTop(tmpBlock.scope); // getScope().push(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } catch (BreakException bExcptn) { // +++ throw new ReturnException(getNil()); // --- } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); getScope().setTop(oldScope); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/Ruby.java/clean/org/jruby/Ruby.java |
||
public File findFile(File i2find) { | public File findFile(Ruby ruby, File i2find) { | public File findFile(File i2find) { RubyArray lLoadPath = (RubyArray) getGlobalVar("$:"); int lPathNb = lLoadPath.getLength(); String l2Find = i2find.getPath(); for (int i = 0; i < lPathNb; i++) { String lCurPath = ((RubyString) lLoadPath.entry(i)).getValue(); File lCurFile = new File(lCurPath + File.separatorChar + l2Find); if (lCurFile.exists()) { i2find = lCurFile; break; } } if (i2find.exists()) { return i2find; } else { throw new LoadError(ruby, "No such file to load -- " + i2find.getPath());// throw new RuntimeException("file " + i2find.getPath() + " can't be found!"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c2cc02999f957e5b4789133df1ab058f33a4a6cc/Ruby.java/buggy/org/jruby/Ruby.java |
public File findFile(File i2find) { RubyArray lLoadPath = (RubyArray) getGlobalVar("$:"); int lPathNb = lLoadPath.getLength(); String l2Find = i2find.getPath(); for (int i = 0; i < lPathNb; i++) { String lCurPath = ((RubyString) lLoadPath.entry(i)).getValue(); File lCurFile = new File(lCurPath + File.separatorChar + l2Find); if (lCurFile.exists()) { i2find = lCurFile; break; } } if (i2find.exists()) { return i2find; } else { throw new LoadError(ruby, "No such file to load -- " + i2find.getPath());// throw new RuntimeException("file " + i2find.getPath() + " can't be found!"); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c2cc02999f957e5b4789133df1ab058f33a4a6cc/Ruby.java/buggy/org/jruby/Ruby.java |
||
javaObjectClass.defineMethod("hash", CallbackFactory.getMethod(RubyJavaObject.class, "hash")); | public static RubyClass createJavaObjectClass(Ruby ruby) { RubyClass javaObjectClass = ruby.defineClass("JavaObject", ruby.getClasses().getObjectClass()); javaObjectClass.defineMethod("to_s", CallbackFactory.getMethod(RubyJavaObject.class, "to_s")); javaObjectClass.defineMethod("eql?", CallbackFactory.getMethod(RubyJavaObject.class, "equal")); javaObjectClass.defineMethod("==", CallbackFactory.getMethod(RubyJavaObject.class, "equal")); javaObjectClass.getRubyClass().undefMethod("new"); return javaObjectClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7f0907240b4b4a4379424377e971ed0ca23f1dcb/RubyJavaObject.java/clean/org/jruby/RubyJavaObject.java |
|
public SingletonReference(String name, Set patterns, String objectTypeName) { this.name = name; this.patterns = patterns; this.objectTypeName = objectTypeName; | public SingletonReference() { | public SingletonReference(String name, Set patterns, String objectTypeName) { this.name = name; this.patterns = patterns; this.objectTypeName = objectTypeName; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/clean/kernel/src/java/org/gbean/geronimo/SingletonReference.java |
public final String getName() { | public String getName() { | public final String getName() { return name; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/clean/kernel/src/java/org/gbean/geronimo/SingletonReference.java |
objectType = ClassLoading.loadClass(objectTypeName, serviceContext.getClassLoader()); | objectType = ClassLoading.loadClass(referenceType, serviceContext.getClassLoader()); | public synchronized final Object getObject() throws ClassNotFoundException { ServiceContext serviceContext = ServiceContextThreadLocal.get(); if (serviceContext == null) { throw new IllegalStateException("Service context has not been set"); } synchronized (this) { if (objectType == null) { objectType = ClassLoading.loadClass(objectTypeName, serviceContext.getClassLoader()); } } Set targets = ServiceInstanceUtil.getRunningTargets(serviceContext.getKernel(), patterns); if (targets.size() != 1) { throw new IllegalStateException("Invalid reference: name=" + name + ", targetCount=" + targets.size() + ", patterns=" + getPatternsText()); } // add a dependency on our target and create the proxy ObjectName target = (ObjectName) targets.iterator().next(); ProxyManager proxyManager = null; try { proxyManager = ProxyManager.findProxyManager(serviceContext.getKernel()); } catch (ServiceNotFoundException e) { throw new IllegalStateException("ProxyManger has not been loaded"); } try { return proxyManager.createProxy(target, objectType, this); } catch (ServiceNotFoundException e) { throw new IllegalStateException("Referenced object was unregistered before a proxy could be created: name=" + name + ", targetCount=" + targets.size() + ", patterns=" + getPatternsText()); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/clean/kernel/src/java/org/gbean/geronimo/SingletonReference.java |
objectType = ClassLoading.loadClass(objectTypeName, serviceContext.getClassLoader()); | objectType = ClassLoading.loadClass(referenceType, serviceContext.getClassLoader()); | public final Class getObjectType() { ServiceContext serviceContext = ServiceContextThreadLocal.get(); if (serviceContext == null) { throw new IllegalStateException("Service context has not been set"); } synchronized (this) { if (objectType == null) { try { objectType = ClassLoading.loadClass(objectTypeName, serviceContext.getClassLoader()); } catch (ClassNotFoundException e) { throw new IllegalStateException("Could not load singleton reference object type"); } } } return objectType; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SingletonReference.java/clean/kernel/src/java/org/gbean/geronimo/SingletonReference.java |
void createNodes(Set nodes, TreeImageDisplay newNode) | void createNodes(Set nodes, TreeImageDisplay newNode, TreeImageDisplay parentDisplay) | void createNodes(Set nodes, TreeImageDisplay newNode) { Iterator i = nodes.iterator(); TreeImageDisplay parent; List list; Iterator j; DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); buildEmptyNode(newNode); while (i.hasNext()) { parent = (TreeImageDisplay) i.next(); parent.addChildDisplay(newNode); list = sorter.sort(parent.getChildrenDisplay()); parent.removeAllChildren(); j = list.iterator(); while (j.hasNext()) dtm.insertNodeInto((TreeImageDisplay) j.next(), parent, parent.getChildCount()); dtm.reload(parent); expandNode(parent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3fc76f3da582f7d2ddc56be96259f52fdf92d68e/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java |
if (parent.equals(parentDisplay)) treeDisplay.setSelectionPath(new TreePath(newNode.getPath())); | void createNodes(Set nodes, TreeImageDisplay newNode) { Iterator i = nodes.iterator(); TreeImageDisplay parent; List list; Iterator j; DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); buildEmptyNode(newNode); while (i.hasNext()) { parent = (TreeImageDisplay) i.next(); parent.addChildDisplay(newNode); list = sorter.sort(parent.getChildrenDisplay()); parent.removeAllChildren(); j = list.iterator(); while (j.hasNext()) dtm.insertNodeInto((TreeImageDisplay) j.next(), parent, parent.getChildCount()); dtm.reload(parent); expandNode(parent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3fc76f3da582f7d2ddc56be96259f52fdf92d68e/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java |
|
void removeNodes(Set nodes) | void removeNodes(Set nodes, TreeImageDisplay parentDisplay) | void removeNodes(Set nodes) { Iterator i = nodes.iterator(); TreeImageDisplay node; TreeImageDisplay parent; DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); while (i.hasNext()) { node = (TreeImageDisplay) i.next(); parent = node.getParentDisplay(); parent.removeChildDisplay(node); parent.remove(node); dtm.reload(parent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3fc76f3da582f7d2ddc56be96259f52fdf92d68e/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java |
if (parent.equals(parentDisplay)) treeDisplay.setSelectionPath(new TreePath(parent.getPath())); | void removeNodes(Set nodes) { Iterator i = nodes.iterator(); TreeImageDisplay node; TreeImageDisplay parent; DefaultTreeModel dtm = (DefaultTreeModel) treeDisplay.getModel(); while (i.hasNext()) { node = (TreeImageDisplay) i.next(); parent = node.getParentDisplay(); parent.removeChildDisplay(node); parent.remove(node); dtm.reload(parent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3fc76f3da582f7d2ddc56be96259f52fdf92d68e/BrowserUI.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java |
|
return (l.equals(r)) ? TRUE : FALSE; | return (!l.equals(r)) ? TRUE : FALSE; | public Boolean compare(Object l, Object r) { return (l.equals(r)) ? TRUE : FALSE; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/54e28a1bfa1b157d0af4ad9ef30c49c956a11319/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java |
return ((o instanceof Integer) || o instanceof Long || o instanceof Short || o instanceof Byte); | return (o instanceof Number); | public static boolean isNumber(Object o) { return ((o instanceof Integer) || o instanceof Long || o instanceof Short || o instanceof Byte); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/54e28a1bfa1b157d0af4ad9ef30c49c956a11319/Expression.java/buggy/webmacro/src/org/webmacro/engine/Expression.java |
Callback const_set = new ReflectionCallbackMethod(RubyModule.class, "const_set", new Class[] { RubyObject.class, RubyObject.class }); | Callback const_set = CallbackFactory.getMethod(RubyModule.class, "const_set", RubyObject.class, RubyObject.class); | public static void createModuleClass(RubyClass moduleClass) {; Callback op_eqq = CallbackFactory.getMethod(RubyModule.class, "op_eqq", RubyObject.class); Callback op_cmp = CallbackFactory.getMethod(RubyModule.class, "op_cmp", RubyObject.class); Callback op_lt = CallbackFactory.getMethod(RubyModule.class, "op_lt", RubyObject.class); Callback op_le = CallbackFactory.getMethod(RubyModule.class, "op_le", RubyObject.class); Callback op_gt = CallbackFactory.getMethod(RubyModule.class, "op_gt", RubyObject.class); Callback op_ge = CallbackFactory.getMethod(RubyModule.class, "op_ge", RubyObject.class); Callback clone = CallbackFactory.getMethod(RubyModule.class, "rbClone"); Callback dup = CallbackFactory.getMethod(RubyModule.class, "dup"); Callback to_s = CallbackFactory.getMethod(RubyModule.class, "to_s"); Callback included_modules = CallbackFactory.getMethod(RubyModule.class, "included_modules"); Callback name = CallbackFactory.getMethod(RubyModule.class, "name"); Callback ancestors = CallbackFactory.getMethod(RubyModule.class, "ancestors"); Callback attr = CallbackFactory.getOptMethod(RubyModule.class, "attr", RubyObject.class); Callback attr_reader = CallbackFactory.getOptMethod(RubyModule.class, "attr_reader"); Callback attr_writer = CallbackFactory.getOptMethod(RubyModule.class, "attr_writer"); Callback attr_accessor = CallbackFactory.getOptMethod(RubyModule.class, "attr_accessor"); Callback newModule = CallbackFactory.getSingletonMethod(RubyModule.class, "newModule"); Callback initialize = CallbackFactory.getOptMethod(RubyModule.class, "initialize"); Callback instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback public_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback protected_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "protected_instance_methods"); Callback private_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "private_instance_methods"); Callback constants = CallbackFactory.getMethod(RubyModule.class, "constants"); Callback const_get = CallbackFactory.getMethod(RubyModule.class, "const_get", RubyObject.class); Callback const_set = new ReflectionCallbackMethod(RubyModule.class, "const_set", new Class[] { RubyObject.class, RubyObject.class }); Callback const_defined = CallbackFactory.getMethod(RubyModule.class, "const_defined", RubyObject.class); Callback class_variables = CallbackFactory.getMethod(RubyModule.class, "class_variables"); Callback remove_class_variable = CallbackFactory.getMethod(RubyModule.class, "remove_class_variable", RubyObject.class); Callback append_features = CallbackFactory.getMethod(RubyModule.class, "append_features", RubyModule.class); Callback extend_object = CallbackFactory.getMethod(RubyModule.class, "extend_object", RubyObject.class); Callback include = CallbackFactory.getOptMethod(RubyModule.class, "include"); Callback rbPublic = CallbackFactory.getOptMethod(RubyModule.class, "rbPublic"); Callback rbProtected = CallbackFactory.getOptMethod(RubyModule.class, "rbProtected"); Callback rbPrivate = CallbackFactory.getOptMethod(RubyModule.class, "rbPrivate"); Callback module_function = CallbackFactory.getOptMethod(RubyModule.class, "module_function"); Callback method_defined = CallbackFactory.getMethod(RubyModule.class, "method_defined", RubyObject.class); Callback public_class_method = CallbackFactory.getOptMethod(RubyModule.class, "public_class_method"); Callback private_class_method = CallbackFactory.getOptMethod(RubyModule.class, "private_class_method"); Callback module_eval = CallbackFactory.getOptMethod(RubyModule.class, "module_eval"); Callback remove_method = CallbackFactory.getMethod(RubyModule.class, "remove_method", RubyObject.class); Callback undef_method = CallbackFactory.getMethod(RubyModule.class, "undef_method", RubyObject.class); Callback alias_method = new ReflectionCallbackMethod(RubyModule.class, "alias_method", new Class[] { RubyObject.class, RubyObject.class }); moduleClass.defineMethod("===", op_eqq); moduleClass.defineMethod("<=>", op_cmp); moduleClass.defineMethod("<", op_lt); moduleClass.defineMethod("<=", op_le); moduleClass.defineMethod(">", op_gt); moduleClass.defineMethod(">=", op_ge); moduleClass.defineMethod("clone", clone); moduleClass.defineMethod("dup", dup); moduleClass.defineMethod("to_s", to_s); moduleClass.defineMethod("included_modules", included_modules); moduleClass.defineMethod("name", name); moduleClass.defineMethod("ancestors", ancestors); moduleClass.definePrivateMethod("attr", attr); moduleClass.definePrivateMethod("attr_reader", attr_reader); moduleClass.definePrivateMethod("attr_writer", attr_writer); moduleClass.definePrivateMethod("attr_accessor", attr_accessor); moduleClass.defineSingletonMethod("new", newModule); moduleClass.defineMethod("initialize", initialize); moduleClass.defineMethod("instance_methods", instance_methods); moduleClass.defineMethod("public_instance_methods", public_instance_methods); moduleClass.defineMethod("protected_instance_methods", protected_instance_methods); moduleClass.defineMethod("private_instance_methods", private_instance_methods); moduleClass.defineMethod("constants", constants); moduleClass.defineMethod("const_get", const_get); moduleClass.defineMethod("const_set", const_set); moduleClass.defineMethod("const_defined?", const_defined); moduleClass.definePrivateMethod("method_added", CallbackFactory.getNilMethod()); moduleClass.defineMethod("class_variables", class_variables); moduleClass.definePrivateMethod("remove_class_variable", remove_class_variable); moduleClass.definePrivateMethod("append_features", append_features); moduleClass.definePrivateMethod("extend_object", extend_object); moduleClass.definePrivateMethod("include", include); moduleClass.definePrivateMethod("public", rbPublic); moduleClass.definePrivateMethod("protected", rbProtected); moduleClass.definePrivateMethod("private", rbPrivate); moduleClass.definePrivateMethod("module_function", module_function); moduleClass.defineMethod("method_defined?", method_defined); moduleClass.defineMethod("public_class_method", public_class_method); moduleClass.defineMethod("private_class_method", private_class_method); moduleClass.defineMethod("module_eval", module_eval); moduleClass.defineMethod("class_eval", module_eval); moduleClass.defineMethod("remove_method", remove_method); moduleClass.defineMethod("undef_method", undef_method); moduleClass.defineMethod("alias_method", alias_method); /*rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);*/ moduleClass.defineSingletonMethod("nesting", CallbackFactory.getSingletonMethod(RubyModule.class, "nesting")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyModule.java/buggy/org/jruby/RubyModule.java |
Callback alias_method = new ReflectionCallbackMethod(RubyModule.class, "alias_method", new Class[] { RubyObject.class, RubyObject.class }); | Callback alias_method = CallbackFactory.getMethod(RubyModule.class, "alias_method", RubyObject.class, RubyObject.class); | public static void createModuleClass(RubyClass moduleClass) {; Callback op_eqq = CallbackFactory.getMethod(RubyModule.class, "op_eqq", RubyObject.class); Callback op_cmp = CallbackFactory.getMethod(RubyModule.class, "op_cmp", RubyObject.class); Callback op_lt = CallbackFactory.getMethod(RubyModule.class, "op_lt", RubyObject.class); Callback op_le = CallbackFactory.getMethod(RubyModule.class, "op_le", RubyObject.class); Callback op_gt = CallbackFactory.getMethod(RubyModule.class, "op_gt", RubyObject.class); Callback op_ge = CallbackFactory.getMethod(RubyModule.class, "op_ge", RubyObject.class); Callback clone = CallbackFactory.getMethod(RubyModule.class, "rbClone"); Callback dup = CallbackFactory.getMethod(RubyModule.class, "dup"); Callback to_s = CallbackFactory.getMethod(RubyModule.class, "to_s"); Callback included_modules = CallbackFactory.getMethod(RubyModule.class, "included_modules"); Callback name = CallbackFactory.getMethod(RubyModule.class, "name"); Callback ancestors = CallbackFactory.getMethod(RubyModule.class, "ancestors"); Callback attr = CallbackFactory.getOptMethod(RubyModule.class, "attr", RubyObject.class); Callback attr_reader = CallbackFactory.getOptMethod(RubyModule.class, "attr_reader"); Callback attr_writer = CallbackFactory.getOptMethod(RubyModule.class, "attr_writer"); Callback attr_accessor = CallbackFactory.getOptMethod(RubyModule.class, "attr_accessor"); Callback newModule = CallbackFactory.getSingletonMethod(RubyModule.class, "newModule"); Callback initialize = CallbackFactory.getOptMethod(RubyModule.class, "initialize"); Callback instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback public_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback protected_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "protected_instance_methods"); Callback private_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "private_instance_methods"); Callback constants = CallbackFactory.getMethod(RubyModule.class, "constants"); Callback const_get = CallbackFactory.getMethod(RubyModule.class, "const_get", RubyObject.class); Callback const_set = new ReflectionCallbackMethod(RubyModule.class, "const_set", new Class[] { RubyObject.class, RubyObject.class }); Callback const_defined = CallbackFactory.getMethod(RubyModule.class, "const_defined", RubyObject.class); Callback class_variables = CallbackFactory.getMethod(RubyModule.class, "class_variables"); Callback remove_class_variable = CallbackFactory.getMethod(RubyModule.class, "remove_class_variable", RubyObject.class); Callback append_features = CallbackFactory.getMethod(RubyModule.class, "append_features", RubyModule.class); Callback extend_object = CallbackFactory.getMethod(RubyModule.class, "extend_object", RubyObject.class); Callback include = CallbackFactory.getOptMethod(RubyModule.class, "include"); Callback rbPublic = CallbackFactory.getOptMethod(RubyModule.class, "rbPublic"); Callback rbProtected = CallbackFactory.getOptMethod(RubyModule.class, "rbProtected"); Callback rbPrivate = CallbackFactory.getOptMethod(RubyModule.class, "rbPrivate"); Callback module_function = CallbackFactory.getOptMethod(RubyModule.class, "module_function"); Callback method_defined = CallbackFactory.getMethod(RubyModule.class, "method_defined", RubyObject.class); Callback public_class_method = CallbackFactory.getOptMethod(RubyModule.class, "public_class_method"); Callback private_class_method = CallbackFactory.getOptMethod(RubyModule.class, "private_class_method"); Callback module_eval = CallbackFactory.getOptMethod(RubyModule.class, "module_eval"); Callback remove_method = CallbackFactory.getMethod(RubyModule.class, "remove_method", RubyObject.class); Callback undef_method = CallbackFactory.getMethod(RubyModule.class, "undef_method", RubyObject.class); Callback alias_method = new ReflectionCallbackMethod(RubyModule.class, "alias_method", new Class[] { RubyObject.class, RubyObject.class }); moduleClass.defineMethod("===", op_eqq); moduleClass.defineMethod("<=>", op_cmp); moduleClass.defineMethod("<", op_lt); moduleClass.defineMethod("<=", op_le); moduleClass.defineMethod(">", op_gt); moduleClass.defineMethod(">=", op_ge); moduleClass.defineMethod("clone", clone); moduleClass.defineMethod("dup", dup); moduleClass.defineMethod("to_s", to_s); moduleClass.defineMethod("included_modules", included_modules); moduleClass.defineMethod("name", name); moduleClass.defineMethod("ancestors", ancestors); moduleClass.definePrivateMethod("attr", attr); moduleClass.definePrivateMethod("attr_reader", attr_reader); moduleClass.definePrivateMethod("attr_writer", attr_writer); moduleClass.definePrivateMethod("attr_accessor", attr_accessor); moduleClass.defineSingletonMethod("new", newModule); moduleClass.defineMethod("initialize", initialize); moduleClass.defineMethod("instance_methods", instance_methods); moduleClass.defineMethod("public_instance_methods", public_instance_methods); moduleClass.defineMethod("protected_instance_methods", protected_instance_methods); moduleClass.defineMethod("private_instance_methods", private_instance_methods); moduleClass.defineMethod("constants", constants); moduleClass.defineMethod("const_get", const_get); moduleClass.defineMethod("const_set", const_set); moduleClass.defineMethod("const_defined?", const_defined); moduleClass.definePrivateMethod("method_added", CallbackFactory.getNilMethod()); moduleClass.defineMethod("class_variables", class_variables); moduleClass.definePrivateMethod("remove_class_variable", remove_class_variable); moduleClass.definePrivateMethod("append_features", append_features); moduleClass.definePrivateMethod("extend_object", extend_object); moduleClass.definePrivateMethod("include", include); moduleClass.definePrivateMethod("public", rbPublic); moduleClass.definePrivateMethod("protected", rbProtected); moduleClass.definePrivateMethod("private", rbPrivate); moduleClass.definePrivateMethod("module_function", module_function); moduleClass.defineMethod("method_defined?", method_defined); moduleClass.defineMethod("public_class_method", public_class_method); moduleClass.defineMethod("private_class_method", private_class_method); moduleClass.defineMethod("module_eval", module_eval); moduleClass.defineMethod("class_eval", module_eval); moduleClass.defineMethod("remove_method", remove_method); moduleClass.defineMethod("undef_method", undef_method); moduleClass.defineMethod("alias_method", alias_method); /*rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);*/ moduleClass.defineSingletonMethod("nesting", CallbackFactory.getSingletonMethod(RubyModule.class, "nesting")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyModule.java/buggy/org/jruby/RubyModule.java |
moduleClass.definePrivateMethod("method_added", CallbackFactory.getNilMethod()); | moduleClass.definePrivateMethod("method_added", CallbackFactory.getNilMethod(1)); | public static void createModuleClass(RubyClass moduleClass) {; Callback op_eqq = CallbackFactory.getMethod(RubyModule.class, "op_eqq", RubyObject.class); Callback op_cmp = CallbackFactory.getMethod(RubyModule.class, "op_cmp", RubyObject.class); Callback op_lt = CallbackFactory.getMethod(RubyModule.class, "op_lt", RubyObject.class); Callback op_le = CallbackFactory.getMethod(RubyModule.class, "op_le", RubyObject.class); Callback op_gt = CallbackFactory.getMethod(RubyModule.class, "op_gt", RubyObject.class); Callback op_ge = CallbackFactory.getMethod(RubyModule.class, "op_ge", RubyObject.class); Callback clone = CallbackFactory.getMethod(RubyModule.class, "rbClone"); Callback dup = CallbackFactory.getMethod(RubyModule.class, "dup"); Callback to_s = CallbackFactory.getMethod(RubyModule.class, "to_s"); Callback included_modules = CallbackFactory.getMethod(RubyModule.class, "included_modules"); Callback name = CallbackFactory.getMethod(RubyModule.class, "name"); Callback ancestors = CallbackFactory.getMethod(RubyModule.class, "ancestors"); Callback attr = CallbackFactory.getOptMethod(RubyModule.class, "attr", RubyObject.class); Callback attr_reader = CallbackFactory.getOptMethod(RubyModule.class, "attr_reader"); Callback attr_writer = CallbackFactory.getOptMethod(RubyModule.class, "attr_writer"); Callback attr_accessor = CallbackFactory.getOptMethod(RubyModule.class, "attr_accessor"); Callback newModule = CallbackFactory.getSingletonMethod(RubyModule.class, "newModule"); Callback initialize = CallbackFactory.getOptMethod(RubyModule.class, "initialize"); Callback instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback public_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "instance_methods"); Callback protected_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "protected_instance_methods"); Callback private_instance_methods = CallbackFactory.getOptMethod(RubyModule.class, "private_instance_methods"); Callback constants = CallbackFactory.getMethod(RubyModule.class, "constants"); Callback const_get = CallbackFactory.getMethod(RubyModule.class, "const_get", RubyObject.class); Callback const_set = new ReflectionCallbackMethod(RubyModule.class, "const_set", new Class[] { RubyObject.class, RubyObject.class }); Callback const_defined = CallbackFactory.getMethod(RubyModule.class, "const_defined", RubyObject.class); Callback class_variables = CallbackFactory.getMethod(RubyModule.class, "class_variables"); Callback remove_class_variable = CallbackFactory.getMethod(RubyModule.class, "remove_class_variable", RubyObject.class); Callback append_features = CallbackFactory.getMethod(RubyModule.class, "append_features", RubyModule.class); Callback extend_object = CallbackFactory.getMethod(RubyModule.class, "extend_object", RubyObject.class); Callback include = CallbackFactory.getOptMethod(RubyModule.class, "include"); Callback rbPublic = CallbackFactory.getOptMethod(RubyModule.class, "rbPublic"); Callback rbProtected = CallbackFactory.getOptMethod(RubyModule.class, "rbProtected"); Callback rbPrivate = CallbackFactory.getOptMethod(RubyModule.class, "rbPrivate"); Callback module_function = CallbackFactory.getOptMethod(RubyModule.class, "module_function"); Callback method_defined = CallbackFactory.getMethod(RubyModule.class, "method_defined", RubyObject.class); Callback public_class_method = CallbackFactory.getOptMethod(RubyModule.class, "public_class_method"); Callback private_class_method = CallbackFactory.getOptMethod(RubyModule.class, "private_class_method"); Callback module_eval = CallbackFactory.getOptMethod(RubyModule.class, "module_eval"); Callback remove_method = CallbackFactory.getMethod(RubyModule.class, "remove_method", RubyObject.class); Callback undef_method = CallbackFactory.getMethod(RubyModule.class, "undef_method", RubyObject.class); Callback alias_method = new ReflectionCallbackMethod(RubyModule.class, "alias_method", new Class[] { RubyObject.class, RubyObject.class }); moduleClass.defineMethod("===", op_eqq); moduleClass.defineMethod("<=>", op_cmp); moduleClass.defineMethod("<", op_lt); moduleClass.defineMethod("<=", op_le); moduleClass.defineMethod(">", op_gt); moduleClass.defineMethod(">=", op_ge); moduleClass.defineMethod("clone", clone); moduleClass.defineMethod("dup", dup); moduleClass.defineMethod("to_s", to_s); moduleClass.defineMethod("included_modules", included_modules); moduleClass.defineMethod("name", name); moduleClass.defineMethod("ancestors", ancestors); moduleClass.definePrivateMethod("attr", attr); moduleClass.definePrivateMethod("attr_reader", attr_reader); moduleClass.definePrivateMethod("attr_writer", attr_writer); moduleClass.definePrivateMethod("attr_accessor", attr_accessor); moduleClass.defineSingletonMethod("new", newModule); moduleClass.defineMethod("initialize", initialize); moduleClass.defineMethod("instance_methods", instance_methods); moduleClass.defineMethod("public_instance_methods", public_instance_methods); moduleClass.defineMethod("protected_instance_methods", protected_instance_methods); moduleClass.defineMethod("private_instance_methods", private_instance_methods); moduleClass.defineMethod("constants", constants); moduleClass.defineMethod("const_get", const_get); moduleClass.defineMethod("const_set", const_set); moduleClass.defineMethod("const_defined?", const_defined); moduleClass.definePrivateMethod("method_added", CallbackFactory.getNilMethod()); moduleClass.defineMethod("class_variables", class_variables); moduleClass.definePrivateMethod("remove_class_variable", remove_class_variable); moduleClass.definePrivateMethod("append_features", append_features); moduleClass.definePrivateMethod("extend_object", extend_object); moduleClass.definePrivateMethod("include", include); moduleClass.definePrivateMethod("public", rbPublic); moduleClass.definePrivateMethod("protected", rbProtected); moduleClass.definePrivateMethod("private", rbPrivate); moduleClass.definePrivateMethod("module_function", module_function); moduleClass.defineMethod("method_defined?", method_defined); moduleClass.defineMethod("public_class_method", public_class_method); moduleClass.defineMethod("private_class_method", private_class_method); moduleClass.defineMethod("module_eval", module_eval); moduleClass.defineMethod("class_eval", module_eval); moduleClass.defineMethod("remove_method", remove_method); moduleClass.defineMethod("undef_method", undef_method); moduleClass.defineMethod("alias_method", alias_method); /*rb_define_private_method(rb_cModule, "define_method", rb_mod_define_method, -1); rb_define_singleton_method(rb_cModule, "constants", rb_mod_s_constants, 0);*/ moduleClass.defineSingletonMethod("nesting", CallbackFactory.getSingletonMethod(RubyModule.class, "nesting")); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyModule.java/buggy/org/jruby/RubyModule.java |
if (coberturaFile.isClass() && shouldInstrument(coberturaFile.getPathname())) | if (coberturaFile.isClass() && classPattern.matches(coberturaFile.getPathname())) | private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.getPathname())) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.getPathname(), contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.getBaseDir(), relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception | private boolean addInstrumentationToArchive(CoberturaFile file, InputStream archive, OutputStream output) throws Exception | private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry) && shouldInstrument(entry.getName())) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumented entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
ZipEntry entry; while ((entry = archive.getNextEntry()) != null) | ZipInputStream zis = null; ZipOutputStream zos = null; try | private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry) && shouldInstrument(entry.getName())) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumented entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); if (isClass(entry) && shouldInstrument(entry.getName())) { ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); if (cv.isInstrumented()) { logger.debug("Putting instrumented entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); | zis = new ZipInputStream(archive); zos = new ZipOutputStream(output); return addInstrumentationToArchive(file, zis, zos); } finally { zis = (ZipInputStream)IOUtil.closeInputStream(zis); zos = (ZipOutputStream)IOUtil.closeOutputStream(zos); | private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry) && shouldInstrument(entry.getName())) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumented entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } | inputStream = IOUtil.closeInputStream(inputStream); | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } | outputStream = IOUtil.closeOutputStream(outputStream); | private void addInstrumentationToSingleClass(File file) { logger.debug("Instrumenting class " + file.getAbsolutePath()); InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (Throwable t) { logger.warn("Unable to instrument file " + file.getAbsolutePath(), t); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
addRegex(ignoreRegexes, args[++i]); | RegexUtil.addRegex(ignoreRegexes, args[++i]); | private void parseArguments(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Parse our parameters List filePaths = new ArrayList(); String baseDir = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = args[++i]; else if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { addRegex(ignoreRegexes, args[++i]); } else if (args[i].equals("--includeClasses")) { addRegex(includeClassesRegexes, args[++i]); } else if (args[i].equals("--excludeClasses")) { addRegex(excludeClassesRegexes, args[++i]); } else { CoberturaFile coberturaFile = new CoberturaFile(baseDir, args[i]); filePaths.add(coberturaFile); } } // Load coverage data if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); // Instrument classes System.out.println("Instrumenting " + filePaths.size() + " " + (filePaths.size() == 1 ? "file" : "files") + (destinationDirectory != null ? " to " + destinationDirectory.getAbsoluteFile() : "")); Iterator iter = filePaths.iterator(); while (iter.hasNext()) { CoberturaFile coberturaFile = (CoberturaFile)iter.next(); if (coberturaFile.isArchive()) { addInstrumentationToArchive(coberturaFile); } else { addInstrumentation(coberturaFile); } } // Save coverage data CoverageDataFileHandler.saveCoverageData(projectData, dataFile); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
addRegex(includeClassesRegexes, args[++i]); | classPattern.addIncludeClassesRegex(args[++i]); | private void parseArguments(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Parse our parameters List filePaths = new ArrayList(); String baseDir = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = args[++i]; else if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { addRegex(ignoreRegexes, args[++i]); } else if (args[i].equals("--includeClasses")) { addRegex(includeClassesRegexes, args[++i]); } else if (args[i].equals("--excludeClasses")) { addRegex(excludeClassesRegexes, args[++i]); } else { CoberturaFile coberturaFile = new CoberturaFile(baseDir, args[i]); filePaths.add(coberturaFile); } } // Load coverage data if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); // Instrument classes System.out.println("Instrumenting " + filePaths.size() + " " + (filePaths.size() == 1 ? "file" : "files") + (destinationDirectory != null ? " to " + destinationDirectory.getAbsoluteFile() : "")); Iterator iter = filePaths.iterator(); while (iter.hasNext()) { CoberturaFile coberturaFile = (CoberturaFile)iter.next(); if (coberturaFile.isArchive()) { addInstrumentationToArchive(coberturaFile); } else { addInstrumentation(coberturaFile); } } // Save coverage data CoverageDataFileHandler.saveCoverageData(projectData, dataFile); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
addRegex(excludeClassesRegexes, args[++i]); | classPattern.addExcludeClassesRegex(args[++i]); | private void parseArguments(String[] args) { File dataFile = CoverageDataFileHandler.getDefaultDataFile(); // Parse our parameters List filePaths = new ArrayList(); String baseDir = null; for (int i = 0; i < args.length; i++) { if (args[i].equals("--basedir")) baseDir = args[++i]; else if (args[i].equals("--datafile")) dataFile = new File(args[++i]); else if (args[i].equals("--destination")) destinationDirectory = new File(args[++i]); else if (args[i].equals("--ignore")) { addRegex(ignoreRegexes, args[++i]); } else if (args[i].equals("--includeClasses")) { addRegex(includeClassesRegexes, args[++i]); } else if (args[i].equals("--excludeClasses")) { addRegex(excludeClassesRegexes, args[++i]); } else { CoberturaFile coberturaFile = new CoberturaFile(baseDir, args[i]); filePaths.add(coberturaFile); } } // Load coverage data if (dataFile.isFile()) projectData = CoverageDataFileHandler.loadCoverageData(dataFile); if (projectData == null) projectData = new ProjectData(); // Instrument classes System.out.println("Instrumenting " + filePaths.size() + " " + (filePaths.size() == 1 ? "file" : "files") + (destinationDirectory != null ? " to " + destinationDirectory.getAbsoluteFile() : "")); Iterator iter = filePaths.iterator(); while (iter.hasNext()) { CoberturaFile coberturaFile = (CoberturaFile)iter.next(); if (coberturaFile.isArchive()) { addInstrumentationToArchive(coberturaFile); } else { addInstrumentation(coberturaFile); } } // Save coverage data CoverageDataFileHandler.saveCoverageData(projectData, dataFile); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/ea44d50de680cfb1f234670ee0209ccd6aa03416/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/instrument/Main.java |
IRubyObject[] newArgs = new IRubyObject[args.length + 1]; newArgs[0] = RubySymbol.newSymbol(getRuntime(), name); System.arraycopy(args, 0, newArgs, 1, args.length); return recv.callMethod("method_missing", newArgs); | return callMethodMissing(recv, name, args); | public final IRubyObject call(IRubyObject recv, String name, IRubyObject[] args, int scope) { if (args == null) { args = new IRubyObject[0]; } CacheEntry ent = getRuntime().getMethodCache().getEntry(this, name); if (ent == null) { ent = getMethodBody(name); } if (ent == null || ent.getMethod().isUndefined()) { if (scope == 3) { throw new NameError(ruby, "super: no superclass method '" + name + "'"); } IRubyObject[] newArgs = new IRubyObject[args.length + 1]; newArgs[0] = RubySymbol.newSymbol(getRuntime(), name); System.arraycopy(args, 0, newArgs, 1, args.length); return recv.callMethod("method_missing", newArgs); } RubyModule klass = ent.getOrigin(); name = ent.getOriginalName(); ICallable method = ent.getMethod(); if (!name.equals("method_missing")) { if (method.getVisibility().isPrivate() && scope == 0) { // return undefinedMethod(name, args, Visibility.PRIVATE); } else if (method.getVisibility().isProtected()) { RubyModule defined = klass; while (defined.isIncluded()) { defined = defined.getInternalClass(); } if (!ruby.getCurrentFrame().getSelf().isKindOf(defined)) { // return undefinedMethod(name, args, Visibility.PROTECTED); } } } // ... return klass.call0(recv, name, args, method, false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cfb1b4132c30e5186c41e9dbf0b92acca72fcf81/RubyModule.java/clean/org/jruby/RubyModule.java |
ruby.getLastCallStatus().setPrivate(); return callMethodMissing(recv, name, args); | public final IRubyObject call(IRubyObject recv, String name, IRubyObject[] args, int scope) { if (args == null) { args = new IRubyObject[0]; } CacheEntry ent = getRuntime().getMethodCache().getEntry(this, name); if (ent == null) { ent = getMethodBody(name); } if (ent == null || ent.getMethod().isUndefined()) { if (scope == 3) { throw new NameError(ruby, "super: no superclass method '" + name + "'"); } IRubyObject[] newArgs = new IRubyObject[args.length + 1]; newArgs[0] = RubySymbol.newSymbol(getRuntime(), name); System.arraycopy(args, 0, newArgs, 1, args.length); return recv.callMethod("method_missing", newArgs); } RubyModule klass = ent.getOrigin(); name = ent.getOriginalName(); ICallable method = ent.getMethod(); if (!name.equals("method_missing")) { if (method.getVisibility().isPrivate() && scope == 0) { // return undefinedMethod(name, args, Visibility.PRIVATE); } else if (method.getVisibility().isProtected()) { RubyModule defined = klass; while (defined.isIncluded()) { defined = defined.getInternalClass(); } if (!ruby.getCurrentFrame().getSelf().isKindOf(defined)) { // return undefinedMethod(name, args, Visibility.PROTECTED); } } } // ... return klass.call0(recv, name, args, method, false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cfb1b4132c30e5186c41e9dbf0b92acca72fcf81/RubyModule.java/clean/org/jruby/RubyModule.java |
|
ruby.getLastCallStatus().setProtected(); return callMethodMissing(recv, name, args); | public final IRubyObject call(IRubyObject recv, String name, IRubyObject[] args, int scope) { if (args == null) { args = new IRubyObject[0]; } CacheEntry ent = getRuntime().getMethodCache().getEntry(this, name); if (ent == null) { ent = getMethodBody(name); } if (ent == null || ent.getMethod().isUndefined()) { if (scope == 3) { throw new NameError(ruby, "super: no superclass method '" + name + "'"); } IRubyObject[] newArgs = new IRubyObject[args.length + 1]; newArgs[0] = RubySymbol.newSymbol(getRuntime(), name); System.arraycopy(args, 0, newArgs, 1, args.length); return recv.callMethod("method_missing", newArgs); } RubyModule klass = ent.getOrigin(); name = ent.getOriginalName(); ICallable method = ent.getMethod(); if (!name.equals("method_missing")) { if (method.getVisibility().isPrivate() && scope == 0) { // return undefinedMethod(name, args, Visibility.PRIVATE); } else if (method.getVisibility().isProtected()) { RubyModule defined = klass; while (defined.isIncluded()) { defined = defined.getInternalClass(); } if (!ruby.getCurrentFrame().getSelf().isKindOf(defined)) { // return undefinedMethod(name, args, Visibility.PROTECTED); } } } // ... return klass.call0(recv, name, args, method, false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/cfb1b4132c30e5186c41e9dbf0b92acca72fcf81/RubyModule.java/clean/org/jruby/RubyModule.java |
|
.println("<script type=\"text/javascript\" src=\"js/percentagesorttype.js\"></script>"); | .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/percentagesorttype.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of classes in this package Collection classes; if (packageData == null) { classes = new TreeSet(); if (projectData.getNumberOfClasses() > 0) { iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); if (classData.getPackageName() == null) { classes.add(classData); } } } } else { classes = packageData.getChildren(); } // Output a line for each class if (classes.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = classes.iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); out.println(generateTableRowForClass(classData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8aa2b024b47f24f410d25e5d8eb53673520a571e/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
.println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); | .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/percentagesorttype.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of classes in this package Collection classes; if (packageData == null) { classes = new TreeSet(); if (projectData.getNumberOfClasses() > 0) { iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); if (classData.getPackageName() == null) { classes.add(classData); } } } } else { classes = packageData.getChildren(); } // Output a line for each class if (classes.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = classes.iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); out.println(generateTableRowForClass(classData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8aa2b024b47f24f410d25e5d8eb53673520a571e/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
.println(" [\"String\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); | .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); | private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/percentagesorttype.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of classes in this package Collection classes; if (packageData == null) { classes = new TreeSet(); if (projectData.getNumberOfClasses() > 0) { iter = projectData.getClasses().iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); if (classData.getPackageName() == null) { classes.add(classData); } } } } else { classes = packageData.getChildren(); } // Output a line for each class if (classes.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = classes.iterator(); while (iter.hasNext()) { ClassData classData = (ClassData)iter.next(); out.println(generateTableRowForClass(classData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"Number\", \"Number\", \"Number\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/8aa2b024b47f24f410d25e5d8eb53673520a571e/HTMLReport.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/html/HTMLReport.java |
cg.collectFromCategoryLinks( new MapperBlock( mapper ) ))); | cg.eachLinkedCategory( new MapperBlock( mapper ) ))); | public void copy(IObject model, ModelMapper mapper) { if (model instanceof CategoryGroup) { CategoryGroup cg = (CategoryGroup) model; super.copy(model,mapper); // Details if (cg.getDetails()!=null){ this.setOwner((ExperimenterData) mapper.findTarget( cg.getDetails().getOwner())); } // Fields this.setName(cg.getName()); this.setDescription(cg.getDescription()); // Collections setCategories (new HashSet( cg.collectFromCategoryLinks( new MapperBlock( mapper ) ))); // FIXME this won't work. Needs CGCL as pointer to original // otherwise you get non-referential integrity } else { throw new IllegalArgumentException( "CategoryGroupData can only copy from CategoryGroup types"); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b5c704279f82fa929138305f70f2f5e6b462c69/CategoryGroupData.java/clean/components/shoola-adapter/src/pojos/CategoryGroupData.java |
double scale = aPaintContext.getScale(); | PCamera camera = aPaintContext.getCamera(); double scale = camera.getViewScale(); | protected void paint(PPaintContext aPaintContext) { double scale = aPaintContext.getScale(); if (scale < Constants.SCALE_THRESHOLD) { params.setVisible(false); modules.setVisible(true); } else { params.setVisible(true); modules.setVisible(false); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/eb2be5991bbd43d8f22c2408263446bd459f68b0/LinkLayer.java/buggy/SRC/org/openmicroscopy/shoola/agents/chainbuilder/piccolo/LinkLayer.java |
int n = Integer.parseInt(args[0]); | public static void main(String args[]) { //@START int n = Integer.parseInt(args[0]); HashMap hash1 = new HashMap(10000); HashMap hash2 = new HashMap(n); for(int i = 0; i < 10000; i++) hash1.put("foo_" + Integer.toString(i, 10), new Val(i)); for(int i = 0; i < n; i++) { Iterator it = hash1.entrySet().iterator(); while(it.hasNext()) { Map.Entry h1 = (Map.Entry)it.next(); String key = (String)h1.getKey(); int v1 = ((Val)h1.getValue()).val; if (hash2.containsKey(key)) ((Val)hash2.get(key)).val += v1; else hash2.put(key, new Val(v1)); } } System.out.print(((Val)hash1.get("foo_1")).val + " " + ((Val)hash1.get("foo_9999")).val + " " + ((Val)hash2.get("foo_1")).val + " " + ((Val)hash2.get("foo_9999")).val + "\n"); //@END } | 53330 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/53330/eb6c850277407b38bcaefb81155941da0f27b849/hash2.java/clean/tests/shootout/java-start/hash2.java |
|
set.remove(s2); assertTrue(set.contains(s1)); assertTrue(! set.contains(s2)); assertTrue(! set.contains(s3)); | public void testStoring() { IdentitySet set = new IdentitySet(); String s1 = "hello"; String s2 = new String(s1); String s3 = "some other string"; set.add(s1); assertTrue(set.contains(s1)); assertTrue(! set.contains(s2)); assertTrue(! set.contains(s3)); set.add(s2); assertTrue(set.contains(s1)); assertTrue(set.contains(s2)); assertTrue(! set.contains(s3)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3db6c9249a0b029b0a43fa8b53b9d42de5c34174/TestIdentitySet.java/buggy/org/jruby/test/TestIdentitySet.java |
|
return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); | return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); | public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); } BigInteger results[] = getValue().divideAndRemainder(bigIntValue(other)); if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } return bigNorm(getRuntime(), results[0]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyBignum.java/buggy/src/org/jruby/RubyBignum.java |
BigInteger results[] = getValue().divideAndRemainder(bigIntValue(other)); | BigInteger results[] = getValue().divideAndRemainder(bigIntValue(other)); | public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); } BigInteger results[] = getValue().divideAndRemainder(bigIntValue(other)); if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } return bigNorm(getRuntime(), results[0]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyBignum.java/buggy/src/org/jruby/RubyBignum.java |
if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } | if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } | public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_div(other); } BigInteger results[] = getValue().divideAndRemainder(bigIntValue(other)); if (results[0].compareTo(BigInteger.ZERO) <= 0 && results[1].compareTo(BigInteger.ZERO) != 0) { return bigNorm(getRuntime(), results[0].subtract(BigInteger.ONE)); } return bigNorm(getRuntime(), results[0]); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyBignum.java/buggy/src/org/jruby/RubyBignum.java |
RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_mul(other); } return bigNorm(getRuntime(), getValue().multiply(bigIntValue(other))); | return numericValue(num).multiplyWith(this); | public RubyNumeric op_mul(IRubyObject num) { RubyNumeric other = numericValue(num); if (other instanceof RubyFloat) { return RubyFloat.newFloat(getRuntime(), getDoubleValue()).op_mul(other); } return bigNorm(getRuntime(), getValue().multiply(bigIntValue(other))); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a25fc494ea7daeb4b5b479e0173372332cf7d4ac/RubyBignum.java/buggy/src/org/jruby/RubyBignum.java |
public Thumbnail(Integer attributeId, String path, String mimeType, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Repository repository, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.path = path; this.mimeType = mimeType; this.image = image; this.repository = repository; this.moduleExecution = moduleExecution; | public Thumbnail() { | public Thumbnail(Integer attributeId, String path, String mimeType, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Repository repository, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.path = path; this.mimeType = mimeType; this.image = image; this.repository = repository; this.moduleExecution = moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public org.openmicroscopy.omero.model.Image getImage() { | public Image getImage() { | public org.openmicroscopy.omero.model.Image getImage() { return this.image; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { | public ModuleExecution getModuleExecution() { | public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { return this.moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public org.openmicroscopy.omero.model.Repository getRepository() { | public Repository getRepository() { | public org.openmicroscopy.omero.model.Repository getRepository() { return this.repository; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public void setImage(org.openmicroscopy.omero.model.Image image) { | public void setImage(Image image) { | public void setImage(org.openmicroscopy.omero.model.Image image) { this.image = image; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { | public void setModuleExecution(ModuleExecution moduleExecution) { | public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
public void setRepository(org.openmicroscopy.omero.model.Repository repository) { | public void setRepository(Repository repository) { | public void setRepository(org.openmicroscopy.omero.model.Repository repository) { this.repository = repository; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/9570ef74198a070d72e77c417c9d25244a942de2/Thumbnail.java/clean/components/common/src/org/openmicroscopy/omero/model/Thumbnail.java |
throw new NotImplementedError(); | public void raise(RubyException exc) { // TODO: How do we raise the exception from the target thread // (as opposed to the calling thread)? //throw exc; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/97a2e6c00e86a04f4922893e5ab540f1c1636188/RubyThread.java/buggy/org/jruby/RubyThread.java |
|
if (!recv.getRuntime().isBlockGiven()) { System.out.println("No block given to thread!"); | if (! recv.getRuntime().isBlockGiven()) { throw new ThreadError(recv.getRuntime(), "must be called with a block"); | protected static RubyThread startThread(final IRubyObject recv, final IRubyObject[] args, boolean callInit) { if (!recv.getRuntime().isBlockGiven()) { System.out.println("No block given to thread!"); } final RubyThread result = new RubyThread(recv.getRuntime(), (RubyClass) recv); if (callInit) { result.callInit(args); } final RubyProc proc = RubyProc.newProc(recv.getRuntime(), recv.getRuntime().getClasses().getProcClass()); final Frame currentFrame = recv.getRuntime().getCurrentFrame(); final Block currentBlock = recv.getRuntime().getBlockStack().getCurrent(); //result.jvmThread = new Thread(result.new RubyThreadRunner(ruby, args)); result.jvmThread = new Thread(new Runnable() { public void run() { recv.getRuntime().getFrameStack().push(currentFrame); recv.getRuntime().getBlockStack().setCurrent(currentBlock); recv.getRuntime().getCurrentContext().setCurrentThread(result); proc.call(args); } }); result.jvmThread.start(); return result; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/97a2e6c00e86a04f4922893e5ab540f1c1636188/RubyThread.java/buggy/org/jruby/RubyThread.java |
public void init() { | public OMEData init() { | public void init() { // Test data : calculated before to not change times. if (!initialized) { super.init(); imgsPDI = getPercentOfCollection(allImgs, percent); imgsCGCI = getPercentOfCollection(allImgs, percent); imgsAnn1 = getPercentOfCollection(allImgs, percent); imgsAnn2 = getPercentOfCollection(allImgs, percent); dsAnn1 = getPercentOfCollection(allDss, percent); dsAnn2 = getPercentOfCollection(allDss, percent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OMEPerformanceData.java/clean/components/common/src/org/openmicroscopy/omero/tests/OMEPerformanceData.java |
return this; | public void init() { // Test data : calculated before to not change times. if (!initialized) { super.init(); imgsPDI = getPercentOfCollection(allImgs, percent); imgsCGCI = getPercentOfCollection(allImgs, percent); imgsAnn1 = getPercentOfCollection(allImgs, percent); imgsAnn2 = getPercentOfCollection(allImgs, percent); dsAnn1 = getPercentOfCollection(allDss, percent); dsAnn2 = getPercentOfCollection(allDss, percent); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/2bc67970abd041b6cb8e0252d02a6e27f304bec4/OMEPerformanceData.java/clean/components/common/src/org/openmicroscopy/omero/tests/OMEPerformanceData.java |
|
JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "The message has been broadcasted to the following users:\n" + buf.toString(), "Message Broadcasted", JOptionPane.INFORMATION_MESSAGE); | JOptionPane.showMessageDialog(SparkManager.getMainWindow(), Res.getString("message.broadcasted.to", buf.toString()), Res.getString("title.notification"), JOptionPane.INFORMATION_MESSAGE); | private void broadcastToGroup(ContactGroup group) { StringBuffer buf = new StringBuffer(); InputDialog dialog = new InputDialog(); final String messageText = dialog.getInput(Res.getString("title.broadcast.message"), Res.getString("message.broadcast.to", group.getGroupName()), SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), SparkManager.getMainWindow()); if (ModelUtil.hasLength(messageText)) { for (ContactItem item : group.getContactItems()) { final Message message = new Message(); message.setTo(item.getFullJID()); message.setProperty("broadcast", true); message.setBody(messageText); buf.append(item.getNickname()).append("\n"); SparkManager.getConnection().sendPacket(message); } JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "The message has been broadcasted to the following users:\n" + buf.toString(), "Message Broadcasted", JOptionPane.INFORMATION_MESSAGE); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/ede843505c046d47bba853e049191aedc32bd2fe/BroadcastPlugin.java/clean/src/java/org/jivesoftware/sparkimpl/plugin/alerts/BroadcastPlugin.java |
public RubyClass getInternalClass() { if (isNil()) { return getRuby().getClasses().getNilClass(); } return rubyClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62333c275b1a643f18c9a79af5bbb2f0027f4392/RubyObject.java/clean/org/jruby/RubyObject.java |
||
RubyClass currType = getInternalClass(); while (currType != null) { if (currType == type || currType.getMethods().keySet().containsAll(type.getMethods().keySet())) { return true; } currType = currType.getSuperClass(); } return false; | return getInternalClass().ancestors().includes(type); | public boolean isKindOf(RubyModule type) { RubyClass currType = getInternalClass(); while (currType != null) { if (currType == type || currType.getMethods().keySet().containsAll(type.getMethods().keySet())) { return true; } currType = currType.getSuperClass(); } return false; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/62333c275b1a643f18c9a79af5bbb2f0027f4392/RubyObject.java/clean/org/jruby/RubyObject.java |
return wrap( context, "&pixelsService" ); | return wrap( context, IPixels.class ); | public Object invoke( InvocationContext context ) throws Exception { return wrap( context, "&pixelsService" ); // FIXME } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/RawPixelsBean.java/buggy/components/ejb/src/ome/ro/ejb/RawPixelsBean.java |
IPixels metadataService = (IPixels) serviceFactory.getContext() .getBean(IPixels.class.getName()); | IPixels metadataService = serviceFactory.getPixelsService(); | public void setPixelsId( long pixelsId ) { if ( id == null || id.longValue() != pixelsId ) { id = new Long( pixelsId ); pixelsInstance = null; buffer = null; IPixels metadataService = (IPixels) serviceFactory.getContext() .getBean(IPixels.class.getName()); PixelsService dataService = (PixelsService) applicationContext.getBean("/OME/OMEIS/Pixels"); // FIXME in SFactory. pixelsInstance = metadataService.retrievePixDescription( id ); try { buffer = dataService.createPixelBuffer( pixelsInstance ); } catch (IOException e) { e.printStackTrace(); // TODO this could throw a ResourceError anyway. throw new ResourceError( "Failed to create PixelBuffer:\n" +e.getMessage()); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/RawPixelsBean.java/buggy/components/ejb/src/ome/ro/ejb/RawPixelsBean.java |
throw newValue.getRuntime().newNameError(name + " is a read-only variable"); | throw newValue.getRuntime().newNameError(name + " is a read-only variable", name); | public IRubyObject setValue(IRubyObject newValue) { assert newValue != null; throw newValue.getRuntime().newNameError(name + " is a read-only variable"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/1278c5bb3507a052d150d814f15453542ae41aed/ReadonlyAccessor.java/buggy/src/org/jruby/internal/runtime/ReadonlyAccessor.java |
new XMLReport(coverageData, outputDir, sourceDir); | new XMLReport(coverage, outputDir, sourceDir); | public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("format", LongOpt.REQUIRED_ARGUMENT, null, 'f'); longOpts[1] = new LongOpt("instrumentation", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[2] = new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longOpts[3] = new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'); Getopt g = new Getopt(Main.class.getName(), args, ":f:i:o:s:", longOpts); int c; while ((c = g.getopt()) != -1) { switch (c) { case 'f': format = new String(g.getOptarg()); if (!format.equalsIgnoreCase("html") && !format.equalsIgnoreCase("xml")) { throw new Exception("Error: format \"" + format + "\" must be either html or xml"); } break; case 'i': serializationFile = new File(g.getOptarg()); if (!serializationFile.exists()) { throw new Exception("Error: serialization file " + serializationFile + " does not exist"); } if (serializationFile.isDirectory()) { throw new Exception("Error: serialization file " + serializationFile + " cannot be a directory"); } break; case 'o': outputDir = new File(g.getOptarg()); if (outputDir.exists() && outputDir.isFile()) { throw new Exception("Error: destination directory " + outputDir + " already exists and is a file"); } outputDir.mkdirs(); break; case 's': sourceDir = new File(g.getOptarg()); if (!sourceDir.exists()) { throw new Exception("Error: source directory " + sourceDir + " does not exist"); } if (sourceDir.isFile()) { throw new Exception("Error: source directory " + sourceDir + " should be a directory, not a file"); } break; } } if (logger.isDebugEnabled()) { logger.debug("format is " + format); logger.debug("serializationFile is " + serializationFile.getAbsolutePath()); logger.debug("outputDir is " + outputDir.getAbsolutePath()); logger.debug("sourceDir is " + sourceDir.getAbsolutePath()); } InputStream is = null; ObjectInputStream objects = null; try { is = new FileInputStream(serializationFile); objects = new ObjectInputStream(is); Map coverageData = (Map)objects.readObject(); if (format.equalsIgnoreCase("xml")) { new XMLReport(coverageData, outputDir, sourceDir); } else if (format.equalsIgnoreCase("html")) { new HTMLReport(coverageData, outputDir, sourceDir); } } finally { if (is != null) is.close(); if (objects != null) objects.close(); } long stopTime = System.currentTimeMillis(); System.out .println("Reporting time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/1fc76069b3c268690aea68cfb654d632b23e3b49/Main.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Main.java |
new HTMLReport(coverageData, outputDir, sourceDir); | new HTMLReport(coverage, outputDir, sourceDir); | public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("format", LongOpt.REQUIRED_ARGUMENT, null, 'f'); longOpts[1] = new LongOpt("instrumentation", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[2] = new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longOpts[3] = new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'); Getopt g = new Getopt(Main.class.getName(), args, ":f:i:o:s:", longOpts); int c; while ((c = g.getopt()) != -1) { switch (c) { case 'f': format = new String(g.getOptarg()); if (!format.equalsIgnoreCase("html") && !format.equalsIgnoreCase("xml")) { throw new Exception("Error: format \"" + format + "\" must be either html or xml"); } break; case 'i': serializationFile = new File(g.getOptarg()); if (!serializationFile.exists()) { throw new Exception("Error: serialization file " + serializationFile + " does not exist"); } if (serializationFile.isDirectory()) { throw new Exception("Error: serialization file " + serializationFile + " cannot be a directory"); } break; case 'o': outputDir = new File(g.getOptarg()); if (outputDir.exists() && outputDir.isFile()) { throw new Exception("Error: destination directory " + outputDir + " already exists and is a file"); } outputDir.mkdirs(); break; case 's': sourceDir = new File(g.getOptarg()); if (!sourceDir.exists()) { throw new Exception("Error: source directory " + sourceDir + " does not exist"); } if (sourceDir.isFile()) { throw new Exception("Error: source directory " + sourceDir + " should be a directory, not a file"); } break; } } if (logger.isDebugEnabled()) { logger.debug("format is " + format); logger.debug("serializationFile is " + serializationFile.getAbsolutePath()); logger.debug("outputDir is " + outputDir.getAbsolutePath()); logger.debug("sourceDir is " + sourceDir.getAbsolutePath()); } InputStream is = null; ObjectInputStream objects = null; try { is = new FileInputStream(serializationFile); objects = new ObjectInputStream(is); Map coverageData = (Map)objects.readObject(); if (format.equalsIgnoreCase("xml")) { new XMLReport(coverageData, outputDir, sourceDir); } else if (format.equalsIgnoreCase("html")) { new HTMLReport(coverageData, outputDir, sourceDir); } } finally { if (is != null) is.close(); if (objects != null) objects.close(); } long stopTime = System.currentTimeMillis(); System.out .println("Reporting time: " + (stopTime - startTime) + "ms"); } | 50197 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50197/1fc76069b3c268690aea68cfb654d632b23e3b49/Main.java/clean/cobertura/src/net/sourceforge/cobertura/reporting/Main.java |
public void setProperties(Set properties) { | public void setProperties(Set<Property> properties) { | public void setProperties(Set properties) { this.properties = properties; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d9e84b0d2f71da76eba45bc713472ad607c544a/SemanticType.java/clean/components/dsl/src/ome/dsl/SemanticType.java |
List<List> result_set = (List) iQuery.execute(q); | List<CategoryGroup> result_set = (List) iQuery.execute(q); | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosCGCPathsQueryDefinition.class.getName(), PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } // // Destructive changes below this point. // for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.linkCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
for (List result_row : result_set) | for (CategoryGroup cg: result_set) | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosCGCPathsQueryDefinition.class.getName(), PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } // // Destructive changes below this point. // for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.linkCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); | for (Category c : (List<Category>) cg.linkedCategoryList()) { if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosCGCPathsQueryDefinition.class.getName(), PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } // // Destructive changes below this point. // for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.linkCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
ProxyCleanupFilter filter = new ProxyCleanupFilter(); | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosCGCPathsQueryDefinition.class.getName(), PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } // // Destructive changes below this point. // for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.linkCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
|
filter.filter( null, cg ); | public Set findCGCPaths(@NotNull @Validate(Long.class) Set imgIds, String algorithm, Map options) { if (imgIds.size()==0){ return new HashSet(); } if (! IPojos.ALGORITHMS.contains(algorithm)) { throw new IllegalArgumentException( "No such algorithm known:"+algorithm); } PojoOptions po = new PojoOptions(options); Query q = queryFactory.lookup( PojosCGCPathsQueryDefinition.class.getName(), PojosQP.ids(imgIds), PojosQP.String("algorithm",algorithm), PojosQP.options(po.map())); List<List> result_set = (List) iQuery.execute(q); Map<CategoryGroup,Set<Category>> map = new HashMap<CategoryGroup,Set<Category>>(); Set<CategoryGroup> returnValues = new HashSet<CategoryGroup>(); // Parse for (List result_row : result_set) { CategoryGroup cg = (CategoryGroup) result_row.get(0); Category c = (Category) result_row.get(1); if (!map.containsKey(cg)) map.put(cg,new HashSet<Category>()); map.get(cg).add(c); } // // Destructive changes below this point. // for (CategoryGroup cg : map.keySet()) { for (Category c : map.get(cg)) { iQuery.evict(cg); // FIXME does this suffice? cg.linkCategory(c); } returnValues.add(cg); } collectCounts(returnValues,po); return returnValues; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/149c7633fd9b60929f706ce4783c5e19a9f34bd2/PojosImpl.java/clean/components/server/src/ome/logic/PojosImpl.java |
|
void loadRefreshedData(List nodes) | void loadRefreshedData(List nodes, List expandedTopNodes) | void loadRefreshedData(List nodes) { Class klass = null; if (browserType == Browser.PROJECT_EXPLORER) klass = ProjectData.class; else if (browserType == Browser.CATEGORY_EXPLORER) klass = CategoryGroupData.class; if (klass == null) return; state = Browser.LOADING_DATA; currentLoader = new RefreshDataLoader(component, klass, nodes); currentLoader.load(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java |
currentLoader = new RefreshDataLoader(component, klass, nodes); | currentLoader = new RefreshDataLoader(component, klass, nodes, expandedTopNodes); | void loadRefreshedData(List nodes) { Class klass = null; if (browserType == Browser.PROJECT_EXPLORER) klass = ProjectData.class; else if (browserType == Browser.CATEGORY_EXPLORER) klass = CategoryGroupData.class; if (klass == null) return; state = Browser.LOADING_DATA; currentLoader = new RefreshDataLoader(component, klass, nodes); currentLoader.load(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/e14deebd64382fe7de32f39ea661a766a7294394/BrowserModel.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserModel.java |
public static List loadAllArticlesInFolder(File folder) throws XmlException, IOException{ | public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ | public static List loadAllArticlesInFolder(File folder) throws XmlException, IOException{ List list = new ArrayList(); File[] articleFile = folder.listFiles(); if(articleFile!=null){ for(int i=0;i<articleFile.length;i++){ System.out.println("Attempting to load "+articleFile[i].toString()); ArticleItemBean article = new ArticleItemBean(); article.load(articleFile[i]); list.add(article); } } return list; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java |
File[] articleFile = folder.listFiles(); | public static List loadAllArticlesInFolder(File folder) throws XmlException, IOException{ List list = new ArrayList(); File[] articleFile = folder.listFiles(); if(articleFile!=null){ for(int i=0;i<articleFile.length;i++){ System.out.println("Attempting to load "+articleFile[i].toString()); ArticleItemBean article = new ArticleItemBean(); article.load(articleFile[i]); list.add(article); } } return list; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java |
|
if(articleFile!=null){ for(int i=0;i<articleFile.length;i++){ System.out.println("Attempting to load "+articleFile[i].toString()); ArticleItemBean article = new ArticleItemBean(); article.load(articleFile[i]); list.add(article); } | IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); HttpURL root = new HttpURL(service.getWebdavServerURL()+folder); root.setUserinfo("root","root"); WebdavResource webdavResource = new WebdavResource(root); String[] file = webdavResource.list(); for(int i=0;i<file.length;i++){ System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean(); article.load(folder+"/"+file[i]); list.add(article); | public static List loadAllArticlesInFolder(File folder) throws XmlException, IOException{ List list = new ArrayList(); File[] articleFile = folder.listFiles(); if(articleFile!=null){ for(int i=0;i<articleFile.length;i++){ System.out.println("Attempting to load "+articleFile[i].toString()); ArticleItemBean article = new ArticleItemBean(); article.load(articleFile[i]); list.add(article); } } return list; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java |
articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]); | articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder("/files/content").toArray(new ArticleItemBean[0]); | public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = 0; ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]); availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(a, i); } } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } _dataModel.setRowCount(availableRows); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java |
ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); | ArticleListBean a = new ArticleListBean(articleItemBean[i].getMainCategory()+"/"+articleItemBean[i].getHeadline()+".xml", articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); | public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = 0; ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[])loadAllArticlesInFolder(new File("/Test/article/")).toArray(new ArticleItemBean[0]); availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(a, i); } } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } _dataModel.setRowCount(availableRows); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/72fe15183822be99f6dfa9d697bce89864c5f7d8/ArticleListBean.java/clean/src/java/com/idega/block/article/bean/ArticleListBean.java |
if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; | public IRubyObject op_cmp(IRubyObject other) { if (other.isNil()) { return other; } if (other instanceof RubyTime) { return getRuntime().newFixnum(cmp((RubyTime) other)); } long millis = getTimeInMillis(); if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d2a3e96a5caf8bc4e4894cc0cff288c732dcc835/RubyTime.java/buggy/src/org/jruby/RubyTime.java |
|
double time_other = ((RubyNumeric) other).getDoubleValue(); | if(other instanceof RubyNumeric) { if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; | public IRubyObject op_cmp(IRubyObject other) { if (other.isNil()) { return other; } if (other instanceof RubyTime) { return getRuntime().newFixnum(cmp((RubyTime) other)); } long millis = getTimeInMillis(); if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d2a3e96a5caf8bc4e4894cc0cff288c732dcc835/RubyTime.java/buggy/src/org/jruby/RubyTime.java |
if (time > time_other) { | double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { | public IRubyObject op_cmp(IRubyObject other) { if (other.isNil()) { return other; } if (other instanceof RubyTime) { return getRuntime().newFixnum(cmp((RubyTime) other)); } long millis = getTimeInMillis(); if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d2a3e96a5caf8bc4e4894cc0cff288c732dcc835/RubyTime.java/buggy/src/org/jruby/RubyTime.java |
} else if (time < time_other) { | } else if (millis < millis_other || (millis == millis_other && usec < 0)) { | public IRubyObject op_cmp(IRubyObject other) { if (other.isNil()) { return other; } if (other instanceof RubyTime) { return getRuntime().newFixnum(cmp((RubyTime) other)); } long millis = getTimeInMillis(); if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d2a3e96a5caf8bc4e4894cc0cff288c732dcc835/RubyTime.java/buggy/src/org/jruby/RubyTime.java |
long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); | return getRuntime().getNil(); | public IRubyObject op_cmp(IRubyObject other) { if (other.isNil()) { return other; } if (other instanceof RubyTime) { return getRuntime().newFixnum(cmp((RubyTime) other)); } long millis = getTimeInMillis(); if (other instanceof RubyFloat || other instanceof RubyBignum) { double time = millis / 1000.0; double time_other = ((RubyNumeric) other).getDoubleValue(); if (time > time_other) { return RubyFixnum.one(getRuntime()); } else if (time < time_other) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } long millis_other = RubyNumeric.num2long(other) * 1000; if (millis > millis_other || (millis == millis_other && usec > 0)) { return RubyFixnum.one(getRuntime()); } else if (millis < millis_other || (millis == millis_other && usec < 0)) { return RubyFixnum.minus_one(getRuntime()); } return RubyFixnum.zero(getRuntime()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d2a3e96a5caf8bc4e4894cc0cff288c732dcc835/RubyTime.java/buggy/src/org/jruby/RubyTime.java |
if ((ho instanceof ImageData)) name = VIEW; | if ((ho instanceof ImageData)) { name = VIEW; description = DESCRIPTION_IMAGE; putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(description)); } | protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } if (selectedDisplay.getParentDisplay() == null) { //root name = BROWSE; setEnabled(model.getSelectedBrowser().getBrowserType() == Browser.IMAGES_EXPLORER); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { Browser browser = model.getSelectedBrowser(); if (browser != null) { if (browser.getSelectedDisplays().length > 1) { setEnabled(true); name = BROWSE; return; } } if ((ho instanceof ImageData)) name = VIEW; else name = BROWSE; if (selectedDisplay instanceof TreeImageSet) { setEnabled( ((TreeImageSet) selectedDisplay).getNumberItems() > 0); } else setEnabled(true); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/38a31e9c570bc8c0bbfb871c8b12b0e52420f22c/ViewAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ViewAction.java |
name = ((RubyString) key).getValue(); | name = ((RubyString) key).toString(); | private String keyName(IRubyObject key) { String name; if (key instanceof RubySymbol) { name = key.asSymbol(); } else if (key instanceof RubyString) { name = ((RubyString) key).getValue(); } else { throw getRuntime().newArgumentError(key.inspect() + " is not a symbol"); } return name; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9f2efc63a858fa0507245b207025eab027840a04/RubyThread.java/clean/src/org/jruby/RubyThread.java |
gMax = Math.min(gMax, max); | gMax = Math.max(gMax, max); | private PixelsStats makeStats(StackStatistics s, PixelsDimensions d) { double gMin = 0; double gMax = 1; double min, max; PixelsStats ps = new PixelsStats(d.sizeW, d.sizeT); //TODO: Need Polymorphic stats. for (int w = 0; w < d.sizeW; w++) { for (int t = 0; t < d.sizeT; t++) { min = s.minimum[w][t]; max = s.maximum[w][t]; if (t == 0) { gMin = min; gMax = max; } else { gMin = Math.min(gMin, min); gMax = Math.min(gMax, max); } ps.setEntry(w, t, min, max, s.geometricMean[w][t], s.geometricSigma[w][t]); } ps.setGlobalEntry(w, gMin, gMax); } return ps; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/7b32c32fc5e84fe503b34b1c1ff061d4097bbdf6/MetadataSource.java/clean/SRC/org/openmicroscopy/shoola/env/rnd/metadata/MetadataSource.java |
if(presence == null){ return null; } | private void registerPresences() { SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; if (presence.getType() == Presence.Type.UNAVAILABLE) { registered = false; } RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); ChatManager chatManager = SparkManager.getChatManager(); chatManager.addContactItemHandler(new ContactItemHandler() { public boolean handlePresence(ContactItem item, Presence presence) { if (presence != null) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportManager.getTransport(domain); if (transport != null) { if (presence.getType() == Presence.Type.AVAILABLE) { item.setIcon(transport.getIcon()); } else { item.setIcon(transport.getInactiveIcon()); } item.updatePresenceStatus(presence); return true; } } return false; } public boolean handleDoubleClick(ContactItem item) { return false; } public Icon useIcon(Presence presence) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportManager.getTransport(domain); if (transport != null) { if (presence.getType() == Presence.Type.AVAILABLE) { return transport.getIcon(); } else { return transport.getInactiveIcon(); } } return null; } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/997a4bd14becef46e30ee291bbdbfe9c99daf102/GatewayPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/GatewayPlugin.java |
|
if(presence == null){ return null; } | public Icon useIcon(Presence presence) { String domain = StringUtils.parseServer(presence.getFrom()); Transport transport = TransportManager.getTransport(domain); if (transport != null) { if (presence.getType() == Presence.Type.AVAILABLE) { return transport.getIcon(); } else { return transport.getInactiveIcon(); } } return null; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/997a4bd14becef46e30ee291bbdbfe9c99daf102/GatewayPlugin.java/buggy/src/java/org/jivesoftware/sparkimpl/plugin/gateways/GatewayPlugin.java |
|
DisplayedNote parentDisplayed = dd.getTree().getSelectedNote(); | DisplayedNote parentDisplayed = tree.getSelectedNote(); | public void addNote(Event e) { DisplayedNote parentDisplayed = dd.getTree().getSelectedNote(); Note parentNote = parentDisplayed.getNote(); Note newNote = new Note("new", parentNote, ""); new DisplayedNote(parentDisplayed, newNote); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/TreeContextMenuController.java/clean/trunk/src/de/berlios/koalanotes/controllers/TreeContextMenuController.java |
for (DisplayedNote removeMe : dd.getTree().getSelectedNotes()) { | for (DisplayedNote removeMe : tree.getSelectedNotes()) { | public void removeNotes(Event e) { for (DisplayedNote removeMe : dd.getTree().getSelectedNotes()) { removeMe.deleteSelfAndChildren(); } } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/TreeContextMenuController.java/clean/trunk/src/de/berlios/koalanotes/controllers/TreeContextMenuController.java |
dd.getTree().initialiseTreeEditor(); | tree.initialiseTreeEditor(); | public void renameNote(Event e) { dd.getTree().initialiseTreeEditor(); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/TreeContextMenuController.java/clean/trunk/src/de/berlios/koalanotes/controllers/TreeContextMenuController.java |
public void scaleChanged(Scale newScale); | public void scaleChanged(String scaleName); | public void scaleChanged(Scale newScale); | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6d45d101f4e831fda33928e252f882d4d16128d2/HeatMapModeListener.java/buggy/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapModeListener.java |
private static int[] getColor(Channel channel) | private static Color getColor(Channel channel) | private static int[] getColor(Channel channel) { int emWave = channel.getLogicalChannel().getEmissionWave().intValue(); if (rangeBlue(emWave)) return BLUE_COLOR; if (rangeGreen(emWave)) return GREEN_COLOR; if (rangeRed(emWave)) return RED_COLOR; return null; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/ColorsFactory.java/clean/components/rendering/src/omeis/providers/re/ColorsFactory.java |
if (runtime.isBlockGiven()) { | /* if (runtime.isBlockGiven()) { | public IRubyObject instance_eval(IRubyObject[] args) { if (runtime.isBlockGiven()) { RubyProc proc = RubyProc.newProc(getRuntime()); return proc.call(args, this); } else { return specificEval(getSingletonClass(), args); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2b80a64aab1ed3862ed461a7e69049fb675d6bc6/RubyObject.java/clean/org/jruby/RubyObject.java |
} else { | } else { */ | public IRubyObject instance_eval(IRubyObject[] args) { if (runtime.isBlockGiven()) { RubyProc proc = RubyProc.newProc(getRuntime()); return proc.call(args, this); } else { return specificEval(getSingletonClass(), args); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2b80a64aab1ed3862ed461a7e69049fb675d6bc6/RubyObject.java/clean/org/jruby/RubyObject.java |
} | public IRubyObject instance_eval(IRubyObject[] args) { if (runtime.isBlockGiven()) { RubyProc proc = RubyProc.newProc(getRuntime()); return proc.call(args, this); } else { return specificEval(getSingletonClass(), args); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2b80a64aab1ed3862ed461a7e69049fb675d6bc6/RubyObject.java/clean/org/jruby/RubyObject.java |
|
super(parameters); | super( defs, parameters ); | public PojosGetImagesQueryDefinition(QueryParameter... parameters) { super(parameters); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f990a7d35ce265e182121d562725175896db41f4/PojosGetImagesQueryDefinition.java/buggy/components/server/src/ome/services/query/PojosGetImagesQueryDefinition.java |
throw new RuntimeException("Error while trying to instantiate:"+queryID,e); | if ( log.isDebugEnabled() ) { e.printStackTrace(); } throw new RuntimeException("Error while trying to instantiate:" +queryID,e); | public Query lookup(String queryID, QueryParameter...parameters) { Query q = null; try { Class klass = Class.forName(queryID); Constructor c = klass.getConstructor(QueryParameter[].class); q = (Query) c.newInstance(new Object[]{parameters}); } catch (ClassNotFoundException e) { // Not an issue. } catch (Exception e) { throw new RuntimeException("Error while trying to instantiate:"+queryID,e); } return q; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0b36a8e77f5bacb7e122d76ffce01866205b09d7/ClassQuerySource.java/buggy/components/server/src/ome/services/query/ClassQuerySource.java |
ret = myBlock.evaluate(context); if (timing) context.stopTiming(); | try { ret = myBlock.evaluate(context); } finally { if (timing) context.stopTiming(); } | public Object evaluate(Context context) throws PropertyException { Object ret; boolean timing = context.isTiming(); if (timing) context.startTiming(myName); ret = myBlock.evaluate(context); if (timing) context.stopTiming(); return ret; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/88d36323ffe7fe0fb49ed32b696ba5e32dca3489/ProfileDirective.java/buggy/webmacro/src/org/webmacro/engine/ProfileDirective.java |
String msg = "Chain: "+chain.getName()+" has structural errors that may prevent it"; | String msg = "Chain: "+chain.getName()+ " has structural errors that may prevent it "; | public void display() { // for now if (errors == null) return; Iterator iter = errors.iterator(); String res = new String(); HashMap nodes = new HashMap(); DefaultMutableTreeNode classNode; DefaultMutableTreeNode objNode; DefaultMutableTreeNode root = new DefaultMutableTreeNode(); while (iter.hasNext()) { ChainStructureError error = (ChainStructureError) iter.next(); // get the node for its class from the hash // get it's error as a tree node Object obj = nodes.get(error.getClass()); if (obj == null) { classNode = new DefaultMutableTreeNode(error.getDescription()); root.add(classNode); nodes.put(error.getClass(),classNode); } else classNode = (DefaultMutableTreeNode) obj; // add it. objNode = new DefaultMutableTreeNode(error.describeError()); classNode.add(objNode); } UserNotifier un = UIFactory.makeUserNotifier(); String msg = "Chain: "+chain.getName()+" has structural errors that may prevent it"; msg += "from being executed.\n"; JTree tree = new JTree(root); tree.setRootVisible(false); un.notifyWarning("Improper Chain Structure",msg,tree); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f79b952e960a2ac240ed08deb21e28e566093122/ChainStructureErrors.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/data/ChainStructureErrors.java |
System.out.println(parent); | public String getPassword(String title, String description, Icon icon, Component parent) { passwordField = new JPasswordField(); TitlePanel titlePanel = new TitlePanel(title, description, icon, true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); final JPanel passwordPanel = new JPanel(new GridBagLayout()); JLabel passwordLabel = new JLabel("Enter Password:"); passwordPanel.add(passwordLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); passwordPanel.add(passwordField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); // The user should only be able to close this dialog. final Object[] options = {Res.getString("ok"), Res.getString("cancel")}; optionPane = new JOptionPane(passwordPanel, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(optionPane, BorderLayout.CENTER); // Lets make sure that the dialog is modal. Cannot risk people // losing this dialog. JOptionPane p = new JOptionPane(); dialog = p.createDialog(parent, title); dialog.setModal(true); dialog.pack(); dialog.setSize(width, height); dialog.setContentPane(mainPanel); dialog.setLocationRelativeTo(parent); optionPane.addPropertyChangeListener(this); // Add Key Listener to Send Field passwordField.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_TAB) { optionPane.requestFocus(); } else if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { dialog.dispose(); } } }); passwordField.requestFocus(); dialog.setVisible(true); return stringValue; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/028cde13fc23ea5cbdaa0191963cf1624ef656d0/PasswordDialog.java/buggy/src/java/org/jivesoftware/spark/component/PasswordDialog.java |
|
outStream = new PrintStream(new ByteArrayOutputStream()); | out = new PrintStream(new ByteArrayOutputStream()); err = new PrintStream(new ByteArrayOutputStream()); | public void setUp() { outStream = new PrintStream(new ByteArrayOutputStream()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/TestCommandlineParser.java/buggy/test/org/jruby/test/TestCommandlineParser.java |
CommandlineParser parser = new CommandlineParser(args, outStream); | CommandlineParser parser = new CommandlineParser(new Main(System.in, out, err), args); | public void testHelpDoesNotRunIntepreter() { String[] args = new String[] { "-h" }; CommandlineParser parser = new CommandlineParser(args, outStream); assertFalse(parser.isShouldRunInterpreter()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/TestCommandlineParser.java/buggy/test/org/jruby/test/TestCommandlineParser.java |
CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }, outStream); | CommandlineParser c = new CommandlineParser(new Main(System.in, out, err), new String[] { "-e", "hello", "-e", "world" }); | public void testParsing() { CommandlineParser c = new CommandlineParser(new String[] { "-e", "hello", "-e", "world" }, outStream); assertEquals("hello\nworld\n", c.inlineScript()); assertNull(c.getScriptFileName()); assertEquals("-e", c.displayedFileName()); c = new CommandlineParser(new String[] { "--version" }, outStream); assertTrue(c.isShowVersion()); c = new CommandlineParser(new String[] { "-n", "myfile.rb" }, outStream); assertTrue(c.isAssumeLoop()); assertEquals("myfile.rb", c.getScriptFileName()); assertEquals("myfile.rb", c.displayedFileName()); c = new CommandlineParser(new String[0], outStream); assertEquals("-", c.displayedFileName()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b4a189a27604d62c317938f16a124fb9dab1e94a/TestCommandlineParser.java/buggy/test/org/jruby/test/TestCommandlineParser.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.