diff --git a/changelog/@unreleased/pr-682.v2.yml b/changelog/@unreleased/pr-682.v2.yml new file mode 100644 index 00000000..32b5541c --- /dev/null +++ b/changelog/@unreleased/pr-682.v2.yml @@ -0,0 +1,5 @@ +type: improvement +improvement: + description: safe-logging annotations may be applied to fields and variables + links: + - https://github.com/palantir/safe-logging/pull/682 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 39bfb0da..b7894cea 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,6 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER}) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) @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 154d31fe..079a6543 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,6 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER}) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) @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 1c62f371..5fbfa6c3 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,6 @@ */ @Documented @Inherited -@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER}) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER, ElementType.LOCAL_VARIABLE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface Unsafe {}