bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private void tableLayout(JTable table) { table.setTableHeader(null); table.setRowHeight(ROW_HEIGHT); table.setOpaque(false); table.setShowGrid(false); TableColumnModel columns = table.getColumnModel(); TableColumn column= columns.getColumn(0); column.setPreferredWidth(DEFAULT_WIDTH); column.setWidth(DEFAULT_WIDTH); table.setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); table.setDefaultEditor(JComponent.class, new TableComponentCellEditor()); }
|
private void tableLayout(JTable table) { table.setTableHeader(null); table.setRowHeight(ROW_HEIGHT); table.setOpaque(false); table.setShowGrid(false); TableColumnModel columns = table.getColumnModel(); TableColumn column= columns.getColumn(0); column.setPreferredWidth(DEFAULT_WIDTH); column.setWidth(DEFAULT_WIDTH); table.setDefaultRenderer(JComponent.class, new TableComponentCellRenderer()); table.setDefaultEditor(JComponent.class, new TableComponentCellEditor()); }
| 3,237,152
|
protected RubyModule(IRuby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, String name) { super(runtime, metaClass); this.superClass = superClass; //this.parentModule = parentModule; setBaseName(name); // If no parent is passed in, it is safe to assume Object. if (parentCRef == null) { if (runtime.getObject() != null) { parentCRef = runtime.getObject().getCRef(); } } this.cref = new SinglyLinkedList(this, parentCRef); }
|
protected RubyModule(IRuby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, String name) { super(runtime, metaClass); this.superClass = superClass; //this.parentModule = parentModule; setBaseName(name); // If no parent is passed in, it is safe to assume Object. if (parentCRef == null) { if (runtime.getObject() != null) { parentCRef = runtime.getObject().getCRef(); } } this.cref = new SinglyLinkedList(this, parentCRef); }
| 3,237,154
|
protected RubyModule(IRuby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, String name) { super(runtime, metaClass); this.superClass = superClass; //this.parentModule = parentModule; setBaseName(name); // If no parent is passed in, it is safe to assume Object. if (parentCRef == null) { if (runtime.getObject() != null) { parentCRef = runtime.getObject().getCRef(); } } this.cref = new SinglyLinkedList(this, parentCRef); }
|
protected RubyModule(IRuby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, String name) { super(runtime, metaClass); this.superClass = superClass; //this.parentModule = parentModule; setBaseName(name); // If no parent is passed in, it is safe to assume Object. if (parentCRef == null) { if (runtime.getObject() != null) { parentCRef = runtime.getObject().getCRef(); } } this.cref = new SinglyLinkedList(this, parentCRef); }
| 3,237,155
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,156
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,157
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,158
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,159
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,160
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
|
private void addAccessor(String name, boolean readable, boolean writeable) { ThreadContext tc = getRuntime().getCurrentContext(); // Check the visibility of the previous frame, which will be the frame in which the class is being eval'ed Visibility attributeScope = tc.getCurrentVisibility(); if (attributeScope.isPrivate()) { //FIXME warning } else if (attributeScope.isModuleFunction()) { attributeScope = Visibility.PRIVATE; // FIXME warning } final String variableName = "@" + name; final IRuby runtime = getRuntime(); ThreadContext context = getRuntime().getCurrentContext(); if (readable) { defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; } public Arity getArity() { return Arity.noArguments(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } if (writeable) { name = name + "="; defineMethod(name, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); } public Arity getArity() { return Arity.singleArgument(); } }); callMethod(context, "method_added", RubySymbol.newSymbol(getRuntime(), name)); } }
| 3,237,161
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; }
| 3,237,162
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { checkArgumentCount(args, 0, 0); IRubyObject variable = self.getInstanceVariable(variableName); return variable == null ? runtime.getNil() : variable; }
| 3,237,163
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); }
| 3,237,164
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { IRubyObject[] fargs = runtime.getCurrentContext().getFrameArgs(); if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } if (fargs.length != 1) { throw runtime.newArgumentError("wrong # of arguments(" + fargs.length + "for 1)"); } return self.setInstanceVariable(variableName, fargs[0]); }
| 3,237,165
|
private void addCachedMethod(String name, ICallable method) { // Included modules modify the original 'included' modules class. Since multiple // classes can include the same module, we cannot cache in the original included module. if (!isIncluded()) { getMethods().put(name, method); getRuntime().getCacheMap().add(method, this); } }
|
private void addCachedMethod(String name, ICallable method) { // Included modules modify the original 'included' modules class. Since multiple // classes can include the same module, we cannot cache in the original included module. if (!isIncluded()) { getMethods().put(name, method); getRuntime().getCacheMap().add(method, this); } }
| 3,237,166
|
public void addMethod(String name, ICallable method) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't define method"); } testFrozen("class/module"); // We can safely reference methods here instead of doing getMethods() since if we // are adding we are not using a IncludedModuleWrapper. synchronized(getMethods()) { // If we add a method which already is cached in this class, then we should update the // cachemap so it stays up to date. ICallable existingMethod = (ICallable) getMethods().remove(name); if (existingMethod != null) { getRuntime().getCacheMap().remove(name, existingMethod); } getMethods().put(name, method); } }
|
public void addMethod(String name, ICallable method) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't define method"); } testFrozen("class/module"); // We can safely reference methods here instead of doing getMethods() since if we // are adding we are not using a IncludedModuleWrapper. synchronized(getMethods()) { // If we add a method which already is cached in this class, then we should update the // cachemap so it stays up to date. ICallable existingMethod = (ICallable) getMethods().remove(name); if (existingMethod != null) { getRuntime().getCacheMap().remove(name, existingMethod); } getMethods().put(name, method); } }
| 3,237,167
|
public IRubyObject attr(IRubyObject[] args) { checkArgumentCount(args, 1, 2); boolean writeable = args.length > 1 ? args[1].isTrue() : false; addAccessor(args[0].asSymbol(), true, writeable); return getRuntime().getNil(); }
|
public IRubyObject attr(IRubyObject[] args) { checkArgumentCount(args, 1, 2); boolean writeable = args.length > 1 ? args[1].isTrue() : false; addAccessor(args[0].asSymbol(), true, writeable); return getRuntime().getNil(); }
| 3,237,168
|
public IRubyObject attr(IRubyObject[] args) { checkArgumentCount(args, 1, 2); boolean writeable = args.length > 1 ? args[1].isTrue() : false; addAccessor(args[0].asSymbol(), true, writeable); return getRuntime().getNil(); }
|
public IRubyObject attr(IRubyObject[] args) { checkArgumentCount(args, 1, 2); boolean writeable = args.length > 1 ? args[1].isTrue() : false; addAccessor(args[0].asSymbol(), true, writeable); return getRuntime().getNil(); }
| 3,237,169
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
| 3,237,170
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
| 3,237,171
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
|
protected IRubyObject cloneMethods(RubyModule clone) { RubyModule realType = this.getNonIncludedClass(); for (Iterator iter = getMethods().entrySet().iterator(); iter.hasNext(); ) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); // Do not clone cached methods if (method.getImplementationClass() == realType) { // A cloned method now belongs to a new class. Set it. // TODO: Make ICallable immutable ICallable clonedMethod = method.dup(); clonedMethod.setImplementationClass(clone); clone.getMethods().put(entry.getKey(), clonedMethod); } } return clone; }
| 3,237,172
|
public RubyBoolean const_defined(IRubyObject symbol) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("wrong constant name " + name); } return getRuntime().newBoolean(getConstantAt(name) != null); }
|
public RubyBoolean const_defined(IRubyObject symbol) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw wrongConstantNameError(name); } return getRuntime().newBoolean(getConstantAt(name) != null); }
| 3,237,173
|
public IRubyObject const_get(IRubyObject symbol) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("wrong constant name " + name); } return getConstant(name); }
|
public IRubyObject const_get(IRubyObject symbol) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw wrongConstantNameError(name); } return getConstant(name); }
| 3,237,174
|
public IRubyObject const_missing(IRubyObject name) { /* Uninitialized constant */ if (this != getRuntime().getObject()) { throw getRuntime().newNameError("uninitialized constant " + getName() + "::" + name.asSymbol()); } throw getRuntime().newNameError("uninitialized constant " + name.asSymbol()); }
|
public IRubyObject const_missing(IRubyObject name) { /* Uninitialized constant */ if (this != getRuntime().getObject()) { throw getRuntime().newNameError("uninitialized constant " + getName() + "::" + name.asSymbol()); } throw getRuntime().newNameError("uninitialized constant " + name.asSymbol()); }
| 3,237,175
|
public IRubyObject const_missing(IRubyObject name) { /* Uninitialized constant */ if (this != getRuntime().getObject()) { throw getRuntime().newNameError("uninitialized constant " + getName() + "::" + name.asSymbol()); } throw getRuntime().newNameError("uninitialized constant " + name.asSymbol()); }
|
public IRubyObject const_missing(IRubyObject name) { /* Uninitialized constant */ if (this != getRuntime().getObject()) { throw getRuntime().newNameError("uninitialized constant " + getName() + "::" + name.asSymbol()); } throw getRuntime().newNameError("uninitialized constant " + name.asSymbol(), name.asSymbol()); }
| 3,237,176
|
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("wrong constant name " + name); } return setConstant(name, value); }
|
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw wrongConstantNameError(name); } return setConstant(name, value); }
| 3,237,177
|
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("wrong constant name " + name); } return setConstant(name, value); }
|
public IRubyObject const_set(IRubyObject symbol, IRubyObject value) { String name = symbol.asSymbol(); if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("wrong constant name " + name); } return setConstant(name, value); }
| 3,237,178
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
| 3,237,179
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
| 3,237,180
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
| 3,237,181
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
| 3,237,182
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
|
public RubyArray constants() { ArrayList constantNames = new ArrayList(); RubyModule objectClass = getRuntime().getObject(); if (getRuntime().getClass("Module") == this) { for (Iterator vars = objectClass.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } else if (getRuntime().getObject() == this) { for (Iterator vars = instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } return getRuntime().newArray(constantNames); } for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (objectClass == p) { continue; } for (Iterator vars = p.instanceVariableNames(); vars.hasNext();) { String name = (String) vars.next(); if (IdUtil.isConstant(name)) { constantNames.add(getRuntime().newString(name)); } } } return getRuntime().newArray(constantNames); }
| 3,237,183
|
public synchronized void defineAlias(String name, String oldName) { testFrozen("module"); if (oldName.equals(name)) { return; } if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getObject().searchMethod(oldName); } if (method.isUndefined()) { throw getRuntime().newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'"); } } getRuntime().getCacheMap().remove(name, searchMethod(name)); getMethods().put(name, new AliasMethod(method, oldName)); }
|
public synchronized void defineAlias(String name, String oldName) { testFrozen("module"); if (oldName.equals(name)) { return; } if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getObject().searchMethod(oldName); } if (method.isUndefined()) { throw getRuntime().newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'"); } } getRuntime().getCacheMap().remove(name, searchMethod(name)); getMethods().put(name, new AliasMethod(method, oldName)); }
| 3,237,184
|
public synchronized void defineAlias(String name, String oldName) { testFrozen("module"); if (oldName.equals(name)) { return; } if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getObject().searchMethod(oldName); } if (method.isUndefined()) { throw getRuntime().newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'"); } } getRuntime().getCacheMap().remove(name, searchMethod(name)); getMethods().put(name, new AliasMethod(method, oldName)); }
|
public synchronized void defineAlias(String name, String oldName) { testFrozen("module"); if (oldName.equals(name)) { return; } if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(oldName); if (method.isUndefined()) { if (isModule()) { method = getRuntime().getObject().searchMethod(oldName); } if (method.isUndefined()) { throw getRuntime().newNameError("undefined method `" + oldName + "' for " + (isModule() ? "module" : "class") + " `" + getName() + "'", oldName); } } getRuntime().getCacheMap().remove(name, searchMethod(name)); getMethods().put(name, new AliasMethod(method, oldName)); }
| 3,237,185
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
| 3,237,186
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
| 3,237,187
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
|
public RubyClass defineClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } else if (((RubyClass) type).getSuperClass().getRealClass() != superClazz) { throw getRuntime().newNameError(name + " is already defined."); } return (RubyClass) type; }
| 3,237,188
|
public void defineConstant(String name, IRubyObject value) { assert value != null; if (this == getRuntime().getClass("Class")) { getRuntime().secure(4); } if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("bad constant name " + name); } setConstant(name, value); }
|
public void defineConstant(String name, IRubyObject value) { assert value != null; if (this == getRuntime().getClass("Class")) { getRuntime().secure(4); } if (!IdUtil.isConstant(name)) { throw getRuntime().newNameError("bad constant name " + name, name); } setConstant(name, value); }
| 3,237,189
|
public void defineMethod(String name, Callback method) { Visibility visibility = name.equals("initialize") ? Visibility.PRIVATE : Visibility.PUBLIC; addMethod(name, new CallbackMethod(this, method, visibility)); }
|
public void defineMethod(String name, Callback method) { Visibility visibility = name.equals("initialize") ? Visibility.PRIVATE : Visibility.PUBLIC; addMethod(name, new CallbackMethod(this, method, visibility)); }
| 3,237,190
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
| 3,237,191
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
| 3,237,192
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
|
public RubyModule defineModuleUnder(String name) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyModule) setConstant(name, getRuntime().defineModuleUnder(name, cref)); } if (!(type instanceof RubyModule)) { throw getRuntime().newTypeError(name + " is not a module."); } return (RubyModule) type; }
| 3,237,193
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
| 3,237,194
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
| 3,237,195
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
| 3,237,196
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
|
public RubyClass defineOrGetClassUnder(String name, RubyClass superClazz) { IRubyObject type = getConstantAt(name); if (type == null) { return (RubyClass) setConstant(name, getRuntime().defineClassUnder(name, superClazz, cref)); } if (!(type instanceof RubyClass)) { throw getRuntime().newTypeError(name + " is not a class."); } return (RubyClass) type; }
| 3,237,197
|
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "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)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
| 3,237,198
|
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "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)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
| 3,237,199
|
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "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)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
| 3,237,200
|
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "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)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
| 3,237,201
|
public IRubyObject define_method(IRubyObject[] args) { if (args.length < 1 || args.length > 2) { throw getRuntime().newArgumentError("wrong # of arguments(" + args.length + " for 1)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "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)"); } IRubyObject body; String name = args[0].asSymbol(); ICallable newMethod = null; ThreadContext tc = getRuntime().getCurrentContext(); Visibility visibility = tc.getCurrentVisibility(); if (visibility.isModuleFunction()) { visibility = Visibility.PRIVATE; } if (args.length == 1 || args[1].isKindOf(getRuntime().getClass("Proc"))) { // double-testing args.length here, but it avoids duplicating the proc-setup code in two places RubyProc proc = (args.length == 1) ? getRuntime().newProc() : (RubyProc)args[1]; body = proc; proc.getBlock().isLambda = true; proc.getBlock().getFrame().setLastClass(this); proc.getBlock().getFrame().setLastFunc(name); newMethod = new ProcMethod(this, proc, visibility); } else if (args[1].isKindOf(getRuntime().getClass("Method"))) { RubyMethod method = (RubyMethod)args[1]; body = method; newMethod = new MethodMethod(this, method.unbind(), visibility); } else { throw getRuntime().newTypeError("wrong argument type " + args[0].getType().getName() + " (expected Proc/Method)"); } addMethod(name, newMethod); RubySymbol symbol = RubySymbol.newSymbol(getRuntime(), name); ThreadContext context = getRuntime().getCurrentContext(); if (tc.getPreviousVisibility().isModuleFunction()) { getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), newMethod, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", symbol); } callMethod(context, "method_added", symbol); return body; }
| 3,237,202
|
protected IRubyObject doClone() { return RubyModule.newModule(getRuntime(), getBaseName(), cref.getNext()); }
|
protected IRubyObject doClone() { return RubyModule.newModule(getRuntime(), getBaseName(), cref.getNext()); }
| 3,237,203
|
public IRubyObject executeUnder(Callback method, IRubyObject[] args) { ThreadContext context = getRuntime().getCurrentContext(); context.preExecuteUnder(this); try { return method.execute(this, args); } finally { context.postExecuteUnder(); } }
|
public IRubyObject executeUnder(Callback method, IRubyObject[] args) { ThreadContext context = getRuntime().getCurrentContext(); context.preExecuteUnder(this); try { return method.execute(this, args); } finally { context.postExecuteUnder(); } }
| 3,237,204
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
| 3,237,205
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
| 3,237,206
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
|
public void exportMethod(String name, Visibility visibility) { if (this == getRuntime().getObject()) { getRuntime().secure(4); } ICallable method = searchMethod(name); if (method.isUndefined()) { throw getRuntime().newNameError("undefined method '" + name + "' for " + (isModule() ? "module" : "class") + " '" + getName() + "'"); } if (method.getVisibility() != visibility) { if (this == method.getImplementationClass()) { method.setVisibility(visibility); } else { final ThreadContext context = getRuntime().getCurrentContext(); addMethod(name, new CallbackMethod(this, new Callback() { public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); } public Arity getArity() { return Arity.optional(); } }, visibility)); } } }
| 3,237,207
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); }
|
public IRubyObject execute(IRubyObject self, IRubyObject[] args) { return context.callSuper(context.getFrameArgs()); }
| 3,237,208
|
public Arity getArity() { return Arity.optional(); }
|
public Arity getArity() { return Arity.optional(); }
| 3,237,209
|
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
|
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
| 3,237,210
|
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
|
public List getAncestorList() { ArrayList list = new ArrayList(); for (RubyModule p = this; p != null; p = p.getSuperClass()) { if(!p.isSingleton()) { list.add(p.getNonIncludedClass()); } } return list; }
| 3,237,211
|
public RubyClass getClass(String name) { IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; }
|
public RubyClass getClass(String name) { IRubyObject module = getConstantAt(name); return (module instanceof RubyClass) ? (RubyClass) module : null; }
| 3,237,212
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
| 3,237,213
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
| 3,237,214
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName()); }
|
public IRubyObject getClassVar(String name) { RubyModule module = getModuleWithInstanceVar(name); if (module != null) { IRubyObject variable = module.getInstanceVariable(name); return variable == null ? getRuntime().getNil() : variable; } throw getRuntime().newNameError("uninitialized class variable " + name + " in " + getName(), name); }
| 3,237,215
|
public IRubyObject getConstantAt(String name) { return getInstanceVariable(name); }
|
public IRubyObject getConstantAt(String name) { return getInstanceVariable(name); }
| 3,237,216
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,217
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,218
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,219
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,220
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,221
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,222
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
|
private IRubyObject getConstantInner(String name, boolean exclude) { IRubyObject objectClass = getRuntime().getObject(); boolean retryForModule = false; RubyModule p = this; retry: while (true) { while (p != null) { IRubyObject constant = p.getConstantAt(name); if (constant == null) { if (getRuntime().getLoadService().autoload(name) != null) { continue; } } if (constant != null) { if (exclude && p == objectClass && this != objectClass) { getRuntime().getWarnings().warn("toplevel constant " + name + " referenced by " + getName() + "::" + name); } return constant; } p = p.getSuperClass(); } if (!exclude && !retryForModule && getClass().equals(RubyModule.class)) { retryForModule = true; p = getRuntime().getObject(); continue retry; } break; } return callMethod(getRuntime().getCurrentContext(), "const_missing", RubySymbol.newSymbol(getRuntime(), name)); }
| 3,237,223
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
| 3,237,224
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
| 3,237,225
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
| 3,237,226
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
| 3,237,227
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
|
public String getName() { if (getBaseName() == null) { if (isClass()) { return "#<" + "Class" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } else { return "#<" + "Module" + ":01x" + Integer.toHexString(System.identityHashCode(this)) + ">"; } } StringBuffer result = new StringBuffer(getBaseName()); RubyClass objectClass = getRuntime().getObject(); for (RubyModule p = this.getParent(); p != null && p != objectClass; p = p.getParent()) { result.insert(0, "::").insert(0, p.getBaseName()); } return result.toString(); }
| 3,237,228
|
public boolean hasModuleInHierarchy(RubyModule type) { // XXX: This check previously used callMethod("==") to check for equality between classes // when scanning the hierarchy. However the == check may be safe; we should only ever have // one instance bound to a given type/constant. If it's found to be unsafe, examine ways // to avoid the == call. for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.getNonIncludedClass() == type) return true; } return false; }
|
public boolean hasModuleInHierarchy(RubyModule type) { // XXX: This check previously used callMethod("==") to check for equality between classes // when scanning the hierarchy. However the == check may be safe; we should only ever have // one instance bound to a given type/constant. If it's found to be unsafe, examine ways // to avoid the == call. for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.getNonIncludedClass() == type) return true; } return false; }
| 3,237,229
|
public RubyModule include(IRubyObject[] modules) { ThreadContext context = getRuntime().getCurrentContext(); for (int i = modules.length - 1; i >= 0; i--) { modules[i].callMethod(context, "append_features", this); modules[i].callMethod(context, "included", this); } return this; }
|
public RubyModule include(IRubyObject[] modules) { ThreadContext context = getRuntime().getCurrentContext(); for (int i = modules.length - 1; i >= 0; i--) { modules[i].callMethod(context, "append_features", this); modules[i].callMethod(context, "included", this); } return this; }
| 3,237,230
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,231
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,232
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,233
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,234
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,235
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,236
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,237
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,238
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
|
public synchronized void includeModule(IRubyObject arg) { assert arg != null; testFrozen("module"); if (!isTaint()) { getRuntime().secure(4); } if (!(arg instanceof RubyModule)) { throw getRuntime().newTypeError("Wrong argument type " + arg.getMetaClass().getName() + " (expected Module)."); } RubyModule module = (RubyModule) arg; // Make sure the module we include does not already exist if (isSame(module)) { return; } infectBy(module); RubyModule p, c; boolean changed = false; boolean skip = false; c = this; while (module != null) { if (getNonIncludedClass() == module.getNonIncludedClass()) { throw getRuntime().newArgumentError("cyclic include detected"); } boolean superclassSeen = false; for (p = getSuperClass(); p != null; p = p.getSuperClass()) { if (p instanceof IncludedModuleWrapper) { if (p.getNonIncludedClass() == module.getNonIncludedClass()) { if (!superclassSeen) { c = p; } skip = true; break; } } else { superclassSeen = true; } } if (!skip) { // In the current logic, if we get here we know that module is not an // IncludedModuleWrapper, so there's no need to fish out the delegate. But just // in case the logic should change later, let's do it anyway: c.setSuperClass(new IncludedModuleWrapper(getRuntime(), c.getSuperClass(), module.getNonIncludedClass())); c = c.getSuperClass(); changed = true; } module = module.getSuperClass(); skip = false; } if (changed) { // MRI seems to blow away its cache completely after an include; is // what we're doing here really safe? for (Iterator iter = ((RubyModule) arg).getMethods().keySet().iterator(); iter.hasNext();) { String methodName = (String) iter.next(); getRuntime().getCacheMap().remove(methodName, searchMethod(methodName)); } } }
| 3,237,239
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,240
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,241
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,242
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,243
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,244
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
|
private RubyArray instance_methods(IRubyObject[] args, final Visibility visibility) { boolean includeSuper = args.length > 0 ? args[0].isTrue() : true; RubyArray ary = getRuntime().newArray(); HashMap undefinedMethods = new HashMap(); for (RubyModule type = this; type != null; type = type.getSuperClass()) { RubyModule realType = type.getNonIncludedClass(); for (Iterator iter = type.getMethods().entrySet().iterator(); iter.hasNext();) { Map.Entry entry = (Map.Entry) iter.next(); ICallable method = (ICallable) entry.getValue(); String methodName = (String) entry.getKey(); if (method.isUndefined()) { undefinedMethods.put(methodName, Boolean.TRUE); continue; } if (method.getImplementationClass() == realType && method.getVisibility().is(visibility) && undefinedMethods.get(methodName) == null) { RubyString name = getRuntime().newString(methodName); if (!ary.includes(name)) { ary.append(name); } } } if (!includeSuper) { break; } } return ary; }
| 3,237,245
|
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
|
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
| 3,237,246
|
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
|
public boolean isKindOfModule(RubyModule type) { for (RubyModule p = this; p != null; p = p.getSuperClass()) { if (p.isSame(type)) { return true; } } return false; }
| 3,237,247
|
public IRubyObject method_added(IRubyObject nothing) { return getRuntime().getNil(); }
|
public IRubyObject method_added(IRubyObject nothing) { return getRuntime().getNil(); }
| 3,237,248
|
public RubyModule module_function(IRubyObject[] args) { if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't change method visibility"); } ThreadContext context = getRuntime().getCurrentContext(); if (args.length == 0) { context.setCurrentVisibility(Visibility.MODULE_FUNCTION); } else { setMethodVisibility(args, Visibility.PRIVATE); for (int i = 0; i < args.length; i++) { String name = args[i].asSymbol(); ICallable method = searchMethod(name); assert !method.isUndefined() : "undefined method '" + name + "'"; getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), method, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", RubySymbol.newSymbol(getRuntime(), name)); } } return this; }
|
public RubyModule module_function(IRubyObject[] args) { if (getRuntime().getSafeLevel() >= 4 && !isTaint()) { throw getRuntime().newSecurityError("Insecure: can't change method visibility"); } ThreadContext context = getRuntime().getCurrentContext(); if (args.length == 0) { context.setCurrentVisibility(Visibility.MODULE_FUNCTION); } else { setMethodVisibility(args, Visibility.PRIVATE); for (int i = 0; i < args.length; i++) { String name = args[i].asSymbol(); ICallable method = searchMethod(name); assert !method.isUndefined() : "undefined method '" + name + "'"; getSingletonClass().addMethod(name, new WrapperCallable(getSingletonClass(), method, Visibility.PUBLIC)); callMethod(context, "singleton_method_added", RubySymbol.newSymbol(getRuntime(), name)); } } return this; }
| 3,237,249
|
public RubyString name() { return getRuntime().newString(getBaseName() == null ? "" : getName()); }
|
public RubyString name() { return getRuntime().newString(getBaseName() == null ? "" : getName()); }
| 3,237,250
|
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
|
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
| 3,237,251
|
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
|
public IncludedModuleWrapper newIncludeClass(RubyClass superClazz) { IncludedModuleWrapper includedModule = new IncludedModuleWrapper(getRuntime(), superClazz, this); // include its parent (and in turn that module's parents) if (getSuperClass() != null) { includedModule.includeModule(getSuperClass()); } return includedModule; }
| 3,237,252
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.