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: 3eb55f47e3d6
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bfa5cad0d95d
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Dec 30, 2016

  1. plenty of classes in the tank - use some of JRuby's instead of a dummy

    minor improvement of class.count -1 for #4266's fix
    kares committed Dec 30, 2016
    Copy the full SHA
    d7c5da5 View commit details
  2. Copy the full SHA
    bfa5cad View commit details
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -2397,7 +2397,7 @@ public IRubyObject collect(ThreadContext context, Block block) {
for (i = 0; i < realLength; i++) {
// Do not coarsen the "safe" check, since it will misinterpret AIOOBE from the yield
// See JRUBY-5434
arr[i] = block.yield(context, safeArrayRef(values, i + begin));
safeArraySet(runtime, arr, i, block.yield(context, safeArrayRef(values, i + begin))); // arr[i] = ...
}

// use iteration count as new size in case something was deleted along the way
11 changes: 0 additions & 11 deletions core/src/main/java/org/jruby/javasupport/DummyForJavaUtil.java

This file was deleted.

5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/javasupport/Java.java
Original file line number Diff line number Diff line change
@@ -1424,4 +1424,9 @@ static boolean isDefaultMethod(final Method method) {
return false;
}

/**
* @see JavaUtil#CAN_SET_ACCESSIBLE
*/
@SuppressWarnings("unused") private static final byte _ = 72;

}
11 changes: 6 additions & 5 deletions core/src/main/java/org/jruby/javasupport/JavaUtil.java
Original file line number Diff line number Diff line change
@@ -98,12 +98,13 @@ public class JavaUtil {

if (RubyInstanceConfig.CAN_SET_ACCESSIBLE) {
try {
// We want to check if we can access a commonly-existing private field through reflection. If so,
// we're probably able to access some other fields too later on.
Field f = DummyForJavaUtil.class.getDeclaredField("PRIVATE");
// We want to check if we can access a commonly-existing private field through reflection.
// If so, we're probably able to access some other fields too later on.
Field f = Java.class.getDeclaredField("_");
f.setAccessible(true);
canSetAccessible = f.get(null).equals(DummyForJavaUtil.PUBLIC);
} catch (Exception t) {
canSetAccessible = f.getByte(null) == 72;
}
catch (Exception t) {
// added this so if things are weird in the future we can debug without
// spinning a new binary
if (Options.JI_LOGCANSETACCESSIBLE.load()) {