Skip to content

Commit

Permalink
Merge branch 'master' into ruby-2.3
Browse files Browse the repository at this point in the history
* master: (28 commits)
  single Unsafe retrieval is enough - do not do it over again in StringSupport
  [test] add and pend load module wrapping test - does not work for this case currently
  make JavaMethod arity sub-classes open-closed with call overrides (for less surprises)
  Add a simple issue template for contributors.
  [Truffle] Strip out internal NilNodes when flattening a sequence.
  [Truffle] Break down IfNode into If, IfElse and Unless so they can be simpler.
  [Truffle] BreakShellException is dead code.
  [Truffle] Tidy up NotNode.
  [Truffle] Tidy up IfNode.
  [Truffle] Tidy up OrNode.
  [Truffle] Tidy up AndNode.
  [Truffle] Couple of minor cosmetic fixes to the backtrace package.
  [Truffle] Interleaving Java should be configured per-formatter.
  [Truffle] Remove print_interleaved_backtrace, as we can do it with -Xtruffle.backtraces.interleave_java now.
  [Truffle] Option to interleave Java stacktraces in Ruby backtraces.
  [Truffle] Store Java exceptions in some cases.
  [Truffle] Optionally store Java stack traces in Ruby backtraces.
  [Truffle] Simplify long-winded comment.
  [Truffle] Move check_ambiguous_arguments to allowed failures.
  test that public_send correctly dispatches native Java methods (closing #3668)
  ...
kares committed Feb 18, 2016
2 parents e0450e5 + e6b9bcc commit ec23586
Showing 34 changed files with 403 additions and 221 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -77,6 +77,8 @@ matrix:
# jdk: oraclejdk8
allow_failures:
- env: PHASE='-Prake -Dtask=test:mri:fullint'
- env: JT=check_ambiguous_arguments
jdk: oraclejdk8
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
#- env: PHASE='-Pmain'
# sudo: required
34 changes: 34 additions & 0 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
This is a simple template for filing JRuby isuses.
Please help us help you by providing the information below.
Text inside XML comment tags will not be shown in your report.
-->

### Environment

<!--
Provide at least:
* JRuby version (`jruby -v`) and command line (flags, JRUBY_OPTS, etc)
* Operating system and platform (e.g. `uname -a`)
Other relevant info you may wish to add:
* Installed or activated gems
* Application/framework version (e.g. Rails, Sinatra)
* Environment variables
-->

### Expected Behavior

<!--
Describe your expectation of how JRuby should behave.
Provide an executable Ruby script or a link to an example repository.
-->

### Actual Behavior

<!--
Describe or show the actual behavior.
Provide text or screen capture showing the behavior.
-->
25 changes: 13 additions & 12 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -4614,14 +4614,14 @@ public IRubyObject squeeze19(ThreadContext context) {
return str;
}

@JRubyMethod(name = "squeeze")
@JRubyMethod(name = "squeeze", required = 1)
public IRubyObject squeeze19(ThreadContext context, IRubyObject arg) {
RubyString str = strDup(context.runtime);
str.squeeze_bang19(context, arg);
return str;
}

@JRubyMethod(name = "squeeze", rest = true)
@JRubyMethod(name = "squeeze", required = 2, rest = true)
public IRubyObject squeeze19(ThreadContext context, IRubyObject[] args) {
RubyString str = strDup(context.runtime);
str.squeeze_bang19(context, args);
@@ -4630,11 +4630,12 @@ public IRubyObject squeeze19(ThreadContext context, IRubyObject[] args) {

@JRubyMethod(name = "squeeze!")
public IRubyObject squeeze_bang19(ThreadContext context) {
Ruby runtime = context.runtime;
if (value.getRealSize() == 0) {
modifyCheck();
return runtime.getNil();
return context.nil;
}
final Ruby runtime = context.runtime;

final boolean squeeze[] = new boolean[StringSupport.TRANS_SIZE];
for (int i=0; i< StringSupport.TRANS_SIZE; i++) squeeze[i] = true;

@@ -4652,9 +4653,9 @@ public IRubyObject squeeze_bang19(ThreadContext context) {
return this;
}

@JRubyMethod(name = "squeeze!")
@JRubyMethod(name = "squeeze!", required = 1)
public IRubyObject squeeze_bang19(ThreadContext context, IRubyObject arg) {
Ruby runtime = context.runtime;
final Ruby runtime = context.runtime;

RubyString otherStr = arg.convertToString();
final boolean squeeze[] = new boolean[StringSupport.TRANS_SIZE + 1];
@@ -4674,29 +4675,29 @@ public IRubyObject squeeze_bang19(ThreadContext context, IRubyObject arg) {
return this;
}

@JRubyMethod(name = "squeeze!", rest = true)
@JRubyMethod(name = "squeeze!", rest = true, required = 2)
public IRubyObject squeeze_bang19(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
if (value.getRealSize() == 0) {
modifyCheck();
return runtime.getNil();
return context.nil;
}
final Ruby runtime = context.runtime;

RubyString otherStr = args[0].convertToString();
Encoding enc = checkEncoding(otherStr);
final boolean squeeze[] = new boolean[StringSupport.TRANS_SIZE + 1];
StringSupport.TrTables tables = StringSupport.trSetupTable(otherStr.value, runtime, squeeze, null, true, enc);

boolean singlebyte = singleByteOptimizable() && otherStr.singleByteOptimizable();
boolean singleByte = singleByteOptimizable() && otherStr.singleByteOptimizable();
for (int i=1; i<args.length; i++) {
otherStr = args[i].convertToString();
enc = checkEncoding(otherStr);
singlebyte = singlebyte && otherStr.singleByteOptimizable();
singleByte = singleByte && otherStr.singleByteOptimizable();
tables = StringSupport.trSetupTable(otherStr.value, runtime, squeeze, tables, false, enc);
}

modifyAndKeepCodeRange();
if (singlebyte) {
if (singleByte) {
if (! StringSupport.singleByteSqueeze(value, squeeze)) {
return runtime.getNil();
}
4 changes: 1 addition & 3 deletions core/src/main/java/org/jruby/ext/zlib/ZlibLibrary.java
Original file line number Diff line number Diff line change
@@ -27,13 +27,11 @@
***** END LICENSE BLOCK *****/
package org.jruby.ext.zlib;

import java.io.IOException;

import org.jruby.Ruby;
import org.jruby.runtime.load.Library;

public class ZlibLibrary implements Library {
public void load(final Ruby runtime, boolean wrap) throws IOException {
public void load(final Ruby runtime, boolean wrap) {
RubyZlib.createZlibModule(runtime);
}
}
Loading

0 comments on commit ec23586

Please sign in to comment.