pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/commit/a81e632dbef7e97f159bbb6c7b658d4eb617909d

" /> moar deprecation warnings fixed · jruby/jruby@a81e632 · GitHub
Skip to content

Commit a81e632

Browse files
committed
moar deprecation warnings fixed
1 parent caaf5ca commit a81e632

9 files changed

Lines changed: 29 additions & 13 deletions

File tree

core/src/main/java/org/jruby/RubyGlobal.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,8 @@ public MatchMatchGlobalVariable(Ruby runtime, String name) {
908908

909909
@Override
910910
public IRubyObject get() {
911-
return RubyRegexp.last_match(runtime.getCurrentContext().getBackRef());
911+
var context = runtime.getCurrentContext();
912+
return RubyRegexp.last_match(context, context.getBackRef());
912913
}
913914
}
914915

@@ -931,7 +932,8 @@ public PostMatchGlobalVariable(Ruby runtime, String name) {
931932

932933
@Override
933934
public IRubyObject get() {
934-
return RubyRegexp.match_post(runtime.getCurrentContext().getBackRef());
935+
var context = runtime.getCurrentContext();
936+
return RubyRegexp.match_post(context, context.getBackRef());
935937
}
936938
}
937939

core/src/main/java/org/jruby/RubyProcess.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ public static IRubyObject eid(Ruby runtime, IRubyObject arg) {
608608
return RubyProcess.egid_set(runtime.getCurrentContext(), arg);
609609
}
610610

611+
@Deprecated(since = "10.0")
611612
public static IRubyObject grant_privilege(IRubyObject self, IRubyObject arg) {
612613
return grant_privilege(((RubyBasicObject) self).getCurrentContext(), self, arg);
613614
}
@@ -1942,13 +1943,23 @@ public static RubyFixnum spawn(ThreadContext context, IRubyObject recv, IRubyObj
19421943
asFixnum(context, ShellLauncher.runExternalWithoutWait(context.runtime, args));
19431944
}
19441945

1945-
@JRubyMethod(name = "exit", optional = 1, checkArity = false, module = true, visibility = PRIVATE)
1946+
@Deprecated(since = "10.0")
19461947
public static IRubyObject exit(IRubyObject recv, IRubyObject[] args) {
1947-
return RubyKernel.exit(((RubyBasicObject) recv).getCurrentContext(), recv, args);
1948+
return exit(((RubyBasicObject) recv).getCurrentContext(), recv, args);
19481949
}
19491950

1950-
@JRubyMethod(name = "setproctitle", module = true, visibility = PRIVATE)
1951+
@JRubyMethod(name = "exit", optional = 1, checkArity = false, module = true, visibility = PRIVATE)
1952+
public static IRubyObject exit(ThreadContext context, IRubyObject recv, IRubyObject[] args) {
1953+
return RubyKernel.exit(context, recv, args);
1954+
}
1955+
1956+
@Deprecated(since = "10.0")
19511957
public static IRubyObject setproctitle(IRubyObject recv, IRubyObject name) {
1958+
return setproctitle(((RubyBasicObject) recv).getCurrentContext(), recv, name);
1959+
}
1960+
1961+
@JRubyMethod(name = "setproctitle", module = true, visibility = PRIVATE)
1962+
public static IRubyObject setproctitle(ThreadContext context, IRubyObject recv, IRubyObject name) {
19521963
// Not possible for us to implement on most platforms, so we just noop.
19531964
name.convertToString();
19541965

core/src/main/java/org/jruby/compiler/MethodJITTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ protected void logFailed(ThreadContext context, final Throwable ex) {
126126

127127
@Override
128128
protected void logImpl(ThreadContext context, String message, Object... reason) {
129-
JITCompiler.log(method, methodName, message, reason);
129+
JITCompiler.log(context, method, methodName, message, reason);
130130
}
131131

132132
static String checkExcludedMethod(final RubyInstanceConfig config, final String className, final String methodName,

core/src/main/java/org/jruby/ext/date/RubyDateTime.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ public RubyDateTime(Ruby runtime, RubyClass klass, DateTime dt) {
9595
this.off = dt.getZone().getOffset(dt.getMillis()) / 1000;
9696
}
9797

98+
@Deprecated(since = "10.0")
9899
public RubyDateTime(Ruby runtime, DateTime dt) {
99-
this(runtime, getDateTime(runtime), dt);
100+
this(runtime, getDateTime(runtime.getCurrentContext()), dt);
100101
}
101102

102103
public RubyDateTime(Ruby runtime, long millis, Chronology chronology) {
103-
super(runtime, getDateTime(runtime), new DateTime(millis, chronology));
104+
super(runtime, getDateTime(runtime.getCurrentContext()), new DateTime(millis, chronology));
104105
}
105106

106107
RubyDateTime(ThreadContext context, RubyClass klass, IRubyObject ajd, int off, long start) {

core/src/main/java/org/jruby/ext/zlib/RubyGzipFile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public IRubyObject level(ThreadContext context) {
309309
return asFixnum(context, level);
310310
}
311311

312+
@Deprecated(since = "10.0")
312313
public IRubyObject set_sync(IRubyObject arg) {
313314
return set_sync(getCurrentContext(), arg);
314315
}

core/src/main/java/org/jruby/java/proxies/MapJavaProxy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public MapJavaProxy(Ruby runtime, RubyClass klazz, Map map) {
8383
*/
8484
public static RubyClass createMapJavaProxy(ThreadContext context, RubyClass _ConcreteJavaProxy) {
8585
var MapJavaProxy = defineClass(context, "MapJavaProxy", _ConcreteJavaProxy, MapJavaProxy::new);
86-
ConcreteJavaProxy.initialize(MapJavaProxy);
86+
ConcreteJavaProxy.initialize(context, MapJavaProxy);
8787
return MapJavaProxy;
8888
}
8989

core/src/main/java/org/jruby/javasupport/ext/JavaLang.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ public static IRubyObject backtrace(final ThreadContext context, final IRubyObje
235235
return RubyArray.newArrayMayCopy(runtime, backtrace);
236236
}
237237

238+
@Deprecated(since = "10.0")
238239
public static IRubyObject set_backtrace(final IRubyObject self, final IRubyObject backtrace) {
239240
return set_backtrace(((RubyBasicObject) self).getCurrentContext(), self, backtrace);
240241
}
@@ -793,7 +794,7 @@ public static IRubyObject new_array(ThreadContext context, IRubyObject self, IRu
793794
final java.lang.Class klass = unwrapJavaObject(self);
794795

795796
if (length instanceof RubyInteger lenint) { // one-dimensional array
796-
return ArrayJavaProxy.newArray(context.runtime, klass, lenint.asInt(context));
797+
return ArrayJavaProxy.newArray(context, klass, lenint.asInt(context));
797798
}
798799
if (length instanceof RubyArray ary) { // n-dimensional array
799800
IRubyObject[] aryLengths = ary.toJavaArrayMaybeUnsafe();

core/src/main/java/org/jruby/javasupport/ext/Module.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ private static IRubyObject javaImport(ThreadContext context, RubyModule target,
145145
@JRubyMethod(visibility = PRIVATE)
146146
public static IRubyObject java_alias(final ThreadContext context, final IRubyObject self, IRubyObject new_id, IRubyObject old_id) {
147147
final IncludedPackages includedPackages = getIncludedPackages(context, (RubyModule) self);
148-
if (!(new_id instanceof RubySymbol)) new_id = new_id.convertToString().intern();
149-
if (!(old_id instanceof RubySymbol)) old_id = old_id.convertToString().intern();
148+
if (!(new_id instanceof RubySymbol)) new_id = new_id.convertToString().intern(context);
149+
if (!(old_id instanceof RubySymbol)) old_id = old_id.convertToString().intern(context);
150150

151151
includedPackages.javaAliases.put(((RubySymbol) new_id).idString(), ((RubySymbol) old_id).idString());
152152
return old_id;

core/src/main/java/org/jruby/runtime/InterpretedIRBlockBody.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public InterpreterContext ensureInstrsReady() {
8484
}
8585

8686
@Override
87-
public String getOwnerName() {
87+
public String getOwnerName(ThreadContext context) {
8888
return null;
8989
}
9090

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy