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

Commits on May 10, 2016

  1. Copy the full SHA
    1a219af View commit details
  2. Remove outdated JI test.

    headius committed May 10, 2016
    Copy the full SHA
    ae9772e View commit details
Showing with 11 additions and 12 deletions.
  1. +11 −0 core/src/main/java/org/jruby/RubyFile.java
  2. +0 −12 test/jruby/test_java_extension.rb
11 changes: 11 additions & 0 deletions core/src/main/java/org/jruby/RubyFile.java
Original file line number Diff line number Diff line change
@@ -1557,6 +1557,17 @@ private static IRubyObject expandPathInternal(ThreadContext context, IRubyObject

RubyString origPath = StringSupport.checkEmbeddedNulls(runtime, get_path(context, args[0]));
String relativePath = origPath.getUnicodeValue();

// Encoding logic lives in MRI's rb_file_expand_path_internal and should roughly equate to the following:
// * Paths expanded from the system, like ~ expanding to the user's home dir, should be filesystem-encoded.
// * Calls with a relative directory should use the encoding of that string.
// * Remaining calls should use the encoding of the incoming path string.
//
// We have our own system-like cases (e.g. URI expansion) that we do not set to the filesystem encoding
// because they are not really filesystem paths; they're in-process or network paths.
//
// See dac9850 and jruby/jruby#3849.

Encoding enc = origPath.getEncoding();
// for special paths like ~
Encoding fsenc = runtime.getEncodingService().getFileSystemEncoding();
12 changes: 0 additions & 12 deletions test/jruby/test_java_extension.rb
Original file line number Diff line number Diff line change
@@ -303,18 +303,6 @@ def test_overriding_protected_method
end
end

class CallAbstractInConstructor < org.jruby.test.Abstract
def initialize; super("call protected method in constructor!") end

def protected_method; "HELLO!" end
end

def test_calling_abstract_method_in_java_constructor
skip('this leaking in super constructor (calling Ruby implemented methods)')
#a = CallAbstractInConstructor.new
#assert_equal "HELLO!", a.result
end

def test_map_interface_to_array
hash = {"one"=>"two","three"=>"four"}
map = java.util.HashMap.new(hash)