Skip to content

Commit 64a2452

Browse files
committedMar 19, 2018
Additional tweaks for ambiguous calls debug (#4894).
1 parent d8198d9 commit 64a2452

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

Diff for: ‎core/src/main/java/org/jruby/java/dispatch/CallableSelector.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,15 @@ else if ( procArity < 0 && methodArity >= -(procArity + 1) ) { // *splat that fi
280280
method = mostSpecific;
281281

282282
if ( ambiguous ) {
283-
if (Options.DEBUG_AMBIGUOUS_JAVA_CALLS.load()) {
283+
if (Options.JI_AMBIGUOUS_CALLS_DEBUG.load()) {
284284
runtime.newRuntimeError(
285285
"multiple Java methods found, dumping backtrace and choosing "
286286
+ ((Member) ((JavaCallable) method).accessibleObject()).getName()
287287
+ prettyParams(msTypes)
288288
).printStackTrace(runtime.getErr());
289289
} else {
290290
runtime.getWarnings().warn(
291-
"multiple Java methods found, use -Xdebug.ambiguous.java.calls for backtrace. Choosing "
291+
"multiple Java methods found, use -X" + Options.JI_AMBIGUOUS_CALLS_DEBUG.propertyName() + " for backtrace. Choosing "
292292
+ ((Member) ((JavaCallable) method).accessibleObject()).getName()
293293
+ prettyParams(msTypes));
294294
}

Diff for: ‎core/src/main/java/org/jruby/util/cli/Options.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ public class Options {
188188
public static final Option<String> LOGGER_CLASS = string(DEBUG, "logger.class", new String[]{"class name"}, "org.jruby.util.log.StandardErrorLogger", "Use specified class for logging.");
189189
public static final Option<Boolean> DUMP_INSTANCE_VARS = bool(DEBUG, "dump.variables", false, "Dump class + instance var names on first new of Object subclasses.");
190190
public static final Option<Boolean> REWRITE_JAVA_TRACE = bool(DEBUG, "rewrite.java.trace", true, "Rewrite stack traces from exceptions raised in Java calls.");
191-
public static final Option<Boolean> DEBUG_AMBIGUOUS_JAVA_CALLS = bool(DEBUG, "debug.ambiguous.java.calls", false, "Toggle verbose reporting of all ambiguous calls to Java objects");
192191

193192
// TODO: Replace flag that's false on 9 with proper module checks
194193
public static final Option<Boolean> JI_SETACCESSIBLE = bool(JAVA_INTEGRATION, "ji.setAccessible", calculateSetAccessibleDefault(), "Try to set inaccessible Java methods to be accessible.");
@@ -199,6 +198,7 @@ public class Options {
199198
public static final Option<Boolean> JI_NEWSTYLEEXTENSION = bool(JAVA_INTEGRATION, "ji.newStyleExtension", false, "Extend Java classes without using a proxy object.");
200199
public static final Option<Boolean> JI_OBJECTPROXYCACHE = bool(JAVA_INTEGRATION, "ji.objectProxyCache", false, "Cache Java object wrappers between calls.");
201200
public static final Option<String> JI_PROXYCLASSFACTORY = string(JAVA_INTEGRATION, "ji.proxyClassFactory", "Allow external envs to replace JI proxy class factory");
201+
public static final Option<Boolean> JI_AMBIGUOUS_CALLS_DEBUG = bool(JAVA_INTEGRATION, "ji.ambiguous.calls.debug", false, "Toggle verbose reporting of all ambiguous calls to Java objects");
202202
public static final Option<Boolean> AOT_LOADCLASSES = bool(JAVA_INTEGRATION, "aot.loadClasses", false, "Look for .class before .rb to load AOT-compiled code");
203203

204204
public static final Option<Integer> PROFILE_MAX_METHODS = integer(PROFILING, "profile.max.methods", 100000, "Maximum number of methods to consider for profiling.");

0 commit comments

Comments
 (0)
Please sign in to comment.