Skip to content

Commit

Permalink
Merge branch 'jruby-9.1'
Browse files Browse the repository at this point in the history
headius committed Nov 21, 2017

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nomadium Miguel Landaeta
2 parents ee351ad + 8d5b2ca commit e2a43de
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -180,10 +180,12 @@ fi
# ----- Execute The Requested Command -----------------------------------------
JAVA_ENCODING=""

if [ -e "/dev/urandom" ]; then
if [ -r "/dev/urandom" ]; then
# OpenJDK tries really hard to prevent you from using urandom.
# See https://bugs.openjdk.java.net/browse/JDK-6202721
JAVA_SECURITY_EGD="/dev/./urandom"
# Non-file URL causes fallback to slow threaded SeedGenerator.
# See https://bz.apache.org/bugzilla/show_bug.cgi?id=56139
JAVA_SECURITY_EGD="file:/dev/urandom"
fi

declare -a java_args
5 changes: 4 additions & 1 deletion core/src/main/java/org/jruby/javasupport/Java.java
Original file line number Diff line number Diff line change
@@ -961,13 +961,16 @@ private static RubyModule getProxyClassOrNull(final Ruby runtime, final String c
// cannot link Java class com.sample.FooBar needs Java 8 (java.lang.UnsupportedClassVersionError: com/sample/FooBar : Unsupported major.minor version 52.0)
throw runtime.newNameError("cannot link Java class " + className + ' ' + msg, className, ex, false);
}
catch (NoClassDefFoundError | ClassNotFoundException ncdfe) {
// let caller try other names
return null;
}
catch (LinkageError ex) {
throw runtime.newNameError("cannot link Java class " + className + ' ' + '(' + ex + ')', className, ex, false);
}
catch (SecurityException ex) {
throw runtime.newSecurityError(ex.getLocalizedMessage());
}
catch (ClassNotFoundException ex) { return null; }

if ( initJavaClass ) {
return getProxyClass(runtime, JavaClass.get(runtime, clazz));
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/parser/StaticScope.java
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ protected StaticScope(Type type, StaticScope enclosingScope, ByteList[] names, i
this.variableNames = names;
this.variableNamesLength = names.length;
this.type = type;
this.irScope = null;
this.irScope = enclosingScope == null ? null : enclosingScope.irScope;
this.isBlockOrEval = (type != Type.LOCAL);
this.isArgumentScope = !isBlockOrEval;
this.firstKeywordIndex = firstKeywordIndex;
4 changes: 4 additions & 0 deletions spec/ruby/language/BEGIN_spec.rb
Original file line number Diff line number Diff line change
@@ -29,4 +29,8 @@

ScratchPad.recorded.should == ['foo', 'bar']
end

it "returns the top-level script's filename for __FILE__" do
ruby_exe(fixture(__FILE__, "begin_file.rb")).chomp.should =~ /begin_file\.rb$/
end
end

0 comments on commit e2a43de

Please sign in to comment.