rem
stringlengths 0
477k
| add
stringlengths 0
313k
| context
stringlengths 6
599k
| meta
stringlengths 141
403
|
---|---|---|---|
if (actException.funcall("backtrace").isNil() && actException.getRuby().getSourceFile() != null) { actException.funcall("set_backtrace", createBacktrace(actException.getRuby(), -1)); } | ruby.stackTraces++; if (actException.funcall("backtrace").isNil() && ruby.getSourceFile() != null) { actException.funcall("set_backtrace", createBacktrace(ruby, -1)); } ruby.stackTraces--; | protected void setActException(RubyException actException) { this.actException = actException; if (actException.funcall("backtrace").isNil() && actException.getRuby().getSourceFile() != null) { actException.funcall("set_backtrace", createBacktrace(actException.getRuby(), -1)); } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/RaiseException.java/buggy/org/jruby/exceptions/RaiseException.java |
protected QuantumStrategy(QuantumDef qd, PixelsType pt) | protected QuantumStrategy(QuantumDef qd, PixelsType pt, IPixels iPixels) | protected QuantumStrategy(QuantumDef qd, PixelsType pt) { windowStart = globalMin = 0.0; windowEnd = globalMax = 1.0; family = QuantumFactory.getFamily(QuantumFactory.LINEAR); curveCoefficient = 1.0; if (qd == null) throw new NullPointerException("No quantum definition"); this.qDef = qd; if (pt == null) throw new NullPointerException("No pixel type"); this.type = pt; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/QuantumStrategy.java/clean/components/rendering/src/omeis/providers/re/quantum/QuantumStrategy.java |
family = QuantumFactory.getFamily(QuantumFactory.LINEAR); | family = QuantumFactory.getFamily(iPixels, QuantumFactory.LINEAR); | protected QuantumStrategy(QuantumDef qd, PixelsType pt) { windowStart = globalMin = 0.0; windowEnd = globalMax = 1.0; family = QuantumFactory.getFamily(QuantumFactory.LINEAR); curveCoefficient = 1.0; if (qd == null) throw new NullPointerException("No quantum definition"); this.qDef = qd; if (pt == null) throw new NullPointerException("No pixel type"); this.type = pt; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/64e6d912272b039f986c1a36d1ca930cc5578578/QuantumStrategy.java/clean/components/rendering/src/omeis/providers/re/quantum/QuantumStrategy.java |
Channel channel = getChannel(); if (channel != null && channel instanceof SelectableChannel) { try { ((SelectableChannel)channel).configureBlocking(block); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } | if(!(handler instanceof IOHandlerNio)) { throw getRuntime().newNotImplementedError("FCNTL only works with Nio based handlers"); } try { ((IOHandlerNio) handler).setBlocking(block); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } | public IRubyObject fcntl(IRubyObject cmd, IRubyObject arg) throws IOException { long realCmd = cmd.convertToInteger().getLongValue(); // Fixme: Arg may also be true, false, and nil and still be valid. Strangely enough, // protocol conversion is not happening in Ruby on this arg? if (!(arg instanceof RubyNumeric)) { return getRuntime().newFixnum(0); } long realArg = ((RubyNumeric)arg).getLongValue(); // Fixme: Only F_SETFL is current supported if (realCmd == 1L) { // cmd is F_SETFL boolean block = false; if((realArg & IOModes.NONBLOCK) == IOModes.NONBLOCK) { block = true; } Channel channel = getChannel(); if (channel != null && channel instanceof SelectableChannel) { try { ((SelectableChannel)channel).configureBlocking(block); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } } return getRuntime().newFixnum(0); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/404fdac0a79f1b57c3fb97914fbafb91618ca119/RubyIO.java/buggy/src/org/jruby/RubyIO.java |
} if (channel instanceof AbstractSelectableChannel) { ((AbstractSelectableChannel)channel).configureBlocking(false); | public IOHandlerNio(IRuby runtime, Channel channel) throws IOException { super(runtime); String mode = ""; this.channel = channel; if (channel instanceof ReadableByteChannel) { mode += "r"; isOpen = true; } if (channel instanceof WritableByteChannel) { mode += "w"; isOpen = true; } if (channel instanceof AbstractSelectableChannel) { ((AbstractSelectableChannel)channel).configureBlocking(false); } if ("rw".equals(mode)) { modes = new IOModes(runtime, IOModes.RDWR); isOpen = true; } else { if (!isOpen) { // Neither stream exists? // throw new IOException("Opening nothing?"); // Hack to cover the ServerSocketChannel case mode = "r"; isOpen = true; } modes = new IOModes(runtime, mode); } fileno = RubyIO.getNewFileno(); outBuffer = ByteBuffer.allocate(BLOCK_SIZE); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/404fdac0a79f1b57c3fb97914fbafb91618ca119/IOHandlerNio.java/buggy/src/org/jruby/util/IOHandlerNio.java |
|
commentPanel.add(buildInstructions(instructions), "1, 0, 2, 0"); | commentPanel.add(UIUtilities.buildTextPane(instructions), "1, 0, 2, 0"); | private JPanel buildCommentPanel(String instructions, String comment, Icon icon) { JPanel commentPanel = new JPanel(); int iconSpace = 0; if (icon != null) iconSpace = icon.getIconWidth()+20; double tableSize[][] = {{iconSpace, (160 - iconSpace), TableLayout.FILL}, // columns {100, 30, TableLayout.FILL}}; // rows TableLayout layout = new TableLayout(tableSize); commentPanel.setLayout(layout); commentPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); if (icon != null) commentPanel.add(new JLabel(icon), "0, 0, l, c"); commentPanel.add(buildInstructions(instructions), "1, 0, 2, 0"); commentPanel.add(buildEmailAreaPanel('E'), "0, 1, 2, 1"); commentPanel.add(buildCommentAreaPanel(comment, 'W'), "0, 2, 2, 2"); return commentPanel; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/bbd964029121f2811ba2b7cf47a392087032888c/MessengerDialog.java/buggy/SRC/org/openmicroscopy/shoola/util/ui/MessengerDialog.java |
Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher); | Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher); | public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener, Dispatcher, Controllers Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); sashForm.setWeights(new int[] {20, 80}); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/DisplayedDocument.java/buggy/trunk/src/de/berlios/koalanotes/display/DisplayedDocument.java |
dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher)); | public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener, Dispatcher, Controllers Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); sashForm.setWeights(new int[] {20, 80}); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/57d4036eb7167d2d27117abe1f0280376377dbaa/DisplayedDocument.java/buggy/trunk/src/de/berlios/koalanotes/display/DisplayedDocument.java |
|
public Listener(Controllers controllers) { this.controllers = controllers; | public Listener(Dispatcher dispatcher) { this.dispatcher = dispatcher; | public Listener(Controllers controllers) { this.controllers = controllers; srcToEvtToMethod = new HashMap<Widget, HashMap<Integer, String>>(); } | 57508 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57508/18ce9cf33f3e06fda4addd57f5ae5c9423a990fb/Listener.java/buggy/trunk/src/de/berlios/koalanotes/controllers/Listener.java |
assertStringTemplateEquals ("#if(true){pass}\n\n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n \n #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass}\n\n\n\n\n\n\n\n\n\n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n\n \n \n\n \n \n\n \n\n #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass}\n \n \n \n \n \n \n\n \n\n#else{fail}", "pass"); | public void testBeforeSubdirective () throws Exception { assertStringTemplateEquals ("#if(true){pass} #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n #else{fail}", "pass"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5a4586d6c4b36b78c3896b3ea43acac5de0be624/TestWhitespace.java/clean/webmacro/test/unit/org/webmacro/template/TestWhitespace.java |
|
assertStringTemplateEquals("layer-background-color:#FFFFCC", | assertStringTemplateEquals("layer-background-color:#FFFFCC", | public void testColor() throws Exception { assertStringTemplateEquals("layer-background-color:#FFFFCC", "layer-background-color:#FFFFCC"); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5a4586d6c4b36b78c3896b3ea43acac5de0be624/TestWhitespace.java/clean/webmacro/test/unit/org/webmacro/template/TestWhitespace.java |
public void testTabs() throws Exception { assertStringTemplateEquals("\t#if (true) { pass }\n\t#else { fail }", | public void testTabs() throws Exception { assertStringTemplateEquals("\t#if (true) { pass }\n\t#else { fail }", | public void testTabs() throws Exception { assertStringTemplateEquals("\t#if (true) { pass }\n\t#else { fail }", " pass "); assertStringTemplateEquals("\t#if (true) \t#begin pass \t#end\t#else \t#begin fail \t#end", "pass "); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5a4586d6c4b36b78c3896b3ea43acac5de0be624/TestWhitespace.java/clean/webmacro/test/unit/org/webmacro/template/TestWhitespace.java |
assertStringTemplateEquals("\t#if (true) \t#begin pass \t#end\t#else \t#begin fail \t#end", | assertStringTemplateEquals("\t#if (true) \t#begin pass \t#end\t#else \t#begin fail \t#end", | public void testTabs() throws Exception { assertStringTemplateEquals("\t#if (true) { pass }\n\t#else { fail }", " pass "); assertStringTemplateEquals("\t#if (true) \t#begin pass \t#end\t#else \t#begin fail \t#end", "pass "); } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/5a4586d6c4b36b78c3896b3ea43acac5de0be624/TestWhitespace.java/clean/webmacro/test/unit/org/webmacro/template/TestWhitespace.java |
public void accept(NodeVisitor iVisitor) { iVisitor.visitBlockPassNode(this); } | public void accept(NodeVisitor iVisitor) { iVisitor.visitBlockPassNode(this); } | public void accept(NodeVisitor iVisitor) { iVisitor.visitBlockPassNode(this); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
||
public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
||
return ruby.getNil(); | return self.eval(getIterNode()); | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; | if (block instanceof RubyMethod/*.kind_of(ruby.getClasses().getMethodClass()).isTrue()*/) { block = methodProc(ruby, (RubyMethod)block); } else if (!(block instanceof RubyProc)) { throw new TypeError(ruby, "wrong argument type " + block.getRubyClass().toName() + " (expected Proc)"); } RubyBlock oldBlock = ruby.getBlock(); ruby.setBlock(((RubyProc) block).getBlock()); ruby.getIter().push(RubyIter.ITER_PRE); ruby.getRubyFrame().setIter(RubyIter.ITER_PRE); try { return self.eval(getIterNode()); } finally { ruby.getIter().pop(); ruby.setBlock(oldBlock); } /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
/*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); | */ | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result; */ } | public RubyObject eval(Ruby ruby, RubyObject self) { RubyObject block = getBodyNode().eval(ruby, self); // RubyBlock oldBlock; // RubyBlock _block; // RubyBlock data; RubyObject result = ruby.getNil(); // int orphan; // int safe = ruby.getSecurityLevel(); if (block.isNil()) { return ruby.getNil(); // +++ rb_eval(self, node->nd_iter); } if (block.kind_of(ruby.getClasses().getMethodClass()).isTrue()) { block = null; // method_proc(block); // } else if (!(block instanceof RubyProc)) { } return result; /*if (NIL_P(block)) { return rb_eval(self, node->nd_iter); } if (rb_obj_is_kind_of(block, rb_cMethod)) { block = method_proc(block); } else if (!rb_obj_is_proc(block)) { rb_raise(rb_eTypeError, "wrong argument type %s (expected Proc)", rb_class2name(CLASS_OF(block))); } Data_Get_Struct(block, struct BLOCK, data); orphan = blk_orphan(data); /* PUSH BLOCK from data */ /*old_block = ruby_block; _block = *data; ruby_block = &_block; PUSH_ITER(ITER_PRE); ruby_frame->iter = ITER_PRE; PUSH_TAG(PROT_NONE); state = EXEC_TAG(); if (state == 0) { proc_set_safe_level(block); if (safe > ruby_safe_level) ruby_safe_level = safe; result = rb_eval(self, node->nd_iter); } POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { if (orphan) { state &= TAG_MASK; } else { struct BLOCK *ptr = old_block; while (ptr) { if (ptr->scope == _block.scope) { ptr->tag->dst = state; break; } ptr = ptr->prev; } if (!ptr) { state &= TAG_MASK; } } } ruby_block = old_block; ruby_safe_level = safe; switch (state) {/* escape from orphan procedure */ /*case 0: break; case TAG_BREAK: if (orphan) { rb_raise(rb_eLocalJumpError, "break from proc-closure"); } break; case TAG_RETRY: rb_raise(rb_eLocalJumpError, "retry from proc-closure"); break; case TAG_RETURN: if (orphan) { rb_raise(rb_eLocalJumpError, "return from proc-closure"); } default: JUMP_TAG(state); } return result;*/ } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/fe5b7835d80b52a0683d503660a7f722b7af69b1/BlockPassNode.java/buggy/org/jruby/nodes/BlockPassNode.java |
|
images.add(model.getRenderedImage()); | images.add(model.getSplitComponentImage()); | public List getImageComponents() { switch (model.getState()) { case NEW: case LOADING_RENDERING_CONTROL: case DISCARDED: throw new IllegalStateException( "This method can't be invoked in the DISCARDED, NEW or" + "LOADING_RENDERING_CONTROL state."); } if (model.getColorModel().equals(GREY_SCALE_MODEL)) return null; List l = model.getActiveChannels(); if (l.size() < 2) return null; Iterator i = l.iterator(); int index; ArrayList images = new ArrayList(l.size()); while (i.hasNext()) { index = ((Integer) i.next()).intValue(); for (int j = 0; j < model.getMaxC(); j++) model.setChannelActive(j, j == index); images.add(model.getRenderedImage()); } i = l.iterator(); while (i.hasNext()) { //reset values. index = ((Integer) i.next()).intValue(); model.setChannelActive(index, true); } return images; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java |
if (map == null || map.size() != 1) return; | if (map == null || map.size() != 1) return; | public void setColorModel(Map map) { switch (model.getState()) { case NEW: case LOADING_RENDERING_CONTROL: case DISCARDED: throw new IllegalStateException( "This method can't be invoked in the DISCARDED, NEW or" + "LOADING_RENDERING_CONTROL state."); } if (map == null || map.size() != 1) return; Iterator i = map.keySet().iterator(); Integer key = null; ViewerAction value = null; while (i.hasNext()) { key = (Integer) i.next(); value = (ViewerAction) map.get(key); } List channels = model.getActiveChannels(); switch (key.intValue()) { case ColorModelAction.GREY_SCALE_MODEL: historyActiveChannels = model.getActiveChannels(); model.setColorModel(GREY_SCALE_MODEL); if (channels != null && channels.size() > 1) { i = channels.iterator(); int index; int j = 0; while (i.hasNext()) { index = ((Integer) i.next()).intValue(); setChannelActive(index, j == 0); j++; } } else if (channels == null || channels.size() == 0) { //no channel so one will be active. setChannelActive(0, true); } break; case ColorModelAction.RGB_MODEL: case ColorModelAction.HSB_MODEL: model.setColorModel(HSB_MODEL); if (historyActiveChannels != null && historyActiveChannels.size() != 0) { i = historyActiveChannels.iterator(); while (i.hasNext()) setChannelActive(((Integer) i.next()).intValue(), true); } else { if (channels == null || channels.size() == 0) { //no channel so one will be active. setChannelActive(0, true); } else { i = channels.iterator(); while (i.hasNext()) setChannelActive(((Integer) i.next()).intValue(), true); } } break; default: throw new IllegalArgumentException("Color model not supported"); } //need firePropertyChange(COLOR_MODEL_CHANGE_PROPERTY, new Integer(1), new Integer(-1)); view.setColorModel(value); renderXYPlane(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java |
if(factor != -1) | if (factor != -1) | public void setZoomFactor(double factor) { if(factor != -1) { if (factor > ZoomAction.MAX_ZOOM_FACTOR || factor < ZoomAction.MIN_ZOOM_FACTOR) throw new IllegalArgumentException("The zoom factor is value " + "between "+ZoomAction.MIN_ZOOM_FACTOR+" and "+ ZoomAction.MAX_ZOOM_FACTOR); model.setZoomFitToWindow(false); model.setZoomFactor(factor); } else { model.setZoomFitToWindow(true); model.setZoomFactor(factor); } if(view.isLensVisible()) view.setImageZoomFactor((float)model.getZoomFactor()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java |
if(view.isLensVisible()) view.setImageZoomFactor((float)model.getZoomFactor()); | if (view.isLensVisible()) view.setImageZoomFactor((float) model.getZoomFactor()); | public void setZoomFactor(double factor) { if(factor != -1) { if (factor > ZoomAction.MAX_ZOOM_FACTOR || factor < ZoomAction.MIN_ZOOM_FACTOR) throw new IllegalArgumentException("The zoom factor is value " + "between "+ZoomAction.MIN_ZOOM_FACTOR+" and "+ ZoomAction.MAX_ZOOM_FACTOR); model.setZoomFitToWindow(false); model.setZoomFactor(factor); } else { model.setZoomFitToWindow(true); model.setZoomFactor(factor); } if(view.isLensVisible()) view.setImageZoomFactor((float)model.getZoomFactor()); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/54a6dc1cc81e06c2190546075a6c5a04f18d9bb5/ImViewerComponent.java/clean/SRC/org/openmicroscopy/shoola/agents/imviewer/view/ImViewerComponent.java |
if (offset < 0 && getLength() + offset < 0) { | if (offset < 0 && getLength() + offset < -1) { | public IRubyObject insert(IRubyObject[] args) { checkArgumentCount(args, 1, -1); // ruby does not bother to bounds check index, if no elements are to be added. if (args.length == 1) { return this; } // too negative of an offset will throw an IndexError long offset = args[0].convertToInteger().getLongValue(); if (offset < 0 && getLength() + offset < 0) { throw getRuntime().newIndexError("index " + (getLength() + offset) + " out of array"); } // An offset larger than the current length will pad with nils // to length if (offset > getLength()) { long difference = offset - getLength(); IRubyObject nil = getRuntime().getNil(); for (long i = 0; i < difference; i++) { list.add(nil); } } if (offset < 0) { offset += getLength() + 1; } for (int i = 1; i < args.length; i++) { list.add((int) (offset + i - 1), args[i]); } return this; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b42633842f09f67265d0738f78d69abc879169ce/RubyArray.java/clean/src/org/jruby/RubyArray.java |
defaultCursor = new Cursor(Cursor.DEFAULT_CURSOR); handCursor = new Cursor(Cursor.HAND_CURSOR); | public DrawingCanvasMng(DrawingCanvas view) { this.view = view; drawingArea = new Rectangle(); attachListeners(); setDefault(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/136981255a811ff12b29c8657594b0388f36e74b/DrawingCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvasMng.java |
|
case ROIAgt.CONSTRUCTING: | case ROIAgt.CONSTRUCTING: | private void handleMouseDrag(Point p) { switch (state) { case ROIAgt.CONSTRUCTING: currentShape = ROIFactory.makeShape(anchor, p, shapeType); view.draw(currentShape); break; case ROIAgt.MOVING: if (currentShape != null) move(p); break; case ROIAgt.RESIZING: if (currentShape != null) resize(p); break; } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/136981255a811ff12b29c8657594b0388f36e74b/DrawingCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvasMng.java |
if (clickCount == 2) control.annotateROI(roi); | if (clickCount == 2) { dragging = false; control.annotateROI(roi); } | private void handleMousePressed(Point p, int clickCount) { pressed = true; dragging = true; currentROI = null; currentShape = null; anchor = p; Iterator i = listROI.iterator(); ROIShape roi; Shape s; while (i.hasNext()) { roi = (ROIShape) (i.next()); s = roi.getShape(); if (s.contains(p)) { currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) control.annotateROI(roi); } } } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/136981255a811ff12b29c8657594b0388f36e74b/DrawingCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvasMng.java |
case ROIAgt.RESIZING: | case ROIAgt.RESIZING: | public void mouseReleased(MouseEvent e) { dragging = false; moving = false; switch (state) { case ROIAgt.CONSTRUCTING: if (!pressed) saveROI(); break; case ROIAgt.MOVING: case ROIAgt.RESIZING: if (currentShape != null) saveShape(); } pressed = false; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/136981255a811ff12b29c8657594b0388f36e74b/DrawingCanvasMng.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvasMng.java |
public void setTextOnOff(boolean b) { textOnOff = b; } | void setTextOnOff(boolean b) { textOnOff = b; } | public void setTextOnOff(boolean b) { textOnOff = b; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
public void setOnOff(boolean b) { onOff = b; } | void setOnOff(boolean b) { onOff = b; } | public void setOnOff(boolean b) { onOff = b; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/75759d4628947eccba1f0e97cd7b5035c174f2cc/DrawingCanvas.java/buggy/SRC/org/openmicroscopy/shoola/agents/roi/canvas/DrawingCanvas.java |
oldHomeProperty = System.getProperty("jruby.home"); oldLibProperty = System.getProperty("jruby.lib"); | public void setUp() { ruby = Ruby.getDefaultInstance(); oldHomeProperty = System.getProperty("jruby.home"); oldLibProperty = System.getProperty("jruby.lib"); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/7cb3d56be740f72388f1c3a99dacb2cbeec122c5/TestRuby.java/buggy/org/jruby/test/TestRuby.java |
|
try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) { } } | try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) { } } | public void tearDown() { try { if (in != null) in.close(); if (out != null) out.close(); } catch (IOException ex) { } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/774c5d3d592dfd020e3a8f961b73f629c4c55cf0/TestRubyBase.java/buggy/org/jruby/test/TestRubyBase.java |
setLayout(new CardLayout()); | setLayout(new BorderLayout()); | public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
add(treeScroller, ROSTER_PANEL); | retryPanel = new RetryPanel(); | public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); | workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); | public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
CardLayout cl = (CardLayout)getLayout(); cl.show(this, ROSTER_PANEL); | workspace.changeCardLayout(Workspace.WORKSPACE_PANE); | public void clientReconnected() { XMPPConnection con = SparkManager.getConnection(); if (con.isConnected()) { // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); final Roster roster = con.getRoster(); final Iterator rosterEntries = roster.getEntries(); while (rosterEntries.hasNext()) { RosterEntry entry = (RosterEntry)rosterEntries.next(); updateUserPresence(roster.getPresence(entry.getUser())); } } CardLayout cl = (CardLayout)getLayout(); cl.show(this, ROSTER_PANEL); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
CardLayout cl = (CardLayout)getLayout(); cl.show(this, RETRY_PANEL); | workspace.changeCardLayout(RETRY_PANEL); | private void reconnect(final String message, final boolean conflict) { // Show MainWindow SparkManager.getMainWindow().setVisible(true); // Flash That Window. SparkManager.getAlertManager().flashWindowStopOnFocus(SparkManager.getMainWindow()); if (reconnectListener == null) { reconnectListener = new RetryPanel.ReconnectListener() { public void reconnected() { clientReconnected(); } public void cancelled() { removeAllUsers(); } }; retryPanel.addReconnectionListener(reconnectListener); } // Show reconnect panel CardLayout cl = (CardLayout)getLayout(); cl.show(this, RETRY_PANEL); retryPanel.setDisconnectReason(message); if (!conflict) { retryPanel.startTimer(); } else { retryPanel.showConflict(); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
CardLayout cardLayout = (CardLayout)getLayout(); cardLayout.show(this, ROSTER_PANEL); | workspace.changeCardLayout(RETRY_PANEL); | private void removeAllUsers() { // Show reconnect panel CardLayout cardLayout = (CardLayout)getLayout(); cardLayout.show(this, ROSTER_PANEL); // Behind the scenes, move everyone to the offline group. Iterator contactGroups = new ArrayList(getContactGroups()).iterator(); while (contactGroups.hasNext()) { ContactGroup contactGroup = (ContactGroup)contactGroups.next(); Iterator contactItems = new ArrayList(contactGroup.getContactItems()).iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); contactGroup.removeContactItem(item); } } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/ContactList.java/clean/src/java/org/jivesoftware/spark/ui/ContactList.java |
int sizeZ, int z) { this.control = control; this.view = view; maxT = sizeT; curT = t; maxZ = sizeZ; curZ = z; } | int sizeZ, int z) { this.control = control; this.view = view; maxT = sizeT; curT = t; maxZ = sizeZ; curZ = z; } | public ToolBarManager(ViewerCtrl control, ToolBar view, int sizeT, int t, int sizeZ, int z) { this.control = control; this.view = view; maxT = sizeT; curT = t; maxZ = sizeZ; curZ = z; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
{ JTextField tField = view.getTField(), zField = view.getZField(); tField.setActionCommand(""+T_FIELD_CMD); tField.addActionListener(this); tField.addFocusListener(this); zField.setActionCommand(""+Z_FIELD_CMD); zField.addActionListener(this); zField.addFocusListener(this); JButton render = view.getRender(), inspector = view.getInspector(), saveAs = view.getSaveAs(), viewer3D = view.getViewer3D(), movie = view.getMovie(); | { JTextField tField = view.getTField(), zField = view.getZField(); tField.setActionCommand(""+T_FIELD_CMD); tField.addActionListener(this); tField.addFocusListener(this); zField.setActionCommand(""+Z_FIELD_CMD); zField.addActionListener(this); zField.addFocusListener(this); JButton render = view.getRender(), inspector = view.getInspector(), saveAs = view.getSaveAs(), viewer3D = view.getViewer3D(), movie = view.getMovie(), roi = view.getROI(); | void attachListeners() { //textfield JTextField tField = view.getTField(), zField = view.getZField(); tField.setActionCommand(""+T_FIELD_CMD); tField.addActionListener(this); tField.addFocusListener(this); zField.setActionCommand(""+Z_FIELD_CMD); zField.addActionListener(this); zField.addFocusListener(this); //button JButton render = view.getRender(), inspector = view.getInspector(), saveAs = view.getSaveAs(), viewer3D = view.getViewer3D(), movie = view.getMovie(); movie.setActionCommand(""+MOVIE_CMD); movie.addActionListener(this); render.setActionCommand(""+RENDER_CMD); render.addActionListener(this); inspector.setActionCommand(""+INSPECTOR_CMD); inspector.addActionListener(this); saveAs.setActionCommand(""+SAVEAS_CMD); saveAs.addActionListener(this); viewer3D.setActionCommand(""+VIEWER3D_CMD); viewer3D.addActionListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
movie.setActionCommand(""+MOVIE_CMD); movie.addActionListener(this); render.setActionCommand(""+RENDER_CMD); render.addActionListener(this); inspector.setActionCommand(""+INSPECTOR_CMD); inspector.addActionListener(this); saveAs.setActionCommand(""+SAVEAS_CMD); saveAs.addActionListener(this); viewer3D.setActionCommand(""+VIEWER3D_CMD); viewer3D.addActionListener(this); } | movie.setActionCommand(""+MOVIE_CMD); movie.addActionListener(this); render.setActionCommand(""+RENDER_CMD); render.addActionListener(this); inspector.setActionCommand(""+INSPECTOR_CMD); inspector.addActionListener(this); saveAs.setActionCommand(""+SAVEAS_CMD); saveAs.addActionListener(this); viewer3D.setActionCommand(""+VIEWER3D_CMD); viewer3D.addActionListener(this); roi.setActionCommand(""+ROI_CMD); roi.addActionListener(this); } | void attachListeners() { //textfield JTextField tField = view.getTField(), zField = view.getZField(); tField.setActionCommand(""+T_FIELD_CMD); tField.addActionListener(this); tField.addFocusListener(this); zField.setActionCommand(""+Z_FIELD_CMD); zField.addActionListener(this); zField.addFocusListener(this); //button JButton render = view.getRender(), inspector = view.getInspector(), saveAs = view.getSaveAs(), viewer3D = view.getViewer3D(), movie = view.getMovie(); movie.setActionCommand(""+MOVIE_CMD); movie.addActionListener(this); render.setActionCommand(""+RENDER_CMD); render.addActionListener(this); inspector.setActionCommand(""+INSPECTOR_CMD); inspector.addActionListener(this); saveAs.setActionCommand(""+SAVEAS_CMD); saveAs.addActionListener(this); viewer3D.setActionCommand(""+VIEWER3D_CMD); viewer3D.addActionListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ToolBarManager.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/controls/ToolBarManager.java |
String jrubyEnvMethod = System.getProperty("jruby.env.method"); IOSEnvironmentReader reader; | Map envs = null; | public Map getEnvironmentVariableMap(IRuby runtime) { String jrubyEnvMethod = System.getProperty("jruby.env.method"); IOSEnvironmentReader reader; if (jrubyEnvMethod == null || jrubyEnvMethod.length() < 1) { // Try to get environment from Java5 System.getenv() reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromJava5SystemGetenv.class.getName()); // not Java5 so try getting environment using Runtime exec if (reader == null) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromRuntimeExec.class.getName()); //runtime.getWarnings().warn("Getting environment variables using Runtime Exec"); } else { //runtime.getWarnings().warn("Getting environment variables using Java5 System.getenv()"); } } else { // get environment from jruby command line property supplied class runtime.getWarnings().warn("Getting environment variables using command line defined method: " + jrubyEnvMethod); reader = getAccessibleOSEnvironment(runtime, jrubyEnvMethod); } Map envs = null; if (reader != null) { Map variables = null; variables = reader.getVariables(runtime); envs = getAsMapOfRubyStrings(runtime, variables.entrySet()); } return envs; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d38821551a58969cd2593b463d93df5f32bf3c14/OSEnvironment.java/clean/src/org/jruby/environment/OSEnvironment.java |
if (jrubyEnvMethod == null || jrubyEnvMethod.length() < 1) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromJava5SystemGetenv.class.getName()); if (reader == null) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromRuntimeExec.class.getName()); } else { | try { String jrubyEnvMethod = System.getProperty("jruby.env.method"); IOSEnvironmentReader reader; if (jrubyEnvMethod == null || jrubyEnvMethod.length() < 1) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromJava5SystemGetenv.class.getName()); if (reader == null) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromRuntimeExec.class.getName()); } else { } } else { runtime.getWarnings().warn("Getting environment variables using command line defined method: " + jrubyEnvMethod); reader = getAccessibleOSEnvironment(runtime, jrubyEnvMethod); envs = null; if (reader != null) { Map variables = null; variables = reader.getVariables(runtime); envs = getAsMapOfRubyStrings(runtime, variables.entrySet()); } | public Map getEnvironmentVariableMap(IRuby runtime) { String jrubyEnvMethod = System.getProperty("jruby.env.method"); IOSEnvironmentReader reader; if (jrubyEnvMethod == null || jrubyEnvMethod.length() < 1) { // Try to get environment from Java5 System.getenv() reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromJava5SystemGetenv.class.getName()); // not Java5 so try getting environment using Runtime exec if (reader == null) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromRuntimeExec.class.getName()); //runtime.getWarnings().warn("Getting environment variables using Runtime Exec"); } else { //runtime.getWarnings().warn("Getting environment variables using Java5 System.getenv()"); } } else { // get environment from jruby command line property supplied class runtime.getWarnings().warn("Getting environment variables using command line defined method: " + jrubyEnvMethod); reader = getAccessibleOSEnvironment(runtime, jrubyEnvMethod); } Map envs = null; if (reader != null) { Map variables = null; variables = reader.getVariables(runtime); envs = getAsMapOfRubyStrings(runtime, variables.entrySet()); } return envs; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d38821551a58969cd2593b463d93df5f32bf3c14/OSEnvironment.java/clean/src/org/jruby/environment/OSEnvironment.java |
} else { runtime.getWarnings().warn("Getting environment variables using command line defined method: " + jrubyEnvMethod); reader = getAccessibleOSEnvironment(runtime, jrubyEnvMethod); } Map envs = null; if (reader != null) { Map variables = null; variables = reader.getVariables(runtime); envs = getAsMapOfRubyStrings(runtime, variables.entrySet()); | } catch (AccessControlException accessEx) { envs = new HashMap(); | public Map getEnvironmentVariableMap(IRuby runtime) { String jrubyEnvMethod = System.getProperty("jruby.env.method"); IOSEnvironmentReader reader; if (jrubyEnvMethod == null || jrubyEnvMethod.length() < 1) { // Try to get environment from Java5 System.getenv() reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromJava5SystemGetenv.class.getName()); // not Java5 so try getting environment using Runtime exec if (reader == null) { reader = getAccessibleOSEnvironment(runtime, OSEnvironmentReaderFromRuntimeExec.class.getName()); //runtime.getWarnings().warn("Getting environment variables using Runtime Exec"); } else { //runtime.getWarnings().warn("Getting environment variables using Java5 System.getenv()"); } } else { // get environment from jruby command line property supplied class runtime.getWarnings().warn("Getting environment variables using command line defined method: " + jrubyEnvMethod); reader = getAccessibleOSEnvironment(runtime, jrubyEnvMethod); } Map envs = null; if (reader != null) { Map variables = null; variables = reader.getVariables(runtime); envs = getAsMapOfRubyStrings(runtime, variables.entrySet()); } return envs; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d38821551a58969cd2593b463d93df5f32bf3c14/OSEnvironment.java/clean/src/org/jruby/environment/OSEnvironment.java |
return getAsMapOfRubyStrings(runtime, System.getProperties().entrySet()); | try { return getAsMapOfRubyStrings(runtime, System.getProperties().entrySet()); } catch (AccessControlException accessEx) { return new HashMap(); } | public Map getSystemPropertiesMap(IRuby runtime) { return getAsMapOfRubyStrings(runtime, System.getProperties().entrySet()); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/d38821551a58969cd2593b463d93df5f32bf3c14/OSEnvironment.java/clean/src/org/jruby/environment/OSEnvironment.java |
throw new NullPointerException("No ROI at: "+i+"."); | throw new NullPointerException("No ROI at: "+i+"."); this.rois = rois; | public ROIAnalyzer(ROI5D[] rois, DataSink source, PixelsDimensions dims) { //Fail-fast checks. Failing in the middle of an analysis is generally //very expensive. (Think of rois[0]!=null and rois[1]==null and a //200 timepoints image; assume rois[0] defines at least one 2D selection //per timepoint...) if (rois == null) throw new NullPointerException("No rois."); if (rois.length == 0) throw new IllegalArgumentException("No ROI defined."); for (int i = 0; i < rois.length; ++i) if (rois[i] == null) throw new NullPointerException("No ROI at: "+i+"."); //Constructor will check source and dims. runner = new PointIterator(source, dims); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIAnalyzer.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIAnalyzer.java |
this.dims = dims; | public ROIAnalyzer(ROI5D[] rois, DataSink source, PixelsDimensions dims) { //Fail-fast checks. Failing in the middle of an analysis is generally //very expensive. (Think of rois[0]!=null and rois[1]==null and a //200 timepoints image; assume rois[0] defines at least one 2D selection //per timepoint...) if (rois == null) throw new NullPointerException("No rois."); if (rois.length == 0) throw new IllegalArgumentException("No ROI defined."); for (int i = 0; i < rois.length; ++i) if (rois[i] == null) throw new NullPointerException("No ROI at: "+i+"."); //Constructor will check source and dims. runner = new PointIterator(source, dims); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/c3acf0375531681576d4a65f174981535a8919ae/ROIAnalyzer.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIAnalyzer.java |
|
if (dims == null) throw new NullPointerException("No dims."); | if (dims == null) throw new NullPointerException("No dims."); this.dims = dims; | public ROIStats(PixelsDimensions dims) { if (dims == null) throw new NullPointerException("No dims."); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/83adfc51b46811002b63a5e63336b8585ab9d4b4/ROIStats.java/buggy/SRC/org/openmicroscopy/shoola/env/rnd/roi/ROIStats.java |
version1 = version1.replaceAll(".online", ""); | public boolean isGreater(String version1, String version2) { return version1.compareTo(version2) >= 1; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/9cf7945b70183f60db5f493b968c7b801cf52788/CheckUpdates.java/clean/src/java/org/jivesoftware/sparkimpl/updater/CheckUpdates.java |
|
setBackground(Color.black); | setBackground(Color.white); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.black); titleLabel.setFont(new Font("dialog", Font.BOLD, 11)); descriptionLabel.setFont(new Font("dialog", 0, 10)); } else { final JPanel panel = new ImagePanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); titleLabel.setVerticalTextPosition(JLabel.CENTER); titleLabel.setFont(new Font("dialog", Font.BOLD, 14)); titleLabel.setForeground(Color.black); descriptionLabel.setFont(new Font("dialog", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/0807e1b794eeaa6c07d31a5c351697146a85040b/TitlePanel.java/buggy/src/java/org/jivesoftware/spark/component/TitlePanel.java |
setName(names[ratingIndex]); | name = names[ratingIndex]; | public RateImageAction(ImViewer model, int ratingIndex) { super(model); setEnabled(true); controlsIndex(ratingIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.ratingIndex = ratingIndex; putValue(Action.NAME, UIUtilities.formatToolTipText(names[ratingIndex])); setName(names[ratingIndex]); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/RateImageAction.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/actions/RateImageAction.java |
return "Repository"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); | return "Repository"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); | public String toString(){ return "Repository"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/51a3c546dfc7a7a98b29771a459df19094fc5b51/Repository.java/clean/components/common/src/ome/model/Repository.java |
PixelsService service = PixelsService.getInstance(); | PixelsService service = new PixelsService(PixelsService.ROOT_DEFAULT); | protected void setUp() { pixels = new Pixels(); pixels.setId(1L); pixels.setSizeX(256); pixels.setSizeY(256); pixels.setSizeZ(64); pixels.setSizeC(3); pixels.setSizeT(50); PixelsType type = new PixelsType(); pixels.setPixelsType(type); // FIXME PixelsService service = PixelsService.getInstance(); pixelBuffer = service.getPixelBuffer(pixels); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/ae0b01fad17fcacba3ec0999ca1ad645f389b5f9/NormalPixelBufferUnitTest.java/clean/components/omeio-nio/test/ome/io/nio/utests/NormalPixelBufferUnitTest.java |
RubyArray newArgs = RubyArray.create(recv, args); | RubyArray newArgs = RubyArray.newArray(recv.getRuntime(), args); | public static IRubyObject sprintf(IRubyObject recv, IRubyObject args[]) { if (args.length == 0) { throw new ArgumentError(recv.getRuntime(), "sprintf must have at least one argument"); } RubyString str = RubyString.stringValue(args[0]); RubyArray newArgs = RubyArray.create(recv, args); newArgs.shift(); return str.format(newArgs); } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/3acff782b00a5f6892fe6bd44e0665cc6194f9aa/RubyKernel.java/clean/org/jruby/RubyKernel.java |
System.out.println(v); | public void setDelay(int v) { if (state != STOP) return; delay = DELAY/v; timer.setDelay(delay); timer.setInitialDelay(delay*10);//to check if that's correct. } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/3b273af3a5320ab0a054540f14a3c299ff01de69/Player.java/buggy/SRC/org/openmicroscopy/shoola/agents/imviewer/util/player/Player.java |
|
List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders); | public ObjectName load(Kernel kernel, String location) { try { LiveHashSet repositories = new LiveHashSet(kernel, "repositories", Collections.singleton(new ObjectName("*:j2eeType=Repository,*"))); repositories.start(); ConfigurationInfo configurationInfo = loadConfigurationInfo(location); final ClassLoader classLoader = ConfigurationUtil.createClassLoader(configurationInfo.getConfigurationId(), configurationInfo.getDependencies(), getClass().getClassLoader(), repositories); DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); try { Resource resource = new FileSystemResource(new File(location)); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory) { public ClassLoader getBeanClassLoader() { return classLoader; } }; reader.loadBeanDefinitions(resource); } catch (BeansException e) { // not a spring file return null; } // convert properties into named constructor args List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders); NamedConstructorArgs namedConstructorArgs = new NamedConstructorArgs(metadataManager); namedConstructorArgs.postProcessBeanFactory(factory); // create object names for all of the beans ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder(metadataManager, configurationInfo.getDomain(), configurationInfo.getServer(), configurationInfo.getConfigurationId().toString()); objectNameBuilder.postProcessBeanFactory(factory); // auto detect the livecycle methods (todo this needs work) LifecycleDetector lifecycleDetector = new LifecycleDetector(); lifecycleDetector.addLifecycleInterface(SimpleLifecycle.class, "start", "stop"); lifecycleDetector.addLifecycleInterface(org.apache.geronimo.gbean.GBeanLifecycle.class, "doStart", "doStop"); lifecycleDetector.postProcessBeanFactory(factory); Map serviceFactories = new LinkedHashMap(); String[] beanDefinitionNames = factory.getBeanDefinitionNames(); if (beanDefinitionNames != null) { for (int i = 0; i < beanDefinitionNames.length; i++) { String beanName = beanDefinitionNames[i]; BeanDefinition beanDefinition = factory.getBeanDefinition(beanName); ServiceFactory serviceFactory = new SpringServiceFactory((RootBeanDefinition) beanDefinition, objectNameBuilder.getObjectNameMap()); ObjectName objectName = objectNameBuilder.getObjectName(beanName); serviceFactories.put(objectName, serviceFactory); } } SpringConfiguration springConfiguration = new SpringConfiguration(kernel, configurationInfo, serviceFactories, classLoader); SimpleServiceFactory springServiceFactory = new SimpleServiceFactory(springConfiguration); ObjectName configurationObjectName = springConfiguration.getObjectName(); kernel.loadService(configurationObjectName, springServiceFactory, classLoader); return configurationObjectName; } catch (Exception e) { throw new InvalidConfigurationException("Unable to load configuration: " + location, e); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SpringLoader.java/clean/kernel/src/java/org/gbean/spring/SpringLoader.java |
|
} catch (InvalidConfigurationException e) { throw e; | public ObjectName load(Kernel kernel, String location) { try { LiveHashSet repositories = new LiveHashSet(kernel, "repositories", Collections.singleton(new ObjectName("*:j2eeType=Repository,*"))); repositories.start(); ConfigurationInfo configurationInfo = loadConfigurationInfo(location); final ClassLoader classLoader = ConfigurationUtil.createClassLoader(configurationInfo.getConfigurationId(), configurationInfo.getDependencies(), getClass().getClassLoader(), repositories); DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); try { Resource resource = new FileSystemResource(new File(location)); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory) { public ClassLoader getBeanClassLoader() { return classLoader; } }; reader.loadBeanDefinitions(resource); } catch (BeansException e) { // not a spring file return null; } // convert properties into named constructor args List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders); NamedConstructorArgs namedConstructorArgs = new NamedConstructorArgs(metadataManager); namedConstructorArgs.postProcessBeanFactory(factory); // create object names for all of the beans ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder(metadataManager, configurationInfo.getDomain(), configurationInfo.getServer(), configurationInfo.getConfigurationId().toString()); objectNameBuilder.postProcessBeanFactory(factory); // auto detect the livecycle methods (todo this needs work) LifecycleDetector lifecycleDetector = new LifecycleDetector(); lifecycleDetector.addLifecycleInterface(SimpleLifecycle.class, "start", "stop"); lifecycleDetector.addLifecycleInterface(org.apache.geronimo.gbean.GBeanLifecycle.class, "doStart", "doStop"); lifecycleDetector.postProcessBeanFactory(factory); Map serviceFactories = new LinkedHashMap(); String[] beanDefinitionNames = factory.getBeanDefinitionNames(); if (beanDefinitionNames != null) { for (int i = 0; i < beanDefinitionNames.length; i++) { String beanName = beanDefinitionNames[i]; BeanDefinition beanDefinition = factory.getBeanDefinition(beanName); ServiceFactory serviceFactory = new SpringServiceFactory((RootBeanDefinition) beanDefinition, objectNameBuilder.getObjectNameMap()); ObjectName objectName = objectNameBuilder.getObjectName(beanName); serviceFactories.put(objectName, serviceFactory); } } SpringConfiguration springConfiguration = new SpringConfiguration(kernel, configurationInfo, serviceFactories, classLoader); SimpleServiceFactory springServiceFactory = new SimpleServiceFactory(springConfiguration); ObjectName configurationObjectName = springConfiguration.getObjectName(); kernel.loadService(configurationObjectName, springServiceFactory, classLoader); return configurationObjectName; } catch (Exception e) { throw new InvalidConfigurationException("Unable to load configuration: " + location, e); } } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/SpringLoader.java/clean/kernel/src/java/org/gbean/spring/SpringLoader.java |
|
public InvalidConfigurationException(String s, Throwable throwable) { super(s, throwable); | public InvalidConfigurationException() { | public InvalidConfigurationException(String s, Throwable throwable) { super(s, throwable); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/InvalidConfigurationException.java/buggy/kernel/src/java/org/gbean/configuration/InvalidConfigurationException.java |
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); | public void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException { super.visitBeanDefinition(beanDefinition, data); | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
parametersToConstructorArgs(rootBeanDefinition); | processParameters(rootBeanDefinition); | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
visitor.visitBeanFactory(beanFactory); | visitor.visitBeanFactory(beanFactory, null); | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/NamedConstructorArgs.java/buggy/kernel/src/java/org/gbean/spring/NamedConstructorArgs.java |
public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) { | public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String moduleName) { | public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) { this.metadataManager = metadataManager; this.domainName = domainName; this.serverName = serverName; this.applicationName = applicationName; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/ObjectNameBuilder.java/buggy/kernel/src/java/org/gbean/spring/ObjectNameBuilder.java |
this.applicationName = applicationName; | this.moduleName = moduleName; | public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) { this.metadataManager = metadataManager; this.domainName = domainName; this.serverName = serverName; this.applicationName = applicationName; } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/ObjectNameBuilder.java/buggy/kernel/src/java/org/gbean/spring/ObjectNameBuilder.java |
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); | public void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException { super.visitBeanDefinition(beanDefinition, data); | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } } }; visitor.visitBeanFactory(beanFactory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/LifecycleDetector.java/buggy/kernel/src/java/org/gbean/spring/LifecycleDetector.java |
visitor.visitBeanFactory(beanFactory); | visitor.visitBeanFactory(beanFactory, null); | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } } }; visitor.visitBeanFactory(beanFactory); } | 52533 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52533/6a661ce4fbc3261ed4b3a744b1e1919df53cbbf7/LifecycleDetector.java/buggy/kernel/src/java/org/gbean/spring/LifecycleDetector.java |
add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 5), 0, 0)); | add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 10), 0, 0)); | public SparkTab(Icon icon, String text) { setLayout(new GridBagLayout()); selectedBorderColor = new Color(173, 0, 0); // setBackground(backgroundColor); this.actualText = text; iconLabel = new JLabel(icon); iconLabel.setOpaque(false); textLabel = new JLabel(text); // add Label add(iconLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 2, 3, 2), 0, 0)); // add text label add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 5), 0, 0)); // Set fonts defaultFont = new Font("Dialog", Font.PLAIN, 11); textLabel.setFont(defaultFont); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/574c15c5effb6d20a2b7e90ba6b59211402c8696/SparkTab.java/clean/src/java/org/jivesoftware/spark/component/tabbedPane/SparkTab.java |
return strategy.pack(data, offset, bytesPerPixel); | switch(javaType) { case PlaneFactory.BYTE: byte i = data.get(offset); return i; case PlaneFactory.SHORT: return data.getShort(offset); case PlaneFactory.INT: return data.getInt(offset); case PlaneFactory.FLOAT: return data.getFloat(offset); case PlaneFactory.DOUBLE: return data.getDouble(offset); } throw new RuntimeException("Unknown pixel type."); | public double getPixelValue(int x1, int x2) { int offset = calculateOffset(x1, x2); return strategy.pack(data, offset, bytesPerPixel); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/b2d1563defffc9fa654271400d754843f42e2810/Plane2D.java/buggy/components/rendering/src/omeis/providers/re/data/Plane2D.java |
_log.warning ("TemplateProvider: Template not found: " + fileName, npe); | _log.warning ("TemplateProvider: Template not found: " + fileName); | final public Template getTemplate(String fileName) { File tFile = findTemplate (fileName); Template t = null; try { t = new FileTemplate (_broker, tFile); t.parse (); _lastModifiedCache.put (fileName, new Long (tFile.lastModified())); return t; } catch (NullPointerException npe) { _log.warning ("TemplateProvider: Template not found: " + fileName, npe); } catch (Exception e) { // this probably occured b/c of a parsing error. // should throw some kind of ParseErrorException here instead _log.warning ("TemplateProvider: Error occured while getting " + fileName, e); } return null; } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/3a5b935d0fecd6ca6762a4f8eb9163a9970c170b/TemplateProvider.java/buggy/webmacro/src/org/webmacro/resource/TemplateProvider.java |
if (_templatePath == null) { _log.error("TemplatePath not specified in properties"); _templatePath = ""; } | public void init(Broker b, Settings config) throws InitException { super.init(b,config); _broker = b; _log = b.getLog("resource", "Object loading and caching"); try { _cacheDuration = config.getIntegerSetting("TemplateExpireTime", 0); _templatePath = config.getSetting("TemplatePath"); StringTokenizer st = new StringTokenizer(_templatePath, _pathSeparator); _templateDirectory = new String[ st.countTokens() ]; int i; for (i=0; i < _templateDirectory.length; i++) { String dir = st.nextToken(); _templateDirectory[i] = dir; } } catch(Exception e) { throw new InitException("Could not initialize",e); } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/3a5b935d0fecd6ca6762a4f8eb9163a9970c170b/TemplateProvider.java/buggy/webmacro/src/org/webmacro/resource/TemplateProvider.java |
|
public int getIntegerSetting(String key, int defaultValue) { if (containsKey(key)) { return getIntegerSetting(key); } else { return defaultValue; | public int getIntegerSetting(String key) { String snum = getSetting(key); try { return Integer.parseInt(snum); } catch (Exception e) { return 0; | public int getIntegerSetting(String key, int defaultValue) { if (containsKey(key)) { return getIntegerSetting(key); } else { return defaultValue; } } | 52513 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52513/3a5b935d0fecd6ca6762a4f8eb9163a9970c170b/Settings.java/buggy/webmacro/src/org/webmacro/util/Settings.java |
setBackground(Color.white); | setBackground(Color.black); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e09aa9d934a9c1b5e4ed60e26d9643f0b23212a8/TitlePanel.java/clean/src/java/org/jivesoftware/spark/component/TitlePanel.java |
titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); | titleLabel.setFont(new Font("dialog", Font.BOLD, 11)); descriptionLabel.setFont(new Font("dialog", 0, 10)); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e09aa9d934a9c1b5e4ed60e26d9643f0b23212a8/TitlePanel.java/clean/src/java/org/jivesoftware/spark/component/TitlePanel.java |
final JPanel panel = new JPanel(); | final JPanel panel = new ImagePanel(); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e09aa9d934a9c1b5e4ed60e26d9643f0b23212a8/TitlePanel.java/clean/src/java/org/jivesoftware/spark/component/TitlePanel.java |
panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); | panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e09aa9d934a9c1b5e4ed60e26d9643f0b23212a8/TitlePanel.java/clean/src/java/org/jivesoftware/spark/component/TitlePanel.java |
panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); | titleLabel.setVerticalTextPosition(JLabel.CENTER); titleLabel.setFont(new Font("dialog", Font.BOLD, 14)); titleLabel.setForeground(Color.black); descriptionLabel.setFont(new Font("dialog", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0)); | public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/e09aa9d934a9c1b5e4ed60e26d9643f0b23212a8/TitlePanel.java/clean/src/java/org/jivesoftware/spark/component/TitlePanel.java |
WebdavResource resource = slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath); | private void makesureStandardFolderisCreated() { IWUserContext iwuc = getIWUserContext(); IWSlideService slideService = getIWSlideService(iwuc); String contentFolderPath = ArticleUtil.getContentRootPath(); String articlePath = ArticleUtil.getArticleRootPath(); try { //first make the folder: slideService.createAllFoldersInPathAsRoot(articlePath); WebdavResource resource = slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath); AccessControlList aclList = slideService.getAccessControlList(contentFolderPath); AuthenticationBusiness authBusiness = ((IWSlideServiceBean)slideService).getAuthenticationBusiness(); String editorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_EDITOR); Ace editorAce = new Ace(editorRoleUri); editorAce.addPrivilege(Privilege.READ); editorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry editorEntry = new AccessControlEntry(editorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(editorEntry); String authorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_AUTHOR); Ace authorAce = new Ace(authorRoleUri); authorAce.addPrivilege(Privilege.READ); authorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry authorEntry = new AccessControlEntry(authorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(authorEntry); slideService.storeAccessControlList(aclList); //debug: aclList = slideService.getAccessControlList(contentFolderPath); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/86bcfa751eb12cc3b02291868448e4a4d243faf3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
|
body = baos.toString(); | body = baos.toString("UTF-8"); | 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); 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(); } // System.out.println("ArticleOut = "+articleOut); setBody(body); } } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/86bcfa751eb12cc3b02291868448e4a4d243faf3/ArticleItemBean.java/buggy/src/java/com/idega/block/article/bean/ArticleItemBean.java |
return ContentUtil.getContentRootPath(); | return ContentUtil.getContentBaseFolderPath(); | public static String getContentRootPath(){ return ContentUtil.getContentRootPath(); } | 57000 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/57000/9dd8a7f9883fa3785baebfbed97ebf38eba1add9/ArticleUtil.java/buggy/src/java/com/idega/block/article/business/ArticleUtil.java |
Pattern p = Pattern.compile(glob2Regexp(pattern)); | private static Collection getMatchingFiles(final NormalizedFile parent, final String pattern, final boolean isDirectory) { FileFilter filter = new FileFilter() { Pattern p = Pattern.compile(glob2Regexp(pattern)); public boolean accept(File pathname) { return (pathname.isDirectory() || !isDirectory) && p.matcher(pathname.getName()).matches(); } }; NormalizedFile[] matchArray = (NormalizedFile[])parent.listFiles(filter); Collection matchingFiles = new ArrayList(); if (matchArray != null) { for (int i = 0; i < matchArray.length; i++) { matchingFiles.add(matchArray[i]); if (pattern.equals("**")) { // recurse into dirs if (matchArray[i].isDirectory()) { matchingFiles.addAll(getMatchingFiles(matchArray[i], pattern, isDirectory)); } } } } return matchingFiles; } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/de57bcba8c547c0e27b2a2367bbd793bda772c32/Glob.java/buggy/src/org/jruby/util/Glob.java |
|
public File[] listFiles(FileFilter filter) { File[] files = super.listFiles(filter); | public File[] listFiles() { File[] files = super.listFiles(); | public File[] listFiles(FileFilter filter) { File[] files = super.listFiles(filter); if (files == null) { return null; } else { NormalizedFile[] smartFiles = new NormalizedFile[files.length]; for (int i = 0; i < files.length; i++) { smartFiles[i] = new NormalizedFile(files[i].getPath()); } return smartFiles; } } | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/c506a9979e35512d57d5f29f0d18b3da14ef2919/NormalizedFile.java/buggy/src/org/jruby/util/NormalizedFile.java |
public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition); | public ISourcePosition getPosition(ISourcePosition startPosition, boolean inclusive); | public ISourcePosition getPosition(LexerSource source, ISourcePosition startPosition); | 50661 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/50661/b1293eda8454686e846e2a9837b348e2983bb423/ISourcePositionFactory.java/clean/src/org/jruby/lexer/yacc/ISourcePositionFactory.java |
chatPref = (ChatPreferences)preferenceManager.getPreferenceData(ChatPreference.NAMESPACE); | public TranscriptWindow() { setEditable(false); /* Load Preferences for this instance */ PreferenceManager preferenceManager = SparkManager.getPreferenceManager(); chatPref = (ChatPreferences)preferenceManager.getPreferenceData(ChatPreference.NAMESPACE); addMouseListener(this); addMouseMotionListener(this); setDragEnabled(true); final TranscriptWindow window = this; addContextMenuListener(new ContextMenuListener() { public void poppingUp(Object component, JPopupMenu popup) { Action printAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { SparkManager.printChatTranscript(window); } }; Action clearAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { clear(); } }; printAction.putValue(Action.NAME, "Print"); printAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.PRINTER_IMAGE_16x16)); clearAction.putValue(Action.NAME, "Clear"); clearAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.ERASER_IMAGE)); popup.addSeparator(); popup.add(printAction); popup.add(clearAction); } public void poppingDown(JPopupMenu popup) { } public boolean handleDefaultAction(MouseEvent e) { return false; } }); // Make sure ctrl-c works getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control c"), "copy"); getActionMap().put("copy", new AbstractAction("copy") { public void actionPerformed(ActionEvent evt) { StringSelection ss = new StringSelection(getSelectedText()); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); } }); } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/TranscriptWindow.java/buggy/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java |
|
chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); | final LocalPreferences pref = SettingsManager.getLocalPreferences(); | private String getDate(Date insertDate) { chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (insertDate == null) { insertDate = new Date(); } StyleConstants.setFontFamily(styles, font.getFontName()); StyleConstants.setFontSize(styles, font.getSize()); if (chatPref.showDatesInChat()) { final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); final String date = formatter.format(insertDate); return "[" + date + "] "; } lastUpdated = insertDate; return ""; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/TranscriptWindow.java/buggy/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java |
if (chatPref.showDatesInChat()) { | if (pref.isTimeDisplayedInChat()) { | private String getDate(Date insertDate) { chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (insertDate == null) { insertDate = new Date(); } StyleConstants.setFontFamily(styles, font.getFontName()); StyleConstants.setFontSize(styles, font.getSize()); if (chatPref.showDatesInChat()) { final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); final String date = formatter.format(insertDate); return "[" + date + "] "; } lastUpdated = insertDate; return ""; } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/TranscriptWindow.java/buggy/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java |
from = chatPref.getNickname(); | from = pref.getNickname(); | public void saveTranscript(String fileName, List transcript, String headerData) { try { SimpleDateFormat formatter; File defaultSaveFile = new File(new File(Spark.getUserHome()), fileName); final JFileChooser fileChooser = new JFileChooser(defaultSaveFile); fileChooser.setSelectedFile(defaultSaveFile); // Show save dialog; this method does not return until the dialog is closed int result = fileChooser.showSaveDialog(this); final File selFile = fileChooser.getSelectedFile(); if (selFile != null && result == JFileChooser.APPROVE_OPTION) { final StringBuffer buf = new StringBuffer(); final Iterator transcripts = transcript.iterator(); buf.append("<html><body>"); if (headerData != null) { buf.append(headerData); } buf.append("<table width=600>"); while (transcripts.hasNext()) { final Message message = (Message)transcripts.next(); String from = message.getFrom(); if (from == null) { from = chatPref.getNickname(); } if (Message.Type.GROUP_CHAT == message.getType()) { if (ModelUtil.hasLength(StringUtils.parseResource(from))) { from = StringUtils.parseResource(from); } } final String body = message.getBody(); final Date insertionDate = (Date)message.getProperty("insertionDate"); formatter = new SimpleDateFormat("hh:mm:ss"); String value = ""; if (insertionDate != null) { value = "[" + formatter.format(insertionDate) + "] "; } buf.append("<tr><td nowrap><font size=2>").append(value).append("<strong>").append(from).append(":</strong> ").append(body).append("</font></td></tr>"); } buf.append("</table></body></html>"); final BufferedWriter writer = new BufferedWriter(new FileWriter(selFile)); writer.write(buf.toString()); writer.close(); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Chat transcript has been saved.", "Chat Transcript Saved", JOptionPane.INFORMATION_MESSAGE); } } catch (Exception ex) { Log.error("Unable to save chat transcript.", ex); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Could not save transcript.", "Error", JOptionPane.ERROR_MESSAGE); } } | 52006 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/52006/f678f06c6fbc4a84079c230a0a7461759cb20755/TranscriptWindow.java/buggy/src/java/org/jivesoftware/spark/ui/TranscriptWindow.java |
{ this.abstraction = abstraction; | { this.abstraction = abstraction; | public ViewerCtrl(Viewer abstraction) { this.abstraction = abstraction; magFactor = ImageInspector.ZOOM_DEFAULT; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
} | drawingArea = new Rectangle(); iat = new ImageAffineTransform(); iat.setMagFactor(magFactor); } | public ViewerCtrl(Viewer abstraction) { this.abstraction = abstraction; magFactor = ImageInspector.ZOOM_DEFAULT; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ String s = e.getActionCommand(); int index = Integer.parseInt(s); try { switch (index) { case RENDERING: showRendering(); break; case SAVE_AS: showImageSaver(); break; case INSPECTOR: showInspector(); break; case VIEWER3D: showImage3DViewer(); break; case MOVIE: showMovie(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | { String s = e.getActionCommand(); int index = Integer.parseInt(s); try { switch (index) { case RENDERING: showRendering(); break; case SAVE_AS: showImageSaver(); break; case INSPECTOR: showInspector(); break; case VIEWER3D: showImage3DViewer(); break; case MOVIE: showMovie(); break; case ROI: showROI(); break; } } catch(NumberFormatException nfe) { throw new Error("Invalid Action ID "+index, nfe); } } | public void actionPerformed(ActionEvent e) { String s = e.getActionCommand(); int index = Integer.parseInt(s); try { switch (index) { case RENDERING: showRendering(); break; case SAVE_AS: showImageSaver(); break; case INSPECTOR: showInspector(); break; case VIEWER3D: showImage3DViewer(); break; case MOVIE: showMovie(); 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/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ item.setActionCommand(""+id); item.addActionListener(this); } | { item.setActionCommand(""+id); item.addActionListener(this); } | void attachItemListener(AbstractButton item, int id) { item.setActionCommand(""+id); item.addActionListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ tSlider = presentation.getTSlider(); zSlider = presentation.getZSlider(); tSlider.addChangeListener(this); zSlider.addChangeListener(this); } | { tSlider = presentation.getTSlider(); zSlider = presentation.getZSlider(); tSlider.addChangeListener(this); zSlider.addChangeListener(this); } | void attachListener() { tSlider = presentation.getTSlider(); zSlider = presentation.getZSlider(); tSlider.addChangeListener(this); zSlider.addChangeListener(this); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ if (moviePlayer != null) moviePlayer.dispose(); if (imageInspector != null) imageInspector.dispose(); moviePlayer = null; imageInspector = null; | { if (moviePlayer != null) moviePlayer.dispose(); if (imageInspector != null) imageInspector.dispose(); setRoiOnOff(false); moviePlayer = null; imageInspector = null; | void disposeDialogs() { if (moviePlayer != null) moviePlayer.dispose(); if (imageInspector != null) imageInspector.dispose(); moviePlayer = null; imageInspector = null; movieSettings = null; magFactor = ImageInspector.ZOOM_DEFAULT; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
} | } | void disposeDialogs() { if (moviePlayer != null) moviePlayer.dispose(); if (imageInspector != null) imageInspector.dispose(); moviePlayer = null; imageInspector = null; movieSettings = null; magFactor = ImageInspector.ZOOM_DEFAULT; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ return abstraction.getCurImage(); } | { return abstraction.getCurImage(); } | public BufferedImage getBufferedImage() { return abstraction.getCurImage(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ return presentation; } | { return presentation; } | public ViewerUIF getReferenceFrame() { return presentation; } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ return abstraction.getRegistry(); } | { return abstraction.getRegistry(); } | public Registry getRegistry() { return abstraction.getRegistry(); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ abstraction.onPlaneSelected(z, t); } | { abstraction.onPlaneSelected(z, t); } | public void onPlaneSelected(int z, int t) { abstraction.onPlaneSelected(z, t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ | { | public void onTChange(int z, int t) { resetTSlider(t); abstraction.onPlaneSelected(z, t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
abstraction.onPlaneSelected(z, t); } | abstraction.onPlaneSelected(z, t); } | public void onTChange(int z, int t) { resetTSlider(t); abstraction.onPlaneSelected(z, t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
{ | { | public void onZChange(int z, int t) { resetZSlider(z); abstraction.onPlaneSelected(z, t); } | 54698 /local/tlutelli/issta_data/temp/all_java5context/java/2006_temp/2006/54698/a81a5a58f8e54d006d057455465766c8d3d72998/ViewerCtrl.java/buggy/SRC/org/openmicroscopy/shoola/agents/viewer/ViewerCtrl.java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.