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: 652664323c42
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d0584dbb3d5c
Choose a head ref
  • 4 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 18, 2014

  1. Copy the full SHA
    3dc06a8 View commit details

Commits on Jan 12, 2015

  1. Copy the full SHA
    7d29f53 View commit details
  2. Fix formatting.

    headius committed Jan 12, 2015
    Copy the full SHA
    732de48 View commit details
  3. Merge branch 'lumeet-2324'

    headius committed Jan 12, 2015
    Copy the full SHA
    d0584db View commit details
Showing with 13 additions and 1 deletion.
  1. +13 −1 core/src/main/ruby/jruby/java/core_ext/object.rb
14 changes: 13 additions & 1 deletion core/src/main/ruby/jruby/java/core_ext/object.rb
Original file line number Diff line number Diff line change
@@ -16,8 +16,20 @@ def java_kind_of?(other)
return other.java_class.assignable_from?(self.java_class)
end

# Import one or many Java classes as follows:
#
# java_import java.lang.System
# java_import java.lang.System, java.lang.Thread
# java_import [java.lang.System, java.lang.Thread]
#
def java_import(*import_classes)
import_classes.flatten!
import_classes = import_classes.each_with_object([]) do |classes, flattened|
if classes.is_a?(Array)
flattened.push *classes
else
flattened.push classes
end
end

import_classes.map do |import_class|
case import_class