From ca291b996fae1e2636a1bace5bd57ddb3723cd3d Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 4 Jan 2024 13:21:00 -0600 Subject: [PATCH] Remove redundant required= for fixed-arity methods --- .../java/org/jruby/AbstractRubyMethod.java | 2 +- .../src/main/java/org/jruby/RubyArgsFile.java | 2 +- .../org/jruby/RubyArithmeticSequence.java | 2 +- core/src/main/java/org/jruby/RubyArray.java | 38 +-- .../main/java/org/jruby/RubyBasicObject.java | 4 +- core/src/main/java/org/jruby/RubyBignum.java | 12 +- core/src/main/java/org/jruby/RubyBinding.java | 2 +- core/src/main/java/org/jruby/RubyChain.java | 2 +- core/src/main/java/org/jruby/RubyClass.java | 4 +- .../java/org/jruby/RubyClassPathVariable.java | 2 +- .../main/java/org/jruby/RubyComparable.java | 12 +- core/src/main/java/org/jruby/RubyDir.java | 8 +- .../src/main/java/org/jruby/RubyEncoding.java | 2 +- .../main/java/org/jruby/RubyEnumerable.java | 4 +- .../main/java/org/jruby/RubyEnumerator.java | 2 +- .../main/java/org/jruby/RubyException.java | 2 +- core/src/main/java/org/jruby/RubyFile.java | 10 +- .../src/main/java/org/jruby/RubyFileStat.java | 6 +- .../src/main/java/org/jruby/RubyFileTest.java | 92 +++---- core/src/main/java/org/jruby/RubyFloat.java | 30 +-- core/src/main/java/org/jruby/RubyGlobal.java | 8 +- core/src/main/java/org/jruby/RubyHash.java | 20 +- core/src/main/java/org/jruby/RubyIO.java | 14 +- core/src/main/java/org/jruby/RubyInteger.java | 6 +- core/src/main/java/org/jruby/RubyKernel.java | 26 +- .../main/java/org/jruby/RubyMatchData.java | 4 +- core/src/main/java/org/jruby/RubyMath.java | 50 ++-- core/src/main/java/org/jruby/RubyMethod.java | 6 +- core/src/main/java/org/jruby/RubyModule.java | 56 ++--- core/src/main/java/org/jruby/RubyNil.java | 8 +- .../main/java/org/jruby/RubyObjectSpace.java | 4 +- core/src/main/java/org/jruby/RubyProcess.java | 26 +- core/src/main/java/org/jruby/RubyRandom.java | 4 +- core/src/main/java/org/jruby/RubyRange.java | 6 +- core/src/main/java/org/jruby/RubyRegexp.java | 8 +- core/src/main/java/org/jruby/RubySignal.java | 10 +- core/src/main/java/org/jruby/RubyString.java | 12 +- core/src/main/java/org/jruby/RubyStruct.java | 10 +- core/src/main/java/org/jruby/RubySymbol.java | 4 +- core/src/main/java/org/jruby/RubyThread.java | 14 +- core/src/main/java/org/jruby/RubyTime.java | 24 +- .../java/org/jruby/RubyUnboundMethod.java | 2 +- .../jruby/ext/bigdecimal/RubyBigDecimal.java | 26 +- .../java/org/jruby/ext/date/RubyDate.java | 6 +- .../main/java/org/jruby/ext/etc/RubyEtc.java | 10 +- .../org/jruby/ext/ffi/AbstractMemory.java | 224 +++++++++--------- .../main/java/org/jruby/ext/ffi/Buffer.java | 2 +- .../java/org/jruby/ext/ffi/MemoryPointer.java | 4 +- .../main/java/org/jruby/ext/ffi/Pointer.java | 2 +- .../main/java/org/jruby/ext/ffi/Struct.java | 4 +- .../java/org/jruby/ext/ffi/StructLayout.java | 4 +- .../src/main/java/org/jruby/ext/ffi/Type.java | 6 +- .../jruby/ext/ffi/io/FileDescriptorIO.java | 2 +- .../java/org/jruby/ext/ffi/jffi/Function.java | 2 +- .../ext/jruby/JRubyExecutionContextLocal.java | 4 +- .../org/jruby/ext/jruby/JRubyFiberLocal.java | 2 +- .../main/java/org/jruby/ext/nkf/RubyNKF.java | 8 +- .../main/java/org/jruby/ext/set/RubySet.java | 2 +- .../org/jruby/ext/socket/RubyTCPServer.java | 2 +- .../java/org/jruby/ext/zlib/JZlibDeflate.java | 12 +- .../java/org/jruby/ext/zlib/JZlibInflate.java | 10 +- .../jruby/ext/zlib/JZlibRubyGzipReader.java | 2 +- .../jruby/ext/zlib/JZlibRubyGzipWriter.java | 12 +- .../java/org/jruby/ext/zlib/RubyGzipFile.java | 2 +- .../java/org/jruby/ext/zlib/RubyZlib.java | 4 +- .../main/java/org/jruby/ext/zlib/ZStream.java | 2 +- .../jruby/java/addons/ClassJavaAddons.java | 2 +- .../org/jruby/java/proxies/MapJavaProxy.java | 20 +- .../java/org/jruby/javasupport/JavaClass.java | 2 +- .../org/jruby/javasupport/JavaObject.java | 4 +- .../org/jruby/javasupport/JavaPackage.java | 6 +- .../org/jruby/javasupport/ext/JavaLang.java | 4 +- .../org/jruby/javasupport/ext/JavaUtil.java | 12 +- .../jruby/javasupport/ext/JavaUtilRegex.java | 10 +- .../org/jruby/javasupport/ext/Module.java | 8 +- .../org/jruby/runtime/load/LoadService.java | 2 +- 76 files changed, 492 insertions(+), 492 deletions(-) diff --git a/core/src/main/java/org/jruby/AbstractRubyMethod.java b/core/src/main/java/org/jruby/AbstractRubyMethod.java index 0d0e196d549..34b449262df 100644 --- a/core/src/main/java/org/jruby/AbstractRubyMethod.java +++ b/core/src/main/java/org/jruby/AbstractRubyMethod.java @@ -82,7 +82,7 @@ public final IRubyObject op_eql19(ThreadContext context, IRubyObject other) { return op_eql(context, other); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject op_eql(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, equals(other) ); } diff --git a/core/src/main/java/org/jruby/RubyArgsFile.java b/core/src/main/java/org/jruby/RubyArgsFile.java index 5d3d670bb84..94412a9cf1b 100644 --- a/core/src/main/java/org/jruby/RubyArgsFile.java +++ b/core/src/main/java/org/jruby/RubyArgsFile.java @@ -732,7 +732,7 @@ public static IRubyObject eof_p(ThreadContext context, IRubyObject recv) { } } - @JRubyMethod(name = "pos=", required = 1) + @JRubyMethod(name = "pos=") public static IRubyObject set_pos(ThreadContext context, IRubyObject recv, IRubyObject offset) { return getCurrentDataFile(context, "no stream to set position").pos_set(context, offset); } diff --git a/core/src/main/java/org/jruby/RubyArithmeticSequence.java b/core/src/main/java/org/jruby/RubyArithmeticSequence.java index 228664811a5..491fea9bfda 100644 --- a/core/src/main/java/org/jruby/RubyArithmeticSequence.java +++ b/core/src/main/java/org/jruby/RubyArithmeticSequence.java @@ -614,7 +614,7 @@ public IRubyObject each_slice(ThreadContext context, IRubyObject arg, final Bloc enumeratorizeWithSize(context, this, "each_slice", new IRubyObject[]{arg}, RubyArithmeticSequence::size); } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject each_with_object(final ThreadContext context, IRubyObject arg, Block block) { return block.isGiven() ? RubyEnumerable.each_with_objectCommon(context, this, block, arg) : enumeratorizeWithSize(context, this, "each_with_object", new IRubyObject[]{arg}, RubyArithmeticSequence::size); diff --git a/core/src/main/java/org/jruby/RubyArray.java b/core/src/main/java/org/jruby/RubyArray.java index 092c58b37f0..106d60db6cc 100644 --- a/core/src/main/java/org/jruby/RubyArray.java +++ b/core/src/main/java/org/jruby/RubyArray.java @@ -725,7 +725,7 @@ protected IRubyObject initializeCommon(ThreadContext context, IRubyObject arg0, /** rb_ary_initialize_copy * */ - @JRubyMethod(name = {"initialize_copy"}, required = 1, visibility=PRIVATE) + @JRubyMethod(name = {"initialize_copy"}, visibility=PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject orig) { return this.replace(orig); @@ -764,7 +764,7 @@ public RubyArray aryDup() { /** rb_ary_replace * */ - @JRubyMethod(name = {"replace"}, required = 1) + @JRubyMethod(name = {"replace"}) public IRubyObject replace(IRubyObject orig) { unpack(); modifyCheck(); @@ -1434,7 +1434,7 @@ protected static IRubyObject size(ThreadContext context, RubyArray self, IRubyOb /** rb_ary_push - specialized rb_ary_store * */ - @JRubyMethod(name = "<<", required = 1) + @JRubyMethod(name = "<<") public RubyArray append(IRubyObject item) { unpack(); modify(); @@ -1465,7 +1465,7 @@ public RubyArray push_m(IRubyObject[] items) { return push(items); } - @JRubyMethod(name = "push", alias = "append", required = 1) + @JRubyMethod(name = "push", alias = "append") public RubyArray push(IRubyObject item) { append(item); @@ -1616,7 +1616,7 @@ public IRubyObject unshift19(IRubyObject[] items) { /** rb_ary_includes * */ - @JRubyMethod(name = "include?", required = 1) + @JRubyMethod(name = "include?") public RubyBoolean include_p(ThreadContext context, IRubyObject item) { return RubyBoolean.newBoolean(context, includes(context, item)); } @@ -1783,7 +1783,7 @@ public IRubyObject aset19(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) /** rb_ary_at * */ - @JRubyMethod(name = "at", required = 1) + @JRubyMethod(name = "at") public IRubyObject at(IRubyObject pos) { return entry(RubyNumeric.num2long(pos)); } @@ -2284,7 +2284,7 @@ public IRubyObject checkArrayType(){ /** rb_ary_equal * */ - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { if (this == obj) return context.tru; @@ -2326,7 +2326,7 @@ public RubyBoolean compare(ThreadContext context, CallSite site, IRubyObject oth /** rb_ary_eql * */ - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject eql(ThreadContext context, IRubyObject obj) { if(!(obj instanceof RubyArray)) { return context.fals; @@ -2941,7 +2941,7 @@ public IRubyObject deconstruct(ThreadContext context) { /** rb_ary_delete * */ - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject delete(ThreadContext context, IRubyObject item, Block block) { unpack(); int i2 = 0; @@ -3025,7 +3025,7 @@ public IRubyObject delete_at(int pos) { /** rb_ary_delete_at_m * */ - @JRubyMethod(name = "delete_at", required = 1) + @JRubyMethod(name = "delete_at") public IRubyObject delete_at(IRubyObject obj) { return delete_at((int) RubyNumeric.num2long(obj)); } @@ -3208,7 +3208,7 @@ private IRubyObject zipCommon(ThreadContext context, IRubyObject[] args, Block b /** rb_ary_cmp * */ - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject op_cmp(ThreadContext context, IRubyObject obj) { final Ruby runtime = context.runtime; @@ -3329,7 +3329,7 @@ public IRubyObject slice_bang(IRubyObject arg0, IRubyObject arg1) { /** rb_ary_assoc * */ - @JRubyMethod(name = "assoc", required = 1) + @JRubyMethod(name = "assoc") public IRubyObject assoc(ThreadContext context, IRubyObject key) { Ruby runtime = context.runtime; @@ -3347,7 +3347,7 @@ public IRubyObject assoc(ThreadContext context, IRubyObject key) { /** rb_ary_rassoc * */ - @JRubyMethod(name = "rassoc", required = 1) + @JRubyMethod(name = "rassoc") public IRubyObject rassoc(ThreadContext context, IRubyObject value) { Ruby runtime = context.runtime; @@ -3547,7 +3547,7 @@ public IRubyObject nitems() { /** rb_ary_plus * */ - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public IRubyObject op_plus(IRubyObject obj) { Ruby runtime = metaClass.runtime; RubyArray y = obj.convertToArray(); @@ -3581,7 +3581,7 @@ public IRubyObject op_plus(IRubyObject obj) { /** rb_ary_times * */ - @JRubyMethod(name = "*", required = 1) + @JRubyMethod(name = "*") public IRubyObject op_times(ThreadContext context, IRubyObject times) { IRubyObject tmp = times.checkStringType(); @@ -3743,7 +3743,7 @@ public IRubyObject uniq19(ThreadContext context, Block block) { /** rb_ary_diff * */ - @JRubyMethod(name = "-", required = 1) + @JRubyMethod(name = "-") public IRubyObject op_diff(IRubyObject other) { final Ruby runtime = metaClass.runtime; @@ -3851,7 +3851,7 @@ public IRubyObject intersect_p(ThreadContext context, IRubyObject other) { /** MRI: rb_ary_and * */ - @JRubyMethod(name = "&", required = 1) + @JRubyMethod(name = "&") public IRubyObject op_and(IRubyObject other) { final Ruby runtime = metaClass.runtime; @@ -3892,7 +3892,7 @@ public IRubyObject op_and(IRubyObject other) { /** rb_ary_or * */ - @JRubyMethod(name = "|", required = 1) + @JRubyMethod(name = "|") public IRubyObject op_or(IRubyObject other) { final Ruby runtime = metaClass.runtime; RubyArray ary2 = other.convertToArray(); @@ -5436,7 +5436,7 @@ public static IRubyObject try_convert(ThreadContext context, IRubyObject self, I return arg.checkArrayType(); } - @JRubyMethod(name = "pack", required = 1) + @JRubyMethod(name = "pack") public RubyString pack(ThreadContext context, IRubyObject obj) { RubyString format = obj.convertToString(); try { diff --git a/core/src/main/java/org/jruby/RubyBasicObject.java b/core/src/main/java/org/jruby/RubyBasicObject.java index 7fdf39a6445..0a2a5684dd1 100644 --- a/core/src/main/java/org/jruby/RubyBasicObject.java +++ b/core/src/main/java/org/jruby/RubyBasicObject.java @@ -1165,7 +1165,7 @@ public IRubyObject op_not(ThreadContext context) { * @param other other object * @return false if this == other, true otherwise */ - @JRubyMethod(name = "!=", required = 1) + @JRubyMethod(name = "!=") public IRubyObject op_not_equal(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, !sites(context).op_equal.call(context, this, this, other).isTrue()); } @@ -1964,7 +1964,7 @@ private void callFinalizer(IRubyObject finalizer) { * * Will use Java identity equality. */ - @JRubyMethod(name = "equal?", required = 1) + @JRubyMethod(name = "equal?") public IRubyObject equal_p(ThreadContext context, IRubyObject other) { return this == other ? context.tru : context.fals; } diff --git a/core/src/main/java/org/jruby/RubyBignum.java b/core/src/main/java/org/jruby/RubyBignum.java index 08316994ff8..fe75bf9fafa 100644 --- a/core/src/main/java/org/jruby/RubyBignum.java +++ b/core/src/main/java/org/jruby/RubyBignum.java @@ -512,7 +512,7 @@ private IRubyObject subtractOther(ThreadContext context, IRubyObject other) { /** rb_big_mul * */ - @JRubyMethod(name = "*", required = 1) + @JRubyMethod(name = "*") public IRubyObject op_mul(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return op_mul(context, ((RubyFixnum) other).value); @@ -605,7 +605,7 @@ public IRubyObject idiv(ThreadContext context, long other) { * */ @Override - @JRubyMethod(name = "divmod", required = 1) + @JRubyMethod(name = "divmod") public IRubyObject divmod(ThreadContext context, IRubyObject other) { final BigInteger otherValue; if (other instanceof RubyFixnum) { @@ -634,7 +634,7 @@ public IRubyObject divmod(ThreadContext context, IRubyObject other) { /** rb_big_modulo * */ - @JRubyMethod(name = {"%", "modulo"}, required = 1) + @JRubyMethod(name = {"%", "modulo"}) public IRubyObject op_mod(ThreadContext context, IRubyObject other) { if (other instanceof RubyFixnum) { return op_mod(context, ((RubyFixnum) other).value); @@ -684,7 +684,7 @@ public IRubyObject op_mod19(ThreadContext context, IRubyObject other) { * */ @Override - @JRubyMethod(name = "remainder", required = 1) + @JRubyMethod(name = "remainder") public IRubyObject remainder(ThreadContext context, IRubyObject other) { if (other instanceof RubyFloat && ((RubyFloat) other).value == 0) { throw context.runtime.newZeroDivisionError(); @@ -714,7 +714,7 @@ public IRubyObject remainder19(ThreadContext context, IRubyObject other) { * */ @Override - @JRubyMethod(name = "quo", required = 1) + @JRubyMethod(name = "quo") public IRubyObject quo(ThreadContext context, IRubyObject other) { if (other instanceof RubyInteger && ((RubyInteger) other).getDoubleValue() == 0) { throw context.runtime.newZeroDivisionError(); @@ -739,7 +739,7 @@ public final IRubyObject quo19(ThreadContext context, IRubyObject other) { * */ @Override - @JRubyMethod(name = {"**", "power"}, required = 1) + @JRubyMethod(name = {"**", "power"}) public IRubyObject op_pow(ThreadContext context, IRubyObject other) { Ruby runtime = context.runtime; if (other == RubyFixnum.zero(runtime)) return RubyFixnum.one(runtime); diff --git a/core/src/main/java/org/jruby/RubyBinding.java b/core/src/main/java/org/jruby/RubyBinding.java index 8ef899bc5b3..b2d28105e80 100644 --- a/core/src/main/java/org/jruby/RubyBinding.java +++ b/core/src/main/java/org/jruby/RubyBinding.java @@ -106,7 +106,7 @@ public IRubyObject initialize(ThreadContext context) { return this; } - @JRubyMethod(name = "initialize_copy", required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject other) { RubyBinding otherBinding = (RubyBinding)other; diff --git a/core/src/main/java/org/jruby/RubyChain.java b/core/src/main/java/org/jruby/RubyChain.java index e4be2562254..7d9d40fddb8 100644 --- a/core/src/main/java/org/jruby/RubyChain.java +++ b/core/src/main/java/org/jruby/RubyChain.java @@ -178,7 +178,7 @@ private static IRubyObject enumChainTotalSize(ThreadContext context, IRubyObject return total; } - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public IRubyObject op_plus(ThreadContext context, IRubyObject obj) { return RubyChain.newChain(context, new IRubyObject[] {this, obj}); } diff --git a/core/src/main/java/org/jruby/RubyClass.java b/core/src/main/java/org/jruby/RubyClass.java index e873665786d..917ccefada0 100644 --- a/core/src/main/java/org/jruby/RubyClass.java +++ b/core/src/main/java/org/jruby/RubyClass.java @@ -984,7 +984,7 @@ private RubyClass initializeCommon(ThreadContext context, RubyClass superClazz, /** rb_class_init_copy * */ - @JRubyMethod(name = "initialize_copy", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject original) { checkNotInitialized(); @@ -1189,7 +1189,7 @@ public RubyModule getRealModule() { return getRealClass(); } - @JRubyMethod(name = "inherited", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "inherited", visibility = PRIVATE) public IRubyObject inherited(ThreadContext context, IRubyObject arg) { return context.nil; } diff --git a/core/src/main/java/org/jruby/RubyClassPathVariable.java b/core/src/main/java/org/jruby/RubyClassPathVariable.java index c2e0f92cd5f..eb7833162dc 100644 --- a/core/src/main/java/org/jruby/RubyClassPathVariable.java +++ b/core/src/main/java/org/jruby/RubyClassPathVariable.java @@ -58,7 +58,7 @@ public IRubyObject append(IRubyObject obj) { return append(obj.getRuntime().getCurrentContext(), obj); } - @JRubyMethod(name = {"append", "<<"}, required = 1) + @JRubyMethod(name = {"append", "<<"}) public IRubyObject append(ThreadContext context, IRubyObject obj) { IRubyObject[] paths; if (obj.respondsTo("to_a")) { diff --git a/core/src/main/java/org/jruby/RubyComparable.java b/core/src/main/java/org/jruby/RubyComparable.java index 3357e0ba46b..d3f443c9f92 100644 --- a/core/src/main/java/org/jruby/RubyComparable.java +++ b/core/src/main/java/org/jruby/RubyComparable.java @@ -149,7 +149,7 @@ public static IRubyObject invcmp(final ThreadContext context, ThreadContext.Recu /** cmp_equal (cmp_eq inlined here) * */ - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public static IRubyObject op_equal(ThreadContext context, IRubyObject recv, IRubyObject other) { return callCmpMethod(context, recv, other, context.fals); } @@ -178,7 +178,7 @@ private static IRubyObject callCmpMethod(final ThreadContext context, final IRub * */ // <=> may return nil in many circumstances, e.g. 3 <=> NaN - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public static RubyBoolean op_gt(ThreadContext context, IRubyObject recv, IRubyObject other) { IRubyObject result = sites(context).op_cmp.call(context, recv, recv, other); @@ -190,7 +190,7 @@ public static RubyBoolean op_gt(ThreadContext context, IRubyObject recv, IRubyOb /** cmp_ge * */ - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public static RubyBoolean op_ge(ThreadContext context, IRubyObject recv, IRubyObject other) { IRubyObject result = sites(context).op_cmp.call(context, recv, recv, other); @@ -202,7 +202,7 @@ public static RubyBoolean op_ge(ThreadContext context, IRubyObject recv, IRubyOb /** cmp_lt * */ - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public static RubyBoolean op_lt(ThreadContext context, IRubyObject recv, IRubyObject other) { IRubyObject result = sites(context).op_cmp.call(context, recv, recv, other); @@ -222,7 +222,7 @@ public static RubyBoolean op_lt(ThreadContext context, CallSite cmp, IRubyObject /** cmp_le * */ - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public static RubyBoolean op_le(ThreadContext context, IRubyObject recv, IRubyObject other) { IRubyObject result = sites(context).op_cmp.call(context, recv, recv, other); @@ -234,7 +234,7 @@ public static RubyBoolean op_le(ThreadContext context, IRubyObject recv, IRubyOb /** cmp_between * */ - @JRubyMethod(name = "between?", required = 2) + @JRubyMethod(name = "between?") public static RubyBoolean between_p(ThreadContext context, IRubyObject recv, IRubyObject first, IRubyObject second) { return RubyBoolean.newBoolean(context, op_lt(context, recv, first).isFalse() && op_gt(context, recv, second).isFalse()); } diff --git a/core/src/main/java/org/jruby/RubyDir.java b/core/src/main/java/org/jruby/RubyDir.java index 46155ab5dc5..9fa82ab80d9 100644 --- a/core/src/main/java/org/jruby/RubyDir.java +++ b/core/src/main/java/org/jruby/RubyDir.java @@ -467,7 +467,7 @@ public static IRubyObject chdir(ThreadContext context, IRubyObject recv, IRubyOb /** * Changes the root directory (only allowed by super user). Not available on all platforms. */ - @JRubyMethod(name = "chroot", required = 1, meta = true, notImplemented = true) + @JRubyMethod(name = "chroot", meta = true, notImplemented = true) public static IRubyObject chroot(IRubyObject recv, IRubyObject path) { throw recv.getRuntime().newNotImplementedError("chroot not implemented: chroot is non-portable and is not supported."); } @@ -499,7 +499,7 @@ public static IRubyObject rmdir(IRubyObject recv, IRubyObject path) { return rmdir19(recv.getRuntime().getCurrentContext(), recv, path); } - @JRubyMethod(name = {"rmdir", "unlink", "delete"}, required = 1, meta = true) + @JRubyMethod(name = {"rmdir", "unlink", "delete"}, meta = true) public static IRubyObject rmdir19(ThreadContext context, IRubyObject recv, IRubyObject path) { Ruby runtime = context.runtime; RubyString cleanPath = StringSupport.checkEmbeddedNulls(runtime, RubyFile.get_path(context, path)); @@ -854,7 +854,7 @@ public RubyInteger tell() { * returned by tell or 0. */ - @JRubyMethod(name = "seek", required = 1) + @JRubyMethod(name = "seek") public IRubyObject seek(IRubyObject newPos) { checkDir(); @@ -862,7 +862,7 @@ public IRubyObject seek(IRubyObject newPos) { return this; } - @JRubyMethod(name = "pos=", required = 1) + @JRubyMethod(name = "pos=") public IRubyObject set_pos(IRubyObject newPos) { int pos2 = RubyNumeric.fix2int(newPos); if (pos2 >= 0) this.pos = pos2; diff --git a/core/src/main/java/org/jruby/RubyEncoding.java b/core/src/main/java/org/jruby/RubyEncoding.java index 656a900f9dd..768ebd721bc 100755 --- a/core/src/main/java/org/jruby/RubyEncoding.java +++ b/core/src/main/java/org/jruby/RubyEncoding.java @@ -656,7 +656,7 @@ public static IRubyObject getDefaultInternal(IRubyObject recv) { return getDefaultInternal(recv.getRuntime().getCurrentContext(), recv); } - @JRubyMethod(name = "default_internal=", required = 1, meta = true) + @JRubyMethod(name = "default_internal=", meta = true) public static IRubyObject setDefaultInternal(ThreadContext context, IRubyObject recv, IRubyObject encoding) { if (context.runtime.isVerbose()) context.runtime.getWarnings().warning("setting Encoding.default_internal"); EncodingUtils.rbEncSetDefaultInternal(context, encoding); diff --git a/core/src/main/java/org/jruby/RubyEnumerable.java b/core/src/main/java/org/jruby/RubyEnumerable.java index 6939961a99a..1718be70cc6 100644 --- a/core/src/main/java/org/jruby/RubyEnumerable.java +++ b/core/src/main/java/org/jruby/RubyEnumerable.java @@ -1212,7 +1212,7 @@ public static IRubyObject each_with_index(ThreadContext context, IRubyObject sel return block.isGiven() ? each_with_indexCommon(context, self, block, args) : enumeratorizeWithSize(context, self, "each_with_index", args, (SizeFn) RubyEnumerable::size); } - @JRubyMethod(required = 1) + @JRubyMethod public static IRubyObject each_with_object(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) { return block.isGiven() ? each_with_objectCommon(context, self, block, arg) : enumeratorizeWithSize(context, self, "each_with_object", new IRubyObject[] { arg }, RubyEnumerable::size); } @@ -1359,7 +1359,7 @@ private static IRubyObject reverse_eachInternal(ThreadContext context, IRubyObje return self; } - @JRubyMethod(name = {"include?", "member?"}, required = 1) + @JRubyMethod(name = {"include?", "member?"}) public static IRubyObject include_p(final ThreadContext context, IRubyObject self, final IRubyObject arg) { try { callEach(context, eachSite(context), self, Signature.OPTIONAL, new BlockCallback() { diff --git a/core/src/main/java/org/jruby/RubyEnumerator.java b/core/src/main/java/org/jruby/RubyEnumerator.java index 91905abdcc9..2faaca874de 100644 --- a/core/src/main/java/org/jruby/RubyEnumerator.java +++ b/core/src/main/java/org/jruby/RubyEnumerator.java @@ -389,7 +389,7 @@ private IRubyObject inspect(ThreadContext context, boolean recurse) { } } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject each_with_object(final ThreadContext context, IRubyObject arg, Block block) { return block.isGiven() ? RubyEnumerable.each_with_objectCommon(context, this, block, arg) : enumeratorizeWithSize(context, this, "each_with_object", new IRubyObject[]{arg}, RubyEnumerator::size); diff --git a/core/src/main/java/org/jruby/RubyException.java b/core/src/main/java/org/jruby/RubyException.java index 2af5dfedf55..d4da217b55a 100644 --- a/core/src/main/java/org/jruby/RubyException.java +++ b/core/src/main/java/org/jruby/RubyException.java @@ -279,7 +279,7 @@ public IRubyObject backtrace() { return getBacktrace(); } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject set_backtrace(IRubyObject obj) { setBacktrace(obj); return backtrace(); diff --git a/core/src/main/java/org/jruby/RubyFile.java b/core/src/main/java/org/jruby/RubyFile.java index 876deee6d16..1bb37b7e454 100644 --- a/core/src/main/java/org/jruby/RubyFile.java +++ b/core/src/main/java/org/jruby/RubyFile.java @@ -290,7 +290,7 @@ protected IRubyObject rbIoClose(ThreadContext context) { return super.rbIoClose(context); } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject flock(ThreadContext context, IRubyObject operation) { // Solaris uses a ruby-ffi version defined in jruby/kernel/file.rb, so re-dispatch @@ -364,7 +364,7 @@ public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block b return openFile(context, args); } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject chmod(ThreadContext context, IRubyObject arg) { checkClosed(context); int mode = (int) arg.convertToInteger().getLongValue(); @@ -377,7 +377,7 @@ public IRubyObject chmod(ThreadContext context, IRubyObject arg) { return context.runtime.newFixnum(context.runtime.getPosix().chmod(path, mode)); } - @JRubyMethod(required = 2) + @JRubyMethod public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2) { checkClosed(context); int owner = -1; @@ -468,7 +468,7 @@ public IRubyObject path(ThreadContext context) { return context.nil; } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject truncate(ThreadContext context, IRubyObject len) { Ruby runtime = context.runtime; OpenFile fptr; @@ -851,7 +851,7 @@ public static String dirname(ThreadContext context, final String filename, int l * @param arg Path to get extension name of * @return Extension, including the dot, or an empty string */ - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject extname(ThreadContext context, IRubyObject recv, IRubyObject arg) { String filename = basename(context, recv, arg).toString(); diff --git a/core/src/main/java/org/jruby/RubyFileStat.java b/core/src/main/java/org/jruby/RubyFileStat.java index 07bb551ce43..5b0b50c3843 100644 --- a/core/src/main/java/org/jruby/RubyFileStat.java +++ b/core/src/main/java/org/jruby/RubyFileStat.java @@ -146,7 +146,7 @@ public IRubyObject initialize(IRubyObject fname, Block unusedBlock) { return initialize19(fname, unusedBlock); } - @JRubyMethod(name = "initialize", required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "initialize", visibility = Visibility.PRIVATE) public IRubyObject initialize19(IRubyObject fname, Block unusedBlock) { Ruby runtime = getRuntime(); ThreadContext context = runtime.getCurrentContext(); @@ -197,7 +197,7 @@ public IRubyObject chardev_p() { return getRuntime().newBoolean(stat.isCharDev()); } - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject cmp(IRubyObject other) { checkInitialized(); if (!(other instanceof RubyFileStat)) return getRuntime().getNil(); @@ -302,7 +302,7 @@ public IRubyObject group_owned_p() { return getRuntime().newBoolean(stat.isGroupOwned()); } - @JRubyMethod(name = "initialize_copy", required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject original) { if (!(original instanceof RubyFileStat)) { diff --git a/core/src/main/java/org/jruby/RubyFileTest.java b/core/src/main/java/org/jruby/RubyFileTest.java index 3259f5064c7..381e542bf01 100644 --- a/core/src/main/java/org/jruby/RubyFileTest.java +++ b/core/src/main/java/org/jruby/RubyFileTest.java @@ -61,14 +61,14 @@ public static RubyModule createFileTestModule(Ruby runtime) { return fileTestModule; } - @JRubyMethod(name = "blockdev?", required = 1, module = true) + @JRubyMethod(name = "blockdev?", module = true) public static IRubyObject blockdev_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isBlockDev()); } - @JRubyMethod(name = "chardev?", required = 1, module = true) + @JRubyMethod(name = "chardev?", module = true) public static IRubyObject chardev_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); @@ -84,7 +84,7 @@ public static IRubyObject directory_p(Ruby ruby, IRubyObject filename) { return directory_p(ruby.getCurrentContext(), filename); } - @JRubyMethod(name = "directory?", required = 1, module = true) + @JRubyMethod(name = "directory?", module = true) public static IRubyObject directory_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return directory_p(context, filename); } @@ -97,12 +97,12 @@ public static IRubyObject directory_p(ThreadContext context, IRubyObject filenam return RubyBoolean.newBoolean(context, fileResource(context, filename).isDirectory()); } - @JRubyMethod(name = "executable?", required = 1, module = true) + @JRubyMethod(name = "executable?", module = true) public static IRubyObject executable_p(IRubyObject recv, IRubyObject filename) { return recv.getRuntime().newBoolean(fileResource(filename).canExecute()); } - @JRubyMethod(name = "executable_real?", required = 1, module = true) + @JRubyMethod(name = "executable_real?", module = true) public static IRubyObject executable_real_p(IRubyObject recv, IRubyObject filename) { if (recv.getRuntime().getPosix().isNative()) { FileStat stat = fileResource(filename).stat(); @@ -119,7 +119,7 @@ public static IRubyObject exist_p(IRubyObject recv, IRubyObject filename) { return exist_p(recv.getRuntime().getCurrentContext(), recv, filename); } - @JRubyMethod(name = {"exist?", "exists?"}, required = 1, module = true) + @JRubyMethod(name = {"exist?", "exists?"}, module = true) public static IRubyObject exist_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { // We get_path here to prevent doing it both existsOnClasspath and fileResource (Only call to_path once). return RubyBoolean.newBoolean(context, exist(context, get_path(context, filename))); @@ -138,12 +138,12 @@ public static RubyBoolean file_p(IRubyObject recv, IRubyObject filename) { return file_p(recv.getRuntime().getCurrentContext(), recv, filename); } - @JRubyMethod(name = "file?", required = 1, module = true) + @JRubyMethod(name = "file?", module = true) public static RubyBoolean file_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyBoolean.newBoolean(context, fileResource(filename).isFile()); } - @JRubyMethod(name = "grpowned?", required = 1, module = true) + @JRubyMethod(name = "grpowned?", module = true) public static IRubyObject grpowned_p(IRubyObject recv, IRubyObject filename) { Ruby runtime = recv.getRuntime(); FileStat stat = fileResource(filename).stat(); @@ -154,7 +154,7 @@ public static IRubyObject grpowned_p(IRubyObject recv, IRubyObject filename) { return runtime.newBoolean(stat != null && stat.isGroupOwned()); } - @JRubyMethod(name = "identical?", required = 2, module = true) + @JRubyMethod(name = "identical?", module = true) public static IRubyObject identical_p(IRubyObject recv, IRubyObject filename1, IRubyObject filename2) { Ruby runtime = recv.getRuntime(); FileResource file1 = fileResource(filename1); @@ -182,14 +182,14 @@ public static IRubyObject identical_p(IRubyObject recv, IRubyObject filename1, I return runtime.newBoolean(stat1 != null && stat2 != null && stat1.isIdentical(stat2)); } - @JRubyMethod(name = "owned?", required = 1, module = true) + @JRubyMethod(name = "owned?", module = true) public static IRubyObject owned_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isOwned()); } - @JRubyMethod(name = "pipe?", required = 1, module = true) + @JRubyMethod(name = "pipe?", module = true) public static IRubyObject pipe_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); @@ -202,7 +202,7 @@ public static IRubyObject readable_p(IRubyObject recv, IRubyObject filename) { } // We use file test since it is faster than a stat; also euid == uid in Java always - @JRubyMethod(name = {"readable?", "readable_real?"}, required = 1, module = true) + @JRubyMethod(name = {"readable?", "readable_real?"}, module = true) public static IRubyObject readable_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { Ruby runtime = context.runtime; if (!(filename instanceof RubyFile)) { @@ -219,14 +219,14 @@ public static IRubyObject rowned_p(IRubyObject recv, IRubyObject filename) { return recv.getRuntime().newBoolean(stat != null && stat.isROwned()); } - @JRubyMethod(name = "setgid?", required = 1, module = true) + @JRubyMethod(name = "setgid?", module = true) public static IRubyObject setgid_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isSetgid()); } - @JRubyMethod(name = "setuid?", required = 1, module = true) + @JRubyMethod(name = "setuid?", module = true) public static IRubyObject setuid_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); @@ -237,7 +237,7 @@ public static IRubyObject size(IRubyObject recv, IRubyObject filename) { return size(recv.getRuntime().getCurrentContext(), recv, filename); } - @JRubyMethod(name = "size", required = 1, module = true) + @JRubyMethod(name = "size", module = true) public static IRubyObject size(ThreadContext context, IRubyObject recv, IRubyObject filename) { if (!(filename instanceof RubyFile) && filename.respondsTo("to_io")) { filename = TypeConverter.convertToType(filename, context.runtime.getIO(), "to_io"); @@ -255,7 +255,7 @@ public static IRubyObject size_p(IRubyObject recv, IRubyObject filename) { return size_p(recv.getRuntime().getCurrentContext(), recv, filename); } - @JRubyMethod(name = "size?", required = 1, module = true) + @JRubyMethod(name = "size?", module = true) public static IRubyObject size_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { Ruby runtime = context.runtime; if (!(filename instanceof RubyFile) && filename.respondsTo("to_io")) { @@ -270,28 +270,28 @@ public static IRubyObject size_p(ThreadContext context, IRubyObject recv, IRubyO return length > 0 ? runtime.newFixnum(length) : runtime.getNil(); } - @JRubyMethod(name = "socket?", required = 1, module = true) + @JRubyMethod(name = "socket?", module = true) public static IRubyObject socket_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isSocket()); } - @JRubyMethod(name = "sticky?", required = 1, module = true) + @JRubyMethod(name = "sticky?", module = true) public static IRubyObject sticky_p(IRubyObject recv, IRubyObject filename) { FileStat stat = fileResource(filename).stat(); return recv.getRuntime().newBoolean(stat != null && stat.isSticky()); } - @JRubyMethod(name = "symlink?", required = 1, module = true) + @JRubyMethod(name = "symlink?", module = true) public static RubyBoolean symlink_p(IRubyObject recv, IRubyObject filename) { return recv.getRuntime().newBoolean(fileResource(filename).isSymLink()); } // We do both writable and writable_real through the same method because // in our java process effective and real userid will always be the same. - @JRubyMethod(name = {"writable?", "writable_real?"}, required = 1, module = true) + @JRubyMethod(name = {"writable?", "writable_real?"}, module = true) public static RubyBoolean writable_p(IRubyObject recv, IRubyObject filename) { return filename.getRuntime().newBoolean(fileResource(filename).canWrite()); } @@ -301,7 +301,7 @@ public static RubyBoolean zero_p(IRubyObject recv, IRubyObject filename) { return zero_p(recv.getRuntime().getCurrentContext(), recv, filename); } - @JRubyMethod(name = {"empty?", "zero?"}, required = 1, module = true) + @JRubyMethod(name = {"empty?", "zero?"}, module = true) public static RubyBoolean zero_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { FileResource resource = fileResource(context, filename); @@ -318,14 +318,14 @@ public static RubyBoolean zero_p(ThreadContext context, IRubyObject recv, IRubyO return RubyBoolean.newBoolean(context, stat.st_size() == 0L); } - @JRubyMethod(name = "world_readable?", required = 1, module = true) + @JRubyMethod(name = "world_readable?", module = true) public static IRubyObject worldReadable(ThreadContext context, IRubyObject recv, IRubyObject filename) { RubyFileStat stat = getRubyFileStat(context, filename); return stat == null ? context.nil : stat.worldReadable(context); } - @JRubyMethod(name = "world_writable?", required = 1, module = true) + @JRubyMethod(name = "world_writable?", module = true) public static IRubyObject worldWritable(ThreadContext context, IRubyObject recv, IRubyObject filename) { RubyFileStat stat = getRubyFileStat(context, filename); @@ -342,117 +342,117 @@ public static IRubyObject worldWritable(ThreadContext context, IRubyObject recv, * class. */ public static class FileTestFileMethods { - @JRubyMethod(name = "blockdev?", required = 1) + @JRubyMethod(name = "blockdev?") public static IRubyObject blockdev_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.blockdev_p(recv, filename); } - @JRubyMethod(name = "chardev?", required = 1) + @JRubyMethod(name = "chardev?") public static IRubyObject chardev_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.chardev_p(recv, filename); } - @JRubyMethod(name = "directory?", required = 1) + @JRubyMethod(name = "directory?") public static IRubyObject directory_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.directory_p(context, recv, filename); } - @JRubyMethod(name = "executable?", required = 1) + @JRubyMethod(name = "executable?") public static IRubyObject executable_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.executable_p(recv, filename); } - @JRubyMethod(name = "executable_real?", required = 1) + @JRubyMethod(name = "executable_real?") public static IRubyObject executable_real_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.executable_real_p(recv, filename); } - @JRubyMethod(name = {"exist?", "exists?"}, required = 1) + @JRubyMethod(name = {"exist?", "exists?"}) public static IRubyObject exist_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.exist_p(context, recv, filename); } - @JRubyMethod(name = "file?", required = 1) + @JRubyMethod(name = "file?") public static RubyBoolean file_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.file_p(context, recv, filename); } - @JRubyMethod(name = "grpowned?", required = 1) + @JRubyMethod(name = "grpowned?") public static IRubyObject grpowned_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.grpowned_p(recv, filename); } - @JRubyMethod(name = "identical?", required = 2) + @JRubyMethod(name = "identical?") public static IRubyObject identical_p(IRubyObject recv, IRubyObject filename1, IRubyObject filename2) { return RubyFileTest.identical_p(recv, filename1, filename2); } - @JRubyMethod(name = "owned?", required = 1) + @JRubyMethod(name = "owned?") public static IRubyObject owned_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.owned_p(recv, filename); } - @JRubyMethod(name = "pipe?", required = 1) + @JRubyMethod(name = "pipe?") public static IRubyObject pipe_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.pipe_p(recv, filename); } - @JRubyMethod(name = {"readable?", "readable_real?"}, required = 1) + @JRubyMethod(name = {"readable?", "readable_real?"}) public static IRubyObject readable_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.readable_p(context, recv, filename); } - @JRubyMethod(name = "setgid?", required = 1) + @JRubyMethod(name = "setgid?") public static IRubyObject setgid_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.setgid_p(recv, filename); } - @JRubyMethod(name = "setuid?", required = 1) + @JRubyMethod(name = "setuid?") public static IRubyObject setuid_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.setuid_p(recv, filename); } - @JRubyMethod(name = "size", required = 1) + @JRubyMethod(name = "size") public static IRubyObject size(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.size(context, recv, filename); } - @JRubyMethod(name = "size?", required = 1) + @JRubyMethod(name = "size?") public static IRubyObject size_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.size_p(context, recv, filename); } - @JRubyMethod(name = "socket?", required = 1) + @JRubyMethod(name = "socket?") public static IRubyObject socket_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.socket_p(recv, filename); } - @JRubyMethod(name = "sticky?", required = 1) + @JRubyMethod(name = "sticky?") public static IRubyObject sticky_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.sticky_p(recv, filename); } - @JRubyMethod(name = "symlink?", required = 1) + @JRubyMethod(name = "symlink?") public static RubyBoolean symlink_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.symlink_p(recv, filename); } - @JRubyMethod(name = {"writable?", "writable_real?"}, required = 1) + @JRubyMethod(name = {"writable?", "writable_real?"}) public static RubyBoolean writable_p(IRubyObject recv, IRubyObject filename) { return RubyFileTest.writable_p(recv, filename); } - @JRubyMethod(name = {"empty?", "zero?"}, required = 1) + @JRubyMethod(name = {"empty?", "zero?"}) public static RubyBoolean zero_p(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.zero_p(context, recv, filename); } - @JRubyMethod(name = "world_readable?", required = 1) + @JRubyMethod(name = "world_readable?") public static IRubyObject worldReadable(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.worldReadable(context, recv, filename); } - @JRubyMethod(name = "world_writable?", required = 1) + @JRubyMethod(name = "world_writable?") public static IRubyObject worldWritable(ThreadContext context, IRubyObject recv, IRubyObject filename) { return RubyFileTest.worldWritable(context, recv, filename); } diff --git a/core/src/main/java/org/jruby/RubyFloat.java b/core/src/main/java/org/jruby/RubyFloat.java index bf0ba8c05c0..a028ce85424 100644 --- a/core/src/main/java/org/jruby/RubyFloat.java +++ b/core/src/main/java/org/jruby/RubyFloat.java @@ -290,7 +290,7 @@ public IRubyObject to_s() { /** flo_coerce * */ - @JRubyMethod(name = "coerce", required = 1) + @JRubyMethod(name = "coerce") @Override public IRubyObject coerce(IRubyObject other) { final Ruby runtime = metaClass.runtime; @@ -314,7 +314,7 @@ public IRubyObject op_uminus() { /** flo_plus * */ - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") @Override public IRubyObject op_plus(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { @@ -333,7 +333,7 @@ public IRubyObject op_plus(ThreadContext context, double other) { /** flo_minus * */ - @JRubyMethod(name = "-", required = 1) + @JRubyMethod(name = "-") public IRubyObject op_minus(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -351,7 +351,7 @@ public IRubyObject op_minus(ThreadContext context, double other) { /** flo_mul * */ - @JRubyMethod(name = "*", required = 1) + @JRubyMethod(name = "*") public IRubyObject op_mul(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -369,7 +369,7 @@ public IRubyObject op_mul(ThreadContext context, double other) { /** * MRI: flo_div */ - @JRubyMethod(name = "/", required = 1) + @JRubyMethod(name = "/") public IRubyObject op_div(ThreadContext context, IRubyObject other) { // don't override Numeric#div ! switch (getMetaClass(other).getClassIndex()) { case INTEGER: @@ -399,7 +399,7 @@ public IRubyObject quo(ThreadContext context, IRubyObject other) { /** flo_mod * */ - @JRubyMethod(name = {"%", "modulo"}, required = 1) + @JRubyMethod(name = {"%", "modulo"}) public IRubyObject op_mod(ThreadContext context, IRubyObject other) { switch (getMetaClass(other).getClassIndex()) { case INTEGER: @@ -432,7 +432,7 @@ public final IRubyObject op_mod19(ThreadContext context, IRubyObject other) { * */ @Override - @JRubyMethod(name = "divmod", required = 1) + @JRubyMethod(name = "divmod") public IRubyObject divmod(ThreadContext context, IRubyObject other) { switch (getMetaClass(other).getClassIndex()) { case INTEGER: @@ -463,7 +463,7 @@ public IRubyObject divmod(ThreadContext context, IRubyObject other) { /** flo_pow * */ - @JRubyMethod(name = "**", required = 1) + @JRubyMethod(name = "**") public IRubyObject op_pow(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -491,7 +491,7 @@ public IRubyObject op_pow19(ThreadContext context, IRubyObject other) { /** flo_eq * */ - @JRubyMethod(name = {"==", "==="}, required = 1) + @JRubyMethod(name = {"==", "==="}) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (Double.isNaN(value)) { @@ -540,7 +540,7 @@ public final int compareTo(IRubyObject other) { /** flo_cmp * */ - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject op_cmp(ThreadContext context, IRubyObject other) { final Ruby runtime = context.runtime; switch (other.getMetaClass().getClassIndex()) { @@ -579,7 +579,7 @@ public IRubyObject op_cmp(ThreadContext context, double other) { /** flo_gt * */ - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -598,7 +598,7 @@ public IRubyObject op_gt(ThreadContext context, double other) { /** flo_ge * */ - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -617,7 +617,7 @@ public IRubyObject op_ge(ThreadContext context, double other) { /** flo_lt * */ - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public IRubyObject op_lt(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -636,7 +636,7 @@ public IRubyObject op_lt(ThreadContext context, double other) { /** flo_le * */ - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { switch (other.getMetaClass().getClassIndex()) { case INTEGER: @@ -655,7 +655,7 @@ public IRubyObject op_le(ThreadContext context, double other) { /** flo_eql * */ - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") @Override public IRubyObject eql_p(IRubyObject other) { return metaClass.runtime.newBoolean( equals(other) ); diff --git a/core/src/main/java/org/jruby/RubyGlobal.java b/core/src/main/java/org/jruby/RubyGlobal.java index 2f61a394e9d..c319f1caebc 100644 --- a/core/src/main/java/org/jruby/RubyGlobal.java +++ b/core/src/main/java/org/jruby/RubyGlobal.java @@ -426,7 +426,7 @@ public CaseInsensitiveStringOnlyRubyHash(Ruby runtime, Map= otherHash.size()) return context.fals; @@ -1335,7 +1335,7 @@ public IRubyObject op_lt(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, hash_le(otherHash)); } - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { final RubyHash otherHash = other.convertToHash(); if (size() > otherHash.size()) return context.fals; @@ -1343,13 +1343,13 @@ public IRubyObject op_le(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, hash_le(otherHash)); } - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { final RubyHash otherHash = other.convertToHash(); return otherHash.op_lt(context, this); } - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { final RubyHash otherHash = other.convertToHash(); return otherHash.op_le(context, this); @@ -1464,7 +1464,7 @@ public IRubyObject fetch(ThreadContext context, IRubyObject key, IRubyObject _de /** rb_hash_has_key * */ - @JRubyMethod(name = {"has_key?", "key?", "include?", "member?"}, required = 1) + @JRubyMethod(name = {"has_key?", "key?", "include?", "member?"}) public RubyBoolean has_key_p(ThreadContext context, IRubyObject key) { return hasKey(key) ? context.tru : context.fals; } @@ -1529,7 +1529,7 @@ public void visit(ThreadContext context, RubyHash self, IRubyObject key, IRubyOb /** rb_hash_has_value * */ - @JRubyMethod(name = {"has_value?", "value?"}, required = 1) + @JRubyMethod(name = {"has_value?", "value?"}) public RubyBoolean has_value_p(ThreadContext context, IRubyObject expected) { return RubyBoolean.newBoolean(context, hasValue(context, expected)); } @@ -2152,7 +2152,7 @@ public RubyHash merge(ThreadContext context, IRubyObject[] others, Block block) return dup.merge_bang(context, others, block); } - @JRubyMethod(name = "initialize_copy", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = PRIVATE) public RubyHash initialize_copy(ThreadContext context, IRubyObject other) { return replace(context, other); } @@ -2165,7 +2165,7 @@ public RubyHash initialize_copy19(ThreadContext context, IRubyObject other) { /** rb_hash_replace * */ - @JRubyMethod(name = "replace", required = 1) + @JRubyMethod(name = "replace") public RubyHash replace(final ThreadContext context, IRubyObject other) { modify(); diff --git a/core/src/main/java/org/jruby/RubyIO.java b/core/src/main/java/org/jruby/RubyIO.java index 1bc05ba897d..866e2191f9e 100644 --- a/core/src/main/java/org/jruby/RubyIO.java +++ b/core/src/main/java/org/jruby/RubyIO.java @@ -1346,7 +1346,7 @@ public IRubyObject op_binmode(ThreadContext context) { } // rb_io_syswrite - @JRubyMethod(name = "syswrite", required = 1) + @JRubyMethod(name = "syswrite") public IRubyObject syswrite(ThreadContext context, IRubyObject str) { Ruby runtime = context.runtime; OpenFile fptr; @@ -1690,7 +1690,7 @@ public void write(int bite) { /** rb_io_addstr * */ - @JRubyMethod(name = "<<", required = 1) + @JRubyMethod(name = "<<") public IRubyObject op_append(ThreadContext context, IRubyObject anObject) { // Claims conversion is done via 'to_s' in docs. sites(context).write.call(context, this, this, anObject); @@ -1716,7 +1716,7 @@ public RubyFixnum lineno(ThreadContext context) { * * @param newLineNumber The new line number. */ - @JRubyMethod(name = "lineno=", required = 1) + @JRubyMethod(name = "lineno=") public RubyFixnum lineno_set(ThreadContext context, IRubyObject newLineNumber) { getOpenFileChecked().setLineNumber(RubyNumeric.fix2int(newLineNumber)); @@ -1782,7 +1782,7 @@ public RubyFixnum pos(ThreadContext context) { } // rb_io_set_pos - @JRubyMethod(name = "pos=", required = 1) + @JRubyMethod(name = "pos=") public RubyFixnum pos_set(ThreadContext context, IRubyObject offset) { OpenFile fptr; long pos; @@ -1847,7 +1847,7 @@ public IRubyObject printf(ThreadContext context, IRubyObject[] args) { return context.nil; } - @JRubyMethod(required = 1) + @JRubyMethod public IRubyObject putc(ThreadContext context, IRubyObject ch) { IRubyObject str; if (ch instanceof RubyString) { @@ -2023,7 +2023,7 @@ public RubyFixnum fsync(ThreadContext context) { * * @param sync The new sync mode. */ - @JRubyMethod(name = "sync=", required = 1) + @JRubyMethod(name = "sync=") public IRubyObject sync_set(IRubyObject sync) { setSync(sync.isTrue()); @@ -2095,7 +2095,7 @@ public RubyBoolean tty_p(ThreadContext context) { } // rb_io_init_copy - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject _io){ RubyIO dest = this; diff --git a/core/src/main/java/org/jruby/RubyInteger.java b/core/src/main/java/org/jruby/RubyInteger.java index df87603652a..653efba4ca3 100644 --- a/core/src/main/java/org/jruby/RubyInteger.java +++ b/core/src/main/java/org/jruby/RubyInteger.java @@ -569,7 +569,7 @@ public IRubyObject ceil(ThreadContext context){ return this; } - @JRubyMethod(name = "ceil", required = 1) + @JRubyMethod(name = "ceil") public abstract IRubyObject ceil(ThreadContext context, IRubyObject arg); @JRubyMethod(name = "floor") @@ -577,7 +577,7 @@ public IRubyObject floor(ThreadContext context){ return this; } - @JRubyMethod(name = "floor", required = 1) + @JRubyMethod(name = "floor") public abstract IRubyObject floor(ThreadContext context, IRubyObject arg); @JRubyMethod(name = "truncate") @@ -585,7 +585,7 @@ public IRubyObject truncate(ThreadContext context){ return this; } - @JRubyMethod(name = "truncate", required = 1) + @JRubyMethod(name = "truncate") public abstract IRubyObject truncate(ThreadContext context, IRubyObject arg); @Override diff --git a/core/src/main/java/org/jruby/RubyKernel.java b/core/src/main/java/org/jruby/RubyKernel.java index 5803acfc195..125b3d61463 100644 --- a/core/src/main/java/org/jruby/RubyKernel.java +++ b/core/src/main/java/org/jruby/RubyKernel.java @@ -572,14 +572,14 @@ else if (argc > 1) { return ret; } - @JRubyMethod(required = 1, module = true) + @JRubyMethod(module = true) public static IRubyObject public_method(ThreadContext context, IRubyObject recv, IRubyObject symbol) { return recv.getMetaClass().newMethod(recv, symbol.asJavaString(), true, PUBLIC, true, false); } /** rb_f_putc */ - @JRubyMethod(required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(module = true, visibility = PRIVATE) public static IRubyObject putc(ThreadContext context, IRubyObject recv, IRubyObject ch) { IRubyObject defout = context.runtime.getGlobalVariables().get("$>"); if (recv == defout) { @@ -1743,7 +1743,7 @@ private static int getTestCommand(ThreadContext context, IRubyObject arg0) { return cmd; } - @JRubyMethod(name = "`", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "`", module = true, visibility = PRIVATE) public static IRubyObject backquote(ThreadContext context, IRubyObject recv, IRubyObject str) { Ruby runtime = context.runtime; @@ -2134,17 +2134,17 @@ public static IRubyObject public_send(ThreadContext context, IRubyObject recv, I * See JRUBY-4871 (because of RubyObject instead of RubyBasicObject cast) * BEGIN delegated bindings: */ - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public static IRubyObject eql_p(IRubyObject self, IRubyObject obj) { return ((RubyBasicObject)self).eql_p(obj); } - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") public static IRubyObject op_eqq(ThreadContext context, IRubyObject self, IRubyObject other) { return ((RubyBasicObject) self).op_eqq(context, other); } - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public static IRubyObject op_cmp(ThreadContext context, IRubyObject self, IRubyObject other) { return ((RubyBasicObject) self).op_cmp(context, other); } @@ -2243,7 +2243,7 @@ public static IRubyObject inspect(IRubyObject self) { return ((RubyBasicObject)self).inspect(); } - @JRubyMethod(name = "instance_of?", required = 1) + @JRubyMethod(name = "instance_of?") public static RubyBoolean instance_of_p(ThreadContext context, IRubyObject self, IRubyObject type) { return ((RubyBasicObject)self).instance_of_p(context, type); } @@ -2253,7 +2253,7 @@ public static IRubyObject itself(IRubyObject self) { return self; } - @JRubyMethod(name = {"kind_of?", "is_a?"}, required = 1) + @JRubyMethod(name = {"kind_of?", "is_a?"}) public static RubyBoolean kind_of_p(ThreadContext context, IRubyObject self, IRubyObject type) { return ((RubyBasicObject)self).kind_of_p(context, type); } @@ -2323,7 +2323,7 @@ public static RubyArray singleton_methods19(ThreadContext context, IRubyObject s return ((RubyBasicObject)self).singleton_methods(context, args); } - @JRubyMethod(name = "singleton_method", required = 1) + @JRubyMethod(name = "singleton_method") public static IRubyObject singleton_method(IRubyObject self, IRubyObject symbol) { return ((RubyBasicObject)self).singleton_method(symbol); } @@ -2401,22 +2401,22 @@ public static IRubyObject op_not_match(ThreadContext context, IRubyObject self, return ((RubyBasicObject) self).op_not_match(context, arg); } - @JRubyMethod(name = "instance_variable_defined?", required = 1) + @JRubyMethod(name = "instance_variable_defined?") public static IRubyObject instance_variable_defined_p(ThreadContext context, IRubyObject self, IRubyObject name) { return ((RubyBasicObject)self).instance_variable_defined_p(context, name); } - @JRubyMethod(name = "instance_variable_get", required = 1) + @JRubyMethod(name = "instance_variable_get") public static IRubyObject instance_variable_get(ThreadContext context, IRubyObject self, IRubyObject name) { return ((RubyBasicObject)self).instance_variable_get(context, name); } - @JRubyMethod(name = "instance_variable_set", required = 2) + @JRubyMethod(name = "instance_variable_set") public static IRubyObject instance_variable_set(IRubyObject self, IRubyObject name, IRubyObject value) { return ((RubyBasicObject)self).instance_variable_set(name, value); } - @JRubyMethod(name = "remove_instance_variable", required = 1) + @JRubyMethod(name = "remove_instance_variable") public static IRubyObject remove_instance_variable(ThreadContext context, IRubyObject self, IRubyObject name, Block block) { return ((RubyBasicObject) self).remove_instance_variable(context, name, block); } diff --git a/core/src/main/java/org/jruby/RubyMatchData.java b/core/src/main/java/org/jruby/RubyMatchData.java index 9e843c62725..98109a27c1c 100644 --- a/core/src/main/java/org/jruby/RubyMatchData.java +++ b/core/src/main/java/org/jruby/RubyMatchData.java @@ -796,7 +796,7 @@ public IRubyObject string() { return str; //str is frozen } - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject original) { if (this == original) return this; @@ -828,7 +828,7 @@ public boolean equals(Object other) { this.begin == that.begin && this.end == that.end; } - @JRubyMethod(name = {"eql?", "=="}, required = 1) + @JRubyMethod(name = {"eql?", "=="}) @Override public IRubyObject eql_p(IRubyObject obj) { return metaClass.runtime.newBoolean( equals(obj) ); diff --git a/core/src/main/java/org/jruby/RubyMath.java b/core/src/main/java/org/jruby/RubyMath.java index 3db483053a0..8abd6469a35 100644 --- a/core/src/main/java/org/jruby/RubyMath.java +++ b/core/src/main/java/org/jruby/RubyMath.java @@ -87,7 +87,7 @@ public static double sign(double x, double y) { return (y < 0.0) ? -abs : abs; } - @JRubyMethod(name = "atan2", required = 2, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "atan2", module = true, visibility = Visibility.PRIVATE) public static RubyFloat atan2(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) { double valuea = RubyNumeric.num2dbl(context, x); double valueb = RubyNumeric.num2dbl(context, y); @@ -100,7 +100,7 @@ public static RubyFloat atan219(ThreadContext context, IRubyObject recv, IRubyOb return atan2(context, recv, x, y); } - @JRubyMethod(name = "cos", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "cos", module = true, visibility = Visibility.PRIVATE) public static RubyFloat cos(ThreadContext context, IRubyObject recv, IRubyObject x) { return RubyFloat.newFloat(context.runtime, Math.cos(RubyNumeric.num2dbl(context, x))); } @@ -110,7 +110,7 @@ public static RubyFloat cos19(ThreadContext context, IRubyObject recv, IRubyObje return cos(context, recv, x); } - @JRubyMethod(name = "sin", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "sin", module = true, visibility = Visibility.PRIVATE) public static RubyFloat sin(ThreadContext context, IRubyObject recv, IRubyObject x) { return RubyFloat.newFloat(context.runtime, Math.sin(RubyNumeric.num2dbl(context, x))); } @@ -120,7 +120,7 @@ public static RubyFloat sin19(ThreadContext context, IRubyObject recv, IRubyObje return sin(context, recv, x); } - @JRubyMethod(name = "tan", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "tan", module = true, visibility = Visibility.PRIVATE) public static RubyFloat tan(ThreadContext context, IRubyObject recv, IRubyObject x) { return RubyFloat.newFloat(context.runtime, Math.tan(RubyNumeric.num2dbl(context, x))); } @@ -130,7 +130,7 @@ public static RubyFloat tan19(ThreadContext context, IRubyObject recv, IRubyObj return tan(context, recv, x); } - @JRubyMethod(name = "asin", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "asin", module = true, visibility = Visibility.PRIVATE) public static RubyFloat asin(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -144,7 +144,7 @@ public static RubyFloat asin19(ThreadContext context, IRubyObject recv, IRubyObj return asin(context, recv, x); } - @JRubyMethod(name = "acos", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "acos", module = true, visibility = Visibility.PRIVATE) public static RubyFloat acos(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -158,7 +158,7 @@ public static RubyFloat acos19(ThreadContext context, IRubyObject recv, IRubyObj return acos(context, recv, x); } - @JRubyMethod(name = "atan", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "atan", module = true, visibility = Visibility.PRIVATE) public static RubyFloat atan(ThreadContext context, IRubyObject recv, IRubyObject x) { return RubyFloat.newFloat(context.runtime, Math.atan(RubyNumeric.num2dbl(context, x))); } @@ -168,7 +168,7 @@ public static RubyFloat atan19(ThreadContext context, IRubyObject recv, IRubyObj return atan(context, recv, x); } - @JRubyMethod(name = "cosh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "cosh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat cosh(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -180,7 +180,7 @@ public static RubyFloat cosh19(ThreadContext context, IRubyObject recv, IRubyObj return cosh(context, recv, x); } - @JRubyMethod(name = "sinh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "sinh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat sinh(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -192,7 +192,7 @@ public static RubyFloat sinh19(ThreadContext context, IRubyObject recv, IRubyObj return sinh(context, recv, x); } - @JRubyMethod(name = "tanh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "tanh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat tanh(ThreadContext context, IRubyObject recv, IRubyObject x) { return RubyFloat.newFloat(context.runtime, Math.tanh(RubyNumeric.num2dbl(context, x))); } @@ -202,7 +202,7 @@ public static RubyFloat tanh19(ThreadContext context, IRubyObject recv, IRubyObj return tanh(context, recv, x); } - @JRubyMethod(name = "acosh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "acosh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat acosh(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); double result; @@ -249,7 +249,7 @@ public static RubyFloat acosh19(ThreadContext context, IRubyObject recv, IRubyOb .34904658524827565638313923706880e-17 }; - @JRubyMethod(name = "asinh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "asinh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat asinh(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); double y = Math.abs(value); @@ -295,7 +295,7 @@ public static RubyFloat asinh19(ThreadContext context, IRubyObject recv, IRubyOb .4497954546494931083083327624533e-18 }; - @JRubyMethod(name = "atanh", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "atanh", module = true, visibility = Visibility.PRIVATE) public static RubyFloat atanh(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -326,7 +326,7 @@ public static RubyFloat atanh_19(ThreadContext context, IRubyObject recv, IRubyO return atanh(context, recv, x); } - @JRubyMethod(name = "exp", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "exp", module = true, visibility = Visibility.PRIVATE) public static RubyFloat exp(ThreadContext context, IRubyObject recv, IRubyObject exponent) { return exp(context, exponent); } @@ -409,7 +409,7 @@ public static RubyFloat log_19(ThreadContext context, IRubyObject recv, IRubyObj /** Returns the base 10 logarithm of x. * */ - @JRubyMethod(name = "log10", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "log10", module = true, visibility = Visibility.PRIVATE) public static RubyFloat log10(ThreadContext context, IRubyObject recv, IRubyObject x) { double [] ret = get_double_rshift(context, x); @@ -429,7 +429,7 @@ public static RubyFloat log10_19(ThreadContext context, IRubyObject recv, IRubyO /** Returns the base 2 logarithm of x. * */ - @JRubyMethod(name = "log2", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "log2", module = true, visibility = Visibility.PRIVATE) public static RubyFloat log2(ThreadContext context, IRubyObject recv, IRubyObject x) { double [] ret = get_double_rshift(context, x); @@ -446,7 +446,7 @@ public static RubyFloat log2_19(ThreadContext context, IRubyObject recv, IRubyOb return log2(context, recv, x); } - @JRubyMethod(name = "sqrt", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "sqrt", module = true, visibility = Visibility.PRIVATE) public static RubyFloat sqrt(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -460,7 +460,7 @@ public static RubyFloat sqrt19(ThreadContext context, IRubyObject recv, IRubyObj return sqrt(context, recv, x); } - @JRubyMethod(name = "cbrt", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "cbrt", module = true, visibility = Visibility.PRIVATE) public static RubyFloat cbrt(ThreadContext context, IRubyObject recv, IRubyObject x) { double result = Math.cbrt(RubyNumeric.num2dbl(context, x)); @@ -471,7 +471,7 @@ public static RubyFloat hypot(ThreadContext context, IRubyObject recv, IRubyObje return hypot19(context, recv, x, y); } - @JRubyMethod(name = "hypot", required = 2, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "hypot", module = true, visibility = Visibility.PRIVATE) public static RubyFloat hypot19(ThreadContext context, IRubyObject recv, IRubyObject x, IRubyObject y) { double valuea = RubyNumeric.num2dbl(context, x); double valueb = RubyNumeric.num2dbl(context, y); @@ -499,7 +499,7 @@ public static RubyFloat hypot19(ThreadContext context, IRubyObject recv, IRubyOb * Where mantissa is in the range of [.5, 1) * */ - @JRubyMethod(name = "frexp", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "frexp", module = true, visibility = Visibility.PRIVATE) public static RubyArray frexp(ThreadContext context, IRubyObject recv, IRubyObject other) { double mantissa = RubyNumeric.num2dbl(context, other); short sign = 1; @@ -532,7 +532,7 @@ public static RubyArray frexp19(ThreadContext context, IRubyObject recv, IRubyOb /* * r = x * 2 ** y */ - @JRubyMethod(name = "ldexp", required = 2, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "ldexp", module = true, visibility = Visibility.PRIVATE) public static RubyFloat ldexp(ThreadContext context, IRubyObject recv, IRubyObject mantissa, IRubyObject exponent) { double m = RubyNumeric.num2dbl(context, mantissa); int e = RubyNumeric.num2int(exponent); @@ -566,7 +566,7 @@ public static RubyFloat ldexp19(ThreadContext context, IRubyObject recv, IRubyOb -.126124551191552258324954248533e-18 }; - @JRubyMethod(name = "erf", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "erf", module = true, visibility = Visibility.PRIVATE) public static RubyFloat erf(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); @@ -654,7 +654,7 @@ public static RubyFloat erf19(ThreadContext context, IRubyObject recv, IRubyObje .194744338223207851429197867821e-18 }; - @JRubyMethod(name = "erfc", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "erfc", module = true, visibility = Visibility.PRIVATE) public static RubyFloat erfc(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyNumeric.num2dbl(context, x); double result; @@ -747,7 +747,7 @@ public static RubyFloat erfc19(ThreadContext context, IRubyObject recv, IRubyObj * New asymptotic expansion for the Γ(x) function */ - @JRubyMethod(name = "gamma", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "gamma", module = true, visibility = Visibility.PRIVATE) public static RubyFloat gamma(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyKernel.new_float(context.runtime, x).value; double result = nemes_gamma(value); @@ -786,7 +786,7 @@ public static RubyFloat gamma(ThreadContext context, IRubyObject recv, IRubyObje * @see #gamma(ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.runtime.builtin.IRubyObject) */ - @JRubyMethod(name = "lgamma", required = 1, module = true, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "lgamma", module = true, visibility = Visibility.PRIVATE) public static RubyArray lgamma(ThreadContext context, IRubyObject recv, IRubyObject x) { double value = RubyKernel.new_float(context.runtime, x).value; // JRUBY-4653: Could this error checking done more elegantly? diff --git a/core/src/main/java/org/jruby/RubyMethod.java b/core/src/main/java/org/jruby/RubyMethod.java index d5859880fc6..7ebbad1bb11 100644 --- a/core/src/main/java/org/jruby/RubyMethod.java +++ b/core/src/main/java/org/jruby/RubyMethod.java @@ -155,19 +155,19 @@ public RubyFixnum arity() { return getRuntime().newFixnum(method.getSignature().arityValue()); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject op_eql(ThreadContext context, IRubyObject other) { return op_equal(context, other); } @Override - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public RubyBoolean op_equal(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, equals(other) ); } @Override - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") public IRubyObject op_eqq(ThreadContext context, IRubyObject other) { return method.call(context, receiver, sourceModule, methodName, other, Block.NULL_BLOCK); } diff --git a/core/src/main/java/org/jruby/RubyModule.java b/core/src/main/java/org/jruby/RubyModule.java index fa003c18ed0..cc22aef072f 100644 --- a/core/src/main/java/org/jruby/RubyModule.java +++ b/core/src/main/java/org/jruby/RubyModule.java @@ -806,7 +806,7 @@ private String calculateAnonymousName() { } - @JRubyMethod(name = "refine", required = 1, reads = SCOPE) + @JRubyMethod(name = "refine", reads = SCOPE) public IRubyObject refine(ThreadContext context, IRubyObject klass, Block block) { if (!block.isGiven()) throw context.runtime.newArgumentError("no block given"); @@ -918,7 +918,7 @@ private void addActivatedRefinement(ThreadContext context, RubyModule moduleToRe activatedRefinements.put(moduleToRefine, iclass); } - @JRubyMethod(name = "using", required = 1, visibility = PRIVATE, reads = {SELF, SCOPE}) + @JRubyMethod(name = "using", visibility = PRIVATE, reads = {SELF, SCOPE}) public IRubyObject using(ThreadContext context, IRubyObject refinedModule) { if (context.getFrameSelf() != this) throw context.runtime.newRuntimeError("Module#using is not called on self"); if (context.getCurrentStaticScope().isWithinMethod()) { @@ -1451,7 +1451,7 @@ public void undef(ThreadContext context, String name) { } } - @JRubyMethod(name = "include?", required = 1) + @JRubyMethod(name = "include?") public IRubyObject include_p(ThreadContext context, IRubyObject arg) { if (!arg.isModule()) { throw context.runtime.newTypeError(arg, context.runtime.getModule()); @@ -2611,7 +2611,7 @@ protected final IRubyObject cloneMethods(RubyModule clone) { /** mri: rb_mod_init_copy * */ - @JRubyMethod(name = "initialize_copy", required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject original) { if (this instanceof RubyClass) { @@ -2788,7 +2788,7 @@ public RubyString to_s() { /** rb_mod_eqq * */ - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") @Override public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, isInstance(obj)); @@ -2805,7 +2805,7 @@ public boolean equals(Object other) { return this == other; } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if(!(other instanceof RubyModule)) return context.fals; @@ -2831,7 +2831,7 @@ public final IRubyObject freeze(ThreadContext context) { /** * MRI: rb_class_inherited_p */ - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(IRubyObject arg) { Ruby runtime = getRuntime(); @@ -2868,7 +2868,7 @@ protected RubyModule searchAncestor(RubyModule c) { /** rb_mod_lt * */ - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public IRubyObject op_lt(IRubyObject obj) { return obj == this ? getRuntime().getFalse() : op_le(obj); } @@ -2876,7 +2876,7 @@ public IRubyObject op_lt(IRubyObject obj) { /** rb_mod_ge * */ - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(IRubyObject obj) { if (!(obj instanceof RubyModule)) { throw getRuntime().newTypeError("compared with non class/module"); @@ -2888,7 +2888,7 @@ public IRubyObject op_ge(IRubyObject obj) { /** rb_mod_gt * */ - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(IRubyObject obj) { return this == obj ? getRuntime().getFalse() : op_ge(obj); } @@ -2896,7 +2896,7 @@ public IRubyObject op_gt(IRubyObject obj) { /** rb_mod_cmp * */ - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject op_cmp(IRubyObject obj) { if (this == obj) return getRuntime().newFixnum(0); if (!(obj instanceof RubyModule)) return getRuntime().getNil(); @@ -3187,7 +3187,7 @@ public RubyArray public_instance_methods19(IRubyObject[] args) { return instanceMethods(args, PUBLIC, false, false); } - @JRubyMethod(name = "instance_method", required = 1, reads = SCOPE) + @JRubyMethod(name = "instance_method", reads = SCOPE) public IRubyObject instance_method(ThreadContext context, IRubyObject symbol) { return newMethod(null, TypeConverter.checkID(symbol).idString(), context.getCurrentStaticScope(), false, null); } @@ -3196,7 +3196,7 @@ public IRubyObject instance_method(IRubyObject symbol) { return newMethod(null, TypeConverter.checkID(symbol).idString(), false, null); } - @JRubyMethod(name = "public_instance_method", required = 1) + @JRubyMethod(name = "public_instance_method") public IRubyObject public_instance_method(IRubyObject symbol) { return newMethod(null, TypeConverter.checkID(symbol).idString(), false, PUBLIC); } @@ -3234,7 +3234,7 @@ public RubyArray private_instance_methods19(IRubyObject[] args) { /** rb_mod_prepend_features * */ - @JRubyMethod(name = "prepend_features", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "prepend_features", visibility = PRIVATE) public RubyModule prepend_features(IRubyObject include) { if (!isModule()) { throw getRuntime().newTypeError(this, getRuntime().getModule()); @@ -3254,7 +3254,7 @@ public RubyModule prepend_features(IRubyObject include) { /** rb_mod_append_features * */ - @JRubyMethod(name = "append_features", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "append_features", visibility = PRIVATE) public RubyModule append_features(IRubyObject include) { if (!isModule()) { throw getRuntime().newTypeError(this, getRuntime().getModule()); @@ -3274,7 +3274,7 @@ public RubyModule append_features(IRubyObject include) { /** rb_mod_extend_object * */ - @JRubyMethod(name = "extend_object", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "extend_object", visibility = PRIVATE) public IRubyObject extend_object(IRubyObject obj) { if (!isModule()) { throw getRuntime().newTypeError(this, getRuntime().getModule()); @@ -3311,7 +3311,7 @@ public RubyModule include(IRubyObject[] modules) { return this; } - @JRubyMethod(name = "include", required = 1) // most common path: include Enumerable + @JRubyMethod(name = "include") // most common path: include Enumerable public RubyModule include(ThreadContext context, IRubyObject module) { if (!module.isModule()) throw context.runtime.newTypeError(module, context.runtime.getModule()); @@ -3320,12 +3320,12 @@ public RubyModule include(ThreadContext context, IRubyObject module) { return this; } - @JRubyMethod(name = "included", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "included", visibility = PRIVATE) public IRubyObject included(ThreadContext context, IRubyObject other) { return context.nil; } - @JRubyMethod(name = "extended", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "extended", visibility = PRIVATE) public IRubyObject extended(ThreadContext context, IRubyObject other, Block block) { return context.nil; } @@ -3507,17 +3507,17 @@ public IRubyObject module_function(ThreadContext context, IRubyObject[] args) { return this; } - @JRubyMethod(name = "method_added", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "method_added", visibility = PRIVATE) public IRubyObject method_added(ThreadContext context, IRubyObject nothing) { return context.nil; } - @JRubyMethod(name = "method_removed", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "method_removed", visibility = PRIVATE) public IRubyObject method_removed(ThreadContext context, IRubyObject nothing) { return context.nil; } - @JRubyMethod(name = "method_undefined", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "method_undefined", visibility = PRIVATE) public IRubyObject method_undefined(ThreadContext context, IRubyObject nothing) { return context.nil; } @@ -3612,7 +3612,7 @@ public RubyModule private_class_method(IRubyObject[] args) { * @param oldId the current name of the method * @return the new name */ - @JRubyMethod(name = "alias_method", required = 2) + @JRubyMethod(name = "alias_method") public IRubyObject aliasMethod(ThreadContext context, IRubyObject newId, IRubyObject oldId) { RubySymbol newSym = TypeConverter.checkID(newId); RubySymbol oldSym = TypeConverter.checkID(oldId); // MRI uses rb_to_id but we return existing symbol @@ -3963,7 +3963,7 @@ private RubyModule proceedWithPrepend(RubyModule insertBelow, RubyModule moduleT ////////////////// CLASS VARIABLE RUBY METHODS //////////////// // - @JRubyMethod(name = "class_variable_defined?", required = 1) + @JRubyMethod(name = "class_variable_defined?") public IRubyObject class_variable_defined_p(ThreadContext context, IRubyObject var) { String id = validateClassVariable(context.runtime, var); @@ -4257,13 +4257,13 @@ public IRubyObject const_source_location(ThreadContext context, IRubyObject[] ar /** rb_mod_const_set * */ - @JRubyMethod(name = "const_set", required = 2) + @JRubyMethod(name = "const_set") public IRubyObject const_set(IRubyObject name, IRubyObject value) { ThreadContext context = getRuntime().getCurrentContext(); return setConstant(validateConstant(name), value, context.getFile(), context.getLine() + 1); } - @JRubyMethod(name = "remove_const", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "remove_const", visibility = PRIVATE) public IRubyObject remove_const(ThreadContext context, IRubyObject rubyName) { String id = validateConstant(rubyName); IRubyObject value = deleteConstant(id); @@ -4298,7 +4298,7 @@ private boolean hasConstantInHierarchy(final String name) { * @param rubyName The constant name which was found to be missing * @return Nothing! Absolutely nothing! (though subclasses might choose to return something) */ - @JRubyMethod(name = "const_missing", required = 1) + @JRubyMethod(name = "const_missing") public IRubyObject const_missing(ThreadContext context, IRubyObject rubyName, Block block) { Ruby runtime = context.runtime; @@ -4480,7 +4480,7 @@ public IRubyObject prepend(ThreadContext context, IRubyObject[] modules) { return this; } - @JRubyMethod(name = "prepended", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "prepended", visibility = PRIVATE) public IRubyObject prepended(ThreadContext context, IRubyObject other) { return context.nil; } diff --git a/core/src/main/java/org/jruby/RubyNil.java b/core/src/main/java/org/jruby/RubyNil.java index d9643f4caf6..c56df3dadde 100644 --- a/core/src/main/java/org/jruby/RubyNil.java +++ b/core/src/main/java/org/jruby/RubyNil.java @@ -171,7 +171,7 @@ static RubyString inspect(Ruby runtime) { } @Override - @JRubyMethod(name = "=~", required = 1) + @JRubyMethod(name = "=~") public IRubyObject op_match(ThreadContext context, IRubyObject arg) { return this; // nil } @@ -179,7 +179,7 @@ public IRubyObject op_match(ThreadContext context, IRubyObject arg) { /** nil_and * */ - @JRubyMethod(name = "&", required = 1) + @JRubyMethod(name = "&") public static RubyBoolean op_and(ThreadContext context, IRubyObject recv, IRubyObject obj) { return context.fals; } @@ -187,7 +187,7 @@ public static RubyBoolean op_and(ThreadContext context, IRubyObject recv, IRubyO /** nil_or * */ - @JRubyMethod(name = "|", required = 1) + @JRubyMethod(name = "|") public static RubyBoolean op_or(ThreadContext context, IRubyObject recv, IRubyObject obj) { return RubyBoolean.newBoolean(context, obj.isTrue()); } @@ -195,7 +195,7 @@ public static RubyBoolean op_or(ThreadContext context, IRubyObject recv, IRubyOb /** nil_xor * */ - @JRubyMethod(name = "^", required = 1) + @JRubyMethod(name = "^") public static RubyBoolean op_xor(ThreadContext context, IRubyObject recv, IRubyObject obj) { return RubyBoolean.newBoolean(context, obj.isTrue()); } diff --git a/core/src/main/java/org/jruby/RubyObjectSpace.java b/core/src/main/java/org/jruby/RubyObjectSpace.java index e10650c7ab4..1b1239295e2 100644 --- a/core/src/main/java/org/jruby/RubyObjectSpace.java +++ b/core/src/main/java/org/jruby/RubyObjectSpace.java @@ -105,13 +105,13 @@ private static boolean blockReferencesObject(IRubyObject object, Block block) { return block.getBinding().getSelf() == object; } - @JRubyMethod(required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(module = true, visibility = PRIVATE) public static IRubyObject undefine_finalizer(IRubyObject recv, IRubyObject obj, Block block) { recv.getRuntime().getObjectSpace().removeFinalizers(RubyNumeric.fix2long(obj.id())); return recv; } - @JRubyMethod(name = "_id2ref", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "_id2ref", module = true, visibility = PRIVATE) public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) { final Ruby runtime = id.getRuntime(); if (!(id instanceof RubyFixnum)) { diff --git a/core/src/main/java/org/jruby/RubyProcess.java b/core/src/main/java/org/jruby/RubyProcess.java index 032ec1fa698..e1c74f05026 100644 --- a/core/src/main/java/org/jruby/RubyProcess.java +++ b/core/src/main/java/org/jruby/RubyProcess.java @@ -961,7 +961,7 @@ public static IRubyObject getpgrp(Ruby runtime) { return runtime.newFixnum(runtime.getPosix().getpgrp()); } - @JRubyMethod(name = "groups=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "groups=", module = true, visibility = PRIVATE) public static IRubyObject groups_set(IRubyObject recv, IRubyObject arg) { throw recv.getRuntime().newNotImplementedError("Process#groups not yet implemented"); } @@ -1184,7 +1184,7 @@ public static IRubyObject setpgrp(Ruby runtime) { public static IRubyObject egid_set(IRubyObject recv, IRubyObject arg) { return egid_set(recv.getRuntime(), arg); } - @JRubyMethod(name = "egid=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "egid=", module = true, visibility = PRIVATE) public static IRubyObject egid_set(ThreadContext context, IRubyObject recv, IRubyObject arg) { return egid_set(context.runtime, arg); } @@ -1219,7 +1219,7 @@ public static IRubyObject euid(Ruby runtime) { public static IRubyObject uid_set(IRubyObject recv, IRubyObject arg) { return uid_set(recv.getRuntime(), arg); } - @JRubyMethod(name = "uid=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "uid=", module = true, visibility = PRIVATE) public static IRubyObject uid_set(ThreadContext context, IRubyObject recv, IRubyObject arg) { return uid_set(context.runtime, arg); } @@ -1253,7 +1253,7 @@ public static IRubyObject maxgroups(IRubyObject recv) { public static IRubyObject getpriority(IRubyObject recv, IRubyObject arg1, IRubyObject arg2) { return getpriority(recv.getRuntime(), arg1, arg2); } - @JRubyMethod(name = "getpriority", required = 2, module = true, visibility = PRIVATE) + @JRubyMethod(name = "getpriority", module = true, visibility = PRIVATE) public static IRubyObject getpriority(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) { return getpriority(context.runtime, arg1, arg2); } @@ -1290,12 +1290,12 @@ public static IRubyObject waitpid2(Ruby runtime, IRubyObject[] args) { return waitpid2(runtime.getCurrentContext(), runtime.getProcess(), args); } - @JRubyMethod(name = "initgroups", required = 2, module = true, visibility = PRIVATE) + @JRubyMethod(name = "initgroups", module = true, visibility = PRIVATE) public static IRubyObject initgroups(IRubyObject recv, IRubyObject arg1, IRubyObject arg2) { throw recv.getRuntime().newNotImplementedError("Process#initgroups not yet implemented"); } - @JRubyMethod(name = "maxgroups=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "maxgroups=", module = true, visibility = PRIVATE) public static IRubyObject maxgroups_set(IRubyObject recv, IRubyObject arg) { throw recv.getRuntime().newNotImplementedError("Process#maxgroups_set not yet implemented"); } @@ -1318,7 +1318,7 @@ public static IRubyObject ppid(Ruby runtime) { public static IRubyObject gid_set(IRubyObject recv, IRubyObject arg) { return gid_set(recv.getRuntime(), arg); } - @JRubyMethod(name = "gid=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "gid=", module = true, visibility = PRIVATE) public static IRubyObject gid_set(ThreadContext context, IRubyObject recv, IRubyObject arg) { return gid_set(context.runtime, arg); } @@ -1341,7 +1341,7 @@ public static IRubyObject wait2(ThreadContext context, IRubyObject recv, IRubyOb public static IRubyObject euid_set(IRubyObject recv, IRubyObject arg) { return euid_set(recv.getRuntime(), arg); } - @JRubyMethod(name = "euid=", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "euid=", module = true, visibility = PRIVATE) public static IRubyObject euid_set(ThreadContext context, IRubyObject recv, IRubyObject arg) { return euid_set(context.runtime, arg); } @@ -1364,7 +1364,7 @@ public static IRubyObject euid_set(Ruby runtime, IRubyObject arg) { public static IRubyObject setpriority(IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) { return setpriority(recv.getRuntime(), arg1, arg2, arg3); } - @JRubyMethod(name = "setpriority", required = 3, module = true, visibility = PRIVATE) + @JRubyMethod(name = "setpriority", module = true, visibility = PRIVATE) public static IRubyObject setpriority(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3) { return setpriority(context.runtime, arg1, arg2, arg3); } @@ -1382,7 +1382,7 @@ public static IRubyObject setpriority(Ruby runtime, IRubyObject arg1, IRubyObjec public static IRubyObject setpgid(IRubyObject recv, IRubyObject arg1, IRubyObject arg2) { return setpgid(recv.getRuntime(), arg1, arg2); } - @JRubyMethod(name = "setpgid", required = 2, module = true, visibility = PRIVATE) + @JRubyMethod(name = "setpgid", module = true, visibility = PRIVATE) public static IRubyObject setpgid(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2) { return setpgid(context.runtime, arg1, arg2); } @@ -1396,7 +1396,7 @@ public static IRubyObject setpgid(Ruby runtime, IRubyObject arg1, IRubyObject ar public static IRubyObject getpgid(IRubyObject recv, IRubyObject arg) { return getpgid(recv.getRuntime(), arg); } - @JRubyMethod(name = "getpgid", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "getpgid", module = true, visibility = PRIVATE) public static IRubyObject getpgid(ThreadContext context, IRubyObject recv, IRubyObject arg) { return getpgid(context.runtime, arg); } @@ -1408,7 +1408,7 @@ public static IRubyObject getpgid(Ruby runtime, IRubyObject arg) { public static IRubyObject getrlimit(IRubyObject recv, IRubyObject arg) { return getrlimit(recv.getRuntime(), arg); } - @JRubyMethod(name = "getrlimit", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "getrlimit", module = true, visibility = PRIVATE) public static IRubyObject getrlimit(ThreadContext context, IRubyObject recv, IRubyObject arg) { return getrlimit(context.runtime, arg); } @@ -1563,7 +1563,7 @@ public static IRubyObject kill(Ruby runtime, IRubyObject[] args) { } - @JRubyMethod(name = "detach", required = 1, module = true, visibility = PRIVATE) + @JRubyMethod(name = "detach", module = true, visibility = PRIVATE) public static IRubyObject detach(ThreadContext context, IRubyObject recv, IRubyObject arg) { final long pid = arg.convertToInteger().getLongValue(); Ruby runtime = context.runtime; diff --git a/core/src/main/java/org/jruby/RubyRandom.java b/core/src/main/java/org/jruby/RubyRandom.java index 12cde78cc04..af69236b67a 100644 --- a/core/src/main/java/org/jruby/RubyRandom.java +++ b/core/src/main/java/org/jruby/RubyRandom.java @@ -245,7 +245,7 @@ public static IRubyObject seed(ThreadContext context, IRubyObject self) { return getDefaultRand(context).getSeed(); } - @JRubyMethod(name = "initialize_copy", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject orig) { if (!(orig instanceof RubyRandom)) { @@ -333,7 +333,7 @@ public IRubyObject op_equal_19(ThreadContext context, IRubyObject obj) { // c: random_equal @Override - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { if (!getType().equals(obj.getType())) { return context.fals; diff --git a/core/src/main/java/org/jruby/RubyRange.java b/core/src/main/java/org/jruby/RubyRange.java index 0096940d350..2847c85fc89 100644 --- a/core/src/main/java/org/jruby/RubyRange.java +++ b/core/src/main/java/org/jruby/RubyRange.java @@ -297,7 +297,7 @@ public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block u return context.nil; } - @JRubyMethod(required = 1, visibility = PRIVATE) + @JRubyMethod(visibility = PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject original) { if (this.isInited) throw context.runtime.newFrozenError("`initialize' called twice", this); @@ -386,12 +386,12 @@ public RubyBoolean exclude_end_p() { return getRuntime().newBoolean(isExclusive); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject eql_p(ThreadContext context, IRubyObject other) { return equalityInner(context, other, MethodNames.EQL); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public IRubyObject op_equal(ThreadContext context, IRubyObject other) { return equalityInner(context, other, MethodNames.OP_EQUAL); } diff --git a/core/src/main/java/org/jruby/RubyRegexp.java b/core/src/main/java/org/jruby/RubyRegexp.java index 9e1db6598ce..417f2a9ab5f 100755 --- a/core/src/main/java/org/jruby/RubyRegexp.java +++ b/core/src/main/java/org/jruby/RubyRegexp.java @@ -879,7 +879,7 @@ public static IRubyObject union19(ThreadContext context, IRubyObject recv, IRuby /** rb_reg_init_copy */ - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject re) { if (this == re) return this; @@ -1028,7 +1028,7 @@ public RubyFixnum hash() { return metaClass.runtime.newFixnum(hash + (hash >> 5)); } - @JRubyMethod(name = {"==", "eql?"}, required = 1) + @JRubyMethod(name = {"==", "eql?"}) @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (this == other) { @@ -1073,7 +1073,7 @@ public IRubyObject op_match2(ThreadContext context) { /** rb_reg_eqq * */ - @JRubyMethod(name = "===", required = 1, writes = BACKREF) + @JRubyMethod(name = "===", writes = BACKREF) public IRubyObject eqq(ThreadContext context, IRubyObject arg) { arg = operandNoCheck(arg); @@ -1101,7 +1101,7 @@ public IRubyObject eqq19(ThreadContext context, IRubyObject arg) { // MRI: rb_reg_match @Override - @JRubyMethod(name = "=~", required = 1, writes = BACKREF) + @JRubyMethod(name = "=~", writes = BACKREF) public IRubyObject op_match(ThreadContext context, IRubyObject str) { final RubyString[] strp = { null }; int pos = matchPos(context, str, strp, true, 0); diff --git a/core/src/main/java/org/jruby/RubySignal.java b/core/src/main/java/org/jruby/RubySignal.java index 62ca459a287..cfbd55d4859 100644 --- a/core/src/main/java/org/jruby/RubySignal.java +++ b/core/src/main/java/org/jruby/RubySignal.java @@ -155,27 +155,27 @@ public static IRubyObject list(ThreadContext context, IRubyObject recv) { return names; } - @JRubyMethod(required = 2, meta = true) + @JRubyMethod(meta = true) public static IRubyObject __jtrap_kernel(final IRubyObject recv, IRubyObject block, IRubyObject sig) { return SIGNAL_FACADE.trap(recv, block, sig); } - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject __jtrap_platform_kernel(final IRubyObject recv, IRubyObject sig) { return SIGNAL_FACADE.restorePlatformDefault(recv, sig); } - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject __jtrap_osdefault_kernel(final IRubyObject recv, IRubyObject sig) { return SIGNAL_FACADE.restoreOSDefault(recv, sig); } - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject __jtrap_restore_kernel(final IRubyObject recv, IRubyObject sig) { return SIGNAL_FACADE.ignore(recv, sig); } - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject signame(ThreadContext context, final IRubyObject recv, IRubyObject rubySig) { long sig = rubySig.convertToInteger().getLongValue(); String signame = signo2signm(sig); diff --git a/core/src/main/java/org/jruby/RubyString.java b/core/src/main/java/org/jruby/RubyString.java index 36b78db833b..f6cf4b5d706 100644 --- a/core/src/main/java/org/jruby/RubyString.java +++ b/core/src/main/java/org/jruby/RubyString.java @@ -1227,7 +1227,7 @@ public IRubyObject op_plus(ThreadContext context, IRubyObject arg) { return op_plus19(context, arg); } - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public IRubyObject op_plus19(ThreadContext context, IRubyObject arg) { RubyString str = arg.convertToString(); Encoding enc = checkEncoding(str); @@ -1244,7 +1244,7 @@ public IRubyObject op_mul(ThreadContext context, IRubyObject other) { return op_mul19(context, other); } - @JRubyMethod(name = "*", required = 1) + @JRubyMethod(name = "*") public IRubyObject op_mul19(ThreadContext context, IRubyObject other) { RubyString result = multiplyByteList(context, other); result.value.setEncoding(value.getEncoding()); @@ -1276,7 +1276,7 @@ private RubyString multiplyByteList(ThreadContext context, IRubyObject arg) { return result; } - @JRubyMethod(name = "%", required = 1) + @JRubyMethod(name = "%") public RubyString op_format(ThreadContext context, IRubyObject arg) { IRubyObject tmp; if (arg instanceof RubyHash) { @@ -1489,13 +1489,13 @@ public IRubyObject replace(IRubyObject other) { return replace19(other); } - @JRubyMethod(name = "initialize_copy", required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(name = "initialize_copy", visibility = Visibility.PRIVATE) @Override public RubyString initialize_copy(IRubyObject other) { return replace19(other); } - @JRubyMethod(name = "replace", required = 1) + @JRubyMethod(name = "replace") public RubyString replace19(IRubyObject other) { modifyCheck(); if (this == other) return this; @@ -1723,7 +1723,7 @@ public IRubyObject match(ThreadContext context, IRubyObject pattern) { return match19(context, pattern, Block.NULL_BLOCK); } - @JRubyMethod(name = "match", required = 1, writes = BACKREF) + @JRubyMethod(name = "match", writes = BACKREF) public IRubyObject match19(ThreadContext context, IRubyObject pattern, Block block) { RubyRegexp coercedPattern = getPattern(context.runtime, pattern); IRubyObject result = sites(context).match.call(context, coercedPattern, coercedPattern, this); diff --git a/core/src/main/java/org/jruby/RubyStruct.java b/core/src/main/java/org/jruby/RubyStruct.java index 2f25e85131d..747bca5a1b8 100644 --- a/core/src/main/java/org/jruby/RubyStruct.java +++ b/core/src/main/java/org/jruby/RubyStruct.java @@ -608,7 +608,7 @@ public void copySpecialInstanceVariables(IRubyObject clone) { System.arraycopy(values, 0, struct.values, 0, values.length); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (this == other) return context.tru; @@ -622,7 +622,7 @@ public IRubyObject op_equal(ThreadContext context, IRubyObject other) { return RecursiveComparator.compare(context, sites(context).op_equal, this, other); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject eql_p(ThreadContext context, IRubyObject other) { if (this == other) return context.tru; if (!(other instanceof RubyStruct)) return context.fals; @@ -776,7 +776,7 @@ public IRubyObject each_pair(final ThreadContext context, final Block block) { return block.isGiven() ? each_pairInternal(context, block) : enumeratorizeWithSize(context, this, "each_pair", RubyStruct::size); } - @JRubyMethod(name = "[]", required = 1) + @JRubyMethod(name = "[]") public IRubyObject aref(IRubyObject key) { return arefImpl( key, false ); } @@ -807,7 +807,7 @@ final IRubyObject aref(int idx) { return values[newIdx]; } - @JRubyMethod(name = "[]=", required = 2) + @JRubyMethod(name = "[]=") public IRubyObject aset(IRubyObject key, IRubyObject value) { if (key instanceof RubyString || key instanceof RubySymbol) { final String name = key.asJavaString(); @@ -942,7 +942,7 @@ private static RubyClass pathToClass(Ruby runtime, String path) { } @Override - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) public IRubyObject initialize_copy(IRubyObject arg) { if (this == arg) return this; RubyStruct original = (RubyStruct) arg; diff --git a/core/src/main/java/org/jruby/RubySymbol.java b/core/src/main/java/org/jruby/RubySymbol.java index 28b21354c39..692b7f0cf1b 100644 --- a/core/src/main/java/org/jruby/RubySymbol.java +++ b/core/src/main/java/org/jruby/RubySymbol.java @@ -504,13 +504,13 @@ public RubyString asString() { return to_s(metaClass.runtime); } - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") @Override public IRubyObject op_eqq(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, this == other); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, this == other); diff --git a/core/src/main/java/org/jruby/RubyThread.java b/core/src/main/java/org/jruby/RubyThread.java index 77cae6c3caa..1d88c5fd8c4 100644 --- a/core/src/main/java/org/jruby/RubyThread.java +++ b/core/src/main/java/org/jruby/RubyThread.java @@ -911,7 +911,7 @@ private boolean pendingInterruptInclude(RubyModule err) { return false; } - @JRubyMethod(name = "name=", required = 1) + @JRubyMethod(name = "name=") public IRubyObject setName(IRubyObject name) { final Ruby runtime = getRuntime(); @@ -1073,7 +1073,7 @@ public IRubyObject fetch(ThreadContext context, IRubyObject key, IRubyObject _de return value; } - @JRubyMethod(name = "[]", required = 1) + @JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { key = getSymbolKey(key); final Map locals = getFiberLocals(); @@ -1083,7 +1083,7 @@ public IRubyObject op_aref(ThreadContext context, IRubyObject key) { } } - @JRubyMethod(name = "[]=", required = 2) + @JRubyMethod(name = "[]=") public IRubyObject op_aset(IRubyObject key, IRubyObject value) { checkFrozen(); @@ -1137,7 +1137,7 @@ public IRubyObject thread_variable_get(ThreadContext context, IRubyObject key) { } } - @JRubyMethod(name = "thread_variable_set", required = 2) + @JRubyMethod(name = "thread_variable_set") public IRubyObject thread_variable_set(ThreadContext context, IRubyObject key, IRubyObject value) { checkFrozen(); key = getSymbolKey(key); @@ -1175,7 +1175,7 @@ public RubyBoolean abort_on_exception(ThreadContext context) { return isAbortOnException() ? context.tru : context.fals; } - @JRubyMethod(name = "abort_on_exception=", required = 1) + @JRubyMethod(name = "abort_on_exception=") public IRubyObject abort_on_exception_set(IRubyObject val) { setAbortOnException(val.isTrue()); return val; @@ -1367,7 +1367,7 @@ public static IRubyObject stop(ThreadContext context, IRubyObject receiver) { return context.nil; } - @JRubyMethod(required = 1, meta = true) + @JRubyMethod(meta = true) public static IRubyObject kill(IRubyObject receiver, IRubyObject rubyThread, Block block) { if (!(rubyThread instanceof RubyThread)) throw receiver.getRuntime().newTypeError(rubyThread, receiver.getRuntime().getThread()); return ((RubyThread)rubyThread).kill(); @@ -1403,7 +1403,7 @@ public RubyFixnum priority() { return RubyFixnum.newFixnum(getRuntime(), javaPriorityToRubyPriority(threadImpl.getPriority())); } - @JRubyMethod(name = "priority=", required = 1) + @JRubyMethod(name = "priority=") public IRubyObject priority_set(IRubyObject priority) { int iPriority = RubyNumeric.fix2int(priority); diff --git a/core/src/main/java/org/jruby/RubyTime.java b/core/src/main/java/org/jruby/RubyTime.java index 7e3bfc63276..610cea882e6 100644 --- a/core/src/main/java/org/jruby/RubyTime.java +++ b/core/src/main/java/org/jruby/RubyTime.java @@ -561,7 +561,7 @@ public static RubyTime newTime(Ruby runtime, DateTime dt, long nsec) { return t; } - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) @Override public IRubyObject initialize_copy(IRubyObject original) { if (!(original instanceof RubyTime)) { @@ -689,13 +689,13 @@ public RubyString strftime(IRubyObject format) { return strftime(getRuntime().getCurrentContext(), format); } - @JRubyMethod(required = 1) + @JRubyMethod public RubyString strftime(ThreadContext context, IRubyObject format) { final RubyDateFormatter rdf = context.getRubyDateFormatter(); return rdf.compileAndFormat(format.convertToString().getByteList(), false, dt, nsec, null); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { @@ -719,7 +719,7 @@ private static int safeCmp(ThreadContext context, RubyTime self, IRubyObject oth return cmpResult; } - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { return RubyBoolean.newBoolean(context, safeCmp(context, this, other) >= 0); @@ -728,7 +728,7 @@ public IRubyObject op_ge(ThreadContext context, IRubyObject other) { return RubyComparable.op_ge(context, this, other); } - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { return RubyBoolean.newBoolean(context, safeCmp(context, this, other) > 0); @@ -737,7 +737,7 @@ public IRubyObject op_gt(ThreadContext context, IRubyObject other) { return RubyComparable.op_gt(context, this, other); } - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { return RubyBoolean.newBoolean(context, safeCmp(context, this, other) <= 0); @@ -746,7 +746,7 @@ public IRubyObject op_le(ThreadContext context, IRubyObject other) { return RubyComparable.op_le(context, this, other); } - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public IRubyObject op_lt(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { return RubyBoolean.newBoolean(context, safeCmp(context, this, other) < 0); @@ -776,7 +776,7 @@ public IRubyObject op_plus(IRubyObject other) { return op_plus(getRuntime().getCurrentContext(), other); } - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public IRubyObject op_plus(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { throw context.runtime.newTypeError("time + time?"); @@ -823,7 +823,7 @@ public IRubyObject op_minus(IRubyObject other) { return op_minus(getRuntime().getCurrentContext(), other); } - @JRubyMethod(name = "-", required = 1) + @JRubyMethod(name = "-") public IRubyObject op_minus(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) return opMinus(context.runtime, (RubyTime) other); @@ -859,7 +859,7 @@ private RubyTime opMinus(Ruby runtime, double other) { return newTime; } - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") @Override public IRubyObject op_eqq(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { @@ -869,7 +869,7 @@ public IRubyObject op_eqq(ThreadContext context, IRubyObject other) { return context.fals; } - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") @Override public IRubyObject op_cmp(ThreadContext context, IRubyObject other) { if (other instanceof RubyTime) { @@ -879,7 +879,7 @@ public IRubyObject op_cmp(ThreadContext context, IRubyObject other) { return invcmp(context, sites(context).recursive_cmp, this, other); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") @Override public IRubyObject eql_p(IRubyObject other) { if (other instanceof RubyTime) { diff --git a/core/src/main/java/org/jruby/RubyUnboundMethod.java b/core/src/main/java/org/jruby/RubyUnboundMethod.java index d9b1dba8828..6c541df44cd 100644 --- a/core/src/main/java/org/jruby/RubyUnboundMethod.java +++ b/core/src/main/java/org/jruby/RubyUnboundMethod.java @@ -91,7 +91,7 @@ public static RubyClass defineUnboundMethodClass(Ruby runtime) { } @Override - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public RubyBoolean op_equal(ThreadContext context, IRubyObject other) { return RubyBoolean.newBoolean(context, equals(other) ); } diff --git a/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java b/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java index d4a28469171..6aafff7190c 100644 --- a/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java +++ b/core/src/main/java/org/jruby/ext/bigdecimal/RubyBigDecimal.java @@ -990,7 +990,7 @@ public IRubyObject initialize_copy(IRubyObject original) { return this; } - @JRubyMethod(name = {"%", "modulo"}, required = 1) + @JRubyMethod(name = {"%", "modulo"}) public IRubyObject op_mod(ThreadContext context, IRubyObject other) { RubyBigDecimal val = getVpValueWithPrec(context, other, false); @@ -1014,7 +1014,7 @@ public IRubyObject op_mod19(ThreadContext context, IRubyObject arg) { } @Override - @JRubyMethod(name = "remainder", required = 1) + @JRubyMethod(name = "remainder") public IRubyObject remainder(ThreadContext context, IRubyObject arg) { return remainderInternal(context, getVpValueWithPrec(context, arg, false), arg); } @@ -1034,7 +1034,7 @@ private IRubyObject remainderInternal(ThreadContext context, RubyBigDecimal val, return new RubyBigDecimal(context.runtime, value.remainder(val.value)).setResult(); } - @JRubyMethod(name = "*", required = 1) + @JRubyMethod(name = "*") public IRubyObject op_mul(ThreadContext context, IRubyObject arg) { RubyBigDecimal val = getVpValueWithPrec(context, arg, false); if (val == null) return callCoerced(context, sites(context).op_times, arg, true); @@ -1046,7 +1046,7 @@ public IRubyObject op_mul19(ThreadContext context, IRubyObject arg) { return op_mul(context, arg); } - @JRubyMethod(name = "mult", required = 2) + @JRubyMethod(name = "mult") public IRubyObject mult2(ThreadContext context, IRubyObject b, IRubyObject n) { final int mx = getPrecisionInt(context.runtime, n); if (mx == 0) return op_mul(context, b); @@ -1405,7 +1405,7 @@ public IRubyObject op_uminus(ThreadContext context) { return new RubyBigDecimal(context.runtime, value.negate()); } - @JRubyMethod(name = "-", required = 1) + @JRubyMethod(name = "-") public IRubyObject op_minus(ThreadContext context, IRubyObject b) { return subInternal(context, getVpValueWithPrec(context, b, false), b, 0); } @@ -1415,7 +1415,7 @@ public IRubyObject op_minus19(ThreadContext context, IRubyObject b) { return op_minus(context, b); } - @JRubyMethod(name = "sub", required = 2) + @JRubyMethod(name = "sub") public IRubyObject sub2(ThreadContext context, IRubyObject b, IRubyObject n) { return subInternal(context, getVpValueWithPrec(context, b, false), b, getPositiveInt(context, n)); } @@ -1723,40 +1723,40 @@ private static boolean falsyEqlCheck(final ThreadContext context, final IRubyObj } @Override - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject op_cmp(ThreadContext context, IRubyObject arg) { return cmp(context, arg, '*'); } // NOTE: do not use BigDecimal#equals since ZERO.equals(new BD('0.0')) -> false @Override - @JRubyMethod(name = {"eql?", "=="}, required = 1) + @JRubyMethod(name = {"eql?", "=="}) public IRubyObject eql_p(ThreadContext context, IRubyObject arg) { return cmp(context, arg, '='); } @Override - @JRubyMethod(name = "===", required = 1) // same as == (eql?) + @JRubyMethod(name = "===") // same as == (eql?) public IRubyObject op_eqq(ThreadContext context, IRubyObject arg) { return cmp(context, arg, '='); } - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public IRubyObject op_lt(ThreadContext context, IRubyObject arg) { return cmp(context, arg, '<'); } - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject arg) { return cmp(context, arg, 'L'); } - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject arg) { return cmp(context, arg, '>'); } - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject arg) { return cmp(context, arg, 'G'); } diff --git a/core/src/main/java/org/jruby/ext/date/RubyDate.java b/core/src/main/java/org/jruby/ext/date/RubyDate.java index 690dc690040..90ec12e50c8 100644 --- a/core/src/main/java/org/jruby/ext/date/RubyDate.java +++ b/core/src/main/java/org/jruby/ext/date/RubyDate.java @@ -785,7 +785,7 @@ public final boolean equals(RubyDate that) { } @Override - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject eql_p(IRubyObject other) { if (other instanceof RubyDate) { return getRuntime().newBoolean( equals((RubyDate) other) ); @@ -803,7 +803,7 @@ public IRubyObject eql_p(IRubyObject other) { * @return true/false/nil */ @Override - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") public IRubyObject op_eqq(ThreadContext context, IRubyObject other) { if (other instanceof RubyDate) { return f_equal(context, jd(context), ((RubyDate) other).jd(context)); @@ -828,7 +828,7 @@ private IRubyObject fallback_eqq(ThreadContext context, IRubyObject other) { } @Override - @JRubyMethod(name = "<=>", required = 1) + @JRubyMethod(name = "<=>") public IRubyObject op_cmp(ThreadContext context, IRubyObject other) { if (other instanceof RubyDate) { return context.runtime.newFixnum(cmp(context, (RubyDate) other)); diff --git a/core/src/main/java/org/jruby/ext/etc/RubyEtc.java b/core/src/main/java/org/jruby/ext/etc/RubyEtc.java index 7fb8e87f4d9..40aa092f0c8 100644 --- a/core/src/main/java/org/jruby/ext/etc/RubyEtc.java +++ b/core/src/main/java/org/jruby/ext/etc/RubyEtc.java @@ -40,7 +40,7 @@ @JRubyModule(name="Etc") public class RubyEtc { public static class IOExt { - @JRubyMethod(required = 1) + @JRubyMethod public static synchronized IRubyObject pathconf(ThreadContext context, IRubyObject recv, IRubyObject arg) { Pathconf name = Pathconf.valueOf(RubyNumeric.num2long(arg)); RubyIO io = (RubyIO) recv; @@ -159,7 +159,7 @@ private static IRubyObject intoStringArray(Ruby runtime, String[] members) { return RubyArray.newArrayMayCopy(runtime, arr); } - @JRubyMethod(required = 1, module = true) + @JRubyMethod(module = true) public static synchronized IRubyObject sysconf(ThreadContext context, IRubyObject recv, IRubyObject arg) { Ruby runtime = context.runtime; Sysconf name = Sysconf.valueOf(RubyNumeric.num2long(arg)); @@ -181,7 +181,7 @@ public static synchronized IRubyObject sysconf(ThreadContext context, IRubyObjec return RubyFixnum.newFixnum(runtime, ret); } - @JRubyMethod(required = 1, module = true) + @JRubyMethod(module = true) public static synchronized IRubyObject confstr(ThreadContext context, IRubyObject recv, IRubyObject arg) { Confstr name = Confstr.valueOf(RubyNumeric.num2long(arg)); ByteBuffer buf; @@ -244,7 +244,7 @@ public static synchronized IRubyObject getpwuid(IRubyObject recv, IRubyObject[] } } - @JRubyMethod(required=1, module = true) + @JRubyMethod(module = true) public static synchronized IRubyObject getpwnam(IRubyObject recv, IRubyObject name) { Ruby runtime = recv.getRuntime(); String nam = name.convertToString().toString(); @@ -373,7 +373,7 @@ public static synchronized IRubyObject getpwent(IRubyObject recv) { } } - @JRubyMethod(required=1, module = true) + @JRubyMethod(module = true) public static synchronized IRubyObject getgrnam(IRubyObject recv, IRubyObject name) { Ruby runtime = recv.getRuntime(); String nam = name.convertToString().toString(); diff --git a/core/src/main/java/org/jruby/ext/ffi/AbstractMemory.java b/core/src/main/java/org/jruby/ext/ffi/AbstractMemory.java index 2d2b4376d22..32f4cd2572c 100644 --- a/core/src/main/java/org/jruby/ext/ffi/AbstractMemory.java +++ b/core/src/main/java/org/jruby/ext/ffi/AbstractMemory.java @@ -195,7 +195,7 @@ public boolean equals(Object obj) { return other.getMemoryIO().equals(getMemoryIO()); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") @Override public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this.equals(obj)); @@ -247,7 +247,7 @@ public final IRubyObject type_size(ThreadContext context) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_char" } , required = 1) + @JRubyMethod(name = { "write_char" } ) public IRubyObject write_char(ThreadContext context, IRubyObject value) { getMemoryIO().putByte(0, Util.int8Value(value)); @@ -260,7 +260,7 @@ public IRubyObject write_char(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int8", "put_char" } , required = 1) + @JRubyMethod(name = { "put_int8", "put_char" } ) public IRubyObject put_int8(ThreadContext context, IRubyObject value) { getMemoryIO().putByte(0, Util.int8Value(value)); @@ -274,7 +274,7 @@ public IRubyObject put_int8(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int8", "put_char" } , required = 2) + @JRubyMethod(name = { "put_int8", "put_char" } ) public IRubyObject put_int8(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putByte(getOffset(offset), Util.int8Value(value)); @@ -307,7 +307,7 @@ public IRubyObject get_int8(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_int8", "get_char" }, required = 1) + @JRubyMethod(name = { "get_int8", "get_char" }) public IRubyObject get_int8(ThreadContext context, IRubyObject offset) { return Util.newSigned8(context.runtime, getMemoryIO().getByte(getOffset(offset))); } @@ -318,7 +318,7 @@ public IRubyObject get_int8(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_uchar" }, required = 1) + @JRubyMethod(name = { "write_uchar" }) public IRubyObject write_uchar(ThreadContext context, IRubyObject value) { getMemoryIO().putByte(0, (byte) Util.uint8Value(value)); return this; @@ -330,7 +330,7 @@ public IRubyObject write_uchar(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint8", "put_uchar" }, required = 1) + @JRubyMethod(name = { "put_uint8", "put_uchar" }) public IRubyObject put_uint8(ThreadContext context, IRubyObject value) { getMemoryIO().putByte(0, (byte) Util.uint8Value(value)); return this; @@ -343,7 +343,7 @@ public IRubyObject put_uint8(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint8", "put_uchar" }, required = 2) + @JRubyMethod(name = { "put_uint8", "put_uchar" }) public IRubyObject put_uint8(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putByte(getOffset(offset), (byte) Util.uint8Value(value)); return this; @@ -375,7 +375,7 @@ public IRubyObject get_uint8(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_uint8", "get_uchar" }, required = 1) + @JRubyMethod(name = { "get_uint8", "get_uchar" }) public IRubyObject get_uint8(ThreadContext context, IRubyObject offset) { return Util.newUnsigned8(context.runtime, getMemoryIO().getByte(getOffset(offset))); } @@ -386,7 +386,7 @@ public IRubyObject get_uint8(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_short", "write_int16" }, required = 1) + @JRubyMethod(name = { "write_short", "write_int16" }) public IRubyObject write_short(ThreadContext context, IRubyObject value) { getMemoryIO().putShort(0, Util.int16Value(value)); @@ -399,7 +399,7 @@ public IRubyObject write_short(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int16", "put_short" }, required = 1) + @JRubyMethod(name = { "put_int16", "put_short" }) public IRubyObject put_int16(ThreadContext context, IRubyObject value) { getMemoryIO().putShort(0, Util.int16Value(value)); @@ -413,7 +413,7 @@ public IRubyObject put_int16(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int16", "put_short" }, required = 2) + @JRubyMethod(name = { "put_int16", "put_short" }) public IRubyObject put_int16(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putShort(getOffset(offset), Util.int16Value(value)); @@ -446,7 +446,7 @@ public IRubyObject get_int16(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_int16", "get_short" }, required = 1) + @JRubyMethod(name = { "get_int16", "get_short" }) public IRubyObject get_int16(ThreadContext context, IRubyObject offset) { return Util.newSigned16(context.runtime, getMemoryIO().getShort(getOffset(offset))); } @@ -457,7 +457,7 @@ public IRubyObject get_int16(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_ushort" }, required = 1) + @JRubyMethod(name = { "write_ushort" }) public IRubyObject write_ushort(ThreadContext context, IRubyObject value) { getMemoryIO().putShort(0, (short) Util.uint16Value(value)); @@ -470,7 +470,7 @@ public IRubyObject write_ushort(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint16", "put_ushort" }, required = 1) + @JRubyMethod(name = { "put_uint16", "put_ushort" }) public IRubyObject put_uint16(ThreadContext context, IRubyObject value) { getMemoryIO().putShort(0, (short) Util.uint16Value(value)); @@ -484,7 +484,7 @@ public IRubyObject put_uint16(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint16", "put_ushort" }, required = 2) + @JRubyMethod(name = { "put_uint16", "put_ushort" }) public IRubyObject put_uint16(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putShort(getOffset(offset), (short) Util.uint16Value(value)); @@ -517,7 +517,7 @@ public IRubyObject get_uint16(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_uint16", "get_ushort" }, required = 1) + @JRubyMethod(name = { "get_uint16", "get_ushort" }) public IRubyObject get_uint16(ThreadContext context, IRubyObject offset) { return Util.newUnsigned16(context.runtime, getMemoryIO().getShort(getOffset(offset))); } @@ -555,7 +555,7 @@ public IRubyObject put_int32(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int32", "put_int" }, required = 2) + @JRubyMethod(name = { "put_int32", "put_int" }) public IRubyObject put_int32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putInt(getOffset(offset), Util.int32Value(value)); @@ -588,7 +588,7 @@ public IRubyObject get_int32(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_int32", "get_int" }, required = 1) + @JRubyMethod(name = { "get_int32", "get_int" }) public IRubyObject get_int32(ThreadContext context, IRubyObject offset) { return Util.newSigned32(context.runtime, getMemoryIO().getInt(getOffset(offset))); } @@ -599,7 +599,7 @@ public IRubyObject get_int32(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_uint32", "write_uint" }, required = 1) + @JRubyMethod(name = { "write_uint32", "write_uint" }) public IRubyObject write_uint(ThreadContext context, IRubyObject value) { getMemoryIO().putInt(0, (int) Util.uint32Value(value)); @@ -612,7 +612,7 @@ public IRubyObject write_uint(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint32", "put_uint" }, required = 1) + @JRubyMethod(name = { "put_uint32", "put_uint" }) public IRubyObject put_uint32(ThreadContext context, IRubyObject value) { getMemoryIO().putInt(0, (int) Util.uint32Value(value)); @@ -626,7 +626,7 @@ public IRubyObject put_uint32(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint32", "put_uint" }, required = 2) + @JRubyMethod(name = { "put_uint32", "put_uint" }) public IRubyObject put_uint32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putInt(getOffset(offset), (int) Util.uint32Value(value)); @@ -679,7 +679,7 @@ public IRubyObject get_uint32(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_uint32", "get_uint" }, required = 1) + @JRubyMethod(name = { "get_uint32", "get_uint" }) public IRubyObject get_uint32(ThreadContext context, IRubyObject offset) { return Util.newUnsigned32(context.runtime, getMemoryIO().getInt(getOffset(offset))); } @@ -690,7 +690,7 @@ public IRubyObject get_uint32(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_int64", "write_long_long" }, required = 1) + @JRubyMethod(name = { "write_int64", "write_long_long" }) public IRubyObject write_long_long(ThreadContext context, IRubyObject value) { getMemoryIO().putLong(0, Util.int64Value(value)); @@ -703,7 +703,7 @@ public IRubyObject write_long_long(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int64", "put_long_long" }, required = 1) + @JRubyMethod(name = { "put_int64", "put_long_long" }) public IRubyObject put_int64(ThreadContext context, IRubyObject value) { getMemoryIO().putLong(0, Util.int64Value(value)); @@ -717,7 +717,7 @@ public IRubyObject put_int64(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_int64", "put_long_long" }, required = 2) + @JRubyMethod(name = { "put_int64", "put_long_long" }) public IRubyObject put_int64(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putLong(getOffset(offset), Util.int64Value(value)); @@ -750,7 +750,7 @@ public IRubyObject get_int64(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_int64", "get_long_long" }, required = 1) + @JRubyMethod(name = { "get_int64", "get_long_long" }) public IRubyObject get_int64(ThreadContext context, IRubyObject offset) { return Util.newSigned64(context.runtime, getMemoryIO().getLong(getOffset(offset))); } @@ -761,7 +761,7 @@ public IRubyObject get_int64(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_uint64", "write_ulong_long" }, required = 1) + @JRubyMethod(name = { "write_uint64", "write_ulong_long" }) public IRubyObject write_ulong_long(ThreadContext context, IRubyObject value) { getMemoryIO().putLong(0, Util.uint64Value(value)); @@ -774,7 +774,7 @@ public IRubyObject write_ulong_long(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint64", "put_ulong_long" }, required = 1) + @JRubyMethod(name = { "put_uint64", "put_ulong_long" }) public IRubyObject put_uint64(ThreadContext context, IRubyObject value) { getMemoryIO().putLong(0, Util.uint64Value(value)); @@ -788,7 +788,7 @@ public IRubyObject put_uint64(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_uint64", "put_ulong_long" }, required = 2) + @JRubyMethod(name = { "put_uint64", "put_ulong_long" }) public IRubyObject put_uint64(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putLong(getOffset(offset), Util.uint64Value(value)); @@ -821,7 +821,7 @@ public IRubyObject get_uint64(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_uint64", "get_ulong_long" }, required = 1) + @JRubyMethod(name = { "get_uint64", "get_ulong_long" }) public IRubyObject get_uint64(ThreadContext context, IRubyObject offset) { return Util.newUnsigned64(context.runtime, getMemoryIO().getLong(getOffset(offset))); } @@ -833,7 +833,7 @@ public IRubyObject get_uint64(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = "write_long", required = 1) + @JRubyMethod(name = "write_long") public IRubyObject write_long(ThreadContext context, IRubyObject value) { return put_long(context, value); } @@ -844,7 +844,7 @@ public IRubyObject write_long(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = "put_long", required = 1) + @JRubyMethod(name = "put_long") public IRubyObject put_long(ThreadContext context, IRubyObject value) { return Platform.getPlatform().longSize() == 32 ? put_int32(context, value) @@ -858,7 +858,7 @@ public IRubyObject put_long(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = "put_long", required = 2) + @JRubyMethod(name = "put_long") public IRubyObject put_long(ThreadContext context, IRubyObject offset, IRubyObject value) { return Platform.getPlatform().longSize() == 32 ? put_int32(context, offset, value) @@ -892,7 +892,7 @@ public IRubyObject get_long(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read. */ - @JRubyMethod(name = "get_long", required = 1) + @JRubyMethod(name = "get_long") public IRubyObject get_long(ThreadContext context, IRubyObject offset) { return Platform.getPlatform().longSize() == 32 ? get_int32(context, offset) @@ -905,7 +905,7 @@ public IRubyObject get_long(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_ulong", "write_ulong" }, required = 1) + @JRubyMethod(name = { "put_ulong", "write_ulong" }) public IRubyObject put_ulong(ThreadContext context, IRubyObject value) { return Platform.getPlatform().longSize() == 32 ? put_uint32(context, value) @@ -919,7 +919,7 @@ public IRubyObject put_ulong(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = "put_ulong", required = 2) + @JRubyMethod(name = "put_ulong") public IRubyObject put_ulong(ThreadContext context, IRubyObject offset, IRubyObject value) { return Platform.getPlatform().longSize() == 32 ? put_uint32(context, offset, value) @@ -954,7 +954,7 @@ public IRubyObject get_ulong(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read. */ - @JRubyMethod(name = "get_ulong", required = 1) + @JRubyMethod(name = "get_ulong") public IRubyObject get_ulong(ThreadContext context, IRubyObject offset) { return Platform.getPlatform().longSize() == 32 ? get_uint32(context, offset) @@ -967,7 +967,7 @@ public IRubyObject get_ulong(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_float" }, required = 1) + @JRubyMethod(name = { "write_float" }) public IRubyObject write_float(ThreadContext context, IRubyObject value) { getMemoryIO().putFloat(0, Util.floatValue(value)); @@ -980,7 +980,7 @@ public IRubyObject write_float(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_float32", "put_float" }, required = 1) + @JRubyMethod(name = { "put_float32", "put_float" }) public IRubyObject put_float32(ThreadContext context, IRubyObject value) { getMemoryIO().putFloat(0, Util.floatValue(value)); @@ -994,7 +994,7 @@ public IRubyObject put_float32(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_float32", "put_float" }, required = 2) + @JRubyMethod(name = { "put_float32", "put_float" }) public IRubyObject put_float32(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putFloat(getOffset(offset), Util.floatValue(value)); @@ -1027,7 +1027,7 @@ public IRubyObject get_float32(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_float32", "get_float" }, required = 1) + @JRubyMethod(name = { "get_float32", "get_float" }) public IRubyObject get_float32(ThreadContext context, IRubyObject offset) { return RubyFloat.newFloat(context.runtime, getMemoryIO().getFloat(getOffset(offset))); } @@ -1038,7 +1038,7 @@ public IRubyObject get_float32(ThreadContext context, IRubyObject offset) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "write_double" }, required = 1) + @JRubyMethod(name = { "write_double" }) public IRubyObject write_double(ThreadContext context, IRubyObject value) { getMemoryIO().putDouble(0, Util.doubleValue(value)); @@ -1051,7 +1051,7 @@ public IRubyObject write_double(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_float64", "put_double" }, required = 1) + @JRubyMethod(name = { "put_float64", "put_double" }) public IRubyObject put_float64(ThreadContext context, IRubyObject value) { getMemoryIO().putDouble(0, Util.doubleValue(value)); @@ -1065,7 +1065,7 @@ public IRubyObject put_float64(ThreadContext context, IRubyObject value) { * @param value The value to write. * @return The value written. */ - @JRubyMethod(name = { "put_float64", "put_double" }, required = 2) + @JRubyMethod(name = { "put_float64", "put_double" }) public IRubyObject put_float64(ThreadContext context, IRubyObject offset, IRubyObject value) { getMemoryIO().putDouble(getOffset(offset), Util.doubleValue(value)); @@ -1098,7 +1098,7 @@ public IRubyObject get_float64(ThreadContext context) { * @param offset The offset from the base pointer address to read the value. * @return The value read from the address. */ - @JRubyMethod(name = { "get_float64", "get_double" }, required = 1) + @JRubyMethod(name = { "get_float64", "get_double" }) public IRubyObject get_float64(ThreadContext context, IRubyObject offset) { return RubyFloat.newFloat(context.runtime, getMemoryIO().getDouble(getOffset(offset))); } @@ -1110,7 +1110,7 @@ public IRubyObject get_float64(ThreadContext context, IRubyObject offset) { * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_int8", "get_array_of_char" }, required = 2) + @JRubyMethod(name = { "get_array_of_int8", "get_array_of_char" }) public IRubyObject get_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned8(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1123,7 +1123,7 @@ public IRubyObject get_array_of_int8(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_int8", "put_array_of_char" }, required = 2) + @JRubyMethod(name = { "put_array_of_int8", "put_array_of_char" }) public IRubyObject put_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned8(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1139,7 +1139,7 @@ public IRubyObject put_array_of_int8(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_uint8", "get_array_of_uchar" }, required = 2) + @JRubyMethod(name = { "get_array_of_uint8", "get_array_of_uchar" }) public IRubyObject get_array_of_uint8(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned8(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1152,7 +1152,7 @@ public IRubyObject get_array_of_uint8(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_uint8", "put_array_of_uchar" }, required = 2) + @JRubyMethod(name = { "put_array_of_uint8", "put_array_of_uchar" }) public IRubyObject put_array_of_uint8(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfUnsigned8(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1168,7 +1168,7 @@ public IRubyObject put_array_of_uint8(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_int16", "get_array_of_short" }, required = 2) + @JRubyMethod(name = { "get_array_of_int16", "get_array_of_short" }) public IRubyObject get_array_of_int16(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned16(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1181,7 +1181,7 @@ public IRubyObject get_array_of_int16(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_int16", "put_array_of_short" }, required = 2) + @JRubyMethod(name = { "put_array_of_int16", "put_array_of_short" }) public IRubyObject put_array_of_int16(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned16(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1197,7 +1197,7 @@ public IRubyObject put_array_of_int16(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_uint16", "get_array_of_ushort" }, required = 2) + @JRubyMethod(name = { "get_array_of_uint16", "get_array_of_ushort" }) public IRubyObject get_array_of_uint16(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned16(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1210,7 +1210,7 @@ public IRubyObject get_array_of_uint16(ThreadContext context, IRubyObject offset * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_uint16", "put_array_of_ushort" }, required = 2) + @JRubyMethod(name = { "put_array_of_uint16", "put_array_of_ushort" }) public IRubyObject put_array_of_uint16(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfUnsigned16(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1226,7 +1226,7 @@ public IRubyObject put_array_of_uint16(ThreadContext context, IRubyObject offset * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_int32", "get_array_of_int" }, required = 2) + @JRubyMethod(name = { "get_array_of_int32", "get_array_of_int" }) public IRubyObject get_array_of_int32(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned32(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1239,7 +1239,7 @@ public IRubyObject get_array_of_int32(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_int32", "put_array_of_int" }, required = 2) + @JRubyMethod(name = { "put_array_of_int32", "put_array_of_int" }) public IRubyObject put_array_of_int32(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned32(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1254,7 +1254,7 @@ public IRubyObject put_array_of_int32(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_uint32", "get_array_of_uint" }, required = 2) + @JRubyMethod(name = { "get_array_of_uint32", "get_array_of_uint" }) public IRubyObject get_array_of_uint32(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned32(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1267,7 +1267,7 @@ public IRubyObject get_array_of_uint32(ThreadContext context, IRubyObject offset * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_uint32", "put_array_of_uint" }, required = 2) + @JRubyMethod(name = { "put_array_of_uint32", "put_array_of_uint" }) public IRubyObject put_array_of_uint32(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfUnsigned32(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1282,7 +1282,7 @@ public IRubyObject put_array_of_uint32(ThreadContext context, IRubyObject offset * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = "get_array_of_long", required = 2) + @JRubyMethod(name = "get_array_of_long") public IRubyObject get_array_of_long(ThreadContext context, IRubyObject offset, IRubyObject length) { return Platform.getPlatform().longSize() == 32 ? get_array_of_int32(context, offset, length) @@ -1297,7 +1297,7 @@ public IRubyObject get_array_of_long(ThreadContext context, IRubyObject offset, * @param arr Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = "put_array_of_long", required = 2) + @JRubyMethod(name = "put_array_of_long") public IRubyObject put_array_of_long(ThreadContext context, IRubyObject offset, IRubyObject arr) { return Platform.getPlatform().longSize() == 32 ? put_array_of_int32(context, offset, arr) @@ -1312,7 +1312,7 @@ public IRubyObject put_array_of_long(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = "get_array_of_ulong", required = 2) + @JRubyMethod(name = "get_array_of_ulong") public IRubyObject get_array_of_ulong(ThreadContext context, IRubyObject offset, IRubyObject length) { return Platform.getPlatform().longSize() == 32 ? get_array_of_uint32(context, offset, length) @@ -1327,7 +1327,7 @@ public IRubyObject get_array_of_ulong(ThreadContext context, IRubyObject offset, * @param arr Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = "put_array_of_ulong", required = 2) + @JRubyMethod(name = "put_array_of_ulong") public IRubyObject put_array_of_ulong(ThreadContext context, IRubyObject offset, IRubyObject arr) { return Platform.getPlatform().longSize() == 32 ? put_array_of_uint32(context, offset, arr) @@ -1342,7 +1342,7 @@ public IRubyObject put_array_of_ulong(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_int64", "get_array_of_long_long" }, required = 2) + @JRubyMethod(name = { "get_array_of_int64", "get_array_of_long_long" }) public IRubyObject get_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfSigned64(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1355,7 +1355,7 @@ public IRubyObject get_array_of_int64(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_int64", "put_array_of_long_long" }, required = 2) + @JRubyMethod(name = { "put_array_of_int64", "put_array_of_long_long" }) public IRubyObject put_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfSigned64(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1371,7 +1371,7 @@ public IRubyObject put_array_of_int64(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_uint64", "get_array_of_ulong_long" }, required = 2) + @JRubyMethod(name = { "get_array_of_uint64", "get_array_of_ulong_long" }) public IRubyObject get_array_of_uint64(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned64(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1384,7 +1384,7 @@ public IRubyObject get_array_of_uint64(ThreadContext context, IRubyObject offset * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_uint64", "put_array_of_ulong_long" }, required = 2) + @JRubyMethod(name = { "put_array_of_uint64", "put_array_of_ulong_long" }) public IRubyObject put_array_of_uint64(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfUnsigned64(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1400,7 +1400,7 @@ public IRubyObject put_array_of_uint64(ThreadContext context, IRubyObject offset * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_float32", "get_array_of_float" }, required = 2) + @JRubyMethod(name = { "get_array_of_float32", "get_array_of_float" }) public IRubyObject get_array_of_float(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfFloat32(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1413,7 +1413,7 @@ public IRubyObject get_array_of_float(ThreadContext context, IRubyObject offset, * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_float32", "put_array_of_float" }, required = 2) + @JRubyMethod(name = { "put_array_of_float32", "put_array_of_float" }) public IRubyObject put_array_of_float(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfFloat32(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1429,7 +1429,7 @@ public IRubyObject put_array_of_float(ThreadContext context, IRubyObject offset, * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "get_array_of_float64", "get_array_of_double" }, required = 2) + @JRubyMethod(name = { "get_array_of_float64", "get_array_of_double" }) public IRubyObject get_array_of_float64(ThreadContext context, IRubyObject offset, IRubyObject length) { return MemoryUtil.getArrayOfFloat64(context.runtime, getMemoryIO(), getOffset(offset), Util.int32Value(length)); } @@ -1442,7 +1442,7 @@ public IRubyObject get_array_of_float64(ThreadContext context, IRubyObject offse * @param arrParam Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "put_array_of_float64", "put_array_of_double" }, required = 2) + @JRubyMethod(name = { "put_array_of_float64", "put_array_of_double" }) public IRubyObject put_array_of_float64(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { MemoryUtil.putArrayOfFloat64(context.runtime, getMemoryIO(), getOffset(offset), checkArray(arrParam)); @@ -1456,7 +1456,7 @@ public IRubyObject put_array_of_float64(ThreadContext context, IRubyObject offse * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_int8", "read_array_of_char" }, required = 1) + @JRubyMethod(name = { "read_array_of_int8", "read_array_of_char" }) public IRubyObject read_array_of_int8(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfSigned8(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1468,7 +1468,7 @@ public IRubyObject read_array_of_int8(ThreadContext context, IRubyObject length) * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_int8", "write_array_of_char" }, required = 1) + @JRubyMethod(name = { "write_array_of_int8", "write_array_of_char" }) public IRubyObject write_array_of_int8(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfSigned8(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1483,7 +1483,7 @@ public IRubyObject write_array_of_int8(ThreadContext context, IRubyObject ary) { * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_uint8", "read_array_of_uchar" }, required = 1) + @JRubyMethod(name = { "read_array_of_uint8", "read_array_of_uchar" }) public IRubyObject read_array_of_uint8(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned8(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1495,7 +1495,7 @@ public IRubyObject read_array_of_uint8(ThreadContext context, IRubyObject length * @param ary Array of values to write to memory. * @return this object. */ - @JRubyMethod(name = { "write_array_of_uint8", "write_array_of_uchar" }, required = 1) + @JRubyMethod(name = { "write_array_of_uint8", "write_array_of_uchar" }) public IRubyObject write_array_of_uint8(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfUnsigned8(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1510,7 +1510,7 @@ public IRubyObject write_array_of_uint8(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_int16", "read_array_of_short" }, required = 1) + @JRubyMethod(name = { "read_array_of_int16", "read_array_of_short" }) public IRubyObject read_array_of_int16(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfSigned16(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1522,7 +1522,7 @@ public IRubyObject read_array_of_int16(ThreadContext context, IRubyObject length * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_int16", "write_array_of_short" }, required = 1) + @JRubyMethod(name = { "write_array_of_int16", "write_array_of_short" }) public IRubyObject write_array_of_int16(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfSigned16(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1537,7 +1537,7 @@ public IRubyObject write_array_of_int16(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_uint16", "read_array_of_ushort" }, required = 1) + @JRubyMethod(name = { "read_array_of_uint16", "read_array_of_ushort" }) public IRubyObject read_array_of_uint16(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned16(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1549,7 +1549,7 @@ public IRubyObject read_array_of_uint16(ThreadContext context, IRubyObject lengt * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_uint16", "write_array_of_ushort" }, required = 1) + @JRubyMethod(name = { "write_array_of_uint16", "write_array_of_ushort" }) public IRubyObject write_array_of_uint16(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfUnsigned16(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1565,7 +1565,7 @@ public IRubyObject write_array_of_uint16(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_int32", "read_array_of_int" }, required = 1) + @JRubyMethod(name = { "read_array_of_int32", "read_array_of_int" }) public IRubyObject read_array_of_int32(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfSigned32(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1577,7 +1577,7 @@ public IRubyObject read_array_of_int32(ThreadContext context, IRubyObject length * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_int32", "write_array_of_int" }, required = 1) + @JRubyMethod(name = { "write_array_of_int32", "write_array_of_int" }) public IRubyObject write_array_of_int32(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfSigned32(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1592,7 +1592,7 @@ public IRubyObject write_array_of_int32(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_uint32", "read_array_of_uint" }, required = 1) + @JRubyMethod(name = { "read_array_of_uint32", "read_array_of_uint" }) public IRubyObject read_array_of_uint32(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned32(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1604,7 +1604,7 @@ public IRubyObject read_array_of_uint32(ThreadContext context, IRubyObject lengt * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_uint32", "write_array_of_uint" }, required = 1) + @JRubyMethod(name = { "write_array_of_uint32", "write_array_of_uint" }) public IRubyObject write_array_of_uint32(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfUnsigned32(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1619,7 +1619,7 @@ public IRubyObject write_array_of_uint32(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_int64", "read_array_of_long_long" }, required = 1) + @JRubyMethod(name = { "read_array_of_int64", "read_array_of_long_long" }) public IRubyObject read_array_of_int64(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfSigned64(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1631,7 +1631,7 @@ public IRubyObject read_array_of_int64(ThreadContext context, IRubyObject length * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_int64", "write_array_of_long_long" }, required = 1) + @JRubyMethod(name = { "write_array_of_int64", "write_array_of_long_long" }) public IRubyObject write_array_of_int64(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfSigned64(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1646,7 +1646,7 @@ public IRubyObject write_array_of_int64(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_uint64", "read_array_of_ulong_long" }, required = 1) + @JRubyMethod(name = { "read_array_of_uint64", "read_array_of_ulong_long" }) public IRubyObject read_array_of_uint64(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfUnsigned64(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1658,7 +1658,7 @@ public IRubyObject read_array_of_uint64(ThreadContext context, IRubyObject lengt * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_uint64", "write_array_of_ulong_long" }, required = 1) + @JRubyMethod(name = { "write_array_of_uint64", "write_array_of_ulong_long" }) public IRubyObject write_array_of_uint64(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfUnsigned64(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1673,7 +1673,7 @@ public IRubyObject write_array_of_uint64(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_long" }, required = 1) + @JRubyMethod(name = { "read_array_of_long" }) public IRubyObject read_array_of_long(ThreadContext context, IRubyObject length) { return Platform.getPlatform().longSize() == 32 ? read_array_of_int32(context, length) @@ -1687,7 +1687,7 @@ public IRubyObject read_array_of_long(ThreadContext context, IRubyObject length) * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_long" }, required = 1) + @JRubyMethod(name = { "write_array_of_long" }) public IRubyObject write_array_of_long(ThreadContext context, IRubyObject ary) { return Platform.getPlatform().longSize() == 32 ? write_array_of_int32(context, ary) @@ -1701,7 +1701,7 @@ public IRubyObject write_array_of_long(ThreadContext context, IRubyObject ary) { * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_ulong" }, required = 1) + @JRubyMethod(name = { "read_array_of_ulong" }) public IRubyObject read_array_of_ulong(ThreadContext context, IRubyObject length) { return Platform.getPlatform().longSize() == 32 ? read_array_of_uint32(context, length) @@ -1715,7 +1715,7 @@ public IRubyObject read_array_of_ulong(ThreadContext context, IRubyObject length * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_ulong" }, required = 1) + @JRubyMethod(name = { "write_array_of_ulong" }) public IRubyObject write_array_of_ulong(ThreadContext context, IRubyObject ary) { return Platform.getPlatform().longSize() == 32 ? write_array_of_uint32(context, ary) @@ -1729,7 +1729,7 @@ public IRubyObject write_array_of_ulong(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_float32", "read_array_of_float" }, required = 1) + @JRubyMethod(name = { "read_array_of_float32", "read_array_of_float" }) public IRubyObject read_array_of_float(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfFloat32(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1741,7 +1741,7 @@ public IRubyObject read_array_of_float(ThreadContext context, IRubyObject length * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_float32", "write_array_of_float" }, required = 1) + @JRubyMethod(name = { "write_array_of_float32", "write_array_of_float" }) public IRubyObject write_array_of_float(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfFloat32(context.runtime, getMemoryIO(), 0, checkArray(ary)); @@ -1756,7 +1756,7 @@ public IRubyObject write_array_of_float(ThreadContext context, IRubyObject ary) * @param length The number of values to be read from memory. * @return An array containing the values. */ - @JRubyMethod(name = { "read_array_of_float64", "read_array_of_double" }, required = 1) + @JRubyMethod(name = { "read_array_of_float64", "read_array_of_double" }) public IRubyObject read_array_of_float64(ThreadContext context, IRubyObject length) { return MemoryUtil.getArrayOfFloat64(context.runtime, getMemoryIO(), 0, Util.int32Value(length)); } @@ -1768,14 +1768,14 @@ public IRubyObject read_array_of_float64(ThreadContext context, IRubyObject leng * @param ary The array of values to write to the memory area. * @return this object. */ - @JRubyMethod(name = { "write_array_of_float64", "write_array_of_double" }, required = 1) + @JRubyMethod(name = { "write_array_of_float64", "write_array_of_double" }) public IRubyObject write_array_of_float64(ThreadContext context, IRubyObject ary) { MemoryUtil.putArrayOfFloat64(context.runtime, getMemoryIO(), 0, checkArray(ary)); return this; } - @JRubyMethod(name = { "read_array_of_type" }, required = 2) + @JRubyMethod(name = { "read_array_of_type" }) public IRubyObject read_array_of_type(ThreadContext context, IRubyObject typeArg, IRubyObject lenArg) { Type type = context.runtime.getFFI().getTypeResolver().findType(context.runtime, typeArg); MemoryOp op = MemoryOp.getMemoryOp(type); @@ -1793,7 +1793,7 @@ public IRubyObject read_array_of_type(ThreadContext context, IRubyObject typeArg return arr; } - @JRubyMethod(name = { "read_array_of_type" }, required = 3) + @JRubyMethod(name = { "read_array_of_type" }) public IRubyObject read_array_of_type(ThreadContext context, IRubyObject typeArg, IRubyObject reader, IRubyObject lenArg) { Type type = context.runtime.getFFI().getTypeResolver().findType(context.runtime, typeArg); DynamicMethod method = getMetaClass().searchMethod(reader.asJavaString()); @@ -1808,7 +1808,7 @@ public IRubyObject read_array_of_type(ThreadContext context, IRubyObject typeArg return arr; } - @JRubyMethod(name = { "write_array_of_type" }, required = 2) + @JRubyMethod(name = { "write_array_of_type" }) public IRubyObject write_array_of_type(ThreadContext context, IRubyObject typeArg, IRubyObject aryArg) { Type type = context.runtime.getFFI().getTypeResolver().findType(context.runtime, typeArg); MemoryOp op = MemoryOp.getMemoryOp(type); @@ -1826,7 +1826,7 @@ public IRubyObject write_array_of_type(ThreadContext context, IRubyObject typeAr return this; } - @JRubyMethod(name = { "write_array_of_type" }, required = 3) + @JRubyMethod(name = { "write_array_of_type" }) public IRubyObject write_array_of_type(ThreadContext context, IRubyObject typeArg, IRubyObject writer, IRubyObject aryArg) { Type type = context.runtime.getFFI().getTypeResolver().findType(context.runtime, typeArg); DynamicMethod method = getMetaClass().searchMethod(writer.asJavaString()); @@ -1881,7 +1881,7 @@ public IRubyObject get_string(ThreadContext context, IRubyObject offArg, IRubyOb getOffset(offArg), Util.int32Value(lenArg)); } - @JRubyMethod(name = { "get_array_of_string" }, required = 1) + @JRubyMethod(name = { "get_array_of_string" }) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); @@ -1899,7 +1899,7 @@ public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffs return arr; } - @JRubyMethod(name = { "get_array_of_string" }, required = 2) + @JRubyMethod(name = { "get_array_of_string" }) public IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset, IRubyObject rbCount) { final int POINTER_SIZE = (Platform.getPlatform().addressSize() / 8); final long off = getOffset(rbOffset); @@ -1923,7 +1923,7 @@ public IRubyObject read_array_of_string(ThreadContext context) { return get_array_of_string(context, RubyFixnum.zero(context.runtime)); } - @JRubyMethod(name = { "read_array_of_string" }, required = 1) + @JRubyMethod(name = { "read_array_of_string" }) public IRubyObject read_array_of_string(ThreadContext context, IRubyObject rbLength) { return get_array_of_string(context, RubyFixnum.zero(context.runtime), rbLength); } @@ -2010,7 +2010,7 @@ public IRubyObject get_pointer(ThreadContext context) { return getPointer(context.runtime, 0); } - @JRubyMethod(name = "get_pointer", required = 1) + @JRubyMethod(name = "get_pointer") public IRubyObject get_pointer(ThreadContext context, IRubyObject offset) { return getPointer(context.runtime, getOffset(offset)); } @@ -2049,19 +2049,19 @@ public IRubyObject write_pointer(ThreadContext context, IRubyObject value) { return this; } - @JRubyMethod(name = { "put_pointer" }, required = 1) + @JRubyMethod(name = { "put_pointer" }) public IRubyObject put_pointer(ThreadContext context, IRubyObject value) { putPointer(context, 0, value); return this; } - @JRubyMethod(name = "put_pointer", required = 2) + @JRubyMethod(name = "put_pointer") public IRubyObject put_pointer(ThreadContext context, IRubyObject offset, IRubyObject value) { putPointer(context, getOffset(offset), value); return this; } - @JRubyMethod(name = { "get_array_of_pointer" }, required = 2) + @JRubyMethod(name = { "get_array_of_pointer" }) public IRubyObject get_array_of_pointer(ThreadContext context, IRubyObject offset, IRubyObject length) { final int POINTER_SIZE = (Platform.getPlatform().addressSize / 8); int count = Util.int32Value(length); @@ -2076,7 +2076,7 @@ public IRubyObject get_array_of_pointer(ThreadContext context, IRubyObject offse return arr; } - @JRubyMethod(name = { "put_array_of_pointer" }, required = 2) + @JRubyMethod(name = { "put_array_of_pointer" }) public IRubyObject put_array_of_pointer(ThreadContext context, IRubyObject offset, IRubyObject arrParam) { final int POINTER_SIZE = (Platform.getPlatform().addressSize / 8); final RubyArray arr = (RubyArray) arrParam; @@ -2089,19 +2089,19 @@ public IRubyObject put_array_of_pointer(ThreadContext context, IRubyObject offse return this; } - @JRubyMethod(name = { "read_array_of_pointer" }, required = 1) + @JRubyMethod(name = { "read_array_of_pointer" }) public IRubyObject read_array_of_pointer(ThreadContext context, IRubyObject length) { return get_array_of_pointer(context, RubyFixnum.zero(context.runtime), length); } - @JRubyMethod(name = { "write_array_of_pointer" }, required = 1) + @JRubyMethod(name = { "write_array_of_pointer" }) public IRubyObject write_array_of_pointer(ThreadContext context, IRubyObject arrParam) { return put_array_of_pointer(context, RubyFixnum.zero(context.runtime), arrParam); } - @JRubyMethod(name = "put_callback", required = 3) + @JRubyMethod(name = "put_callback") public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo) { if (!(cbInfo instanceof CallbackInfo)) { throw context.runtime.newArgumentError("invalid CallbackInfo"); @@ -2111,17 +2111,17 @@ public IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRuby return this; } - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public IRubyObject op_plus(ThreadContext context, IRubyObject value) { return slice(context.runtime, RubyNumeric.fix2long(value)); } - @JRubyMethod(name = "order", required = 0) + @JRubyMethod(name = "order") public final IRubyObject order(ThreadContext context) { return context.runtime.newSymbol(getMemoryIO().order().equals(ByteOrder.LITTLE_ENDIAN) ? "little" : "big"); } - @JRubyMethod(name = "order", required = 1) + @JRubyMethod(name = "order") public final IRubyObject order(ThreadContext context, IRubyObject byte_order) { ByteOrder newOrder = Util.parseByteOrder(context.runtime, byte_order); if (getMemoryIO().order().equals(newOrder)) { diff --git a/core/src/main/java/org/jruby/ext/ffi/Buffer.java b/core/src/main/java/org/jruby/ext/ffi/Buffer.java index 13d6f436c98..c122c0985f6 100644 --- a/core/src/main/java/org/jruby/ext/ffi/Buffer.java +++ b/core/src/main/java/org/jruby/ext/ffi/Buffer.java @@ -101,7 +101,7 @@ public IRubyObject initialize(ThreadContext context, IRubyObject sizeArg, /** * */ - @JRubyMethod(required = 1, visibility=PRIVATE) + @JRubyMethod(visibility=PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) { if (this == other) { return this; diff --git a/core/src/main/java/org/jruby/ext/ffi/MemoryPointer.java b/core/src/main/java/org/jruby/ext/ffi/MemoryPointer.java index 1bcba900df4..910f7aed76a 100644 --- a/core/src/main/java/org/jruby/ext/ffi/MemoryPointer.java +++ b/core/src/main/java/org/jruby/ext/ffi/MemoryPointer.java @@ -112,7 +112,7 @@ public final String toString() { return String.format("MemoryPointer[address=%#x, size=%d]", getAddress(), size); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this == obj || getAddress() == 0L && obj.isNil() @@ -129,7 +129,7 @@ public final IRubyObject free(ThreadContext context) { return context.nil; } - @JRubyMethod(name = "autorelease=", required = 1) + @JRubyMethod(name = "autorelease=") public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(release.isTrue()); return context.nil; diff --git a/core/src/main/java/org/jruby/ext/ffi/Pointer.java b/core/src/main/java/org/jruby/ext/ffi/Pointer.java index 8c42e4f3b4c..b91afd8f17c 100644 --- a/core/src/main/java/org/jruby/ext/ffi/Pointer.java +++ b/core/src/main/java/org/jruby/ext/ffi/Pointer.java @@ -161,7 +161,7 @@ public final long getAddress() { return getMemoryIO().address(); } - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this == obj || getAddress() == 0L && obj.isNil() diff --git a/core/src/main/java/org/jruby/ext/ffi/Struct.java b/core/src/main/java/org/jruby/ext/ffi/Struct.java index 534ea6e6606..f38b7c29ef8 100644 --- a/core/src/main/java/org/jruby/ext/ffi/Struct.java +++ b/core/src/main/java/org/jruby/ext/ffi/Struct.java @@ -344,12 +344,12 @@ public IRubyObject null_p(ThreadContext context) { return RubyBoolean.newBoolean(context, getMemory().getMemoryIO().isNull()); } - @JRubyMethod(name = "order", required = 0) + @JRubyMethod(name = "order") public final IRubyObject order(ThreadContext context) { return context.runtime.newSymbol(getMemoryIO().order().equals(ByteOrder.LITTLE_ENDIAN) ? "little" : "big"); } - @JRubyMethod(name = "order", required = 1) + @JRubyMethod(name = "order") public final IRubyObject order(ThreadContext context, IRubyObject byte_order) { ByteOrder order = Util.parseByteOrder(context.runtime, byte_order); return new Struct(context.runtime, getMetaClass(), layout, diff --git a/core/src/main/java/org/jruby/ext/ffi/StructLayout.java b/core/src/main/java/org/jruby/ext/ffi/StructLayout.java index df6031920fe..9faf4b86632 100644 --- a/core/src/main/java/org/jruby/ext/ffi/StructLayout.java +++ b/core/src/main/java/org/jruby/ext/ffi/StructLayout.java @@ -238,7 +238,7 @@ public static final IRubyObject newStructLayout(ThreadContext context, IRubyObje * @param name The name of the member. * @return A ruby value for the native value of the struct member. */ - @JRubyMethod(name = "get", required = 2) + @JRubyMethod(name = "get") public IRubyObject get(ThreadContext context, IRubyObject ptr, IRubyObject name) { return getValue(context, name, nullStorage, ptr); } @@ -250,7 +250,7 @@ public IRubyObject get(ThreadContext context, IRubyObject ptr, IRubyObject name) * @param name The name of the member. * @return A ruby value for the native value of the struct member. */ - @JRubyMethod(name = "put", required = 3) + @JRubyMethod(name = "put") public IRubyObject put(ThreadContext context, IRubyObject ptr, IRubyObject name, IRubyObject value) { putValue(context, name, nullStorage, ptr, value); diff --git a/core/src/main/java/org/jruby/ext/ffi/Type.java b/core/src/main/java/org/jruby/ext/ffi/Type.java index 3f0fda8ed6e..cbdadd7f466 100644 --- a/core/src/main/java/org/jruby/ext/ffi/Type.java +++ b/core/src/main/java/org/jruby/ext/ffi/Type.java @@ -215,18 +215,18 @@ public final IRubyObject to_sym(ThreadContext context) { } @Override - @JRubyMethod(name = "==", required = 1) + @JRubyMethod(name = "==") public IRubyObject op_equal(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this.equals(obj)); } @Override - @JRubyMethod(name = "equal?", required = 1) + @JRubyMethod(name = "equal?") public IRubyObject equal_p(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this.equals(obj)); } - @JRubyMethod(name = "eql?", required = 1) + @JRubyMethod(name = "eql?") public IRubyObject eql_p(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, this.equals(obj)); } diff --git a/core/src/main/java/org/jruby/ext/ffi/io/FileDescriptorIO.java b/core/src/main/java/org/jruby/ext/ffi/io/FileDescriptorIO.java index 7e153a0a1be..47297faebf1 100644 --- a/core/src/main/java/org/jruby/ext/ffi/io/FileDescriptorIO.java +++ b/core/src/main/java/org/jruby/ext/ffi/io/FileDescriptorIO.java @@ -92,7 +92,7 @@ public static FileDescriptorIO newInstance(ThreadContext context, IRubyObject re return new FileDescriptorIO(context.runtime, fd); } - @JRubyMethod(name = "wrap", required = 1, meta = true) + @JRubyMethod(name = "wrap", meta = true) public static RubyIO wrap(ThreadContext context, IRubyObject recv, IRubyObject fd) { return new FileDescriptorIO(context.runtime, fd); } diff --git a/core/src/main/java/org/jruby/ext/ffi/jffi/Function.java b/core/src/main/java/org/jruby/ext/ffi/jffi/Function.java index 71a45d0965d..ae1db481f36 100644 --- a/core/src/main/java/org/jruby/ext/ffi/jffi/Function.java +++ b/core/src/main/java/org/jruby/ext/ffi/jffi/Function.java @@ -153,7 +153,7 @@ public final IRubyObject free(ThreadContext context) { return context.nil; } - @JRubyMethod(name = "autorelease=", required = 1) + @JRubyMethod(name = "autorelease=") public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { if (autorelease != release.isTrue() && getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(autorelease = release.isTrue()); diff --git a/core/src/main/java/org/jruby/ext/jruby/JRubyExecutionContextLocal.java b/core/src/main/java/org/jruby/ext/jruby/JRubyExecutionContextLocal.java index 436fb8ed071..8f83129bd7d 100644 --- a/core/src/main/java/org/jruby/ext/jruby/JRubyExecutionContextLocal.java +++ b/core/src/main/java/org/jruby/ext/jruby/JRubyExecutionContextLocal.java @@ -79,7 +79,7 @@ public IRubyObject getDefaultProc() { return (default_proc != null) ? default_proc : getRuntime().getNil(); } - @JRubyMethod(name = "value", required = 0) + @JRubyMethod(name = "value") public IRubyObject getValue(ThreadContext context) { final IRubyObject value; final Map contextVariables; @@ -99,7 +99,7 @@ public IRubyObject getValue(ThreadContext context) { return default_value; } - @JRubyMethod(name = "value=", required = 1) + @JRubyMethod(name = "value=") public IRubyObject setValue(ThreadContext context, IRubyObject value) { getContextVariables(context).put(this, value); return value; diff --git a/core/src/main/java/org/jruby/ext/jruby/JRubyFiberLocal.java b/core/src/main/java/org/jruby/ext/jruby/JRubyFiberLocal.java index 16f04f5e7c8..94bae3c8981 100644 --- a/core/src/main/java/org/jruby/ext/jruby/JRubyFiberLocal.java +++ b/core/src/main/java/org/jruby/ext/jruby/JRubyFiberLocal.java @@ -44,7 +44,7 @@ public JRubyFiberLocal(Ruby runtime, RubyClass type) { super(runtime, type); } - @JRubyMethod(name = "with_value", required = 1) + @JRubyMethod(name = "with_value") public IRubyObject withValue(ThreadContext context, IRubyObject value, Block block) { final Map contextVariables; contextVariables = getContextVariables(context); diff --git a/core/src/main/java/org/jruby/ext/nkf/RubyNKF.java b/core/src/main/java/org/jruby/ext/nkf/RubyNKF.java index 4225987cdc9..9875c309ba3 100644 --- a/core/src/main/java/org/jruby/ext/nkf/RubyNKF.java +++ b/core/src/main/java/org/jruby/ext/nkf/RubyNKF.java @@ -126,7 +126,7 @@ public static void createNKF(Ruby runtime) { NKF.defineAnnotatedMethods(RubyNKF.class); } - @JRubyMethod(name = "guess", required = 1, module = true) + @JRubyMethod(name = "guess", module = true) public static IRubyObject guess(ThreadContext context, IRubyObject recv, IRubyObject s) { return charsetMappedValue(context.runtime, guess(context, s)); } @@ -195,17 +195,17 @@ private static IRubyObject charsetMappedValue(final Ruby runtime, final NKFChars return runtime.getEncodingService().convertEncodingToRubyEncoding(encoding); } - @JRubyMethod(name = "guess1", required = 1, module = true) + @JRubyMethod(name = "guess1", module = true) public static IRubyObject guess1(ThreadContext context, IRubyObject recv, IRubyObject str) { return guess(context, recv, str); } - @JRubyMethod(name = "guess2", required = 1, module = true) + @JRubyMethod(name = "guess2", module = true) public static IRubyObject guess2(ThreadContext context, IRubyObject recv, IRubyObject str) { return guess(context, recv, str); } - @JRubyMethod(name = "nkf", required = 2, module = true) + @JRubyMethod(name = "nkf", module = true) public static IRubyObject nkf(ThreadContext context, IRubyObject recv, IRubyObject opt, IRubyObject str) { Ruby runtime = context.runtime; diff --git a/core/src/main/java/org/jruby/ext/set/RubySet.java b/core/src/main/java/org/jruby/ext/set/RubySet.java index 8b67eeb55b1..8420328d964 100644 --- a/core/src/main/java/org/jruby/ext/set/RubySet.java +++ b/core/src/main/java/org/jruby/ext/set/RubySet.java @@ -198,7 +198,7 @@ public IRubyObject initialize(ThreadContext context, Block block) { /** * initialize(enum = nil, &block) */ - @JRubyMethod(required = 1, visibility = Visibility.PRIVATE) + @JRubyMethod(visibility = Visibility.PRIVATE) public IRubyObject initialize(ThreadContext context, IRubyObject enume, Block block) { if ( enume.isNil() ) return initialize(context, block); diff --git a/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java b/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java index 494610bc2ed..6375e3b3dca 100644 --- a/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java +++ b/core/src/main/java/org/jruby/ext/socket/RubyTCPServer.java @@ -263,7 +263,7 @@ public IRubyObject sysaccept(ThreadContext context) { } } - @JRubyMethod(name = "listen", required = 1) + @JRubyMethod(name = "listen") public IRubyObject listen(ThreadContext context, IRubyObject backlog) { return RubyFixnum.zero(context.runtime); } diff --git a/core/src/main/java/org/jruby/ext/zlib/JZlibDeflate.java b/core/src/main/java/org/jruby/ext/zlib/JZlibDeflate.java index bc04bd85b19..d810ecb9a81 100644 --- a/core/src/main/java/org/jruby/ext/zlib/JZlibDeflate.java +++ b/core/src/main/java/org/jruby/ext/zlib/JZlibDeflate.java @@ -159,7 +159,7 @@ public IRubyObject initialize_copy(IRubyObject _other) { return (IRubyObject) this; } - @JRubyMethod(name = "<<", required = 1) + @JRubyMethod(name = "<<") public IRubyObject append(IRubyObject arg) { checkClosed(); try { @@ -170,28 +170,28 @@ public IRubyObject append(IRubyObject arg) { return this; } - @JRubyMethod(name = "params", required = 2) + @JRubyMethod(name = "params") public IRubyObject params(ThreadContext context, IRubyObject level, IRubyObject strategy) { int l = RubyNumeric.fix2int(level); checkLevel(getRuntime(), l); - + int s = RubyNumeric.fix2int(strategy); checkStrategy(getRuntime(), s); - + if (flater.next_out == null) flater.setOutput(ByteList.NULL_ARRAY); int err = flater.params(l, s); if (err == com.jcraft.jzlib.JZlib.Z_STREAM_ERROR) { throw RubyZlib.newStreamError(getRuntime(), "stream error"); } - + if (collectedIdx != flater.next_out_index) collectedIdx = flater.next_out_index; run(); return getRuntime().getNil(); } - @JRubyMethod(name = "set_dictionary", required = 1) + @JRubyMethod(name = "set_dictionary") public IRubyObject set_dictionary(ThreadContext context, IRubyObject arg) { try { byte[] tmp = arg.convertToString().getBytes(); diff --git a/core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java b/core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java index 06148dfed4e..3713ce65bee 100644 --- a/core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java +++ b/core/src/main/java/org/jruby/ext/zlib/JZlibInflate.java @@ -56,7 +56,7 @@ public JZlibInflate(Ruby runtime, RubyClass type) { super(runtime, type); } - @JRubyMethod(name = "inflate", required = 1, meta = true) + @JRubyMethod(name = "inflate", meta = true) public static IRubyObject s_inflate(ThreadContext context, IRubyObject recv, IRubyObject string) { RubyClass klass = (RubyClass)(recv.isClass() ? recv : context.runtime.getClassFromPath("Zlib::Inflate")); JZlibInflate inflate = (JZlibInflate) klass.allocate(); @@ -114,7 +114,7 @@ private IRubyObject flushOutput(ThreadContext context, Block block) { return RubyString.newEmptyBinaryString(context.runtime); } - @JRubyMethod(name = "<<", required = 1) + @JRubyMethod(name = "<<") public IRubyObject append(ThreadContext context, IRubyObject arg) { checkClosed(); if (arg.isNil()) { @@ -151,7 +151,7 @@ public IRubyObject sync_point() { } } - @JRubyMethod(name = "set_dictionary", required = 1) + @JRubyMethod(name = "set_dictionary") public IRubyObject set_dictionary(ThreadContext context, IRubyObject arg) { try { return set_dictionary(arg); @@ -174,7 +174,7 @@ private IRubyObject set_dictionary(IRubyObject str) { return str; } - @JRubyMethod(name = "inflate", required = 1) + @JRubyMethod(name = "inflate") public IRubyObject inflate(ThreadContext context, IRubyObject string, Block block) { ByteList data = null; if (!string.isNil()) { @@ -192,7 +192,7 @@ public IRubyObject inflate(ThreadContext context, ByteList str, Block block) { } } - @JRubyMethod(name = "sync", required = 1) + @JRubyMethod(name = "sync") public IRubyObject sync(ThreadContext context, IRubyObject string) { if (flater.avail_in > 0) { switch (flater.sync()) { diff --git a/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java b/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java index abb0125d327..187d4db7bd6 100644 --- a/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java +++ b/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipReader.java @@ -458,7 +458,7 @@ private ByteList readSize(int length) throws IOException { return new ByteList(buffer, 0, length - toRead, false); } - @JRubyMethod(name = "lineno=", required = 1) + @JRubyMethod(name = "lineno=") public IRubyObject set_lineno(IRubyObject lineArg) { line = RubyNumeric.fix2int(lineArg); diff --git a/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipWriter.java b/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipWriter.java index f8b84022efa..f2234d3e983 100644 --- a/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipWriter.java +++ b/core/src/main/java/org/jruby/ext/zlib/JZlibRubyGzipWriter.java @@ -190,7 +190,7 @@ public IRubyObject close() { return realIo; } - @JRubyMethod(name = {"append", "<<"}, required = 1) + @JRubyMethod(name = {"append", "<<"}) public IRubyObject append(IRubyObject p1) { this.write(p1); @@ -223,7 +223,7 @@ public IRubyObject pos() { return RubyNumeric.int2fix(getRuntime(), io.getTotalIn()); } - @JRubyMethod(name = "orig_name=", required = 1) + @JRubyMethod(name = "orig_name=") public IRubyObject set_orig_name(IRubyObject obj) { nullFreeOrigName = obj.convertToString().strDup(getRuntime()); ensureNonNull(nullFreeOrigName); @@ -237,7 +237,7 @@ public IRubyObject set_orig_name(IRubyObject obj) { return obj; } - @JRubyMethod(name = "comment=", required = 1) + @JRubyMethod(name = "comment=") public IRubyObject set_comment(IRubyObject obj) { nullFreeComment = obj.convertToString().strDup(getRuntime()); ensureNonNull(nullFreeComment); @@ -260,7 +260,7 @@ private void ensureNonNull(RubyString obj) { } } - @JRubyMethod(name = "putc", required = 1) + @JRubyMethod(name = "putc") public IRubyObject putc(IRubyObject p1) { try { io.write(RubyNumeric.num2chr(p1)); @@ -318,7 +318,7 @@ public IRubyObject flush(IRubyObject[] args) { return getRuntime().getNil(); } - @JRubyMethod(name = "mtime=", required = 1) + @JRubyMethod(name = "mtime=") public IRubyObject set_mtime(IRubyObject arg) { Ruby runtime = getRuntime(); @@ -352,7 +352,7 @@ public IRubyObject crc() { return getRuntime().newFixnum(crc); } - @JRubyMethod(name = "write", required = 1) + @JRubyMethod(name = "write") public IRubyObject write(IRubyObject p1) { Ruby runtime = getRuntime(); RubyString str = p1.asString(); diff --git a/core/src/main/java/org/jruby/ext/zlib/RubyGzipFile.java b/core/src/main/java/org/jruby/ext/zlib/RubyGzipFile.java index e971a2e2536..91b0a7a830d 100644 --- a/core/src/main/java/org/jruby/ext/zlib/RubyGzipFile.java +++ b/core/src/main/java/org/jruby/ext/zlib/RubyGzipFile.java @@ -251,7 +251,7 @@ public IRubyObject level() { return getRuntime().newFixnum(level); } - @JRubyMethod(name = "sync=", required = 1) + @JRubyMethod(name = "sync=") public IRubyObject set_sync(IRubyObject arg) { sync = ((RubyBoolean) arg).isTrue(); return sync ? getRuntime().getTrue() : getRuntime().getFalse(); diff --git a/core/src/main/java/org/jruby/ext/zlib/RubyZlib.java b/core/src/main/java/org/jruby/ext/zlib/RubyZlib.java index 49585dd5320..54ddb461753 100644 --- a/core/src/main/java/org/jruby/ext/zlib/RubyZlib.java +++ b/core/src/main/java/org/jruby/ext/zlib/RubyZlib.java @@ -246,7 +246,7 @@ public static IRubyObject crc_table(IRubyObject recv) { return array; } - @JRubyMethod(name = "crc32_combine", required = 3, module = true, visibility = PRIVATE) + @JRubyMethod(name = "crc32_combine", module = true, visibility = PRIVATE) public static IRubyObject crc32_combine(IRubyObject recv, IRubyObject arg0, IRubyObject arg1, @@ -259,7 +259,7 @@ public static IRubyObject crc32_combine(IRubyObject recv, return recv.getRuntime().newFixnum(crc3); } - @JRubyMethod(name = "adler32_combine", required = 3, module = true, visibility = PRIVATE) + @JRubyMethod(name = "adler32_combine", module = true, visibility = PRIVATE) public static IRubyObject adler32_combine(IRubyObject recv, IRubyObject arg0, IRubyObject arg1, diff --git a/core/src/main/java/org/jruby/ext/zlib/ZStream.java b/core/src/main/java/org/jruby/ext/zlib/ZStream.java index e3e21a2c684..77d6d9271fc 100644 --- a/core/src/main/java/org/jruby/ext/zlib/ZStream.java +++ b/core/src/main/java/org/jruby/ext/zlib/ZStream.java @@ -115,7 +115,7 @@ public IRubyObject avail_out() { return RubyFixnum.zero(getRuntime()); } - @JRubyMethod(name = "avail_out=", required = 1) + @JRubyMethod(name = "avail_out=") public IRubyObject set_avail_out(IRubyObject p1) { checkClosed(); diff --git a/core/src/main/java/org/jruby/java/addons/ClassJavaAddons.java b/core/src/main/java/org/jruby/java/addons/ClassJavaAddons.java index 611ede67306..7e1abf9729d 100644 --- a/core/src/main/java/org/jruby/java/addons/ClassJavaAddons.java +++ b/core/src/main/java/org/jruby/java/addons/ClassJavaAddons.java @@ -61,7 +61,7 @@ private static JavaProxy asJavaClass(final Ruby runtime, final Class reifiedC return (JavaProxy) Java.getInstance(runtime, reifiedClass); } - @JRubyMethod(name = "become_java!", required = 0) + @JRubyMethod(name = "become_java!") public static IRubyObject become_java(ThreadContext context, final IRubyObject self) { return becomeJava(context, (RubyClass) self, null, true); } diff --git a/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java b/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java index e8ff4948ce3..5f2652e81de 100644 --- a/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java +++ b/core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java @@ -400,7 +400,7 @@ public IRubyObject default_value_get(ThreadContext context, IRubyObject arg) { /** rb_hash_set_default * */ - @JRubyMethod(name = "default=", required = 1) + @JRubyMethod(name = "default=") public IRubyObject default_value_set(ThreadContext context, final IRubyObject defaultValue) { return getOrCreateRubyHashMap(context.runtime).default_value_set(context, defaultValue); } @@ -488,7 +488,7 @@ public RubyHash to_hash(ThreadContext context) { /** rb_hash_aset * */ - @JRubyMethod(name = {"[]=", "store"}, required = 2) + @JRubyMethod(name = {"[]=", "store"}) public IRubyObject op_aset(ThreadContext context, IRubyObject key, IRubyObject value) { return getOrCreateRubyHashMap(context.runtime).op_aset(context, key, value); } @@ -512,27 +512,27 @@ public IRubyObject op_eql(final ThreadContext context, IRubyObject other) { /** rb_hash_aref * */ - @JRubyMethod(name = "[]", required = 1) + @JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { return getOrCreateRubyHashMap(context.runtime).op_aref(context, key); } - @JRubyMethod(name = "<", required = 1) + @JRubyMethod(name = "<") public IRubyObject op_lt(ThreadContext context, IRubyObject other) { return getOrCreateRubyHashMap(context.runtime).op_lt(context, other); } - @JRubyMethod(name = "<=", required = 1) + @JRubyMethod(name = "<=") public IRubyObject op_le(ThreadContext context, IRubyObject other) { return getOrCreateRubyHashMap(context.runtime).op_le(context, other); } - @JRubyMethod(name = ">", required = 1) + @JRubyMethod(name = ">") public IRubyObject op_gt(ThreadContext context, IRubyObject other) { return getOrCreateRubyHashMap(context.runtime).op_gt(context, other); } - @JRubyMethod(name = ">=", required = 1) + @JRubyMethod(name = ">=") public IRubyObject op_ge(ThreadContext context, IRubyObject other) { return getOrCreateRubyHashMap(context.runtime).op_ge(context, other); } @@ -561,7 +561,7 @@ public IRubyObject fetch(ThreadContext context, IRubyObject key, IRubyObject _de /** rb_hash_has_key_p * */ - @JRubyMethod(name = {"has_key?", "key?", "include?", "member?"}, required = 1) + @JRubyMethod(name = {"has_key?", "key?", "include?", "member?"}) public RubyBoolean has_key_p(ThreadContext context, IRubyObject key) { return getOrCreateRubyHashMap(context.runtime).has_key_p(context, key); } @@ -569,7 +569,7 @@ public RubyBoolean has_key_p(ThreadContext context, IRubyObject key) { /** rb_hash_has_value * */ - @JRubyMethod(name = {"has_value?", "value?"}, required = 1) + @JRubyMethod(name = {"has_value?", "value?"}) public RubyBoolean has_value_p(ThreadContext context, IRubyObject expected) { return getOrCreateRubyHashMap(context.runtime).has_value_p(context, expected); } @@ -747,7 +747,7 @@ public RubyHash initialize_copy(ThreadContext context, IRubyObject other) { /** rb_hash_replace * */ - @JRubyMethod(name = { "replace", "ruby_replace" }, required = 1) // collision with java.util.Map#replace on Java 8+ + @JRubyMethod(name = { "replace", "ruby_replace" }) // collision with java.util.Map#replace on Java 8+ public RubyHash replace(final ThreadContext context, IRubyObject other) { return getOrCreateRubyHashMap(context.runtime).replace(context, other); } diff --git a/core/src/main/java/org/jruby/javasupport/JavaClass.java b/core/src/main/java/org/jruby/javasupport/JavaClass.java index 72132e48546..4af48350f05 100644 --- a/core/src/main/java/org/jruby/javasupport/JavaClass.java +++ b/core/src/main/java/org/jruby/javasupport/JavaClass.java @@ -196,7 +196,7 @@ public static JavaClass forNameQuiet(Ruby runtime, String className) { } @Deprecated - @JRubyMethod(name = "for_name", required = 1, meta = true) + @JRubyMethod(name = "for_name", meta = true) public static JavaClass for_name(IRubyObject recv, IRubyObject name) { return for_name(recv, name.asJavaString()); } diff --git a/core/src/main/java/org/jruby/javasupport/JavaObject.java b/core/src/main/java/org/jruby/javasupport/JavaObject.java index adc1c5cf9af..edf6866a416 100644 --- a/core/src/main/java/org/jruby/javasupport/JavaObject.java +++ b/core/src/main/java/org/jruby/javasupport/JavaObject.java @@ -181,7 +181,7 @@ public static IRubyObject to_s(Ruby runtime, Object dataStruct) { return JavaProxyMethods.to_s(runtime, dataStruct); } - @JRubyMethod(name = {"==", "eql?"}, required = 1) + @JRubyMethod(name = {"==", "eql?"}) public IRubyObject op_equal(final IRubyObject other) { return JavaProxyMethods.equals(getRuntime(), getValue(), other); } @@ -190,7 +190,7 @@ public static RubyBoolean op_equal(JavaProxy self, IRubyObject other) { return JavaProxyMethods.equals(self.getRuntime(), self.getObject(), other); } - @JRubyMethod(name = "equal?", required = 1) + @JRubyMethod(name = "equal?") public IRubyObject same(final IRubyObject other) { final Ruby runtime = getRuntime(); final Object thisValue = getValue(); diff --git a/core/src/main/java/org/jruby/javasupport/JavaPackage.java b/core/src/main/java/org/jruby/javasupport/JavaPackage.java index 4378042474b..91a2e590216 100644 --- a/core/src/main/java/org/jruby/javasupport/JavaPackage.java +++ b/core/src/main/java/org/jruby/javasupport/JavaPackage.java @@ -121,12 +121,12 @@ public RubyBoolean op_eqq(ThreadContext context, IRubyObject obj) { return RubyBoolean.newBoolean(context, obj == this || isInstance(obj)); } - @JRubyMethod(name = "const_missing", required = 1) + @JRubyMethod(name = "const_missing") public IRubyObject const_missing(final ThreadContext context, final IRubyObject name) { return relativeJavaClassOrPackage(context, name, false); } - @JRubyMethod(name = "const_get", required = 1) + @JRubyMethod(name = "const_get") public final IRubyObject const_get(final ThreadContext context, final IRubyObject name) { // skip constant validation and do not inherit or include object IRubyObject constant = getConstantNoConstMissing(name.toString(), false, false); @@ -134,7 +134,7 @@ public final IRubyObject const_get(final ThreadContext context, final IRubyObjec return relativeJavaClassOrPackage(context, name, false); // e.g. javax.const_get(:script) } - @JRubyMethod(name = "const_get", required = 2) + @JRubyMethod(name = "const_get") public final IRubyObject const_get(final ThreadContext context, final IRubyObject name, final IRubyObject inherit) { IRubyObject constant = getConstantNoConstMissing(name.toString(), inherit.isTrue(), false); diff --git a/core/src/main/java/org/jruby/javasupport/ext/JavaLang.java b/core/src/main/java/org/jruby/javasupport/ext/JavaLang.java index d29e84638e2..65aeea85427 100644 --- a/core/src/main/java/org/jruby/javasupport/ext/JavaLang.java +++ b/core/src/main/java/org/jruby/javasupport/ext/JavaLang.java @@ -641,7 +641,7 @@ public static IRubyObject static_p(final IRubyObject self) { // JavaClass facade (compatibility) : - @JRubyMethod(required = 1) + @JRubyMethod public static IRubyObject extend_proxy(final ThreadContext context, IRubyObject self, IRubyObject extender) { java.lang.Class klass = Java.unwrapClassProxy(self); RubyModule proxy = Java.getProxyClass(context.runtime, klass); @@ -749,7 +749,7 @@ public static IRubyObject array_class(ThreadContext context, IRubyObject self) { return Java.getInstance(context.runtime, arrayClass); } - @JRubyMethod(required = 1) + @JRubyMethod public static IRubyObject new_array(ThreadContext context, IRubyObject self, IRubyObject length) { final java.lang.Class klass = unwrapJavaObject(self); diff --git a/core/src/main/java/org/jruby/javasupport/ext/JavaUtil.java b/core/src/main/java/org/jruby/javasupport/ext/JavaUtil.java index 19aeff7883d..4b8e9222f95 100644 --- a/core/src/main/java/org/jruby/javasupport/ext/JavaUtil.java +++ b/core/src/main/java/org/jruby/javasupport/ext/JavaUtil.java @@ -202,7 +202,7 @@ public static IRubyObject count(final ThreadContext context, final IRubyObject s return JavaLang.Iterable.count(context, self, obj, Block.NULL_BLOCK); } */ - @JRubyMethod(name = "+", required = 1) + @JRubyMethod(name = "+") public static IRubyObject op_plus(final ThreadContext context, final IRubyObject self, final IRubyObject coll) { final IRubyObject dup = self.callMethod(context, "dup"); java.util.Collection javaDup = unwrapIfJavaObject(dup); @@ -215,7 +215,7 @@ public static IRubyObject op_plus(final ThreadContext context, final IRubyObject return dup; } - @JRubyMethod(name = "-", required = 1) + @JRubyMethod(name = "-") public static IRubyObject op_minus(final ThreadContext context, final IRubyObject self, final IRubyObject coll) { final IRubyObject dup = self.callMethod(context, "dup"); java.util.Collection javaDup = unwrapIfJavaObject(dup); @@ -416,7 +416,7 @@ public static IRubyObject last(final ThreadContext context, final IRubyObject se return Java.getInstance(context.runtime, list.subList(start, end)); } - @JRubyMethod(name = "index", required = 0) // list.index { |val| val > 0 } + @JRubyMethod(name = "index") // list.index { |val| val > 0 } public static IRubyObject index(final ThreadContext context, final IRubyObject self, final Block block) { final Ruby runtime = context.runtime; if ( ! block.isGiven() ) { // list.index ... Enumerator.new(self, :index) @@ -441,7 +441,7 @@ public static IRubyObject index(final ThreadContext context, final IRubyObject s return context.nil; } - @JRubyMethod(name = "index", required = 1) // list.index '42' + @JRubyMethod(name = "index") // list.index '42' public static IRubyObject index(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock) { @@ -469,7 +469,7 @@ public static IRubyObject index(final ThreadContext context, final IRubyObject s return context.nil; } - @JRubyMethod(name = "rindex", required = 0) // list.rindex { |val| val > 0 } + @JRubyMethod(name = "rindex") // list.rindex { |val| val > 0 } public static IRubyObject rindex(final ThreadContext context, final IRubyObject self, final Block block) { final Ruby runtime = context.runtime; if ( ! block.isGiven() ) { // list.rindex ... Enumerator.new(self, :rindex) @@ -495,7 +495,7 @@ public static IRubyObject rindex(final ThreadContext context, final IRubyObject return context.nil; } - @JRubyMethod(name = "rindex", required = 1) // list.rindex '42' + @JRubyMethod(name = "rindex") // list.rindex '42' public static IRubyObject rindex(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock) { diff --git a/core/src/main/java/org/jruby/javasupport/ext/JavaUtilRegex.java b/core/src/main/java/org/jruby/javasupport/ext/JavaUtilRegex.java index 24798efe7f6..2aafc1681c6 100644 --- a/core/src/main/java/org/jruby/javasupport/ext/JavaUtilRegex.java +++ b/core/src/main/java/org/jruby/javasupport/ext/JavaUtilRegex.java @@ -59,13 +59,13 @@ static RubyClass define(final Ruby runtime, final RubyClass proxy) { return proxy; } - @JRubyMethod(name = "=~", required = 1) + @JRubyMethod(name = "=~") public static IRubyObject op_match(final ThreadContext context, final IRubyObject self, IRubyObject str) { final java.util.regex.Matcher matcher = matcher(self, str); return matcher.find() ? context.runtime.newFixnum(matcher.start()) : context.nil; } - @JRubyMethod(name = "match", required = 1) + @JRubyMethod(name = "match") public static IRubyObject match(final ThreadContext context, final IRubyObject self, IRubyObject str) { final java.util.regex.Matcher matcher = matcher(self, str); if ( ! matcher.find() ) return context.nil; @@ -74,7 +74,7 @@ public static IRubyObject match(final ThreadContext context, final IRubyObject s return matcherProxy; } - @JRubyMethod(name = "===", required = 1) + @JRubyMethod(name = "===") public static IRubyObject eqq(final ThreadContext context, final IRubyObject self, IRubyObject str) { return RubyBoolean.newBoolean(context, matcher(self, str).find() ); } @@ -211,7 +211,7 @@ private static IRubyObject[] groups(final ThreadContext context, final IRubyObje return arr; } - @JRubyMethod(name = "[]", required = 1) + @JRubyMethod(name = "[]") public static IRubyObject aref(final ThreadContext context, final IRubyObject self, final IRubyObject idx) { final java.util.regex.Matcher matcher = unwrapJavaObject(self); if ( idx instanceof RubySymbol || idx instanceof RubyString ) { @@ -224,7 +224,7 @@ public static IRubyObject aref(final ThreadContext context, final IRubyObject se return to_a(context, self).aref(context, idx); // Range } - @JRubyMethod(name = "[]", required = 2) + @JRubyMethod(name = "[]") public static IRubyObject aref(final ThreadContext context, final IRubyObject self, final IRubyObject arg0, final IRubyObject arg1) { return to_a(context, self).aref(arg0, arg1); diff --git a/core/src/main/java/org/jruby/javasupport/ext/Module.java b/core/src/main/java/org/jruby/javasupport/ext/Module.java index 3ccbddd9240..f12c2898b3c 100644 --- a/core/src/main/java/org/jruby/javasupport/ext/Module.java +++ b/core/src/main/java/org/jruby/javasupport/ext/Module.java @@ -67,7 +67,7 @@ public static void define(final Ruby runtime) { Module.defineAnnotatedMethods(Module.class); } - @JRubyMethod(name = "import", required = 1, visibility = PRIVATE) + @JRubyMethod(name = "import", visibility = PRIVATE) public static IRubyObject import_(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) { if (arg instanceof RubyString) { final String name = ((RubyString) arg).decodeString(); @@ -83,7 +83,7 @@ public static IRubyObject import_(ThreadContext context, IRubyObject self, IRuby return include_package(context, self, arg); } - @JRubyMethod(required = 1, visibility = PRIVATE) + @JRubyMethod(visibility = PRIVATE) public static IRubyObject java_import(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) { if (arg instanceof RubyArray) { return java_import(context, self, ((RubyArray) arg).toJavaArrayMaybeUnsafe(), block); @@ -151,7 +151,7 @@ private static IRubyObject javaImport(ThreadContext context, RubyModule target, return proxyClass; } - @JRubyMethod(required = 2, visibility = PRIVATE) + @JRubyMethod(visibility = PRIVATE) public static IRubyObject java_alias(final ThreadContext context, final IRubyObject self, IRubyObject new_id, IRubyObject old_id) { final IncludedPackages includedPackages = getIncludedPackages(context, (RubyModule) self); if (!(new_id instanceof RubySymbol)) new_id = new_id.convertToString().intern(); @@ -161,7 +161,7 @@ public static IRubyObject java_alias(final ThreadContext context, final IRubyObj return old_id; } - @JRubyMethod(required = 1, visibility = PRIVATE) + @JRubyMethod(visibility = PRIVATE) public static IRubyObject include_package(final ThreadContext context, final IRubyObject self, IRubyObject pkg) { String packageName; if (pkg instanceof JavaPackage) { diff --git a/core/src/main/java/org/jruby/runtime/load/LoadService.java b/core/src/main/java/org/jruby/runtime/load/LoadService.java index d9fa2d184d1..a67fce0a227 100644 --- a/core/src/main/java/org/jruby/runtime/load/LoadService.java +++ b/core/src/main/java/org/jruby/runtime/load/LoadService.java @@ -300,7 +300,7 @@ protected void addPath(String path) { } public static class LoadPathMethods { - @JRubyMethod(required = 1) + @JRubyMethod public static IRubyObject resolve_feature_path(ThreadContext context, IRubyObject self, IRubyObject pathArg) { Ruby runtime = context.runtime; RubyString path = StringSupport.checkEmbeddedNulls(runtime, RubyFile.get_path(context, pathArg));