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

Commits on Nov 2, 2014

  1. Copy the full SHA
    b42424d View commit details

Commits on Nov 4, 2014

  1. Merge pull request #2075 from byteit101/master

    Provide better error message when using :: in java_import (fixes #2074)
    headius committed Nov 4, 2014
    Copy the full SHA
    1df19df View commit details
Showing with 8 additions and 0 deletions.
  1. +8 −0 core/src/main/ruby/jruby/java/core_ext/object.rb
8 changes: 8 additions & 0 deletions core/src/main/ruby/jruby/java/core_ext/object.rb
Original file line number Diff line number Diff line change
@@ -22,6 +22,14 @@ def java_import(*import_classes)
import_classes.map do |import_class|
case import_class
when String
cc = java.lang.Character
valid_name = import_class.split(".").all? do |frag|
cc.java_identifier_start? frag[0].ord and
frag.each_char.all? {|c| cc.java_identifier_part? c.ord }
end
unless valid_name
raise ArgumentError.new "not a valid Java identifier: #{import_class}"
end
# pull in the class
import_class = JavaUtilities.get_proxy_class(import_class)
when Module