Skip to content

Commit bc84a06

Browse files
Marcono1234simonresch
authored andcommitted
docs: add Javadoc to mutation annotations
1 parent b7e9952 commit bc84a06

File tree

12 files changed

+95
-0
lines changed

12 files changed

+95
-0
lines changed

src/main/java/com/code_intelligence/jazzer/mutation/annotation/Ascii.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import java.lang.annotation.Retention;
2525
import java.lang.annotation.Target;
2626

27+
/**
28+
* Generates a {@code String} consisting only of ASCII characters (including control characters).
29+
*
30+
* @see WithUtf8Length
31+
*/
2732
@Target(TYPE_USE)
2833
@Retention(RUNTIME)
2934
@AppliesTo(String.class)

src/main/java/com/code_intelligence/jazzer/mutation/annotation/DoubleInRange.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,28 @@
2525
import java.lang.annotation.Retention;
2626
import java.lang.annotation.Target;
2727

28+
/**
29+
* Generates a {@code double} in the specified range.
30+
*/
2831
@Target(TYPE_USE)
2932
@Retention(RUNTIME)
3033
@AppliesTo({double.class, Double.class})
3134
@ValidateMinMax
3235
@PropertyConstraint
3336
public @interface DoubleInRange {
37+
/**
38+
* The minimum value of the range, inclusive.
39+
*/
3440
double min() default Double.NEGATIVE_INFINITY;
3541

42+
/**
43+
* The maximum value of the range, inclusive.
44+
*/
3645
double max() default Double.POSITIVE_INFINITY;
3746

47+
/**
48+
* Whether NaN is allowed to be generated.
49+
*/
3850
boolean allowNaN() default true;
3951

4052
/**

src/main/java/com/code_intelligence/jazzer/mutation/annotation/FloatInRange.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,28 @@
2525
import java.lang.annotation.Retention;
2626
import java.lang.annotation.Target;
2727

28+
/**
29+
* Generates a {@code float} in the specified range.
30+
*/
2831
@Target(TYPE_USE)
2932
@Retention(RUNTIME)
3033
@AppliesTo({float.class, Float.class})
3134
@ValidateMinMax
3235
@PropertyConstraint
3336
public @interface FloatInRange {
37+
/**
38+
* The minimum value of the range, inclusive.
39+
*/
3440
float min() default Float.NEGATIVE_INFINITY;
3541

42+
/**
43+
* The maximum value of the range, inclusive.
44+
*/
3645
float max() default Float.POSITIVE_INFINITY;
3746

47+
/**
48+
* Whether NaN is allowed to be generated.
49+
*/
3850
boolean allowNaN() default true;
3951

4052
/**

src/main/java/com/code_intelligence/jazzer/mutation/annotation/InRange.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
import java.lang.annotation.Retention;
2626
import java.lang.annotation.Target;
2727

28+
/**
29+
* Generates an integral number in the specified range.
30+
*
31+
* @see FloatInRange
32+
* @see DoubleInRange
33+
*/
2834
@Target(TYPE_USE)
2935
@Retention(RUNTIME)
3036
@AppliesTo({
@@ -40,8 +46,14 @@
4046
@ValidateMinMax
4147
@PropertyConstraint
4248
public @interface InRange {
49+
/**
50+
* The minimum value of the range, inclusive.
51+
*/
4352
long min() default Long.MIN_VALUE;
4453

54+
/**
55+
* The maximum value of the range, inclusive.
56+
*/
4557
long max() default Long.MAX_VALUE;
4658

4759
/**

src/main/java/com/code_intelligence/jazzer/mutation/annotation/Negative.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import java.lang.annotation.Retention;
2525
import java.lang.annotation.Target;
2626

27+
/**
28+
* Generates a negative number, that is, a number < 0.
29+
*
30+
* <p>For {@code float} and {@code double} this does not include -0.0 or NaN.
31+
*/
2732
@Target(TYPE_USE)
2833
@Retention(RUNTIME)
2934
@AppliesTo({

src/main/java/com/code_intelligence/jazzer/mutation/annotation/NonNegative.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import java.lang.annotation.Retention;
2525
import java.lang.annotation.Target;
2626

27+
/**
28+
* Generates a non-negative number, that is, a number >= 0.
29+
*
30+
* <p>For {@code float} and {@code double} this does not include NaN.
31+
*/
2732
@Target(TYPE_USE)
2833
@Retention(RUNTIME)
2934
@AppliesTo({

src/main/java/com/code_intelligence/jazzer/mutation/annotation/NonPositive.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import java.lang.annotation.Retention;
2525
import java.lang.annotation.Target;
2626

27+
/**
28+
* Generates a non-positive number, that is, a number <= 0.
29+
*
30+
* <p>For {@code float} and {@code double} this does not include NaN.
31+
*/
2732
@Target(TYPE_USE)
2833
@Retention(RUNTIME)
2934
@AppliesTo({

src/main/java/com/code_intelligence/jazzer/mutation/annotation/NotNull.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
import java.lang.annotation.Retention;
2626
import java.lang.annotation.Target;
2727

28+
/**
29+
* Generates a not-{@code null} value. By default the mutation framework can generate {@code null} for objects
30+
* (including arrays).
31+
*/
2832
@Target({PARAMETER, TYPE_USE})
2933
@Retention(RUNTIME)
3034
@AppliesTo(subClassesOf = Object.class)

src/main/java/com/code_intelligence/jazzer/mutation/annotation/Positive.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
import java.lang.annotation.Retention;
2525
import java.lang.annotation.Target;
2626

27+
/**
28+
* Generates a positive number, that is, a number > 0.
29+
*
30+
* <p>For {@code float} and {@code double} this does not include NaN.
31+
*/
2732
@Target(TYPE_USE)
2833
@Retention(RUNTIME)
2934
@AppliesTo({

src/main/java/com/code_intelligence/jazzer/mutation/annotation/WithLength.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
import java.lang.annotation.Retention;
2626
import java.lang.annotation.Target;
2727

28+
/**
29+
* Generates an array of the specified length.
30+
*
31+
* @see WithSize
32+
* @see WithUtf8Length
33+
*/
2834
@Target(TYPE_USE)
2935
@Retention(RUNTIME)
3036
@AppliesTo(
@@ -42,8 +48,14 @@
4248
@ValidateContainerDimensions
4349
@PropertyConstraint
4450
public @interface WithLength {
51+
/**
52+
* The minimum length, inclusive.
53+
*/
4554
int min() default 0;
4655

56+
/**
57+
* The maximum length, inclusive.
58+
*/
4759
int max() default 1000;
4860

4961
/**

0 commit comments

Comments
 (0)