Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into update_stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 4, 2014
2 parents 668a4bd + 1df19df commit 822abec
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/main/ruby/jruby/java/core_ext/object.rb
Expand Up @@ -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
Expand Down

0 comments on commit 822abec

Please sign in to comment.