Skip to content

Commit

Permalink
Add more forms of warning to Warn
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 19, 2024
1 parent c5c4a16 commit 57a1b31
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion core/src/main/java/org/jruby/api/Warn.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,35 @@ public static void warn(ThreadContext context, String message) {
}

/**
* Produce a warning id deprecated is set (e.g. Warning[:deprecated] = true)
* Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
* @param context the current context
* @param message to be displayed as a warning
*/
public static void warnDeprecated(ThreadContext context, String message) {
context.runtime.getWarnings().warnDeprecated(message);
}

/**
* Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
* @param context the current context
* @param message to be displayed as a warning
* @param version the version at which this deprecated feature will be removed
*/
public static void warnDeprecatedForRemoval(ThreadContext context, String message, String version) {
context.runtime.getWarnings().warnDeprecatedForRemoval(message, version);
}

/**
* Produce a warning if deprecated is set (e.g. Warning[:deprecated] = true)
* @param context the current context
* @param message to be displayed as a warning
* @param version the version at which this deprecated feature will be removed
* @param alternate the alternate feature that should be used instead
*/
public static void warnDeprecatedForRemovalAlternate(ThreadContext context, String message, String version, String alternate) {
context.runtime.getWarnings().warnDeprecatedForRemovalAlternate(message, version, alternate);
}

public static void warning(ThreadContext context, String message) {
context.runtime.getWarnings().warning(message);
}
Expand Down

0 comments on commit 57a1b31

Please sign in to comment.