diff --git a/changelog/@unreleased/pr-699.v2.yml b/changelog/@unreleased/pr-699.v2.yml new file mode 100644 index 00000000..fb336458 --- /dev/null +++ b/changelog/@unreleased/pr-699.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: Allow annotations on type use (`List<@Safe String>`) + links: + - https://github.com/palantir/safe-logging/pull/699 diff --git a/safe-logging/src/main/java/com/palantir/logsafe/DoNotLog.java b/safe-logging/src/main/java/com/palantir/logsafe/DoNotLog.java index b7894cea..450e02a2 100644 --- a/safe-logging/src/main/java/com/palantir/logsafe/DoNotLog.java +++ b/safe-logging/src/main/java/com/palantir/logsafe/DoNotLog.java @@ -29,6 +29,13 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) +@Target({ + ElementType.TYPE, + ElementType.METHOD, + ElementType.PARAMETER, + ElementType.LOCAL_VARIABLE, + ElementType.FIELD, + ElementType.TYPE_USE +}) @Retention(RetentionPolicy.RUNTIME) public @interface DoNotLog {} diff --git a/safe-logging/src/main/java/com/palantir/logsafe/Safe.java b/safe-logging/src/main/java/com/palantir/logsafe/Safe.java index 079a6543..4a1cec75 100644 --- a/safe-logging/src/main/java/com/palantir/logsafe/Safe.java +++ b/safe-logging/src/main/java/com/palantir/logsafe/Safe.java @@ -58,6 +58,13 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) +@Target({ + ElementType.TYPE, + ElementType.METHOD, + ElementType.PARAMETER, + ElementType.LOCAL_VARIABLE, + ElementType.FIELD, + ElementType.TYPE_USE +}) @Retention(RetentionPolicy.RUNTIME) public @interface Safe {} diff --git a/safe-logging/src/main/java/com/palantir/logsafe/Unsafe.java b/safe-logging/src/main/java/com/palantir/logsafe/Unsafe.java index 5fbfa6c3..f7f96468 100644 --- a/safe-logging/src/main/java/com/palantir/logsafe/Unsafe.java +++ b/safe-logging/src/main/java/com/palantir/logsafe/Unsafe.java @@ -30,6 +30,13 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) +@Target({ + ElementType.TYPE, + ElementType.METHOD, + ElementType.PARAMETER, + ElementType.LOCAL_VARIABLE, + ElementType.FIELD, + ElementType.TYPE_USE +}) @Retention(RetentionPolicy.RUNTIME) public @interface Unsafe {}