diff --git a/deploy/BUILD.bazel b/deploy/BUILD.bazel index 1567d999f..a89b914f1 100644 --- a/deploy/BUILD.bazel +++ b/deploy/BUILD.bazel @@ -40,7 +40,11 @@ java_export( pom_template = "//deploy:jazzer-api.pom", toolchains = [":jazzer_version"], visibility = ["//visibility:public"], - runtime_deps = ["//src/main/java/com/code_intelligence/jazzer/api"], + exports = [ + "//src/main/java/com/code_intelligence/jazzer/api", + "//src/main/java/com/code_intelligence/jazzer/mutation/annotation", + "//src/main/java/com/code_intelligence/jazzer/mutation/annotation/proto", + ], ) java_export( @@ -95,13 +99,16 @@ java_export( pom_template = "jazzer-junit.pom", toolchains = [":jazzer_version"], visibility = ["//visibility:public"], - runtime_deps = [ - # These deps' only effect is to include a dependency on the 'jazzer' and 'jazzer-api' Maven artifacts in the - # POM. - "//deploy:jazzer", + exports = [ + # Maven users should not need to depend on jazzer-api directly if they already directly depend on jazzer-junit, + # both for convenience and backwards compatibility. "//deploy:jazzer-api", "//src/main/java/com/code_intelligence/jazzer/junit", ], + runtime_deps = [ + # This dep's only effect is to include a dependency on the 'jazzer' Maven artifacts in the POM. + "//deploy:jazzer", + ], ) sh_test( diff --git a/deploy/jazzer-api_artifact_test.sh b/deploy/jazzer-api_artifact_test.sh index c1aabbc88..d1a60e608 100755 --- a/deploy/jazzer-api_artifact_test.sh +++ b/deploy/jazzer-api_artifact_test.sh @@ -27,6 +27,9 @@ JAR="$2/bin/jar" -e '^com/code_intelligence/$' \ -e '^com/code_intelligence/jazzer/$' \ -e '^com/code_intelligence/jazzer/api/' \ + -e '^com/code_intelligence/jazzer/mutation/$' \ + -e '^com/code_intelligence/jazzer/mutation/annotation/' \ + -e '^com/code_intelligence/jazzer/mutation/utils/' \ -e '^jaz/' \ -e '^META-INF/$' \ -e '^META-INF/MANIFEST.MF$' diff --git a/src/main/java/com/code_intelligence/jazzer/api/Autofuzz.java b/src/main/java/com/code_intelligence/jazzer/api/Autofuzz.java index ae525c6c5..ec30b7592 100644 --- a/src/main/java/com/code_intelligence/jazzer/api/Autofuzz.java +++ b/src/main/java/com/code_intelligence/jazzer/api/Autofuzz.java @@ -146,15 +146,15 @@ private Autofuzz() {} *
Note: This function is inherently heuristic and may fail to execute {@code func} in * meaningful ways for a number of reasons. * + *
May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Function1} with (partially) specified
* type variables, e.g. {@code (Function1 Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Function2} with (partially) specified
* type variables.
* @return the return value of {@code func}, or {@code null} if {@code autofuzz} failed to invoke
* the function.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
@SuppressWarnings("unchecked")
public static May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Function3} with (partially) specified
* type variables.
* @return the return value of {@code func}, or {@code null} if {@code autofuzz} failed to invoke
* the function.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
@SuppressWarnings("unchecked")
public static May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Function4} with (partially) specified
* type variables.
* @return the return value of {@code func}, or {@code null} if {@code autofuzz} failed to invoke
* the function.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
@SuppressWarnings("unchecked")
public static Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Function5} with (partially) specified
* type variables.
* @return the return value of {@code func}, or {@code null} if {@code autofuzz} failed to invoke
* the function.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
@SuppressWarnings("unchecked")
public static Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Consumer1} with explicitly specified
* type variable.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
public static Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Consumer2} with (partially) specified
* type variables.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
public static Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Consumer3} with (partially) specified
* type variables.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
public static May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Consumer4} with (partially) specified
* type variables.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
public static Note: This function is inherently heuristic and may fail to execute {@code func} in
* meaningful ways for a number of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param func a method reference for the function to autofuzz. If there are multiple overloads,
* resolve ambiguities by explicitly casting to {@link Consumer5} with (partially) specified
* type variables.
- * @throws Throwable any {@link Throwable} thrown by {@code func}, or an {@link
- * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
- * The {@link Throwable} is thrown unchecked.
*/
public static Note: This function is inherently heuristic and may fail to return meaningful values
* for a variety of reasons.
*
+ * May throw (unchecked) any {@link Throwable} thrown by {@code func} or an {@link
+ * AutofuzzConstructionException} if autofuzz failed to construct the arguments for the call.
+ *
* @param data the {@link FuzzedDataProvider} instance provided to {@code fuzzerTestOneInput}.
* @param type the {@link Class} to construct an instance of.
* @return an instance of {@code type} constructed from the fuzzer input, or {@code null} if
diff --git a/src/main/java/com/code_intelligence/jazzer/api/MethodHook.java b/src/main/java/com/code_intelligence/jazzer/api/MethodHook.java
index 0df33c20d..bb1a8a405 100644
--- a/src/main/java/com/code_intelligence/jazzer/api/MethodHook.java
+++ b/src/main/java/com/code_intelligence/jazzer/api/MethodHook.java
@@ -119,6 +119,8 @@
* reference a target method, no other types allowed. Attention must be paid to not
* guide the Fuzzer in different directions via {@link Jazzer}'s {@code guideTowardsXY}
* methods in the different hooks.
+ *
+ *
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
diff --git a/src/main/java/com/code_intelligence/jazzer/mutation/annotation/UrlSegment.java b/src/main/java/com/code_intelligence/jazzer/mutation/annotation/UrlSegment.java
index 6a938dd61..3cc8f04fd 100644
--- a/src/main/java/com/code_intelligence/jazzer/mutation/annotation/UrlSegment.java
+++ b/src/main/java/com/code_intelligence/jazzer/mutation/annotation/UrlSegment.java
@@ -27,8 +27,8 @@
/**
* An annotation that applies to {@link String} and limits the character set of the
* annotated type to valid URL segment characters, as described in RFC 3986, appendix A. Can be combined with
- * {@link WithUtf8Length} to limit the length of the generated string.
+ * href="https://www.ietf.org/rfc/rfc3986.txt">RFC 3986, appendix A.
+ * Can be combined with {@link WithUtf8Length} to limit the length of the generated string.
*/
@Target(TYPE_USE)
@Retention(RUNTIME)
diff --git a/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateContainerDimensions.java b/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateContainerDimensions.java
index 3b5ebe5c5..a67c44e5c 100644
--- a/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateContainerDimensions.java
+++ b/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateContainerDimensions.java
@@ -25,7 +25,7 @@
/**
* Meta-annotation intended to be used internally by Jazzer for container annotations with min and
* max fields. Annotations annotated with @ValidateContainerDimensions will be validated to ensure
- * that min and max are both >= 0, and that min <= max.
+ * that min and max are both {@code >= 0}, and that {@code min <= max}.
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
diff --git a/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateMinMax.java b/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateMinMax.java
index 3b3e4216c..69d4528d4 100644
--- a/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateMinMax.java
+++ b/src/main/java/com/code_intelligence/jazzer/mutation/utils/ValidateMinMax.java
@@ -24,7 +24,7 @@
/**
* Meta-annotation intended to be used internally by Jazzer for annotations that have min and max
- * fields. For all such annotations, Jazzer will assert that min <= max.
+ * fields. For all such annotations, Jazzer will assert that {@code min <= max}.
*/
@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)