Skip to content

Commit

Permalink
Merge branch 'jruby-9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 19, 2018
2 parents a3661da + 86b956b commit b30ed1c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
@@ -1,5 +1,6 @@
package org.jruby.javasupport.binding;

import com.headius.modulator.Modulator;
import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyModule;
Expand Down Expand Up @@ -539,6 +540,9 @@ private static int addNewMethods(
// Skip private methods, since they may mess with dispatch
if ( Modifier.isPrivate(mod) ) continue;

// Skip protected methods if we can't set accessible
if ( !Modifier.isPublic(mod) && !Modulator.trySetAccessible(method)) continue;

// ignore bridge methods because we'd rather directly call methods that this method
// is bridging (and such methods are by definition always available.)
if ( ( mod & ACC_BRIDGE ) != 0 ) continue;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java
Expand Up @@ -879,7 +879,7 @@ private int yylex() throws IOException {
continue;
case '#': { /* it's a comment */
this.tokenSeen = tokenSeen;
if (!tokenSeen || !warnings.isVerbose()) {
if (!tokenSeen || warnings.isVerbose()) {
if (!parser_magic_comment(lexb.makeShared(lex_p, lex_pend - lex_p))) {
if (comment_at_top()) set_file_encoding(lex_p, lex_pend);
}
Expand Down
12 changes: 12 additions & 0 deletions spec/java_integration/methods/dispatch_spec.rb
Expand Up @@ -293,3 +293,15 @@
end.not_to raise_error
end
end

if TestHelper::JAVA_9
describe "An overridden Java method" do
describe "with a non-public base implementation" do
it "is called using a public override" do
expect do
java.util.Properties.new.clone
end.not_to raise_error
end
end
end
end
1 change: 1 addition & 0 deletions test/jruby/test_helper.rb
Expand Up @@ -47,6 +47,7 @@ module TestHelper
IBM_JVM = RbConfig::CONFIG['host_vendor'] =~ /IBM Corporation/

JAVA_8 = ENV_JAVA['java.specification.version'] >= '1.8'
JAVA_9 = ENV_JAVA['java.specification.version'] > '1.8'

def q
WINDOWS ? '"' : '\''
Expand Down

0 comments on commit b30ed1c

Please sign in to comment.