bugged
stringlengths
6
599k
fixed
stringlengths
6
40.8M
__index_level_0__
int64
0
3.24M
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
public void run() { ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
3,233,530
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(false); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
3,233,531
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
public void run() { final ContactList contactList = SparkManager.getWorkspace().getContactList(); ChatRoom chatRoom = null; try { chatRoom = getChatContainer().getChatRoom(StringUtils.parseBareAddress(from)); if (chatRoom != null && chatRoom instanceof ChatRoomImpl) { ((ChatRoomImpl)chatRoom).showTyping(true); } } catch (ChatRoomNotFoundException e) { } contactList.setIconFor(from, SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_EDIT_IMAGE)); customList.add(StringUtils.parseBareAddress(from)); }
3,233,532
public void load() { rwl.writeLock().lock(); try { errorIfNullPixels(); /* * TODO we could also allow for setting of the buffer! perhaps * better caching, etc. */ PixelBuffer buffer = pixDataSrv.getPixelBuffer(pixelsObj); renderer = new Renderer(pixMetaSrv, pixelsObj, rendDefObj, buffer); try { buffer.close(); } catch (IOException e) { e.printStackTrace(); throw new ResourceError(e.getMessage()); } } finally { rwl.writeLock().unlock(); } }
public void load() { rwl.writeLock().lock(); try { errorIfNullPixels(); /* * TODO we could also allow for setting of the buffer! perhaps * better caching, etc. */ PixelBuffer buffer = pixDataSrv.getPixelBuffer(pixelsObj); renderer = new Renderer(pixMetaSrv, pixelsObj, rendDefObj, buffer); try { if (buffer != null) buffer.close(); } catch (IOException e) { e.printStackTrace(); throw new ResourceError(e.getMessage()); } } finally { rwl.writeLock().unlock(); } }
3,233,533
public Classification(Integer attributeId, Float confidence, Boolean valid, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Category category, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.confidence = confidence; this.valid = valid; this.image = image; this.category = category; this.moduleExecution = moduleExecution; }
public Classification(Integer attributeId, Float confidence, Boolean valid, org.openmicroscopy.omero.model.Image image, org.openmicroscopy.omero.model.Category category, org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.attributeId = attributeId; this.confidence = confidence; this.valid = valid; this.image = image; this.category = category; this.moduleExecution = moduleExecution; }
3,233,534
public org.openmicroscopy.omero.model.Category getCategory() { return this.category; }
public Category getCategory() { return this.category; }
3,233,535
public org.openmicroscopy.omero.model.Image getImage() { return this.image; }
public Image getImage() { return this.image; }
3,233,536
public org.openmicroscopy.omero.model.ModuleExecution getModuleExecution() { return this.moduleExecution; }
public ModuleExecution getModuleExecution() { return this.moduleExecution; }
3,233,537
public void setCategory(org.openmicroscopy.omero.model.Category category) { this.category = category; }
public void setCategory(Category category) { this.category = category; }
3,233,538
public void setImage(org.openmicroscopy.omero.model.Image image) { this.image = image; }
public void setImage(Image image) { this.image = image; }
3,233,539
public void setModuleExecution(org.openmicroscopy.omero.model.ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
public void setModuleExecution(ModuleExecution moduleExecution) { this.moduleExecution = moduleExecution; }
3,233,540
public static IRubyObject autoload(IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return runtime.getObject().getConstant(name); } }); return recv; }
public static IRubyObject autoload(final IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return runtime.getObject().getConstant(name); } }); return recv; }
3,233,542
public static IRubyObject autoload(IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return runtime.getObject().getConstant(name); } }); return recv; }
public static IRubyObject autoload(IRubyObject recv, IRubyObject symbol, final IRubyObject file) { final LoadService loadService = recv.getRuntime().getLoadService(); loadService.addAutoload(symbol.asSymbol(), new IAutoloadMethod() { /** * @see org.jruby.runtime.load.IAutoloadMethod#load(IRuby, String) */ public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return ((RubyModule)recv).getConstant(name); } }); return recv; }
3,233,543
public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return runtime.getObject().getConstant(name); }
public IRubyObject load(IRuby runtime, String name) { loadService.require(file.toString()); return ((RubyModule)recv).getConstant(name); }
3,233,544
public static void main (String args[]) { System.out.println("WARNING this is an ALPHA version of JRuby!!!"); System.out.println("--------------------------------------------"); System.out.println(); if (args.length == 0) { printUsage(); } else { /*if (args[0].equals("-version")) { printVersion(); } else*/ if (args[0].equals("-help")) { printUsage(); } else { runInterpreter(args[0]); } } }
public static void main (String args[]) { System.out.println("WARNING this is an ALPHA version of JRuby!!!"); System.out.println("--------------------------------------------"); System.out.println(); if (args.length == 0) { printUsage(); } else { /*if (args[0].equals("-version")) { printVersion(); } else*/ if (args[0].equals("-help")) { printUsage(); } else { runInterpreter(args[0]); } } }
3,233,545
public static void main (String args[]) { System.out.println("WARNING this is an ALPHA version of JRuby!!!"); System.out.println("--------------------------------------------"); System.out.println(); if (args.length == 0) { printUsage(); } else { /*if (args[0].equals("-version")) { printVersion(); } else*/ if (args[0].equals("-help")) { printUsage(); } else { runInterpreter(args[0]); } } }
public static void main (String args[]) { System.out.println("WARNING this is an ALPHA version of JRuby!!!"); System.out.println("--------------------------------------------"); System.out.println(); if (args.length == 0) { printUsage(); } else { /*if (args[0].equals("-version")) { printVersion(); } else*/ if (args[0].equals("-help")) { printUsage(); } else { runInterpreter(args[0]); } } }
3,233,546
protected static void printUsage() { System.out.println("Usage: java -jar jruby.jar rubyfile.rb"); }
protected static void printUsage() { System.out.println("Usage: java -jar jruby.jar [switches] [rubyfile.rb] [arguments]"); System.out.println(" -e 'command' one line of script. Several -e's allowed. Omit [programfile]"); }
3,233,548
protected static void runInterpreter(String fileName) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); // Initialize Runtime Ruby ruby = new Ruby(); // Initialize Parser parse p = new parse(ruby); // Parse and interpret file RubyString rs = RubyString.m_newString(ruby, sb.toString()); ruby.getInterpreter().eval(ruby.getObjectClass(), p.rb_compile_string(fileName, rs, 0)); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
protected static void runInterpreter(String fileName) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); // Initialize Runtime Ruby ruby = new Ruby(); // Initialize Parser parse p = new parse(ruby); // Parse and interpret file RubyString rs = RubyString.m_newString(ruby, sb.toString()); ruby.getInterpreter().eval(ruby.getObjectClass(), p.rb_compile_string(fileName, rs, 0)); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
3,233,549
public void saveCurrentSettings() { rwl.writeLock().lock(); try { errorIfNullRenderingDef(); pixMetaSrv.saveRndSettings(rendDefObj); } finally { rwl.writeLock().unlock(); } iUpdate.flush(); iUpdate.commit(); }
public void saveCurrentSettings() { rwl.writeLock().lock(); try { errorIfNullRenderingDef(); pixMetaSrv.saveRndSettings(rendDefObj); } finally { rwl.writeLock().unlock(); } iUpdate.flush(); }
3,233,550
protected Object runQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria((Class) value(CLASS)); for (QueryParameter qp : params.queryParameters()) { if ( ! qp.name.equals( CLASS ) ) { c.add(Expression.eq(qp.name,qp.value)); // TODO checks for type. } } return c.list(); }
protected Object runQuery(Session session) throws HibernateException, SQLException { Criteria c = session.createCriteria((Class) value(CLASS)); for (QueryParameter qp : params.queryParameters()) { if ( ! qp.name.equals( CLASS ) ) { c.add(Expression.eq(qp.name,qp.value)); // TODO checks for type. } } return this.params.getFilter().isUnique() ? c.uniqueResult() : c.list(); }
3,233,551
private Node parseExpressionString(Node list, int closeQuote) { int c; int brace = -1; RubyObject ss; Node node; int nest; c = nextc(); switch (c) { case '$' : case '@' : case '{' : break; default : tokadd('#'); pushback(c); return list; } ss = RubyString.newString(ruby, tok(), toklen()); if (list == null) { list = nf.newDStr(ss); } else if (toklen() > 0) { ph.list_append(list, nf.newStr(ss)); } newtok(); fetch_id : for (;;) { switch (c) { case '$' : tokadd('$'); c = nextc(); if (c == -1) { return Node.MINUS_ONE; } switch (c) { case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : while (Character.isDigit((char) c)) { tokadd(c); c = nextc(); } pushback(c); break fetch_id; case '&' : case '+' : case '_' : case '~' : case '*' : case '$' : case '?' : case '!' : case '@' : case ',' : case '.' : case '=' : case ':' : case '<' : case '>' : case '\\' : //refetch: tokadd(c); break fetch_id; default : if (c == closeQuote) { ph.list_append(list, nf.newStr(RubyString.newString(ruby, "#$"))); pushback(c); newtok(); return list; } switch (c) { case '\"' : case '/' : case '\'' : case '`' : //goto refetch; tokadd(c); break fetch_id; } if (!isIdentifierChar(c)) { yyerror("bad global variable in string"); newtok(); return list; } } while (isIdentifierChar(c)) { tokadd(c); c = nextc(); } pushback(c); break; case '@' : tokadd(c); c = nextc(); if (c == '@') { tokadd(c); c = nextc(); } while (isIdentifierChar(c)) { tokadd(c); c = nextc(); } pushback(c); break; case '{' : if (c == '{') { brace = '}'; } nest = 0; do { loop_again : for (;;) { c = nextc(); switch (c) { case -1 : if (nest > 0) { yyerror("bad substitution in string"); newtok(); return list; } return Node.MINUS_ONE; case '}' : if (c == brace) { if (nest == 0) { break; } nest--; } tokadd(c); continue loop_again; case '\\' : c = nextc(); if (c == -1) { return Node.MINUS_ONE; } if (c == closeQuote) { tokadd(c); } else { tokadd('\\'); tokadd(c); } break; case '{' : if (brace != -1) { nest++; } case '\"' : case '/' : case '`' : if (c == closeQuote) { pushback(c); ph.list_append(list, nf.newStr(RubyString.newString(ruby, "#"))); ph.rb_warning("bad substitution in string"); ph.list_append(list, nf.newStr(RubyString.newString(ruby, tok(), toklen()))); newtok(); return list; } default : tokadd(c); break; } break loop_again; } } while (c != brace); } break; } //fetch_id: node = nf.newEVStr(tok(), toklen()); ph.list_append(list, node); newtok(); return list; }
private Node parseExpressionString(Node list, int closeQuote) { int c; int brace = -1; RubyObject ss; Node node; int nest; c = nextc(); switch (c) { case '$' : case '@' : case '{' : break; default : tokadd('#'); pushback(c); return list; } ss = RubyString.newString(ruby, tok(), toklen()); if (list == null) { list = nf.newDStr(ss); } else if (toklen() > 0) { ph.list_append(list, nf.newStr(ss)); } newtok(); fetch_id : for (;;) { switch (c) { case '$' : tokadd('$'); c = nextc(); if (c == -1) { return Node.MINUS_ONE; } switch (c) { case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : while (Character.isDigit((char) c)) { tokadd(c); c = nextc(); } pushback(c); break fetch_id; case '&' : case '+' : case '_' : case '~' : case '*' : case '$' : case '?' : case '!' : case '@' : case ',' : case '.' : case '=' : case ':' : case '<' : case '>' : case '\\' : //refetch: tokadd(c); break fetch_id; default : if (c == closeQuote) { ph.list_append(list, nf.newStr(RubyString.newString(ruby, "#$"))); pushback(c); newtok(); return list; } switch (c) { case '\"' : case '/' : case '\'' : case '`' : //goto refetch; tokadd(c); break fetch_id; } if (!isIdentifierChar(c)) { yyerror("bad global variable in string"); newtok(); return list; } } while (isIdentifierChar(c)) { tokadd(c); c = nextc(); } pushback(c); break; case '@' : tokadd(c); c = nextc(); if (c == '@') { tokadd(c); c = nextc(); } while (isIdentifierChar(c)) { tokadd(c); c = nextc(); } pushback(c); break; case '{' : if (c == '{') { brace = '}'; } nest = 0; do { loop_again : for (;;) { c = nextc(); switch (c) { case -1 : if (nest > 0) { yyerror("bad substitution in string"); newtok(); return list; } return Node.MINUS_ONE; case '}' : if (c == brace) { if (nest == 0) { break; } nest--; } tokadd(c); continue loop_again; case '\\' : c = nextc(); if (c == -1) { return Node.MINUS_ONE; } if (c == closeQuote) { tokadd(c); } else { tokadd('\\'); tokadd(c); } break; case '{' : if (brace != -1) { nest++; } case '\"' : case '/' : case '`' : if (c == closeQuote) { pushback(c); ph.list_append(list, nf.newStr(RubyString.newString(ruby, "#"))); ph.rb_warning("bad substitution in string"); ph.list_append(list, nf.newStr(RubyString.newString(ruby, tok(), toklen()))); newtok(); return list; } default : tokadd(c); break; } break loop_again; } } while (c != brace); } break; } //fetch_id: node = nf.newEVStr(tok(), toklen()); ph.list_append(list, node); newtok(); return list; }
3,233,552
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } String name = args[0].asSymbol(); IRubyObject body; ICallable newMethod; Visibility visibility = getRuntime().getCurrentContext().getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1) { body = getRuntime().newProc(); newMethod = new ProcMethod(this, (RubyProc)body, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { body = args[1]; newMethod = new MethodMethod(this, ((RubyMethod)body).unbind(), visibility); } else if (args[1].isKindOf(getRuntime().getClass("Proc"))) { body = args[1]; newMethod = new ProcMethod(this, (RubyProc)body, visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/RubyMethod)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); if (getRuntime().getCurrentContext().getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod("singleton_method_added", symbol); } callMethod("method_added", symbol); return body; }
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } String name = args[0].asSymbol(); IRubyObject body; ICallable newMethod; Visibility visibility = getRuntime().getCurrentContext().getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1) { body = getRuntime().newProc(); newMethod = new ProcMethod(this, (RubyProc)body, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { body = args[1]; newMethod = new MethodMethod(this, ((RubyMethod)body).unbind(), visibility); } else if (args[1].isKindOf(getRuntime().getClass("Proc"))) { body = args[1]; newMethod = new ProcMethod(this, (RubyProc)body, visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); if (getRuntime().getCurrentContext().getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod("singleton_method_added", symbol); } callMethod("method_added", symbol); return body; }
3,233,554
public void generate(NamespaceMapping namespaceMapping) throws IOException { String namespace = namespaceMapping.getNamespace(); if (namespace == null) { return; } File file = new File(metaInfDir, NamespaceHelper.createDiscoveryPathName(namespace)); file.getParentFile().mkdirs(); log.log("Generating META-INF properties file: " + file + " for namespace: " + namespace); PrintWriter out = new PrintWriter(new FileWriter(file)); try { generatePropertiesFile(out, namespaceMapping.getElements()); } finally { out.close(); } // Generate spring 2.0 mapping file = new File(metaInfDir, "META-INF/spring.handlers"); log.log("Generating Spring 2.0 handler mapping: " + file + " for namespace: " + namespace); out = new PrintWriter(new FileWriter(file)); try { out.println(namespace.replace(":", "\\:") + "=" + NAMESPACE_HANDLER); } finally { out.close(); } }
public void generate(NamespaceMapping namespaceMapping) throws IOException { String namespace = namespaceMapping.getNamespace(); if (namespace == null) { return; } File file = new File(metaInfDir, NamespaceHelper.createDiscoveryPathName(namespace)); file.getParentFile().mkdirs(); log.log("Generating META-INF properties file: " + file + " for namespace: " + namespace); PrintWriter out = new PrintWriter(new FileWriter(file)); try { generatePropertiesFile(out, namespaceMapping.getElements()); } finally { out.close(); } // Generate spring 2.0 mapping file = new File(metaInfDir, "META-INF/spring.handlers"); log.log("Generating Spring 2.0 handler mapping: " + file + " for namespace: " + namespace); out = new PrintWriter(new FileWriter(file)); try { out.println(namespace.replaceAll(":", "\\\\:") + "=" + NAMESPACE_HANDLER); } finally { out.close(); } }
3,233,555
public List childNodes() { return Collections.EMPTY_LIST; }
public List childNodes() { return EMPTY_LIST; }
3,233,558
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
private void setTableLayout() { int w = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
3,233,559
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
3,233,560
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
3,233,561
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
private void setTableLayout() { int width = AnalysisControls.WIDTH_MIN; if (numColumns > AnalysisControls.MAX) width = AnalysisControls.WIDTH_MAX; setRowHeight(width); TableColumn col; for (int i = 0; i < numColumns; i++) { col = getColumnModel().getColumn(i); col.setMinWidth(width); col.setMaxWidth(width); col.setPreferredWidth(width); } int w = width*numColumns, h = width*numRows; if (w > MAX_WIDTH) w = MAX_WIDTH; if (h > MAX_HEIGHT) h = MAX_HEIGHT; setPreferredScrollableViewportSize(new Dimension(w, h)); setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); }
3,233,562
public RubyArray coerce(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyArray.newArray(getRuntime(), newFloat(getRuntime(), other.getDoubleValue()), this); }
public RubyArray coerce(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyArray.newArray(getRuntime(), newFloat(getRuntime(), other.getDoubleValue()), this); }
3,233,563
public static RubyClass createFloatClass(Ruby ruby) { return new FloatDefinition(ruby).getType(); }
public static RubyClass createFloatClass(Ruby ruby) { RubyClass result = ruby.defineClass("Float", ruby.getClasses().getNumericClass()); CallbackFactory callbackFactory = ruby.callbackFactory(); result.defineMethod("+", callbackFactory.getMethod(RubyFloat.class, "op_plus", RubyNumeric.class)); result.defineMethod("-", callbackFactory.getMethod(RubyFloat.class, "op_minus", RubyNumeric.class)); result.defineMethod("*", callbackFactory.getMethod(RubyFloat.class, "op_mul", RubyNumeric.class)); result.defineMethod("/", callbackFactory.getMethod(RubyFloat.class, "op_div", RubyNumeric.class)); result.defineMethod("%", callbackFactory.getMethod(RubyFloat.class, "op_mod", RubyNumeric.class)); result.defineMethod("**", callbackFactory.getMethod(RubyFloat.class, "op_pow", RubyNumeric.class)); result.defineMethod("ceil", callbackFactory.getMethod(RubyFloat.class, "ceil")); result.defineMethod("finite?", callbackFactory.getMethod(RubyFloat.class, "finite_p")); result.defineMethod("floor", callbackFactory.getMethod(RubyFloat.class, "floor")); result.defineMethod("hash", callbackFactory.getMethod(RubyFloat.class, "hash")); result.defineMethod("infinite?", callbackFactory.getMethod(RubyFloat.class, "infinite_p")); result.defineMethod("nan?", callbackFactory.getMethod(RubyFloat.class, "nan_p")); result.defineMethod("round", callbackFactory.getMethod(RubyFloat.class, "round")); result.defineMethod("to_i", callbackFactory.getMethod(RubyFloat.class, "to_i")); result.defineMethod("to_f", callbackFactory.getMethod(RubyFloat.class, "to_f")); result.defineMethod("to_s", callbackFactory.getMethod(RubyFloat.class, "to_s")); result.defineMethod("truncate", callbackFactory.getMethod(RubyFloat.class, "truncate")); result.getMetaClass().undefineMethod("new"); result.defineSingletonMethod("induced_from", callbackFactory.getSingletonMethod(RubyFloat.class, "induced_from", IRubyObject.class)); return result; }
3,233,564
public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() / other.getDoubleValue()); }
public RubyNumeric op_div(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() / other.getDoubleValue()); }
3,233,565
public RubyNumeric op_minus(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() - other.getDoubleValue()); }
public RubyNumeric op_minus(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() - other.getDoubleValue()); }
3,233,566
public RubyNumeric op_mod(IRubyObject num) { RubyNumeric other = numericValue(num); // Modelled after c ruby implementation (java /,% not same as ruby) double x = getDoubleValue(); double y = other.getDoubleValue(); double mod = x % y; if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { mod += y; } return RubyFloat.newFloat(getRuntime(), mod); }
public RubyNumeric op_mod(IRubyObject num) { RubyNumeric other = numericValue(num); // Modelled after c ruby implementation (java /,% not same as ruby) double x = getDoubleValue(); double y = other.getDoubleValue(); double mod = x % y; if ((mod < 0 && y > 0) || (mod > 0 && y < 0)) { mod += y; } return RubyFloat.newFloat(getRuntime(), mod); }
3,233,567
public RubyNumeric op_mul(IRubyObject num) { return numericValue(num).multiplyWith(this); }
public RubyNumeric op_mul(IRubyObject num) { return numericValue(num).multiplyWith(this); }
3,233,568
public RubyNumeric op_plus(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() + other.getDoubleValue()); }
public RubyNumeric op_plus(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), getDoubleValue() + other.getDoubleValue()); }
3,233,569
public RubyNumeric op_pow(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), Math.pow(getDoubleValue(), other.getDoubleValue())); }
public RubyNumeric op_pow(IRubyObject num) { RubyNumeric other = numericValue(num); return RubyFloat.newFloat(getRuntime(), Math.pow(getDoubleValue(), other.getDoubleValue())); }
3,233,570
public static Criteria buildPixelsCriteria(int imageID) { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("default_pixels"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels", "SizeX"); criteria.addWantedField("default_pixels", "SizeY"); criteria.addWantedField("default_pixels", "SizeZ"); criteria.addWantedField("default_pixels", "SizeC"); criteria.addWantedField("default_pixels", "SizeT"); criteria.addWantedField("default_pixels", "PixelType"); criteria.addWantedField("default_pixels", "Repository"); criteria.addWantedField("default_pixels", "ImageServerID"); criteria.addWantedField("default_pixels.Repository", "ImageServerURL"); criteria.addFilter("id", new Integer(imageID)); return criteria; }
public static Criteria buildPixelsCriteria(int imageID) { Criteria criteria = new Criteria(); //Specify which fields we want for the image. criteria.addWantedField("default_pixels"); //Specify which fields we want for the pixels. criteria.addWantedField("default_pixels", "SizeX"); criteria.addWantedField("default_pixels", "SizeY"); criteria.addWantedField("default_pixels", "SizeZ"); criteria.addWantedField("default_pixels", "SizeC"); criteria.addWantedField("default_pixels", "SizeT"); criteria.addWantedField("default_pixels", "PixelType"); criteria.addWantedField("default_pixels", "Repository"); criteria.addWantedField("default_pixels", "ImageServerID"); criteria.addWantedField("default_pixels.Repository", "ImageServerURL"); criteria.addFilter("id", new Integer(imageID)); return criteria; }
3,233,571
private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, Res.getString("cancel")); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Dialog", Font.BOLD, 10)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); }
private void decorateCancelButton() { cancelButton.setVisible(false); ResourceUtils.resButton(cancelButton, Res.getString("cancel")); cancelButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); cancelButton.setForeground(new Color(73, 113, 196)); cancelButton.setFont(new Font("Dialog", Font.BOLD, 11)); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelTransfer(); } }); cancelButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); }
3,233,572
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 11)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
3,233,573
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 10)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
private void transferDone(final FileTransferRequest request, FileTransfer transfer) { cancelButton.setVisible(false); showAlert(true); String bareJID = StringUtils.parseBareAddress(request.getRequestor()); ContactList contactList = SparkManager.getWorkspace().getContactList(); ContactItem contactItem = contactList.getContactItemByJID(bareJID); titleLabel.setText(Res.getString("message.received.file", contactItem.getNickname())); fileLabel.setText(request.getFileName()); remove(acceptLabel); remove(declineLabel); remove(progressBar); final TransferButton openFileButton = new TransferButton(); final TransferButton openFolderButton = new TransferButton(); add(openFileButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); add(openFolderButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 0, 0)); Downloads downloads = Downloads.getInstance(); final File downloadedFile = new File(downloads.getDownloadDirectory(), request.getFileName()); openFileButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFileButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); openFolderButton.addMouseListener(new MouseAdapter() { public void mouseEntered(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); } public void mouseExited(MouseEvent e) { openFolderButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); } }); add(fileLabel, new GridBagConstraints(1, 1, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0)); ResourceUtils.resButton(openFileButton, Res.getString("open")); ResourceUtils.resButton(openFolderButton, Res.getString("open.folder")); openFileButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFileButton.setForeground(new Color(73, 113, 196)); openFileButton.setFont(new Font("Dialog", Font.BOLD, 10)); openFolderButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(73, 113, 196))); openFolderButton.setForeground(new Color(73, 113, 196)); openFolderButton.setFont(new Font("Dialog", Font.BOLD, 11)); imageLabel.setIcon(GraphicUtils.getIcon(downloadedFile)); imageLabel.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent e) { showPopup(e, downloadedFile); } public void mouseReleased(MouseEvent e) { showPopup(e, downloadedFile); } }); openFileButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { openFile(downloadedFile); } }); openFolderButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { try { Downloads downloads = Downloads.getInstance(); if (!Spark.isMac()) { try { Desktop.open(downloads.getDownloadDirectory()); } catch (DesktopException e) { Log.error(e); } } else if (Spark.isMac()) { Runtime.getRuntime().exec("open " + downloads.getDownloadDirectory().getCanonicalPath()); } } catch (IOException e1) { Log.error(e1); } } }); if (isImage(downloadedFile.getName())) { try { URL imageURL = downloadedFile.toURL(); ImageIcon image = new ImageIcon(imageURL); image = GraphicUtils.scaleImageIcon(image, 64, 64); imageLabel.setIcon(image); } catch (MalformedURLException e) { Log.error("Could not locate image.", e); imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32)); } } invalidate(); validate(); repaint(); }
3,233,574
public HashMap getChainExecutionsByChainID() { return executionsByChain; }
public LinkedHashMap getChainExecutionsByChainID() { return executionsByChain; }
3,233,577
public HashMap getChainExecutionsByDatasetID() { return (HashMap) getSource(); }
public HashMap getChainExecutionsByDatasetID() { return (HashMap) getSource(); }
3,233,578
public HashMap getExecutionsByID() { return executionsByID; }
public LinkedHashMap getExecutionsByID() { return executionsByID; }
3,233,579
public RubyString inspect() { //FIXME this two strings should be built only once, at leas only once //per instance no matter how many calls to inspect and maybe better once //per ruby interpreter. //Benoit final String sep = ", "; final String arrow = "=>"; final StringBuffer sb = new StringBuffer('{'); valueMap.foreach(new RubyMapMethod() { boolean firstEntry = true; public int execute(Object key, Object value, Object arg) { // RubyString str = RubyString.stringValue((RubyObject) arg); if (!firstEntry) { sb.append(sep); } sb.append(((RubyObject) key).funcall("inspect")); sb.append(arrow); sb.append(((RubyObject) value).funcall("inspect")); firstEntry = false; return RubyMapMethod.CONTINUE; } }, null); sb.append("}"); return RubyString.newString(ruby, sb.toString()); }
public RubyString inspect() { //FIXME this two strings should be built only once, at leas only once //per instance no matter how many calls to inspect and maybe better once //per ruby interpreter. //Benoit final String sep = ", "; final String arrow = "=>"; final StringBuffer sb = new StringBuffer("{"); valueMap.foreach(new RubyMapMethod() { boolean firstEntry = true; public int execute(Object key, Object value, Object arg) { // RubyString str = RubyString.stringValue((RubyObject) arg); if (!firstEntry) { sb.append(sep); } sb.append(((RubyObject) key).funcall("inspect")); sb.append(arrow); sb.append(((RubyObject) value).funcall("inspect")); firstEntry = false; return RubyMapMethod.CONTINUE; } }, null); sb.append("}"); return RubyString.newString(ruby, sb.toString()); }
3,233,580
public static void autoJoinConferenceRoom(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return; } } final List errors = new ArrayList(); final String userPassword = password; final SwingWorker startChat = new SwingWorker() { public Object construct() { if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } return "ok"; } public void finished() { if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return; } else if (groupChat.isJoined()) { ChatManager chatManager = SparkManager.getChatManager(); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return; } } }; startChat.start(); }
public static void autoJoinConferenceRoom(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return; } } final List errors = new ArrayList(); final String userPassword = password; final SwingWorker startChat = new SwingWorker() { public Object construct() { if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } return "ok"; } public void finished() { if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return; } else if (groupChat.isJoined()) { ChatManager chatManager = SparkManager.getChatManager(); chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return; } } }; startChat.start(); }
3,233,581
public static void createPrivateConference(String serviceName, String message, String roomName, Collection jids) { final MultiUserChat chatRoom = new MultiUserChat(SparkManager.getConnection(), roomName + "@" + serviceName); final GroupChatRoom room = new GroupChatRoom(chatRoom); try { ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); chatRoom.create(chatPref.getNickname()); // Since this is a private room, make the room not public and set user as owner of the room. Form submitForm = chatRoom.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", roomName); List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); submitForm.setAnswer("muc#roomconfig_roomowners", owners); chatRoom.sendConfigurationForm(submitForm); } catch (XMPPException e1) { Log.error("Unable to send conference room chat configuration form.", e1); } ChatManager chatManager = SparkManager.getChatManager(); // Check if room already is open try { chatManager.getChatContainer().getChatRoom(room.getRoomname()); } catch (ChatRoomNotFoundException e) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } final Iterator jidsToInvite = jids.iterator(); while (jidsToInvite.hasNext()) { String jid = (String)jidsToInvite.next(); chatRoom.invite(jid, message); room.getTranscriptWindow().insertNotificationMessage("Waiting for " + jid + " to join."); } }
public static void createPrivateConference(String serviceName, String message, String roomName, Collection jids) { final MultiUserChat chatRoom = new MultiUserChat(SparkManager.getConnection(), roomName + "@" + serviceName); final GroupChatRoom room = new GroupChatRoom(chatRoom); try { ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); chatRoom.create(chatPref.getNickname()); // Since this is a private room, make the room not public and set user as owner of the room. Form submitForm = chatRoom.getConfigurationForm().createAnswerForm(); submitForm.setAnswer("muc#roomconfig_publicroom", false); submitForm.setAnswer("muc#roomconfig_roomname", roomName); List owners = new ArrayList(); owners.add(SparkManager.getSessionManager().getBareAddress()); submitForm.setAnswer("muc#roomconfig_roomowners", owners); chatRoom.sendConfigurationForm(submitForm); } catch (XMPPException e1) { Log.error("Unable to send conference room chat configuration form.", e1); } ChatManager chatManager = SparkManager.getChatManager(); // Check if room already is open try { chatManager.getChatContainer().getChatRoom(room.getRoomname()); } catch (ChatRoomNotFoundException e) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } final Iterator jidsToInvite = jids.iterator(); while (jidsToInvite.hasNext()) { String jid = (String)jidsToInvite.next(); chatRoom.invite(jid, message); room.getTranscriptWindow().insertNotificationMessage("Waiting for " + jid + " to join."); } }
3,233,582
public static GroupChatRoom enterRoomOnSameThread(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return chatRoom; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return null; } } final List errors = new ArrayList(); final String userPassword = password; if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return null; } else if (groupChat.isJoined()) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return null; } return room; }
public static GroupChatRoom enterRoomOnSameThread(final String roomName, String roomJID, String password) { ChatManager chatManager = SparkManager.getChatManager(); final MultiUserChat groupChat = new MultiUserChat(SparkManager.getConnection(), roomJID); ChatPreferences chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); final String nickname = chatPref.getNickname().trim(); try { GroupChatRoom chatRoom = (GroupChatRoom)chatManager.getChatContainer().getChatRoom(roomJID); MultiUserChat muc = chatRoom.getMultiUserChat(); if (!muc.isJoined()) { joinRoom(muc, nickname, password); } chatManager.getChatContainer().activateChatRoom(chatRoom); return chatRoom; } catch (ChatRoomNotFoundException e) { } final GroupChatRoom room = new GroupChatRoom(groupChat); room.setTabTitle(roomName); if (requiresPassword(roomJID) && password == null) { password = JOptionPane.showInputDialog(null, "Enter Room Password", "Need Password", JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(password)) { return null; } } final List errors = new ArrayList(); final String userPassword = password; if (!groupChat.isJoined()) { int groupChatCounter = 0; while (true) { groupChatCounter++; String joinName = nickname; if (groupChatCounter > 1) { joinName = joinName + groupChatCounter; } if (groupChatCounter < 10) { try { if (ModelUtil.hasLength(userPassword)) { groupChat.join(joinName, userPassword); } else { groupChat.join(joinName); } break; } catch (XMPPException ex) { int code = 0; if (ex.getXMPPError() != null) { code = ex.getXMPPError().getCode(); } if (code == 0) { errors.add("No response from server."); } else if (code == 401) { errors.add("The password did not match the room's password."); } else if (code == 403) { errors.add("You have been banned from this room."); } else if (code == 404) { errors.add("The room you are trying to enter does not exist."); } else if (code == 407) { errors.add("You are not a member of this room.\nThis room requires you to be a member to join."); } else if (code != 409) { break; } } } else { break; } } } if (errors.size() > 0) { String error = (String)errors.get(0); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), error, "Unable to join the room at this time.", JOptionPane.ERROR_MESSAGE); return null; } else if (groupChat.isJoined()) { chatManager.getChatContainer().addChatRoom(room); chatManager.getChatContainer().activateChatRoom(room); } else { JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Unable to join the room.", "Error", JOptionPane.ERROR_MESSAGE); return null; } return room; }
3,233,583
public void joinRoom(final String roomJID, final String roomName) { final ChatPreferences pref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); // Set default nickname nicknameField.setText(pref.getNickname()); // Enable password field if a password is required passwordField.setVisible(false); passwordLabel.setVisible(false); roomNameDescription.setText(roomName); final JOptionPane pane; TitlePanel titlePanel; // Create the title panel for this dialog titlePanel = new TitlePanel("Join Conference Room", "Specify information for conference room.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); // The user should only be able to close this dialog. Object[] options = {"Join", "Cancel"}; pane = new JOptionPane(this, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); final JOptionPane p = new JOptionPane(); final JDialog dlg = p.createDialog(SparkManager.getMainWindow(), "Conference Rooms"); dlg.setModal(false); dlg.pack(); dlg.setSize(350, 250); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(SparkManager.getMainWindow()); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String value = (String)pane.getValue(); if ("Cancel".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); } else if ("Join".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); ConferenceUtils.autoJoinConferenceRoom(roomName, roomJID, null); } } }; pane.addPropertyChangeListener(changeListener); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); SwingWorker worker = new SwingWorker() { boolean requiresPassword; public Object construct() { requiresPassword = ConferenceUtils.requiresPassword(roomJID); return new Boolean(requiresPassword); } public void finished() { passwordField.setVisible(requiresPassword); passwordLabel.setVisible(requiresPassword); } }; worker.start(); }
public void joinRoom(final String roomJID, final String roomName) { final LocalPreferences pref = SettingsManager.getLocalPreferences(); // Set default nickname nicknameField.setText(pref.getNickname()); // Enable password field if a password is required passwordField.setVisible(false); passwordLabel.setVisible(false); roomNameDescription.setText(roomName); final JOptionPane pane; TitlePanel titlePanel; // Create the title panel for this dialog titlePanel = new TitlePanel("Join Conference Room", "Specify information for conference room.", SparkRes.getImageIcon(SparkRes.BLANK_IMAGE), true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); // The user should only be able to close this dialog. Object[] options = {"Join", "Cancel"}; pane = new JOptionPane(this, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); final JOptionPane p = new JOptionPane(); final JDialog dlg = p.createDialog(SparkManager.getMainWindow(), "Conference Rooms"); dlg.setModal(false); dlg.pack(); dlg.setSize(350, 250); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(SparkManager.getMainWindow()); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String value = (String)pane.getValue(); if ("Cancel".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); } else if ("Join".equals(value)) { pane.setValue(JOptionPane.UNINITIALIZED_VALUE); dlg.dispose(); ConferenceUtils.autoJoinConferenceRoom(roomName, roomJID, null); } } }; pane.addPropertyChangeListener(changeListener); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); SwingWorker worker = new SwingWorker() { boolean requiresPassword; public Object construct() { requiresPassword = ConferenceUtils.requiresPassword(roomJID); return new Boolean(requiresPassword); } public void finished() { passwordField.setVisible(requiresPassword); passwordLabel.setVisible(requiresPassword); } }; worker.start(); }
3,233,584
public TreeView getTreeView() { int state = model.getState(); if (state != LOADING_THUMBNAILS && state != READY) throw new IllegalStateException( "This method can only be invoked in the LOADING_THUMBNAILS "+ "or READY state."); return model.getTreeView(); }
public TreeView getTreeView() { int state = model.getState(); if (state != LOADING_THUMBNAILS && state != READY) throw new IllegalStateException( "This method can only be invoked in the LOADING_THUMBNAILS "+ "or READY state."); TreeView treeView = model.getTreeView(); if (treeView == null) { model.createTreeView(); treeView = model.getTreeView(); treeView.addPropertyChangeListener(controller); } return treeView; }
3,233,585
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,586
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { propName = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,587
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,588
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), propName)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,589
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextPropValue = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,590
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { propName = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,591
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(propName); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,592
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextPropValue = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,593
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,594
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextPropValue = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,595
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextPropValue = acc.get(instance, propName); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,596
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,597
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,598
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( propName, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( propName, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,599
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if ( start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,600
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
3,233,601
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextProp; } }
public Object getProperty (final Context context, final Object instance, final Object[] names, int start, int end) throws PropertyException { String prop; Object nextProp = null; Accessor acc = null; if (names[start] instanceof String) { prop = (String) names[start]; } else if (names[start] instanceof PropertyMethod) { PropertyMethod pm = (PropertyMethod) names[start]; prop = pm.getName(); acc = (Accessor) _directAccessors.get(prop); Object[] args = pm.getArguments(context); if (acc == null) { if (isMethodRestricted(instance.getClass(), prop)) throw new PropertyException.RestrictedMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } try { nextProp = acc.get(instance, args); start++; } catch (NoSuchMethodException e) { throw new PropertyException.NoSuchMethodException( pm.toString(), fillInName(names, start), instance.getClass().getName()); } } else { prop = names[start].toString(); } // unary? if (acc == null) { acc = (Accessor) _unaryAccessors.get(prop); if (acc != null) { try { nextProp = acc.get(instance); start++; } catch (NoSuchMethodException e) { acc = null; } } } // binary? if (acc == null) { acc = (Accessor) _binaryAccessors.get(prop); if ((acc != null) && ((start + 1) <= end)) { try { nextProp = acc.get(instance, (String) names[start + 1]); start += 2; } catch (NoSuchMethodException e) { acc = null; } catch (ClassCastException e) { // names[start + 1] was not a String, just move on // this catch is more efficient than using instanceof // since 90% of the time it really will be a string acc = null; } } else { acc = null; } } // hash? if (acc == null) { acc = _hashAccessor; try { if (acc != null) { nextProp = acc.get(instance, prop); start++; } } catch (NoSuchMethodException e) { acc = null; } } if (acc == null) { // user tried to access a property of a property that doesn't exist // ex: $TestObject.FirstName.NotThere // check if object is restricted if (isMethodRestricted(instance.getClass(), "get" + prop) || isMethodRestricted(instance.getClass(), "set" + prop)) throw new PropertyException.RestrictedPropertyException( prop, fillInName(names, start), instance.getClass().getName()); throw new PropertyException.NoSuchPropertyException( prop, fillInName(names, start), instance.getClass().getName()); } if (start <= end) { try { return _cache.getOperator(nextProp) .getProperty(context, nextProp, names, start, end); } catch (NullPointerException e) { // $Foo.getNull().SomeProperty is what makes this happen throw new PropertyException("$" + fillInName(names, start) + " is null. Cannot access ." + names[end]); } } else { return nextPropValue; } }
3,233,602
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int parentPos = names.length - 1; int binPos = parentPos - 1; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
public boolean setProperty (Context context, Object instance, Object[] names, Object value, int pos) throws PropertyException, NoSuchMethodException { // names[pos] is what we could set from here int parentPos = names.length - 1; int binPos = parentPos - 1; // if we're not yet at the binary-settable parent, go there if (pos < binPos) { Object grandparent = getProperty(context, instance, names, pos, binPos - 1); PropertyOperator po = _cache.getOperator(grandparent); return po.setProperty(context, grandparent, names, value, binPos); } // if we're at the binary-settable parent, try direct first if (pos == binPos) { // try direct -- move to direct parent and try from there Object parent = null; try { parent = getProperty(context, instance, names, pos, pos); if (parent != null) { PropertyOperator po = _cache.getOperator(parent); if (po.setProperty(context, parent, names, value, pos + 1)) { return true; } } } catch (NoSuchMethodException e) { // oh well, keep trying: XXX this makes binOp expensive } // if direct failed, try binary Accessor binOp = (Accessor) _binaryAccessors.get(names[pos]); if (binOp != null) { try { return binOp.set(instance, (String) names[pos + 1], value); } catch (ClassCastException e) { // names[pos+1] was not a string, just move on return false; } catch (NoSuchMethodException e) { return false; } } return false; } // we're the direct parent, use unaryOp or hash method Accessor unaryOp = (Accessor) _unaryAccessors.get(names[pos]); try { if ((unaryOp != null) && unaryOp.set(instance, value)) { return true; } if (_hashAccessor != null) { return _hashAccessor.set(instance, (String) names[pos], value); } } catch (NoSuchMethodException e) { // fall through } catch (ClassCastException e) { // names[pos] was not a string, fall through } return false; }
3,233,603
public void mouseMoved(MouseEvent e) { if(e != null){ mouseEvent = e; } if(!canShowPopup){ return; } int loc = list.locationToIndex(e.getPoint()); Point point = list.indexToLocation(loc); ContactItem item = (ContactItem)model.getElementAt(loc); if (item == null || item.getFullJID() == null) { return; } if (activeItem != null && activeItem == item) { return; } activeItem = item; window.setVisible(false); window = new JWindow(); window.setFocusableWindowState(false); ContactInfo info = new ContactInfo(item); window.getContentPane().add(info); window.pack(); info.setBorder(BorderFactory.createEtchedBorder()); Point mainWindowLocation = SparkManager.getMainWindow().getLocationOnScreen(); Point listLocation = list.getLocationOnScreen(); int x = (int)mainWindowLocation.getX() + SparkManager.getMainWindow().getWidth(); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if ((int)screenSize.getWidth() - 250 >= x) { window.setLocation(x, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } else { window.setLocation((int)mainWindowLocation.getX() - 250, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } }
public void mouseMoved(MouseEvent e) { if(e != null){ mouseEvent = e; } if(!canShowPopup){ return; } int loc = list.locationToIndex(e.getPoint()); Point point = list.indexToLocation(loc); ContactItem item = (ContactItem)model.getElementAt(loc); if (item == null || item.getFullJID() == null) { return; } if (activeItem != null && activeItem == item) { return; } activeItem = item; window.dispose(); window = new JWindow(); window.setFocusableWindowState(false); ContactInfo info = new ContactInfo(item); window.getContentPane().add(info); window.pack(); info.setBorder(BorderFactory.createEtchedBorder()); Point mainWindowLocation = SparkManager.getMainWindow().getLocationOnScreen(); Point listLocation = list.getLocationOnScreen(); int x = (int)mainWindowLocation.getX() + SparkManager.getMainWindow().getWidth(); final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); if ((int)screenSize.getWidth() - 250 >= x) { window.setLocation(x, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } else { window.setLocation((int)mainWindowLocation.getX() - 250, (int)listLocation.getY() + (int)point.getY()); window.setVisible(true); } }
3,233,605
ViewerUIF(ViewerCtrl control, Registry registry, PixelsDimensions pxsDims, int defaultT, int defaultZ) { super("", registry.getTaskBar()); active = false; this.control = control; im = IconManager.getInstance(registry); int maxT = pxsDims.sizeT-1; int maxZ = pxsDims.sizeZ-1; setJMenuBar(createMenuBar(maxZ, maxT)); toolBar = new ToolBar(control, registry, maxT, defaultT, maxZ, defaultZ); initSliders(maxT, defaultT, maxZ, defaultZ); buildGUI(); }
ViewerUIF(ViewerCtrl control, Registry registry, PixelsDimensions pxsDims, int defaultT, int defaultZ) { super("", registry.getTaskBar()); active = false; this.control = control; im = IconManager.getInstance(registry); int maxT = pxsDims.sizeT-1; int maxZ = pxsDims.sizeZ-1; setJMenuBar(createMenuBar(maxZ, maxT)); toolBar = new ToolBar(control, registry, maxT, defaultT, maxZ, defaultZ); initSliders(maxT, defaultT, maxZ, defaultZ); buildGUI(); }
3,233,607
void setDefaultZT(int t, int z, int sizeT, int sizeZ) { ToolBarManager tbm = toolBar.getManager(); tbm.onTChange(t); tbm.onZChange(z); int maxZ = sizeZ-1; int maxT = sizeT-1; tbm.setMaxT(maxT); tbm.setMaxZ(maxZ); toolBar.getZLabel().setText("/"+maxZ); toolBar.getTLabel().setText("/"+maxT); resetSliders(maxT, t, maxZ, z); boolean bT = false, bZ = false; if (maxT != 0) bT = true; if (maxZ != 0) bZ = true; toolBar.getTField().setEditable(bT); toolBar.getZField().setEditable(bZ); toolBar.getViewer3D().setEnabled(bZ); viewer3DItem.setEnabled(bZ); if (bZ && bT) movieItem.setEnabled(true); }
voidsetDefaultZT(intt,intz,intsizeT,intsizeZ){ToolBarManagertbm=toolBar.getManager();tbm.onTChange(t);tbm.onZChange(z);intmaxZ=sizeZ-1;intmaxT=sizeT-1;tbm.setMaxT(maxT);tbm.setMaxZ(maxZ);toolBar.getZLabel().setText("/"+maxZ);toolBar.getTLabel().setText("/"+maxT);resetSliders(maxT,t,maxZ,z);booleanbT=false,bZ=false;if(maxT!=0)bT=true;if(maxZ!=0)bZ=true;toolBar.getTField().setEditable(bT);toolBar.getZField().setEditable(bZ);toolBar.getViewer3D().setEnabled(bZ);viewer3DItem.setEnabled(bZ);if(bZ&&bT)movieItem.setEnabled(true);}
3,233,609
void setDefaultZT(int t, int z, int sizeT, int sizeZ) { ToolBarManager tbm = toolBar.getManager(); tbm.onTChange(t); tbm.onZChange(z); int maxZ = sizeZ-1; int maxT = sizeT-1; tbm.setMaxT(maxT); tbm.setMaxZ(maxZ); toolBar.getZLabel().setText("/"+maxZ); toolBar.getTLabel().setText("/"+maxT); resetSliders(maxT, t, maxZ, z); boolean bT = false, bZ = false; if (maxT != 0) bT = true; if (maxZ != 0) bZ = true; toolBar.getTField().setEditable(bT); toolBar.getZField().setEditable(bZ); toolBar.getViewer3D().setEnabled(bZ); viewer3DItem.setEnabled(bZ); if (bZ && bT) movieItem.setEnabled(true); }
voidsetDefaultZT(intt,intz,intsizeT,intsizeZ){ToolBarManagertbm=toolBar.getManager();tbm.onTChange(t);tbm.onZChange(z);intmaxZ=sizeZ-1;intmaxT=sizeT-1;tbm.setMaxT(maxT);tbm.setMaxZ(maxZ);toolBar.getZLabel().setText("/"+maxZ);toolBar.getTLabel().setText("/"+maxT);resetSliders(maxT,t,maxZ,z);booleanbT=false,bZ=false;if(maxT!=0)bT=true;if(maxZ!=0)bZ=true;toolBar.getTField().setEditable(bT);toolBar.getZField().setEditable(bZ);toolBar.getViewer3D().setEnabled(bZ);viewer3DItem.setEnabled(bZ);if(bZ&&bT)movieItem.setEnabled(true);}
3,233,610
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject result = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N:/* PUSH_TAG(PROT_NONE); switch (state = EXEC_TAG()) { case 0: opt_n_next: while (!NIL_P(rb_gets())) { opt_n_redo: rb_eval(self, node->nd_body); } break; case TAG_REDO: state = 0; goto opt_n_redo; case TAG_NEXT: state = 0; goto opt_n_next; case TAG_BREAK: state = 0; default: break; } POP_TAG(); if (state) JUMP_TAG(state); RETURN(Qnil);*/ return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: while (true) { BLOCK _block = PUSH_BLOCK(node.nd_var(), node.nd_body(), self); try { rubyIter.push(Iter.ITER_PRE); if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = _block.flags &= ~BLOCK_D_SCOPE; BLOCK tmp_block = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_iter()); END_CALLARGS(tmp_block); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } rubyIter.pop(); break; } catch (RetryException rExcptn) { POP_BLOCK(_block); } catch (ReturnException rExcptn) { POP_BLOCK(_block); result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { POP_BLOCK(_block); result = ruby.getNil(); break; } } return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { if (RTEST(rb_eval(self, node->nd_beg))) { ruby_scope->local_vars[node->nd_cnt] = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue; result = Qtrue; } else { result = Qfalse; } } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_FLIP3: /* like SED */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse; ruby_scope->local_vars[node->nd_cnt] = result; } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; BLOCK tmpBlock = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: /*NODE saved_cref = null; FRAME frame = ruby_frame; frame.tmp = ruby_frame; ruby_frame = frame; PUSH_SCOPE(); PUSH_TAG(PROT_NONE); if (node->nd_rval) { saved_cref = ruby_cref; ruby_cref = (NODE*)node->nd_rval; ruby_frame->cbase = node->nd_rval; }*/ if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); }/* if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_next); } POP_TAG(); POP_SCOPE(); ruby_frame = frame.tmp; if (saved_cref) ruby_cref = saved_cref; if (state) JUMP_TAG(state); } break; */ case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // rom.rb_funcall2(recv, node.nd_next().nd_aid(), 1, &val); return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: RubyModule rubyClass = (RubyModule)eval(self, node.nd_head());/* switch (TYPE(klass)) { case T_CLASS: case T_MODULE: break; default: return rom.rb_funcall(klass, node.nd_mid(), 0, 0); }*/ return rubyClass.getConstant((RubyId)node.nd_mid()); case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH:/* RubyHash hash = RubyHash.m_newHash(); RubyObject key, val; NODE list = node.nd_head(); while (list != null) { key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { rom.rb_bug("odd number list for Hash"); } val = eval(self, list.nd_head()); list = list.nd_next(); hash.aset(key, val); } return hash;*/ case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: RubyArray ary = (RubyArray)RubyArray.m_newArray(getRuby(), node.nd_alen()); for (int i = 0; node != null ; node = node.nd_next()) { ary.getArray().set(i++, eval(self, node.nd_head())); } return ary; case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { // ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: //rb_alias_variable(node.nd_new(), node.nd_old()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject result = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N:/* PUSH_TAG(PROT_NONE); switch (state = EXEC_TAG()) { case 0: opt_n_next: while (!NIL_P(rb_gets())) { opt_n_redo: rb_eval(self, node->nd_body); } break; case TAG_REDO: state = 0; goto opt_n_redo; case TAG_NEXT: state = 0; goto opt_n_next; case TAG_BREAK: state = 0; default: break; } POP_TAG(); if (state) JUMP_TAG(state); RETURN(Qnil);*/ return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: while (true) { BLOCK _block = PUSH_BLOCK(node.nd_var(), node.nd_body(), self); try { rubyIter.push(Iter.ITER_PRE); if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = _block.flags &= ~BLOCK_D_SCOPE; BLOCK tmp_block = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_iter()); END_CALLARGS(tmp_block); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } rubyIter.pop(); break; } catch (RetryException rExcptn) { POP_BLOCK(_block); } catch (ReturnException rExcptn) { POP_BLOCK(_block); result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { POP_BLOCK(_block); result = ruby.getNil(); break; } } return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { if (RTEST(rb_eval(self, node->nd_beg))) { ruby_scope->local_vars[node->nd_cnt] = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue; result = Qtrue; } else { result = Qfalse; } } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_FLIP3: /* like SED */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse; ruby_scope->local_vars[node->nd_cnt] = result; } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; BLOCK tmpBlock = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: /*NODE saved_cref = null; FRAME frame = ruby_frame; frame.tmp = ruby_frame; ruby_frame = frame; PUSH_SCOPE(); PUSH_TAG(PROT_NONE); if (node->nd_rval) { saved_cref = ruby_cref; ruby_cref = (NODE*)node->nd_rval; ruby_frame->cbase = node->nd_rval; }*/ if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); }/* if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_next); } POP_TAG(); POP_SCOPE(); ruby_frame = frame.tmp; if (saved_cref) ruby_cref = saved_cref; if (state) JUMP_TAG(state); } break; */ case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // rom.rb_funcall2(recv, node.nd_next().nd_aid(), 1, &val); return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: RubyModule rubyClass = (RubyModule)eval(self, node.nd_head());/* switch (TYPE(klass)) { case T_CLASS: case T_MODULE: break; default: return rom.rb_funcall(klass, node.nd_mid(), 0, 0); }*/ return rubyClass.getConstant((RubyId)node.nd_mid()); case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH:/* RubyHash hash = RubyHash.m_newHash(); RubyObject key, val; NODE list = node.nd_head(); while (list != null) { key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { rom.rb_bug("odd number list for Hash"); } val = eval(self, list.nd_head()); list = list.nd_next(); hash.aset(key, val); } return hash;*/ case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: RubyArray ary = (RubyArray)RubyArray.m_newArray(getRuby(), node.nd_alen()); for (int i = 0; node != null ; node = node.nd_next()) { ary.getArray().set(i++, eval(self, node.nd_head())); } return ary; case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { // ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: //rb_alias_variable(node.nd_new(), node.nd_old()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
3,233,611
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject result = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N:/* PUSH_TAG(PROT_NONE); switch (state = EXEC_TAG()) { case 0: opt_n_next: while (!NIL_P(rb_gets())) { opt_n_redo: rb_eval(self, node->nd_body); } break; case TAG_REDO: state = 0; goto opt_n_redo; case TAG_NEXT: state = 0; goto opt_n_next; case TAG_BREAK: state = 0; default: break; } POP_TAG(); if (state) JUMP_TAG(state); RETURN(Qnil);*/ return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: while (true) { BLOCK _block = PUSH_BLOCK(node.nd_var(), node.nd_body(), self); try { rubyIter.push(Iter.ITER_PRE); if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = _block.flags &= ~BLOCK_D_SCOPE; BLOCK tmp_block = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_iter()); END_CALLARGS(tmp_block); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } rubyIter.pop(); break; } catch (RetryException rExcptn) { POP_BLOCK(_block); } catch (ReturnException rExcptn) { POP_BLOCK(_block); result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { POP_BLOCK(_block); result = ruby.getNil(); break; } } return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { if (RTEST(rb_eval(self, node->nd_beg))) { ruby_scope->local_vars[node->nd_cnt] = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue; result = Qtrue; } else { result = Qfalse; } } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_FLIP3: /* like SED */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse; ruby_scope->local_vars[node->nd_cnt] = result; } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; BLOCK tmpBlock = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: /*NODE saved_cref = null; FRAME frame = ruby_frame; frame.tmp = ruby_frame; ruby_frame = frame; PUSH_SCOPE(); PUSH_TAG(PROT_NONE); if (node->nd_rval) { saved_cref = ruby_cref; ruby_cref = (NODE*)node->nd_rval; ruby_frame->cbase = node->nd_rval; }*/ if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); }/* if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_next); } POP_TAG(); POP_SCOPE(); ruby_frame = frame.tmp; if (saved_cref) ruby_cref = saved_cref; if (state) JUMP_TAG(state); } break; */ case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // rom.rb_funcall2(recv, node.nd_next().nd_aid(), 1, &val); return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: RubyModule rubyClass = (RubyModule)eval(self, node.nd_head());/* switch (TYPE(klass)) { case T_CLASS: case T_MODULE: break; default: return rom.rb_funcall(klass, node.nd_mid(), 0, 0); }*/ return rubyClass.getConstant((RubyId)node.nd_mid()); case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH:/* RubyHash hash = RubyHash.m_newHash(); RubyObject key, val; NODE list = node.nd_head(); while (list != null) { key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { rom.rb_bug("odd number list for Hash"); } val = eval(self, list.nd_head()); list = list.nd_next(); hash.aset(key, val); } return hash;*/ case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: RubyArray ary = (RubyArray)RubyArray.m_newArray(getRuby(), node.nd_alen()); for (int i = 0; node != null ; node = node.nd_next()) { ary.getArray().set(i++, eval(self, node.nd_head())); } return ary; case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { // ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); ruby_class.funcall(getRuby().intern("method_added"), ((RubyId)node.nd_mid()).toSymbol()); return getRuby().getNil(); case NODE_VALIAS: //rb_alias_variable(node.nd_new(), node.nd_old()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
public RubyObject eval(RubyObject self, NODE n) { NODE node = n; RubyBoolean cond = null; RubyObject[] args = null; RubyObject result = null; // int state; // RubyOriginalMethods rom = getRuby().getOriginalMethods(); while (true) { if (node == null) { return getRuby().getNil(); } switch (node.nd_type()) { case NODE_BLOCK: while (node.nd_next() != null) { eval(self, node.nd_head()); node = node.nd_next(); } node = node.nd_head(); break; case NODE_POSTEXE: // rb_f_END(); node.nd_set_type(NODE_NIL); /* exec just once */ return getRuby().getNil(); /* begin .. end without clauses */ case NODE_BEGIN: node = node.nd_body(); break; /* nodes for speed-up(default match) */ case NODE_MATCH: //return rom.rb_reg_match2(node.nd_head().nd_lit()); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH2: //return rom.rb_reg_match(eval(node.nd_recv()), eval(node.nd_value())); return getRuby().getNil(); /* nodes for speed-up(literal match) */ case NODE_MATCH3: //VALUE r = eval(node.nd_recv()); //VALUE l = eval(node.nd_value()); //if (r instanceof RubyString) { // return rom.rb_reg_match(l, r); //} else { // return rom.rb_funcall(r, match, 1, l); //} return getRuby().getNil(); /* node for speed-up(top-level loop for -n/-p) */ case NODE_OPT_N:/* PUSH_TAG(PROT_NONE); switch (state = EXEC_TAG()) { case 0: opt_n_next: while (!NIL_P(rb_gets())) { opt_n_redo: rb_eval(self, node->nd_body); } break; case TAG_REDO: state = 0; goto opt_n_redo; case TAG_NEXT: state = 0; goto opt_n_next; case TAG_BREAK: state = 0; default: break; } POP_TAG(); if (state) JUMP_TAG(state); RETURN(Qnil);*/ return getRuby().getNil(); case NODE_SELF: return self; case NODE_NIL: return getRuby().getNil(); case NODE_TRUE: return getRuby().getTrue(); case NODE_FALSE: return getRuby().getFalse(); case NODE_IF: // ruby_sourceline = node.nd_line(); cond = (RubyBoolean)eval(self, node.nd_cond()); if (cond.isTrue()) { node = node.nd_body(); } else { node = node.nd_else(); } break; case NODE_WHEN: while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); }*/ // ruby_sourcefile = tag.nd_file; // ruby_sourceline = tag.nd_line(); if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj = eval(self, tag.nd_head().nd_head()); if (!(obj instanceof RubyArray)) { obj = RubyArray.m_newArray(getRuby(), obj); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { if (((RubyBoolean)((RubyArray)obj).entry(i)).isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head())).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_CASE: RubyObject obj = eval(self, node.nd_head()); node = node.nd_body(); while (node != null) { NODE tag; if (node.nd_type() != NODE_WHEN) { break; } tag = node.nd_head(); while (tag != null) {/* if (trace_func) { call_trace_func("line", tag->nd_file, nd_line(tag), self, ruby_frame->last_func, ruby_frame->last_class); } ruby_sourcefile = tag->nd_file; ruby_sourceline = nd_line(tag);*/ if (tag.nd_head().nd_type() == NODE_WHEN) { RubyObject obj2 = eval(self, tag.nd_head().nd_head()); if (!(obj2 instanceof RubyArray)) { obj2 = RubyArray.m_newArray(getRuby(), obj2); } for (int i = 0; i < ((RubyArray)obj).length(); i++) { RubyBoolean eqq = (RubyBoolean)((RubyArray)obj2).entry(i).funcall(getRuby().intern("==="), obj); if (eqq.isTrue()) { node = node.nd_body(); break; } } tag = tag.nd_next(); continue; } if (((RubyBoolean)eval(self, tag.nd_head()).funcall(getRuby().intern("==="), obj)).isTrue()) { node = node.nd_body(); break; } tag = tag.nd_next(); } node = node.nd_next(); } return getRuby().getNil(); case NODE_WHILE: while (eval(self, node.nd_cond()).isTrue()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_UNTIL: while (eval(self, node.nd_cond()).isFalse()) { while (true) { try { eval(self, node.nd_body()); break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { break; } catch (BreakException bExcptn) { return getRuby().getNil(); } } } return getRuby().getNil(); case NODE_BLOCK_PASS: //return block_pass(node); return null; case NODE_ITER: case NODE_FOR: while (true) { BLOCK _block = PUSH_BLOCK(node.nd_var(), node.nd_body(), self); try { rubyIter.push(Iter.ITER_PRE); if (node.nd_type() == NODE_ITER) { result = eval(self, node.nd_iter()); } else { // String file = // int line = _block.flags &= ~BLOCK_D_SCOPE; BLOCK tmp_block = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_iter()); END_CALLARGS(tmp_block); // = file; // = line; result = recv.getRubyClass().call(recv, ruby.intern("each"), null, 0); } rubyIter.pop(); break; } catch (RetryException rExcptn) { POP_BLOCK(_block); } catch (ReturnException rExcptn) { POP_BLOCK(_block); result = rExcptn.getReturnValue(); break; } catch (BreakException bExcptn) { POP_BLOCK(_block); result = ruby.getNil(); break; } } return result; case NODE_BREAK: throw new BreakException(); case NODE_NEXT: throw new NextException(); case NODE_REDO: throw new RedoException(); case NODE_RETRY: throw new RetryException(); case NODE_RESTARGS: result = eval(self, node.nd_head()); if (!(result instanceof RubyArray)) { result = obj = RubyArray.m_newArray(getRuby(), result); } return result; case NODE_YIELD: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); if (node.nd_stts().nd_type() == NODE_RESTARGS && ((RubyArray)result).length() == 1) { result = ((RubyArray)result).entry(0); } } else { result = ruby.getNil(); } return yield0(result, null, null, false); case NODE_RESCUE:/* retry_entry: { volatile VALUE e_info = ruby_errinfo; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_head); } POP_TAG(); if (state == TAG_RAISE) { NODE * volatile resq = node->nd_resq; ruby_sourceline = nd_line(node); while (resq) { if (handle_rescue(self, resq)) { state = 0; PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, resq->nd_body); } POP_TAG(); if (state == TAG_RETRY) { state = 0; ruby_errinfo = Qnil; goto retry_entry; } if (state != TAG_RAISE) { ruby_errinfo = e_info; } break; } resq = resq->nd_head; /* next rescue */ /** } * } * else if (node->nd_else) { /* else clause given *//* if (!state) { /* no exception raised *//* result = rb_eval(self, node->nd_else); } } if (state) JUMP_TAG(state); } break;*/ case NODE_ENSURE:/* PUSH_TAG(PROT_NONE); if ((state = EXEC_TAG()) == 0) { result = eval(node.nd_head()); } POP_TAG(); if (node.nd_ensr()) { VALUE retval = prot_tag->retval; /* save retval *//* VALUE errinfo = ruby_errinfo; rb_eval(self, node->nd_ensr); return_value(retval); ruby_errinfo = errinfo; } if (state) JUMP_TAG(state); break;*/ case NODE_AND: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isFalse()) { return cond; } node = node.nd_2nd(); break; case NODE_OR: cond = (RubyBoolean)eval(self, node.nd_1st()); if (cond.isTrue()) { return cond; } node = node.nd_2nd(); break; case NODE_NOT: return RubyBoolean.m_newBoolean(getRuby(), eval(self, node.nd_1st()).isFalse()); case NODE_DOT2: case NODE_DOT3: result = RubyRange.m_newRange(getRuby(), eval(self, node.nd_beg()), eval(self, node.nd_end()), node.nd_type() == NODE_DOT3); if (node.nd_state() != 0) { return result; } if (node.nd_beg().nd_type() == NODE_LIT && (node.nd_beg().nd_lit() instanceof RubyFixnum) && node.nd_end().nd_type() == NODE_LIT && (node.nd_end().nd_lit() instanceof RubyFixnum)) { node.nd_set_type(NODE_LIT); node.nd_lit(result); } else { node.nd_state(1L); } return result; case NODE_FLIP2: /* like AWK */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { if (RTEST(rb_eval(self, node->nd_beg))) { ruby_scope->local_vars[node->nd_cnt] = RTEST(rb_eval(self, node->nd_end))?Qfalse:Qtrue; result = Qtrue; } else { result = Qfalse; } } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_FLIP3: /* like SED */ //RubyBoolean result;/* if (ruby_scope->local_vars == 0) { rb_bug("unexpected local variable"); } if (!RTEST(ruby_scope->local_vars[node->nd_cnt])) { result = RTEST(rb_eval(self, node->nd_beg)) ? Qtrue : Qfalse; ruby_scope->local_vars[node->nd_cnt] = result; } else { if (RTEST(rb_eval(self, node->nd_end))) { ruby_scope->local_vars[node->nd_cnt] = Qfalse; } result = Qtrue; }*/ return result; case NODE_RETURN: if (node.nd_stts() != null) { result = eval(self, node.nd_stts()); } else { result = ruby.getNil(); } throw new ReturnException(result); case NODE_ARGSCAT: return ((RubyArray)eval(self, node.nd_head())).m_concat(eval(self, node.nd_body())); case NODE_ARGSPUSH: return ((RubyArray)eval(self, node.nd_head()).m_dup()).push(eval(self, node.nd_body())); case NODE_CALL: // TMP_PROTECT; BLOCK tmpBlock = BEGIN_CALLARGS(); RubyObject recv = eval(self, node.nd_recv()); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return recv.getRubyClass().call(recv, (RubyId)node.nd_mid(), args, 0); case NODE_FCALL: // TMP_PROTECT; tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); return self.getRubyClass().call(self, (RubyId)node.nd_mid(), args, 1); case NODE_VCALL: return self.getRubyClass().call(self, (RubyId)node.nd_mid(), null, 2); case NODE_SUPER: case NODE_ZSUPER: // TMP_PROTECT; if (rubyFrame.getLastClass() == null) { throw new RubyNameException("superclass method '" + rubyFrame.getLastFunc().toName() + "' disabled"); } if (node.nd_type() == NODE_ZSUPER) { List argsList = rubyFrame.getArgs(); args = (RubyObject[])argsList.toArray(new RubyObject[argsList.size()]); } else { tmpBlock = BEGIN_CALLARGS(); args = setupArgs(self, node.nd_args()); END_CALLARGS(tmpBlock); } rubyIter.push(rubyIter.getIter() != Iter.ITER_NOT ? Iter.ITER_PRE : Iter.ITER_NOT); result = rubyFrame.getLastClass().getSuperClass().call(rubyFrame.getSelf(), rubyFrame.getLastFunc(), args, 3); rubyIter.pop(); return result; case NODE_SCOPE: /*NODE saved_cref = null; FRAME frame = ruby_frame; frame.tmp = ruby_frame; ruby_frame = frame; PUSH_SCOPE(); PUSH_TAG(PROT_NONE); if (node->nd_rval) { saved_cref = ruby_cref; ruby_cref = (NODE*)node->nd_rval; ruby_frame->cbase = node->nd_rval; }*/ if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalVars(vars); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); }/* if ((state = EXEC_TAG()) == 0) { result = rb_eval(self, node->nd_next); } POP_TAG(); POP_SCOPE(); ruby_frame = frame.tmp; if (saved_cref) ruby_cref = saved_cref; if (state) JUMP_TAG(state); } break; */ case NODE_OP_ASGN1: // TMP_PROTECT; recv = eval(self, node.nd_recv()); NODE rval = node.nd_args().nd_head(); args = setupArgs(self, node.nd_args().nd_next()); ArrayList argsList = new ArrayList(Arrays.asList(args)); argsList.remove(args.length - 1); RubyBoolean val = (RubyBoolean)recv.funcall(getRuby().intern("[]"), (RubyObject[])argsList.toArray(new RubyObject[argsList.size()])); switch (node.nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, rval); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, rval); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, rval)); } args[args.length - 1] = val; return recv.funcall(getRuby().intern("[]="), args); case NODE_OP_ASGN2: ID id = node.nd_next().nd_vid(); recv = eval(self, node.nd_recv()); val = (RubyBoolean)recv.funcall((RubyId)id, (RubyObject[])null); switch (node.nd_next().nd_mid().intValue()) { case 0: /* OR */ if (val.isTrue()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; case 1: /* AND */ if (val.isFalse()) { return val; } val = (RubyBoolean)eval(self, node.nd_value()); break; default: val = (RubyBoolean)val.funcall((RubyId)node.nd_mid(), eval(self, node.nd_value())); } // rom.rb_funcall2(recv, node.nd_next().nd_aid(), 1, &val); return val; case NODE_OP_ASGN_AND: cond = (RubyBoolean)eval(self, node.nd_head()); if (cond.isFalse()) { return cond; } node = node.nd_value(); break; case NODE_OP_ASGN_OR: cond = (RubyBoolean)eval(self, node.nd_head()); if ((node.nd_aid() != null && !self.isInstanceVarDefined((RubyId)node.nd_aid())) || cond.isFalse()) { node = node.nd_value(); break; } return cond; case NODE_MASGN: return massign(self, node, eval(self, node.nd_value()), false); case NODE_LASGN: // if (ruby.ruby_scope.local_vars == null) { // rb_bug("unexpected local variable assignment"); // } result = eval(self, node.nd_value()); getRuby().rubyScope.setLocalVars(node.nd_cnt(), result); return result; case NODE_DASGN: result = eval(self, node.nd_value()); RubyVarmap.assign(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_DASGN_CURR: result = eval(self, node.nd_value()); RubyVarmap.assignCurrent(ruby, (RubyId)node.nd_vid(), result); return result; case NODE_GASGN: result = eval(self, node.nd_value()); ((RubyGlobalEntry)node.nd_entry()).set(result); return result; case NODE_IASGN: result = eval(self, node.nd_value()); self.setInstanceVar((RubyId)node.nd_vid(), result); return result; case NODE_CDECL: if (ruby_class == null) { throw new RubyTypeException("no class/module to define constant"); } result = eval(self, node.nd_value()); ruby_class.setConstant((RubyId)node.nd_vid(), result); return result; case NODE_CVDECL: if (ruby_cbase == null) { throw new RubyTypeException("no class/module to define class variable"); } result = eval(self, node.nd_value()); if (ruby_cbase.isSingleton()) { ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().declareClassVar((RubyId)node.nd_vid(), result); return result; } ruby_cbase.declareClassVar((RubyId)node.nd_vid(), result); return result; case NODE_CVASGN: result = eval(self, node.nd_value()); self.getClassVarSingleton().setClassVar((RubyId)node.nd_vid(), result); return result; case NODE_LVAR: //if (getRuby().ruby_scope.local_vars == null) { // rb_bug("unexpected local variable"); // } return (RubyObject)getRuby().rubyScope.getLocalVars(node.nd_cnt()); case NODE_DVAR: return getDynamicVars().getRef((RubyId)node.nd_vid()); case NODE_GVAR: return ((RubyGlobalEntry)node.nd_entry()).get(); case NODE_IVAR: return self.getInstanceVar((RubyId)node.nd_vid()); case NODE_CONST: return getConstant((NODE)rubyFrame.getCbase(), (RubyId)node.nd_vid(), self); case NODE_CVAR: /* normal method */ if (ruby_cbase == null) { return self.getRubyClass().getClassVar((RubyId)node.nd_vid()); } if (!ruby_cbase.isSingleton()) { return ruby_cbase.getClassVar((RubyId)node.nd_vid()); } return ruby_cbase.getInstanceVar("__attached__").getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_CVAR2: /* singleton method */ return self.getClassVarSingleton().getClassVar((RubyId)node.nd_vid()); case NODE_BLOCK_ARG: if (ruby.rubyScope.getLocalVars() == null) { throw new RuntimeException("BUG: unexpected block argument"); } if (isBlockGiven()) { result = getRuby().getNil(); // Create Proc object ruby.rubyScope.setLocalVars(node.nd_cnt(), result); return result; } else { return getRuby().getNil(); } case NODE_COLON2: RubyModule rubyClass = (RubyModule)eval(self, node.nd_head());/* switch (TYPE(klass)) { case T_CLASS: case T_MODULE: break; default: return rom.rb_funcall(klass, node.nd_mid(), 0, 0); }*/ return rubyClass.getConstant((RubyId)node.nd_mid()); case NODE_COLON3: return getRuby().getObjectClass().getConstant((RubyId)node.nd_mid()); case NODE_NTH_REF: // return rom.rb_reg_nth_match(node.nd_nth(), MATCH_DATA); return null; case NODE_BACK_REF: /*switch ((char)node.nd_nth()) { case '&': return rom.rb_reg_last_match(MATCH_DATA); case '`': return rom.rb_reg_match_pre(MATCH_DATA); case '\'': return rom.rb_reg_match_post(MATCH_DATA); case '+': return rom.rb_reg_match_last(MATCH_DATA); default: rom.rb_bug("unexpected back-ref"); }*/ case NODE_HASH:/* RubyHash hash = RubyHash.m_newHash(); RubyObject key, val; NODE list = node.nd_head(); while (list != null) { key = eval(self, list.nd_head()); list = list.nd_next(); if (list == null) { rom.rb_bug("odd number list for Hash"); } val = eval(self, list.nd_head()); list = list.nd_next(); hash.aset(key, val); } return hash;*/ case NODE_ZARRAY: /* zero length list */ return RubyArray.m_newArray(getRuby()); case NODE_ARRAY: RubyArray ary = (RubyArray)RubyArray.m_newArray(getRuby(), node.nd_alen()); for (int i = 0; node != null ; node = node.nd_next()) { ary.getArray().set(i++, eval(self, node.nd_head())); } return ary; case NODE_STR: return ((RubyObject)node.nd_lit()).m_to_s(); case NODE_DSTR: case NODE_DXSTR: case NODE_DREGX: case NODE_DREGX_ONCE:/* NODE list = node.nd_next(); RubyString str = RubyString.m_newString(getRuby(), (RubyObject)node.nd_lit()); RubyString str2; while (list != null) { if (list.nd_head() != null) { switch (list.nd_head().nd_type()) { case NODE_STR: str2 = (RubyString)list.nd_head().nd_lit(); break; case NODE_EVSTR: result = ruby_errinfo; ruby_errinfo = Qnil; ruby_sourceline = nd_line(node); ruby_in_eval++; list.nd_head(compile(list.nd_head().nd_lit(), ruby_sourcefile,ruby_sourceline)); ruby_eval_tree = 0; ruby_in_eval--; if (ruby_nerrs > 0) { compile_error("string expansion"); } if (!NIL_P(result)) ruby_errinfo = result; /* fall through *//* default: str2 = (RubyString)rom.rb_obj_as_string(eval(list.nd_head())); break; } str.append(str2); str.infectObject(str2); } list = list.nd_next(); } switch (node.nd_type()) { case NODE_DREGX: return rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); case NODE_DREGX_ONCE: /* regexp expand once *//* VALUE result = rom.rb_reg_new(str.getString(), str.getString().length(), node.nd_cflag()); node.nd_set_type(NODE_LIT); node.nd_lit(result); return result; case NODE_DXSTR: return rom.rb_funcall(this, '`', 1, str); default: return str; }*/ return null; case NODE_XSTR: return self.funcall(getRuby().intern("`"), (RubyObject)node.nd_lit()); case NODE_LIT: return (RubyObject)node.nd_lit(); case NODE_ATTRSET: if (rubyFrame.getArgs().size() != 1) { throw new RubyArgumentException("wrong # of arguments(" + rubyFrame.getArgs().size() + "for 1)"); } return self.setInstanceVar((RubyId)node.nd_vid(), (RubyObject)rubyFrame.getArgs().get(0)); case NODE_DEFN: if (node.nd_defn() != null) { int noex; if (ruby_class == null) { throw new RubyTypeException("no class to add method"); } //if (ruby_class == getRuby().getObjectClass() && node.nd_mid() == init) { // rom.rb_warn("redefining Object#initialize may cause infinite loop"); //} //if (node.nd_mid() == __id__ || node.nd_mid() == __send__) { // rom.rb_warn("redefining `%s' may cause serious problem", ((RubyId)node.nd_mid()).toName()); //} // ruby_class.setFrozen(true); NODE body = ruby_class.searchMethod((RubyId)node.nd_mid()); RubyObject origin = ruby_class.getMethodOrigin((RubyId)node.nd_mid()); if (body != null){ // if (ruby_verbose.isTrue() && ruby_class == origin && body.nd_cnt() == 0) { // rom.rb_warning("discarding old %s", ((RubyId)node.nd_mid()).toName()); // } // if (node.nd_noex() != 0) { /* toplevel */ /* should upgrade to rb_warn() if no super was called inside? */ // rom.rb_warning("overriding global function `%s'", ((RubyId)node.nd_mid()).toName()); // } } if (isScope(SCOPE_PRIVATE) || node.nd_mid().equals(ruby.intern("initialize"))) { noex = NOEX_PRIVATE; } else if (isScope(SCOPE_PROTECTED)) { noex = NOEX_PROTECTED; } else if (ruby_class == getRuby().getObjectClass()) { noex = node.nd_noex(); } else { noex = NOEX_PUBLIC; } if (body != null && origin == ruby_class && (body.nd_noex() & NOEX_UNDEF) != 0) { noex |= NOEX_UNDEF; } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); ruby_class.addMethod((RubyId)node.nd_mid(), defn, noex); // rb_clear_cache_by_id(node.nd_mid()); if (scope_vmode == SCOPE_MODFUNC) { ruby_class.getSingletonClass().addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC); ruby_class.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } if (ruby_class.isSingleton()) { ruby_class.getInstanceVar("__attached__").funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } else { // } } return getRuby().getNil(); case NODE_DEFS: if (node.nd_defn() != null) { recv = eval(self, node.nd_recv()); if (getRuby().getSecurityLevel() >= 4 && !recv.isTaint()) { throw new RubySecurityException("Insecure; can't define singleton method"); } /*if (FIXNUM_P(recv) || SYMBOL_P(recv)) { rb_raise(rb_eTypeError, "can't define singleton method \"%s\" for %s", rb_id2name(node.nd_mid()), rb_class2name(CLASS_OF(recv))); }*/ // not needed in jruby if (recv.isFrozen()) { throw new RubyFrozenException("object"); } rubyClass = recv.getSingletonClass(); NODE body = (NODE)rubyClass.getMethods().get((RubyId)node.nd_mid()); if (body != null) { if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("redefining method prohibited"); } /*if (RTEST(ruby_verbose)) { rb_warning("redefine %s", rb_id2name(node.nd_mid())); }*/ } NODE defn = node.nd_defn().copyNodeScope(ruby_cref); defn.nd_rval(ruby_cref); rubyClass.addMethod((RubyId)node.nd_mid(), defn, NOEX_PUBLIC | (body != null ? body.nd_noex() & NOEX_UNDEF : 0)); // rb_clear_cache_by_id(node.nd_mid()); recv.funcall(getRuby().intern("singleton_method_added"), ((RubyId)node.nd_mid()).toSymbol()); } return getRuby().getNil(); case NODE_UNDEF: if (ruby_class == null) { throw new RubyTypeException("no class to undef method"); } ruby_class.undef((RubyId)node.nd_mid()); return getRuby().getNil(); case NODE_ALIAS: if (ruby_class == null) { throw new RubyTypeException("no class to make alias"); } ruby_class.aliasMethod((RubyId)node.nd_new(), (RubyId)node.nd_old()); return getRuby().getNil(); case NODE_VALIAS: //rb_alias_variable(node.nd_new(), node.nd_old()); return getRuby().getNil(); case NODE_CLASS: RubyModule superClass; if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } if (node.nd_super() != null) { superClass = getSuperClass(self, node.nd_super()); } else { superClass = null; } rubyClass = null; // if ((ruby_class == getRuby().getObjectClass()) && rb_autoload_defined(node.nd_cname())) { // rb_autoload_load(node.nd_cname()); // } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { rubyClass = (RubyClass)ruby_class.getConstant((RubyId)node.nd_cname()); } if (rubyClass != null) { if (!rubyClass.isClass()) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a class"); } if (superClass != null) { RubyModule tmp = rubyClass.getSuperClass(); if (tmp.isSingleton()) { tmp = tmp.getSuperClass(); } while (tmp.isIncluded()) { tmp = tmp.getSuperClass(); } if (tmp != superClass) { superClass = tmp; //goto override_class; } } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending class prohibited"); } // rb_clear_cache(); } else { //override_class: if (superClass == null) { superClass = getRuby().getObjectClass(); } rubyClass = getRuby().defineClassId((RubyId)node.nd_cname(), (RubyClass)superClass); ruby_class.setConstant((RubyId)node.nd_cname(), rubyClass); rubyClass.setClassPath((RubyClass)ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_MODULE: if (ruby_class == null) { throw new RubyTypeException("no outer class/module"); } RubyModule module = null; if ((ruby_class == getRuby().getObjectClass()) && getRuby().isAutoloadDefined((RubyId)node.nd_cname())) { // getRuby().rb_autoload_load(node.nd_cname()); } if (ruby_class.isConstantDefined((RubyId)node.nd_cname())) { module = (RubyModule)ruby_class.getConstant((RubyId)node.nd_cname()); } if (module != null) { if (!(module instanceof RubyModule)) { throw new RubyTypeException(((RubyId)node.nd_cname()).toName() + " is not a module"); } if (getRuby().getSecurityLevel() >= 4) { throw new RubySecurityException("extending module prohibited"); } } else { module = getRuby().defineModuleId((RubyId)node.nd_cname()); ruby_class.setConstant((RubyId)node.nd_cname(), module); module.setClassPath(ruby_class, ((RubyId)node.nd_cname()).toName()); } if (ruby_wrapper != null) { module.getSingletonClass().includeModule(ruby_wrapper); module.includeModule(ruby_wrapper); } return setupModule(module, node.nd_body()); case NODE_SCLASS: rubyClass = (RubyClass)eval(self, node.nd_recv()); if (rubyClass.isSpecialConst()) { throw new RubyTypeException("no virtual class for " + rubyClass.getRubyClass().toName()); } if (getRuby().getSecurityLevel() >= 4 && !rubyClass.isTaint()) { throw new RubySecurityException("Insecure: can't extend object"); } if (rubyClass.getRubyClass().isSingleton()) { // rb_clear_cache(); } rubyClass = rubyClass.getSingletonClass(); if (ruby_wrapper != null) { rubyClass.getSingletonClass().includeModule(ruby_wrapper); rubyClass.includeModule(ruby_wrapper); } return setupModule(rubyClass, node.nd_body()); case NODE_DEFINED: // String buf; // String desc = is_defined(self, node.nd_head(), buf); // // if (desc) { // result = rb_str_new2(desc); // } else { // result = Qnil; // } case NODE_NEWLINE: // ruby_sourcefile = node.nd_file; // ruby_sourceline = node.nd_nth(); // if (trace_func) { // call_trace_func("line", ruby_sourcefile, ruby_sourceline, self, // ruby_frame.last_func(), // ruby_frame.last_class()); // } node = node.nd_next(); break; default: // rom.rb_bug("unknown node type %d", nd_type(node)); } } }
3,233,612
protected RubyObject getConstant(NODE cref, RubyId id, RubyObject self) { NODE cbase = cref; // while (cbase != null && cbase.nd_next() != null) {// RubyObject rubyClass = (RubyObject)cbase.nd_clss();// if (rubyClass.isNil()) { return self.getRubyClass().getConstant(id);// } else if (rubyClass.getInstanceVariables().get(id) != null) {// return (RubyObject)rubyClass.getInstanceVariables().get(id);// }// cbase = cbase.nd_next();// }// return ((RubyModule)cref.nd_clss()).getConstant(id); }
while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { protected RubyObject getConstant(NODE cref, RubyId id, RubyObject self) {while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { NODE cbase = cref;while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { //while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) {//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { RubyObject rubyClass = (RubyObject)cbase.nd_clss();//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { if (rubyClass.isNil()) {while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { return self.getRubyClass().getConstant(id);//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { } else if (rubyClass.getInstanceVariables().get(id) != null) {//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { return (RubyObject)rubyClass.getInstanceVariables().get(id);//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { }//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { cbase = cbase.nd_next();//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { }//while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { return ((RubyModule)cref.nd_clss()).getConstant(id);while (cbase != null && cbase.nd_next() != null) { RubyObject rubyClass = (RubyObject)cbase.nd_clss(); if (rubyClass.isNil()) { }
3,233,614
protected RubyObject getConstant(NODE cref, RubyId id, RubyObject self) { NODE cbase = cref; // while (cbase != null && cbase.nd_next() != null) {// RubyObject rubyClass = (RubyObject)cbase.nd_clss();// if (rubyClass.isNil()) { return self.getRubyClass().getConstant(id);// } else if (rubyClass.getInstanceVariables().get(id) != null) {// return (RubyObject)rubyClass.getInstanceVariables().get(id);// }// cbase = cbase.nd_next();// }// return ((RubyModule)cref.nd_clss()).getConstant(id); }
protected RubyObject getConstant(NODE cref, RubyId id, RubyObject self) {} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); NODE cbase = cref;} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); //} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); while (cbase != null && cbase.nd_next() != null) {//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); RubyObject rubyClass = (RubyObject)cbase.nd_clss();//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); if (rubyClass.isNil()) {} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); return self.getRubyClass().getConstant(id);//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) {//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); return (RubyObject)rubyClass.getInstanceVariables().get(id);//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); }//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); } else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); cbase = cbase.nd_next();//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); }//} else if (rubyClass.getInstanceVariables().get(id) != null) { return (RubyObject)rubyClass.getInstanceVariables().get(id); } cbase = cbase.nd_next(); } return ((RubyModule)cref.nd_clss()).getConstant(id); return ((RubyModule)cref.nd_clss()).getConstant(id); }
3,233,615
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); /*if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
3,233,616
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass '" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
3,233,617
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass '" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
3,233,618
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // } // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); } // JUMP_TAG(state); } if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; } if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); } return (RubyClass)obj; }
private RubyClass getSuperClass(RubyObject self, NODE node) { RubyObject obj; int state = 1; // unreachable // PUSH_TAG(PROT_NONE); // if ((state = EXEC_TAG()) == 0 ) { obj = eval(self, node); // }*/ // POP_TAG(); if (state != 0) { switch (node.nd_type()) { case NODE_COLON2: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_mid()).toName() + "'"); case NODE_CONST: throw new RubyTypeException("undefined superclass `" + ((RubyId)node.nd_vid()).toName() + "'"); default: throw new RubyTypeException("undefined superclass"); }*/ // JUMP_TAG(state); }*/ if (!(obj instanceof RubyClass)) { throw new RuntimeException(); // goto superclass_error; }*/ if (((RubyClass)obj).isSingleton()) { throw new RubyTypeException("can't make subclass of virtual class"); }*/ return (RubyClass)obj; }
3,233,619
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; public RubyObject setupModule(RubyModule module, NODE n) {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; NODE node = n;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // String file = ruby_sourcefile;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // int line = ruby_sourceline;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // TMP_PROTECT;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // frame = ruby_frame;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // frame.tmp(ruby_frame);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // ruby_frame = frame;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // PUSH_CLASS();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby_class = module;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // PUSH_SCOPE();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; RubyVarmap.push(ruby);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; if (node.nd_tbl() != null) {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil());Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ShiftableList vars = new ShiftableList(new ArrayList(tmp));Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; vars.set(0, (VALUE)node);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; vars.shift(1);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; getRuby().rubyScope.setLocalTbl(node.nd_tbl());Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; } else {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; getRuby().rubyScope.setLocalVars(null);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; getRuby().rubyScope.setLocalTbl(null);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; }Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // PUSH_CREF(module);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; rubyFrame.setCbase((VALUE)ruby_cref);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // PUSH_TAG(PROT_NONE);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; RubyObject result = null;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // if (( state = EXEC_TAG()) == 0 ) {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // if (trace_func) {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; //Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; call_trace_func("class", file, line, ruby_class,Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; //Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; ruby_frame->last_func, ruby_frame->last_class );Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // }Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; result = eval(ruby_class, node.nd_next());Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // }Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // POP_TAG();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // POP_CREF();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; RubyVarmap.pop(ruby);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // POP_SCOPE();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // POP_CLASS();Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // ruby_frame = frame.tmp;//Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; if (trace_func) {//Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );//Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; }Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // if (state != 0) {Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; //Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; JUMP_TAG(state);Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; // }Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; return result;Frame frame = rubyFrame; frame.setTmp(rubyFrame); rubyFrame = frame; }
3,233,620
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
pushClass(); pushClass(); pushClass(); pushClass(); publicpushClass(); RubyObjectpushClass(); setupModule(RubyModulepushClass(); module,pushClass(); NODEpushClass(); n)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); NODEpushClass(); nodepushClass(); =pushClass(); n;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); StringpushClass(); filepushClass(); =pushClass(); ruby_sourcefile;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); intpushClass(); linepushClass(); =pushClass(); ruby_sourceline;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); TMP_PROTECT;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); framepushClass(); =pushClass(); ruby_frame;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); frame.tmp(ruby_frame);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ruby_framepushClass(); =pushClass(); frame;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); PUSH_CLASS();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_classpushClass(); =pushClass(); module;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); PUSH_SCOPE();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyVarmap.push(ruby);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (node.nd_tbl()pushClass(); !=pushClass(); null)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ListpushClass(); tmppushClass(); =pushClass(); Collections.nCopies(node.nd_tbl()[0].intValue()pushClass(); +pushClass(); 1,pushClass(); ruby.getNil());pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ShiftableListpushClass(); varspushClass(); =pushClass(); newpushClass(); ShiftableList(newpushClass(); ArrayList(tmp));pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); vars.set(0,pushClass(); (VALUE)node);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); vars.shift(1);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); getRuby().rubyScope.setLocalTbl(node.nd_tbl());pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); getRuby().rubyScope.setLocalVars(null);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); getRuby().rubyScope.setLocalTbl(null);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); PUSH_CREF(module);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); rubyFrame.setCbase((VALUE)ruby_cref);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); PUSH_TAG(PROT_NONE);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyObjectpushClass(); resultpushClass(); =pushClass(); null;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ifpushClass(); ((pushClass(); statepushClass(); =pushClass(); EXEC_TAG())pushClass(); ==pushClass(); 0pushClass(); )pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ifpushClass(); (trace_func)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); call_trace_func("class",pushClass(); file,pushClass(); line,pushClass(); ruby_class,pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_frame->last_func,pushClass(); ruby_frame->last_classpushClass(); );pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); resultpushClass(); =pushClass(); eval(ruby_class,pushClass(); node.nd_next());pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); POP_TAG();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); POP_CREF();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyVarmap.pop(ruby);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); POP_SCOPE();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); POP_CLASS();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ruby_framepushClass(); =pushClass(); frame.tmp;//pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (trace_func)pushClass(); {//pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); call_trace_func("end",pushClass(); file,pushClass(); line,pushClass(); 0,pushClass(); ruby_frame->last_func,pushClass(); ruby_frame->last_classpushClass(); );//pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ifpushClass(); (statepushClass(); !=pushClass(); 0)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); JUMP_TAG(state);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); returnpushClass(); result;pushClass(); pushClass(); pushClass(); pushClass(); }
3,233,621
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); publicgetRuby().rubyScope.push(); RubyObjectgetRuby().rubyScope.push(); setupModule(RubyModulegetRuby().rubyScope.push(); module,getRuby().rubyScope.push(); NODEgetRuby().rubyScope.push(); n)getRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); NODEgetRuby().rubyScope.push(); nodegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); n;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); StringgetRuby().rubyScope.push(); filegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); ruby_sourcefile;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); intgetRuby().rubyScope.push(); linegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); ruby_sourceline;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); TMP_PROTECT;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); framegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); ruby_frame;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); frame.tmp(ruby_frame);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); ruby_framegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); frame;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); PUSH_CLASS();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ruby_classgetRuby().rubyScope.push(); =getRuby().rubyScope.push(); module;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); PUSH_SCOPE();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); RubyVarmap.push(ruby);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ifgetRuby().rubyScope.push(); (node.nd_tbl()getRuby().rubyScope.push(); !=getRuby().rubyScope.push(); null)getRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ListgetRuby().rubyScope.push(); tmpgetRuby().rubyScope.push(); =getRuby().rubyScope.push(); Collections.nCopies(node.nd_tbl()[0].intValue()getRuby().rubyScope.push(); +getRuby().rubyScope.push(); 1,getRuby().rubyScope.push(); ruby.getNil());getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ShiftableListgetRuby().rubyScope.push(); varsgetRuby().rubyScope.push(); =getRuby().rubyScope.push(); newgetRuby().rubyScope.push(); ShiftableList(newgetRuby().rubyScope.push(); ArrayList(tmp));getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); vars.set(0,getRuby().rubyScope.push(); (VALUE)node);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); vars.shift(1);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.setLocalTbl(node.nd_tbl());getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); }getRuby().rubyScope.push(); elsegetRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.setLocalVars(null);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.setLocalTbl(null);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); }getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); PUSH_CREF(module);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); rubyFrame.setCbase((VALUE)ruby_cref);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); PUSH_TAG(PROT_NONE);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); RubyObjectgetRuby().rubyScope.push(); resultgetRuby().rubyScope.push(); =getRuby().rubyScope.push(); null;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); ifgetRuby().rubyScope.push(); ((getRuby().rubyScope.push(); stategetRuby().rubyScope.push(); =getRuby().rubyScope.push(); EXEC_TAG())getRuby().rubyScope.push(); ==getRuby().rubyScope.push(); 0getRuby().rubyScope.push(); )getRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); ifgetRuby().rubyScope.push(); (trace_func)getRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); call_trace_func("class",getRuby().rubyScope.push(); file,getRuby().rubyScope.push(); line,getRuby().rubyScope.push(); ruby_class,getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ruby_frame->last_func,getRuby().rubyScope.push(); ruby_frame->last_classgetRuby().rubyScope.push(); );getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); }getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); resultgetRuby().rubyScope.push(); =getRuby().rubyScope.push(); eval(ruby_class,getRuby().rubyScope.push(); node.nd_next());getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); }getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); POP_TAG();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); POP_CREF();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); RubyVarmap.pop(ruby);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); POP_SCOPE();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); POP_CLASS();getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); ruby_framegetRuby().rubyScope.push(); =getRuby().rubyScope.push(); frame.tmp;//getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); ifgetRuby().rubyScope.push(); (trace_func)getRuby().rubyScope.push(); {//getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); call_trace_func("end",getRuby().rubyScope.push(); file,getRuby().rubyScope.push(); line,getRuby().rubyScope.push(); 0,getRuby().rubyScope.push(); ruby_frame->last_func,getRuby().rubyScope.push(); ruby_frame->last_classgetRuby().rubyScope.push(); );//getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); }getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); ifgetRuby().rubyScope.push(); (stategetRuby().rubyScope.push(); !=getRuby().rubyScope.push(); 0)getRuby().rubyScope.push(); {getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); JUMP_TAG(state);getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); //getRuby().rubyScope.push(); }getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); returngetRuby().rubyScope.push(); result;getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); getRuby().rubyScope.push(); }
3,233,622
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); publicPUSH_CREF(module); RubyObjectPUSH_CREF(module); setupModule(RubyModulePUSH_CREF(module); module,PUSH_CREF(module); NODEPUSH_CREF(module); n)PUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); NODEPUSH_CREF(module); nodePUSH_CREF(module); =PUSH_CREF(module); n;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); StringPUSH_CREF(module); filePUSH_CREF(module); =PUSH_CREF(module); ruby_sourcefile;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); intPUSH_CREF(module); linePUSH_CREF(module); =PUSH_CREF(module); ruby_sourceline;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); TMP_PROTECT;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); framePUSH_CREF(module); =PUSH_CREF(module); ruby_frame;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); frame.tmp(ruby_frame);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); ruby_framePUSH_CREF(module); =PUSH_CREF(module); frame;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_CLASS();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ruby_classPUSH_CREF(module); =PUSH_CREF(module); module;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_SCOPE();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); RubyVarmap.push(ruby);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ifPUSH_CREF(module); (node.nd_tbl()PUSH_CREF(module); !=PUSH_CREF(module); null)PUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ListPUSH_CREF(module); tmpPUSH_CREF(module); =PUSH_CREF(module); Collections.nCopies(node.nd_tbl()[0].intValue()PUSH_CREF(module); +PUSH_CREF(module); 1,PUSH_CREF(module); ruby.getNil());PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ShiftableListPUSH_CREF(module); varsPUSH_CREF(module); =PUSH_CREF(module); newPUSH_CREF(module); ShiftableList(newPUSH_CREF(module); ArrayList(tmp));PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); vars.set(0,PUSH_CREF(module); (VALUE)node);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); vars.shift(1);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); getRuby().rubyScope.setLocalTbl(node.nd_tbl());PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); }PUSH_CREF(module); elsePUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); getRuby().rubyScope.setLocalVars(null);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); getRuby().rubyScope.setLocalTbl(null);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); }PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_CREF(module);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_TAG(PROT_NONE);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); RubyObjectPUSH_CREF(module); resultPUSH_CREF(module); =PUSH_CREF(module); null;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); ifPUSH_CREF(module); ((PUSH_CREF(module); statePUSH_CREF(module); =PUSH_CREF(module); EXEC_TAG())PUSH_CREF(module); ==PUSH_CREF(module); 0PUSH_CREF(module); )PUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); ifPUSH_CREF(module); (trace_func)PUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); call_trace_func("class",PUSH_CREF(module); file,PUSH_CREF(module); line,PUSH_CREF(module); ruby_class,PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ruby_frame->last_func,PUSH_CREF(module); ruby_frame->last_classPUSH_CREF(module); );PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); }PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); resultPUSH_CREF(module); =PUSH_CREF(module); eval(ruby_class,PUSH_CREF(module); node.nd_next());PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); }PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); POP_TAG();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); POP_CREF();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); RubyVarmap.pop(ruby);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); POP_SCOPE();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); POP_CLASS();PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); ruby_framePUSH_CREF(module); =PUSH_CREF(module); frame.tmp;//PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); ifPUSH_CREF(module); (trace_func)PUSH_CREF(module); {//PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); call_trace_func("end",PUSH_CREF(module); file,PUSH_CREF(module); line,PUSH_CREF(module); 0,PUSH_CREF(module); ruby_frame->last_func,PUSH_CREF(module); ruby_frame->last_classPUSH_CREF(module); );//PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); }PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); ifPUSH_CREF(module); (statePUSH_CREF(module); !=PUSH_CREF(module); 0)PUSH_CREF(module); {PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); JUMP_TAG(state);PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); //PUSH_CREF(module); }PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); returnPUSH_CREF(module); result;PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); PUSH_CREF(module); }
3,233,623
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); publicPOP_CREF(); RubyObjectPOP_CREF(); setupModule(RubyModulePOP_CREF(); module,POP_CREF(); NODEPOP_CREF(); n)POP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); NODEPOP_CREF(); nodePOP_CREF(); =POP_CREF(); n;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); StringPOP_CREF(); filePOP_CREF(); =POP_CREF(); ruby_sourcefile;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); intPOP_CREF(); linePOP_CREF(); =POP_CREF(); ruby_sourceline;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); TMP_PROTECT;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); framePOP_CREF(); =POP_CREF(); ruby_frame;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); frame.tmp(ruby_frame);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); ruby_framePOP_CREF(); =POP_CREF(); frame;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); PUSH_CLASS();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ruby_classPOP_CREF(); =POP_CREF(); module;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); PUSH_SCOPE();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); RubyVarmap.push(ruby);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ifPOP_CREF(); (node.nd_tbl()POP_CREF(); !=POP_CREF(); null)POP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ListPOP_CREF(); tmpPOP_CREF(); =POP_CREF(); Collections.nCopies(node.nd_tbl()[0].intValue()POP_CREF(); +POP_CREF(); 1,POP_CREF(); ruby.getNil());POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ShiftableListPOP_CREF(); varsPOP_CREF(); =POP_CREF(); newPOP_CREF(); ShiftableList(newPOP_CREF(); ArrayList(tmp));POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); vars.set(0,POP_CREF(); (VALUE)node);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); vars.shift(1);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); getRuby().rubyScope.setLocalTbl(node.nd_tbl());POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); }POP_CREF(); elsePOP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); getRuby().rubyScope.setLocalVars(null);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); getRuby().rubyScope.setLocalTbl(null);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); }POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); PUSH_CREF(module);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); rubyFrame.setCbase((VALUE)ruby_cref);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); PUSH_TAG(PROT_NONE);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); RubyObjectPOP_CREF(); resultPOP_CREF(); =POP_CREF(); null;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); ifPOP_CREF(); ((POP_CREF(); statePOP_CREF(); =POP_CREF(); EXEC_TAG())POP_CREF(); ==POP_CREF(); 0POP_CREF(); )POP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); ifPOP_CREF(); (trace_func)POP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); call_trace_func("class",POP_CREF(); file,POP_CREF(); line,POP_CREF(); ruby_class,POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ruby_frame->last_func,POP_CREF(); ruby_frame->last_classPOP_CREF(); );POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); }POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); resultPOP_CREF(); =POP_CREF(); eval(ruby_class,POP_CREF(); node.nd_next());POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); }POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_TAG();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_CREF();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); RubyVarmap.pop(ruby);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_SCOPE();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_CLASS();POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); ruby_framePOP_CREF(); =POP_CREF(); frame.tmp;//POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); ifPOP_CREF(); (trace_func)POP_CREF(); {//POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); call_trace_func("end",POP_CREF(); file,POP_CREF(); line,POP_CREF(); 0,POP_CREF(); ruby_frame->last_func,POP_CREF(); ruby_frame->last_classPOP_CREF(); );//POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); }POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); ifPOP_CREF(); (statePOP_CREF(); !=POP_CREF(); 0)POP_CREF(); {POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); JUMP_TAG(state);POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); //POP_CREF(); }POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); returnPOP_CREF(); result;POP_CREF(); POP_CREF(); POP_CREF(); POP_CREF(); }
3,233,624
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); public RubyObject setupModule(RubyModule module, NODE n) {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); NODE node = n;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // String file = ruby_sourcefile;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // int line = ruby_sourceline;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // TMP_PROTECT;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // frame = ruby_frame;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // frame.tmp(ruby_frame);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // ruby_frame = frame;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // PUSH_CLASS();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); ruby_class = module;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // PUSH_SCOPE();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); RubyVarmap.push(ruby);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); if (node.nd_tbl() != null) {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil());getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); ShiftableList vars = new ShiftableList(new ArrayList(tmp));getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); vars.set(0, (VALUE)node);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); vars.shift(1);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.setLocalTbl(node.nd_tbl());getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); } else {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.setLocalVars(null);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.setLocalTbl(null);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); }getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // PUSH_CREF(module);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); rubyFrame.setCbase((VALUE)ruby_cref);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // PUSH_TAG(PROT_NONE);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); RubyObject result = null;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // if (( state = EXEC_TAG()) == 0 ) {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // if (trace_func) {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); //getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); call_trace_func("class", file, line, ruby_class,getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); //getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); ruby_frame->last_func, ruby_frame->last_class );getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // }getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); result = eval(ruby_class, node.nd_next());getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // }getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // POP_TAG();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // POP_CREF();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); RubyVarmap.pop(ruby);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // POP_SCOPE();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // POP_CLASS();getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // ruby_frame = frame.tmp;//getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); if (trace_func) {//getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );//getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); }getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // if (state != 0) {getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); //getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); JUMP_TAG(state);getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); // }getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); return result;getRuby().rubyScope.pop(); popClass(); getRuby().rubyScope.pop(); popClass(); }
3,233,625
public RubyObject setupModule(RubyModule module, NODE n) { NODE node = n; // String file = ruby_sourcefile; // int line = ruby_sourceline; // TMP_PROTECT; // frame = ruby_frame; // frame.tmp(ruby_frame); // ruby_frame = frame; // PUSH_CLASS(); ruby_class = module; // PUSH_SCOPE(); RubyVarmap.push(ruby); if (node.nd_tbl() != null) { List tmp = Collections.nCopies(node.nd_tbl()[0].intValue() + 1, ruby.getNil()); ShiftableList vars = new ShiftableList(new ArrayList(tmp)); vars.set(0, (VALUE)node); vars.shift(1); getRuby().rubyScope.setLocalTbl(node.nd_tbl()); } else { getRuby().rubyScope.setLocalVars(null); getRuby().rubyScope.setLocalTbl(null); } // PUSH_CREF(module); rubyFrame.setCbase((VALUE)ruby_cref); // PUSH_TAG(PROT_NONE); RubyObject result = null; // if (( state = EXEC_TAG()) == 0 ) { // if (trace_func) { // call_trace_func("class", file, line, ruby_class, // ruby_frame->last_func, ruby_frame->last_class ); // } result = eval(ruby_class, node.nd_next()); // } // POP_TAG(); // POP_CREF(); RubyVarmap.pop(ruby); // POP_SCOPE(); // POP_CLASS(); // ruby_frame = frame.tmp;// if (trace_func) {// call_trace_func("end", file, line, 0, ruby_frame->last_func, ruby_frame->last_class );// } // if (state != 0) { // JUMP_TAG(state); // } return result; }
rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); publicrubyFrame = frame.getTmp(); RubyObjectrubyFrame = frame.getTmp(); setupModule(RubyModulerubyFrame = frame.getTmp(); module,rubyFrame = frame.getTmp(); NODErubyFrame = frame.getTmp(); n)rubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); NODErubyFrame = frame.getTmp(); noderubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); n;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); StringrubyFrame = frame.getTmp(); filerubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); ruby_sourcefile;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); intrubyFrame = frame.getTmp(); linerubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); ruby_sourceline;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); TMP_PROTECT;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); framerubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); ruby_frame;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); frame.tmp(ruby_frame);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); ruby_framerubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); frame;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); PUSH_CLASS();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ruby_classrubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); module;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); PUSH_SCOPE();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); RubyVarmap.push(ruby);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ifrubyFrame = frame.getTmp(); (node.nd_tbl()rubyFrame = frame.getTmp(); !=rubyFrame = frame.getTmp(); null)rubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ListrubyFrame = frame.getTmp(); tmprubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); Collections.nCopies(node.nd_tbl()[0].intValue()rubyFrame = frame.getTmp(); +rubyFrame = frame.getTmp(); 1,rubyFrame = frame.getTmp(); ruby.getNil());rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ShiftableListrubyFrame = frame.getTmp(); varsrubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); newrubyFrame = frame.getTmp(); ShiftableList(newrubyFrame = frame.getTmp(); ArrayList(tmp));rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); vars.set(0,rubyFrame = frame.getTmp(); (VALUE)node);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); vars.shift(1);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); getRuby().rubyScope.setLocalTbl(node.nd_tbl());rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); elserubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); getRuby().rubyScope.setLocalVars(null);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); getRuby().rubyScope.setLocalTbl(null);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); PUSH_CREF(module);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame.setCbase((VALUE)ruby_cref);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); PUSH_TAG(PROT_NONE);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); RubyObjectrubyFrame = frame.getTmp(); resultrubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); null;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); ifrubyFrame = frame.getTmp(); ((rubyFrame = frame.getTmp(); staterubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); EXEC_TAG())rubyFrame = frame.getTmp(); ==rubyFrame = frame.getTmp(); 0rubyFrame = frame.getTmp(); )rubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); ifrubyFrame = frame.getTmp(); (trace_func)rubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); call_trace_func("class",rubyFrame = frame.getTmp(); file,rubyFrame = frame.getTmp(); line,rubyFrame = frame.getTmp(); ruby_class,rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ruby_frame->last_func,rubyFrame = frame.getTmp(); ruby_frame->last_classrubyFrame = frame.getTmp(); );rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); resultrubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); eval(ruby_class,rubyFrame = frame.getTmp(); node.nd_next());rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); POP_TAG();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); POP_CREF();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); RubyVarmap.pop(ruby);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); POP_SCOPE();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); POP_CLASS();rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); ruby_framerubyFrame = frame.getTmp(); =rubyFrame = frame.getTmp(); frame.tmp;//rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); ifrubyFrame = frame.getTmp(); (trace_func)rubyFrame = frame.getTmp(); {//rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); call_trace_func("end",rubyFrame = frame.getTmp(); file,rubyFrame = frame.getTmp(); line,rubyFrame = frame.getTmp(); 0,rubyFrame = frame.getTmp(); ruby_frame->last_func,rubyFrame = frame.getTmp(); ruby_frame->last_classrubyFrame = frame.getTmp(); );//rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); ifrubyFrame = frame.getTmp(); (staterubyFrame = frame.getTmp(); !=rubyFrame = frame.getTmp(); 0)rubyFrame = frame.getTmp(); {rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); JUMP_TAG(state);rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); //rubyFrame = frame.getTmp(); }rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); returnrubyFrame = frame.getTmp(); result;rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); rubyFrame = frame.getTmp(); }
3,233,626
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { RubyObject result = ruby.getNil(); if (!(isBlockGiven() || isFBlockGiven()) || (ruby_block == null)) { throw new RuntimeException("yield called out of block"); } RubyVarmap.push(ruby); // PUSH_CLASS(); BLOCK block = ruby_block; Frame frame = block.frame; frame.setPrev(rubyFrame); rubyFrame = frame; VALUE old_cref = ruby_cref; ruby_cref = (NODE)rubyFrame.getCbase(); RubyScope oldScope = ruby.rubyScope; ruby.rubyScope = block.scope; ruby_block = block.prev; if ((block.flags & BLOCK_D_SCOPE) != 0) { dynamicVars = new RubyVarmap(null, null, block.dyna_vars); } else { dynamicVars = block.dyna_vars; } ruby_class = (klass != null) ? klass : block.klass; if (klass == null) { self = (RubyObject)block.self; } NODE node = block.body; if (block.var != null) { // try { if (block.var == NODE.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() != 0) { throw new RubyArgumentException("wrong # of arguments ("+ ((RubyArray)value).length() + " for 0)"); } } else { if (block.var.nd_type() == NODE_MASGN) { massign(self, block.var, value, acheck); } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } assign(self, block.var, value, acheck); } } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } } rubyIter.push(block.iter); while (true) { try { if (node == null) { result = ruby.getNil(); } else if (node.nd_type() == NODE_CFUNC || node.nd_type() == NODE_IFUNC) { if (value == null) { value = RubyArray.m_newArray(ruby, 0); } result = ((RubyCallbackMethod)node.nd_cfnc()).execute(value, new RubyObject[] {(RubyObject)node.nd_tval(), self}, ruby); } else { result = eval(self, node); } break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { result = ruby.getNil(); break; } catch (BreakException bExcptn) { break; } catch (ReturnException rExcptn) { break; } } // pop_state: rubyIter.pop(); // POP_CLASS(); RubyVarmap.pop(ruby); ruby_block = block; rubyFrame = rubyFrame.getPrev(); ruby_cref = (NODE)old_cref; // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); ruby.rubyScope = oldScope; /* * if (state) { * if (!block->tag) { * switch (state & TAG_MASK) { * case TAG_BREAK: * case TAG_RETURN: * jump_tag_but_local_jump(state & TAG_MASK); * break; * } * } * JUMP_TAG(state); * } */ return result; }
pushClass(); pushClass(); pushClass(); pushClass(); publicpushClass(); RubyObjectpushClass(); yield0(RubyObjectpushClass(); value,pushClass(); RubyObjectpushClass(); self,pushClass(); RubyModulepushClass(); klass,pushClass(); booleanpushClass(); acheck)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyObjectpushClass(); resultpushClass(); =pushClass(); ruby.getNil();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (!(isBlockGiven()pushClass(); ||pushClass(); isFBlockGiven())pushClass(); ||pushClass(); (ruby_blockpushClass(); ==pushClass(); null))pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); throwpushClass(); newpushClass(); RuntimeException("yieldpushClass(); calledpushClass(); outpushClass(); ofpushClass(); block");pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyVarmap.push(ruby);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); PUSH_CLASS();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); BLOCKpushClass(); blockpushClass(); =pushClass(); ruby_block;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); FramepushClass(); framepushClass(); =pushClass(); block.frame;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); frame.setPrev(rubyFrame);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); rubyFramepushClass(); =pushClass(); frame;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); VALUEpushClass(); old_crefpushClass(); =pushClass(); ruby_cref;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_crefpushClass(); =pushClass(); (NODE)rubyFrame.getCbase();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyScopepushClass(); oldScopepushClass(); =pushClass(); ruby.rubyScope;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby.rubyScopepushClass(); =pushClass(); block.scope;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_blockpushClass(); =pushClass(); block.prev;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); ((block.flagspushClass(); &pushClass(); BLOCK_D_SCOPE)pushClass(); !=pushClass(); 0)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); dynamicVarspushClass(); =pushClass(); newpushClass(); RubyVarmap(null,pushClass(); null,pushClass(); block.dyna_vars);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); dynamicVarspushClass(); =pushClass(); block.dyna_vars;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_classpushClass(); =pushClass(); (klasspushClass(); !=pushClass(); null)pushClass(); ?pushClass(); klasspushClass(); :pushClass(); block.klass;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (klasspushClass(); ==pushClass(); null)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); selfpushClass(); =pushClass(); (RubyObject)block.self;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); NODEpushClass(); nodepushClass(); =pushClass(); block.body;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (block.varpushClass(); !=pushClass(); null)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); trypushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (block.varpushClass(); ==pushClass(); NODE.ONE)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (acheckpushClass(); &&pushClass(); valuepushClass(); !=pushClass(); nullpushClass(); &&pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); valuepushClass(); instanceofpushClass(); RubyArraypushClass(); &&pushClass(); ((RubyArray)value).length()pushClass(); !=pushClass(); 0)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); throwpushClass(); newpushClass(); RubyArgumentException("wrongpushClass(); #pushClass(); ofpushClass(); argumentspushClass(); ("+pushClass(); ((RubyArray)value).length()pushClass(); +pushClass(); "pushClass(); forpushClass(); 0)");pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (block.var.nd_type()pushClass(); ==pushClass(); NODE_MASGN)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); massign(self,pushClass(); block.var,pushClass(); value,pushClass(); acheck);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (acheckpushClass(); &&pushClass(); valuepushClass(); !=pushClass(); nullpushClass(); &&pushClass(); valuepushClass(); instanceofpushClass(); RubyArraypushClass(); &&pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ((RubyArray)value).length()pushClass(); ==pushClass(); 1)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); valuepushClass(); =pushClass(); ((RubyArray)value).entry(0);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); assign(self,pushClass(); block.var,pushClass(); value,pushClass(); acheck);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); }pushClass(); catchpushClass(); ()pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pushClass(); pushClass(); pushClass(); gotopushClass(); pop_state;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (acheckpushClass(); &&pushClass(); valuepushClass(); !=pushClass(); nullpushClass(); &&pushClass(); valuepushClass(); instanceofpushClass(); RubyArraypushClass(); &&pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ((RubyArray)value).length()pushClass(); ==pushClass(); 1)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); valuepushClass(); =pushClass(); ((RubyArray)value).entry(0);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); rubyIter.push(block.iter);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); whilepushClass(); (true)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); trypushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (nodepushClass(); ==pushClass(); null)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); resultpushClass(); =pushClass(); ruby.getNil();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); ifpushClass(); (node.nd_type()pushClass(); ==pushClass(); NODE_CFUNCpushClass(); ||pushClass(); node.nd_type()pushClass(); ==pushClass(); NODE_IFUNC)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (valuepushClass(); ==pushClass(); null)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); valuepushClass(); =pushClass(); RubyArray.m_newArray(ruby,pushClass(); 0);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); resultpushClass(); =pushClass(); ((RubyCallbackMethod)node.nd_cfnc()).execute(value,pushClass(); newpushClass(); RubyObject[]pushClass(); {(RubyObject)node.nd_tval(),pushClass(); self},pushClass(); ruby);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); elsepushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); resultpushClass(); =pushClass(); eval(self,pushClass(); node);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); break;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); catchpushClass(); (RedoExceptionpushClass(); rExcptn)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); catchpushClass(); (NextExceptionpushClass(); nExcptn)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); resultpushClass(); =pushClass(); ruby.getNil();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); break;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); catchpushClass(); (BreakExceptionpushClass(); bExcptn)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); break;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); catchpushClass(); (ReturnExceptionpushClass(); rExcptn)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); break;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pop_state:pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); rubyIter.pop();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); POP_CLASS();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); RubyVarmap.pop(ruby);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_blockpushClass(); =pushClass(); block;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); rubyFramepushClass(); =pushClass(); rubyFrame.getPrev();pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby_crefpushClass(); =pushClass(); (NODE)old_cref;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); ifpushClass(); (ruby_scope->flagpushClass(); &pushClass(); SCOPE_DONT_RECYCLE)pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); //pushClass(); pushClass(); pushClass(); pushClass(); scope_dup(old_scope);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); ruby.rubyScopepushClass(); =pushClass(); oldScope;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); /*pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); ifpushClass(); (state)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); ifpushClass(); (!block->tag)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); switchpushClass(); (statepushClass(); &pushClass(); TAG_MASK)pushClass(); {pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); casepushClass(); TAG_BREAK:pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); casepushClass(); TAG_RETURN:pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); jump_tag_but_local_jump(statepushClass(); &pushClass(); TAG_MASK);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); break;pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); pushClass(); pushClass(); pushClass(); JUMP_TAG(state);pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); *pushClass(); }pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); */pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); pushClass(); returnpushClass(); result;pushClass(); pushClass(); pushClass(); pushClass(); }
3,233,627
public RubyObject yield0(RubyObject value, RubyObject self, RubyModule klass, boolean acheck) { RubyObject result = ruby.getNil(); if (!(isBlockGiven() || isFBlockGiven()) || (ruby_block == null)) { throw new RuntimeException("yield called out of block"); } RubyVarmap.push(ruby); // PUSH_CLASS(); BLOCK block = ruby_block; Frame frame = block.frame; frame.setPrev(rubyFrame); rubyFrame = frame; VALUE old_cref = ruby_cref; ruby_cref = (NODE)rubyFrame.getCbase(); RubyScope oldScope = ruby.rubyScope; ruby.rubyScope = block.scope; ruby_block = block.prev; if ((block.flags & BLOCK_D_SCOPE) != 0) { dynamicVars = new RubyVarmap(null, null, block.dyna_vars); } else { dynamicVars = block.dyna_vars; } ruby_class = (klass != null) ? klass : block.klass; if (klass == null) { self = (RubyObject)block.self; } NODE node = block.body; if (block.var != null) { // try { if (block.var == NODE.ONE) { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() != 0) { throw new RubyArgumentException("wrong # of arguments ("+ ((RubyArray)value).length() + " for 0)"); } } else { if (block.var.nd_type() == NODE_MASGN) { massign(self, block.var, value, acheck); } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } assign(self, block.var, value, acheck); } } // } catch () { // goto pop_state; // } } else { if (acheck && value != null && value instanceof RubyArray && ((RubyArray)value).length() == 1) { value = ((RubyArray)value).entry(0); } } rubyIter.push(block.iter); while (true) { try { if (node == null) { result = ruby.getNil(); } else if (node.nd_type() == NODE_CFUNC || node.nd_type() == NODE_IFUNC) { if (value == null) { value = RubyArray.m_newArray(ruby, 0); } result = ((RubyCallbackMethod)node.nd_cfnc()).execute(value, new RubyObject[] {(RubyObject)node.nd_tval(), self}, ruby); } else { result = eval(self, node); } break; } catch (RedoException rExcptn) { } catch (NextException nExcptn) { result = ruby.getNil(); break; } catch (BreakException bExcptn) { break; } catch (ReturnException rExcptn) { break; } } // pop_state: rubyIter.pop(); // POP_CLASS(); RubyVarmap.pop(ruby); ruby_block = block; rubyFrame = rubyFrame.getPrev(); ruby_cref = (NODE)old_cref; // if (ruby_scope->flag & SCOPE_DONT_RECYCLE) // scope_dup(old_scope); ruby.rubyScope = oldScope; /* * if (state) { * if (!block->tag) { * switch (state & TAG_MASK) { * case TAG_BREAK: * case TAG_RETURN: * jump_tag_but_local_jump(state & TAG_MASK); * break; * } * } * JUMP_TAG(state); * } */ return result; }
popClass(); popClass(); popClass(); popClass(); publicpopClass(); RubyObjectpopClass(); yield0(RubyObjectpopClass(); value,popClass(); RubyObjectpopClass(); self,popClass(); RubyModulepopClass(); klass,popClass(); booleanpopClass(); acheck)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); RubyObjectpopClass(); resultpopClass(); =popClass(); ruby.getNil();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (!(isBlockGiven()popClass(); ||popClass(); isFBlockGiven())popClass(); ||popClass(); (ruby_blockpopClass(); ==popClass(); null))popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); throwpopClass(); newpopClass(); RuntimeException("yieldpopClass(); calledpopClass(); outpopClass(); ofpopClass(); block");popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); RubyVarmap.push(ruby);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); PUSH_CLASS();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); BLOCKpopClass(); blockpopClass(); =popClass(); ruby_block;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); FramepopClass(); framepopClass(); =popClass(); block.frame;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); frame.setPrev(rubyFrame);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); rubyFramepopClass(); =popClass(); frame;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); VALUEpopClass(); old_crefpopClass(); =popClass(); ruby_cref;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby_crefpopClass(); =popClass(); (NODE)rubyFrame.getCbase();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); RubyScopepopClass(); oldScopepopClass(); =popClass(); ruby.rubyScope;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby.rubyScopepopClass(); =popClass(); block.scope;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby_blockpopClass(); =popClass(); block.prev;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); ((block.flagspopClass(); &popClass(); BLOCK_D_SCOPE)popClass(); !=popClass(); 0)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); dynamicVarspopClass(); =popClass(); newpopClass(); RubyVarmap(null,popClass(); null,popClass(); block.dyna_vars);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); dynamicVarspopClass(); =popClass(); block.dyna_vars;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby_classpopClass(); =popClass(); (klasspopClass(); !=popClass(); null)popClass(); ?popClass(); klasspopClass(); :popClass(); block.klass;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (klasspopClass(); ==popClass(); null)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); selfpopClass(); =popClass(); (RubyObject)block.self;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); NODEpopClass(); nodepopClass(); =popClass(); block.body;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (block.varpopClass(); !=popClass(); null)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); trypopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (block.varpopClass(); ==popClass(); NODE.ONE)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (acheckpopClass(); &&popClass(); valuepopClass(); !=popClass(); nullpopClass(); &&popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); valuepopClass(); instanceofpopClass(); RubyArraypopClass(); &&popClass(); ((RubyArray)value).length()popClass(); !=popClass(); 0)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); throwpopClass(); newpopClass(); RubyArgumentException("wrongpopClass(); #popClass(); ofpopClass(); argumentspopClass(); ("+popClass(); ((RubyArray)value).length()popClass(); +popClass(); "popClass(); forpopClass(); 0)");popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (block.var.nd_type()popClass(); ==popClass(); NODE_MASGN)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); massign(self,popClass(); block.var,popClass(); value,popClass(); acheck);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (acheckpopClass(); &&popClass(); valuepopClass(); !=popClass(); nullpopClass(); &&popClass(); valuepopClass(); instanceofpopClass(); RubyArraypopClass(); &&popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ((RubyArray)value).length()popClass(); ==popClass(); 1)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); valuepopClass(); =popClass(); ((RubyArray)value).entry(0);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); assign(self,popClass(); block.var,popClass(); value,popClass(); acheck);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); }popClass(); catchpopClass(); ()popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); popClass(); popClass(); popClass(); gotopopClass(); pop_state;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (acheckpopClass(); &&popClass(); valuepopClass(); !=popClass(); nullpopClass(); &&popClass(); valuepopClass(); instanceofpopClass(); RubyArraypopClass(); &&popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ((RubyArray)value).length()popClass(); ==popClass(); 1)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); valuepopClass(); =popClass(); ((RubyArray)value).entry(0);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); rubyIter.push(block.iter);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); whilepopClass(); (true)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); trypopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (nodepopClass(); ==popClass(); null)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); resultpopClass(); =popClass(); ruby.getNil();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); ifpopClass(); (node.nd_type()popClass(); ==popClass(); NODE_CFUNCpopClass(); ||popClass(); node.nd_type()popClass(); ==popClass(); NODE_IFUNC)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ifpopClass(); (valuepopClass(); ==popClass(); null)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); valuepopClass(); =popClass(); RubyArray.m_newArray(ruby,popClass(); 0);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); resultpopClass(); =popClass(); ((RubyCallbackMethod)node.nd_cfnc()).execute(value,popClass(); newpopClass(); RubyObject[]popClass(); {(RubyObject)node.nd_tval(),popClass(); self},popClass(); ruby);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); elsepopClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); resultpopClass(); =popClass(); eval(self,popClass(); node);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); break;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); catchpopClass(); (RedoExceptionpopClass(); rExcptn)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); catchpopClass(); (NextExceptionpopClass(); nExcptn)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); resultpopClass(); =popClass(); ruby.getNil();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); break;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); catchpopClass(); (BreakExceptionpopClass(); bExcptn)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); break;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); catchpopClass(); (ReturnExceptionpopClass(); rExcptn)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); break;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); pop_state:popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); rubyIter.pop();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); POP_CLASS();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); RubyVarmap.pop(ruby);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby_blockpopClass(); =popClass(); block;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); rubyFramepopClass(); =popClass(); rubyFrame.getPrev();popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby_crefpopClass(); =popClass(); (NODE)old_cref;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); ifpopClass(); (ruby_scope->flagpopClass(); &popClass(); SCOPE_DONT_RECYCLE)popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); //popClass(); popClass(); popClass(); popClass(); scope_dup(old_scope);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); ruby.rubyScopepopClass(); =popClass(); oldScope;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); /*popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); ifpopClass(); (state)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); ifpopClass(); (!block->tag)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); switchpopClass(); (statepopClass(); &popClass(); TAG_MASK)popClass(); {popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); casepopClass(); TAG_BREAK:popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); casepopClass(); TAG_RETURN:popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); jump_tag_but_local_jump(statepopClass(); &popClass(); TAG_MASK);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); break;popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); popClass(); popClass(); popClass(); JUMP_TAG(state);popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); *popClass(); }popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); */popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); popClass(); returnpopClass(); result;popClass(); popClass(); popClass(); popClass(); }
3,233,628
private static void initializeRuntime(Ruby runtime, String filename) { IRubyObject argumentArray = JavaUtil.convertJavaToRuby(runtime, commandline.scriptArguments); runtime.setVerbose(commandline.verbose); defineGlobal(runtime, "$VERBOSE", commandline.verbose); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.defineReadonlyVariable("$*", argumentArray); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", RubyString.newString(runtime, filename))); runtime.getLoadService().init(runtime, commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); KernelModule.require(runtime.getTopSelf(), RubyString.newString(runtime, scriptName)); } }
private static void initializeRuntime(Ruby runtime, String filename) { IRubyObject argumentArray = RubyArray.newArray(runtime, JavaUtil.convertJavaArrayToRuby(runtime, commandline.scriptArguments)); runtime.setVerbose(commandline.verbose); defineGlobal(runtime, "$VERBOSE", commandline.verbose); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.defineReadonlyVariable("$*", argumentArray); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", RubyString.newString(runtime, filename))); runtime.getLoadService().init(runtime, commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); KernelModule.require(runtime.getTopSelf(), RubyString.newString(runtime, scriptName)); } }
3,233,629
private static void initializeRuntime(Ruby runtime, String filename) { IRubyObject argumentArray = JavaUtil.convertJavaToRuby(runtime, commandline.scriptArguments); runtime.setVerbose(commandline.verbose); defineGlobal(runtime, "$VERBOSE", commandline.verbose); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.defineReadonlyVariable("$*", argumentArray); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", RubyString.newString(runtime, filename))); runtime.getLoadService().init(runtime, commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); KernelModule.require(runtime.getTopSelf(), RubyString.newString(runtime, scriptName)); } }
private static void initializeRuntime(Ruby runtime, String filename) { IRubyObject argumentArray = JavaUtil.convertJavaToRuby(runtime, commandline.scriptArguments); runtime.setVerbose(commandline.verbose); defineGlobal(runtime, "$VERBOSE", commandline.verbose); runtime.defineGlobalConstant("ARGV", argumentArray); defineGlobal(runtime, "$-p", commandline.assumePrinting); defineGlobal(runtime, "$-n", commandline.assumeLoop); defineGlobal(runtime, "$-a", commandline.sDoSplit); defineGlobal(runtime, "$-l", commandline.processLineEnds); runtime.getGlobalVariables().defineReadonly("$*", new ValueAccessor(argumentArray)); runtime.defineVariable(new RubyGlobal.StringGlobalVariable(runtime, "$0", RubyString.newString(runtime, filename))); runtime.getLoadService().init(runtime, commandline.loadPaths()); Iterator iter = commandline.requiredLibraries().iterator(); while (iter.hasNext()) { String scriptName = (String) iter.next(); KernelModule.require(runtime.getTopSelf(), RubyString.newString(runtime, scriptName)); } }
3,233,630
public static void main (String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i, new String[0]); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else if (args[i].equals("-rx")) { if (++i >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -rx must be followed by an expression to evaluate"); printUsage(); } else { try { sRegexpAdapter = Class.forName(args[i]); } catch (Exception e) { System.err.println("invalid argument " + i ); System.err.println("failed to load RegexpAdapter: " + args[i]); System.err.println("defaulting to default RegexpAdapter: GNURegexpAdapter"); } } } else { String[] argv = new String[lenArg - i - 1]; System.arraycopy(args, i + 1, argv, 0, argv.length); runInterpreterOnFile(args[i], argv); break; } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
public static void main(String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i, new String[0]); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else if (args[i].equals("-rx")) { if (++i >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -rx must be followed by an expression to evaluate"); printUsage(); } else { try { sRegexpAdapter = Class.forName(args[i]); } catch (Exception e) { System.err.println("invalid argument " + i ); System.err.println("failed to load RegexpAdapter: " + args[i]); System.err.println("defaulting to default RegexpAdapter: GNURegexpAdapter"); } } } else { String[] argv = new String[lenArg - i - 1]; System.arraycopy(args, i + 1, argv, 0, argv.length); runInterpreterOnFile(args[i], argv); break; } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
3,233,631
public static void main (String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i, new String[0]); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else if (args[i].equals("-rx")) { if (++i >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -rx must be followed by an expression to evaluate"); printUsage(); } else { try { sRegexpAdapter = Class.forName(args[i]); } catch (Exception e) { System.err.println("invalid argument " + i ); System.err.println("failed to load RegexpAdapter: " + args[i]); System.err.println("defaulting to default RegexpAdapter: GNURegexpAdapter"); } } } else { String[] argv = new String[lenArg - i - 1]; System.arraycopy(args, i + 1, argv, 0, argv.length); runInterpreterOnFile(args[i], argv); break; } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
public static void main (String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; if (args.length == 0) { printUsage(); } else { int lenArg = args.length; for (int i = 0; i < lenArg; i++) { if (args[i].equals("-h") || args[i].equals("-help")) { printUsage(); } else if (args[i].equals("-e")) { if (i++ >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -e must be followed by an expression to evaluate"); printUsage(); } else { runInterpreter(args[i], "command line " + i, new String[0]); } } else if (args[i].equals("-b")) { // Benchmark now = System.currentTimeMillis(); } else if (args[i].equals("-rx")) { if (++i >= lenArg) { System.err.println("invalid argument " + i); System.err.println(" -rx must be followed by an expression to evaluate"); printUsage(); } else { try { sRegexpAdapter = Class.forName(args[i]); } catch (Exception e) { System.err.println("invalid argument " + i); System.err.println("failed to load RegexpAdapter: " + args[i]); System.err.println("defaulting to default RegexpAdapter: GNURegexpAdapter"); } } } else { String[] argv = new String[lenArg - i - 1]; System.arraycopy(args, i + 1, argv, 0, argv.length); runInterpreterOnFile(args[i], argv); break; } } } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
3,233,632
protected static void runInterpreterOnFile(String fileName, String[] args) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int)rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); runInterpreter(sb.toString(), fileName, args); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
protected static void runInterpreterOnFile(String fileName, String[] args) { File rubyFile = new File(fileName); if (!rubyFile.canRead()) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); } else { try { StringBuffer sb = new StringBuffer((int) rubyFile.length()); BufferedReader br = new BufferedReader(new FileReader(rubyFile)); String line; while ((line = br.readLine()) != null) { sb.append(line).append('\n'); } br.close(); runInterpreter(sb.toString(), fileName, args); } catch (IOException ioExcptn) { System.out.println("Cannot read Rubyfile: \"" + fileName + "\""); System.out.println("IOEception: " + ioExcptn.getMessage()); } } }
3,233,634
private String getClassName(final Class arg0) { if (arg0 ==null) throw new IllegalArgumentException("Class argument cannot be null."); String klass = arg0.getName().substring( arg0.getPackage().getName().length() + 1); return klass; }
private String getClassName(final Class arg0) { if (arg0 ==null) throw new IllegalArgumentException("Class argument cannot be null."); String klass = arg0.getName().substring( arg0.getPackage().getName().length() + 1); return klass; }
3,233,635
IRubyObject[] scanArgs(IRuby runtime, IRubyObject[] args, int required, int optional);
IRubyObject[] scanArgs(IRuby runtime, IRubyObject[] args, int required, int optional);
3,233,637
public void exportMethod(RubyId name, int noex) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } NODE body = searchMethod(name); RubyModule origin = getMethodOrigin(name); if (body == null && isModule()) { body = getRuby().getClasses().getObjectClass().searchMethod(name); origin = getRuby().getClasses().getObjectClass().getMethodOrigin(name); } if (body == null) { } if (body.nd_noex() != noex) { if (this == origin) { body.nd_noex(noex); } else { addMethod(name, NODE.newZSuper(), noex); } } }
public void exportMethod(RubyId name, int noex) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } NODE body = searchMethod(name); RubyModule origin = getMethodOrigin(name); if (body == null && isModule()) { body = getRuby().getClasses().getObjectClass().searchMethod(name); origin = getRuby().getClasses().getObjectClass().getMethodOrigin(name); } if (body == null) { } if (body.nd_noex() != noex) { if (this == origin) { body.nd_noex(noex); } else { addMethod(name, NODE.newZSuper(), noex); } } }
3,233,638
public void exportMethod(RubyId name, int noex) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } NODE body = searchMethod(name); RubyModule origin = getMethodOrigin(name); if (body == null && isModule()) { body = getRuby().getClasses().getObjectClass().searchMethod(name); origin = getRuby().getClasses().getObjectClass().getMethodOrigin(name); } if (body == null) { } if (body.nd_noex() != noex) { if (this == origin) { body.nd_noex(noex); } else { addMethod(name, NODE.newZSuper(), noex); } } }
public void exportMethod(RubyId name, int noex) { if (this == getRuby().getClasses().getObjectClass()) { getRuby().secure(4); } NODE body = searchMethod(name); RubyModule origin = getMethodOrigin(name); if (body == null && isModule()) { body = getRuby().getClasses().getObjectClass().searchMethod(name); origin = getRuby().getClasses().getObjectClass().getMethodOrigin(name); } if (body == null) { } if (body.nd_noex() != noex) { if (this == origin) { body.nd_noex(noex); } else { addMethod(name, NODE.newZSuper(), noex); } } }
3,233,639
public RubyObject m_module_function(RubyObject[] args) { if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException("Insecure: can't change method visibility"); } if (args.length == 0) { getRuby().getInterpreter().setActMethodScope(SCOPE_MODFUNC); } else { setMethodVisibility(args, NOEX_PRIVATE); for (int i = 0; i < args.length; i++) { RubyId id = args[i].toId(); NODE body = searchMethod(id); if (body == null || body.nd_body() == null) { throw new RubyBugException("undefined method '" + id.toName() + "'; can't happen"); } getSingletonClass().addMethod(id, body.nd_body(), NOEX_PUBLIC); // rb_clear_cache_by_id(id); funcall(getRuby().intern("singleton_added"), id.toSymbol()); } } return this; }
public RubyObject m_module_function(RubyObject[] args) { if (getRuby().getSecurityLevel() >= 4 && !isTaint()) { throw new RubySecurityException("Insecure: can't change method visibility"); } if (args.length == 0) { getRuby().getInterpreter().setActMethodScope(SCOPE_MODFUNC); } else { setMethodVisibility(args, NOEX_PRIVATE); for (int i = 0; i < args.length; i++) { RubyId id = args[i].toId(); NODE body = searchMethod(id).getBody(); if (body == null || body.nd_body() == null) { throw new RubyBugException("undefined method '" + id.toName() + "'; can't happen"); } getSingletonClass().addMethod(id, body.nd_body(), NOEX_PUBLIC); // rb_clear_cache_by_id(id); funcall(getRuby().intern("singleton_added"), id.toSymbol()); } } return this; }
3,233,640
public RubyClass newIncludeClass(RubyModule superClass) { RubyClass newClass = new RubyClass(getRuby(), getRuby().getClasses().getClassClass(), superClass); newClass.setIncluded(true); newClass.setInstanceVariables(getInstanceVariables()); newClass.setMethods(getMethods()); if (isIncluded()) { newClass.setRubyClass(getRubyClass()); } else { newClass.setRubyClass(this); } return newClass; }
public RubyClass newIncludeClass(RubyModule superClass) { RubyClass newClass = new RubyClass(getRuby(), superClass); newClass.setIncluded(true); newClass.setInstanceVariables(getInstanceVariables()); newClass.setMethods(getMethods()); if (isIncluded()) { newClass.setRubyClass(getRubyClass()); } else { newClass.setRubyClass(this); } return newClass; }
3,233,641
public static void main(String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; String[] argv = processArgs(args); if (sBenchmarkMode) now = System.currentTimeMillis(); if (sScript != null) { runInterpreter(sScript, "-e", argv); } else if (sFileName != null) { runInterpreterOnFile(sFileName, argv); } else { printUsage(); //interpreting from the command line not supported yet return; } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
public static void main(String args[]) { /* System.out.println(); System.out.println("----------------------------------------------------"); System.out.println("--- WARNING this is an ALPHA version of JRuby!!! ---"); System.out.println("----------------------------------------------------"); System.out.println(); */ // Benchmark long now = -1; String[] argv = processArgs(args); if (sBenchmarkMode) now = System.currentTimeMillis(); if (sScript != null) { runInterpreter(sScript, "-e", argv); } else if (sFileName != null) { runInterpreterOnFile(sFileName, argv); } else { printUsage(); //interpreting from the command line not supported yet return; } // Benchmark if (now != -1) { System.out.println("Runtime: " + (System.currentTimeMillis() - now) + " ms"); } }
3,233,643