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

Commits on Apr 29, 2015

  1. putting the jruby-classloader as context classloader means that all a…

    …ttached "jars" can be found via
    
    the Thread.currentThread.contextClassLoader. running jruby from other environments like servlets just
    leave the context classloader as is. so this was a commandline only feature.
    
    finally it keeps the classloader semantic uniform wether executed from commandline or inside a j2ee container
    or osgi framework or embedded jruby in a java application
    mkristian committed Apr 29, 2015
    3
    Copy the full SHA
    ff10216 View commit details
  2. back to SNAPSHOT version

    mkristian committed Apr 29, 2015
    Copy the full SHA
    83767d5 View commit details
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0.0.pre2
9.0.0.0-SNAPSHOT
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
14 changes: 0 additions & 14 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -283,8 +283,6 @@ public void run() {
}

try {
doSetContextClassLoader(runtime);

if (in == null) {
// no script to run, return success
return new Status();
@@ -454,18 +452,6 @@ private boolean checkStreamSyntax(Ruby runtime, InputStream in, String filename)
}
}

private void doSetContextClassLoader(Ruby runtime) {
// set thread context JRuby classloader here, for the main thread
try {
Thread.currentThread().setContextClassLoader(runtime.getJRubyClassLoader());
} catch (SecurityException se) {
// can't set TC classloader
if (runtime.getInstanceConfig().isVerbose()) {
config.getError().println("WARNING: Security restrictions disallowed setting context classloader for main thread.");
}
}
}

private void doProcessArguments(InputStream in) {
config.processArguments(config.parseShebangOptions(in));
}
4 changes: 2 additions & 2 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-stdlib</artifactId>
<name>JRuby Lib Setup</name>
@@ -22,7 +22,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-core</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
100 changes: 0 additions & 100 deletions lib/ruby/shared/ffi/platform/ppc64le-linux/types.conf

This file was deleted.

2 changes: 1 addition & 1 deletion maven/jruby-complete/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-complete</artifactId>
<packaging>bundle</packaging>
2 changes: 1 addition & 1 deletion maven/jruby-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-dist</artifactId>
<packaging>pom</packaging>
7 changes: 3 additions & 4 deletions maven/jruby-jars/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<groupId>rubygems</groupId>
<artifactId>jruby-jars</artifactId>
@@ -43,7 +43,6 @@ freezing to) a specific jruby-complete jar version.</description>
<url>http://github.com/jruby/jruby/tree/master/gem/jruby-jars</url>
</scm>
<properties>
<jruby.home>${basedir}/../..</jruby.home>
<tesla.dump.readonly>true</tesla.dump.readonly>
<gem.home>${jruby_home}/lib/ruby/gems/shared</gem.home>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
@@ -73,7 +72,7 @@ freezing to) a specific jruby-complete jar version.</description>
</extension>
</extensions>
<directory>${basedir}/pkg</directory>
<finalName>${project.artifactId}-9.0.0.0.pre2</finalName>
<finalName>${project.artifactId}-9.0.0.0.SNAPSHOT</finalName>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
@@ -120,7 +119,7 @@ freezing to) a specific jruby-complete jar version.</description>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<properties>
<ruby.version>9.0.0.0.pre2</ruby.version>
<ruby.version>9.0.0.0.SNAPSHOT</ruby.version>
<gem.home>${project.build.directory}/rubygems</gem.home>
<gem.path>${project.build.directory}/rubygems</gem.path>
</properties>
2 changes: 1 addition & 1 deletion maven/jruby/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby</artifactId>
<name>JRuby Main Maven Artifact</name>
2 changes: 1 addition & 1 deletion maven/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-artifacts</artifactId>
<packaging>pom</packaging>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
</parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.pre2</version>
<version>9.0.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JRuby</name>
<description>JRuby is the effort to recreate the Ruby (http://www.ruby-lang.org) interpreter in Java.</description>
6 changes: 4 additions & 2 deletions spec/java_integration/reify/become_java_spec.rb
Original file line number Diff line number Diff line change
@@ -112,8 +112,10 @@ def blah_with_args(arg_one,arg_two)
class JRUBY5564; end
a_class = JRUBY5564.become_java!(false)

# load the java class from the classloader
cl = java.lang.Thread.current_thread.getContextClassLoader
# load the java class from the jruby-classloader
# this diverts from the original issue 5564 since
# JRuby can run without any context_class_loader involved
cl = JRuby.runtime.jruby_class_loader
cl.load_class(a_class.get_name).should == a_class
end

5 changes: 1 addition & 4 deletions test/jruby/test_context_classloader.rb
Original file line number Diff line number Diff line change
@@ -12,10 +12,7 @@ def setup
end

def test_main_thread
# This launches externally because our test run doesn't call through Main,
# so the executing thread's context classloader is not set to JRuby's.
assert_equal("true\n",
jruby('-rjava -rjruby -e "p(JRuby.runtime.jruby_class_loader == java.lang.Thread.current_thread.context_class_loader)"'))
assert_equal(JRuby.runtime.jruby_class_loader.parent, java.lang.Thread.current_thread.context_class_loader)
end

def test_ruby_thread
Loading