Add refmap status in a couple of other useful spots

This commit is contained in:
Mumfrey committed 2017-08-02 19:01:56 +01:00
1 parent 9262eddf2d
commit ee0c879dc7
2 files changed
+7 -6

No files matched your search

@@ -273,14 +273,15 @@ public abstract class InjectionInfo extends SpecialMethodInfo implements ISliceC
this.classNode.methods.add(method);
}
String refMapStatus = this.mixin.getReferenceMapper().getStatus();
if ((MixinEnvironment.getCurrentEnvironment().getOption(Option.DEBUG_INJECTORS) && this.injectedCallbackCount < this.expectedCallbackCount)) {
throw new InvalidInjectionException(this,
String.format("Injection validation failed: %s %s%s in %s expected %d invocation(s) but %d succeeded",
this.getDescription(), this.method.name, this.method.desc, this.mixin, this.expectedCallbackCount, this.injectedCallbackCount));
String.format("Injection validation failed: %s %s%s in %s expected %d invocation(s) but %d succeeded. %s", this.getDescription(),
this.method.name, this.method.desc, this.mixin, this.expectedCallbackCount, this.injectedCallbackCount, refMapStatus));
} else if (this.injectedCallbackCount < this.requiredCallbackCount) {
throw new InjectionError(
String.format("Critical injection failure: %s %s%s in %s failed injection check, (%d/%d) succeeded",
this.getDescription(), this.method.name, this.method.desc, this.mixin, this.injectedCallbackCount, this.requiredCallbackCount));
String.format("Critical injection failure: %s %s%s in %s failed injection check, (%d/%d) succeeded. %s", this.getDescription(),
this.method.name, this.method.desc, this.mixin, this.injectedCallbackCount, this.requiredCallbackCount, refMapStatus));
} else if (this.injectedCallbackCount > this.maxCallbackCount) {
throw new InjectionError(
String.format("Critical injection failure: %s %s%s in %s failed injection check, %d succeeded of %d allowed",
@@ -398,7 +399,7 @@ public abstract class InjectionInfo extends SpecialMethodInfo implements ISliceC
if (this.targets.size() == 0) {
throw new InvalidInjectionException(this, type + " annotation on " + this.method.name + " could not find any targets matching "
+ InjectionInfo.namesOf(searchFor));
+ InjectionInfo.namesOf(searchFor) + ". " + this.mixin.getReferenceMapper().getStatus());
}
}
@@ -144,7 +144,7 @@ public final class ReferenceMapper implements Serializable {
* @return status message
*/
public String getStatus() {
return this.isDefault() ? "No refMap loaded" : "Using refmap " + this.getResourceName();
return this.isDefault() ? "No refMap loaded." : "Using refmap " + this.getResourceName();
}
/**