Skip to content

Commit

Permalink
all: remove JSR305 entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-mastrangelo committed Mar 18, 2023
1 parent bb07047 commit de299fd
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 41 deletions.
1 change: 0 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ maven_install(
artifacts = [
"junit:junit:4.13.2",
"com.google.errorprone:error_prone_annotations:2.7.1",
"com.google.code.findbugs:jsr305:3.0.2",
"com.google.truth:truth:1.1.3",
],
repositories = [
Expand Down
1 change: 0 additions & 1 deletion agent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ plugins {
val jdkVersion = JavaVersion.VERSION_1_6

dependencies {
compileOnly(libs.jsr305)
compileOnly(libs.errorprone)

implementation("org.ow2.asm:asm:9.1")
Expand Down
1 change: 0 additions & 1 deletion java15/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ val jmhAnnotationProcessor by configurations.getting {

dependencies {
implementation(project(":perfmark-impl"))
compileOnly(libs.jsr305)

testImplementation(project(":perfmark-api"))
testImplementation(project(":perfmark-testing"))
Expand Down
1 change: 0 additions & 1 deletion java19/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ val jmhAnnotationProcessor by configurations.getting {

dependencies {
implementation(project(":perfmark-impl"))
compileOnly(libs.jsr305)

testImplementation(project(":perfmark-api"))
testImplementation(project(":perfmark-testing"))
Expand Down
5 changes: 2 additions & 3 deletions java6/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,15 @@ sourceSets {
compileJmhJava {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
javaCompiler = javaToolchains.compilerFor({
javaCompiler.set(javaToolchains.compilerFor({
languageVersion = JavaLanguageVersion.of("17")
})
}))
options.errorprone.enabled = true
options.errorprone.excludedPaths.set(".*/build/generated/sources/annotationProcessor/.*")
}

dependencies {
implementation project(':perfmark-impl')
compileOnly libs.jsr305

testImplementation(project(":perfmark-api"))
testImplementation(project(':perfmark-testing'))
Expand Down
5 changes: 3 additions & 2 deletions java6/src/main/java/io/perfmark/java6/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

@javax.annotation.CheckReturnValue
@javax.annotation.ParametersAreNonnullByDefault
/**
* Java 6 based recorder and generator implementation.
*/
package io.perfmark.java6;
1 change: 0 additions & 1 deletion java7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ compileJmhJava {

dependencies {
implementation project(':perfmark-impl')
compileOnly libs.jsr305

jmhImplementation project(':perfmark-api'),
project(':perfmark-impl'),
Expand Down
5 changes: 3 additions & 2 deletions java7/src/main/java/io/perfmark/java7/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

@javax.annotation.CheckReturnValue
@javax.annotation.ParametersAreNonnullByDefault
/**
* Java 7 based generator
*/
package io.perfmark.java7;
2 changes: 1 addition & 1 deletion java9/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ val jmhAnnotationProcessor by configurations.getting {

dependencies {
implementation(project(":perfmark-impl"))
compileOnly(libs.jsr305)

testImplementation(project(":perfmark-api"))
testImplementation(project(":perfmark-testing"))

jcstressImplementation(project(":perfmark-impl"))

jmhImplementation(project(":perfmark-api"))
Expand Down
2 changes: 0 additions & 2 deletions java9/src/main/java/io/perfmark/java9/package-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@
*/

/** Java 9+ enabled generator and mark-holder. */
@javax.annotation.CheckReturnValue
@javax.annotation.ParametersAreNonnullByDefault
package io.perfmark.java9;
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencyResolutionManagement {
version("jmh", "1.36")

library("junit", "junit:junit:4.13.2")
library("jsr305", "com.google.code.findbugs:jsr305:3.0.2")
library("errorprone", "com.google.errorprone:error_prone_annotations:2.18.0")
library("truth", "com.google.truth:truth:1.1.3")

Expand Down
1 change: 0 additions & 1 deletion traceviewer/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ java_library(
visibility = ["//visibility:public"],
deps = [
"//tracewriter",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)
1 change: 0 additions & 1 deletion traceviewer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ description = "PerfMark Trace Viewer"
val jdkVersion = JavaVersion.VERSION_1_8

dependencies {
compileOnly(libs.jsr305)
compileOnly(libs.errorprone)
implementation(project(":perfmark-tracewriter"))
testImplementation(project(":perfmark-api"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;

import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.perfmark.tracewriter.TraceEventWriter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
Expand All @@ -33,7 +32,6 @@
import java.util.Base64;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;

/**
* This class converts from the Trace Event json data into a full HTML page. It includes the trace
Expand Down Expand Up @@ -76,7 +74,6 @@ public final class TraceEventViewer {
* @return the Path of the written file.
* @throws IOException if it can't write to the destination.
*/
@CanIgnoreReturnValue
public static Path writeTraceHtml() throws IOException {
Path path = Files.createTempFile("perfmark-trace-", ".html");
try (OutputStream os = Files.newOutputStream(path, TRUNCATE_EXISTING);
Expand Down Expand Up @@ -138,7 +135,7 @@ public static void writeTraceHtml(Writer writer) throws IOException {
* data as a top level text/plain script.
*/
private static String replaceIndexTraceImport(
String index, String replacement, @Nullable String inlineTraceData64) {
String index, String replacement, String inlineTraceData64) {
int start = index.indexOf("IO_PERFMARK_TRACE_IMPORT");
if (start == -1) {
throw new IllegalArgumentException("index doesn't contain IO_PERFMARK_TRACE_IMPORT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
* The Trace View package reads the PerfMark recorded tasks, and converts them into the
* Chrome Trace Viewer format, bundled into a self-contained HTML page.
*/
@javax.annotation.CheckReturnValue
@javax.annotation.ParametersAreNonnullByDefault
package io.perfmark.traceviewer;
1 change: 0 additions & 1 deletion tracewriter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ java_library(
"//impl:mark",
"//impl:mark-list",
"//impl:storage",
"@maven//:com_google_code_findbugs_jsr305",
"@maven//:com_google_errorprone_error_prone_annotations",
],
)
1 change: 0 additions & 1 deletion tracewriter/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies {
runtimeOnly(project(":perfmark-java6"))

implementation(project(":perfmark-api"))
compileOnly(libs.jsr305)
compileOnly(libs.errorprone)
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.14.2")
}
Expand Down
26 changes: 13 additions & 13 deletions tracewriter/src/main/java/io/perfmark/tracewriter/TraceEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;

@CheckReturnValue
final class TraceEvent implements Cloneable {

private TraceEvent() {}
Expand All @@ -42,31 +39,31 @@ private TraceEvent() {}
@SuppressWarnings("unused")
String name;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
String categories;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
Double traceClockMicros;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
Long pid;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
Long tid;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
Long id;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
TagMap args = null;

@Nullable
/** {@code Nullable} */
@SuppressWarnings("unused")
String colorName = null;

Expand Down Expand Up @@ -188,7 +185,8 @@ private TagMap(List<Entry<String, ?>> keyedValues, List<?> unkeyedValues) {
this.unkeyedValues = unkeyedValues;
}

TagMap withUnkeyed(@Nullable String tagName, long tagId) {
/** tagName is {@code Nullable} */
TagMap withUnkeyed(String tagName, long tagId) {
List<Object> unkeyedValues = null;
if (tagName != null && !Mark.NO_TAG_NAME.equals(tagName)) {
unkeyedValues = new ArrayList<>(this.unkeyedValues);
Expand All @@ -205,13 +203,15 @@ TagMap withUnkeyed(@Nullable String tagName, long tagId) {
}
}

TagMap withKeyed(@Nullable String tagName, Object tagValue) {
/** tagName is {@code Nullable} */
TagMap withKeyed(String tagName, Object tagValue) {
List<Entry<String, ?>> keyedValues = new ArrayList<>(this.keyedValues);
keyedValues.add(new SimpleImmutableEntry<>(String.valueOf(tagName), tagValue));
return new TagMap(Collections.unmodifiableList(keyedValues), unkeyedValues);
}

TagMap withKeyed(@Nullable String tagName, long tagValue0, long tagValue1) {
/** tagName is {@code Nullable} */
TagMap withKeyed(String tagName, long tagValue0, long tagValue1) {
List<Entry<String, ?>> keyedValues = new ArrayList<>(this.keyedValues);
keyedValues.add(
new SimpleImmutableEntry<>(String.valueOf(tagName), tagValue0 + ":" + tagValue1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
* The Trace Writer package reads the PerfMark recorded tasks, and converts them into the Chrome
* Trace Viewer format.
*/
@javax.annotation.CheckReturnValue
@javax.annotation.ParametersAreNonnullByDefault
package io.perfmark.tracewriter;

0 comments on commit de299fd

Please sign in to comment.