|
24 | 24 | */ |
25 | 25 | package org.graalvm.compiler.options; |
26 | 26 |
|
27 | | -import java.util.Formatter; |
28 | | - |
29 | 27 | import org.graalvm.collections.EconomicMap; |
30 | 28 | import org.graalvm.collections.UnmodifiableEconomicMap; |
31 | 29 |
|
@@ -64,19 +62,19 @@ public final OptionDescriptor getDescriptor() { |
64 | 62 | protected boolean checkDescriptorExists() { |
65 | 63 | OptionKey.Lazy.init(); |
66 | 64 | if (descriptor == null) { |
67 | | - Formatter buf = new Formatter(); |
68 | | - buf.format("Could not find a descriptor for an option key. The most likely cause is " + |
69 | | - "a dependency on the %s annotation without a dependency on the " + |
70 | | - "org.graalvm.compiler.options.processor.OptionProcessor annotation processor.", Option.class.getName()); |
| 65 | + StringBuilder result = new StringBuilder(); |
| 66 | + result.append("Could not find a descriptor for an option key. The most likely cause is a dependency on the "); |
| 67 | + result.append(Option.class.getName()); |
| 68 | + result.append(" annotation without a dependency on the org.graalvm.compiler.options.processor.OptionProcessor annotation processor."); |
71 | 69 | StackTraceElement[] stackTrace = new Exception().getStackTrace(); |
72 | 70 | if (stackTrace.length > 2 && |
73 | 71 | stackTrace[1].getClassName().equals(OptionKey.class.getName()) && |
74 | 72 | stackTrace[1].getMethodName().equals("getValue")) { |
75 | 73 | String caller = stackTrace[2].getClassName(); |
76 | | - buf.format(" In suite.py, add GRAAL_OPTIONS_PROCESSOR to the \"annotationProcessors\" attribute of the project " + |
77 | | - "containing %s.", caller); |
| 74 | + result.append(" In suite.py, add GRAAL_OPTIONS_PROCESSOR to the \"annotationProcessors\" attribute of the project containing "); |
| 75 | + result.append(caller); |
78 | 76 | } |
79 | | - throw new AssertionError(buf.toString()); |
| 77 | + throw new AssertionError(result.toString()); |
80 | 78 | } |
81 | 79 | return true; |
82 | 80 | } |
|
0 commit comments