Skip to content

Commit 4bbf1ad

Browse files
Cleanups.
1 parent d41e892 commit 4bbf1ad

File tree

1 file changed

+5
-6
lines changed
  • substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/logging

1 file changed

+5
-6
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jfr/logging/JfrLogging.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,24 @@
3535
import org.graalvm.nativeimage.Platforms;
3636

3737
import com.oracle.svm.core.SubstrateUtil;
38+
import com.oracle.svm.core.heap.RestrictHeapAccess;
3839
import com.oracle.svm.core.log.Log;
3940
import com.oracle.svm.util.ReflectionUtil;
40-
import com.oracle.svm.core.heap.RestrictHeapAccess;
4141

4242
import jdk.jfr.internal.LogLevel;
4343
import jdk.jfr.internal.LogTag;
4444

4545
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+
4849
private final String[] logLevels;
4950
private final String[] logTagSets;
5051
private int levelDecorationFill = 0;
5152
private int tagSetDecorationFill = 0;
5253

5354
@Platforms(Platform.HOSTED_ONLY.class)
5455
public JfrLogging() {
55-
verifyLogLevelException = new IllegalArgumentException("LogLevel passed is outside valid range");
56-
verifyLogTagSetIdException = new IllegalArgumentException("LogTagSet id is outside valid range");
5756
logLevels = createLogLevels();
5857
logTagSets = createLogTagSets();
5958
}
@@ -149,7 +148,7 @@ private static String[] createLogTagSets() {
149148
Set<JfrLogTag> set = JfrLogConfiguration.LOG_TAG_SETS.get(logTagSet);
150149
if (set != null) {
151150
for (JfrLogTag logTag : set) {
152-
if (builder.length() > 0) {
151+
if (!builder.isEmpty()) {
153152
builder.append(",");
154153
}
155154
builder.append(logTag.toString().toLowerCase(Locale.ROOT));

0 commit comments

Comments
 (0)