Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 760957dc7f50
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 28ec5de6758e
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Jan 6, 2015

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    32be2df View commit details
  2. Typos.

    headius committed Jan 6, 2015
    Copy the full SHA
    f4a1b0b View commit details
  3. Copy the full SHA
    28ec5de View commit details
28 changes: 19 additions & 9 deletions core/src/main/java/org/jruby/AbstractRubyMethod.java
Original file line number Diff line number Diff line change
@@ -36,11 +36,13 @@
import org.jruby.ext.jruby.JRubyLibrary;
import org.jruby.internal.runtime.methods.DynamicMethod;
import org.jruby.internal.runtime.methods.ProcMethod;
import org.jruby.internal.runtime.methods.UndefinedMethod;
import org.jruby.runtime.Block;
import org.jruby.runtime.BlockBody;
import org.jruby.runtime.ClassIndex;
import org.jruby.runtime.CompiledBlockCallback19;
import org.jruby.runtime.CompiledBlockLight19;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.PositionAware;
import org.jruby.runtime.ThreadContext;
@@ -82,20 +84,15 @@ public RubyFixnum arity() {
return getRuntime().newFixnum(method.getArity().getValue());
}

@JRubyMethod(name = "eql?", required = 1, compat = CompatVersion.RUBY1_9)
@JRubyMethod(name = "eql?", required = 1)
public IRubyObject op_eql19(ThreadContext context, IRubyObject other) {
return op_equal(context, other);
}

public abstract AbstractRubyMethod rbClone();

@JRubyMethod(name = "name", compat = CompatVersion.RUBY1_8)
@JRubyMethod(name = "name")
public IRubyObject name(ThreadContext context) {
return context.runtime.newString(methodName);
}

@JRubyMethod(name = "name", compat = CompatVersion.RUBY1_9)
public IRubyObject name19(ThreadContext context) {
return context.runtime.newSymbol(methodName);
}

@@ -108,7 +105,7 @@ public IRubyObject owner(ThreadContext context) {
return implementationModule;
}

@JRubyMethod(name = "source_location", compat = CompatVersion.RUBY1_9)
@JRubyMethod(name = "source_location")
public IRubyObject source_location(ThreadContext context) {
Ruby runtime = context.runtime;

@@ -138,9 +135,22 @@ public int getLine() {
return -1;
}

@JRubyMethod(name = "parameters", compat = CompatVersion.RUBY1_9)
@JRubyMethod(name = "parameters")
public IRubyObject parameters(ThreadContext context) {
return JRubyLibrary.MethodExtensions.methodArgs(this);
}

protected IRubyObject super_method(ThreadContext context, IRubyObject receiver, RubyModule superClass) {
if (superClass == null) return context.runtime.getNil();

DynamicMethod newMethod = superClass.searchMethod(methodName);
if (newMethod == UndefinedMethod.INSTANCE) return context.runtime.getNil();

if (receiver == null) {
return RubyUnboundMethod.newUnboundMethod(superClass, methodName, superClass, originName, newMethod);
} else {
return RubyMethod.newMethod(superClass, methodName, superClass, originName, newMethod, receiver);
}
}
}

26 changes: 0 additions & 26 deletions core/src/main/java/org/jruby/RubyMethod.java
Original file line number Diff line number Diff line change
@@ -246,19 +246,6 @@ public IRubyObject inspect() {
return str;
}

public IRubyObject name(ThreadContext context) {
return name19(context);
}

@JRubyMethod(name = "name")
public IRubyObject name19(ThreadContext context) {
return context.runtime.newSymbol(methodName);
}

public String getMethodName() {
return methodName;
}

@JRubyMethod
public IRubyObject receiver(ThreadContext context) {
return receiver;
@@ -314,18 +301,5 @@ public IRubyObject super_method(ThreadContext context) {
RubyModule superClass = Helpers.findImplementerIfNecessary(receiver.getMetaClass(), implementationModule).getSuperClass();
return super_method(context, receiver, superClass);
}

protected IRubyObject super_method(ThreadContext context, IRubyObject receiver, RubyModule superClass) {
if (superClass == null) return context.runtime.getNil();

DynamicMethod newMethod = superClass.searchMethod(methodName);
if (newMethod == UndefinedMethod.INSTANCE) return context.runtime.getNil();

if (receiver == null) {
return RubyUnboundMethod.newUnboundMethod(superClass, methodName, superClass, originName, newMethod);
} else {
return newMethod(superClass, methodName, superClass, originName, newMethod, receiver);
}
}
}

17 changes: 0 additions & 17 deletions core/src/main/java/org/jruby/RubyUnboundMethod.java
Original file line number Diff line number Diff line change
@@ -138,23 +138,6 @@ public IRubyObject inspect() {
return str;
}

@Override
public IRubyObject name(ThreadContext context) {
return name19(context);
}

@JRubyMethod(name = "name")
@Override
public IRubyObject name19(ThreadContext context) {
return context.runtime.newSymbol(methodName);
}

@JRubyMethod
@Override
public IRubyObject owner(ThreadContext context) {
return implementationModule;
}

@JRubyMethod
public IRubyObject super_method(ThreadContext context ) {
return super_method(context, null, implementationModule.getSuperClass());
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/util/io/PosixShim.java
Original file line number Diff line number Diff line change
@@ -83,8 +83,8 @@ public int write(ChannelFD fd, byte[] bytes, int offset, int length, boolean non
try {
if (nonblock) {
// TODO: figure out what nonblocking writes against atypical streams (files?) actually do
// Ff we can't set the channel nonblocking, I'm not sure what we can do to
// pretend the channel is blocking.
// If we can't set the channel nonblocking, I'm not sure what we can do to
// pretend the channel is nonblocking.
}

int written = fd.chWrite.write(tmp);