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: b2919d66e447^
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 93bb20672b3f
Choose a head ref

Commits on Mar 22, 2016

  1. introduce (native) JavaPackage replacement for JavaPackageModuleTemplate

    with makeMetaClass - previous package module meta-class attaching
    ... should no longer be necessary
    kares committed Mar 22, 2016
    Copy the full SHA
    516fa6b View commit details
  2. Copy the full SHA
    b899bfc View commit details
  3. Copy the full SHA
    d806532 View commit details
  4. Copy the full SHA
    999f9fe View commit details
  5. Copy the full SHA
    a489792 View commit details
  6. Copy the full SHA
    3769acd View commit details
  7. Copy the full SHA
    82af8af View commit details
  8. Copy the full SHA
    e4125f3 View commit details
  9. Copy the full SHA
    c0bb0b0 View commit details
  10. Copy the full SHA
    6d816ba View commit details
  11. Copy the full SHA
    682549b View commit details
  12. handle more Kernel methods in Java packages "right" (including name)

    - `pkg.name` has been working since 1.7.22/9.0.1.0 (#2468)
    - handling :object_id as it is quite surprising to not have
    - can handle :throw/:catch since they're not valid package names
    - commented-out methods that would be good to have as well
    kares committed Mar 22, 2016
    Copy the full SHA
    75e2e8a View commit details
  13. Copy the full SHA
    772e6b1 View commit details
  14. Copy the full SHA
    644fb8b View commit details
  15. Copy the full SHA
    8d3979f View commit details
  16. Copy the full SHA
    7e757a8 View commit details
  17. Copy the full SHA
    d93aa2e View commit details
  18. [test] how packages behave when a method collides (e.g. on pkg.name)

    and assert that `pkg.object_id` works as expected!
    kares committed Mar 22, 2016
    Copy the full SHA
    d975f4c View commit details
  19. Copy the full SHA
    80966be View commit details

Commits on Mar 23, 2016

  1. [ji] keep (deprecated) JavaPackageModuleTemplate constant for compati…

    …bility
    
    ... its probably fine to remove - but just in case
    kares committed Mar 23, 2016
    Copy the full SHA
    f226b78 View commit details
  2. [ji] packages shall try to handle respond_to? and respond_to_missing?…

    … right
    
    ... also restored singleton method hooks for compatibility with previous versions
    kares committed Mar 23, 2016
    Copy the full SHA
    4036c08 View commit details

Commits on Mar 26, 2016

  1. Copy the full SHA
    9411be4 View commit details

Commits on Mar 28, 2016

  1. Squashed 'spec/ruby/' changes from 8d632d3..f5d943e

    f5d943e A few cosmetic fixes in Thread#backtrace spec
    38cc7ef Basic tests of Thread#backtrace
    c062803 Test where class variables are defined and updated
    9f94d6c Add a spec for adding two invalid strings together that results in a valid one
    86ddccf Fixed Symbol.all_symbols spec.
    a98b62d Wait for a thread status change rather than a random amount of time in rb_thread_blocking_region
    3dba3bf Merge pull request #219 from donv/basic_coverage_specs
    2e7722e adapt realpath specs to run on Windows
    6f1fbd4 syslog is POSIX-only
    d9b2e19 adapt realdirpath specs to run on Windows
    e80ca16 Process.daemon is not implemented on Windows
    801850b Guard unicode path spec not working on Windows
    b6c738b Dir.home with an argument is not working on Windows
    aa55259 Update for changes in mspec's home_directory helper
    25e443c Removing problematic path in dir specs for Windows
    8f3e280 Show remaining files if delete_mock_dirs fails
    83a11ee Merge pull request #216 from ruby/vais/windows
    53b800f Skip all specs that rely on fork on Windows
    76811e1 Wrap a few remaining fork-using specs in with_feature :fork block
    937be98 Use explicit receiver for the helper method
    afbcef4 Change namespace odule to CoverageSpecs to avoid clashing with stdlib
    0ecdf4d Guarded specs for peek_result for Ruby 2.3 Used raise_error helper instead of customer begin...rescue
    da7b44b Added specs for peek_result Pulled helper method to separate SpecHelper module
    607e7ea Filter old results from result hash
    3f65bbd Added specs for multiple runs
    c3e050f Added a basic spec for counts
    490cc2d Merge pull request #217 from donv/try_add_coverage_spec
    dbaf24f Started adding spec for coverage
    0f2743d Merge pull request #218 from donv/test_mri_2.3
    86f19a1 Start testing MRI 2.3.x
    07ea93b Fix indent
    7e241f7 Fix typo
    1a2d168 Reasonable precision in Bignum#* spec
    342f9ae Merge pull request #215 from ruby/vais/windows
    854cd89 Run AppVeyor only on master and try* branches
    fe5acba Passing all WIN32OLE specs
    e36ff82 Merge pull request #214 from ruby/vais/windows
    4575e16 Skip the entire ARGF.read_nonblock spec on Windows
    f580a29 Merge pull request #212 from wied03/master
    323d258 Cover another alias/super case
    504eea0 Revert "Clean up the entire spec temp dir when finished with mock dirs."
    8d75627 AppVeyor: use an inclusion filter
    182a683 AppVeyor: fix last commit
    4f24a03 AppVeyor: exclude C-API specs for now
    40411ed AppVeyor: use the file formatter
    ea7d4ba Remove branch filter in appveyor.yml
    bfa4a13 Make sure the Signalizer is not run on Windows since it hangs
    3bbc6ae Try to run the LeakChecker under AppVeyor
    a9c496a Add setup for AppVeyor
    06e8a89 Merge pull request #210 from odaira/myContribution
    9c17cb6 Merge pull request #211 from ruby/vais/windows
    8b5c3eb Pass ENV specs on Windows
    2307c18 Remove extra File.join in DirSpecs.nonexistent
    eaaf635 Module#{include,prepend} are public since 2.1
    b144eac Remove 'ruby_version_is ""..."2.1" do' guards since 2.1 is now the lowest version
    32c5020 Remove 'ruby_version_is "2.1" do' guards since this is now the lowest version
    c0b7368 Modify a test that succeeds or fails depending on today's date in a year. Time#gmtoff values match only when both or neither of the Time objects are in summer time
    2458625 Drop support for 2.0.0 as it is no longer supported
    6d4e6f4 Merge pull request #208 from ruby/vais/argf
    52eff83 Pass ARGF.binmode on Windows
    e8c46eb Fix leak in Kernel#open
    5080525 Choose a more appropriate error class in C-API thread specs
    c55e620 Fix 2 thread leaks in C-API specs
    0c65308 Terminate the WEBrick timeout thread when supported
    6d0be63 Fix thread leak in Thread#name spec
    ddf7d41 Show leaked subprocess pid
    c7a99a6 Revert "Remove now useless Process.waitall"
    9676480 Fix subprocess leaks in ObjectSpace.define_finalizer specs
    3229895 Do not leak a Dir in Marshal#load specs
    4ff6dd5 Fix fd leak in Dir#fileno setup
    32c48c7 Remove now useless Process.waitall
    4d73980 Wait for subprocess to die in Process specs
    b513748 Close the pipe reading-side in the parent as well to avoid leaking a fd
    a277946 Unshare Process.times since there is only one usage
    c67efe7 Merge pull request #205 from unak/patch-4
    ff2c878 get rid of blocking on Windows
    5a1ea16 Merge pull request #204 from unak/patch-3
    7a2f6b0 Should not assume to exist outer commands.
    3b52dae Merge pull request #203 from unak/patch-2
    87898e6 Wrong assumption
    adbe6d5 Make STDIN non-EOF
    add86e1 Revert "Remove problematic specs"
    8b5cb71 Remove problematic specs
    265cc4c fixup! remove unguaranteed behavior
    d8aadfb remove unguaranteed behavior
    56d2e70 remove rb_class_inherited spec
    4056f12 Remove unreliable spec
    01bad6a Do not spec Unicode changing behavior
    2258d1d Add missing 2.1 version guards.
    3a80eb8 Add missing 2.3 version guards
    8825b5f Add a spec for autoloading a constant that was already loaded by another thread
    9be9a58 ObjectSpace._id2ref raises for invalid ID values
    9d7f072 Move String#@{+,-} specs to the right files
    a579440 Added String#-@ and String#+@
    974a254 Remove redundant specs
    6a44638 Added NameError#receiver spec
    e976989 Add specs for rb_time_timespec_new
    1b4d6a2 Add specs for rb_define_class_id_under
    d61a24c Add a spec for rb_define_class_under when given a mismatched superclass
    4e64448 add example which specs behavior of Proc#for_define_method when procs @ruby_method is set
    cba082b Added local variable methods to Binding
    3c5e63d Use the argf helper in ARGF.read_nonblock
    0938149 Added specs for ARGF.read_nonblock
    b960ebe Spec Enumerable#sort_by when #map does not return an array
    51b21d0 Use describe, rephrase spec description
    523f780 Fix count when enumerable yields multiple values
    62c1c8c Reword spec description
    309fda6 Add a spec covering Array#product returning self when given a block
    d9bbeb1 Add another failing specs for zsuper with keyword arguments
    89e8773 Fix Kernel#rand when given a Float exclusive range.
    08dd725 Added failing specs for zsuper with rest kwargs
    a828e0d Add failing specs for slice_* when iterator method is changed
    7bb5997 Add specs for IO#{read,write}_nonblock accepting exception option
    51fe64d Add specs for ARGF.readpartial
    f5b730c Add a spec covering clearing output buffer of ARGF.read
    214cf9e add failing spec for String.new with optional encoding argument
    48fd956 Move Hash comparison specs to the right files
    7ed5840 Avoid the new_hash helper
    9c43b34 Add specs for Hash comparison operators
    4f7eaa5 Fixed some 64bit assumptions in specs.
    1e84f38 Fix a typo in Enumerator::Lazy specs
    48060b6 Add specs for File.mkfifo
    1e971da Add specs for #dig with no arguments
    59b2043 Add specs for Enumerator::Lazy#grep_v
    38801cd Add specs for Hash#to_proc
    93c40ee Add a spec for setting thread's group in rb_thread_create
    668056f Add a spec covering rb_rescue returning the break value when the passed function yields to a block with a break
    34bf4b5 Added 2.3 specs for #positive? and #negative?
    3988aac multiple calls of close, close_read, and close_write should no longer raise IOError
    065e422 Add specs for #dig implmenetation for Hash, Array and Struct classes
    0be9395 puts: Make it more compatible to MRI
    e3c3858 spec 2.2 behavior where limit 0 raises ArgumentError
    d4f49e6 puts: Check if argument responds to :to_ary, instead of checking its type being Array
    cc7a472 Add spec for Enumerable#first with multiple yield parameters
    7ca9596 Automatically run Travis on try* branches
    ba0bd69 Merge pull request #202 from wied03/master
    f6ed69a NoMethodError should not require a name (because underlying NameError class does not)
    81977c9 sprintf: test infinite and nan float values
    37d0d3c Merge pull request #201 from nobu/no-new_ostruct_member
    c800735 Do not test method for internal use
    
    git-subtree-dir: spec/ruby
    git-subtree-split: f5d943e19e980264de972b6d1b49c927e527053b
    eregon committed Mar 28, 2016
    Copy the full SHA
    6240e31 View commit details
  2. Copy the full SHA
    b38ba18 View commit details
  3. Copy the full SHA
    0034504 View commit details
  4. Copy the full SHA
    ea64ba1 View commit details
  5. Copy the full SHA
    cb0f0a9 View commit details
  6. [Truffle] Switched to optimized RopeNodes.GetByteNode for single byte…

    …-optimizable String#ord.
    nirvdrum committed Mar 28, 2016
    Copy the full SHA
    ca4915f View commit details
  7. Copy the full SHA
    43dddfb View commit details
  8. Add tags for new specs.

    eregon committed Mar 28, 2016
    Copy the full SHA
    d851678 View commit details
  9. Add tag for failing CI spec

    eregon committed Mar 28, 2016
    Copy the full SHA
    f66b250 View commit details
  10. Copy the full SHA
    56736f2 View commit details
  11. Copy the full SHA
    e9ed318 View commit details
  12. Copy the full SHA
    e729b93 View commit details
  13. Copy the full SHA
    3a8e29e View commit details
  14. Copy the full SHA
    ed32c9d View commit details
  15. Copy the full SHA
    9fa250c View commit details
  16. Copy the full SHA
    bb231d1 View commit details
  17. Copy the full SHA
    aabf1fc View commit details
  18. Copy the full SHA
    af60d2d View commit details
  19. Copy the full SHA
    c4304ef View commit details
  20. Copy the full SHA
    9b23c30 View commit details
  21. Copy the full SHA
    72dcd4b View commit details
  22. Copy the full SHA
    fa87feb View commit details
  23. Copy the full SHA
    76cddce View commit details
  24. Copy the full SHA
    1aafbc1 View commit details
  25. Copy the full SHA
    e16aba4 View commit details
  26. Copy the full SHA
    133574e View commit details
  27. Copy the full SHA
    e896b50 View commit details
  28. [Truffle] Separate the format read nodes which read from an array and…

    … those that read from bytes.
    chrisseaton committed Mar 28, 2016
    Copy the full SHA
    c614f0a View commit details
Showing 768 changed files with 14,414 additions and 9,921 deletions.
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -6,11 +6,14 @@ sudo: false
# directories:
# - $HOME/.m2

before_script:
before_install:
- export MAVEN_SKIP_RC=true
- export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
- mvn -Xmx32M -v | grep 1.7.0; if [ $? = 0 ]; then export MAVEN_OPTS="-XX:MaxPermSize=240M"; else export MAVEN_OPTS="-XX:MaxMetaspaceSize=240M -XX:CompressedClassSpaceSize=240M"; fi
- export MAVEN_OPTS="-Xmx512M $MAVEN_OPTS"

before_script:
- unset GEM_PATH GEM_HOME IRBRC JRUBY_OPTS
- "export PATH=`pwd`/bin:$PATH"
- export PATH="`pwd`/bin:$PATH"
- echo $HOME

jdk:
@@ -22,15 +25,16 @@ os:

env:
global:
- JAVA_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx512M"
- JAVA_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmn48M -Xmx512M"
- MALLOC_ARENA_MAX=2
matrix:
- JT='test specs :command_line'
- JT='test specs :language'
- JT='test specs :core'
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test integration fast'
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m"
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true

matrix:
include:
@@ -43,9 +47,9 @@ matrix:
- env: JT=check_ambiguous_arguments
jdk: oraclejdk8
- env: JT='test mri'
- env: PHASE='-Pmain'
- env: PHASE='-Pmain --projects !truffle'
jdk: oraclejdk8
- env: PHASE='-Pj2ee'
- env: PHASE='-Pj2ee --projects !truffle'
jdk: oraclejdk7
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
#- env: PHASE='-Pmain'
@@ -83,3 +87,6 @@ notifications:
# we are on a branch
on_success: always
on_failure: never

services:
- redis-server
57 changes: 30 additions & 27 deletions core/src/main/java/org/jruby/NativeException.java
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ public NativeException(Ruby runtime, RubyClass rubyClass, Throwable cause) {
private NativeException(Ruby runtime, RubyClass rubyClass) {
super(runtime, rubyClass);
this.cause = new Throwable();
this.message = runtime.newString();
this.message = RubyString.newEmptyString(runtime);
}

private static ObjectAllocator NATIVE_EXCEPTION_ALLOCATOR = new ObjectAllocator() {
@@ -72,32 +72,43 @@ public static RubyClass createClass(Ruby runtime, RubyClass baseClass) {
}

@JRubyMethod
public final IRubyObject cause() {
return Java.getInstance(getRuntime(), getCause());
}

@Deprecated
public IRubyObject cause(Block unusedBlock) {
return Java.getInstance(getRuntime(), cause);
return cause();
}

public IRubyObject backtrace() {
@Override
public final IRubyObject backtrace() {
IRubyObject rubyTrace = super.backtrace();
if (rubyTrace.isNil()) {
return rubyTrace;
}
if ( rubyTrace.isNil() ) return rubyTrace;

final Ruby runtime = getRuntime();
RubyArray array = (RubyArray) rubyTrace.dup();
StackTraceElement[] stackTrace = cause.getStackTrace();
for (int i = stackTrace.length - 1; i >= 0; i--) {
StackTraceElement element = stackTrace[i];
final RubyArray rTrace = (RubyArray) rubyTrace;
StackTraceElement[] jTrace = cause.getStackTrace();
final IRubyObject[] trace = new IRubyObject[jTrace.length + rTrace.size()];
final StringBuilder line = new StringBuilder(32);
for ( int i = 0; i < jTrace.length; i++ ) {
StackTraceElement element = jTrace[i];
final String className = element.getClassName();
final String line;
line.setLength(0);
if (element.getFileName() == null) {
line = className + ':' + element.getLineNumber() + ":in `" + element.getMethodName() + '\'';
line.append(className).append(':').append(element.getLineNumber()).append(":in `").append(element.getMethodName()).append('\'');
} else {
final int index = className.lastIndexOf('.');
final String packageName = index == -1 ? "" : className.substring(0, index) + '/';
line = packageName.replace('.', '/') + element.getFileName() + ':' + element.getLineNumber() + ":in `" + element.getMethodName() + '\'';
if ( index > - 1 ) {
line.append(className.substring(0, index).replace('.', '/'));
line.append('/');
}
line.append(element.getFileName()).append(':').append(element.getLineNumber()).append(":in `").append(element.getMethodName()).append('\'');
}
array.unshift(runtime.newString(line));
trace[i] = RubyString.newString(runtime, line.toString());
}
return array;
System.arraycopy(rTrace.toJavaArrayMaybeUnsafe(), 0, trace, jTrace.length, rTrace.size());
return RubyArray.newArrayNoCopy(runtime, trace);
}

@Deprecated // not used
@@ -139,14 +150,6 @@ public void trimStackTrace(Member target) {
}
}

public void printBacktrace(PrintStream errorStream) {
super.printBacktrace(errorStream);
if (getRuntime().isDebug()) {
errorStream.println("Complete Java stackTrace");
cause.printStackTrace(errorStream);
}
}

public final Throwable getCause() {
return cause;
}
@@ -155,9 +158,9 @@ private static String searchStackMessage(Throwable cause) {
String message;
do {
message = cause.getMessage();
if ( message != null ) return message;
cause = cause.getCause();
} while (message == null && cause != null);

return message;
} while ( cause != null );
return null;
}
}
Loading