Skip to content

Commit e47dfb8

Browse files
alblueMarkus Grönlund
authored and
Markus Grönlund
committed
8264062: Use the blessed modifier order in jdk.jfr
Reviewed-by: mgronlun
1 parent 5a930c4 commit e47dfb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+143
-143
lines changed

src/jdk.jfr/share/classes/jdk/jfr/Enabled.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
* Setting name {@code "enabled"}, signifies that the event should be
4848
* recorded.
4949
*/
50-
public final static String NAME = "enabled";
50+
public static final String NAME = "enabled";
5151

5252
/**
5353
* Returns {@code true} if by default the event should be enabled, {@code false} otherwise.

src/jdk.jfr/share/classes/jdk/jfr/Event.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
@Enabled(true)
8787
@StackTrace(true)
8888
@Registered(true)
89-
abstract public class Event extends jdk.internal.event.Event {
89+
public abstract class Event extends jdk.internal.event.Event {
9090
/**
9191
* Sole constructor, for invocation by subclass constructors, typically
9292
* implicit.
@@ -98,7 +98,7 @@ protected Event() {
9898
* Starts the timing of this event.
9999
*/
100100
@Override
101-
final public void begin() {
101+
public final void begin() {
102102
}
103103

104104
/**
@@ -107,7 +107,7 @@ final public void begin() {
107107
* The {@code end} method must be invoked after the {@code begin} method.
108108
*/
109109
@Override
110-
final public void end() {
110+
public final void end() {
111111
}
112112

113113
/**
@@ -119,7 +119,7 @@ final public void end() {
119119
* ends when the {@code commit} method is invoked.
120120
*/
121121
@Override
122-
final public void commit() {
122+
public final void commit() {
123123
}
124124

125125
/**
@@ -130,7 +130,7 @@ final public void commit() {
130130
* @return {@code true} if event is enabled, {@code false} otherwise
131131
*/
132132
@Override
133-
final public boolean isEnabled() {
133+
public final boolean isEnabled() {
134134
return false;
135135
}
136136

@@ -144,7 +144,7 @@ final public boolean isEnabled() {
144144
* system, {@code false} otherwise
145145
*/
146146
@Override
147-
final public boolean shouldCommit() {
147+
public final boolean shouldCommit() {
148148
return false;
149149
}
150150

@@ -170,6 +170,6 @@ final public boolean shouldCommit() {
170170
* @see EventFactory
171171
*/
172172
@Override
173-
final public void set(int index, Object value) {
173+
public final void set(int index, Object value) {
174174
}
175175
}

src/jdk.jfr/share/classes/jdk/jfr/EventSettings.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Map<String, String> toMap() {
8888
*
8989
* @return event settings object for further configuration, not {@code null}
9090
*/
91-
final public EventSettings withStackTrace() {
91+
public final EventSettings withStackTrace() {
9292
return with(StackTrace.NAME, "true");
9393
}
9494

@@ -99,7 +99,7 @@ final public EventSettings withStackTrace() {
9999
*
100100
* @return event settings object for further configuration, not {@code null}
101101
*/
102-
final public EventSettings withoutStackTrace() {
102+
public final EventSettings withoutStackTrace() {
103103
return with(StackTrace.NAME, "false");
104104
}
105105

@@ -111,7 +111,7 @@ final public EventSettings withoutStackTrace() {
111111
*
112112
* @return event settings object for further configuration, not {@code null}
113113
*/
114-
final public EventSettings withoutThreshold() {
114+
public final EventSettings withoutThreshold() {
115115
return with(Threshold.NAME, "0 s");
116116
}
117117

@@ -122,7 +122,7 @@ final public EventSettings withoutThreshold() {
122122
*
123123
* @return event settings object for further configuration, not {@code null}
124124
*/
125-
final public EventSettings withPeriod(Duration duration) {
125+
public final EventSettings withPeriod(Duration duration) {
126126
return with(Period.NAME, duration.toNanos() + " ns");
127127
}
128128

@@ -133,7 +133,7 @@ final public EventSettings withPeriod(Duration duration) {
133133
*
134134
* @return event settings object for further configuration, not {@code null}
135135
*/
136-
final public EventSettings withThreshold(Duration duration) {
136+
public final EventSettings withThreshold(Duration duration) {
137137
if (duration == null) {
138138
return with(Threshold.NAME, "0 ns");
139139
} else {
@@ -151,7 +151,7 @@ final public EventSettings withThreshold(Duration duration) {
151151
*
152152
* @return event settings object for further configuration, not {@code null}
153153
*/
154-
abstract public EventSettings with(String name, String value);
154+
public abstract EventSettings with(String name, String value);
155155

156156
/**
157157
* Creates a settings {@code Map} for the event that is associated with this

src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public final class FlightRecorderPermission extends java.security.BasicPermissio
104104
PrivateAccess.setPrivateAccess(new InternalAccess());
105105
}
106106

107-
private final static class InternalAccess extends PrivateAccess {
107+
private static final class InternalAccess extends PrivateAccess {
108108

109109
@Override
110110
public Type getType(Object o) {

src/jdk.jfr/share/classes/jdk/jfr/Period.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/**
4545
* Settings name {@code "period"} for configuring periodic events
4646
*/
47-
public final static String NAME = "period";
47+
public static final String NAME = "period";
4848

4949
/**
5050
* Returns the default setting value for a periodic setting.

src/jdk.jfr/share/classes/jdk/jfr/StackTrace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* Settings name {@code "stackTrace"} to be used for enabling event stack traces.
4747
*/
48-
public final static String NAME = "stackTrace";
48+
public static final String NAME = "stackTrace";
4949

5050
/**
5151
* Returns if the stack trace from the {@code Event#commit()} method should be recorded.

src/jdk.jfr/share/classes/jdk/jfr/Threshold.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/**
4646
* Setting name {@code "threshold"} for configuring event thresholds.
4747
*/
48-
public final static String NAME = "threshold";
48+
public static final String NAME = "threshold";
4949

5050
/**
5151
* The threshold (for example, {@code "20 ms"}).

src/jdk.jfr/share/classes/jdk/jfr/Timestamp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
* The unit for the difference, measured in milliseconds, between the current
4747
* time and midnight, January 1, 1970 UTC.
4848
*/
49-
public final static String MILLISECONDS_SINCE_EPOCH = "MILLISECONDS_SINCE_EPOCH";
49+
public static final String MILLISECONDS_SINCE_EPOCH = "MILLISECONDS_SINCE_EPOCH";
5050

5151
/**
5252
* The unit for the number of ticks that have transpired since some arbitrary
5353
* starting date.
5454
*/
55-
public final static String TICKS = "TICKS";
55+
public static final String TICKS = "TICKS";
5656

5757
/**
5858
* Unit for the time stamp.

src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public MetadataEvent newMetadataEvent(List<EventType> previous, List<EventType>
150150
JdkJfrConsumer.setAccess(access);
151151
}
152152

153-
private final static class UnsignedValue {
153+
private static final class UnsignedValue {
154154
private final Object o;
155155

156156
UnsignedValue(Object o) {
@@ -261,7 +261,7 @@ public boolean hasField(String name) {
261261
* @see #hasField(String)
262262
*
263263
*/
264-
final public <T> T getValue(String name) {
264+
public final <T> T getValue(String name) {
265265
@SuppressWarnings("unchecked")
266266
T t = (T) getValue(name, false);
267267
return t;
@@ -978,7 +978,7 @@ public final RecordedThread getThread(String name) {
978978
* @return textual description of this object
979979
*/
980980
@Override
981-
final public String toString() {
981+
public final String toString() {
982982
StringWriter s = new StringWriter();
983983
PrettyWriter p = new PrettyWriter(new PrintWriter(s));
984984
p.setStackDepth(5);

src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
*/
6868
public final class RecordingStream implements AutoCloseable, EventStream {
6969

70-
final static class ChunkConsumer implements Consumer<Long> {
70+
static final class ChunkConsumer implements Consumer<Long> {
7171

7272
private final Recording recording;
7373

src/jdk.jfr/share/classes/jdk/jfr/events/Handlers.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
import jdk.jfr.internal.Utils;
2929

3030
public final class Handlers {
31-
public final static EventHandler SOCKET_READ = Utils.getHandler(SocketReadEvent.class);
32-
public final static EventHandler SOCKET_WRITE = Utils.getHandler(SocketWriteEvent.class);
33-
public final static EventHandler FILE_READ = Utils.getHandler(FileReadEvent.class);
34-
public final static EventHandler FILE_WRITE = Utils.getHandler(FileWriteEvent.class);
35-
public final static EventHandler FILE_FORCE = Utils.getHandler(FileForceEvent.class);
36-
public final static EventHandler ERROR_THROWN = Utils.getHandler(ErrorThrownEvent.class);
37-
public final static EventHandler EXCEPTION_THROWN = Utils.getHandler(ExceptionThrownEvent.class);
31+
public static final EventHandler SOCKET_READ = Utils.getHandler(SocketReadEvent.class);
32+
public static final EventHandler SOCKET_WRITE = Utils.getHandler(SocketWriteEvent.class);
33+
public static final EventHandler FILE_READ = Utils.getHandler(FileReadEvent.class);
34+
public static final EventHandler FILE_WRITE = Utils.getHandler(FileWriteEvent.class);
35+
public static final EventHandler FILE_FORCE = Utils.getHandler(FileForceEvent.class);
36+
public static final EventHandler ERROR_THROWN = Utils.getHandler(ErrorThrownEvent.class);
37+
public static final EventHandler EXCEPTION_THROWN = Utils.getHandler(ExceptionThrownEvent.class);
3838
}

src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
public final class Control {
4040
private final AccessControlContext context;
41-
private final static int CACHE_SIZE = 5;
41+
private static final int CACHE_SIZE = 5;
4242
private final Set<?>[] cachedUnions = new HashSet<?>[CACHE_SIZE];
4343
private final String[] cachedValues = new String[CACHE_SIZE];
4444
private final SettingControl delegate;

src/jdk.jfr/share/classes/jdk/jfr/internal/Cutoff.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
/**
5050
* Settings name {@code "cutoff"} for configuring event cutoffs.
5151
*/
52-
public final static String NAME = "cutoff";
53-
public final static String INFINITY = "infinity";
52+
public static final String NAME = "cutoff";
53+
public static final String INFINITY = "infinity";
5454

5555
/**
5656
* Cutoff, for example {@code "20 ms"}.

src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
// holds SettingControl instances that need to be released
5757
// when a class is unloaded (to avoid memory leaks).
5858
public final class EventControl {
59-
final static class NamedControl {
59+
static final class NamedControl {
6060
public final String name;
6161
public final Control control;
6262
NamedControl(String name, Control control) {

src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ final class EventHandlerCreator {
6363
private static final String FIELD_EVENT_TYPE = "platformEventType";
6464
private static final String FIELD_PREFIX_STRING_POOL = "stringPool";
6565

66-
private final static Type TYPE_STRING_POOL = Type.getType(StringPool.class);
67-
private final static Type TYPE_EVENT_WRITER = Type.getType(EventWriter.class);
68-
private final static Type TYPE_PLATFORM_EVENT_TYPE = Type.getType(PlatformEventType.class);
69-
private final static Type TYPE_EVENT_HANDLER = Type.getType(EventHandler.class);
70-
private final static Type TYPE_SETTING_CONTROL = Type.getType(SettingControl.class);
71-
private final static Type TYPE_EVENT_TYPE = Type.getType(EventType.class);
72-
private final static Type TYPE_EVENT_CONTROL = Type.getType(EventControl.class);
73-
private final static String DESCRIPTOR_EVENT_HANDLER = "(" + Type.BOOLEAN_TYPE.getDescriptor() + TYPE_EVENT_TYPE.getDescriptor() + TYPE_EVENT_CONTROL.getDescriptor() + ")V";
74-
private final static Method METHOD_GET_EVENT_WRITER = new Method("getEventWriter", "()" + TYPE_EVENT_WRITER.getDescriptor());
75-
private final static Method METHOD_EVENT_HANDLER_CONSTRUCTOR = new Method("<init>", DESCRIPTOR_EVENT_HANDLER);
76-
private final static Method METHOD_RESET = new Method("reset", "()V");
66+
private static final Type TYPE_STRING_POOL = Type.getType(StringPool.class);
67+
private static final Type TYPE_EVENT_WRITER = Type.getType(EventWriter.class);
68+
private static final Type TYPE_PLATFORM_EVENT_TYPE = Type.getType(PlatformEventType.class);
69+
private static final Type TYPE_EVENT_HANDLER = Type.getType(EventHandler.class);
70+
private static final Type TYPE_SETTING_CONTROL = Type.getType(SettingControl.class);
71+
private static final Type TYPE_EVENT_TYPE = Type.getType(EventType.class);
72+
private static final Type TYPE_EVENT_CONTROL = Type.getType(EventControl.class);
73+
private static final String DESCRIPTOR_EVENT_HANDLER = "(" + Type.BOOLEAN_TYPE.getDescriptor() + TYPE_EVENT_TYPE.getDescriptor() + TYPE_EVENT_CONTROL.getDescriptor() + ")V";
74+
private static final Method METHOD_GET_EVENT_WRITER = new Method("getEventWriter", "()" + TYPE_EVENT_WRITER.getDescriptor());
75+
private static final Method METHOD_EVENT_HANDLER_CONSTRUCTOR = new Method("<init>", DESCRIPTOR_EVENT_HANDLER);
76+
private static final Method METHOD_RESET = new Method("reset", "()V");
7777

7878
private final ClassWriter classWriter;
7979
private final String className;

src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public SettingInfo(String fieldName, int index) {
7878
}
7979

8080
static final class FieldInfo {
81-
private final static Type STRING = Type.getType(String.class);
81+
private static final Type STRING = Type.getType(String.class);
8282
final String fieldName;
8383
final String fieldDescriptor;
8484
final String internalClassName;

src/jdk.jfr/share/classes/jdk/jfr/internal/EventWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public final class EventWriter {
3939
// Event may not exceed size for a padded integer
4040
private static final long MAX_EVENT_SIZE = (1 << 28) -1;
4141
private static final Unsafe unsafe = Unsafe.getUnsafe();
42-
private final static JVM jvm = JVM.getJVM();
42+
private static final JVM jvm = JVM.getJVM();
4343

4444
// The JVM needs access to these values. Don't remove
4545
private final long threadID;

src/jdk.jfr/share/classes/jdk/jfr/internal/FilePurger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// so they can a later staged be removed.
3737
final class FilePurger {
3838

39-
private final static Set<SafePath> paths = new LinkedHashSet<>();
39+
private static final Set<SafePath> paths = new LinkedHashSet<>();
4040

4141
public synchronized static void add(SafePath p) {
4242
paths.add(p);

src/jdk.jfr/share/classes/jdk/jfr/internal/Logger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
public final class Logger {
3434

35-
private final static int MAX_SIZE = 10000;
35+
private static final int MAX_SIZE = 10000;
3636
static {
3737
// This will try to initialize the JVM logging system
3838
JVMSupport.tryToInitializeJVM();

src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public final class MetadataLoader {
6767
private final Type PERIOD_TYPE = TypeLibrary.createAnnotationType(Period.class);
6868

6969
// <Event>, <Type> and <Relation>
70-
private final static class TypeElement {
70+
private static final class TypeElement {
7171
private final List<FieldElement> fields;
7272
private final String name;
7373
private final String label;

src/jdk.jfr/share/classes/jdk/jfr/internal/Options.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
*/
3737
public final class Options {
3838

39-
private final static JVM jvm = JVM.getJVM();
40-
private final static long WAIT_INTERVAL = 1000; // ms;
39+
private static final JVM jvm = JVM.getJVM();
40+
private static final long WAIT_INTERVAL = 1000; // ms;
4141

42-
private final static long MIN_MAX_CHUNKSIZE = 1024 * 1024;
42+
private static final long MIN_MAX_CHUNKSIZE = 1024 * 1024;
4343

4444
private static final long DEFAULT_GLOBAL_BUFFER_COUNT = 20;
4545
private static final long DEFAULT_GLOBAL_BUFFER_SIZE = 524288;

src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public final class PlatformRecorder {
6363

6464

6565
private final List<PlatformRecording> recordings = new ArrayList<>();
66-
private final static List<SecureRecorderListener> changeListeners = new ArrayList<>();
66+
private static final List<SecureRecorderListener> changeListeners = new ArrayList<>();
6767
private final Repository repository;
68-
private final static JVM jvm = JVM.getJVM();
68+
private static final JVM jvm = JVM.getJVM();
6969
private final EventType activeRecordingEvent;
7070
private final EventType activeSettingEvent;
7171
private final Thread shutdownHook;

src/jdk.jfr/share/classes/jdk/jfr/internal/RequestEngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040

4141
public final class RequestEngine {
4242

43-
private final static JVM jvm = JVM.getJVM();
43+
private static final JVM jvm = JVM.getJVM();
4444

45-
final static class RequestHook {
45+
static final class RequestHook {
4646
private final Runnable hook;
4747
private final PlatformEventType type;
4848
private final AccessControlContext accessControllerContext;
@@ -99,7 +99,7 @@ public Void run() {
9999
}
100100
}
101101

102-
private final static List<RequestHook> entries = new CopyOnWriteArrayList<>();
102+
private static final List<RequestHook> entries = new CopyOnWriteArrayList<>();
103103
private static long lastTimeMillis;
104104
private static long flushInterval = Long.MAX_VALUE;
105105
private static long streamDelta;

0 commit comments

Comments
 (0)