1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00

Change from internal 'Java::JavaLang' to recommended 'java.lang'

The JRuby team recommends using the package/method-call-style
notation. The camel-cased module name mapping is not intended for
public consumption.
This commit is contained in:
Nick Sieger 2011-06-08 15:01:27 -05:00
parent d08b275b77
commit 0be2d0ee2d
2 changed files with 6 additions and 6 deletions

View file

@ -31,7 +31,7 @@ module Rhino
# end # end
# #
# == Notes # == Notes
# While there are many similarities between Rhino::Context and Java::OrgMozillaJavascript::Context, they are not # While there are many similarities between Rhino::Context and Java::org.mozilla.javascript.Context, they are not
# the same thing and should not be confused. # the same thing and should not be confused.
class Context class Context
@ -150,7 +150,7 @@ module Rhino
end end
class IOReader < Java::JavaIo::Reader #:nodoc: class IOReader < java.io.Reader #:nodoc:
def initialize(io) def initialize(io)
@io = io @io = io
@ -162,14 +162,14 @@ module Rhino
if str.nil? if str.nil?
return -1 return -1
else else
jstring = Java::JavaLang::String.new(str) jstring = java.lang.String.new(str)
for i in 0 .. jstring.length - 1 for i in 0 .. jstring.length - 1
charbuffer[i + offset] = jstring.charAt(i) charbuffer[i + offset] = jstring.charAt(i)
end end
return jstring.length return jstring.length
end end
rescue StandardError => e rescue StandardError => e
raise Java::JavaIo::IOException.new, "Failed reading from ruby IO object" raise java.io.IOException.new, "Failed reading from ruby IO object"
end end
end end
end end

View file

@ -53,7 +53,7 @@ describe Rhino::To do
it "it unwraps wrapped java objects" do it "it unwraps wrapped java objects" do
Context.open do |cx| Context.open do |cx|
scope = cx.scope scope = cx.scope
Java::JavaLang::String.new("Hello World").tap do |str| java.lang.String.new("Hello World").tap do |str|
J::NativeJavaObject.new(scope.j, str, str.getClass()).tap do |o| J::NativeJavaObject.new(scope.j, str, str.getClass()).tap do |o|
To.ruby(o).should == "Hello World" To.ruby(o).should == "Hello World"
end end
@ -132,4 +132,4 @@ describe Rhino::To do
def to(object) def to(object)
To.javascript(object) To.javascript(object)
end end
end end