diff --git a/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java b/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java index f530e325ab7..9b070cae795 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/AnnotationElement.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,24 +46,22 @@ import jdk.jfr.internal.Utils; *
* The following example shows how {@code AnnotationElement} can be used to dynamically define events. * - *
- *
- * List{@literal <}AnnotationElement{@literal >} typeAnnotations = new ArrayList{@literal <}{@literal >}();
- * typeannotations.add(new AnnotationElement(Name.class, "com.example.HelloWorld");
+ * {@literal
+ * List typeAnnotations = new ArrayList<>();
+ * typeAnnotations.add(new AnnotationElement(Name.class, "com.example.HelloWorld"));
* typeAnnotations.add(new AnnotationElement(Label.class, "Hello World"));
* typeAnnotations.add(new AnnotationElement(Description.class, "Helps programmer getting started"));
*
- * List{@literal <}AnnotationElement{@literal >} fieldAnnotations = new ArrayList{@literal <}{@literal >}();
+ * List fieldAnnotations = new ArrayList<>();
* fieldAnnotations.add(new AnnotationElement(Label.class, "Message"));
*
- * List{@literal <}ValueDescriptor{@literal >} fields = new ArrayList{@literal <}{@literal >}();
+ * List fields = new ArrayList<>();
* fields.add(new ValueDescriptor(String.class, "message", fieldAnnotations));
*
* EventFactory f = EventFactory.create(typeAnnotations, fields);
* Event event = f.newEvent();
* event.commit();
- *
- *
+ * }
*
* @since 9
*/
@@ -357,7 +355,7 @@ public final class AnnotationElement {
* @param annotationType the {@code Class object} corresponding to the annotation type,
* not {@code null}
* @return this element's annotation for the specified annotation type if
- * it it exists, else {@code null}
+ * it exists, else {@code null}
*/
public final A getAnnotation(Class extends Annotation> annotationType) {
Objects.requireNonNull(annotationType);
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java b/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java
index 06b32ef0d0a..6fc92ceab34 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/BooleanFlag.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,7 +32,7 @@ import java.lang.annotation.Target;
/**
* Event field annotation, specifies that the value is a boolean flag, a {@code true} or
- * {@code false} value
+ * {@code false} value.
*
* @since 9
*/
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Category.java b/src/jdk.jfr/share/classes/jdk/jfr/Category.java
index 91f6807057e..9b7e2c4b968 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/Category.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/Category.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -75,32 +75,32 @@ import java.lang.annotation.Target;
* @Category("Upload")@Category({"Upload", "Image Upload"})@Category({"Upload", "Image Upload"})@Category({"Upload", "Image Upload"})@Category("Java Application")@Category("Java Application")* The following example shows how to implement an {@code Event} class. * - *
- *
+ * {@literal
* import jdk.jfr.Event;
* import jdk.jfr.Description;
* import jdk.jfr.Label;
*
* public class Example {
*
- * @Label("Hello World")
- * @Description("Helps programmer getting started")
+ * @Label("Hello World")
+ * @Description("Helps programmer getting started")
* static class HelloWorld extends Event {
- * @Label("Message")
+ * @Label("Message")
* String message;
* }
*
@@ -52,11 +51,10 @@ package jdk.jfr;
* event.commit();
* }
* }
- *
- *
+ * }
* * After an event is allocated and its field members are populated, it can be - * written to the Flight Recorder system by using the {@code #commit()} method. + * written to the Flight Recorder system by using the {@link #commit()} method. *
* By default, an event is enabled. To disable an event annotate the
* {@link Event} class with {@code @Enabled(false)}.
@@ -79,8 +77,8 @@ package jdk.jfr;
* Gathering data to store in an event can be expensive. The
* {@link Event#shouldCommit()} method can be used to verify whether an event
* instance would actually be written to the system when the
- * {@code Event#commit()commit} method is invoked. If
- * {@link Event#shouldCommit()} returns false, then those operations can be
+ * {@code commit()} method is invoked. If
+ * {@code shouldCommit()} returns false, then those operations can be
* avoided.
*
* @since 9
@@ -156,7 +154,7 @@ abstract public class Event extends jdk.internal.event.Event {
* {@code EventFactory} class.
*
* @param index the index of the field that is passed to
- * {@code EventFactory#create(String, java.util.List, java.util.List)}
+ * {@link EventFactory#create(java.util.List, java.util.List)}
* @param value value to set, can be {@code null}
* @throws UnsupportedOperationException if it's not a dynamically generated
* event
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java b/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java
index b4ccb5f50b7..bbda1be7490 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/EventFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -171,7 +171,7 @@ public final class EventFactory {
try {
return new EventFactory(eventClass, sanitizedAnnotation, sanitizedFields);
} catch (IllegalAccessException e) {
- throw new IllegalAccessError("Could not accees constructor of generated event handler, " + e.getMessage());
+ throw new IllegalAccessError("Could not access constructor of generated event handler, " + e.getMessage());
} catch (NoSuchMethodException e) {
throw new InternalError("Could not find constructor in generated event handler, " + e.getMessage());
}
@@ -189,7 +189,7 @@ public final class EventFactory {
try {
return (Event) constructorHandle.invoke();
} catch (Throwable e) {
- throw new InstantiationError("Could not instantaite dynamically generated event class " + eventClass.getName() + ". " + e.getMessage());
+ throw new InstantiationError("Could not instantiate dynamically generated event class " + eventClass.getName() + ". " + e.getMessage());
}
}
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/EventType.java b/src/jdk.jfr/share/classes/jdk/jfr/EventType.java
index e67489becc3..cb06717aa28 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/EventType.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/EventType.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -67,10 +67,8 @@ public final class EventType {
* Returns the field with the specified name, or {@code null} if it doesn't
* exist.
*
- * @return a value descriptor that describes the field, or null if
+ * @return a value descriptor that describes the field, or {@code null} if
* the field with the specified name doesn't exist
- *
- * @return a value descriptor, or null if it doesn't exist
*/
public ValueDescriptor getField(String name) {
Objects.requireNonNull(name);
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java
index ae9371c1196..eb9459e8bcb 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java
@@ -85,7 +85,7 @@ public final class FlightRecorder {
/**
* Creates a snapshot of all available recorded data.
*
- * A snapshot is a synthesized recording in a {@code STOPPPED} state. If no data is + * A snapshot is a synthesized recording in a {@code STOPPED} state. If no data is * available, a recording with size {@code 0} is returned. *
* A snapshot provides stable access to data for later operations (for example, @@ -93,17 +93,15 @@ public final class FlightRecorder { *
* The following example shows how to create a snapshot and write a subset of the data to a file. * - *
- *
+ * {@literal
* try (Recording snapshot = FlightRecorder.getFlightRecorder().takeSnapshot()) {
- * if (snapshot.getSize() > 0) {
+ * if (snapshot.getSize() > 0) {
* snapshot.setMaxSize(100_000_000);
* snapshot.setMaxAge(Duration.ofMinutes(5));
* snapshot.dump(Paths.get("snapshot.jfr"));
* }
* }
- *
- *
+ * }
*
* The caller must close the recording when access to the data is no longer
* needed.
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java
index cda440f36d0..55798f89de4 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderListener.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,12 +41,12 @@ public interface FlightRecorderListener {
* * This method allows clients to implement their own initialization mechanism * that is executed before a {@code FlightRecorder} instance is returned by - * {@code FlightRecorder#getFlightRecorder()}. + * {@link FlightRecorder#getFlightRecorder()}. * * @implNote This method should return as soon as possible, to avoid blocking * initialization of Flight Recorder. To avoid deadlocks or unexpected * behavior, this method should not call - * {@link FlightRecorder#getFlightRecorder()} or start new recordings. + * {@code FlightRecorder.getFlightRecorder()} or start new recordings. * * @implSpec The default implementation of this method is empty. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java b/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java index 826346da0ef..919c7b01cff 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/MetadataDefinition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,39 +36,36 @@ import java.lang.annotation.Target; * In the following example, a transaction event is defined with two * user-defined annotations, {@code @Severity} and {@code @TransactionId}. * - *
- *
- *{@literal @}MetadataDefinition
- *{@literal @}Label("Severity")
- *{@literal @}Description("Value between 0 and 100 that indicates severity. 100 is most severe.")
- *{@literal @}Retention(RetentionPolicy.RUNTIME)
- *{@literal @}Target({ ElementType.TYPE })
- * public {@literal @}interface {@literal @}Severity {
- * int value() default 50;
+ * {@literal
+ * @MetadataDefinition
+ * @Label("Severity")
+ * @Description("Value between 0 and 100 that indicates severity. 100 is most severe.")
+ * @Retention(RetentionPolicy.RUNTIME)
+ * @Target({ElementType.TYPE})
+ * public @interface Severity {
+ * int value() default 50;
* }
*
- *{@literal @}MetadataDefinition
- *{@literal @}Label("Transaction Id")
- *{@literal @}Relational
- *{@literal @}Retention(RetentionPolicy.RUNTIME)
- *{@literal @}Target({ ElementType.FIELD })
- * public {@literal @}interface {@literal @}Severity {
+ * @MetadataDefinition
+ * @Label("Transaction Id")
+ * @Relational
+ * @Retention(RetentionPolicy.RUNTIME)
+ * @Target({ElementType.FIELD})
+ * public @interface TransactionId {
* }
*
- *{@literal @}Severity(80)
- *{@literal @}Label("Transaction Blocked");
+ * @Severity(80)
+ * @Label("Transaction Blocked")
* class TransactionBlocked extends Event {
- * {@literal @}TransactionId
- * {@literal @}Label("Transaction");
- * long transactionId;
+ * @TransactionId
+ * @Label("Transaction")
+ * long transactionId1;
*
- * {@literal @}TransactionId
- * {@literal @}Label("Transaction Blocker");
- * long transactionId;
+ * @TransactionId
+ * @Label("Transaction Blocker")
+ * long transactionId2;
* }
- *
- *
- *
+ * }
*
* Adding {@code @MetadataDefinition} to the declaration of {@code @Severity} and {@code @TransactionId}
* ensures the information is saved by Flight Recorder.
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Period.java b/src/jdk.jfr/share/classes/jdk/jfr/Period.java
index 4fa32c39023..8e3aa10e660 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/Period.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/Period.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,7 @@ public @interface Period {
* * Example values: {@code "0 ns"}, {@code "10 ms"}, and {@code "1 s"}. *
- * A period may also be "everyChunk" to specify that it occurs at
+ * A period may also be {@code "everyChunk"} to specify that it occurs at
* least once for every recording file. The number of events that are emitted
* depends on how many times the file rotations occur when data is recorded.
*
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java
index 10aeefa4f62..84b22227a4c 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/Recording.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/Recording.java
@@ -46,8 +46,7 @@ import jdk.jfr.internal.WriteableUserPath;
*
* The following example shows how configure, start, stop and dump recording data to disk. * - *
- *
+ * {@literal
* Configuration c = Configuration.getConfiguration("default");
* Recording r = new Recording(c);
* r.start();
@@ -55,8 +54,7 @@ import jdk.jfr.internal.WriteableUserPath;
* Thread.sleep(5000);
* r.stop();
* r.dump(Files.createTempFile("my-recording", ".jfr"));
- *
- *
+ * }
*
* @since 9
*/
@@ -145,11 +143,9 @@ public final class Recording implements Closeable {
* * The following example shows how create a recording that uses a predefined configuration. * - *
- *
+ * {@literal
* Recording r = new Recording(Configuration.getConfiguration("default"));
- *
- *
+ * }
*
* The newly created recording is in the {@link RecordingState#NEW} state. To
* start the recording, invoke the {@link Recording#start()} method.
@@ -269,7 +265,7 @@ public final class Recording implements Closeable {
/**
* Returns the time when this recording was started.
*
- * @return the the time, or {@code null} if this recording is not started
+ * @return the time, or {@code null} if this recording is not started
*/
public Instant getStartTime() {
return internal.getStartTime();
@@ -311,25 +307,21 @@ public final class Recording implements Closeable {
* * The following example shows how to set event settings for a recording. * - *
- *
- * Map{@literal <}String, String{@literal >} settings = new HashMap{@literal <}{@literal >}();
+ * {@literal
+ * Map settings = new HashMap<>();
* settings.putAll(EventSettings.enabled("jdk.CPUSample").withPeriod(Duration.ofSeconds(2)).toMap());
* settings.putAll(EventSettings.enabled(MyEvent.class).withThreshold(Duration.ofSeconds(2)).withoutStackTrace().toMap());
* settings.put("jdk.ExecutionSample#period", "10 ms");
* recording.setSettings(settings);
- *
- *
+ * }
*
* The following example shows how to merge settings.
*
- *
- * {@code
+ * {@literal
* Map settings = recording.getSettings();
* settings.putAll(additionalSettings);
* recording.setSettings(settings);
- * }
- *
+ * }
*
* @param settings the settings to set, not {@code null}
*/
@@ -421,7 +413,7 @@ public final class Recording implements Closeable {
*
* @param maxSize the amount of data to retain, {@code 0} if infinite
*
- * @throws IllegalArgumentException if maxSize is negative
+ * @throws IllegalArgumentException if {@code maxSize} is negative
*
* @throws IllegalStateException if the recording is in {@code CLOSED} state
*/
@@ -474,7 +466,7 @@ public final class Recording implements Closeable {
*
* @param maxAge the length of time that data is kept, or {@code null} if infinite
*
- * @throws IllegalArgumentException if maxAge is negative
+ * @throws IllegalArgumentException if {@code maxAge} is negative
*
* @throws IllegalStateException if the recording is in the {@code CLOSED} state
*/
@@ -586,10 +578,10 @@ public final class Recording implements Closeable {
* * The stream may contain some data outside the specified range. * - * @param the start start time for the stream, or {@code null} to get data from + * @param start the start time for the stream, or {@code null} to get data from * start time of the recording * - * @param the end end time for the stream, or {@code null} to get data until the + * @param end the end time for the stream, or {@code null} to get data until the * present time. * * @return an input stream, or {@code null} if no data is available in the diff --git a/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java b/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java index cd5609d624c..98e36e0963e 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/RecordingState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,7 +65,7 @@ public enum RecordingState { * recording are released. *
* Nothing that can be done with a recording from this point, and it's - * no longer retrievable from the {@code FlightRrecorder.getRecordings()} method. + * no longer retrievable from the {@link FlightRecorder#getRecordings()} method. */ CLOSED; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java b/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java index 8f0a44fb494..04ac74529d6 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/SettingControl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,32 +36,30 @@ import jdk.jfr.internal.Control; * The following example shows a naive implementation of a setting control for * regular expressions: * - *
- *
+ * {@literal
* final class RegExpControl extends SettingControl {
* private Pattern pattern = Pattern.compile(".*");
*
- * {@literal @}Override
+ * @Override
* public void setValue(String value) {
* this.pattern = Pattern.compile(value);
* }
*
- * {@literal @}Override
- * public String combine(Set{@literal <}String{@literal >} values) {
+ * @Override
+ * public String combine(Set values) {
* return String.join("|", values);
* }
*
- * {@literal @}Override
+ * @Override
* public String getValue() {
* return pattern.toString();
* }
*
- * public String matches(String s) {
+ * public boolean matches(String s) {
* return pattern.matcher(s).find();
* }
* }
- *
- *
+ * }
*
* The {@code setValue(String)}, {@code getValue()} and
* {@code combine(Set
- *
+ * {@literal
* abstract class HTTPRequest extends Event {
- * {@literal @}Label("Request URI")
+ * @Label("Request URI")
* protected String uri;
*
- * {@literal @}Label("Servlet URI Filter")
- * {@literal @}SettingDefinition
+ * @Label("Servlet URI Filter")
+ * @SettingDefinition
* protected boolean uriFilter(RegExpControl regExp) {
* return regExp.matches(uri);
* }
* }
*
- * {@literal @}Label("HTTP Get Request")
+ * @Label("HTTP Get Request")
* class HTTPGetRequest extends HTTPRequest {
* }
*
- * {@literal @}Label("HTTP Post Request")
+ * @Label("HTTP Post Request")
* class HTTPPostRequest extends HTTPRequest {
* }
*
- * class ExampleServlet extends HTTPServlet {
+ * class ExampleServlet extends HttpServlet {
* protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
* HTTPGetRequest request = new HTTPGetRequest();
* request.begin();
@@ -124,22 +121,18 @@ import jdk.jfr.internal.Control;
* request.commit();
* }
* }
- *
- *
+ * }
*
+ * * The following example shows how an event can be filtered by assigning the * {@code "uriFilter"} setting with the specified regular expressions. * - *
- *
+ * {@literal
* Recording r = new Recording();
* r.enable("HTTPGetRequest").with("uriFilter", "https://www.example.com/list/.*");
* r.enable("HTTPPostRequest").with("uriFilter", "https://www.example.com/login/.*");
* r.start();
- *
- *
- *
- *
+ * }
*
* @see SettingDefinition
*
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java b/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java
index 849bf5de5a8..7eae00c1f3e 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/SettingDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,21 +41,19 @@ import java.lang.annotation.Target;
* * The following example shows how to annotate a method in an event class. * - *
- *
- * class HelloWorld extend Event {
+ * {@literal
+ * class HelloWorld extends Event {
*
- * {@literal @}Label("Message");
+ * @Label("Message")
* String message;
*
- * {@literal @}SettingDefinition;
- * {@literal @}Label("Message Filter");
+ * @SettingDefinition
+ * @Label("Message Filter")
* public boolean filter(RegExpControl regExp) {
* return regExp.matches(message);
* }
* }
- *
- *
+ * }
*
* For an example of how the setting controls are defined, see
* {@link SettingControl}.
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java b/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java
index bcf5b2a2677..7989306b375 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/Timespan.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -69,7 +69,7 @@ public @interface Timespan {
* * By default, the unit is nanoseconds. * - * @return the time span unit, default {@code #NANOSECONDS}, not {@code null} + * @return the time span unit, default {@link #NANOSECONDS}, not {@code null} */ String value() default NANOSECONDS; } diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java index eda0331ce23..c8789826016 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/EventStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,15 +87,14 @@ import jdk.jfr.internal.consumer.FileAccess; *
* If an unexpected exception occurs in an action, it is possible to catch the * exception in an error handler. An error handler can be registered using the - * {@link #onError(Runnable)} method. If no error handler is registered, the + * {@link #onError(Consumer)} method. If no error handler is registered, the * default behavior is to print the exception and its backtrace to the standard * error stream. *
* The following example shows how an {@code EventStream} can be used to listen * to events on a JVM running Flight Recorder * - *
- *
+ * {@literal
* try (var es = EventStream.openRepository()) {
* es.onEvent("jdk.CPULoad", event -> {
* System.out.println("CPU Load " + event.getEndTime());
@@ -113,8 +112,7 @@ import jdk.jfr.internal.consumer.FileAccess;
* });
* es.start();
* }
- *
- *
+ * }
* * To start recording together with the stream, see {@link RecordingStream}. * @@ -139,7 +137,7 @@ public interface EventStream extends AutoCloseable { */ public static EventStream openRepository() throws IOException { Utils.checkAccessFlightRecorder(); - return new EventDirectoryStream(AccessController.getContext(), null, SecuritySupport.PRIVILIGED, null); + return new EventDirectoryStream(AccessController.getContext(), null, SecuritySupport.PRIVILEGED, null); } /** @@ -162,7 +160,7 @@ public interface EventStream extends AutoCloseable { public static EventStream openRepository(Path directory) throws IOException { Objects.nonNull(directory); AccessControlContext acc = AccessController.getContext(); - return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILIGED, null); + return new EventDirectoryStream(acc, directory, FileAccess.UNPRIVILEGED, null); } /** @@ -213,7 +211,7 @@ public interface EventStream extends AutoCloseable { /** * Registers an action to perform if an exception occurs. *
- * if an action is not registered, an exception stack trace is printed to + * If an action is not registered, an exception stack trace is printed to * standard error. *
* Registering an action overrides the default behavior. If multiple actions @@ -273,7 +271,7 @@ public interface EventStream extends AutoCloseable { * Specifies that the event object in an {@link #onEvent(Consumer)} action * can be reused. *
- * If reuse is set to {@code true), an action should not keep a reference + * If reuse is set to {@code true}, an action should not keep a reference * to the event object after the action has completed. * * @param reuse {@code true} if an event object can be reused, {@code false} @@ -286,7 +284,7 @@ public interface EventStream extends AutoCloseable { * they were committed to the stream. * * @param ordered if event objects arrive in chronological order to - * {@code #onEvent(Consumer)} + * {@link #onEvent(Consumer)} */ void setOrdered(boolean ordered); @@ -321,22 +319,22 @@ public interface EventStream extends AutoCloseable { void setEndTime(Instant endTime); /** - * Start processing of actions. + * Starts processing of actions. *
* Actions are performed in the current thread. *
- * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. * * @throws IllegalStateException if the stream is already started or closed */ void start(); /** - * Start asynchronous processing of actions. + * Starts asynchronous processing of actions. *
* Actions are performed in a single separate thread. *
- * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. * * @throws IllegalStateException if the stream is already started or closed */ diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java index f82e7adb055..8d6b5647f2f 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClass.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ package jdk.jfr.consumer; -import java.lang.reflect.Modifier; - import jdk.jfr.internal.consumer.ObjectContext; /** @@ -45,12 +43,10 @@ public final class RecordedClass extends RecordedObject { /** * Returns the modifiers of the class. - *
- * See {@link java.lang.reflect.Modifier} * * @return the modifiers * - * @see Modifier + * @see java.lang.reflect.Modifier */ public int getModifiers() { return getTyped("modifiers", Integer.class, -1); @@ -58,7 +54,7 @@ public final class RecordedClass extends RecordedObject { /** * Returns the class loader that defined the class. - *
+ *
* If the bootstrap class loader is represented as {@code null} in the Java * Virtual Machine (JVM), then {@code null} is also the return value of this method. * diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java index d22818d2856..ab99b1d71b9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public final class RecordedClassLoader extends RecordedObject { /** * Returns the class of the class loader. - *
+ *
* If the bootstrap class loader is represented as {@code null} in the Java * Virtual Machine (JVM), then {@code null} is also the return value of this * method. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java index 0bd9232067d..a82b43ffc36 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedMethod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -72,13 +72,12 @@ public final class RecordedMethod extends RecordedObject { * Returns the method descriptor for this method (for example, * {@code "(Ljava/lang/String;)V"}). *
- * See Java Virtual Machine Specification, 4.3 - *
- * If this method doesn't belong to a Java frame then the the result is undefined. + * If this method doesn't belong to a Java frame then the result is undefined. * - * @return method descriptor. + * @return method descriptor * * @see RecordedFrame#isJavaFrame() + * @jvms 4.3 Descriptors */ public String getDescriptor() { return getTyped("descriptor", String.class, null); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java index 87fd16c8e68..07d9d4161cb 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -182,7 +182,7 @@ public class RecordedObject { * * @param name name of the field to get, not {@code null} * - * @return {@code true} if the field exists, {@code false} otherwise. + * @return {@code true} if the field exists, {@code false} otherwise * * @see #getFields() */ @@ -222,8 +222,7 @@ public class RecordedObject { *
* Example * - *
- *
+ * {@literal
* if (event.hasField("intValue")) {
* int intValue = event.getValue("intValue");
* System.out.println("Int value: " + intValue);
@@ -236,10 +235,9 @@ public class RecordedObject {
*
* if (event.hasField("sampledThread")) {
* RecordedThread sampledThread = event.getValue("sampledThread");
- * System.out.println("Sampled thread: " + sampledThread.getName());
+ * System.out.println("Sampled thread: " + sampledThread.getJavaName());
* }
- *
- *
+ * }
*
* @param * Returns {@code java.lang.Thread.getName()} if the thread has a Java * representation. {@code null} otherwise. diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java index d5ad5bc965a..1d4234e76a9 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordedThreadGroup.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ public final class RecordedThreadGroup extends RecordedObject { /** * Returns the parent thread group, or {@code null} if it doesn't exist. * - * @return parent thread group, or {@code null} if it doesn't exist. + * @return parent thread group, or {@code null} if it doesn't exist */ public RecordedThreadGroup getParent() { return getTyped("parent", RecordedThreadGroup.class, null); diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java index 96b7a8ac622..7d94a72281d 100644 --- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java +++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/RecordingFile.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,16 +48,14 @@ import jdk.jfr.internal.consumer.RecordingInput; *
* The following example shows how read and print all events in a recording file. * - *
- *
+ * {@literal
* try (RecordingFile recordingFile = new RecordingFile(Paths.get("recording.jfr"))) {
* while (recordingFile.hasMoreEvents()) {
* RecordedEvent event = recordingFile.readEvent();
* System.out.println(event);
* }
* }
- *
- *
+ * }
*
* @since 9
*/
@@ -83,7 +81,7 @@ public final class RecordingFile implements Closeable {
*/
public RecordingFile(Path file) throws IOException {
this.file = file.toFile();
- this.input = new RecordingInput(this.file, FileAccess.UNPRIVILIGED);
+ this.input = new RecordingInput(this.file, FileAccess.UNPRIVILEGED);
findNext();
}
@@ -93,7 +91,7 @@ public final class RecordingFile implements Closeable {
* @return the next event, not {@code null}
*
* @throws EOFException if no more events exist in the recording file
- * @throws IOException if an I/O error occurs.
+ * @throws IOException if an I/O error occurs
*
* @see #hasMoreEvents()
*/
@@ -136,7 +134,7 @@ public final class RecordingFile implements Closeable {
MetadataDescriptor previous = null;
List
- *
+ * {@literal
* Configuration c = Configuration.getConfiguration("default");
* try (var rs = new RecordingStream(c)) {
* rs.onEvent("jdk.GarbageCollection", System.out::println);
* rs.onEvent("jdk.CPULoad", System.out::println);
* rs.onEvent("jdk.JVMInformation", System.out::println);
* rs.start();
- * }
* }
- *
- *
+ * }
*
* @since 14
*/
@@ -88,7 +85,7 @@ public final class RecordingStream implements AutoCloseable, EventStream {
this.recording = new Recording();
try {
PlatformRecording pr = PrivateAccess.getInstance().getPlatformRecording(recording);
- this.directoryStream = new EventDirectoryStream(acc, null, SecuritySupport.PRIVILIGED, pr);
+ this.directoryStream = new EventDirectoryStream(acc, null, SecuritySupport.PRIVILEGED, pr);
} catch (IOException ioe) {
this.recording.close();
throw new IllegalStateException(ioe.getMessage());
@@ -101,15 +98,13 @@ public final class RecordingStream implements AutoCloseable, EventStream {
* The following example shows how to create a recording stream that uses a
* predefined configuration.
*
- *
- *
+ * {@literal
* var c = Configuration.getConfiguration("default");
* try (var rs = new RecordingStream(c)) {
* rs.onEvent(System.out::println);
* rs.start();
* }
- *
- *
+ * }
*
* @param configuration configuration that contains the settings to use,
* not {@code null}
@@ -152,19 +147,17 @@ public final class RecordingStream implements AutoCloseable, EventStream {
* The following example records 20 seconds using the "default" configuration
* and then changes settings to the "profile" configuration.
*
- *
- *
- * Configuration defaultConfiguration = Configuration.getConfiguration("default");
- * Configuration profileConfiguration = Configuration.getConfiguration("profile");
- * try (var rs = new RecordingStream(defaultConfiguration) {
- * rs.onEvent(System.out::println);
- * rs.startAsync();
- * Thread.sleep(20_000);
- * rs.setSettings(profileConfiguration.getSettings());
- * Thread.sleep(20_000);
- * }
- *
- *
+ * {@literal
+ * Configuration defaultConfiguration = Configuration.getConfiguration("default");
+ * Configuration profileConfiguration = Configuration.getConfiguration("profile");
+ * try (var rs = new RecordingStream(defaultConfiguration)) {
+ * rs.onEvent(System.out::println);
+ * rs.startAsync();
+ * Thread.sleep(20_000);
+ * rs.setSettings(profileConfiguration.getSettings());
+ * Thread.sleep(20_000);
+ * }
+ * }
*
* @param settings the settings to set, not {@code null}
*
@@ -330,17 +323,16 @@ public final class RecordingStream implements AutoCloseable, EventStream {
}
/**
- * Start asynchronous processing of actions.
+ * Starts asynchronous processing of actions.
* * Actions are performed in a single separate thread. *
- * To stop the stream, use the {@code #close()} method. + * To stop the stream, use the {@link #close()} method. *
* The following example prints the CPU usage for ten seconds. When * the current thread leaves the try-with-resources block the * stream is stopped/closed. - *
- *
+ * {@literal
* try (var stream = new RecordingStream()) {
* stream.enable("jdk.CPULoad").withPeriod(Duration.ofSeconds(1));
* stream.onEvent("jdk.CPULoad", event -> {
@@ -349,11 +341,9 @@ public final class RecordingStream implements AutoCloseable, EventStream {
* stream.startAsync();
* Thread.sleep(10_000);
* }
- *
- *
+ * }
*
* @throws IllegalStateException if the stream is already started or closed
- *
*/
@Override
public void startAsync() {
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java b/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java
index ba9b1e4833f..2ebde0891ca 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/consumer/package-info.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -27,8 +27,7 @@
* This package contains classes for consuming Flight Recorder data.
* * In the following example, the program prints a histogram of all method samples in a recording. - *
- *
+ * {@literal
* public static void main(String[] args) throws IOException {
* if (args.length != 1) {
* System.err.println("Must specify a recording file.");
@@ -50,8 +49,7 @@
* .sorted((a, b) -> b.getValue().compareTo(a.getValue()))
* .forEach(e -> System.out.printf("%8d %s\n", e.getValue(), e.getKey()));
* }
- *
- *
+ * }
* * Null-handling *
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java
index 3b24aec0bbf..39a53dfb03f 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/Control.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@ abstract public class Control {
return getValue();
} catch (Throwable t) {
// Prevent malicious user to propagate exception callback in the wrong context
- Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when trying to get value for " + getClass());
+ Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when trying to get value for " + getClass());
}
return defaultValue != null ? defaultValue : ""; // Need to return something
}
@@ -123,7 +123,7 @@ abstract public class Control {
try {
setValue(value);
} catch (Throwable t) {
- Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occured when setting value \"" + value + "\" for " + getClass());
+ Logger.log(LogTag.JFR_SETTING, LogLevel.WARN, "Exception occurred when setting value \"" + value + "\" for " + getClass());
}
} else {
AccessController.doPrivileged(new PrivilegedAction
* Example values, {@code "0 ns"}, {@code "10 ms"} and {@code "1 s"}. If the
- * events has an infinite timespan, the text {@code"infinity"} should be used.
+ * events has an infinite timespan, the text {@code "infinity"} should be used.
*
* @return the threshold, default {@code "0 ns"} not {@code null}
*/
- String value() default "inifity";
+ String value() default "infinity";
}
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java
index fa2e5bdae69..70effc2f01d 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventControl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -244,7 +244,7 @@ public final class EventControl {
private static Control defineCutoff(PlatformEventType type) {
Cutoff cutoff = type.getAnnotation(Cutoff.class);
- String def = Cutoff.INIFITY;
+ String def = Cutoff.INFINITY;
if (cutoff != null) {
def = cutoff.value();
}
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java
index 9b0d6f77678..4d6cfd41cbc 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventHandlerCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -56,7 +56,7 @@ final class EventHandlerCreator {
// with for example WLS.
private static final int CLASS_VERSION = 52;
- // This is needed so a new EventHandler is automatically generated in MetadataRespoistory
+ // This is needed so a new EventHandler is automatically generated in MetadataRepository
// if a user Event class is loaded using APPCDS/CDS.
private static final String SUFFIX = "_" + System.currentTimeMillis() + "-" + JVM.getJVM().getPid();
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java
index 758e5abe34c..961590cfa64 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/EventInstrumentation.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -320,7 +320,7 @@ public final class EventInstrumentation {
return result;
}
- public byte[] builUninstrumented() {
+ public byte[] buildUninstrumented() {
makeUninstrumented();
return toByteArray();
}
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
index c3f19358301..307346fbdc0 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVM.java
@@ -25,7 +25,6 @@
package jdk.jfr.internal;
-import java.io.IOException;
import java.util.List;
import jdk.internal.HotSpotIntrinsicCandidate;
@@ -283,7 +282,6 @@ public final class JVM {
*
* @param file the file where data should be written, or null if it should
* not be copied out (in memory).
- * @throws IOException
*/
public native void setOutput(String file);
@@ -362,8 +360,6 @@ public final class JVM {
* Requires that JFR has been started with {@link #createNativeJFR()}
*
* @param bytes binary representation of metadata descriptor
- *
- * @param binary representation of descriptor
*/
public native void storeMetadataDescriptor(byte[] bytes);
@@ -428,8 +424,8 @@ public final class JVM {
public native double getTimeConversionFactor();
/**
- * Return a unique identifier for a class. Compared to {@link #getClassId()}
- * , this method does not tag the class as being "in-use".
+ * Return a unique identifier for a class. Compared to {@link #getClassId(Class)},
+ * this method does not tag the class as being "in-use".
*
* @param clazz class
*
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java
index 9e8ce2e4de6..2e4e4c95a3f 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/JVMUpcalls.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -81,7 +81,7 @@ final class JVMUpcalls {
* Id of the class
* @param forceInstrumentation
* add instrumentation regardless if event is enabled or not.
- * @param superClazz
+ * @param superClass
* the super class of the class being processed
* @param oldBytes
* byte code
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java
index 831b4444c6d..833be1317a6 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -328,7 +328,7 @@ final class MetadataHandler extends DefaultHandler implements EntityResolver {
}
}
if (t.cutoff) {
- aes.add(new AnnotationElement(Cutoff.class, Cutoff.INIFITY));
+ aes.add(new AnnotationElement(Cutoff.class, Cutoff.INFINITY));
}
}
if (t.experimental) {
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java
index 4dd7545614d..5acefa6ec1f 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/MetadataRepository.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@ import jdk.jfr.internal.handlers.EventHandler;
public final class MetadataRepository {
private static final JVM jvm = JVM.getJVM();
- private static final MetadataRepository instace = new MetadataRepository();
+ private static final MetadataRepository instance = new MetadataRepository();
private final List
- * All operation using this path must happen in {@link #doPriviligedIO(Callable)}
+ * All operation using this path must happen in {@link #doPrivilegedIO(Callable)}
*/
public final class WriteableUserPath {
private final AccessControlContext controlContext;
@@ -120,7 +120,7 @@ public final class WriteableUserPath {
return real;
}
- public void doPriviligedIO(Callable> function) throws IOException {
+ public void doPrivilegedIO(Callable> function) throws IOException {
try {
inPrivileged = true;
AccessController.doPrivileged(new PrivilegedExceptionAction
* After an event class is defined, instances can be created (event objects).
* Data is stored in the event by assigning data to fields. Event timing can be
- * explicitly controlled by using the
* Gathering data to store in an event can be expensive. The
- * {@link Event#shouldCommit()} method can be used to verify whether an event
- * instance would actually be written to the system when the
- * {@code Event#commit()} method is invoked. If
- * {@link Event#shouldCommit()} returns {@code false}, then those operations can be
- * avoided.
+ * {@link jdk.jfr.Event#shouldCommit()} method can be used to verify whether
+ * an event instance would actually be written to the system when
+ * the {@link jdk.jfr.Event#commit()} method is invoked.
+ * If {@link jdk.jfr.Event#shouldCommit()} returns {@code false},
+ * then those operations can be avoided.
*
* Sometimes the field layout of an event is not known at compile time. In that
* case, an event can be dynamically defined. However, dynamic events might not
@@ -63,8 +63,8 @@
*
* Controlling Flight Recorder
*
- * Flight Recorder can be controlled locally by using the
* null to show a list of all recordings.
+ * {@code null} to show a list of all recordings.
*
* @param verbose if event settings should be included.
*
@@ -102,7 +102,7 @@ final class DCmdCheck extends AbstractDCmd {
printGeneral(recording);
if (verbose) {
println();
- printSetttings(recording);
+ printSettings(recording);
}
}
@@ -130,7 +130,7 @@ final class DCmdCheck extends AbstractDCmd {
println();
}
- private void printSetttings(Recording recording) {
+ private void printSettings(Recording recording) {
Mapnull to dump everything
+ * @param name name or id of the recording to dump, or {@code null} to dump everything
*
* @param filename file path where recording should be written, not null
* @param maxAge how far back in time to dump, may be null
@@ -114,7 +114,7 @@ final class DCmdDump extends AbstractDCmd {
if (beginTime != null && endTime != null) {
if (endTime.isBefore(beginTime)) {
- throw new DCmdException("Dump failed, begin must preceed end.");
+ throw new DCmdException("Dump failed, begin must precede end.");
}
}
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
index b858bfb6a8c..7d05bbe5fa9 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java
@@ -69,10 +69,10 @@ final class DCmdStart extends AbstractDCmd {
* @param disk if recording should be persisted to disk
* @param path file path where recording data should be written
* @param maxAge how long recording data should be kept in the disk
- * repository, or 0 if no limit should be set.
+ * repository, or {@code 0} if no limit should be set.
*
* @param maxSize the minimum amount data to keep in the disk repository
- * before it is discarded, or 0 if no limit should be
+ * before it is discarded, or {@code 0} if no limit should be
* set.
*
* @param dumpOnExit if recording should dump on exit
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
index 71490b1915a..90190829be6 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -44,12 +44,12 @@ final class DCmdStop extends AbstractDCmd {
/**
* Execute JFR.stop
*
- * Requires that either name or id is set.
+ * Requires that either {@code name} or {@code id} is set.
*
* @param name name or id of the recording to stop.
*
* @param filename file path where data should be written after recording has
- * been stopped, or null if recording shouldn't be written
+ * been stopped, or {@code null} if recording shouldn't be written
* to disk.
* @return result text
*
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java
index 79b72757d51..00ecd760967 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/handlers/EventHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,7 +64,7 @@ public abstract class EventHandler {
// Accessed by generated code in event class
// Accessed by generated sub class
public final boolean isEnabled() {
- return platformEventType.isCommitable();
+ return platformEventType.isCommittable();
}
public final EventType getEventType() {
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java
index 83cb63097cb..86245db7e08 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/JFC.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -109,7 +109,7 @@ public final class JFC {
* @throws IOException if the file can't be read
*
* @throws SecurityException if a security manager exists and its
- * checkRead method denies read access to the file.
+ * {@code checkRead} method denies read access to the file
* @see java.io.File#getPath()
* @see java.lang.SecurityManager#checkRead(java.lang.String)
*/
diff --git a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd
index ee47ba506eb..b09a5769c6f 100644
--- a/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd
+++ b/src/jdk.jfr/share/classes/jdk/jfr/internal/jfc/jfc.xsd
@@ -73,7 +73,7 @@
jdk.jfr package, or by using a user-defined
+ * available in the {@code jdk.jfr} package, or by using a user-defined
* annotation that has the {@link jdk.jfr.MetadataDefinition} annotation.
* begin and {@code end} methods
- * available in the Event class.
+ * explicitly controlled by using the {@code begin} and {@code end} methods
+ * available in the {@code Event} class.
* jcmd
- * command line tool or remotely by using the FlightRecorderMXBean
+ * Flight Recorder can be controlled locally by using the {@code jcmd}
+ * command line tool or remotely by using the {@code FlightRecorderMXBean}
* interface, registered in the platform MBeanServer. When direct programmatic
* access is needed, a Flight Recorder instance can be obtained by invoking
* {@link jdk.jfr.FlightRecorder#getFlightRecorder()} and a recording created by
@@ -168,7 +168,7 @@
*
*
* {@code stackTrace}
- * Specifies whether the stack trace from the {@code Event#commit()} method
+ * Specifies whether the stack trace from the {@link Event#commit()} method
* is recorded
* {@code "true"}
* String representation of a {@code Boolean} ({@code "true"} or
diff --git a/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java b/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java
index 9852935b35f..2be3bc03252 100644
--- a/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java
+++ b/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@ public class TestJcmdDumpLimited {
private static void testDumpEndBegin() throws Exception {
Path testEndBegin = Paths.get("testEndBegin.jfr");
OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + testEndBegin.toFile().getAbsolutePath(), "begin=" + Instant.now(), "end=" + Instant.now().minusSeconds(200));
- output.shouldContain("Dump failed, begin must preceed end.");
+ output.shouldContain("Dump failed, begin must precede end.");
assertMissingFile(testEndBegin);
}