bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
public List retrieveImagesInUserDatasetsNotInCategoryGroup( CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { Iterator i = group.getCategories().iterator(); Map ids = new HashMap(); CategorySummary cs; Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } List images = new ArrayList(); List userImages = registry.getDataManagementService().retrieveImagesInUserDatasets(); Iterator j = userImages.iterator(); ImageSummary is; while (j.hasNext()) { is = (ImageSummary) j.next(); if (!ids.containsKey(new Integer(is.getID()))) images.add(is); } return images; }
|
public List retrieveImagesInUserDatasetsNotInCategoryGroup( CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { Iterator i = group.getCategories().iterator(); Map ids = new HashMap(); CategorySummary cs; Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } List images = new ArrayList(); List userImages = registry.getDataManagementService().retrieveImagesInUserDatasets(); Iterator j = userImages.iterator(); ImageSummary is; while (j.hasNext()) { is = (ImageSummary) j.next(); if (!ids.containsKey(new Integer(is.getID()))) images.add(is); } return images; }
| 3,236,267
|
public List retrieveImagesInUserDatasetsNotInCategoryGroup( CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { Iterator i = group.getCategories().iterator(); Map ids = new HashMap(); CategorySummary cs; Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } List images = new ArrayList(); List userImages = registry.getDataManagementService().retrieveImagesInUserDatasets(); Iterator j = userImages.iterator(); ImageSummary is; while (j.hasNext()) { is = (ImageSummary) j.next(); if (!ids.containsKey(new Integer(is.getID()))) images.add(is); } return images; }
|
public List retrieveImagesInUserDatasetsNotInCategoryGroup( CategoryGroupData group) throws DSOutOfServiceException, DSAccessException { Iterator i = group.getCategories().iterator(); Map ids = new HashMap(); CategorySummary cs; Iterator k; Object obj; while (i.hasNext()) { cs = (CategorySummary) i.next(); k = cs.getImages().iterator(); while (k.hasNext()) { obj = k.next(); //Integer ids.put(obj, obj); } } List images = new ArrayList(); List userImages = registry.getDataManagementService().retrieveImagesInUserDatasets(); Iterator j = userImages.iterator(); ImageSummary is; while (j.hasNext()) { is = (ImageSummary) j.next(); if (!ids.containsKey(new Integer(is.getID()))) images.add(is); } return images; }
| 3,236,268
|
protected void setUp() { pixels = new Pixels(); pixels.setId(1L); pixels.setSizeX(512); pixels.setSizeY(512); 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); }
|
protected void setUp() { pixels = new Pixels(); pixels.setId(1L); pixels.setSizeX(512); pixels.setSizeY(512); pixels.setSizeZ(64); pixels.setSizeC(3); pixels.setSizeT(50); PixelsType type = new PixelsType(); pixels.setPixelsType(type); // FIXME PixelsService service = new PixelsService(PixelsService.ROOT_DEFAULT); pixelBuffer = service.getPixelBuffer(pixels); }
| 3,236,269
|
public void displaysImagesName() { if (model.getState() == DISCARDED) throw new IllegalStateException("This method cannot be invoked "+ "in the DISCARDED state."); PartialNameVisitor v = new PartialNameVisitor(view.isPartialName()); accept(v, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); view.repaint(); }
|
public void displaysImagesName() { if (model.getState() == DISCARDED) throw new IllegalStateException("This method cannot be invoked "+ "in the DISCARDED state."); PartialNameVisitor v = new PartialNameVisitor(view.isPartialName()); accept(v, TreeImageDisplayVisitor.TREEIMAGE_NODE_ONLY); view.repaint(); }
| 3,236,270
|
public boolean isMainTree() { // TODO Auto-generated method stub return model.isMainTree(); }
|
publicbooleanisMainTree(){//TODOAuto-generatedmethodstubreturnmodel.isMainTree();}
| 3,236,271
|
public void navigate(boolean v) { TreeImageDisplay display = getLastSelectedDisplay(); if (display != null) { //shouldn't happen if (display.containsImages()) { controller.getAction(BrowserControl.FORWARD_NAV).setEnabled(!v); } else { controller.getAction(BrowserControl.FORWARD_NAV).setEnabled(v); } controller.getAction(BrowserControl.BACKWARD_NAV).setEnabled(!v); long id = -1; if (model.getGoIntoNode() != null) id = model.getGoIntoNode().getUserObjectId(); if (v) { model.setMainTree(v, null); view.navigate(); } else if (!v && !(display.getUserObjectId() == id)) { model.setMainTree(v, display); view.navigate(); } } }
|
public void navigate(boolean v) { TreeImageDisplay display = getLastSelectedDisplay(); if (display != null) { //shouldn't happen if (display.containsImages()) { controller.getAction(BrowserControl.FORWARD_NAV).setEnabled(!v); } else { controller.getAction(BrowserControl.FORWARD_NAV).setEnabled(v); } controller.getAction(BrowserControl.BACKWARD_NAV).setEnabled(!v); long id = -1; if (model.getGoIntoNode() != null) id = model.getGoIntoNode().getUserObjectId(); if (v) { model.setMainTree(v, null); view.navigate(); } else if (!v && !(display.getUserObjectId() == id)) { model.setMainTree(v, display); view.navigate(); } } }
| 3,236,272
|
public void visitDefnNode(DefnNode iVisited) { RubyModule containingClass = threadContext.getRubyClass(); if (containingClass == null) { throw new TypeError(runtime, "No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getClasses().getObjectClass() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = threadContext.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } else if (visibility.isPublic() && containingClass == runtime.getClasses().getObjectClass()) { visibility = iVisited.getVisibility(); } MetaClass singletonClass = null; // if defining in a singleton, pop it and use visitDefs-style definition below if (runtime.getRubyClass().isSingleton()) { singletonClass = (MetaClass)threadContext.popClass(); containingClass = threadContext.getRubyClass(); } DefaultMethod newMethod = new DefaultMethod(iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, threadContext.getRubyClass()); iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); containingClass.addMethod(name, newMethod); if (threadContext.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod(name, new WrapperCallable(newMethod, Visibility.PUBLIC)); containingClass.callMethod("singleton_method_added", runtime.newSymbol(name)); } if (singletonClass != null) { threadContext.pushClass(singletonClass); singletonClass.addMethod(iVisited.getName(), newMethod); // FIXME: need to call someone's singleton_method_added (receiver is lost at this point)! //.callMethod("singleton_method_added", runtime.toSymbol(iVisited.getName())); } else { containingClass.callMethod("method_added", runtime.newSymbol(name)); } }
|
public void visitDefnNode(DefnNode iVisited) { RubyModule containingClass = threadContext.getRubyClass(); if (containingClass == null) { throw new TypeError(runtime, "No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getClasses().getObjectClass() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = threadContext.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } else if (visibility.isPublic() && containingClass == runtime.getClasses().getObjectClass()) { visibility = iVisited.getVisibility(); } MetaClass singletonClass = null; // if defining in a singleton, pop it and use visitDefs-style definition below if (runtime.getRubyClass().isSingleton()) { singletonClass = (MetaClass)threadContext.popClass(); containingClass = threadContext.getRubyClass(); } DefaultMethod newMethod = new DefaultMethod(iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, threadContext.getRubyClass()); iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); containingClass.addMethod(name, newMethod); if (threadContext.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod(name, new WrapperCallable(newMethod, Visibility.PUBLIC)); containingClass.callMethod("singleton_method_added", runtime.newSymbol(name)); } if (singletonClass != null) { threadContext.pushClass(singletonClass); singletonClass.addMethod(iVisited.getName(), newMethod); // FIXME: need to call someone's singleton_method_added (receiver is lost at this point)! //.callMethod("singleton_method_added", runtime.toSymbol(iVisited.getName())); } else { containingClass.callMethod("method_added", runtime.newSymbol(name)); } }
| 3,236,276
|
public void visitDefnNode(DefnNode iVisited) { RubyModule containingClass = threadContext.getRubyClass(); if (containingClass == null) { throw new TypeError(runtime, "No class to add method."); } String name = iVisited.getName(); if (containingClass == runtime.getClasses().getObjectClass() && name.equals("initialize")) { runtime.getWarnings().warn("redefining Object#initialize may cause infinite loop"); } Visibility visibility = threadContext.getCurrentVisibility(); if (name.equals("initialize") || visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } else if (visibility.isPublic() && containingClass == runtime.getClasses().getObjectClass()) { visibility = iVisited.getVisibility(); } MetaClass singletonClass = null; // if defining in a singleton, pop it and use visitDefs-style definition below if (runtime.getRubyClass().isSingleton()) { singletonClass = (MetaClass)threadContext.popClass(); containingClass = threadContext.getRubyClass(); } DefaultMethod newMethod = new DefaultMethod(iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, threadContext.getRubyClass()); iVisited.getBodyNode().accept(new CreateJumpTargetVisitor(newMethod)); containingClass.addMethod(name, newMethod); if (threadContext.getCurrentVisibility().isModuleFunction()) { containingClass.getSingletonClass().addMethod(name, new WrapperCallable(newMethod, Visibility.PUBLIC)); containingClass.callMethod("singleton_method_added", runtime.newSymbol(name)); } if (singletonClass != null) { threadContext.pushClass(singletonClass); singletonClass.addMethod(iVisited.getName(), newMethod); // FIXME: need to call someone's singleton_method_added (receiver is lost at this point)! //.callMethod("singleton_method_added", runtime.toSymbol(iVisited.getName())); } else { containingClass.callMethod("method_added", runtime.newSymbol(name)); } }
|
*/ */ */ */ public*/ void*/ visitDefnNode(DefnNode*/ iVisited)*/ {*/ */ */ */ */ */ */ */ RubyModule*/ containingClass*/ =*/ threadContext.getRubyClass();*/ */ */ */ */ */ */ */ if*/ (containingClass*/ ==*/ null)*/ {*/ */ */ */ */ */ */ */ */ */ */ */ throw*/ new*/ TypeError(runtime,*/ "No*/ class*/ to*/ add*/ method.");*/ */ */ */ */ */ */ */ }*/ */ */ */ */ */ */ */ String*/ name*/ =*/ iVisited.getName();*/ */ */ */ */ */ */ */ if*/ (containingClass*/ ==*/ runtime.getClasses().getObjectClass()*/ &&*/ name.equals("initialize"))*/ {*/ */ */ */ */ */ */ */ */ */ */ */ runtime.getWarnings().warn("redefining*/ Object#initialize*/ may*/ cause*/ infinite*/ loop");*/ */ */ */ */ */ */ */ }*/ */ */ */ */ */ */ */ Visibility*/ visibility*/ =*/ threadContext.getCurrentVisibility();*/ */ */ */ */ */ */ */ if*/ (name.equals("initialize")*/ ||*/ visibility.isModuleFunction())*/ {*/ */ */ */ */ */ */ */ */ */ */ */ visibility*/ =*/ Visibility.PRIVATE;*/ */ */ */ */ */ */ */ }*/ else*/ if*/ (visibility.isPublic()*/ &&*/ containingClass*/ ==*/ runtime.getClasses().getObjectClass())*/ {*/ */ */ */ */ */ */ */ */ */ */ */ visibility*/ =*/ iVisited.getVisibility();*/ */ */ */ */ */ */ */ }*/ */ */ */ */ */ */ */ MetaClass*/ singletonClass*/ =*/ null;*/ */ */ */ */ */ */ */ //*/ if*/ defining*/ in*/ a*/ singleton,*/ pop*/ it*/ and*/ use*/ visitDefs-style*/ definition*/ below*/ */ */ */ */ */ */ */ if*/ (runtime.getRubyClass().isSingleton())*/ {*/ */ */ */ */ */ */ */ singletonClass*/ =*/ (MetaClass)threadContext.popClass();*/ */ */ */ */ */ */ */ containingClass*/ =*/ threadContext.getRubyClass();*/ */ */ */ */ */ */ */ }*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ DefaultMethod*/ newMethod*/ =*/ new*/ DefaultMethod(iVisited.getBodyNode(),*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ (ArgsNode)*/ iVisited.getArgsNode(),*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ visibility,*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ threadContext.getRubyClass());*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ iVisited.getBodyNode().accept(new*/ CreateJumpTargetVisitor(newMethod));*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ containingClass.addMethod(name,*/ newMethod);*/ */ */ */ */ */ */ */ if*/ (threadContext.getCurrentVisibility().isModuleFunction())*/ {*/ */ */ */ */ */ */ */ */ */ */ */ containingClass.getSingletonClass().addMethod(name,*/ new*/ WrapperCallable(newMethod,*/ Visibility.PUBLIC));*/ */ */ */ */ */ */ */ */ */ */ */ containingClass.callMethod("singleton_method_added",*/ runtime.newSymbol(name));*/ */ */ */ */ */ */ */ }*/ */ */ */ */ */ */ */ */ */ */ */ */ */ */ */ if*/ (singletonClass*/ !=*/ null)*/ {*/ */ */ */ */ */ */ */ threadContext.pushClass(singletonClass);*/ */ */ */ */ */ */ */ singletonClass.addMethod(iVisited.getName(),*/ newMethod);*/ */ */ */ */ */ */ */ //*/ FIXME:*/ need*/ to*/ call*/ someone's*/ singleton_method_added*/ (receiver*/ is*/ lost*/ at*/ this*/ point)!*/ */ */ */ */ */ */ */ //.callMethod("singleton_method_added",*/ runtime.toSymbol(iVisited.getName()));*/ */ */ */ */ */ */ */ }*/ else*/ {*/ */ */ */ */ */ */ */ containingClass.callMethod("method_added",*/ runtime.newSymbol(name));*/ */ */ */ */ */ */ */ }*/ */ */ */ }
| 3,236,277
|
public Collection saveAndReturnCollection(Collection graph) { throw new RuntimeException("Not implemented yet."); }
|
public Collection saveAndReturnCollection( @Validate(IObject.class) Collection graph) { throw new RuntimeException("Not implemented yet."); }
| 3,236,278
|
public void saveCollection(Collection graph) { beforeSave(); for (Object _object : graph) { IObject obj = (IObject) _object; obj = internalSave(obj); } afterSave(); }
|
public void saveCollection(@Validate(IObject.class) Collection graph) { beforeSave(); for (Object _object : graph) { IObject obj = (IObject) _object; obj = internalSave(obj); } afterSave(); }
| 3,236,279
|
public RubyScope getScope() { return rubyScope; }
|
public RubyScope getScope() { return rubyScope; }
| 3,236,280
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); rubyScope.push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = rubyScope; setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); getScope().push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = rubyScope; setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
| 3,236,281
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); rubyScope.push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = rubyScope; setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); rubyScope.push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = (Scope)getScope().getTop(); setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
| 3,236,282
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); rubyScope.push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = rubyScope; setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
|
public void init() { if (initialized) { return; } initialized = true; setIter(new RubyIter()); // ruby_iter = &iter; rubyFrame = topFrame = new RubyFrame(this); // rb_origenviron = environ; // Init_stack(0); // Init_heap(); rubyScope.push(); // PUSH_SCOPE(); // rubyScope.setLocalVars(null); topScope = rubyScope; setActMethodScope(Constants.SCOPE_PRIVATE); try { callInits(); rubyClass = getClasses().getObjectClass(); rubyFrame.setSelf(rubyTopSelf); topCRef = new CRefNode(getClasses().getObjectClass(), null); cRef = topCRef; rubyFrame.setCbase(cRef); // defineGlobalConstant("TOPLEVEL_BINDING", rb_f_binding(ruby_top_self)); // ruby_prog_init(); } catch (Exception excptn) { excptn.printStackTrace(getRuntime().getErrorStream()); } rubyScope.pop(); rubyScope = topScope; }
| 3,236,283
|
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); RubyScope oldScope = getScope(); setScope(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); setScope(oldScope); } }
|
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); RubyScope oldScope = getScope(); setScope(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); setScope(oldScope); } }
| 3,236,284
|
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); RubyScope oldScope = getScope(); setScope(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); setScope(oldScope); } }
|
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { if (!isBlockGiven()) { throw new RaiseException(this, "LocalJumpError", "yield called out of block"); } RubyVarmap.push(this); pushClass(); RubyBlock tmpBlock = block.getTmp(); RubyFrame frame = new RubyFrame(tmpBlock.frame); // block.frame; frame.setPrev(getRubyFrame()); setRubyFrame(frame); CRefNode oldCRef = getCRef(); setCRef(getRubyFrame().getCbase()); RubyScope oldScope = getScope(); setScope(tmpBlock.scope); // block.pop(); block = block.prev; if ((block.flags & RubyBlock.BLOCK_D_SCOPE) != 0) { setDynamicVars(new RubyVarmap(null, null, tmpBlock.dynamicVars)); } else { setDynamicVars(block.dynamicVars); } setRubyClass((klass != null) ? klass : tmpBlock.klass); if (klass == null) { self = tmpBlock.self; } Node node = tmpBlock.body; if (tmpBlock.var != null) { // try { if (tmpBlock.var == Node.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() != 0) { throw new RubyArgumentException(this, "wrong # of arguments (" + ((RubyArray) value).getLength() + " for 0)"); } } else { if (!(tmpBlock.var instanceof MAsgnNode)) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } ((AssignableNode) tmpBlock.var).assign(this, self, value, acheck); } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray) value).getLength() == 1) { value = ((RubyArray) value).entry(0); } } iter.push(tmpBlock.iter); try { while (true) { try { if (node == null) { return getNil(); } else if (node instanceof ExecutableNode) { if (value == null) { value = RubyArray.newArray(this, 0); } return ((ExecutableNode) node).execute(value, new RubyObject[] { node.getTValue(), self }, this); } else { return node.eval(this, self); } } catch (RedoException rExcptn) { } } //break; } catch (NextException nExcptn) { return getNil(); /* } catch (BreakException bExcptn) { throw bExcptn;*/ } catch (ReturnException rExcptn) { // break; return rExcptn.getReturnValue(); } finally { iter.pop(); popClass(); RubyVarmap.pop(this); block.setTmp(tmpBlock); setRubyFrame(getRubyFrame().getPrev()); setCRef(oldCRef); // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); getScope().setTop(oldScope); } }
| 3,236,285
|
public IRubyObject instance_variable_get(IRubyObject var) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } IRubyObject variable = getInstanceVariable(varName); // Pickaxe v2 says no var should show NameError, but ruby only sends back nil.. return variable == null ? getRuntime().getNil() : variable; }
|
public IRubyObject instance_variable_get(IRubyObject var) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name", varName); } IRubyObject variable = getInstanceVariable(varName); // Pickaxe v2 says no var should show NameError, but ruby only sends back nil.. return variable == null ? getRuntime().getNil() : variable; }
| 3,236,287
|
public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name"); } return setInstanceVariable(var.asSymbol(), value); }
|
public IRubyObject instance_variable_set(IRubyObject var, IRubyObject value) { String varName = var.asSymbol(); if (!varName.startsWith("@")) { throw getRuntime().newNameError("`" + varName + "' is not allowable as an instance variable name", varName); } return setInstanceVariable(var.asSymbol(), value); }
| 3,236,288
|
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod(getRuntime().getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = getRuntime().getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallType == CallType.VARIABLE) { throw getRuntime().newNameError(msg); } throw getRuntime().newNoMethodError(msg); }
|
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod(getRuntime().getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = getRuntime().getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallType == CallType.VARIABLE) { throw getRuntime().newNameError(msg, name); } throw getRuntime().newNoMethodError(msg); }
| 3,236,289
|
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod(getRuntime().getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = getRuntime().getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallType == CallType.VARIABLE) { throw getRuntime().newNameError(msg); } throw getRuntime().newNoMethodError(msg); }
|
public IRubyObject method_missing(IRubyObject[] args) { if (args.length == 0) { throw getRuntime().newArgumentError("no id given"); } String name = args[0].asSymbol(); String description = callMethod(getRuntime().getCurrentContext(), "inspect").toString(); boolean noClass = description.length() > 0 && description.charAt(0) == '#'; ThreadContext tc = getRuntime().getCurrentContext(); Visibility lastVis = tc.getLastVisibility(); CallType lastCallType = tc.getLastCallType(); String format = lastVis.errorMessageFormat(lastCallType, name); String msg = new PrintfFormat(format).sprintf(new Object[] { name, description, noClass ? "" : ":", noClass ? "" : getType().getName()}); if (lastCallType == CallType.VARIABLE) { throw getRuntime().newNameError(msg); } throw getRuntime().newNoMethodError(msg, name); }
| 3,236,290
|
public IRubyObject remove_instance_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isInstanceVariable(id)) { throw getRuntime().newNameError("wrong instance variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove instance variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } throw getRuntime().newNameError("instance variable " + id + " not defined"); }
|
public IRubyObject remove_instance_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isInstanceVariable(id)) { throw getRuntime().newNameError("wrong instance variable name " + id, id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove instance variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } throw getRuntime().newNameError("instance variable " + id + " not defined"); }
| 3,236,291
|
public IRubyObject remove_instance_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isInstanceVariable(id)) { throw getRuntime().newNameError("wrong instance variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove instance variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } throw getRuntime().newNameError("instance variable " + id + " not defined"); }
|
public IRubyObject remove_instance_variable(IRubyObject name) { String id = name.asSymbol(); if (!IdUtil.isInstanceVariable(id)) { throw getRuntime().newNameError("wrong instance variable name " + id); } if (!isTaint() && getRuntime().getSafeLevel() >= 4) { throw getRuntime().newSecurityError("Insecure: can't remove instance variable"); } testFrozen("class/module"); IRubyObject variable = removeInstanceVariable(id); if (variable != null) { return variable; } throw getRuntime().newNameError("instance variable " + id + " not defined", id); }
| 3,236,292
|
public String toString(){ return "RenderingSetting"+(attributeId==null ? ":Hash"+this.hashCode() : ":"+attributeId); }
|
public String toString(){ return "RenderingSetting"+(attributeId==null ? ":Hash_"+this.hashCode() : ":Id_"+attributeId); }
| 3,236,295
|
public List getAvailableFamilies() { return delegate.getAvailableFamilies(); }
|
public List getAvailableFamilies() { List<Family> families = delegate.getAvailableFamilies(); List result = new ArrayList(); for (Family family : families) { result.add( copyFamily(family) ); } return result; }
| 3,236,296
|
public List getAvailableModels() { return delegate.getAvailableModels(); }
|
public List getAvailableModels() { List<RenderingModel> models = delegate.getAvailableModels(); List result = new ArrayList(); for (RenderingModel model : models) { result.add( copyRenderingModel(model)); } return result; }
| 3,236,297
|
public Family getChannelFamily(int arg0) { return delegate.getChannelFamily(arg0); }
|
public Family getChannelFamily(int arg0) { Family family = delegate.getChannelFamily(arg0); return copyFamily(family); }
| 3,236,298
|
public RenderingModel getModel() { return delegate.getModel(); }
|
public RenderingModel getModel() { return copyRenderingModel(delegate.getModel()); }
| 3,236,299
|
public Pixels getPixels() { return delegate.getPixels(); }
|
public Pixels getPixels() { Pixels pix = delegate.getPixels(); return (Pixels) new ShallowCopy().copy(pix); }
| 3,236,300
|
public QuantumDef getQuantumDef() { return delegate.getQuantumDef(); }
|
public QuantumDef getQuantumDef() { QuantumDef def = delegate.getQuantumDef(); return (QuantumDef) new ShallowCopy().copy(def); }
| 3,236,301
|
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(iconLabel); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(message); }
|
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); JPanel p = UIUtilities.buildComponentPanel(iconLabel); p.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(p); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(message); }
| 3,236,302
|
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(iconLabel); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(message); }
|
private void buildMessagePanel(String msg, Icon msgIcon) { messagePanel.setLayout(new BoxLayout(messagePanel, BoxLayout.X_AXIS)); if (msgIcon != null) { JLabel iconLabel = new JLabel(msgIcon); iconLabel.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(iconLabel); messagePanel.add(Box.createRigidArea(H_SPACER_SIZE)); } MultilineLabel message = new MultilineLabel(msg); message.setPreferredSize(MSG_AREA_SIZE); message.setAlignmentY(TOP_ALIGNMENT); messagePanel.add(UIUtilities.buildComponentPanelRight(message)); }
| 3,236,303
|
public void setUp() { runtime = Ruby.getDefaultInstance(); runtime.getLoadService().init(runtime, new ArrayList()); }
|
public void setUp() { runtime = Ruby.getDefaultInstance(); runtime.getLoadService().init(new ArrayList()); }
| 3,236,304
|
public NODE newCall(Object r, Object m, Object a) { return newDefaultNode(NODE.NODE_CALL, r, m, a); }
|
public NODE newCall(Object r, Object m, Object a) { return newDefaultNode(NODE.NODE_CALL, r, m, a); }
| 3,236,305
|
public NODE newVCall(Object m) { return newDefaultNode(NODE.NODE_VCALL, null, m, null); }
|
public NODE newVCall(Object m) { return newDefaultNode(NODE.NODE_VCALL, null, m, null); }
| 3,236,306
|
public IRubyObject callSuper(IRubyObject[] args) { Frame frame = getCurrentFrame(); if (frame.getLastClass() == null) { String name = frame.getLastFunc(); throw runtime.newNameError("superclass method '" + name + "' must be enabled by enableSuper().", name); } setNoBlockIfNoBlock(); try { RubyClass superClass = frame.getLastClass().getSuperClass(); // Modules do not directly inherit Object so we have hacks like this if (superClass == null) { // TODO cnutter: I believe modules, the only ones here to have no superclasses, should have Module as their superclass superClass = runtime.getClass("Module"); } return frame.getSelf().callMethod(this, superClass, frame.getLastFunc(), args, CallType.SUPER); } finally { clearNoBlock(); } }
|
public IRubyObject callSuper(IRubyObject[] args) { Frame frame = getCurrentFrame(); if (frame.getLastClass() == null) { String name = frame.getLastFunc(); throw runtime.newNameError("superclass method '" + name + "' must be enabled by enableSuper().", name); } setNoBlockIfNoBlock(); try { RubyClass superClass = frame.getLastClass().getSuperClass(); // Modules do not directly inherit Object so we have hacks like this if (superClass == null) { // TODO cnutter: I believe modules, the only ones here to have no superclasses, should have Module as their superclass superClass = runtime.getClass("Module"); } return frame.getSelf().callMethod(this, superClass, frame.getLastFunc(), args, CallType.SUPER); } finally { clearNoBlock(); } }
| 3,236,307
|
private void pushCallFrame(IRubyObject self, IRubyObject[] args, String lastFunc, RubyModule lastClass) { pushFrame(new Frame(this, self, args, lastFunc, lastClass, getPosition(), getCurrentIter(), getCurrentBlock())); }
|
private void pushCallFrame(IRubyObject self, IRubyObject[] args, String lastFunc, RubyModule lastClass) { Iter iter = getCurrentFrame().getCallingZSuper() ? getCurrentFrame().getIter() : getCurrentIter(); pushFrame(new Frame(this, self, args, lastFunc, lastClass, getPosition(), iter, getCurrentBlock())); }
| 3,236,309
|
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 BorderLayout()); 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); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); // 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(); } }); }
|
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 BorderLayout()); 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); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // 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(); } }); }
| 3,236,310
|
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 BorderLayout()); 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); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); // 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(); } }); }
|
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 BorderLayout()); 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); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER); // 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(); } }); }
| 3,236,311
|
public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); }
|
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
| 3,236,312
|
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
|
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } } }
| 3,236,313
|
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } } }
|
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = new ContactGroup(groupName); addContactGroup(contactGroup); } } }
| 3,236,314
|
public void run() { subscriptionRequest(presence.getFrom()); }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
| 3,236,315
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.UNSUBSCRIBED); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
| 3,236,316
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
| 3,236,318
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
| 3,236,319
|
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
|
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
| 3,236,320
|
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
|
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
| 3,236,321
|
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
|
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, "Rename Roster Group", "Rename to:", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
| 3,236,322
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
| 3,236,323
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
| 3,236,324
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
|
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, "Are you sure you want to delete \"" + group.getGroupName() + "\"", "Delete Confirmation", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { Iterator entries = rosterGroup.getEntries(); while (entries.hasNext()) { RosterEntry entry = (RosterEntry)entries.next(); try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
| 3,236,325
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry entry = roster.getEntry(jid); addUser(entry); } }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry entry = roster.getEntry(jid); addUser(entry); } }
| 3,236,326
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
|
public void run() { Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
| 3,236,327
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
|
public void run() { Roster roster = SparkManager.getConnection().getRoster(); Iterator jids = addresses.iterator(); while (jids.hasNext()) { String jid = (String)jids.next(); RosterEntry rosterEntry = roster.getEntry(jid); if (rosterEntry != null) { // Check for new Roster Groups and add them if they do not exist. Iterator rosterGroups = rosterEntry.getGroups(); boolean isUnfiled = true; while (rosterGroups.hasNext()) { isUnfiled = false; RosterGroup group = (RosterGroup)rosterGroups.next(); // Handle if this is a new Entry in a new Group. if (getContactGroup(group.getName()) == null) { // Create group. ContactGroup contactGroup = new ContactGroup(group.getName()); contactGroup.setVisible(false); addContactGroup(contactGroup); contactGroup = getContactGroup(group.getName()); String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } ContactItem contactItem = new ContactItem(name, rosterEntry.getUser()); contactGroup.addContactItem(contactItem); Presence presence = roster.getPresence(jid); contactItem.setPresence(presence); if (presence != null) { contactGroup.setVisible(true); } } else { ContactGroup contactGroup = getContactGroup(group.getName()); ContactItem item = contactGroup.getContactItemByJID(jid); // Check to see if this entry is new to a pre-existing group. if (item == null) { String name = rosterEntry.getName(); if (name == null) { name = rosterEntry.getUser(); } item = new ContactItem(name, rosterEntry.getUser()); Presence presence = roster.getPresence(jid); item.setPresence(presence); if (presence != null) { contactGroup.addContactItem(item); contactGroup.fireContactGroupUpdated(); } } // If not, just update their presence. else { Presence presence = roster.getPresence(jid); item.setPresence(presence); updateUserPresence(presence); contactGroup.fireContactGroupUpdated(); } } } // Now check to see if groups have been modified or removed. This is used // to check if Contact Groups have been renamed or removed. Set groupSet = new HashSet(); jids = addresses.iterator(); while (jids.hasNext()) { jid = (String)jids.next(); rosterEntry = roster.getEntry(jid); Iterator groups = rosterEntry.getGroups(); while (groups.hasNext()) { RosterGroup g = (RosterGroup)groups.next(); groupSet.add(g.getName()); } for (ContactGroup group : new ArrayList<ContactGroup>(getContactGroups())) { if (group.getContactItemByJID(jid) != null && group != unfiledGroup && group != offlineGroup) { if (!groupSet.contains(group.getGroupName())) { removeContactGroup(group); } } } } if (!isUnfiled) { return; } ContactItem unfiledItem = unfiledGroup.getContactItemByJID(jid); if (unfiledItem != null) { } else { ContactItem offlineItem = offlineGroup.getContactItemByJID(jid); if (offlineItem != null) { if ((rosterEntry.getType() == RosterPacket.ItemType.NONE || rosterEntry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == rosterEntry.getStatus()) { // Remove from offlineItem and add to unfiledItem. offlineGroup.removeContactItem(offlineItem); unfiledGroup.addContactItem(offlineItem); unfiledGroup.fireContactGroupUpdated(); unfiledGroup.setVisible(true); } } } } } }
| 3,236,328
|
private void showEmptyGroups(boolean show) { Iterator contactGroups = getContactGroups().iterator(); while (contactGroups.hasNext()) { ContactGroup group = (ContactGroup)contactGroups.next(); if (show) { group.setVisible(true); } else { // Never hide offline group. if (group != offlineGroup) { group.setVisible(group.hasAvailableContacts()); } } } localPreferences.setEmptyGroupsShown(show); showHideMenu.setSelected(show); viewOnline.setSelected(show); if (showHideMenu.isSelected()) { viewOnline.setToolTipText("Hide Empty Groups"); } else { viewOnline.setToolTipText("Show Empty Groups"); } }
|
private void showEmptyGroups(boolean show) { Iterator contactGroups = getContactGroups().iterator(); while (contactGroups.hasNext()) { ContactGroup group = (ContactGroup)contactGroups.next(); if (show) { group.setVisible(true); } else { // Never hide offline group. if (group != offlineGroup) { group.setVisible(group.hasAvailableContacts()); } } } localPreferences.setEmptyGroupsShown(show); showHideMenu.setSelected(show); viewOnline.setSelected(show); if (showHideMenu.isSelected()) { viewOnline.setToolTipText("Hide Empty Groups"); } else { viewOnline.setToolTipText("Show Empty Groups"); } }
| 3,236,329
|
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
|
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
| 3,236,330
|
public void actionPerformed(ActionEvent e) { removeContactFromRoster(item); }
|
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
| 3,236,331
|
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
|
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
| 3,236,332
|
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
|
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
| 3,236,333
|
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
|
public void actionPerformed(ActionEvent e) { JEditorPane pane = new JEditorPane(); StringBuffer buf = new StringBuffer(); Collection col = item.getPresenceHistory(); Iterator iter = col.iterator(); while (iter.hasNext()) { String history = (String)iter.next(); buf.append(history + "\n"); } pane.setText(buf.toString()); MessageDialog.showComponent("Presence History", "History of user activity while online.", SparkRes.getImageIcon(SparkRes.INFORMATION_IMAGE), new JScrollPane(pane), getGUI(), 400, 400, false); }
| 3,236,334
|
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
|
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), "Idle for " + time, "Last Activity", JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
| 3,236,335
|
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.SUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
|
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.SUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
| 3,236,337
|
public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.SUBSCRIBED); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } }
|
public void actionPerformed(ActionEvent e) { dialog.dispose(); Presence response = new Presence(Presence.Type.SUBSCRIBED); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), "Would you like to add the user to your roster?", "Add To Roster", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(jid); rosterDialog.showRosterDialog(); } }
| 3,236,338
|
public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.UNSUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); }
|
public void actionPerformed(ActionEvent e) { // Send subscribed Presence response = new Presence(Presence.Type.UNSUBSCRIBE); response.setTo(jid); SparkManager.getConnection().sendPacket(response); dialog.dispose(); }
| 3,236,339
|
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
|
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
| 3,236,340
|
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
|
static RenderingStrategy makeNew(int model) { RenderingStrategy strategy = null; try { switch (model) { case RenderingDefConstants.GS: strategy = new GreyScaleStrategy(); break; case RenderingDefConstants.HSB: strategy = new HSBStrategy(); break; case RenderingDefConstants.RGB: strategy = new RGBStrategy(); break; default: //Set the GreyScaleStrategy as the default one. strategy = new GreyScaleStrategy(); //TODO: log debug? } } catch(NumberFormatException nfe) { throw new RuntimeException("Invalid model ID "+model+".", nfe); } return strategy; }
| 3,236,341
|
public Object yyparse (RubyYaccLexer yyLex, Object yydebug) throws java.io.IOException, yyException { return yyparse(yyLex); }
|
public Object yyparse (RubyYaccLexer yyLex, Object yydebug) throws java.io.IOException, yyException { return yyparse(yyLex); }
| 3,236,342
|
public static Map getEmoticonMap() { Map newMap = new HashMap(emotionMap); newMap.remove("8-)"); newMap.remove("|-)"); newMap.remove("<:o)"); newMap.remove(":-)"); return newMap; }
|
public static Map getEmoticonMap() { Map<String,String> newMap = new HashMap<String,String>(emotionMap); newMap.remove("8-)"); newMap.remove("|-)"); newMap.remove("<:o)"); newMap.remove(":-)"); return newMap; }
| 3,236,343
|
public static final ImageIcon getImageIcon(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return new ImageIcon(url); } } return null; }
|
public static final ImageIcon getImageIcon(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return new ImageIcon(url); } } return null; }
| 3,236,344
|
public static final URL getURL(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return url; } } return null; }
|
public static final URL getURL(String face) { final String value = (String)emotionMap.get(face); if (value != null) { final URL url = cl.getResource(value); if (url != null) { return url; } } return null; }
| 3,236,345
|
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
|
publicvoidaliasMethod(Stringname,StringoldName){testFrozen();if(oldName.equals(name)){return;}if(this==getRuntime().getClasses().getObjectClass()){getRuntime().secure(4);}ICallablemethod=searchMethod(oldName);if(method.isUndefined()){if(isModule()){method=getRuntime().getClasses().getObjectClass().searchMethod(oldName);}if(method.isUndefined()){thrownewNameError(runtime,"undefinedmethod'"+name+"'for"+(isModule()?"module":"class")+"'"+toName()+"'");}}getMethods().put(name,newAliasMethod(method,oldName));clearMethodCache();}
| 3,236,348
|
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
|
publicvoidaliasMethod(Stringname,StringoldName){testFrozen();if(oldName.equals(name)){return;}if(this==getRuntime().getClasses().getObjectClass()){getRuntime().secure(4);}ICallablemethod=searchMethod(oldName);if(method.isUndefined()){if(isModule()){method=getRuntime().getClasses().getObjectClass().searchMethod(oldName);}if(method.isUndefined()){thrownewNameError(runtime,"undefinedmethod'"+name+"'for"+(isModule()?"module":"class")+"'"+toName()+"'");}}getMethods().put(name,newAliasMethod(method,oldName));clearMethodCache();}
| 3,236,349
|
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
|
publicvoidaliasMethod(Stringname,StringoldName){testFrozen();if(oldName.equals(name)){return;}if(this==getRuntime().getClasses().getObjectClass()){getRuntime().secure(4);}ICallablemethod=searchMethod(oldName);if(method.isUndefined()){if(isModule()){method=getRuntime().getClasses().getObjectClass().searchMethod(oldName);}if(method.isUndefined()){thrownewNameError(runtime,"undefinedmethod'"+name+"'for"+(isModule()?"module":"class")+"'"+toName()+"'");}}getMethods().put(name,newAliasMethod(method,oldName));clearMethodCache();}
| 3,236,350
|
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
|
publicvoidaliasMethod(Stringname,StringoldName){testFrozen();if(oldName.equals(name)){return;}if(this==getRuntime().getClasses().getObjectClass()){getRuntime().secure(4);}ICallablemethod=searchMethod(oldName);if(method.isUndefined()){if(isModule()){method=getRuntime().getClasses().getObjectClass().searchMethod(oldName);}if(method.isUndefined()){thrownewNameError(runtime,"undefinedmethod'"+name+"'for"+(isModule()?"module":"class")+"'"+toName()+"'");}}getMethods().put(name,newAliasMethod(method,oldName));clearMethodCache();}
| 3,236,351
|
public void aliasMethod(String name, String oldName) { testFrozen(); if (oldName.equals(name)) { return; } if (this == getRuntime().getClasses().getObjectClass()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getClasses().getObjectClass().searchMethod(oldName); } if (method.isUndefined()) { throw new NameError(runtime, "undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + toName() + "'"); } } getMethods().put(name, new AliasMethod(method, oldName)); clearMethodCache(); }
|
publicvoidaliasMethod(Stringname,StringoldName){testFrozen();if(oldName.equals(name)){return;}if(this==getRuntime().getClasses().getObjectClass()){getRuntime().secure(4);}ICallablemethod=searchMethod(oldName);if(method.isUndefined()){if(isModule()){method=getRuntime().getClasses().getObjectClass().searchMethod(oldName);}if(method.isUndefined()){thrownewNameError(runtime,"undefinedmethod'"+name+"'for"+(isModule()?"module":"class")+"'"+toName()+"'");}}getMethods().put(name,newAliasMethod(method,oldName));clearMethodCache();}
| 3,236,352
|
public Set entrySet() { // TODO: Set.Entry must be wrapped appropriately...? return new ConversionSet(valueMap.entrySet()); }
|
public Set entrySet() { // TODO: Set.Entry must be wrapped appropriately...? return new ConversionSet(valueMap.entrySet()); }
| 3,236,353
|
public Set keySet() { return new ConversionSet(valueMap.keySet()); }
|
public Set keySet() { return new ConversionSet(valueMap.keySet()); }
| 3,236,354
|
public Collection values() { // TODO Auto-generated method stub return null; }
|
public Collection values() { // TODO Auto-generated method stub return null; }
| 3,236,355
|
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (planeDef == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. ChannelBinding cb = cbs.get(w); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb.setNoiseReduction(Boolean.TRUE); cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++; } }
|
privatestaticvoidcomputeLocationStats(Pixelspixels,List<ChannelBinding>cbs,PlaneDefplaneDef,PixelBufferbuf){if(planeDef==null) thrownewNullPointerException("Noplanedefinition.");StatsFactorysf=newStatsFactory();intw=0;List<Channel>channels=pixels.getChannels();for(Channelchannel:channels){ //FIXME:ThisiswhereweneedtohavetheChannelBinding--> //Channellinkage.Withoutit,wehavetoassumethattheorderin //whichthechannelbindingswascreatedmatchesupwiththeorder //ofthechannelslinkedtothepixelsset. ChannelBindingcb=cbs.get(w);//Test sf.computeLocationStats(pixels,buf,planeDef,w); //cb[w].setNoiseReduction(newBoolean(sf.isNoiseReduction()));cb.setNoiseReduction(Boolean.TRUE); cb.setInputStart(newFloat(sf.getInputStart())); cb.setInputEnd(newFloat(sf.getInputEnd())); w++;}}
| 3,236,356
|
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (planeDef == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. ChannelBinding cb = cbs.get(w); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb.setNoiseReduction(Boolean.TRUE); cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++; } }
|
private static void computeLocationStats(Pixels pixels, List<ChannelBinding> cbs, PlaneDef planeDef, PixelBuffer buf) { if (planeDef == null) throw new NullPointerException("No plane definition."); StatsFactory sf = new StatsFactory(); int w = 0; List<Channel> channels = pixels.getChannels(); for (Channel channel : channels) { // FIXME: This is where we need to have the ChannelBinding --> // Channel linkage. Without it, we have to assume that the order in // which the channel bindings was created matches up with the order // of the channels linked to the pixels set. ChannelBinding cb = cbs.get(w); //Test sf.computeLocationStats(pixels, buf, planeDef, w); //cb[w].setNoiseReduction(new Boolean(sf.isNoiseReduction())); cb.setNoiseReduction(sf.isNoiseReduction()); cb.setInputStart(new Float(sf.getInputStart())); cb.setInputEnd(new Float(sf.getInputEnd())); w++; } }
| 3,236,357
|
protected void tearDown() throws Exception { if (context != null) { System.out.println("Closing down the spring context"); context.destroy(); } }
|
protected void tearDown() throws Exception { if (context != null) { log.info("Closing down the spring context"); context.destroy(); } }
| 3,236,358
|
void setImage(BufferedImage image) { browser.setRenderedImage(image); //update image icon computeSizes(); imageIcon = magnifyImage(factor, image); state = ImViewer.READY; }
|
void setImage(BufferedImage image) { browser.setRenderedImage(image); //update image icon computeSizes(); imageIcon = magnifyImage(factor, image); }
| 3,236,360
|
public void callInit(IRubyObject[] args) { ThreadContext tc = getRuntime().getCurrentContext(); tc.setIfBlockAvailable(); try { callMethod(getRuntime().getCurrentContext(), "initialize", args); } finally { tc.clearIfBlockAvailable(); } }
|
public void callInit(IRubyObject[] args) { ThreadContext tc = getRuntime().getCurrentContext(); tc.setIfBlockAvailable(); try { callMethod(getRuntime().getCurrentContext(), "initialize", args); } finally { tc.clearIfBlockAvailable(); } }
| 3,236,361
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
| 3,236,362
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
| 3,236,363
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
|
public IRubyObject convertToTypeWithCheck(String targetType, String convertMethod) { if (targetType.equals(getMetaClass().getName())) { return this; } IRubyObject value = convertToType(targetType, convertMethod, false); if (value.isNil()) { return value; } if (!targetType.equals(value.getMetaClass().getName())) { throw getRuntime().newTypeError(value.getMetaClass().getName() + "#" + convertMethod + "should return " + targetType); } return value; }
| 3,236,364
|
public IRubyObject display(IRubyObject[] args) { IRubyObject port = args.length == 0 ? getRuntime().getGlobalVariables().get("$>") : args[0]; port.callMethod(getRuntime().getCurrentContext(), "write", this); return getRuntime().getNil(); }
|
public IRubyObject display(IRubyObject[] args) { IRubyObject port = args.length == 0 ? getRuntime().getGlobalVariables().get("$>") : args[0]; port.callMethod(getRuntime().getCurrentContext(), "write", this); return getRuntime().getNil(); }
| 3,236,365
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,366
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,367
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,368
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,369
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,370
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalSimple(ThreadContext context, IRubyObject src, String file) { // this is ensured by the callers assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); // no binding, just eval in "current" frame (caller's frame) Iter iter = threadContext.getFrameIter(); IRubyObject result = getRuntime().getNil(); try { // hack to avoid using previous frame if we're the first frame, since this eval is used to start execution too if (threadContext.getPreviousFrame() != null) { threadContext.setFrameIter(threadContext.getPreviousFrameIter()); } result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, threadContext.getCurrentScope()), this); } finally { // FIXME: this is broken for Proc, see above threadContext.setFrameIter(iter); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,371
|
public IRubyObject evalUnder(RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line) { /* if (ruby_safe_level >= 4) { Check_Type(src, T_STRING); } else { Check_SafeStr(src); } */ return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); } public Arity getArity() { return Arity.optional(); } }, new IRubyObject[] { this, src, file, line }); }
|
public IRubyObject evalUnder(RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line) { /* if (ruby_safe_level >= 4) { Check_Type(src, T_STRING); } else { Check_SafeStr(src); } */ return under.executeUnder(new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); } public Arity getArity() { return Arity.optional(); } }, new IRubyObject[] { this, src, file, line }); }
| 3,236,372
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject source = args[1]; IRubyObject filename = args[2]; // FIXME: lineNumber is not supported //IRubyObject lineNumber = args[3]; return args[0].evalSimple(source.getRuntime().getCurrentContext(), source, ((RubyString) filename).toString()); }
| 3,236,373
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,374
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,375
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,376
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,377
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
|
public IRubyObject evalWithBinding(ThreadContext context, IRubyObject src, IRubyObject scope, String file) { // both of these are ensured by the (very few) callers assert !scope.isNil(); assert file != null; ThreadContext threadContext = getRuntime().getCurrentContext(); ISourcePosition savedPosition = threadContext.getPosition(); IRubyObject result = getRuntime().getNil(); IRubyObject newSelf = null; if (!(scope instanceof RubyBinding)) { if (scope instanceof RubyProc) { scope = ((RubyProc) scope).binding(); } else { // bomb out, it's not a binding or a proc throw getRuntime().newTypeError("wrong argument type " + scope.getMetaClass() + " (expected Proc/Binding)"); } } Block blockOfBinding = ((RubyBinding)scope).getBlock(); try { // Binding provided for scope, use it threadContext.preEvalWithBinding(blockOfBinding); newSelf = threadContext.getFrameSelf(); result = EvaluationState.eval(threadContext, getRuntime().parse(src.toString(), file, blockOfBinding.getDynamicScope()), newSelf); } finally { threadContext.postEvalWithBinding(blockOfBinding); // restore position threadContext.setPosition(savedPosition); } return result; }
| 3,236,378
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.