Skip to content

Commit

Permalink
Showing 7 changed files with 22 additions and 8 deletions.
5 changes: 4 additions & 1 deletion COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JRuby is Copyright (c) 2007-2014 The JRuby project, and is released
JRuby is Copyright (c) 2007-2015 The JRuby project, and is released
under a tri EPL/GPL/LGPL license. You can use it, redistribute it
and/or modify it under the terms of the:

@@ -12,6 +12,9 @@ bytelist (http://github.com/jruby/bytelist),
yydebug (http://svn.codehaus.org/jruby/trunk/jay/yydebug)
are released under the same copyright/license.

The Truffle component is copyright (c) 2013-2015 Oracle and/or its
affiliates and is released under the same licenses.

Some additional libraries distributed with JRuby are not covered by
JRuby's licence. Most of these libraries and their licenses are listed
below. Also see LICENSE.RUBY for most files found in lib/ruby/stdlib.
4 changes: 3 additions & 1 deletion core/pom.rb
Original file line number Diff line number Diff line change
@@ -206,7 +206,9 @@
:id => 'default-clean',
:phase => 'clean',
'filesets' => [ { 'directory' => '${project.build.sourceDirectory}',
'includes' => [ '${Constants.java}' ] } ],
'includes' => [ '${Constants.java}' ] },
{ 'directory' => '${project.basedir}/..',
'includes' => [ 'bin/jruby' ] } ],
'failOnError' => 'false' )
end

6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -539,6 +539,12 @@ DO NOT MODIFIY - GENERATED CODE
<include>${Constants.java}</include>
</includes>
</fileset>
<fileset>
<directory>${project.basedir}/..</directory>
<includes>
<include>bin/jruby</include>
</includes>
</fileset>
</filesets>
<failOnError>false</failOnError>
</configuration>
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -337,7 +337,7 @@ public static IRubyObject num2fix(IRubyObject val) {
*/
public static RubyInteger str2inum(Ruby runtime, RubyString str, int base, boolean strict) {
ByteList s = str.getByteList();
return ConvertBytes.byteListToInum(runtime, s, base, strict);
return ConvertBytes.byteListToInum19(runtime, s, base, strict);
}

/**
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -3289,6 +3289,7 @@ private long checkBase(IRubyObject arg0) {
/** rb_str_to_inum
*
*/
@Deprecated
public IRubyObject stringToInum(int base, boolean badcheck) {
ByteList s = this.value;
return ConvertBytes.byteListToInum(getRuntime(), s, base, badcheck);
@@ -3311,7 +3312,7 @@ public IRubyObject oct19(ThreadContext context) {
if (!value.getEncoding().isAsciiCompatible()) {
throw context.runtime.newEncodingCompatibilityError("ASCII incompatible encoding: " + value.getEncoding());
}
return stringToInum(-8, false);
return stringToInum19(-8, false);
}

/** rb_str_hex
8 changes: 5 additions & 3 deletions core/src/main/java/org/jruby/util/ConvertBytes.java
Original file line number Diff line number Diff line change
@@ -21,9 +21,10 @@ public class ConvertBytes {
private final boolean is19;

public ConvertBytes(Ruby runtime, ByteList _str, int base, boolean badcheck) {
this(runtime, _str, base, badcheck, false);
this(runtime, _str, base, badcheck, true);
}

@Deprecated
public ConvertBytes(Ruby runtime, ByteList _str, int base, boolean badcheck, boolean is19) {
this.runtime = runtime;
this._str = _str;
@@ -229,12 +230,13 @@ public static final byte[] twosComplementToUnsignedBytes(byte[] in, int shift, b
/** rb_cstr_to_inum
*
*/
@Deprecated
public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck) {
return new ConvertBytes(runtime, str, base, badcheck).byteListToInum();
return new ConvertBytes(runtime, str, base, badcheck, false).byteListToInum();
}

public static RubyInteger byteListToInum19(Ruby runtime, ByteList str, int base, boolean badcheck) {
return new ConvertBytes(runtime, str, base, badcheck, true).byteListToInum();
return new ConvertBytes(runtime, str, base, badcheck).byteListToInum();
}

private final static byte[] conv_digit = new byte[128];
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/Sprintf.java
Original file line number Diff line number Diff line change
@@ -605,7 +605,7 @@ else if ((flags & FLAG_MINUS) != 0) {
arg = RubyNumeric.dbl2num(arg.getRuntime(),((RubyFloat)arg).getValue());
break;
case STRING:
arg = ((RubyString)arg).stringToInum(0, true);
arg = ((RubyString)arg).stringToInum19(0, true);
break;
default:
if (arg.respondsTo("to_int")) {

0 comments on commit 08b752f

Please sign in to comment.