From 0be2d0ee2dfb7c57bd235bf56de02a51979469b0 Mon Sep 17 00:00:00 2001 From: Nick Sieger Date: Wed, 8 Jun 2011 15:01:27 -0500 Subject: [PATCH] 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. --- lib/rhino/context.rb | 8 ++++---- spec/rhino/wormhole_spec.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rhino/context.rb b/lib/rhino/context.rb index a8009f0..5e69a24 100644 --- a/lib/rhino/context.rb +++ b/lib/rhino/context.rb @@ -31,7 +31,7 @@ module Rhino # end # # == 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. class Context @@ -150,7 +150,7 @@ module Rhino end - class IOReader < Java::JavaIo::Reader #:nodoc: + class IOReader < java.io.Reader #:nodoc: def initialize(io) @io = io @@ -162,14 +162,14 @@ module Rhino if str.nil? return -1 else - jstring = Java::JavaLang::String.new(str) + jstring = java.lang.String.new(str) for i in 0 .. jstring.length - 1 charbuffer[i + offset] = jstring.charAt(i) end return jstring.length end 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 diff --git a/spec/rhino/wormhole_spec.rb b/spec/rhino/wormhole_spec.rb index 4f9993d..49c084d 100644 --- a/spec/rhino/wormhole_spec.rb +++ b/spec/rhino/wormhole_spec.rb @@ -53,7 +53,7 @@ describe Rhino::To do it "it unwraps wrapped java objects" do Context.open do |cx| 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| To.ruby(o).should == "Hello World" end @@ -132,4 +132,4 @@ describe Rhino::To do def to(object) To.javascript(object) end -end \ No newline at end of file +end