|
35 | 35 | import org.graalvm.nativeimage.Platforms;
|
36 | 36 |
|
37 | 37 | import com.oracle.svm.core.SubstrateUtil;
|
| 38 | +import com.oracle.svm.core.heap.RestrictHeapAccess; |
38 | 39 | import com.oracle.svm.core.log.Log;
|
39 | 40 | import com.oracle.svm.util.ReflectionUtil;
|
40 |
| -import com.oracle.svm.core.heap.RestrictHeapAccess; |
41 | 41 |
|
42 | 42 | import jdk.jfr.internal.LogLevel;
|
43 | 43 | import jdk.jfr.internal.LogTag;
|
44 | 44 |
|
45 | 45 | public class JfrLogging {
|
46 |
| - private final IllegalArgumentException verifyLogLevelException; |
47 |
| - private final IllegalArgumentException verifyLogTagSetIdException; |
| 46 | + private static final IllegalArgumentException verifyLogLevelException = new IllegalArgumentException("LogLevel passed is outside valid range"); |
| 47 | + private static final IllegalArgumentException verifyLogTagSetIdException = new IllegalArgumentException("LogTagSet id is outside valid range"); |
| 48 | + |
48 | 49 | private final String[] logLevels;
|
49 | 50 | private final String[] logTagSets;
|
50 | 51 | private int levelDecorationFill = 0;
|
51 | 52 | private int tagSetDecorationFill = 0;
|
52 | 53 |
|
53 | 54 | @Platforms(Platform.HOSTED_ONLY.class)
|
54 | 55 | public JfrLogging() {
|
55 |
| - verifyLogLevelException = new IllegalArgumentException("LogLevel passed is outside valid range"); |
56 |
| - verifyLogTagSetIdException = new IllegalArgumentException("LogTagSet id is outside valid range"); |
57 | 56 | logLevels = createLogLevels();
|
58 | 57 | logTagSets = createLogTagSets();
|
59 | 58 | }
|
@@ -149,7 +148,7 @@ private static String[] createLogTagSets() {
|
149 | 148 | Set<JfrLogTag> set = JfrLogConfiguration.LOG_TAG_SETS.get(logTagSet);
|
150 | 149 | if (set != null) {
|
151 | 150 | for (JfrLogTag logTag : set) {
|
152 |
| - if (builder.length() > 0) { |
| 151 | + if (!builder.isEmpty()) { |
153 | 152 | builder.append(",");
|
154 | 153 | }
|
155 | 154 | builder.append(logTag.toString().toLowerCase(Locale.ROOT));
|
|
0 commit comments