From d62aa092b0cb37bd5f4a1b55464a5622623a7553 Mon Sep 17 00:00:00 2001 From: Connie Date: Fri, 22 Feb 2019 23:20:41 -0800 Subject: [PATCH 1/7] Adding suppression for having named static inner classes from anonymous. --- .../src/main/resources/spotbugs/spotbugs-exclude.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 906a06dd54c6..541b59812dee 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1,6 +1,13 @@ + + + + + + From ed2e0ca9b706bcfbe4b9a825727d9034580458d1 Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 12:43:27 -0800 Subject: [PATCH 2/7] Add suppression for redundant null check. --- .../src/main/resources/spotbugs/spotbugs-exclude.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 541b59812dee..7c1a1ca48700 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -68,4 +68,11 @@ + + + + + + \ No newline at end of file From 3d4d850c876befb7373411cffecb35d3f958952c Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 12:44:28 -0800 Subject: [PATCH 3/7] Move SIC_INNER_SHOULD_BE_STATIC suppression --- .../main/resources/spotbugs/spotbugs-exclude.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 7c1a1ca48700..1e4eee05cf5e 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1,13 +1,6 @@ - - - - - - @@ -48,6 +41,13 @@ + + + + + + From d491002794b726ffa2fb9c88db6d341f5ebb4b8b Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 12:45:24 -0800 Subject: [PATCH 4/7] Move RCN suppression --- .../main/resources/spotbugs/spotbugs-exclude.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 1e4eee05cf5e..634c1925efdc 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -33,6 +33,13 @@ + + + + + + @@ -68,11 +75,4 @@ - - - - - - \ No newline at end of file From 6ce23e570dab91843a7554b9b65724174cbd411d Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 12:58:29 -0800 Subject: [PATCH 5/7] Make anonymous class in CachingKeyResolver a named inner static. --- .../extensions/CachingKeyResolver.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java index 5a6afb43c2ea..a0d3a66bd7f2 100644 --- a/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java +++ b/keyvault/data-plane/azure-keyvault-extensions/src/main/java/com/microsoft/azure/keyvault/extensions/CachingKeyResolver.java @@ -28,13 +28,7 @@ public class CachingKeyResolver implements IKeyResolver { public CachingKeyResolver(int capacity, final IKeyResolver keyResolver) { this.keyResolver = keyResolver; cache = CacheBuilder.newBuilder().maximumSize(capacity) - .build(new CacheLoader>() { - - @Override - public ListenableFuture load(String kid) { - return keyResolver.resolveKeyAsync(kid); - } - }); + .build(new CachingKeyResolverCacheLoader(keyResolver)); } @Override @@ -58,4 +52,18 @@ public void run() { return cache.getUnchecked(kid); } } + + private static class CachingKeyResolverCacheLoader extends CacheLoader> { + + private final IKeyResolver keyResolver; + + CachingKeyResolverCacheLoader(IKeyResolver keyResolver) { + this.keyResolver = keyResolver; + } + + @Override + public ListenableFuture load(String kid) { + return keyResolver.resolveKeyAsync(kid); + } + } } From 708d2919c942ff3247f1fbae2e93a1d435104c72 Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 13:43:40 -0800 Subject: [PATCH 6/7] Include missing impl classes for auto-rest when it generates a variable with known null value --- .../src/main/resources/spotbugs/spotbugs-exclude.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 634c1925efdc..9f20c379a88b 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -72,7 +72,7 @@ - + \ No newline at end of file From c9a44bef53bd666b3727d7ef5977d27781b2d334 Mon Sep 17 00:00:00 2001 From: Connie Date: Tue, 26 Feb 2019 17:35:09 -0800 Subject: [PATCH 7/7] Suppressing unconfirmed casts because we know the cast is correct but the APIs weren't designed for it --- .../src/main/resources/spotbugs/spotbugs-exclude.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml index 9f20c379a88b..3560ab12958a 100755 --- a/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml +++ b/eng/code-quality-reports/src/main/resources/spotbugs/spotbugs-exclude.xml @@ -1,6 +1,12 @@ + + + + + +