Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into test-jossl-0.10.0
Browse files Browse the repository at this point in the history
kares authored May 17, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 6a22347 + 482159b commit 760f7e3
Showing 100 changed files with 403 additions and 14,099 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -53,7 +53,10 @@ lib/ruby/cext/
lib/ruby/gems
lib/ruby/stdlib/*.jar
lib/ruby/stdlib/ant*
lib/ruby/stdlib/cmath.rb
lib/ruby/stdlib/csv.rb
lib/ruby/stdlib/did_you_mean*
lib/ruby/stdlib/fileutils.rb
lib/ruby/stdlib/gauntlet_rdoc.rb
lib/ruby/stdlib/ipaddr*
lib/ruby/stdlib/jar*
@@ -75,6 +78,8 @@ lib/ruby/stdlib/readline*
lib/ruby/stdlib/minitest*
lib/ruby/stdlib/power_assert*
lib/ruby/stdlib/psych*
lib/ruby/stdlib/scanf.rb
lib/ruby/stdlib/webrick*
lib/ruby/stdlib/**/maven-metadata-local.xml
release.properties
share
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -43,7 +43,6 @@ env:
- PHASE='-Prake -Dtask=test:mri:fullint'
- PHASE='-Prake -Dtask=test:mri:jit'
- PHASE='-Prake -Dtask=test:slow_suites'
- PHASE='-Prake -Dtask=test:tracing'
- PHASE='-Prake -Dtask=spec:ji'
- PHASE='-Prake -Dtask=spec:compiler'
- PHASE='-Prake -Dtask=spec:compiler' JRUBY_OPTS=-Xcompile.invokedynamic
8 changes: 4 additions & 4 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -42,12 +42,12 @@

# exclude jnr-ffi to avoid problems with shading and relocation of the asm packages
jar 'com.github.jnr:jnr-netdb:1.1.6', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-enxio:0.16', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-enxio:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.17', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.44', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.19', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.45', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.9', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.1.7'
jar 'com.github.jnr:jnr-ffi:2.1.8'
jar 'com.github.jnr:jffi:${jffi.version}'
jar 'com.github.jnr:jffi:${jffi.version}:native'

8 changes: 4 additions & 4 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-enxio</artifactId>
<version>0.16</version>
<version>0.17</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -123,7 +123,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-unixsocket</artifactId>
<version>0.17</version>
<version>0.19</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -134,7 +134,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.44</version>
<version>3.0.45</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -156,7 +156,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-ffi</artifactId>
<version>2.1.7</version>
<version>2.1.8</version>
</dependency>
<dependency>
<groupId>com.github.jnr</groupId>
19 changes: 13 additions & 6 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -3814,6 +3814,10 @@ public RaiseException newErrnoEMSGSIZEError() {
return newRaiseException(getErrno().getClass("EMSGSIZE"), null);
}

public RaiseException newErrnoEXDEVError(String message) {
return newRaiseException(getErrno().getClass("EXDEV"), message);
}

public RaiseException newIndexError(String message) {
return newRaiseException(getIndexError(), message);
}
@@ -4264,13 +4268,16 @@ private RaiseException newLightweightErrnoException(RubyClass exceptionClass, St
*/
public RaiseException newStopIteration(IRubyObject result, String message) {
final ThreadContext context = getCurrentContext();
if (RubyInstanceConfig.STOPITERATION_BACKTRACE) {
RubyException ex = RubyStopIteration.newInstance(context, result, message);
return ex.toThrowable();
}
if ( message == null ) message = STOPIERATION_BACKTRACE_MESSAGE;

if (message == null) message = STOPIERATION_BACKTRACE_MESSAGE;

RubyException ex = RubyStopIteration.newInstance(context, result, message);
return RaiseException.from(ex, disabledBacktrace());

if (!RubyInstanceConfig.STOPITERATION_BACKTRACE) {
ex.forceBacktrace(disabledBacktrace());
}

return ex.toThrowable();
}

@Deprecated
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -4601,7 +4601,7 @@ public IRubyObject sumCommon(final ThreadContext context, IRubyObject init, fina
if (result instanceof RubyInteger) {
result = ((RubyInteger) result).op_plus(context, value);
} else if (result instanceof RubyRational) {
result = ((RubyRational) result).op_add(context, value);
result = ((RubyRational) result).op_plus(context, value);
} else {
throw runtime.newTypeError("BUG: unexpected type in rational part of Array#sum");
}
20 changes: 7 additions & 13 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Original file line number Diff line number Diff line change
@@ -1111,14 +1111,6 @@ public synchronized Object dataGetStruct() {
return getInternalVariable("__wrap_struct__");
}

// Equivalent of Data_Get_Struct
// This will first check that the object in question is actually a T_DATA equivalent.
@Override
public synchronized Object dataGetStructChecked() {
TypeConverter.checkData(this);
return getInternalVariable("__wrap_struct__");
}

/** rb_obj_id
*
* Return the internal id of an object.
@@ -3107,11 +3099,6 @@ private static BasicObjectSites sites(ThreadContext context) {

// Deprecated methods below this line

@Deprecated
public IRubyObject initialize() {
return getRuntime().getNil();
}

@Deprecated
protected RubyBasicObject(Ruby runtime, RubyClass metaClass, boolean useObjectSpace, boolean canBeTainted) {
this(runtime, metaClass, useObjectSpace);
@@ -3243,6 +3230,13 @@ public final Object getNativeHandle() {
public final void setNativeHandle(Object value) {
}

@Override
@Deprecated
public synchronized Object dataGetStructChecked() {
TypeConverter.checkData(this);
return getInternalVariable("__wrap_struct__");
}

@Deprecated
public static final int FL_USHIFT = 4;
@Deprecated
14 changes: 14 additions & 0 deletions core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@
import java.net.URL;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
@@ -1083,6 +1084,19 @@ public static IRubyObject rename(ThreadContext context, IRubyObject recv, IRubyO
newFile.delete();
}

// Check if source file and dest parent are on same filesystem or raise EXDEV
Path oldPath = Paths.get(oldFile.toURI());
Path destPath = Paths.get(dest.getAbsolutePath());
try {
FileStore oldStore = Files.getFileStore(oldPath);
FileStore destStore = Files.getFileStore(destPath.getParent());
if (!oldStore.equals(destStore)) {
throw runtime.newErrnoEXDEVError("(" + oldFile + ", " + dest + ")");
}
} catch (IOException ioe) {
throw Helpers.newIOErrorFromException(runtime, ioe);
}

if (oldFile.renameTo(dest)) { // try to rename one more time
return RubyFixnum.zero(runtime);
}
6 changes: 6 additions & 0 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
import org.jcodings.specific.ASCIIEncoding;
import org.jcodings.transcode.EConvFlags;
import org.jruby.api.API;
import org.jruby.exceptions.EOFError;
import org.jruby.runtime.Helpers;
import org.jruby.runtime.JavaSites.IOSites;
import org.jruby.runtime.callsite.CachingCallSite;
@@ -4300,6 +4301,8 @@ public static IRubyObject copy_stream(ThreadContext context, IRubyObject recv, I
local1 = true;
} else if (sites.respond_to_read.respondsTo(context, arg1, arg1, true)) {
channel1 = new IOChannel.IOReadableByteChannel(arg1);
} else if (sites.respond_to_readpartial.respondsTo(context, arg1, arg1, true)) {
channel1 = new IOChannel.IOReadableByteChannel(arg1, "readpartial");
} else {
throw runtime.newArgumentError("Should be String or IO");
}
@@ -4378,6 +4381,9 @@ public static IRubyObject copy_stream(ThreadContext context, IRubyObject recv, I
}
}

return context.runtime.newFixnum(size);
} catch (EOFError eof) {
// ignore EOF, reached end of input
return context.runtime.newFixnum(size);
} catch (IOException ioe) {
ioe.printStackTrace();
4 changes: 3 additions & 1 deletion core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -882,7 +882,9 @@ public static IRubyObject raise(ThreadContext context, IRubyObject recv, IRubyOb
raise = convertToException(runtime, args[0], args[1]).toThrowable();
break;
default:
raise = RaiseException.from(convertToException(runtime, args[0], args[1]), args[2]);
RubyException exception = convertToException(runtime, args[0], args[1]);
exception.forceBacktrace(args[2]);
raise = exception.toThrowable();
break;
}

Loading

0 comments on commit 760f7e3

Please sign in to comment.