rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
ruby.setDynamicVariable(iVisited.getName(), result.toRubyObject()); | ruby.setDynamicVariable(iVisited.getName(), result); | public void visitDAsgnCurrNode(DAsgnCurrNode iVisited) { eval(iVisited.getValueNode()); ruby.setDynamicVariable(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.setDynamicVariable(iVisited.getName(), result.toRubyObject()); | ruby.setDynamicVariable(iVisited.getName(), result); | public void visitDAsgnNode(DAsgnNode iVisited) { eval(iVisited.getValueNode()); ruby.setDynamicVariable(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
String def = new DefinedVisitor(ruby, self.toRubyObject()).getDefinition(iVisited.getExpressionNode()); | String def = new DefinedVisitor(ruby, self).getDefinition(iVisited.getExpressionNode()); | public void visitDefinedNode(DefinedNode iVisited) { String def = new DefinedVisitor(ruby, self.toRubyObject()).getDefinition(iVisited.getExpressionNode()); if (def != null) { result = builtins.toString(def); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = RubyRange.newRange(ruby, eval(iVisited.getBeginNode()).toRubyObject(), eval(iVisited.getEndNode()).toRubyObject(), iVisited.isExclusive()); | result = RubyRange.newRange(ruby, eval(iVisited.getBeginNode()), eval(iVisited.getEndNode()), iVisited.isExclusive()); | public void visitDotNode(DotNode iVisited) { result = RubyRange.newRange(ruby, eval(iVisited.getBeginNode()).toRubyObject(), eval(iVisited.getEndNode()).toRubyObject(), iVisited.isExclusive()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = RubyArray.newArray(ruby, result.toRubyObject()); | result = RubyArray.newArray(ruby, result); | public void visitExpandArrayNode(ExpandArrayNode iVisited) { eval(iVisited.getExpandNode()); if (!(result instanceof RubyArray)) { if (result.isNil()) { result = RubyArray.newArray(ruby, 0); } else { result = RubyArray.newArray(ruby, result.toRubyObject()); } } // result.convertToType("Array", "to_ary", false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = self.getInternalClass().call(self.toRubyObject(), iVisited.getName(), args, 1); | result = self.getInternalClass().call(self, iVisited.getName(), args, 1); | public void visitFCallNode(FCallNode iVisited) { Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject[] args = ArgsUtil.setupArgs(ruby, this, iVisited.getArgsNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); result = self.getInternalClass().call(self.toRubyObject(), iVisited.getName(), args, 1); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getScope().setValue(iVisited.getCount(), result.toRubyObject()); | ruby.getScope().setValue(iVisited.getCount(), result); | public void visitFlipNode(FlipNode iVisited) { if (iVisited.isExclusive()) { if (!ruby.getScope().getValue(iVisited.getCount()).isTrue()) { //Benoit: I don't understand why the result is inversed result = eval(iVisited.getBeginNode()).isTrue() ? ruby.getFalse() : ruby.getTrue(); ruby.getScope().setValue(iVisited.getCount(), result.toRubyObject()); } else { if (eval(iVisited.getEndNode()).isTrue()) { ruby.getScope().setValue(iVisited.getCount(), ruby.getFalse()); } result = ruby.getTrue(); } } else { if (!ruby.getScope().getValue(iVisited.getCount()).isTrue()) { if (eval(iVisited.getBeginNode()).isTrue()) { //Benoit: I don't understand why the result is inversed ruby.getScope().setValue(iVisited.getCount(), eval(iVisited.getEndNode()).isTrue() ? ruby.getFalse() : ruby.getTrue()); result = ruby.getTrue(); } else { result = ruby.getFalse(); } } else { if (eval(iVisited.getEndNode()).isTrue()) { ruby.getScope().setValue(iVisited.getCount(), ruby.getFalse()); } result = ruby.getTrue(); } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); | ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self); | public void visitForNode(ForNode iVisited) { ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); // XXX ruby.getBlock().flags &= ~RubyBlock.BLOCK_D_SCOPE; Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); ruby.setSourceFile(file); ruby.setSourceLine(line); result = recv.getInternalClass().call(recv.toRubyObject(), "each", null, 0); return; } catch (RetryException rExcptn) { } } } catch (ReturnJump rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlockStack().pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = recv.getInternalClass().call(recv.toRubyObject(), "each", null, 0); | result = recv.getInternalClass().call(recv, "each", null, 0); | public void visitForNode(ForNode iVisited) { ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { String file = ruby.getSourceFile(); int line = ruby.getSourceLine(); // XXX ruby.getBlock().flags &= ~RubyBlock.BLOCK_D_SCOPE; Block tmpBlock = ArgsUtil.beginCallArgs(ruby); IRubyObject recv = eval(iVisited.getIterNode()); ArgsUtil.endCallArgs(ruby, tmpBlock); ruby.setSourceFile(file); ruby.setSourceLine(line); result = recv.getInternalClass().call(recv.toRubyObject(), "each", null, 0); return; } catch (RetryException rExcptn) { } } } catch (ReturnJump rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlockStack().pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.setGlobalVar(iVisited.getName(), result.toRubyObject()); | ruby.setGlobalVar(iVisited.getName(), result); | public void visitGlobalAsgnNode(GlobalAsgnNode iVisited) { eval(iVisited.getValueNode()); ruby.setGlobalVar(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
hash.aset(key.toRubyObject(), eval((INode) iterator.next()).toRubyObject()); | hash.aset(key, eval((INode) iterator.next())); | public void visitHashNode(HashNode iVisited) { RubyHash hash = RubyHash.newHash(ruby); if (iVisited.getListNode() != null) { Iterator iterator = iVisited.getListNode().iterator(); while (iterator.hasNext()) { IRubyObject key = eval((INode) iterator.next()); if (iterator.hasNext()) { hash.aset(key.toRubyObject(), eval((INode) iterator.next()).toRubyObject()); } else { // XXX throw new RuntimeException("[BUG] odd number list for Hash"); // XXX } } } result = hash; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
self.setInstanceVariable(iVisited.getName(), result.toRubyObject()); | self.setInstanceVariable(iVisited.getName(), result); | public void visitInstAsgnNode(InstAsgnNode iVisited) { eval(iVisited.getValueNode()); self.setInstanceVariable(iVisited.getName(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); | ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self); | public void visitIterNode(IterNode iVisited) { ruby.getBlockStack().push(iVisited.getVarNode(), new EvaluateMethod(iVisited.getBodyNode()), self.toRubyObject()); ruby.getIterStack().push(Iter.ITER_PRE); try { while (true) { try { result = eval(iVisited.getIterNode()); return; } catch (RetryException rExcptn) { } } } catch (ReturnJump rExcptn) { result = rExcptn.getReturnValue(); } catch (BreakJump bExcptn) { result = ruby.getNil(); } finally { ruby.getIterStack().pop(); ruby.getBlockStack().pop(); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
ruby.getScope().setValue(iVisited.getCount(), result.toRubyObject()); | ruby.getScope().setValue(iVisited.getCount(), result); | public void visitLocalAsgnNode(LocalAsgnNode iVisited) { eval(iVisited.getValueNode()); ruby.getScope().setValue(iVisited.getCount(), result.toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = ((RubyRegexp) eval(iVisited.getReceiverNode())).match(eval(iVisited.getValueNode()).toRubyObject()); | result = ((RubyRegexp) eval(iVisited.getReceiverNode())).match(eval(iVisited.getValueNode())); | public void visitMatch2Node(Match2Node iVisited) { result = ((RubyRegexp) eval(iVisited.getReceiverNode())).match(eval(iVisited.getValueNode()).toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = ((RubyRegexp) receiver).match(value.toRubyObject()); | result = ((RubyRegexp) receiver).match(value); | public void visitMatch3Node(Match3Node iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject value = eval(iVisited.getValueNode()); if (value instanceof RubyString) { result = ((RubyRegexp) receiver).match(value.toRubyObject()); } else { result = value.callMethod("=~", receiver.toRubyObject()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = value.callMethod("=~", receiver.toRubyObject()); | result = value.callMethod("=~", receiver); | public void visitMatch3Node(Match3Node iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject value = eval(iVisited.getValueNode()); if (value instanceof RubyString) { result = ((RubyRegexp) receiver).match(value.toRubyObject()); } else { result = value.callMethod("=~", receiver.toRubyObject()); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = new AssignmentVisitor(ruby, self.toRubyObject()).assign(iVisited, eval(iVisited.getValueNode()).toRubyObject(), false); | result = new AssignmentVisitor(ruby, self).assign(iVisited, eval(iVisited.getValueNode()), false); | public void visitMultipleAsgnNode(MultipleAsgnNode iVisited) { result = new AssignmentVisitor(ruby, self.toRubyObject()).assign(iVisited, eval(iVisited.getValueNode()).toRubyObject(), false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
value = value.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); | value = value.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode())); | public void visitOpAsgnNode(OpAsgnNode iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject value = receiver.callMethod(iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { result = value; return; } else { value = eval(iVisited.getValueNode()); } } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { result = value; return; } else { value = eval(iVisited.getValueNode()); } } else { value = value.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); } receiver.callMethod(iVisited.getVariableName() + "=", value.toRubyObject()); result = value; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
receiver.callMethod(iVisited.getVariableName() + "=", value.toRubyObject()); | receiver.callMethod(iVisited.getVariableName() + "=", value); | public void visitOpAsgnNode(OpAsgnNode iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject value = receiver.callMethod(iVisited.getVariableName()); if (iVisited.getOperatorName().equals("||")) { if (value.isTrue()) { result = value; return; } else { value = eval(iVisited.getValueNode()); } } else if (iVisited.getOperatorName().equals("&&")) { if (!value.isTrue()) { result = value; return; } else { value = eval(iVisited.getValueNode()); } } else { value = value.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); } receiver.callMethod(iVisited.getVariableName() + "=", value.toRubyObject()); result = value; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
IRubyObject firstValue = receiver.toRubyObject().callMethod("[]", args); | IRubyObject firstValue = receiver.callMethod("[]", args); | public void visitOpElementAsgnNode(OpElementAsgnNode iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject[] args = ArgsUtil.setupArgs(ruby, this, iVisited.getArgsNode()); IRubyObject firstValue = receiver.toRubyObject().callMethod("[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { result = firstValue; return; } else { firstValue = eval(iVisited.getValueNode()); } } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { result = firstValue; return; } else { firstValue = eval(iVisited.getValueNode()); } } else { firstValue = firstValue.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; result = receiver.callMethod("[]=", expandedArgs); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
firstValue = firstValue.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); | firstValue = firstValue.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode())); | public void visitOpElementAsgnNode(OpElementAsgnNode iVisited) { IRubyObject receiver = eval(iVisited.getReceiverNode()); IRubyObject[] args = ArgsUtil.setupArgs(ruby, this, iVisited.getArgsNode()); IRubyObject firstValue = receiver.toRubyObject().callMethod("[]", args); if (iVisited.getOperatorName().equals("||")) { if (firstValue.isTrue()) { result = firstValue; return; } else { firstValue = eval(iVisited.getValueNode()); } } else if (iVisited.getOperatorName().equals("&&")) { if (!firstValue.isTrue()) { result = firstValue; return; } else { firstValue = eval(iVisited.getValueNode()); } } else { firstValue = firstValue.callMethod(iVisited.getOperatorName(), eval(iVisited.getValueNode()).toRubyObject()); } IRubyObject[] expandedArgs = new IRubyObject[args.length + 1]; System.arraycopy(args, 0, expandedArgs, 0, args.length); expandedArgs[expandedArgs.length - 1] = firstValue; result = receiver.callMethod("[]=", expandedArgs); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = builtins.toArray(eval(iVisited.getArgumentNode()).toRubyObject()); | result = builtins.toArray(eval(iVisited.getArgumentNode())); | public void visitRestArgsNode(RestArgsNode iVisited) { result = builtins.toArray(eval(iVisited.getArgumentNode()).toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
throw new ReturnJump(eval(iVisited.getValueNode()).toRubyObject()); | throw new ReturnJump(eval(iVisited.getValueNode())); | public void visitReturnNode(ReturnNode iVisited) { throw new ReturnJump(eval(iVisited.getValueNode()).toRubyObject()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = self.getInternalClass().call(self.toRubyObject(), iVisited.getMethodName(), null, 2); | result = self.getInternalClass().call(self, iVisited.getMethodName(), null, 2); | public void visitVCallNode(VCallNode iVisited) { result = self.getInternalClass().call(self.toRubyObject(), iVisited.getMethodName(), null, 2); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
result = ruby.yield(result.toRubyObject(), null, null, false); | result = ruby.yield(result, null, null, false); | public void visitYieldNode(YieldNode iVisited) { eval(iVisited.getArgsNode()); if (iVisited.getArgsNode() instanceof ExpandArrayNode && ((RubyArray) result).getLength() == 1) { result = ((RubyArray) result).entry(0); } result = ruby.yield(result.toRubyObject(), null, null, false); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/f235ab756f32ea9496f8f880066b46ad95ebb692/EvaluateVisitor.java/clean/org/jruby/evaluator/EvaluateVisitor.java |
JToolBar tb = new JToolBar(); tb.setFloatable(false); tb.setBackground(Constants.CANVAS_BACKGROUND_COLOR); ButtonGroup group = new ButtonGroup(); IconFactory icons = dataManager.getIconFactory(); Icon zoomIcon = icons.getIcon("zoomMode.png"); Icon panIcon = icons.getIcon("pan.png"); | public void buildGUI() { Container content = getContentPane(); content.setLayout(new BorderLayout()); JToolBar tb = new JToolBar(); tb.setFloatable(false); tb.setBackground(Constants.CANVAS_BACKGROUND_COLOR); ButtonGroup group = new ButtonGroup(); IconFactory icons = dataManager.getIconFactory(); Icon zoomIcon = icons.getIcon("zoomMode.png"); Icon panIcon = icons.getIcon("pan.png"); if (panIcon != null) pan= new JButton(panIcon); else pan = new JButton("pan"); pan.addActionListener(this); group.add(pan); tb.add(pan); if (zoomIcon != null) zoom= new JButton(zoomIcon); else zoom = new JButton("zoom"); zoom.addActionListener(this); group.add(zoom); tb.add(zoom); pan.setEnabled(true); zoom.setEnabled(false); tb.setFloatable(false); content.add(tb,BorderLayout.NORTH); chainCanvas = new ChainPaletteCanvas(dataManager); chainCanvas.setContents(dataManager.getChains()); chainCanvas.layoutContents(); chainCanvas.completeInitialization(); content.add(chainCanvas,BorderLayout.CENTER); chainCanvas.setPreferredSize( new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); //setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); pack(); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { if (chainCanvas != null) chainCanvas.scaleToResize(); } }); //tb.setMaximumSize(tb.getSize()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/40d8ef3c95ae20905956bac6fca05c28b1912366/ChainPaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ChainPaletteWindow.java |
|
if (panIcon != null) pan= new JButton(panIcon); else pan = new JButton("pan"); pan.addActionListener(this); group.add(pan); tb.add(pan); if (zoomIcon != null) zoom= new JButton(zoomIcon); else zoom = new JButton("zoom"); zoom.addActionListener(this); group.add(zoom); tb.add(zoom); pan.setEnabled(true); zoom.setEnabled(false); tb.setFloatable(false); content.add(tb,BorderLayout.NORTH); | public void buildGUI() { Container content = getContentPane(); content.setLayout(new BorderLayout()); JToolBar tb = new JToolBar(); tb.setFloatable(false); tb.setBackground(Constants.CANVAS_BACKGROUND_COLOR); ButtonGroup group = new ButtonGroup(); IconFactory icons = dataManager.getIconFactory(); Icon zoomIcon = icons.getIcon("zoomMode.png"); Icon panIcon = icons.getIcon("pan.png"); if (panIcon != null) pan= new JButton(panIcon); else pan = new JButton("pan"); pan.addActionListener(this); group.add(pan); tb.add(pan); if (zoomIcon != null) zoom= new JButton(zoomIcon); else zoom = new JButton("zoom"); zoom.addActionListener(this); group.add(zoom); tb.add(zoom); pan.setEnabled(true); zoom.setEnabled(false); tb.setFloatable(false); content.add(tb,BorderLayout.NORTH); chainCanvas = new ChainPaletteCanvas(dataManager); chainCanvas.setContents(dataManager.getChains()); chainCanvas.layoutContents(); chainCanvas.completeInitialization(); content.add(chainCanvas,BorderLayout.CENTER); chainCanvas.setPreferredSize( new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); //setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); pack(); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { if (chainCanvas != null) chainCanvas.scaleToResize(); } }); //tb.setMaximumSize(tb.getSize()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/40d8ef3c95ae20905956bac6fca05c28b1912366/ChainPaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ChainPaletteWindow.java |
|
chainCanvas.completeInitialization(); content.add(chainCanvas,BorderLayout.CENTER); chainCanvas.setPreferredSize( new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); pack(); | chainCanvas.completeInitialization(); setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); content.add(chainCanvas); | public void buildGUI() { Container content = getContentPane(); content.setLayout(new BorderLayout()); JToolBar tb = new JToolBar(); tb.setFloatable(false); tb.setBackground(Constants.CANVAS_BACKGROUND_COLOR); ButtonGroup group = new ButtonGroup(); IconFactory icons = dataManager.getIconFactory(); Icon zoomIcon = icons.getIcon("zoomMode.png"); Icon panIcon = icons.getIcon("pan.png"); if (panIcon != null) pan= new JButton(panIcon); else pan = new JButton("pan"); pan.addActionListener(this); group.add(pan); tb.add(pan); if (zoomIcon != null) zoom= new JButton(zoomIcon); else zoom = new JButton("zoom"); zoom.addActionListener(this); group.add(zoom); tb.add(zoom); pan.setEnabled(true); zoom.setEnabled(false); tb.setFloatable(false); content.add(tb,BorderLayout.NORTH); chainCanvas = new ChainPaletteCanvas(dataManager); chainCanvas.setContents(dataManager.getChains()); chainCanvas.layoutContents(); chainCanvas.completeInitialization(); content.add(chainCanvas,BorderLayout.CENTER); chainCanvas.setPreferredSize( new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); //setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); pack(); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { if (chainCanvas != null) chainCanvas.scaleToResize(); } }); //tb.setMaximumSize(tb.getSize()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/40d8ef3c95ae20905956bac6fca05c28b1912366/ChainPaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ChainPaletteWindow.java |
public void buildGUI() { Container content = getContentPane(); content.setLayout(new BorderLayout()); JToolBar tb = new JToolBar(); tb.setFloatable(false); tb.setBackground(Constants.CANVAS_BACKGROUND_COLOR); ButtonGroup group = new ButtonGroup(); IconFactory icons = dataManager.getIconFactory(); Icon zoomIcon = icons.getIcon("zoomMode.png"); Icon panIcon = icons.getIcon("pan.png"); if (panIcon != null) pan= new JButton(panIcon); else pan = new JButton("pan"); pan.addActionListener(this); group.add(pan); tb.add(pan); if (zoomIcon != null) zoom= new JButton(zoomIcon); else zoom = new JButton("zoom"); zoom.addActionListener(this); group.add(zoom); tb.add(zoom); pan.setEnabled(true); zoom.setEnabled(false); tb.setFloatable(false); content.add(tb,BorderLayout.NORTH); chainCanvas = new ChainPaletteCanvas(dataManager); chainCanvas.setContents(dataManager.getChains()); chainCanvas.layoutContents(); chainCanvas.completeInitialization(); content.add(chainCanvas,BorderLayout.CENTER); chainCanvas.setPreferredSize( new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); //setSize(new Dimension(ModulePaletteWindow.SIDE,ModulePaletteWindow.SIDE)); pack(); addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { if (chainCanvas != null) chainCanvas.scaleToResize(); } }); //tb.setMaximumSize(tb.getSize()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/40d8ef3c95ae20905956bac6fca05c28b1912366/ChainPaletteWindow.java/clean/SRC/org/openmicroscopy/shoola/agents/chainbuilder/ui/ChainPaletteWindow.java |
||
return start + (int) (end *java.lang.Math.random()/(Integer.MAX_VALUE+1.0)); | return start + (int)((end - start + 1) * java.lang.Math.random()); | public static final int random(int start, int end) { return start + (int) (end *java.lang.Math.random()/(Integer.MAX_VALUE+1.0)); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/6fd8ce98fadcf4569b8c610257ec353cc5d9b7df/MathTool.java/clean/webmacro/src/org/webmacro/servlet/MathTool.java |
if (! user.getId().equals( 0L )) | if ( user.getId().equals( 0L )) { if ( updatedDetails.getOwner() == null ) { updatedDetails.setOwner( oldDetails.getOwner() ); } } else | protected void checkManagedState( IObject obj ) { Details currentDetails = CurrentDetails.createDetails(); Experimenter user = currentDetails.getOwner(); ExperimenterGroup group = currentDetails.getGroup(); if ( obj.getId() == null) throw new ValidationException( "Id required on all detached instances."); // Throws an exception if does not exist IObject original = (IObject) hibernateOps.load( Utils.trueClass( obj.getClass() ), obj.getId() ); if ( obj == original ) return; // Early exit. Obj is in session. Details oldDetails = original.getDetails(); Details updatedDetails = obj.getDetails(); // This happens if all fields of details are null. if ( oldDetails == null ) { if ( obj.getDetails() != null ) { obj.setDetails( null ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to null like original"); } } } // Probably common since users don't worry about this information. else if ( updatedDetails == null ) { obj.setDetails( new Details( oldDetails ) ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to copy of original details."); } // Now we have to make sure certain things do not happen: } else { if ( ! idEqual( oldDetails.getOwner(), updatedDetails.getOwner() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Owner id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getGroup(), updatedDetails.getGroup() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Group id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getCreationEvent(), updatedDetails.getCreationEvent())) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Creation event changed for %s", obj )); } } } if ( obj instanceof IMutable ) { Integer version = ((IMutable) obj).getVersion(); if ( version == null || version.intValue() < 0 );// throw new ValidationException(// "Version must properly be set on managed objects :\n"+// obj.toString()// ); //TODO } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0039ef3c66932163f0ec9bfa2b7f37eaa70abe47/UpdateFilter.java/buggy/components/server/src/ome/tools/hibernate/UpdateFilter.java |
if (! user.getId().equals( 0L )) | if ( user.getId().equals( 0L )) { if ( updatedDetails.getGroup() == null ) { updatedDetails.setGroup( oldDetails.getGroup() ); } } else | protected void checkManagedState( IObject obj ) { Details currentDetails = CurrentDetails.createDetails(); Experimenter user = currentDetails.getOwner(); ExperimenterGroup group = currentDetails.getGroup(); if ( obj.getId() == null) throw new ValidationException( "Id required on all detached instances."); // Throws an exception if does not exist IObject original = (IObject) hibernateOps.load( Utils.trueClass( obj.getClass() ), obj.getId() ); if ( obj == original ) return; // Early exit. Obj is in session. Details oldDetails = original.getDetails(); Details updatedDetails = obj.getDetails(); // This happens if all fields of details are null. if ( oldDetails == null ) { if ( obj.getDetails() != null ) { obj.setDetails( null ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to null like original"); } } } // Probably common since users don't worry about this information. else if ( updatedDetails == null ) { obj.setDetails( new Details( oldDetails ) ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to copy of original details."); } // Now we have to make sure certain things do not happen: } else { if ( ! idEqual( oldDetails.getOwner(), updatedDetails.getOwner() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Owner id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getGroup(), updatedDetails.getGroup() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Group id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getCreationEvent(), updatedDetails.getCreationEvent())) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Creation event changed for %s", obj )); } } } if ( obj instanceof IMutable ) { Integer version = ((IMutable) obj).getVersion(); if ( version == null || version.intValue() < 0 );// throw new ValidationException(// "Version must properly be set on managed objects :\n"+// obj.toString()// ); //TODO } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0039ef3c66932163f0ec9bfa2b7f37eaa70abe47/UpdateFilter.java/buggy/components/server/src/ome/tools/hibernate/UpdateFilter.java |
if (! user.getId().equals( 0L )) | if ( user.getId().equals( 0L )) | protected void checkManagedState( IObject obj ) { Details currentDetails = CurrentDetails.createDetails(); Experimenter user = currentDetails.getOwner(); ExperimenterGroup group = currentDetails.getGroup(); if ( obj.getId() == null) throw new ValidationException( "Id required on all detached instances."); // Throws an exception if does not exist IObject original = (IObject) hibernateOps.load( Utils.trueClass( obj.getClass() ), obj.getId() ); if ( obj == original ) return; // Early exit. Obj is in session. Details oldDetails = original.getDetails(); Details updatedDetails = obj.getDetails(); // This happens if all fields of details are null. if ( oldDetails == null ) { if ( obj.getDetails() != null ) { obj.setDetails( null ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to null like original"); } } } // Probably common since users don't worry about this information. else if ( updatedDetails == null ) { obj.setDetails( new Details( oldDetails ) ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to copy of original details."); } // Now we have to make sure certain things do not happen: } else { if ( ! idEqual( oldDetails.getOwner(), updatedDetails.getOwner() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Owner id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getGroup(), updatedDetails.getGroup() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Group id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getCreationEvent(), updatedDetails.getCreationEvent())) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Creation event changed for %s", obj )); } } } if ( obj instanceof IMutable ) { Integer version = ((IMutable) obj).getVersion(); if ( version == null || version.intValue() < 0 );// throw new ValidationException(// "Version must properly be set on managed objects :\n"+// obj.toString()// ); //TODO } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0039ef3c66932163f0ec9bfa2b7f37eaa70abe47/UpdateFilter.java/buggy/components/server/src/ome/tools/hibernate/UpdateFilter.java |
if ( updatedDetails.getCreationEvent() == null ) { updatedDetails.setCreationEvent( oldDetails.getCreationEvent() ); } } else { | protected void checkManagedState( IObject obj ) { Details currentDetails = CurrentDetails.createDetails(); Experimenter user = currentDetails.getOwner(); ExperimenterGroup group = currentDetails.getGroup(); if ( obj.getId() == null) throw new ValidationException( "Id required on all detached instances."); // Throws an exception if does not exist IObject original = (IObject) hibernateOps.load( Utils.trueClass( obj.getClass() ), obj.getId() ); if ( obj == original ) return; // Early exit. Obj is in session. Details oldDetails = original.getDetails(); Details updatedDetails = obj.getDetails(); // This happens if all fields of details are null. if ( oldDetails == null ) { if ( obj.getDetails() != null ) { obj.setDetails( null ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to null like original"); } } } // Probably common since users don't worry about this information. else if ( updatedDetails == null ) { obj.setDetails( new Details( oldDetails ) ); if ( log.isDebugEnabled() ) { log.debug("Setting details on "+ obj+" to copy of original details."); } // Now we have to make sure certain things do not happen: } else { if ( ! idEqual( oldDetails.getOwner(), updatedDetails.getOwner() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Owner id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getGroup(), updatedDetails.getGroup() )) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Group id changed for %s", obj )); } } if ( ! idEqual( oldDetails.getCreationEvent(), updatedDetails.getCreationEvent())) { if (! user.getId().equals( 0L )) { throw new SecurityViolation(String.format( "Creation event changed for %s", obj )); } } } if ( obj instanceof IMutable ) { Integer version = ((IMutable) obj).getVersion(); if ( version == null || version.intValue() < 0 );// throw new ValidationException(// "Version must properly be set on managed objects :\n"+// obj.toString()// ); //TODO } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/0039ef3c66932163f0ec9bfa2b7f37eaa70abe47/UpdateFilter.java/buggy/components/server/src/ome/tools/hibernate/UpdateFilter.java |
|
TreeViewNode root = uiDelegate.getRoot(); if (root.equals(node)) return; | void collapseNode(TreeViewNode node) { if (node == null) return; uiDelegate.getTree().collapsePath(new TreePath(node.getPath())); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/660dfd7d9dcef480da4c01224d8ac97fe68e3f63/TreeView.java/buggy/SRC/org/openmicroscopy/shoola/agents/hiviewer/treeview/TreeView.java |
|
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyAcrossT(PlaneArea pa, int from, int to, int z) { int index = presentation.getToolBar().getSelectedIndex(); abstraction.copyAcrossT(pa, index, from, to, z); int t = getCurrentT(); if (z == getCurrentZ() && (t >= from || t <= to)) { PlaneArea p = abstraction.getPlaneArea(z, t, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyAcrossZ(PlaneArea pa, int from, int to, int t) { int index = presentation.getToolBar().getSelectedIndex(); abstraction.copyAcrossZ(pa, index, from, to, t); //Need to refresh the view. int z = getCurrentZ(); if (t == getCurrentT() && (z >= from || z <= to)) { PlaneArea p = abstraction.getPlaneArea(z, t, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyAcrossZAndT(PlaneArea pa, int fromZ, int toZ, int fromT, int toT) { int index = presentation.getToolBar().getSelectedIndex(); int t = getCurrentT(), z = getCurrentZ(); abstraction.copyAcrossZAndT(pa, index, fromZ, toZ, fromT, toT); if ((z >= fromZ || z <= toZ) && (t >= fromT || t <= toT)) { PlaneArea p = abstraction.getPlaneArea(z, t, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyPlaneArea(PlaneArea pa, int newZ, int newT) { int index = presentation.getToolBar().getSelectedIndex(); abstraction.copyPlaneArea(pa, index, newZ, newT); if (newT == getCurrentT() && newZ == getCurrentZ()) { PlaneArea p = abstraction.getPlaneArea(newZ, newT, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyStack(int from, int to) { int index = presentation.getToolBar().getSelectedIndex(); abstraction.copyStack(index, from, to); int t = getCurrentT(); if (t == from || t == to) { PlaneArea p = abstraction.getPlaneArea(getCurrentZ(), t, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); | if (p != null) { p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } | public void copyStackAcrossT(int from, int to) { int index = presentation.getToolBar().getSelectedIndex(); abstraction.copyStackAcrossT(index, from, to); int t = getCurrentT(); if (t >= from || t <= to) { PlaneArea p = abstraction.getPlaneArea(getCurrentZ(), t, index); p.scale(abstraction.getMagFactor()); drawingCanvas.setPlaneArea(p, index); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c12f71277eaacb3789cec24cc403ad97d09fa0af/ROIAgtCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/roi/ROIAgtCtrl.java |
super(control.getReferenceFrame(), "ROI Results", true); paneMap = new HashMap(); | super(control.getReferenceFrame(), "ROI Results"); init(); | public ROIResults(ROIAgtCtrl control, int sizeT, int sizeZ) { super(control.getReferenceFrame(), "ROI Results", true); paneMap = new HashMap(); manager = new ROIResultsMng(this, control); IconManager im = IconManager.getInstance(control.getRegistry()); JPanel p = buildTabbedPanel(control, im, sizeT, sizeZ); buildGUI(im, p); setSize(WIDTH, HEIGHT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3db37517e6873d11567ee5822e769ab058e1abed/ROIResults.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/results/ROIResults.java |
if (newIter == iter) { count ++; } else { prev = new RubyIter(iter, prev); iter = newIter; } | prev = new RubyIter(iter, prev); iter = newIter; | public void push(int newIter) { if (newIter == iter) { count ++; } else { prev = new RubyIter(iter, prev); iter = newIter; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2c6d31ae5651a0a0c68c2bb382ab68cea34c67d7/RubyIter.java/buggy/org/jruby/runtime/RubyIter.java |
scope = ruby.getScope(); | scope = (Scope)ruby.getScope().getTop(); | public void push(Node v, Node b, RubyObject newSelf) { RubyBlock oldBlock = new RubyBlock(var, body, self, frame, scope, klass, iter, vmode, flags, dynamicVars, origThread, prev, ruby); var = v; body = b; self = newSelf; frame = ruby.getRubyFrame(); klass = ruby.getRubyClass(); frame.setFile(ruby.getSourceFile()); frame.setLine(ruby.getSourceLine()); scope = ruby.getScope(); prev = oldBlock; iter = ruby.getIter().getIter(); vmode = ruby.getActMethodScope(); flags = BLOCK_D_SCOPE; dynamicVars = ruby.getDynamicVars(); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/e774974ded4f5d3e83d7f3e7d5f152a6de3fffee/RubyBlock.java/buggy/org/jruby/runtime/RubyBlock.java |
if (count > 0) { count --; } else { iter = prev.iter; prev = prev.prev; } | iter = prev.iter; prev = prev.prev; | public void pop() { if (count > 0) { count --; } else { iter = prev.iter; prev = prev.prev; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/2c6d31ae5651a0a0c68c2bb382ab68cea34c67d7/RubyIter.java/buggy/org/jruby/runtime/RubyIter.java |
public static IObject createIObject(DataObject child, DataObject parent) { if (child instanceof ProjectData) { ProjectData data = (ProjectData) child; Project model = new Project(); model.setName(data.getName()); model.setDescription(data.getDescription()); return model; } else if (child instanceof CategoryGroupData) { CategoryGroupData data = (CategoryGroupData) child; CategoryGroup model = new CategoryGroup(); model.setName(data.getName()); model.setDescription(data.getDescription()); return model; } else if (child instanceof DatasetData) { if (!(parent instanceof ProjectData)) throw new IllegalArgumentException("Parent not valid."); DatasetData data = (DatasetData) child; Dataset model = new Dataset(); model.setName(data.getName()); model.setDescription(data.getDescription()); model.linkProject(new Project(new Long(parent.getId()), false)); //model.linkProject(parent.asProject()); return model; } else if (child instanceof CategoryData) { if (!(parent instanceof CategoryGroupData)) throw new IllegalArgumentException("Parent not valid."); CategoryData data = (CategoryData) child; Category model = new Category(); model.setName(data.getName()); model.setDescription(data.getDescription()); model.linkCategoryGroup(new CategoryGroup(new Long(parent.getId()), false)); return model; } else if (child instanceof ImageData) { if (!(parent instanceof CategoryData) && !(parent instanceof DatasetData)) throw new IllegalArgumentException("Parent not valid."); ImageData data = (ImageData) child; Image model = new Image(); model.setName(data.getName()); model.setDescription(data.getDescription()); if (parent instanceof CategoryData) model.linkCategory(new Category(new Long(parent.getId()), false)); else if (parent instanceof DatasetData) model.linkDataset(new Dataset(new Long(parent.getId()), false)); return model; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f345c83a3d27921d1ebc5f67fd2e08baf108a708/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
||
mChild.unlinkProject(mParent); return mChild; | mParent.unlinkDataset(mChild); return mParent; | public static IObject removeIObject(IObject child, IObject parent) { if ((child instanceof Dataset) && (parent instanceof Project)) { Dataset mChild = (Dataset) child; Project mParent = (Project) parent; mChild.unlinkProject(mParent); return mChild; } else if ((child instanceof Category) && (parent instanceof CategoryGroup)) { Category mChild = (Category) child; CategoryGroup mParent = (CategoryGroup) parent;; mChild.unlinkCategoryGroup(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Dataset)) { Image mChild = (Image) child; Dataset mParent = (Dataset) parent; mChild.unlinkDataset(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Category)) { Image mChild = (Image) child; Category mParent = (Category) parent; mChild.unlinkCategory(mParent); return mChild; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f345c83a3d27921d1ebc5f67fd2e08baf108a708/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
CategoryGroup mParent = (CategoryGroup) parent;; mChild.unlinkCategoryGroup(mParent); return mChild; | CategoryGroup mParent = (CategoryGroup) parent; mParent.unlinkCategory(mChild); return mParent; | public static IObject removeIObject(IObject child, IObject parent) { if ((child instanceof Dataset) && (parent instanceof Project)) { Dataset mChild = (Dataset) child; Project mParent = (Project) parent; mChild.unlinkProject(mParent); return mChild; } else if ((child instanceof Category) && (parent instanceof CategoryGroup)) { Category mChild = (Category) child; CategoryGroup mParent = (CategoryGroup) parent;; mChild.unlinkCategoryGroup(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Dataset)) { Image mChild = (Image) child; Dataset mParent = (Dataset) parent; mChild.unlinkDataset(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Category)) { Image mChild = (Image) child; Category mParent = (Category) parent; mChild.unlinkCategory(mParent); return mChild; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f345c83a3d27921d1ebc5f67fd2e08baf108a708/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
mChild.unlinkDataset(mParent); return mChild; | mParent.unlinkImage(mChild); return mParent; | public static IObject removeIObject(IObject child, IObject parent) { if ((child instanceof Dataset) && (parent instanceof Project)) { Dataset mChild = (Dataset) child; Project mParent = (Project) parent; mChild.unlinkProject(mParent); return mChild; } else if ((child instanceof Category) && (parent instanceof CategoryGroup)) { Category mChild = (Category) child; CategoryGroup mParent = (CategoryGroup) parent;; mChild.unlinkCategoryGroup(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Dataset)) { Image mChild = (Image) child; Dataset mParent = (Dataset) parent; mChild.unlinkDataset(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Category)) { Image mChild = (Image) child; Category mParent = (Category) parent; mChild.unlinkCategory(mParent); return mChild; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f345c83a3d27921d1ebc5f67fd2e08baf108a708/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
mChild.unlinkCategory(mParent); return mChild; | mParent.unlinkImage(mChild); return mParent; | public static IObject removeIObject(IObject child, IObject parent) { if ((child instanceof Dataset) && (parent instanceof Project)) { Dataset mChild = (Dataset) child; Project mParent = (Project) parent; mChild.unlinkProject(mParent); return mChild; } else if ((child instanceof Category) && (parent instanceof CategoryGroup)) { Category mChild = (Category) child; CategoryGroup mParent = (CategoryGroup) parent;; mChild.unlinkCategoryGroup(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Dataset)) { Image mChild = (Image) child; Dataset mParent = (Dataset) parent; mChild.unlinkDataset(mParent); return mChild; } else if ((child instanceof Image) && (parent instanceof Category)) { Image mChild = (Image) child; Category mParent = (Category) parent; mChild.unlinkCategory(mParent); return mChild; } throw new IllegalArgumentException("DataObject not supported."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/f345c83a3d27921d1ebc5f67fd2e08baf108a708/ModelMapper.java/buggy/SRC/org/openmicroscopy/shoola/env/data/util/ModelMapper.java |
public void removeAll(boolean dispose) { int k = windows.size(); if (k == 0) return; JFrame[] wIterator = new JFrame[k]; windows.keySet().toArray(wIterator); for (k = 0; k < wIterator.length; ++k) remove(wIterator[k], dispose); } | public void removeAll() { removeAll(false); } | public void removeAll(boolean dispose) { int k = windows.size(); if (k == 0) return; JFrame[] wIterator = new JFrame[k]; windows.keySet().toArray(wIterator); //NOTE: Using Iterator would cause a ConcurrentModificationException. for (k = 0; k < wIterator.length; ++k) remove(wIterator[k], dispose); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/TopWindowGroup.java/buggy/SRC/org/openmicroscopy/shoola/env/ui/TopWindowGroup.java |
CGI_Impersonator cgi = new CGI_Impersonator(wc.getRequest()); | CGI_Impersonator cgi = new CGI_Impersonator(wc); | public Object init(Context context) throws PropertyException { try { WebContext wc = (WebContext) context; CGI_Impersonator cgi = new CGI_Impersonator(wc.getRequest()); return cgi; } catch (ClassCastException ce) { throw new PropertyException( "CGITool only works with WebContext", ce); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4603f6cee8b46d51274d6e6b533212c93f0fb160/CGITool.java/clean/webmacro/src/org/webmacro/servlet/CGITool.java |
CGI_Impersonator(final HttpServletRequest r) { requst_ = r; | CGI_Impersonator(WebContext wc) { requst_ = wc.getRequest(); sc_ = ((ServletBroker)wc.getBroker()).getServletContext(); | CGI_Impersonator(final HttpServletRequest r) { requst_ = r; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/4603f6cee8b46d51274d6e6b533212c93f0fb160/CGI_Impersonator.java/buggy/webmacro/src/org/webmacro/servlet/CGI_Impersonator.java |
if (pattern.indexOf("**") != -1 || pattern.indexOf("?") != -1) { | /*if (pattern.indexOf("**") != -1 || pattern.indexOf("?") != -1) { | public static RubyArray glob(Ruby ruby, RubyObject recv, RubyString pat) { // FIXME this is only a small subset of the functionallity of this function String pattern = pat.toString(); if (pattern.indexOf("**") != -1 || pattern.indexOf("?") != -1) { throw new NotImplementedError(); } final File patternFile = new File(pattern); String[] files = patternFile.getParentFile().list(new FilenameFilter() { public boolean accept(File dir, String name) { String patternName = patternFile.getName(); return name.startsWith(patternName.substring(0, patternName.indexOf('*'))) && name.endsWith(patternName.substring(patternName.indexOf('*') + 1)); } }); return RubyArray.newArray(ruby, JavaUtil.convertJavaArrayToRuby(ruby, files)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyDir.java/clean/org/jruby/RubyDir.java |
} | }*/ | public static RubyArray glob(Ruby ruby, RubyObject recv, RubyString pat) { // FIXME this is only a small subset of the functionallity of this function String pattern = pat.toString(); if (pattern.indexOf("**") != -1 || pattern.indexOf("?") != -1) { throw new NotImplementedError(); } final File patternFile = new File(pattern); String[] files = patternFile.getParentFile().list(new FilenameFilter() { public boolean accept(File dir, String name) { String patternName = patternFile.getName(); return name.startsWith(patternName.substring(0, patternName.indexOf('*'))) && name.endsWith(patternName.substring(patternName.indexOf('*') + 1)); } }); return RubyArray.newArray(ruby, JavaUtil.convertJavaArrayToRuby(ruby, files)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyDir.java/clean/org/jruby/RubyDir.java |
final File patternFile = new File(pattern); String[] files = patternFile.getParentFile().list(new FilenameFilter() { public boolean accept(File dir, String name) { String patternName = patternFile.getName(); return name.startsWith(patternName.substring(0, patternName.indexOf('*'))) && name.endsWith(patternName.substring(patternName.indexOf('*') + 1)); } }); | String[] files = new File(".").list(new GlobFilenameFilter(pattern)); | public static RubyArray glob(Ruby ruby, RubyObject recv, RubyString pat) { // FIXME this is only a small subset of the functionallity of this function String pattern = pat.toString(); if (pattern.indexOf("**") != -1 || pattern.indexOf("?") != -1) { throw new NotImplementedError(); } final File patternFile = new File(pattern); String[] files = patternFile.getParentFile().list(new FilenameFilter() { public boolean accept(File dir, String name) { String patternName = patternFile.getName(); return name.startsWith(patternName.substring(0, patternName.indexOf('*'))) && name.endsWith(patternName.substring(patternName.indexOf('*') + 1)); } }); return RubyArray.newArray(ruby, JavaUtil.convertJavaArrayToRuby(ruby, files)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/6076c5ab87d25a488469aa1a32f1d2c9c9e470b2/RubyDir.java/clean/org/jruby/RubyDir.java |
if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { } } | protected InputStream loadResource(String uri) { // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { logger.debug("Could not find resource: " + uri); } } return in; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/11df53b59b983bed2ad4569b2462495157cef4ff/XBeanXmlBeanDefinitionParser.java/clean/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java |
|
if (patternIsRelative && path.startsWith(cwd)) { | if (patternIsRelative && !path.equals(cwd) && path.startsWith(cwd)) { | public ArrayList getMatchedFiles() { ArrayList fileNames = new ArrayList(); int size = files.size(); int offset = cwd.endsWith("/") ? 0 : 1; for (int i = 0; i < size; i++) { String path = ((NormalizedFile) files.get(i)).getPath(); String name; if (patternIsRelative && path.startsWith(cwd)) { // chop off cwd when returning results name = path.substring(cwd.length() + offset); } else { name = path; } if (endsWithDelimeter) { name += "/"; } fileNames.add(name.replace('\\', '/')); } return fileNames; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/109832c3a4ccc01386ec87169a6a10abbfd2dc1a/Glob.java/buggy/src/org/jruby/util/Glob.java |
dispatcher.fireModeCancel(); | if(dispatcher != null) { dispatcher.fireModeCancel(); } | private void init() { gradPanel = new HeatMapGradientUI(); statusPanel = new HeatMapStatusUI(); modeBar = new HeatMapModeBar(); scaleBar = new HeatMapScaleBar(); addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent arg0) { dispatcher.fireModeCancel(); } public void internalFrameActivated(InternalFrameEvent arg0) { dispatcher.fireModeReactivate(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cdc302a63d2c856c57cfa903575751e3fb653601/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
dispatcher.fireModeReactivate(); | if(dispatcher != null) { dispatcher.fireModeReactivate(); } | private void init() { gradPanel = new HeatMapGradientUI(); statusPanel = new HeatMapStatusUI(); modeBar = new HeatMapModeBar(); scaleBar = new HeatMapScaleBar(); addInternalFrameListener(new InternalFrameAdapter() { public void internalFrameClosing(InternalFrameEvent arg0) { dispatcher.fireModeCancel(); } public void internalFrameActivated(InternalFrameEvent arg0) { dispatcher.fireModeReactivate(); } }); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cdc302a63d2c856c57cfa903575751e3fb653601/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
dispatcher.fireModeReactivate(); | if(dispatcher != null) { dispatcher.fireModeReactivate(); } | public void internalFrameActivated(InternalFrameEvent arg0) { dispatcher.fireModeReactivate(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cdc302a63d2c856c57cfa903575751e3fb653601/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
dispatcher.fireModeCancel(); | if(dispatcher != null) { dispatcher.fireModeCancel(); } | public void internalFrameClosing(InternalFrameEvent arg0) { dispatcher.fireModeCancel(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/cdc302a63d2c856c57cfa903575751e3fb653601/HeatMapUI.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/heatmap/HeatMapUI.java |
suite.addTest(new TestSuite(TestRubyCollect.class)); | public static Test suite() { TestSuite suite = new TestSuite(); suite.addTest(new TestSuite(TestRubyObject.class)); suite.addTest(new TestSuite(TestRubyNil.class)); suite.addTest(new TestSuite(TestRubyHash.class)); suite.addTest(new TestSuite(TestRubyTime.class)); suite.addTest(new TestSuite(TestRuby.class)); suite.addTest(new TestSuite(TestJavaUtil.class)); suite.addTest(new TestSuite(TestKernel.class)); return suite; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/9960c796f1a8a81da5d0779455626a58fbe6d62e/MainTestSuite.java/clean/org/jruby/test/MainTestSuite.java |
|
} catch(MainExitException e) { if(e.isAborted()) { return e.getStatus(); } else { throw e; } | private int runInterpreter(CommandlineParser commandline) { Reader reader = commandline.getScriptSource(); String filename = commandline.displayedFileName(); IRuby runtime = Ruby.newInstance(in, out, err, commandline.isObjectSpaceEnabled()); runtime.setEncoding(commandline.getEncoding()); try { runInterpreter(runtime, reader, filename); return 0; } catch (JumpException je) { if (je.getJumpType() == JumpException.JumpType.RaiseJump) { RubyException raisedException = ((RaiseException)je).getException(); if (raisedException.isKindOf(runtime.getClass("SystemExit"))) { RubyFixnum status = (RubyFixnum)raisedException.getInstanceVariable("status"); if (status != null) { return RubyNumeric.fix2int(status); } else { return 0; } } else { runtime.printError(raisedException); return 1; } } else if (je.getJumpType() == JumpException.JumpType.ThrowJump) { runtime.printError((RubyException)je.getTertiaryData()); return 1; } else { throw je; } } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/4312f891f233f275731e5d8afa842df31058fc8e/Main.java/clean/src/org/jruby/Main.java |
|
result.defineMethod("synchronized", callbackFactory.getMethod("ruby_synchronized")); | protected static void registerRubyMethods(IRuby runtime, RubyClass result) { CallbackFactory callbackFactory = runtime.callbackFactory(JavaObject.class); result.defineMethod("to_s", callbackFactory.getMethod("to_s")); result.defineMethod("==", callbackFactory.getMethod("equal", IRubyObject.class)); result.defineMethod("eql?", callbackFactory.getMethod("equal", IRubyObject.class)); result.defineMethod("equal?", callbackFactory.getMethod("same", IRubyObject.class)); result.defineMethod("hash", callbackFactory.getMethod("hash")); result.defineMethod("java_type", callbackFactory.getMethod("java_type")); result.defineMethod("java_class", callbackFactory.getMethod("java_class")); result.defineMethod("java_proxy?", callbackFactory.getMethod("is_java_proxy")); result.defineMethod("length", callbackFactory.getMethod("length")); result.defineMethod("[]", callbackFactory.getMethod("aref", IRubyObject.class)); result.defineMethod("[]=", callbackFactory.getMethod("aset", IRubyObject.class, IRubyObject.class)); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b5d01a41bff7a2404e77344585ba8ef89470f08a/JavaObject.java/buggy/src/org/jruby/javasupport/JavaObject.java |
|
if (className == null) { return null; } | protected BeanInfo getBeanInfo(String className) throws BeanDefinitionStoreException { BeanInfo info = null; Class type = null; try { type = loadClass(className); } catch (ClassNotFoundException e) { throw new BeanDefinitionStoreException("Failed to load type: " + className + ". Reason: " + e, e); } try { info = Introspector.getBeanInfo(type); } catch (IntrospectionException e) { throw new BeanDefinitionStoreException("Failed to introspect type: " + className + ". Reason: " + e, e); } return info; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/438aa707be746e2381b40041b37ebd6b00c23429/XBeanXmlBeanDefinitionParser.java/clean/spring/src/java/org/xbean/spring/context/impl/XBeanXmlBeanDefinitionParser.java |
|
return Collections.EMPTY_LIST; | return EMPTY_LIST; | public List childNodes() { return Collections.EMPTY_LIST; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/InstVarNode.java/buggy/src/org/jruby/ast/InstVarNode.java |
camera.addChild((PanCameraNode)iter.next()); | camera.addChild(0,(PanCameraNode)iter.next()); | protected void recalculatePanNodes() { for(Iterator iter = panNodeList.iterator(); iter.hasNext();) { camera.removeChild((PanCameraNode)iter.next()); } panNodeList.clear(); double netAmount = camera.localToView(new Point2D.Double(panSpeed,0)).getX(); PanCameraNode nwNode = new PanCameraNode(new Rectangle2D.Double(0,0, edgeDistance, edgeDistance), netAmount, netAmount); // make the happy fun activated arrow. GeneralPath arrow = new GeneralPath(); arrow.moveTo(5,5); arrow.lineTo(35,5); arrow.lineTo(5,35); arrow.closePath(); nwNode.setIndicatorShape(arrow); PanCameraNode nNode = new PanCameraNode(new Rectangle2D.Double( edgeDistance,0, cameraBounds.getWidth()- (edgeDistance*2), edgeDistance), 0, netAmount); arrow = new GeneralPath(); arrow.moveTo((float)cameraBounds.getCenterX(),5); arrow.lineTo((float)cameraBounds.getCenterX()-21,26); arrow.lineTo((float)cameraBounds.getCenterX()+21,26); arrow.closePath(); nNode.setIndicatorShape(arrow); PanCameraNode neNode = new PanCameraNode(new Rectangle2D.Double( (cameraBounds.getWidth()- edgeDistance),0, edgeDistance, edgeDistance), -netAmount, netAmount); arrow = new GeneralPath(); arrow.moveTo((float)cameraBounds.getWidth()-5,5); arrow.lineTo((float)cameraBounds.getWidth()-35,5); arrow.lineTo((float)cameraBounds.getWidth()-5,35); arrow.closePath(); neNode.setIndicatorShape(arrow); PanCameraNode eNode = new PanCameraNode(new Rectangle2D.Double( (cameraBounds.getWidth()- edgeDistance), edgeDistance, edgeDistance, cameraBounds.getHeight()- (edgeDistance*2)), -netAmount, 0); arrow = new GeneralPath(); arrow.moveTo((float)cameraBounds.getWidth()-5, (float)cameraBounds.getCenterY()); arrow.lineTo((float)cameraBounds.getWidth()-26, (float)cameraBounds.getCenterY()-21); arrow.lineTo((float)cameraBounds.getWidth()-26, (float)cameraBounds.getCenterY()+21); arrow.closePath(); eNode.setIndicatorShape(arrow); PanCameraNode seNode = new PanCameraNode(new Rectangle2D.Double( (cameraBounds.getWidth()- edgeDistance), (cameraBounds.getHeight()- edgeDistance), edgeDistance, edgeDistance), -netAmount, -netAmount); arrow = new GeneralPath(); arrow.moveTo((float)cameraBounds.getWidth()-5, (float)cameraBounds.getHeight()-5); arrow.lineTo((float)cameraBounds.getWidth()-35, (float)cameraBounds.getHeight()-5); arrow.lineTo((float)cameraBounds.getWidth()-5, (float)cameraBounds.getHeight()-35); arrow.closePath(); seNode.setIndicatorShape(arrow); PanCameraNode sNode = new PanCameraNode(new Rectangle2D.Double( edgeDistance, (cameraBounds.getHeight()- edgeDistance), (cameraBounds.getWidth()- edgeDistance*2), edgeDistance), 0, -netAmount); arrow = new GeneralPath(); arrow.moveTo((float)cameraBounds.getCenterX(), (float)cameraBounds.getHeight()-5); arrow.lineTo((float)cameraBounds.getCenterX()-21, (float)cameraBounds.getHeight()-26); arrow.lineTo((float)cameraBounds.getCenterX()+21, (float)cameraBounds.getHeight()-26); arrow.closePath(); sNode.setIndicatorShape(arrow); PanCameraNode swNode = new PanCameraNode(new Rectangle2D.Double(0, (cameraBounds.getHeight()- edgeDistance), edgeDistance, edgeDistance), netAmount, -netAmount); arrow = new GeneralPath(); arrow.moveTo(5,(float)cameraBounds.getHeight()-5); arrow.lineTo(5,(float)cameraBounds.getHeight()-35); arrow.lineTo(35,(float)cameraBounds.getHeight()-5); arrow.closePath(); swNode.setIndicatorShape(arrow); PanCameraNode wNode = new PanCameraNode(new Rectangle2D.Double(0, edgeDistance, edgeDistance, (cameraBounds.getHeight()- edgeDistance*2)), netAmount, 0); arrow = new GeneralPath(); arrow.moveTo(5,(float)cameraBounds.getCenterY()); arrow.lineTo(26,(float)cameraBounds.getCenterY()-21); arrow.lineTo(26,(float)cameraBounds.getCenterY()+21); arrow.closePath(); wNode.setIndicatorShape(arrow); panNodeList.add(nwNode); panNodeList.add(nNode); panNodeList.add(neNode); panNodeList.add(eNode); panNodeList.add(seNode); panNodeList.add(sNode); panNodeList.add(swNode); panNodeList.add(wNode); for(Iterator iter = panNodeList.iterator(); iter.hasNext();) { camera.addChild((PanCameraNode)iter.next()); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5214c63d0780f0ad6707f85bd79e0dbdfdc21e65/BrowserCamera.java/clean/SRC/org/openmicroscopy/shoola/agents/browser/BrowserCamera.java |
p.getChildren().add(WFUtil.getText(" ")); HtmlOutputText t = WFUtil.getTextVB(ref + "categoryNames"); t.setConverter(new WFCommaSeparatedListConverter()); g = WFUtil.group(localizer.getHeaderTextVB("categories"), WFUtil.getHeaderText(": ")); g.getChildren().add(t); p.getChildren().add(g); | private UIComponent getDetailPanel() { WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(1); //Add the detailed info p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getHeaderTextVB(ref + "headline")); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.getTextVB(ref + "teaser")); p.getChildren().add(WFUtil.getText(" ")); WFPlainOutputText bodyText = new WFPlainOutputText(); WFUtil.setValueBinding(bodyText, "value", ref + "body"); p.getChildren().add(bodyText); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(new WFPlainOutputText("<hr/>")); UIComponent g = WFUtil.group(localizer.getHeaderTextVB("author"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "author")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("created"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "creationDate")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); HtmlOutputText t = WFUtil.getTextVB(ref + "categoryNames"); t.setConverter(new WFCommaSeparatedListConverter()); g = WFUtil.group(localizer.getHeaderTextVB("categories"), WFUtil.getHeaderText(": ")); g.getChildren().add(t); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getHeaderText(": "));// g.getChildren().add(WFUtil.getTextVB(ref + "versionId")); g.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("comment"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "comment")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("source"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "source")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); WebDAVFileDetails details = new WebDAVFileDetails(); WFUtil.setValueBinding(details,"currentResourcePath",ref+"resourcePath"); p.getChildren().add(details); return p; } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/5db26355cf68616cbd8859fa37cd6aa73d783808/ArticleDetailView.java/clean/src/java/com/idega/block/article/component/ArticleDetailView.java |
|
format = new String(g.getOptarg()); | format = g.getOptarg(); | 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("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); 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:d: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 'd': dataFile = new File(g.getOptarg()); if (!dataFile.exists()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " does not exist"); } if (dataFile.isDirectory()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " 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("dataFile is " + dataFile.getAbsolutePath()); logger.debug("outputDir is " + outputDir.getAbsolutePath()); logger.debug("sourceDir is " + sourceDir.getAbsolutePath()); } if (dataFile == null) dataFile = new File(CoverageDataFileHandler.FILE_NAME); ProjectData projectData = CoverageDataFileHandler .loadCoverageData(dataFile); if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, outputDir, sourceDir); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, outputDir, sourceDir); } 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/4d63a8c9fa3cc11c9152b3635695cdd64fa70119/Main.java/buggy/cobertura/src/net/sourceforge/cobertura/reporting/Main.java |
currentSession().setFlushMode(FlushMode.AUTO); | currentSession().setFlushMode( FlushMode.AUTO ); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
Event currentEvent = CurrentDetails.getCreationEvent(); | Event currentEvent = securitySystem.getCurrentEvent(); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
CurrentDetails.newEvent( internal ); | securitySystem.newEvent( internal ); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
List logs = CurrentDetails.getCreationEvent().collectLogs( null ); | List logs = securitySystem.getCurrentEvent().collectLogs( null ); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
CurrentDetails.setCreationEvent( currentEvent ); | securitySystem.setCurrentEvent( currentEvent ); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
currentSession().setFlushMode( filter.previousFlushMode ); | private void afterUpdate( Object argument, UpdateFilter filter) { if ( logger.isDebugEnabled() ) logger.debug( " Post-save cleanup. " ); // Save all that and go back to AUTO flush. getHibernateTemplate().flush(); // TODO performance? currentSession().setFlushMode(FlushMode.AUTO); // Let's save the event again using a temporary event. Event currentEvent = CurrentDetails.getCreationEvent(); EventType internal = (EventType) getHibernateTemplate().execute( new HibernateCallback(){ public Object doInHibernate(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria(EventType.class) .add( Restrictions.like( "value", "Internal" )); return c.uniqueResult(); } } ); CurrentDetails.newEvent( internal ); internalSave( currentEvent, filter ); // Checks. List logs = CurrentDetails.getCreationEvent().collectLogs( null ); if (logs.size() > 0) log.error("New logs created on update.afterSave:\n"+logs); // FIXME we shouldn't be updating experimenter etc. here. // Return the previous event. CurrentDetails.setCreationEvent( currentEvent ); // Clean up filter.unloadReplacedObjects(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
|
Event currentEvent = CurrentDetails.getCreationEvent(); | Event currentEvent = securitySystem.getCurrentEvent(); | private void beforeUpdate( Object argument, UpdateFilter filter ) { if ( argument == null ) throw new IllegalArgumentException( "Argument to save cannot be null."); if ( logger.isDebugEnabled() ) logger.debug( " Saving event before merge. " ); // Save event before we enter. Event currentEvent = CurrentDetails.getCreationEvent(); Event mergedEvent = (Event) internalSave( currentEvent, filter );// FIXME ERROR HERE: // internalSave is replacing details of Event even though it should be// persistent. CurrentDetails.setCreationEvent( mergedEvent ); // Don't flush until we're done. currentSession().setFlushMode(FlushMode.COMMIT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
CurrentDetails.setCreationEvent( mergedEvent ); | securitySystem.setCurrentEvent( mergedEvent ); | private void beforeUpdate( Object argument, UpdateFilter filter ) { if ( argument == null ) throw new IllegalArgumentException( "Argument to save cannot be null."); if ( logger.isDebugEnabled() ) logger.debug( " Saving event before merge. " ); // Save event before we enter. Event currentEvent = CurrentDetails.getCreationEvent(); Event mergedEvent = (Event) internalSave( currentEvent, filter );// FIXME ERROR HERE: // internalSave is replacing details of Event even though it should be// persistent. CurrentDetails.setCreationEvent( mergedEvent ); // Don't flush until we're done. currentSession().setFlushMode(FlushMode.COMMIT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
filter.previousFlushMode = currentSession().getFlushMode(); | private void beforeUpdate( Object argument, UpdateFilter filter ) { if ( argument == null ) throw new IllegalArgumentException( "Argument to save cannot be null."); if ( logger.isDebugEnabled() ) logger.debug( " Saving event before merge. " ); // Save event before we enter. Event currentEvent = CurrentDetails.getCreationEvent(); Event mergedEvent = (Event) internalSave( currentEvent, filter );// FIXME ERROR HERE: // internalSave is replacing details of Event even though it should be// persistent. CurrentDetails.setCreationEvent( mergedEvent ); // Don't flush until we're done. currentSession().setFlushMode(FlushMode.COMMIT); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
|
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public void deleteObject( IObject row ) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( row, filter ); internalDelete( row, filter ); afterUpdate( row, filter ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public IObject[] saveAndReturnArray(IObject[] graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); for (int i = 0; i < graph.length; i++) { graph[i] = internalSave( graph[i], filter ); } afterUpdate( graph, filter ); return graph; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public IObject saveAndReturnObject( IObject graph ) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); graph = internalSave( graph, filter ); afterUpdate( graph, filter ); return graph; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public void saveArray(IObject[] graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); for (int i = 0; i < graph.length; i++) { graph[i] = internalSave( graph[i], filter ); } afterUpdate( graph, filter ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public void saveCollection(Collection graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); for (Object _object : graph) { IObject obj = (IObject) _object; obj = internalSave( obj, filter ); } afterUpdate( graph, filter ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); | UpdateFilter filter = new UpdateFilter( securitySystem, localQuery ); | public void saveObject(IObject graph) { UpdateFilter filter = new UpdateFilter( getHibernateTemplate() ); beforeUpdate( graph, filter ); graph = internalSave( graph, filter ); afterUpdate( graph, filter ); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/dc8dde051a1e2b716514b3964c9222ce006ebea9/UpdateImpl.java/clean/components/server/src/ome/logic/UpdateImpl.java |
if (presentation != null && presentation.isClosed()) abstraction.showPresentation(); | if (presentation != null) { if (presentation.isClosed()) abstraction.showPresentation(); if (presentation.isIcon()) abstraction.deiconifyPresentation(); } | private void showPresentation() { DataManagerUIF presentation = abstraction.getPresentation(); if (presentation != null && presentation.isClosed()) abstraction.showPresentation(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/6ec05530173229b43c3f21f0021b71fd776dd63c/DataManagerCtrl.java/clean/SRC/org/openmicroscopy/shoola/agents/datamng/DataManagerCtrl.java |
dms.updateDataset(transformPojosDatasetData(dd), isToRemove, isToAdd); | List toRemove = new ArrayList(isToRemove.size()); Iterator i = isToRemove.iterator(); while (i.hasNext()) toRemove.add(transformPojosIDToIs((pojos.ImageData) i.next())); List toAdd = new ArrayList(isToAdd.size()); i = isToAdd.iterator(); while (i.hasNext()) toAdd.add(transformPojosIDToIs((pojos.ImageData) i.next())); dms.updateDataset(transformPojosDatasetData(dd), toRemove, toAdd); | void updateDataset(pojos.DatasetData dd, List isToRemove, List isToAdd, boolean nameChange) { try { DataManagementService dms = registry.getDataManagementService(); dms.updateDataset(transformPojosDatasetData(dd), isToRemove, isToAdd); //update the presentation and the dataset summary contained in the //datasetSummaries list accordingly. if (datasetSummaries.size() != 0) updateDSList(dd); else updateDatasetInPS(dd); if (nameChange) presentation.updateDatasetInTree(); UserNotifier un = registry.getUserNotifier(); IconManager im = IconManager.getInstance(registry); un.notifyInfo("Update dataset", "The dataset has been updated.", im.getIcon(IconManager.SEND_TO_DB)); } catch(DSAccessException dsae) { String s = "Can't update the dataset: "+dd.getId()+"."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java |
List toRemove = new ArrayList(dsToRemove.size()); Iterator i = dsToRemove.iterator(); while (i.hasNext()) toRemove.add(transformDDToDs((pojos.DatasetData) i.next())); List toAdd = new ArrayList(dsToAdd.size()); i = dsToAdd.iterator(); while (i.hasNext()) toAdd.add(transformDDToDs((pojos.DatasetData) i.next())); | void updateProject(pojos.ProjectData pd, List dsToRemove, List dsToAdd, boolean nameChange) { try { DataManagementService dms = registry.getDataManagementService(); dms.updateProject(transformPojosProjectData(pd), dsToRemove, dsToAdd); //update the presentation and the project summary contained in the //projectSummaries list accordingly updatePSList(pd); if (nameChange) presentation.updateProjectInTree(); UserNotifier un = registry.getUserNotifier(); IconManager im = IconManager.getInstance(registry); un.notifyInfo("Update project", "The project has been updated.", im.getIcon(IconManager.SEND_TO_DB)); } catch(DSAccessException dsae) { String s = "Can't update the project: "+pd.getId()+"."; registry.getLogger().error(this, s+" Error: "+dsae); registry.getUserNotifier().notifyError("Data Retrieval Failure", s, dsae); } catch(DSOutOfServiceException dsose) { ServiceActivationRequest request = new ServiceActivationRequest( ServiceActivationRequest.DATA_SERVICES); registry.getEventBus().post(request); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/5d253e1d8b8b563bd79074b962fe0a01fca0a091/DataManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/datamng/DataManager.java |
|
falseClass.defineMethod("id", CallbackFactory.getMethod(RubyBoolean.class, "id")); | public static RubyClass createFalseClass(Ruby ruby) { RubyClass falseClass = ruby.defineClass("FalseClass", ruby.getClasses().getObjectClass()); falseClass.defineMethod("to_s", CallbackFactory.getMethod(RubyBoolean.class, "to_s")); falseClass.defineMethod("type", CallbackFactory.getMethod(RubyBoolean.class, "type")); falseClass.defineMethod("&", CallbackFactory.getMethod(RubyBoolean.class, "op_and", IRubyObject.class)); falseClass.defineMethod("|", CallbackFactory.getMethod(RubyBoolean.class, "op_or", IRubyObject.class)); falseClass.defineMethod("^", CallbackFactory.getMethod(RubyBoolean.class, "op_xor", IRubyObject.class)); falseClass.getInternalClass().undefMethod("new"); ruby.defineGlobalConstant("FALSE", ruby.getFalse()); return falseClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a33fc547e26999709256db0c7da831fd8ed14d1c/RubyBoolean.java/buggy/org/jruby/RubyBoolean.java |
|
trueClass.defineMethod("id", CallbackFactory.getMethod(RubyBoolean.class, "id")); | public static RubyClass createTrueClass(Ruby ruby) { RubyClass trueClass = ruby.defineClass("TrueClass", ruby.getClasses().getObjectClass()); trueClass.defineMethod("to_s", CallbackFactory.getMethod(RubyBoolean.class, "to_s")); trueClass.defineMethod("type", CallbackFactory.getMethod(RubyBoolean.class, "type")); trueClass.defineMethod("&", CallbackFactory.getMethod(RubyBoolean.class, "op_and", IRubyObject.class)); trueClass.defineMethod("|", CallbackFactory.getMethod(RubyBoolean.class, "op_or", IRubyObject.class)); trueClass.defineMethod("^", CallbackFactory.getMethod(RubyBoolean.class, "op_xor", IRubyObject.class)); trueClass.getInternalClass().undefMethod("new"); ruby.defineGlobalConstant("TRUE", ruby.getTrue()); return trueClass; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/a33fc547e26999709256db0c7da831fd8ed14d1c/RubyBoolean.java/buggy/org/jruby/RubyBoolean.java |
|
protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } //if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //root setEnabled(true); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE); setEnabled(true); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/da2e93951e8dd4dfd33ba4559d46441b0a667598/ViewAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ViewAction.java |
||
setEnabled(true); | putValue(Action.NAME, BROWSE); setEnabled(model.getSelectedBrowser().getBrowserType() == Browser.IMAGES_EXPLORER); | protected void onDisplayChange(TreeImageDisplay selectedDisplay) { if (selectedDisplay == null) { setEnabled(false); return; } //if (model.getSelectedBrowser().getBrowserType() == //Browser.IMAGES_EXPLORER && if (selectedDisplay.getParentDisplay() == null) { //root setEnabled(true); return; } Object ho = selectedDisplay.getUserObject(); if (ho == null || !(ho instanceof DataObject)) setEnabled(false); else { if ((ho instanceof ImageData)) putValue(Action.NAME, VIEW); else putValue(Action.NAME, BROWSE); setEnabled(true); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/da2e93951e8dd4dfd33ba4559d46441b0a667598/ViewAction.java/clean/SRC/org/openmicroscopy/shoola/agents/treeviewer/actions/ViewAction.java |
ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString(); | tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(body.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); body = baos.toString(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } | protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/22364a9ee3ec58b02b551c2387345b61de69878c/ArticleItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleItemBean.java |
setBody(articleOut); | setBody(body); | protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/22364a9ee3ec58b02b551c2387345b61de69878c/ArticleItemBean.java/clean/src/java/com/idega/block/article/bean/ArticleItemBean.java |
{ zoomLevel = magFactor; percentFormat = NumberFormat.getPercentInstance(); this.view = view; this.control = control; } | { zoomLevel = magFactor; percentFormat = NumberFormat.getPercentInstance(); this.view = view; this.control = control; } | public ZoomBarManager(ZoomBar view, ImageInspectorManager control, double magFactor) { zoomLevel = magFactor; percentFormat = NumberFormat.getPercentInstance(); this.view = view; this.control = control; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case ZOOM_FIELD_CMD: zoomFieldActionHandler(); break; case ZOOM_IN_CMD: zoomIn(); break; case ZOOM_OUT_CMD: zoomOut(); break; case ZOOM_FIT_CMD: zoomFit(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case ZOOM_FIELD_CMD: zoomFieldActionHandler(); break; case ZOOM_IN_CMD: zoomIn(); break; case ZOOM_OUT_CMD: zoomOut(); break; case ZOOM_FIT_CMD: zoomFit(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | public void actionPerformed(ActionEvent e) { int index = Integer.parseInt(e.getActionCommand()); try { switch (index) { case ZOOM_FIELD_CMD: zoomFieldActionHandler(); break; case ZOOM_IN_CMD: zoomIn(); break; case ZOOM_OUT_CMD: zoomOut(); break; case ZOOM_FIT_CMD: zoomFit(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ zoomField = view.getZoomField(); zoomField.setActionCommand(""+ZOOM_FIELD_CMD); zoomField.addActionListener(this); zoomField.addFocusListener(this); JButton zoomIn = view.getZoomIn(), zoomOut = view.getZoomOut(), zoomFit = view.getZoomFit(); zoomIn.addActionListener(this); zoomIn.setActionCommand(""+ZOOM_IN_CMD); zoomOut.addActionListener(this); zoomOut.setActionCommand(""+ZOOM_OUT_CMD); zoomFit.addActionListener(this); zoomFit.setActionCommand(""+ZOOM_FIT_CMD); } | { zoomField = view.getZoomField(); zoomField.setActionCommand(""+ZOOM_FIELD_CMD); zoomField.addActionListener(this); zoomField.addFocusListener(this); JButton zoomIn = view.getZoomIn(), zoomOut = view.getZoomOut(), zoomFit = view.getZoomFit(); zoomIn.addActionListener(this); zoomIn.setActionCommand(""+ZOOM_IN_CMD); zoomOut.addActionListener(this); zoomOut.setActionCommand(""+ZOOM_OUT_CMD); zoomFit.addActionListener(this); zoomFit.setActionCommand(""+ZOOM_FIT_CMD); } | void attachListeners() { //textfield zoomField = view.getZoomField(); zoomField.setActionCommand(""+ZOOM_FIELD_CMD); zoomField.addActionListener(this); zoomField.addFocusListener(this); //button JButton zoomIn = view.getZoomIn(), zoomOut = view.getZoomOut(), zoomFit = view.getZoomFit(); zoomIn.addActionListener(this); zoomIn.setActionCommand(""+ZOOM_IN_CMD); zoomOut.addActionListener(this); zoomOut.setActionCommand(""+ZOOM_OUT_CMD); zoomFit.addActionListener(this); zoomFit.setActionCommand(""+ZOOM_FIT_CMD); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ String val = zoomField.getText(); String cVal = percentFormat.format(zoomLevel); if (val == null || !val.equals(cVal)) zoomField.setText(cVal); } | { String val = zoomField.getText(); String cVal = percentFormat.format(zoomLevel); if (val == null || !val.equals(cVal)) zoomField.setText(cVal); } | public void focusLost(FocusEvent e) { String val = zoomField.getText(); String cVal = percentFormat.format(zoomLevel); if (val == null || !val.equals(cVal)) zoomField.setText(cVal); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
{ zoomField.setText(percentFormat.format(level)); } | { zoomField.setText(percentFormat.format(level)); } | public void setText(double level) { zoomField.setText(percentFormat.format(level)); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c61e383c3ea1df4e7b870a5e40d70e12c9ce01f4/ZoomBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/transform/zooming/ZoomBarManager.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.