bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public JMethod getMethod(String name, JType[] argTypes) { outer : for (JMethod m : methods) { if (!m.name().equals(name)) continue; if (m.hasSignature(argTypes)) return m; } return null; }
public JMethod getMethod(String name, JType[] argTypes) { for (JMethod m : methods) { if (!m.name().equals(name)) continue; if (m.hasSignature(argTypes)) return m; } return null; }
3,229,992
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); Map kernelMethods = getRuntime().getClasses().getKernelModule().getMethods(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility)) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility)) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
3,229,993
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); Map kernelMethods = getRuntime().getClasses().getKernelModule().getMethods(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility)) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); Map kernelMethods = getRuntime().getClasses().getKernelModule().getMethods(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility)) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
3,229,994
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); Map kernelMethods = getRuntime().getClasses().getKernelModule().getMethods(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility)) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = RubyArray.newArray(getRuntime()); Map kernelMethods = getRuntime().getClasses().getKernelModule().getMethods(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { // kernel methods do not get printed out (but why?). if (p.getMethods() == kernelMethods) { continue; } for (Iterator iter = p.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); if (method.getVisibility().is(visibility) && method.isUndefined() == false) { RubyString name = RubyString.newString(getRuntime(), (String) entry.getKey()); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
3,229,995
public IRubyObject newMethod(IRubyObject receiver, String name, boolean bound) { CacheEntry ent = getMethodBodyCached(name); if (! ent.isDefined()) { // printUndef(); return getRuntime().getNil(); } while (ent.getMethod() instanceof EvaluateMethod && ((EvaluateMethod) ent.getMethod()).getNode() instanceof ZSuperNode) { ent = ent.getOrigin().getSuperClass().getMethodBodyCached(ent.getOriginalName()); if (! ent.isDefined()) { // printUndef(); return getRuntime().getNil(); } } Method method = null; if (bound) { method = Method.newMethod(ent.getOrigin(), ent.getOriginalName(), this, name, ent.getMethod(), receiver); } else { method = UnboundMethod.newUnboundMethod(ent.getOrigin(), ent.getOriginalName(), this, name, ent.getMethod()); } method.infectBy(this); return method; }
public IRubyObject newMethod(IRubyObject receiver, String name, boolean bound) { CacheEntry ent = getMethodBodyCached(name); if (! ent.isDefined()) { // printUndef(); throw new NameError(getRuntime(), "undefined method `" + name + "' for class `" + this.getName() + "'"); } while (ent.getMethod() instanceof EvaluateMethod && ((EvaluateMethod) ent.getMethod()).getNode() instanceof ZSuperNode) { ent = ent.getOrigin().getSuperClass().getMethodBodyCached(ent.getOriginalName()); if (! ent.isDefined()) { // printUndef(); throw new NameError(getRuntime(), "undefined method `" + name + "' for class `" + this.getName() + "'"); } } Method method = null; if (bound) { method = Method.newMethod(ent.getOrigin(), ent.getOriginalName(), this, name, ent.getMethod(), receiver); } else { method = UnboundMethod.newUnboundMethod(ent.getOrigin(), ent.getOriginalName(), this, name, ent.getMethod()); } method.infectBy(this); return method; }
3,229,996
public final void backup(int amount) { backupChars += amount; if (curBuf.curPos - amount < 0) { int addlChars = amount - 1 - curBuf.curPos; curBuf.curPos = 0; swapBuf(); curBuf.curPos = curBuf.dataLen - addlChars - 1; } else { curBuf.curPos -= amount; } }
public final void backup(int amount) { backupChars += amount; if (curBuf.curPos - amount < 0) { int addlChars = amount - (inputStreamClosed? 0 : 1) - curBuf.curPos; curBuf.curPos = 0; swapBuf(); curBuf.curPos = curBuf.dataLen - addlChars - 1; } else { curBuf.curPos -= amount; } }
3,229,999
public String getTooltip() { return Res.getString("title.login.settings"); }
public String getTooltip() { return Res.getString("title.login.settings"); }
3,230,001
public RubyObject call(RubyObject[] args) { getRuby().getIter().push( getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getBodyNode(), false); getRuby().getIter().pop(); return result; }
public RubyObject call(RubyObject[] args) { getRuby().getIter().push( getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getBodyNode(), false); getRuby().getIter().pop(); return result; }
3,230,002
public RubyObject call(RubyObject[] args) { getRuby().getIter().push( getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getBodyNode(), false); getRuby().getIter().pop(); return result; }
public RubyObject call(RubyObject[] args) { getRuby().getIter().push( getRuby().isBlockGiven() ? RubyIter.ITER_PRE : RubyIter.ITER_NOT); RubyObject result = getReceiverClass().call0( getReceiver(), getMethodId(), new RubyPointer(args), getBodyNode(), false); getRuby().getIter().pop(); return result; }
3,230,003
protected WMTemplate(Broker broker) { _broker = broker; }
protected WMTemplate(Broker broker) { this(broker,"wm"); }
3,230,004
public Filter getFilter(String name) { return (Filter) myFilters.get(name); }
public Filter getFilter(String name) { return (Filter) _filters.get(name); }
3,230,005
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return myParameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return myParameters.get(key); } } }
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return _parameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return _parameters.get(key); } } }
3,230,006
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return myParameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return myParameters.get(key); } } }
public Object getParam(String key) throws IOException, TemplateException { // perform double checked lock in case template has not yet // been parsed. try { return _parameters.get(key); } catch (NullPointerException e) { synchronized(this) { parse(); return _parameters.get(key); } } }
3,230,007
public HashMap getParameters() { return myParameters; }
public HashMap getParameters() { return _parameters; }
3,230,008
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,009
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,010
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,011
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,012
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,013
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
public final void parse() throws IOException, TemplateException { // thread policy: // // unsynchronized code elsewhere will access myContent. We must // ensure that any data copied into myContent is ready for public // use--which means dealing with two subtle issues. First, the Block // created by this method must be written back to main memory BEFORE // being referenced by myContent. Second, once we add it to myContent, // our copy of myContent has to be copied back to main memory as well. // // Therefore we synchronize around the access to myContent so as to // accomplish both these things. newContent will be written to main // memory at the start of the synchronized block, and myContent will // be written to main memory at the close. Block newContent = null; HashMap newParameters = null; Reader source = null; Hashtable newFilters = null; try { Parser parser; try { parser = (Parser) _broker.getValue("parser","wm"); } catch (Exception e) { Engine.log.exception(e); throw new TemplateException("Could not load \"wm\" parser:" + e); } Reader in = getReader(); BlockBuilder bb = parser.parseBlock(toString(),in); in.close(); BuildContext bc = new BuildContext(_broker); newParameters = bc.getLocalVariables(); newFilters = bc.getFilters(); newContent = (Block) bb.build(bc); } catch (BuildException be) { newContent = null; _log.error("Template contained invalid data: " + be); throw be; } catch (IOException e) { newContent = null; // don't let the old one survive _log.error("Template: Could not read template: " + this); throw e; } finally { try { source.close(); } catch (Exception e) { } synchronized(this) { myParameters = newParameters; myFilters = newFilters; myContent = newContent; } } }
3,230,014
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,230,015
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,230,016
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = _content; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,230,017
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (_content == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,230,018
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = myContent; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = myContent; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(Writer out, Context data) throws IOException { // thread policy: Access to myContent is unsynchronized here at // the cost of having a slightly stale copy. This is OK, because // you might have requested it slightly earlier anyway. You will // always get a consistent copy--either the current one, or one // that was the current one a few milliseconds ago. This is because // a thread setting myContent may not update main memory immediately, // and this thread may not update its copy of myContent immediately // (it may have a stale copy it read earlier). Block content = _content; // copy to a local var in case it changes // Make sure that all the contents of "content" are up to date--that // our thread is fully synchronized with main memory, so that we don't // have a half-created version. Synchronize on anything to do this: // we will use an object we don't share with any other thread. synchronized(data) { } if (content == null) { try { synchronized(this) { // double check under the lock if (myContent == null) { parse(); } content = _content; } } catch (Exception e) { _log.exception(e); _log.error("Template: Unable to read template: " + this); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } } try { content.write(out,data); } catch (InvalidContextException e) { _log.exception(e); String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
3,230,019
final public Object get(Object name) { return (_globals != null) ? _globals.get(name) : null; }
final public Object get(Object name) { if (_globals != null) return _globals.get(name); if (_beanGet != null){ try { return _beanGet.invoke(_bean, new Object[]{ name }); } catch (Exception e){} } return null; }
3,230,020
final public void put(Object name, Object value) { if (_globals == null) { getGlobalVariables().put(name,value); } else { _globals.put(name,value); } }
final public void put(Object name, Object value) { if (_globals == null) { if (_beanPut != null){ try { _beanPut.invoke(_bean, new Object[]{ name, value }); } catch (Exception e){} } else { getGlobalVariables().put(name,value); } } else { _globals.put(name,value); } }
3,230,021
private void initComponents() { titleLabel = new JLabel(TITLE_MSG+DEFAULT_MSG); saveButton = new JButton("SAVE"); saveButton.setEnabled(false); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { model.save(); } }); annotationArea = new MultilineLabel(); annotationArea.setBackground(Color.WHITE); annotationArea.setBorder(new TitledBorder("Annotation")); deleteBox = new JCheckBox(DELETE_ANNOTATION); listModel = new DefaultListModel(); annotatedByList = new JList(listModel); annotatedByList.setBorder(new TitledBorder("Annotated by")); annotatedByList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedByList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationAreaListener = new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { model.setAnnotated(true); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { model.setAnnotated(true); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }; annotationArea.getDocument().addDocumentListener( annotationAreaListener); annotationArea.addMouseListener(new MouseAdapter() { //Removes default message. public void mouseClicked(MouseEvent e) { if (isAnnotable() && defaultText) annotationArea.setText(""); } }); setComponentsEnabled(false); deleteBox.setSelected(false); }
private void initComponents() { titleLabel = new JLabel(TITLE_MSG+DEFAULT_MSG); saveButton = new JButton("SAVE"); saveButton.setEnabled(false); saveButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { model.save(); } }); annotationArea = new MultilineLabel(); annotationArea.setBackground(Color.WHITE); annotationArea.setBorder(new TitledBorder("Annotation")); deleteBox = new JCheckBox(DELETE_ANNOTATION); listModel = new DefaultListModel(); annotatedByList = new JList(listModel); annotatedByList.setBorder(new TitledBorder("Annotated by")); annotatedByList.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION); annotatedByList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 1) { showSingleAnnotation(); } } }); annotationAreaListener = new DocumentListener() { /** * Indicates that the object is annotated. * @see DocumentListener#insertUpdate(DocumentEvent) */ public void insertUpdate(DocumentEvent de) { model.setAnnotated(true); } /** * Indicates that the object is annotated. * @see DocumentListener#removeUpdate(DocumentEvent) */ public void removeUpdate(DocumentEvent de) { model.setAnnotated(true); } /** * Required by I/F but no-op implementation in our case. * @see DocumentListener#changedUpdate(DocumentEvent) */ public void changedUpdate(DocumentEvent de) {} }; annotationArea.getDocument().addDocumentListener( annotationAreaListener); annotationArea.addMouseListener(new MouseAdapter() { //Removes default message. public void mouseClicked(MouseEvent e) { if (isAnnotable() && defaultText) { annotationArea.getDocument().removeDocumentListener( annotationAreaListener); annotationArea.setText(""); annotationArea.getDocument().addDocumentListener( annotationAreaListener); } } }); setComponentsEnabled(false); deleteBox.setSelected(false); }
3,230,023
public void mouseClicked(MouseEvent e) { if (isAnnotable() && defaultText) annotationArea.setText(""); }
public void mouseClicked(MouseEvent e) { if (isAnnotable() && defaultText) { annotationArea.getDocument().removeDocumentListener( annotationAreaListener); annotationArea.setText(""); annotationArea.getDocument().addDocumentListener( annotationAreaListener); } }
3,230,026
public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) { if (arg1.getValue().endsWith(".rb")) { // ruby.getRuntime().load((RubyString)arg1, false); } else if (arg1.getValue().endsWith(".jar")) { File jarFile = new File(arg1.getValue()); if (!jarFile.exists()) { jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue()); if (!jarFile.exists()) { System.err.println("[Error] Jarfile + \"" + jarFile.getAbsolutePath() + "\"not found."); } } if (jarFile.exists()) { try { ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader()); ruby.setJavaClassLoader(javaClassLoader); } catch (MalformedURLException murlExcptn) { } } } return ruby.getNil(); }
ruby.getRuntime().loadFile((RubyString)arg1, false); public static RubyObject m_require(Ruby ruby, RubyObject recv, RubyString arg1) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); if (arg1.getValue().endsWith(".rb")) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); // ruby.getRuntime().load((RubyString)arg1, false);ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); } else if (arg1.getValue().endsWith(".jar")) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); File jarFile = new File(arg1.getValue());ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); if (!jarFile.exists()) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); jarFile = new File(new File(ruby.getSourceFile()).getParentFile(), arg1.getValue());ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); if (!jarFile.exists()) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); System.err.println("[Error] Jarfile + \"" + jarFile.getAbsolutePath() + "\"not found.");ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); }ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); }ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); if (jarFile.exists()) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); try {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ClassLoader javaClassLoader = new URLClassLoader(new URL[] { jarFile.toURL() }, ruby.getJavaClassLoader());ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.setJavaClassLoader(javaClassLoader);ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); } catch (MalformedURLException murlExcptn) {ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); }ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); }ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); }ruby.getRuntime().loadFile((RubyString)arg1, false); ruby.getRuntime().loadFile((RubyString)arg1, false); return ruby.getNil();ruby.getRuntime().loadFile((RubyString)arg1, false); }
3,230,027
public ColourPicker(Color color) { super(); setTitle("Colour Picker Window"); //setSize(250, 350); setModal(true); setResizable(false); float[] vals = new float[4]; vals = color.getComponents(vals); model = new RGBModel(vals[0], vals[1], vals[2], vals[3]); RGBControl control = new RGBControl(model); TabbedPaneUI tabbedPane = new TabbedPaneUI(this, control); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.weightx = 80; gbc.weighty = 30; gbc.anchor = GridBagConstraints.CENTER; gbc.fill = GridBagConstraints.BOTH; getContentPane().add(tabbedPane, gbc); pack(); }
publicsetSize(240, 310); ColourPicker(ColorsetSize(240, 310); color) { setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); super(); setTitle("ColoursetSize(240, 310); PickersetSize(240, 310); Window"); //setSize(250,setSize(240, 310); 350);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setModal(true);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setResizable(false);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); float[]setSize(240, 310); valssetSize(240, 310); =setSize(240, 310); newsetSize(240, 310); float[4];setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); valssetSize(240, 310); =setSize(240, 310); color.getComponents(vals);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); modelsetSize(240, 310); =setSize(240, 310); newsetSize(240, 310); RGBModel(vals[0],setSize(240, 310); vals[1],setSize(240, 310); vals[2],setSize(240, 310); vals[3]);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); RGBControlsetSize(240, 310); controlsetSize(240, 310); =setSize(240, 310); newsetSize(240, 310); RGBControl(model);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); TabbedPaneUIsetSize(240, 310); tabbedPanesetSize(240, 310); =setSize(240, 310); newsetSize(240, 310); TabbedPaneUI(this,setSize(240, 310); control);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setLayout(newsetSize(240, 310); GridBagLayout()); GridBagConstraintssetSize(240, 310); gbcsetSize(240, 310); =setSize(240, 310); newsetSize(240, 310); GridBagConstraints(); gbc.gridxsetSize(240, 310); =setSize(240, 310); 0; gbc.gridysetSize(240, 310); =setSize(240, 310); 0; gbc.weightxsetSize(240, 310); =setSize(240, 310); 80; gbc.weightysetSize(240, 310); =setSize(240, 310); 30; gbc.anchorsetSize(240, 310); =setSize(240, 310); GridBagConstraints.CENTER; gbc.fillsetSize(240, 310); =setSize(240, 310); GridBagConstraints.BOTH; getContentPane().add(tabbedPane,setSize(240, 310); gbc);setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); setSize(240, 310); pack(); }
3,230,028
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+Arrays.asList(arg0.getArguments())); Object o; try { o = arg0.proceed(); log.info("Rslt:\t"+o); } catch (Throwable t) { log.debug("Excp:\t"+t); throw t; } log(o); return o; }
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+ (arg0 == null? "()" : Arrays.asList(arg0.getArguments()))); Object o; try { o = arg0.proceed(); log.info("Rslt:\t"+o); } catch (Throwable t) { log.debug("Excp:\t"+t); throw t; } log(o); return o; }
3,230,029
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+Arrays.asList(arg0.getArguments())); Object o; try { o = arg0.proceed(); log.info("Rslt:\t"+o); } catch (Throwable t) { log.debug("Excp:\t"+t); throw t; } log(o); return o; }
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+Arrays.asList(arg0.getArguments())); Object o; try { o = arg0.proceed(); finalOutput = "Rslt:\t"+o; } catch (Throwable t) { log.debug("Excp:\t"+t); throw t; } log(o); return o; }
3,230,030
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+Arrays.asList(arg0.getArguments())); Object o; try { o = arg0.proceed(); log.info("Rslt:\t"+o); } catch (Throwable t) { log.debug("Excp:\t"+t); throw t; } log(o); return o; }
public Object invoke(MethodInvocation arg0) throws Throwable { log.info("Meth:\t"+arg0.getMethod().getName()); log.info("Args:\t"+Arrays.asList(arg0.getArguments())); Object o; try { o = arg0.proceed(); log.info("Rslt:\t"+o); } catch (Throwable t) { finalOutput = "Excp:\t"+t; throw t; } log(o); return o; }
3,230,031
protected String renderQuotedBlock(String text) { StringBuffer sb = new StringBuffer (text.length()); sb.append ("<pre>") .append (text) .append ("</pre>"); return sb.toString (); }
protected String renderQuotedBlock(String text) { StringBuffer sb = new StringBuffer (text.length()); sb.append ("<pre>") .append (replace (replace (text, "<", "&lt;"), ">", "&gt;")) .append ("</pre>"); return sb.toString (); }
3,230,035
protected String renderUnknown(WikiData data) { return "<!-- " + data.getType() + " is an unknown WikiData type"; }
protected String renderUnknown(WikiData data) { return "<!-- " + data.getType() + " is an unknown WikiData type -->"; }
3,230,036
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlock().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlock().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlockStack().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlock().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
3,230,037
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlock().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlock().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
public final static Block beginCallArgs(final Ruby ruby) { final Block actBlock = ruby.getBlock().getCurrent(); if (ruby.getCurrentIter().isPre()) { ruby.getBlockStack().pop(); } ruby.getIterStack().push(Iter.ITER_NOT); return actBlock; }
3,230,038
public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlock().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); }
public final static void endCallArgs( final Ruby ruby, final Block actBlock) { if (actBlock != null) { // XXX ruby.getBlockStack().push(actBlock); // Refresh the next attribute. } ruby.getIterStack().pop(); }
3,230,039
public void execute(PInputEvent e) { PNode node = e.getPickedNode(); JPopupMenu menu = PopupMenuFactory.getMenu(node); if(menu != null) { Point2D position = e.getPosition(); e.getCamera().viewToLocal(position); int offsetX = (int)Math.round(position.getX()); int offsetY = (int)Math.round(position.getY()); // this could be error prone, but hopefully not in context PCanvas canvas = (PCanvas)e.getComponent(); menu.show(canvas,offsetX,offsetY); } }
public void execute(PInputEvent e) { PNode node = e.getPickedNode(); JPopupMenu menu = PopupMenuFactory.getMenu(node); if(menu != null) { Point2D position = e.getPosition(); e.getCamera().viewToLocal(position); int offsetX = (int)Math.round(position.getX()); int offsetY = (int)Math.round(position.getY()); // this could be error prone, but hopefully not in context PCanvas canvas = (PCanvas)e.getComponent(); menu.show(canvas,offsetX,offsetY); } }
3,230,040
private void checkPopup(MouseEvent evt) { final int index = list.locationToIndex(evt.getPoint()); list.setSelectedIndex(index); final String selectedUser = getSelectedUser(); final String groupJID = (String)userMap.get(selectedUser); String groupJIDNickname = StringUtils.parseResource(groupJID); final String nickname = groupChatRoom.getNickname(); final Occupant occupant = userManager.getOccupant(groupChatRoom, selectedUser); final boolean admin = SparkManager.getUserManager().isOwnerOrAdmin(groupChatRoom, chat.getNickname()); final boolean moderator = SparkManager.getUserManager().isModerator(groupChatRoom, chat.getNickname()); final boolean userIsAdmin = userManager.isOwnerOrAdmin(occupant); final boolean userIsModerator = userManager.isModerator(occupant); boolean isMe = groupJIDNickname.equals(nickname); JPopupMenu popup = new JPopupMenu(); if (isMe) { Action changeNicknameAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") +":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } } }; changeNicknameAction.putValue(Action.NAME, Res.getString("menuitem.change.nickname")); changeNicknameAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); if (allowNicknameChange) { popup.add(changeNicknameAction); } } Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); } }; chatAction.putValue(Action.NAME, Res.getString("menuitem.start.a.chat")); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); if (!isMe) { popup.add(chatAction); } Action blockAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } } }; blockAction.putValue(Action.NAME, Res.getString("menuitem.block.user")); blockAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE)); if (!isMe) { if (groupChatRoom.isBlocked(groupJID)) { blockAction.putValue(Action.NAME, Res.getString("menuitem.unblock.user")); } popup.add(blockAction); } Action kickAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { kickUser(selectedUser); } }; kickAction.putValue(Action.NAME, Res.getString("menuitem.kick.user")); kickAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); if (moderator && !userIsAdmin && !isMe) { popup.add(kickAction); } // Handle Voice Operations Action voiceAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); } } }; voiceAction.putValue(Action.NAME, Res.getString("menuitem.voice")); voiceAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MEGAPHONE_16x16)); if (moderator && !userIsModerator && !isMe) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { voiceAction.putValue(Action.NAME, Res.getString("menuitem.revoke.voice")); } else { voiceAction.putValue(Action.NAME, Res.getString("menuitem.grant.voice")); } popup.add(voiceAction); } Action banAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser); } }; banAction.putValue(Action.NAME, Res.getString("menuitem.ban.user")); banAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.RED_FLAG_16x16)); if (admin && !userIsModerator && !isMe) { popup.add(banAction); } Action moderatorAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); } } }; moderatorAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE)); if (admin && !userIsModerator) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.grant.moderator")); popup.add(moderatorAction); } else if (admin && userIsModerator && !isMe) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.revoke.moderator")); popup.add(moderatorAction); } // Handle Unbanning of users. Action unbanAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid); } }; if (admin) { JMenu unbanMenu = new JMenu(Res.getString("menuitem.unban")); Iterator bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = (Affiliate)bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.RED_BALL); JMenuItem bannedItem = new JMenuItem(bannedUser.getJid(), icon); unbanMenu.add(bannedItem); bannedItem.addActionListener(unbanAction); } if (unbanMenu.getMenuComponentCount() > 0) { popup.add(unbanMenu); } } Action inviteAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null); } }; inviteAction.putValue(Action.NAME, Res.getString("menuitem.invite.users")); inviteAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.CONFERENCE_IMAGE_16x16)); popup.addSeparator(); popup.add(inviteAction); popup.show(list, evt.getX(), evt.getY()); }
private void checkPopup(MouseEvent evt) { final int index = list.locationToIndex(evt.getPoint()); list.setSelectedIndex(index); final String selectedUser = getSelectedUser(); final String groupJID = (String)userMap.get(selectedUser); String groupJIDNickname = StringUtils.parseResource(groupJID); final String nickname = groupChatRoom.getNickname(); final Occupant occupant = userManager.getOccupant(groupChatRoom, selectedUser); final boolean admin = SparkManager.getUserManager().isOwnerOrAdmin(groupChatRoom, chat.getNickname()); final boolean moderator = SparkManager.getUserManager().isModerator(groupChatRoom, chat.getNickname()); final boolean userIsAdmin = userManager.isOwnerOrAdmin(occupant); final boolean userIsModerator = userManager.isModerator(occupant); boolean isMe = groupJIDNickname.equals(nickname); JPopupMenu popup = new JPopupMenu(); if (isMe) { Action changeNicknameAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } } }; changeNicknameAction.putValue(Action.NAME, Res.getString("menuitem.change.nickname")); changeNicknameAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); if (allowNicknameChange) { popup.add(changeNicknameAction); } } Action chatAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String selectedUser = getSelectedUser(); startChat(groupChatRoom, (String)userMap.get(selectedUser)); } }; chatAction.putValue(Action.NAME, Res.getString("menuitem.start.a.chat")); chatAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); if (!isMe) { popup.add(chatAction); } Action blockAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { ImageIcon icon = (ImageIcon)list.getSelectedValue(); String description = icon.getDescription(); if (groupChatRoom.isBlocked(groupJID)) { groupChatRoom.removeBlockedUser(groupJID); icon = getImageIcon(groupJID); model.setElementAt(icon, index); } else { groupChatRoom.addBlockedUser(groupJID); icon = SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE); icon.setDescription(description); model.setElementAt(icon, index); } } }; blockAction.putValue(Action.NAME, Res.getString("menuitem.block.user")); blockAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.BRICKWALL_IMAGE)); if (!isMe) { if (groupChatRoom.isBlocked(groupJID)) { blockAction.putValue(Action.NAME, Res.getString("menuitem.unblock.user")); } popup.add(blockAction); } Action kickAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { kickUser(selectedUser); } }; kickAction.putValue(Action.NAME, Res.getString("menuitem.kick.user")); kickAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); if (moderator && !userIsAdmin && !isMe) { popup.add(kickAction); } // Handle Voice Operations Action voiceAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { revokeVoice(selectedUser); } else { grantVoice(selectedUser); } } }; voiceAction.putValue(Action.NAME, Res.getString("menuitem.voice")); voiceAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MEGAPHONE_16x16)); if (moderator && !userIsModerator && !isMe) { if (userManager.hasVoice(groupChatRoom, selectedUser)) { voiceAction.putValue(Action.NAME, Res.getString("menuitem.revoke.voice")); } else { voiceAction.putValue(Action.NAME, Res.getString("menuitem.grant.voice")); } popup.add(voiceAction); } Action banAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { banUser(selectedUser); } }; banAction.putValue(Action.NAME, Res.getString("menuitem.ban.user")); banAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.RED_FLAG_16x16)); if (admin && !userIsModerator && !isMe) { popup.add(banAction); } Action moderatorAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { if (!userIsModerator) { grantModerator(selectedUser); } else { revokeModerator(selectedUser); } } }; moderatorAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.MODERATOR_IMAGE)); if (admin && !userIsModerator) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.grant.moderator")); popup.add(moderatorAction); } else if (admin && userIsModerator && !isMe) { moderatorAction.putValue(Action.NAME, Res.getString("menuitem.revoke.moderator")); popup.add(moderatorAction); } // Handle Unbanning of users. Action unbanAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { String jid = ((JMenuItem)actionEvent.getSource()).getText(); unbanUser(jid); } }; if (admin) { JMenu unbanMenu = new JMenu(Res.getString("menuitem.unban")); Iterator bannedUsers = null; try { bannedUsers = chat.getOutcasts().iterator(); } catch (XMPPException e) { Log.error("Error loading all banned users", e); } while (bannedUsers != null && bannedUsers.hasNext()) { Affiliate bannedUser = (Affiliate)bannedUsers.next(); ImageIcon icon = SparkRes.getImageIcon(SparkRes.RED_BALL); JMenuItem bannedItem = new JMenuItem(bannedUser.getJid(), icon); unbanMenu.add(bannedItem); bannedItem.addActionListener(unbanAction); } if (unbanMenu.getMenuComponentCount() > 0) { popup.add(unbanMenu); } } Action inviteAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { ConferenceUtils.inviteUsersToRoom(groupChatRoom.getConferenceService(), groupChatRoom.getRoomname(), null); } }; inviteAction.putValue(Action.NAME, Res.getString("menuitem.invite.users")); inviteAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.CONFERENCE_IMAGE_16x16)); popup.addSeparator(); popup.add(inviteAction); popup.show(list, evt.getX(), evt.getY()); }
3,230,041
public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") +":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } }
public void actionPerformed(ActionEvent actionEvent) { String newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("label.new.nickname") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(newNickname)) { while (true) { newNickname = newNickname.trim(); try { chat.changeNickname(newNickname); break; } catch (XMPPException e1) { newNickname = JOptionPane.showInputDialog(groupChatRoom, Res.getString("message.nickname.in.use") + ":", Res.getString("title.change.nickname"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newNickname)) { break; } } } } }
3,230,042
public boolean isOwnerOrAdmin(Occupant occupant) { if (occupant != null) { String affiliation = occupant.getAffiliation(); if ("owner".equals(affiliation) || "admin".equals(affiliation)) { return true; } } return false; }
public boolean isOwnerOrAdmin(GroupChatRoom groupChatRoom, String nickname) { Occupant occupant = getOccupant(groupChatRoom, nickname); if (occupant != null) { String affiliation = occupant.getAffiliation(); if ("owner".equals(affiliation) || "admin".equals(affiliation)) { return true; } } return false; }
3,230,044
public boolean isModerator(Occupant occupant) { if (occupant != null) { String role = occupant.getRole(); if ("moderator".equals(role)) { return true; } } return false; }
public boolean isModerator(GroupChatRoom groupChatRoom, String nickname) { Occupant occupant = getOccupant(groupChatRoom, nickname); if (occupant != null) { String role = occupant.getRole(); if ("moderator".equals(role)) { return true; } } return false; }
3,230,045
public void addExistingObjects(DataObject parent, Set children) throws DSOutOfServiceException, DSAccessException { if (parent instanceof ProjectData) { try { children.toArray(new DatasetData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be datasets."); } } else if (parent instanceof DatasetData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } } else if (parent instanceof CategoryGroupData) { try { children.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be categories."); } } else if (parent instanceof CategoryData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } Set cat = new HashSet(1); cat.add(parent); classify(children, cat); return ; } else throw new IllegalArgumentException("parent object not supported"); List objects = new ArrayList(); if (parent instanceof ProjectData) { Project mParent = parent.asProject(); ProjectDatasetLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new ProjectDatasetLink(); l.link(mParent, ((DataObject) child.next()).asDataset()); objects.add(l); } } else if (parent instanceof DatasetData) { Dataset mParent = parent.asDataset(); DatasetImageLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new DatasetImageLink(); l.link(mParent, ((DataObject) child.next()).asImage()); objects.add(l); } } else if (parent instanceof CategoryGroupData) { CategoryGroup mParent = parent.asCategoryGroup(); CategoryGroupCategoryLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new CategoryGroupCategoryLink(); l.link(mParent, ((DataObject) child.next()).asCategory()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
public void addExistingObjects(DataObject parent, Set children) throws DSOutOfServiceException, DSAccessException { if (parent instanceof ProjectData) { try { children.toArray(new DatasetData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be datasets."); } } else if (parent instanceof DatasetData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } } else if (parent instanceof CategoryGroupData) { try { children.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be categories."); } } else if (parent instanceof CategoryData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } Set cat = new HashSet(1); cat.add(parent); classify(children, cat); return ; } else throw new IllegalArgumentException("parent object not supported"); List objects = new ArrayList(); if (parent instanceof ProjectData) { Project mParent = parent.asProject(); ProjectDatasetLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new ProjectDatasetLink(); l.link(mParent, ((DataObject) child.next()).asDataset()); objects.add(l); } } else if (parent instanceof DatasetData) { Dataset mParent = parent.asDataset(); DatasetImageLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new DatasetImageLink(); l.link(mParent, ((DataObject) child.next()).asImage()); objects.add(l); } } else if (parent instanceof CategoryGroupData) { CategoryGroup mParent = parent.asCategoryGroup(); CategoryGroupCategoryLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new CategoryGroupCategoryLink(); l.link(mParent, ((DataObject) child.next()).asCategory()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
3,230,046
public void addExistingObjects(DataObject parent, Set children) throws DSOutOfServiceException, DSAccessException { if (parent instanceof ProjectData) { try { children.toArray(new DatasetData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be datasets."); } } else if (parent instanceof DatasetData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } } else if (parent instanceof CategoryGroupData) { try { children.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be categories."); } } else if (parent instanceof CategoryData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } Set cat = new HashSet(1); cat.add(parent); classify(children, cat); return ; } else throw new IllegalArgumentException("parent object not supported"); List objects = new ArrayList(); if (parent instanceof ProjectData) { Project mParent = parent.asProject(); ProjectDatasetLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new ProjectDatasetLink(); l.link(mParent, ((DataObject) child.next()).asDataset()); objects.add(l); } } else if (parent instanceof DatasetData) { Dataset mParent = parent.asDataset(); DatasetImageLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new DatasetImageLink(); l.link(mParent, ((DataObject) child.next()).asImage()); objects.add(l); } } else if (parent instanceof CategoryGroupData) { CategoryGroup mParent = parent.asCategoryGroup(); CategoryGroupCategoryLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new CategoryGroupCategoryLink(); l.link(mParent, ((DataObject) child.next()).asCategory()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
public void addExistingObjects(DataObject parent, Set children) throws DSOutOfServiceException, DSAccessException { if (parent instanceof ProjectData) { try { children.toArray(new DatasetData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be datasets."); } } else if (parent instanceof DatasetData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } } else if (parent instanceof CategoryGroupData) { try { children.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be categories."); } } else if (parent instanceof CategoryData) { try { children.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "items can only be images."); } Set cat = new HashSet(1); cat.add(parent); classify(children, cat); return ; } else throw new IllegalArgumentException("parent object not supported"); List objects = new ArrayList(); if (parent instanceof ProjectData) { Project mParent = parent.asProject(); ProjectDatasetLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new ProjectDatasetLink(); l.link(mParent, ((DataObject) child.next()).asDataset()); objects.add(l); } } else if (parent instanceof DatasetData) { Dataset mParent = parent.asDataset(); DatasetImageLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new DatasetImageLink(); l.link(mParent, ((DataObject) child.next()).asImage()); objects.add(l); } } else if (parent instanceof CategoryGroupData) { CategoryGroup mParent = parent.asCategoryGroup(); CategoryGroupCategoryLink l; Iterator child = children.iterator(); while (child.hasNext()) { l = new CategoryGroupCategoryLink(); l.link(mParent, ((DataObject) child.next()).asCategory()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
3,230,047
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { mParent = ((DataObject) category.next()).asCategory(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { mParent = ((DataObject) category.next()).asCategory(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
3,230,048
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { mParent = ((DataObject) category.next()).asCategory(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { ioParent = ((DataObject) category.next()).asIObject(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
3,230,049
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { mParent = ((DataObject) category.next()).asCategory(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
public void classify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "images only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "categories only contains CategoryData elements."); } Iterator category = categories.iterator(); Iterator image; List objects = new ArrayList(); Category mParent; CategoryImageLink l; while (category.hasNext()) { mParent = ((DataObject) category.next()).asCategory(); image = images.iterator(); while (image.hasNext()) { l = new CategoryImageLink(); l.link(mParent, ((DataObject) image.next()).asImage()); objects.add(l); } } if (objects.size() != 0) { Iterator i = objects.iterator(); IObject[] array = new IObject[objects.size()]; int index = 0; while (i.hasNext()) { array[index] = (IObject) i.next(); index++; } gateway.createObjects(array, (new PojoOptions()).map()); } }
3,230,050
public DataObject createDataObject(DataObject child, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (child == null) throw new IllegalArgumentException("The child cannot be null."); IObject obj = ModelMapper.createIObject(child, parent); if (obj == null) throw new NullPointerException("Cannot convert object."); IObject created = gateway.createObject(obj, (new PojoOptions()).map()); if (parent != null) ModelMapper.linkParentToChild(created, parent.asIObject()); return PojoMapper.asDataObject(created); }
public DataObject createDataObject(DataObject child, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (child == null) throw new IllegalArgumentException("The child cannot be null."); IObject obj = ModelMapper.createIObject(child, parent); if (obj == null) throw new NullPointerException("Cannot convert object."); IObject created = gateway.createObject(obj, (new PojoOptions()).map()); if (parent != null) ModelMapper.linkParentToChild(created, parent.asIObject()); return PojoMapper.asDataObject(created); }
3,230,051
public void cutAndPaste(Map toPaste, Map toCut) throws DSOutOfServiceException, DSAccessException { /* try { if ((toPaste == null || toCut == null) || (toPaste.size() == 0 || toCut.size() == 0)) { throw new IllegalArgumentException("No data to cut and Paste."); } Iterator i = toPaste.keySet().iterator(); DataObject parent; while (i.hasNext()) { parent = (DataObject) i.next(); paste(parent, (Set) toPaste.get(parent)); } i = toCut.keySet().iterator(); while (i.hasNext()) { parent = (DataObject) i.next(); //removeDataObjects((Set) toCut.get(parent), parent); cut(parent, (Set) toCut.get(parent)); } } catch (Exception e) { e.printStackTrace(); } */ Iterator i = toPaste.keySet().iterator(); DataObject parent = null; IObject[] children; ImageData img = null; while (i.hasNext()) { System.out.println("to paste 0"); parent = (DataObject) i.next(); Set imgs = (Set) toPaste.get(parent); Iterator j = imgs.iterator(); while (j.hasNext()) { img = (ImageData) j.next(); } } Image ioObject = null; Dataset mParent = parent.asDataset(); DatasetImageLink l = new DatasetImageLink(); ioObject = (Image) gateway.updateObject(img.asIObject(), (new PojoOptions()).map()); l.link(mParent, ioObject); gateway.createObject(l, (new PojoOptions()).map()); i = toCut.keySet().iterator(); while (i.hasNext()) { System.out.println("to remove 0"); parent = (DataObject) i.next(); Set imgs = (Set) toCut.get(parent); Iterator k = imgs.iterator(); while (k.hasNext()) { img = (ImageData) k.next(); } ioObject = (Image) gateway.updateObject(img.asIObject(), (new PojoOptions()).map()); } mParent = parent.asDataset(); List links = ioObject.collectDatasetLinks(null); i = links.iterator(); DatasetImageLink link = null; while (i.hasNext()) { System.out.println("to remove"); link = (DatasetImageLink) i.next(); if (link.getParent().getId() == mParent.getId()) break; } gateway.deleteObject(link, (new PojoOptions()).map()); }
public void cutAndPaste(Map toPaste, Map toCut) throws DSOutOfServiceException, DSAccessException { /* try { if ((toPaste == null || toCut == null) || (toPaste.size() == 0 || toCut.size() == 0)) { throw new IllegalArgumentException("No data to cut and Paste."); } Iterator i = toPaste.keySet().iterator(); DataObject parent; while (i.hasNext()) { parent = (DataObject) i.next(); paste(parent, (Set) toPaste.get(parent)); } i = toCut.keySet().iterator(); while (i.hasNext()) { parent = (DataObject) i.next(); //removeDataObjects((Set) toCut.get(parent), parent); cut(parent, (Set) toCut.get(parent)); } } catch (Exception e) { e.printStackTrace(); } */ Iterator i = toPaste.keySet().iterator(); DataObject parent = null; IObject[] children; ImageData img = null; while (i.hasNext()) { System.out.println("to paste 0"); parent = (DataObject) i.next(); Set imgs = (Set) toPaste.get(parent); Iterator j = imgs.iterator(); while (j.hasNext()) { img = (ImageData) j.next(); } } Image ioObject = null; Dataset mParent = parent.asDataset(); DatasetImageLink l = new DatasetImageLink(); ioObject = (Image) gateway.updateObject(img.asIObject(), (new PojoOptions()).map()); l.link(mParent, ioObject); gateway.createObject(l, (new PojoOptions()).map()); i = toCut.keySet().iterator(); while (i.hasNext()) { System.out.println("to remove 0"); parent = (DataObject) i.next(); Set imgs = (Set) toCut.get(parent); Iterator k = imgs.iterator(); while (k.hasNext()) { img = (ImageData) k.next(); } ioObject = (Image) gateway.updateObject(img.asIObject(), (new PojoOptions()).map()); } mParent = parent.asDataset(); List links = ioObject.collectDatasetLinks(null); i = links.iterator(); DatasetImageLink link = null; while (i.hasNext()) { System.out.println("to remove"); link = (DatasetImageLink) i.next(); if (link.getParent().getId() == mParent.getId()) break; } gateway.deleteObject(link); }
3,230,052
public void declassify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "The images set only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "The categories set only contains CategoryData elements."); } Iterator category = categories.iterator(); List links = new ArrayList(); Iterator i; IObject mParent; IObject link; while (category.hasNext()) { mParent = ((DataObject) category.next()).asIObject(); i = images.iterator(); while (i.hasNext()) { link = ModelMapper.unlinkChildFromParent( ((DataObject) i.next()).asImage(), mParent); if (link != null) links.add(link); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } }
public void declassify(Set images, Set categories) throws DSOutOfServiceException, DSAccessException { try { images.toArray(new ImageData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "The images set only contains ImageData elements."); } try { categories.toArray(new CategoryData[] {}); } catch (ArrayStoreException ase) { throw new IllegalArgumentException( "The categories set only contains CategoryData elements."); } Iterator category = categories.iterator(); List links = new ArrayList(); Iterator i; IObject mParent; IObject link; while (category.hasNext()) { mParent = ((DataObject) category.next()).asIObject(); i = images.iterator(); while (i.hasNext()) { link = ModelMapper.unlinkChildFromParent( ((DataObject) i.next()).asImage(), mParent); if (link != null) links.add(link); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } }
3,230,053
public DataObject removeAnnotationFrom(DataObject annotatedObject, AnnotationData data) throws DSOutOfServiceException, DSAccessException { if (data == null) throw new IllegalArgumentException("No annotation to delete."); if (annotatedObject == null) throw new IllegalArgumentException("No annotated DataObject."); if (!(annotatedObject instanceof ImageData) && !(annotatedObject instanceof DatasetData)) throw new IllegalArgumentException("This method only supports " + "ImageData and DatasetData objects."); Map options = (new PojoOptions()).map(); gateway.deleteObject(data.asIObject(), options); return updateDataObject(annotatedObject); }
public DataObject removeAnnotationFrom(DataObject annotatedObject, AnnotationData data) throws DSOutOfServiceException, DSAccessException { if (data == null) throw new IllegalArgumentException("No annotation to delete."); if (annotatedObject == null) throw new IllegalArgumentException("No annotated DataObject."); if (!(annotatedObject instanceof ImageData) && !(annotatedObject instanceof DatasetData)) throw new IllegalArgumentException("This method only supports " + "ImageData and DatasetData objects."); Map options = (new PojoOptions()).map(); gateway.deleteObject(data.asIObject(), options); return updateDataObject(annotatedObject); }
3,230,054
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
3,230,055
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); IObject ioChild; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
3,230,056
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
3,230,057
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
public Set removeDataObjects(Set children, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (children == null) throw new IllegalArgumentException("The children cannot be null."); if (children.size() == 0) throw new IllegalArgumentException("The children cannot be null."); Iterator i = children.iterator(); if (parent == null) { int index = 0; IObject[] ioObjects = new IObject[children.size()]; while (i.hasNext()) { ioObjects[index] = ((DataObject) i.next()).asIObject(); index++; } gateway.deleteObjects(ioObjects); } else { DataObject child; IObject p = parent.asIObject(); Image img; IObject link; List links = null; List toUpdate = new ArrayList(); while (i.hasNext()) { child = (DataObject) i.next(); if (child instanceof ImageData) { img = child.asImage(); link = ModelMapper.unlinkChildFromParent(img, p); if (links == null) links = new ArrayList(); if (link != null) links.add(link); if (!(toUpdate.contains(p))) toUpdate.add(p); } else { toUpdate.add(ModelMapper.removeIObject(child.asIObject(), p)); } } if (links != null) { gateway.deleteObjects((IObject[]) links.toArray(new IObject[links.size()])); } IObject[] results = gateway.updateObjects( (IObject[]) toUpdate.toArray( new IObject[toUpdate.size()]), (new PojoOptions()).map()); for (int j = 0; j < results.length; j++) PojoMapper.asDataObject(results[j]); } return children; }
3,230,058
public DataObject updateAnnotationFor(DataObject annotatedObject, AnnotationData data) throws DSOutOfServiceException, DSAccessException { if (data == null) throw new IllegalArgumentException("No annotation to update."); if (annotatedObject == null) throw new IllegalArgumentException("No annotated DataObject."); if (!(annotatedObject instanceof ImageData) && !(annotatedObject instanceof DatasetData)) throw new IllegalArgumentException("This method only supports " + "ImageData and DatasetData objects."); Map options = (new PojoOptions()).map(); IObject updated = gateway.updateObject(annotatedObject.asIObject(), options); IObject toUpdate = data.asIObject(); ModelMapper.setAnnotatedObject(updated, toUpdate); gateway.updateObject(toUpdate, options); return PojoMapper.asDataObject(updated); }
public DataObject updateAnnotationFor(DataObject annotatedObject, AnnotationData data) throws DSOutOfServiceException, DSAccessException { if (data == null) throw new IllegalArgumentException("No annotation to update."); if (annotatedObject == null) throw new IllegalArgumentException("No annotated DataObject."); if (!(annotatedObject instanceof ImageData) && !(annotatedObject instanceof DatasetData)) throw new IllegalArgumentException("This method only supports " + "ImageData and DatasetData objects."); Map options = (new PojoOptions()).map(); IObject updated = gateway.updateObject(annotatedObject.asIObject(), options); IObject toUpdate = data.asIObject(); ModelMapper.setAnnotatedObject(updated, toUpdate); gateway.updateObject(toUpdate, options); return PojoMapper.asDataObject(updated); }
3,230,059
public DataObject updateDataObject(DataObject object) throws DSOutOfServiceException, DSAccessException { if (object == null) throw new DSAccessException("No object to update."); IObject ob = object.asIObject(); ModelMapper.unloadCollections(ob);; IObject updated = gateway.updateObject(ob, (new PojoOptions()).map()); return PojoMapper.asDataObject(updated); }
public DataObject updateDataObject(DataObject object) throws DSOutOfServiceException, DSAccessException { if (object == null) throw new DSAccessException("No object to update."); IObject ob = object.asIObject(); ModelMapper.unloadCollections(ob); IObject updated = gateway.updateObject(ob, (new PojoOptions()).map()); return PojoMapper.asDataObject(updated); }
3,230,060
IObject[] createObjects(IObject[] objects, Map options) throws DSOutOfServiceException, DSAccessException { try { IPojos service = getIPojosService(); return service.createDataObjects(objects, options); } catch (Exception e) { handleException(e, "Cannot update the object."); } return null; }
IObject[] createObjects(IObject[] objects, Map options) throws DSOutOfServiceException, DSAccessException { try { IPojos service = getIPojosService(); IObject[] results = service.createDataObjects(objects, options); return results; } catch (Exception e) { handleException(e, "Cannot update the object."); } return null; }
3,230,061
public static String getVersion() { return "1.1.9.6"; }
public static String getVersion() { return "1.1.9.7"; }
3,230,062
public static Annotator getAnnotator(Set objects, Registry ctx) { if (registry == null) registry = ctx; if (objects == null || objects.size() == 0) return null; return singleton.createAnnotator(objects); }
public static Annotator getAnnotator(Set objects, Registry ctx) { if (registry == null) registry = ctx; if (objects == null || objects.size() == 0) return null; return singleton.createAnnotator(objects); }
3,230,064
public static Classifier getClassifier(Set objects, Class rootType, long rootID, int m, Registry ctx) { if (registry == null) registry = ctx; if (objects == null || objects.size() == 0) return null; return singleton.createClassifier(objects, rootType, rootID, m); }
public static Classifier getClassifier(Set objects, Class rootType, long rootID, int m, Registry ctx) { if (registry == null) registry = ctx; if (objects == null || objects.size() == 0) return null; return singleton.createClassifier(objects, rootType, rootID, m); }
3,230,065
public CommandlineParser(String[] arguments, PrintStream outStream) { this.arguments = arguments; this.outStream = outStream; processArguments(); }
public CommandlineParser(Main main, String[] arguments) { this.arguments = arguments; this.outStream = outStream; processArguments(); }
3,230,067
public CommandlineParser(String[] arguments, PrintStream outStream) { this.arguments = arguments; this.outStream = outStream; processArguments(); }
public CommandlineParser(String[] arguments, PrintStream outStream) { this.arguments = arguments; this.main = main; processArguments(); }
3,230,068
public Reader getScriptSource() { if (hasInlineScript()) { return new StringReader(inlineScript()); } else if (isSourceFromStdin()) { return new InputStreamReader(System.in); } else { File file = new File(getScriptFileName()); try { return new BufferedReader(new FileReader(file)); } catch (IOException e) { System.err.println("Error opening script file: " + e.getMessage()); systemExit(); } } assert false; return null; }
public Reader getScriptSource() { if (hasInlineScript()) { return new StringReader(inlineScript()); } else if (isSourceFromStdin()) { return new InputStreamReader(System.in); } else { File file = new File(getScriptFileName()); try { return new BufferedReader(new FileReader(file)); } catch (IOException e) { System.err.println("Error opening script file: " + e.getMessage()); systemExit(); } } assert false; return null; }
3,230,069
public Reader getScriptSource() { if (hasInlineScript()) { return new StringReader(inlineScript()); } else if (isSourceFromStdin()) { return new InputStreamReader(System.in); } else { File file = new File(getScriptFileName()); try { return new BufferedReader(new FileReader(file)); } catch (IOException e) { System.err.println("Error opening script file: " + e.getMessage()); systemExit(); } } assert false; return null; }
public Reader getScriptSource() { if (hasInlineScript()) { return new StringReader(inlineScript()); } else if (isSourceFromStdin()) { return new InputStreamReader(System.in); } else { File file = new File(getScriptFileName()); try { return new BufferedReader(new FileReader(file)); } catch (IOException e) { System.err.println("Error opening script file: " + e.getMessage()); systemExit(); } } assert false; return null; }
3,230,070
private String grabValue(String errorMessage) { characterIndex++; if (characterIndex < arguments[argumentIndex].length()) { return arguments[argumentIndex].substring(characterIndex); } argumentIndex++; if (argumentIndex < arguments.length) { return arguments[argumentIndex]; } System.err.println("invalid argument " + argumentIndex); System.err.println(errorMessage); Main.printUsage(outStream); systemExit(); return null; }
private String grabValue(String errorMessage) { characterIndex++; if (characterIndex < arguments[argumentIndex].length()) { return arguments[argumentIndex].substring(characterIndex); } argumentIndex++; if (argumentIndex < arguments.length) { return arguments[argumentIndex]; } System.err.println("invalid argument " + argumentIndex); System.err.println(errorMessage); Main.printUsage(outStream); systemExit(); return null; }
3,230,071
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(outStream); shouldRunInterpreter = false; break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : benchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : split = true; break; case 'l' : processLineEnds = true; break; case 'v' : verbose = true; setShowVersion(true); break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { setShowVersion(true); break FOR; } else { if (argument.equals("--")) { // ruby interpreter compatibilty // Usage: ruby [switches] [--] [programfile] [arguments]) break FOR; } } default : System.err.println("unknown option " + argument.charAt(characterIndex)); systemExit(); } } }
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : main.printUsage(); shouldRunInterpreter = false; break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : benchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : split = true; break; case 'l' : processLineEnds = true; break; case 'v' : verbose = true; setShowVersion(true); break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { setShowVersion(true); break FOR; } else { if (argument.equals("--")) { // ruby interpreter compatibilty // Usage: ruby [switches] [--] [programfile] [arguments]) break FOR; } } default : System.err.println("unknown option " + argument.charAt(characterIndex)); systemExit(); } } }
3,230,072
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(outStream); shouldRunInterpreter = false; break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : benchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : split = true; break; case 'l' : processLineEnds = true; break; case 'v' : verbose = true; setShowVersion(true); break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { setShowVersion(true); break FOR; } else { if (argument.equals("--")) { // ruby interpreter compatibilty // Usage: ruby [switches] [--] [programfile] [arguments]) break FOR; } } default : System.err.println("unknown option " + argument.charAt(characterIndex)); systemExit(); } } }
private void processArgument() { String argument = arguments[argumentIndex]; FOR : for (characterIndex = 1; characterIndex < argument.length(); characterIndex++) { switch (argument.charAt(characterIndex)) { case 'h' : Main.printUsage(outStream); shouldRunInterpreter = false; break; case 'I' : loadPaths.add(grabValue(" -I must be followed by a directory name to add to lib path")); break FOR; case 'r' : requiredLibraries.add(grabValue("-r must be followed by a package to require")); break FOR; case 'e' : inlineScript.append(grabValue(" -e must be followed by an expression to evaluate")); inlineScript.append('\n'); break FOR; case 'b' : benchmarking = true; break; case 'p' : assumePrinting = true; assumeLoop = true; break; case 'n' : assumeLoop = true; break; case 'a' : split = true; break; case 'l' : processLineEnds = true; break; case 'v' : verbose = true; setShowVersion(true); break; case 'w' : verbose = true; break; case '-' : if (argument.equals("--version")) { setShowVersion(true); break FOR; } else { if (argument.equals("--")) { // ruby interpreter compatibilty // Usage: ruby [switches] [--] [programfile] [arguments]) break FOR; } } default : System.err.println("unknown option " + argument.charAt(characterIndex)); systemExit(); } } }
3,230,073
protected void leave(Node iVisited) {}
protected void leave(Node iVisited) {}
3,230,074
public void setExpandBlocks(boolean iExpandBlock) { _expandBlocks = iExpandBlock; }
public void setExpandBlocks(boolean iExpandBlock) { _expandBlocks = iExpandBlock; }
3,230,075
protected void visit(Node iVisited) { visit(iVisited, true); }
protected void visit(Node iVisited) { visit(iVisited, true); }
3,230,076
public void visitAliasNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitAliasNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,077
public void visitAndNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitAndNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,078
public void visitArgsCatNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitArgsCatNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,079
public void visitArgsNode(Node iVisited) { visit(iVisited); Node lOptNode = iVisited.getOptNode(); if (lOptNode != null) lOptNode.accept(this); leave(iVisited); }
public void visitArgsNode(Node iVisited) { visit(iVisited); Node lOptNode = iVisited.getOptNode(); if (lOptNode != null) lOptNode.accept(this); leave(iVisited); }
3,230,080
public void visitArgsPushNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitArgsPushNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,081
public void visitArrayNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitArrayNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,082
public void visitAttrSetNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitAttrSetNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,083
public void visitBackRefNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitBackRefNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,084
public void visitBeginNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitBeginNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,085
public void visitBlockArgNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitBlockArgNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,086
public void visitBlockNode(Node iVisited) { visit(iVisited); if (!_expandBlocks) { for (Node node = iVisited; node != null; node = node.getNextNode()) node.getHeadNode().accept(this); } else { iVisited.getHeadNode().accept(this); Node lNext = iVisited.getNextNode(); if (lNext != null) lNext.accept(this); } leave(iVisited); }
public void visitBlockNode(Node iVisited) { visit(iVisited); if (!_expandBlocks) { for (Node node = iVisited; node != null; node = node.getNextNode()) node.getHeadNode().accept(this); } else { iVisited.getHeadNode().accept(this); Node lNext = iVisited.getNextNode(); if (lNext != null) lNext.accept(this); } leave(iVisited); }
3,230,087
public void visitBlockPassNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitBlockPassNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,088
public void visitBreakNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitBreakNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,089
public void visitCDeclNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCDeclNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,090
public void visitCFuncNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCFuncNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,091
public void visitCRefNode(Node iVisited) { visit(iVisited); Node lNext = iVisited.getNextNode(); if (lNext != null) lNext.accept(this); leave(iVisited); }
public void visitCRefNode(Node iVisited) { visit(iVisited); Node lNext = iVisited.getNextNode(); if (lNext != null) lNext.accept(this); leave(iVisited); }
3,230,092
public void visitCVAsgnNode(Node iVisited) { visit(iVisited); iVisited.getValueNode().accept(this); leave(iVisited); }
public void visitCVAsgnNode(Node iVisited) { visit(iVisited); iVisited.getValueNode().accept(this); leave(iVisited); }
3,230,093
public void visitCVDeclNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCVDeclNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,094
public void visitCVar2Node(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCVar2Node(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,095
public void visitCVarNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCVarNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,096
public void visitCallNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCallNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,097
public void visitCaseNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitCaseNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,098
public void visitClassNode(Node iVisited) { visit(iVisited); //FIXME not done yet just quick testing iVisited.getBodyNode().accept(this); leave(iVisited); }
public void visitClassNode(Node iVisited) { visit(iVisited); //FIXME not done yet just quick testing iVisited.getBodyNode().accept(this); leave(iVisited); }
3,230,099
public void visitColon2Node(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitColon2Node(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,100
public void visitColon3Node(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitColon3Node(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,101
public void visitConstNode(Node iVisited) { visit(iVisited); leave(iVisited); }
public void visitConstNode(Node iVisited) { visit(iVisited); leave(iVisited); }
3,230,102
public void visitDAsgnCurrNode(Node iVisited) { visit(iVisited); iVisited.getValueNode().accept(this); leave(iVisited); }
public void visitDAsgnCurrNode(Node iVisited) { visit(iVisited); iVisited.getValueNode().accept(this); leave(iVisited); }
3,230,103