@@ -32,93 +32,99 @@ def static?
3232# *java.lang.Runnable* instances allow for a `to_proc` conversion.
3333# @see http://docs.oracle.com/javase/8/docs/api/java/lang/Runnable.html
3434module Java ::java ::lang ::Runnable
35+ # @return [Proc] calling #run when caled
3536 def to_proc
36- proc { self . run }
37+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
38+ # proc { self.run }
3739 end
38- end
40+ end if false
3941
4042# A `java.lang.Iterable` will act like a Ruby `Enumerable`.
4143# @see http://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html
4244module Java ::java ::lang ::Iterable
4345 include ::Enumerable
4446
45- def each
46- iter = iterator
47- yield ( iter . next ) while iter . hasNext
47+ # Ruby style `Enumerable#each` iteration for Java iterable types.
48+ # @return [Enumerator] if called without a block to yield to
49+ def each ( &block )
50+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
51+ # iter = iterator
52+ # yield(iter.next) while iter.hasNext
4853 end
4954
50- def each_with_index
51- index = 0
52- iter = iterator
53- while iter . hasNext
54- yield ( iter . next , index )
55- index += 1
56- end
55+ # Ruby style `Enumerable#each_with_index` for Java iterable types.
56+ # @return [Enumerator] if called without a block to yield to
57+ def each_with_index ( &block )
58+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
59+ # index = 0
60+ # iter = iterator
61+ # while iter.hasNext
62+ # yield(iter.next, index)
63+ # index += 1
64+ # end
5765 end
58- end
66+ end if false
5967
6068# *java.lang.Comparable* mixes in Ruby's `Comparable` support.
6169# @see http://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html
6270module Java ::java ::lang ::Comparable
6371 include ::Comparable
6472
6573 def <=>( a )
66- return nil if a . nil?
67- compareTo ( a )
74+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
75+ # return nil if a.nil?
76+ # compareTo(a)
6877 end
69- end
78+ end if false
7079
7180# Java's *java.lang.Throwable* (exception/errors) classes resemble Ruby's `Exception`.
7281# @see http://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html
7382class Java ::java ::lang ::Throwable
7483
84+ # @return [Array] the mapped stack-trace
7585 def backtrace
76- stack_trace . map ( &:to_s )
86+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
87+ # stack_trace.map(&:to_s)
7788 end
7889
79- # @note Noop as Java exceptions can not change trace.
90+ # @note Noop as Java exceptions can not change their stack- trace.
8091 def set_backtrace ( trace )
92+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
8193 end
8294
8395 # Always a non-nil to follow Ruby's {Exception#message} conventions.
8496 # @note getMessage still returns nil, when no message was given for the Java exception!
8597 # @return [String]
8698 def message
87- getLocalizedMessage || ''
99+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
100+ # getLocalizedMessage || ''
88101 end
89102
90103 def to_s
91- message
104+ # message
92105 end
93106
94107 def inspect
95- to_string
108+ # to_string
96109 end
97110
98- class << self
99- alias :old_eqq :===
100- def ===( rhs )
101- if ( NativeException == rhs . class ) && ( java_class . assignable_from? ( rhs . cause . java_class ) )
102- true
103- else
104- old_eqq ( rhs )
105- end
106- end
111+ def self . ===( ex )
112+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
107113 end
108- end
114+
115+ end if false
109116
110117class Java ::java ::lang ::Character
111- java_alias :isJavaIdentifierStart_char , :isJavaIdentifierStart , [ Java ::char ]
112- java_alias :isJavaIdentifierPart_char , :isJavaIdentifierPart , [ Java ::char ]
113118
114- def self . java_identifier_start? ( fixnum )
115- isJavaIdentifierStart_char ( fixnum ) ;
119+ def self . java_identifier_start? ( char )
120+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
116121 end
117122
118- def self . java_identifier_part? ( fixnum )
119- isJavaIdentifierPart_char ( fixnum ) ;
123+ def self . java_identifier_part? ( char )
124+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
120125 end
121- end
126+
127+ end if false
122128
123129# *java.lang.Class*
124130# @see http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html
@@ -128,55 +134,60 @@ class Java::java::lang::Class
128134 include ::JavaUtilities ::ModifierShortcuts
129135
130136 def ruby_class
131- ::JRuby . runtime . java_support . get_proxy_class_from_cache ( self )
137+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
138+ # ::JRuby.runtime.java_support.get_proxy_class_from_cache(self)
132139 end
133140
134141 alias to_s name
135142
136143 def inspect
137- "class #{ name } "
144+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
138145 end
139146
140147 def resource_as_string ( name )
141- resource_as_stream ( name ) . to_io . read
148+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
149+ # resource_as_stream(name).to_io.read
142150 end
143151
144152 alias annotation get_annotation
145153
146154 def annotations?
147- !annotations . empty?
155+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
156+ # !annotations.empty?
148157 end
149158
150159 def declared_annotations?
151- !declared_annotations . empty?
160+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
161+ # !declared_annotations.empty?
152162 end
153163
154164 alias annotation_present? is_annotation_present
155165
156166 def <=>( other )
157- return nil unless other . class == java ::lang ::Class
158-
159- return 0 if self == other
160- return 1 if self . is_assignable_from ( other )
161- return -1 if other . is_assignable_from ( self )
167+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
168+ # return nil unless other.class == java::lang::Class
169+ #
170+ # return 0 if self == other
171+ # return 1 if self.is_assignable_from(other)
172+ # return -1 if other.is_assignable_from(self)
162173 end
163174
164175 def java_instance_methods
165- methods . select { | m | ! Modifier . is_static ( m . modifiers ) } . freeze
176+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
166177 end
167178
168179 def declared_instance_methods
169- declared_methods . select { | m | ! Modifier . is_static ( m . modifiers ) } . freeze
180+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
170181 end
171182
172183 def java_class_methods
173- methods . select { | m | Modifier . is_static ( m . modifiers ) } . freeze
184+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
174185 end
175186
176187 def declared_class_methods
177- declared_methods . select { | m | Modifier . is_static ( m . modifiers ) } . freeze
188+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
178189 end
179- end
190+ end if false
180191
181192# *java.lang.ClassLoader*
182193# @see http://docs.oracle.com/javase/8/docs/api/java/lang/ClassLoader.html
@@ -185,31 +196,32 @@ class Java::java::lang::ClassLoader
185196 alias resource_as_url get_resource
186197
187198 def resource_as_string ( name )
188- resource_as_stream ( name ) . to_io . read
199+ # stub implemented in org.jruby.javasupport.ext.JavaLang.java
200+ # resource_as_stream(name).to_io.read
189201 end
190- end
202+ end if false
191203
192204class Java ::java ::lang ::reflect ::AccessibleObject
193205 include ::JavaUtilities ::ModifierShortcuts
194206
195207 alias inspect to_s
196- end
208+ end if false
197209
198210class Java ::java ::lang ::reflect ::Constructor
199211 def return_type
200212 nil
201213 end
202214
203215 alias argument_types parameter_types
204- end
216+ end if false
205217
206218class Java ::java ::lang ::reflect ::Method
207219 def invoke_static ( *args )
208220 invoke ( nil , *args )
209221 end
210222
211223 alias argument_types parameter_types
212- end
224+ end if false
213225
214226class Java ::java ::lang ::reflect ::Field
215227 alias value_type name
@@ -223,7 +235,7 @@ def static_value
223235 def set_static_value ( val )
224236 set ( nil , val )
225237 end
226- end
238+ end if false
227239
228240Java ::byte [ ] . class_eval do
229241 def ubyte_get ( index )
@@ -236,4 +248,4 @@ def ubyte_set(index, value)
236248 value -= 256 if value > 127
237249 self [ index ] = value
238250 end
239- end
251+ end if false
0 commit comments