Skip to content

Commit

Permalink
Add spotbug excludes
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi committed Dec 21, 2023
1 parent 7a7df5b commit b8358fa
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ private DataHolder() {

}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static DataHolder getInstance() {

return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ private AnalyticsServiceReferenceHolder() {

}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static AnalyticsServiceReferenceHolder getInstance() {
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public void setApiRequestInfo(APIRequestInfoDTO apiRequestInfo) {
}

@Deprecated
@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR")
public X509Certificate[] getClientCerts() {
X509Certificate[] x509Certificates = new X509Certificate[clientCerts.length];
for (int i = 0; i < clientCerts.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ private ServiceReferenceHolder() {

}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static ServiceReferenceHolder getInstance() {

return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class ServiceReferenceHolder {
private APIManagerConfiguration apimConfiguration;
private EventProcessorService eventProcessorService;

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static ServiceReferenceHolder getInstance() {
return instance;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class ServiceReferenceHolder {
private ServiceReferenceHolder() {
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static ServiceReferenceHolder getInstance() {
return instance;
}
Expand All @@ -52,13 +51,11 @@ public void setAPIManagerConfigurationService(APIManagerConfigurationService amC
}
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static Map<String, OpenTracer> getOpenTracerMap() {

return openTracerMap;
}

@edu.umd.cs.findbugs.annotations.SuppressFBWarnings("MS_EXPOSE_REP")
public static Map<String, APIMOpenTelemetry> getOpenTelemetryTracerMap() {

return openTelemetryTracerMap;
Expand Down
65 changes: 64 additions & 1 deletion spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,72 @@
<FindBugsFilter>
<!-- false-positive. See details at https://github.com/spotbugs/spotbugs/issues/1601 -->

<Match>
<Class name="org.wso2.carbon.apimgt.cache.invalidation.internal.DataHolder"/>
<Bug pattern="MS_EXPOSE_REP, EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.tracing.internal.ServiceReferenceHolder"/>
<Bug pattern="MS_EXPOSE_REP, EI_EXPOSE_REP2, EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.gateway.dto.RequestContextDTO"/>
<Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.gateway.jwtgenerator.AbstractAPIMgtGatewayJWTGenerator"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP"/>
<Class name="org.wso2.carbon.apimgt.common.gateway.jwttransformer.DefaultJWTTransformer"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.analytics.publishers.dto.Event"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.analytics.AnalyticsServiceReferenceHolder"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_EXPOSE_REP"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.analytics.AnalyticsCommonConfiguration"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.common.analytics.publishers.impl.AnalyticsDataPublisher"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.notification.internal.ServiceReferenceHolder"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_EXPOSE_REP"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.notification.event.Event"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.notification.TokenRevocationNotifierImpl"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.throttle.policy.deployer.internal.ServiceReferenceHolder"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2, MS_EXPOSE_REP"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.cache.invalidation.APIMgtCacheInvalidationListener"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.wso2.carbon.apimgt.cache.invalidation.APIMgtCacheInvalidationRequestSender"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Package name="org.wso2.carbon.apimgt.common.gateway.dto.*"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Package name="org.wso2.carbon.apimgt.throttle.policy.deployer.dto.*"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>

0 comments on commit b8358fa

Please sign in to comment.