del warnings spotbugs-annotations #981

This commit is contained in:
xuechaos 2019-04-01 21:16:14 +08:00
parent adcc955563
commit 178b80ea41
13 changed files with 0 additions and 54 deletions

View File

@ -94,12 +94,6 @@
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -29,7 +29,6 @@ import com.alibaba.nacos.client.monitor.MetricsMonitor;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
import com.alibaba.nacos.client.utils.StringUtils;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.slf4j.Logger;
import java.io.File;
@ -102,7 +101,6 @@ public class ClientWorker {
}
}
@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
void removeCache(String dataId, String group) {
String groupKey = GroupKey.getKey(dataId, group);
synchronized (cacheMap) {
@ -115,7 +113,6 @@ public class ClientWorker {
MetricsMonitor.getListenConfigCountMonitor().set(cacheMap.get().size());
}
@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
void removeCache(String dataId, String group, String tenant) {
String groupKey = GroupKey.getKeyTenant(dataId, group, tenant);
synchronized (cacheMap) {
@ -128,7 +125,6 @@ public class ClientWorker {
MetricsMonitor.getListenConfigCountMonitor().set(cacheMap.get().size());
}
@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
public CacheData addCacheDataIfAbsent(String dataId, String group) {
CacheData cache = getCache(dataId, group);
if (null != cache) {
@ -163,7 +159,6 @@ public class ClientWorker {
return cache;
}
@SuppressFBWarnings("JLM_JSR166_UTILCONCURRENT_MONITORENTER")
public CacheData addCacheDataIfAbsent(String dataId, String group, String tenant) {
CacheData cache = getCache(dataId, group, tenant);
if (null != cache) {

View File

@ -21,7 +21,6 @@ import com.alibaba.nacos.client.config.impl.EventDispatcher.ServerlistChangeEven
import com.alibaba.nacos.client.config.impl.HttpSimpleClient.HttpResult;
import com.alibaba.nacos.client.config.utils.IOUtils;
import com.alibaba.nacos.client.utils.*;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.slf4j.Logger;
import java.io.IOException;
@ -396,7 +395,6 @@ class ServerAddressIterator implements Iterator<String> {
}
@Override
@SuppressFBWarnings("EQ_COMPARETO_USE_OBJECT_EQUALS")
public int compareTo(RandomizedServerAddress other) {
if (this.priority != other.priority) {
return other.priority - this.priority;

View File

@ -25,7 +25,6 @@ import com.alibaba.nacos.client.naming.cache.DiskCache;
import com.alibaba.nacos.client.naming.net.NamingProxy;
import com.alibaba.nacos.client.naming.utils.StringUtils;
import com.alibaba.nacos.client.naming.utils.UtilAndComs;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.*;
import java.util.concurrent.*;
@ -267,7 +266,6 @@ public class HostReactor {
}
}
@SuppressFBWarnings("NN_NAKED_NOTIFY")
public void updateServiceNow(String serviceName, String clusters) {
ServiceInfo oldService = getSerivceInfo0(serviceName, clusters);
try {

View File

@ -15,7 +15,6 @@
*/
package com.alibaba.nacos.client.naming.utils;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.*;
import java.nio.channels.FileChannel;
@ -163,7 +162,6 @@ public class IoUtils {
}
}
@SuppressFBWarnings("BIT_IOR_OF_SIGNED_BYTE")
public static boolean isGzipStream(byte[] bytes) {
int minByteArraySize = 2;

View File

@ -112,10 +112,6 @@
<artifactId>jcip-annotations</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>

View File

@ -60,8 +60,6 @@ import com.alibaba.nacos.config.server.utils.PaginationHelper;
import com.alibaba.nacos.config.server.utils.event.EventDispatcher;
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* 数据库服务提供ConfigInfo在数据库的存取<br> 3.0开始增加数据版本号, 并将物理删除改为逻辑删除<br> 3.0增加数据库切换功能
*
@ -2639,9 +2637,6 @@ public class PersistService {
try {
jt.update(new PreparedStatementCreator() {
@SuppressFBWarnings(value = {"OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
"SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"},
justification = "findbugs does not trust jdbctemplate, sql is constant in practice")
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, configInfo.getDataId());

View File

@ -22,7 +22,6 @@ import com.alibaba.nacos.config.server.service.DynamicDataSource;
import com.alibaba.nacos.config.server.utils.PropertyUtil;
import com.alibaba.nacos.config.server.utils.TimeUtils;
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.CannotGetJdbcConnectionException;
import org.springframework.jdbc.core.JdbcTemplate;
@ -128,9 +127,6 @@ public class GroupCapacityPersistService {
GeneratedKeyHolder generatedKeyHolder = new GeneratedKeyHolder();
PreparedStatementCreator preparedStatementCreator = new PreparedStatementCreator() {
@Override
@SuppressFBWarnings(value = {"OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
"SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"},
justification = "findbugs does not trust jdbctemplate, sql is constant in practice")
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
String group = capacity.getGroup();
@ -306,9 +302,6 @@ public class GroupCapacityPersistService {
try {
PreparedStatementCreator preparedStatementCreator = new PreparedStatementCreator() {
@Override
@SuppressFBWarnings(value = {"OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
"SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"},
justification = "findbugs does not trust jdbctemplate, sql is constant in practice")
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(
"DELETE FROM group_capacity WHERE group_id = ?;");

View File

@ -21,7 +21,6 @@ import com.alibaba.nacos.config.server.service.DynamicDataSource;
import com.alibaba.nacos.config.server.utils.PropertyUtil;
import com.alibaba.nacos.config.server.utils.TimeUtils;
import com.google.common.collect.Lists;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.CannotGetJdbcConnectionException;
import org.springframework.jdbc.core.JdbcTemplate;
@ -96,9 +95,6 @@ public class TenantCapacityPersistService {
GeneratedKeyHolder generatedKeyHolder = new GeneratedKeyHolder();
PreparedStatementCreator preparedStatementCreator = new PreparedStatementCreator() {
@Override
@SuppressFBWarnings(value = {"OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
"SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"},
justification = "findbugs does not trust jdbctemplate, sql is constant in practice")
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
String tenant = tenantCapacity.getTenant();
@ -257,9 +253,6 @@ public class TenantCapacityPersistService {
try {
PreparedStatementCreator preparedStatementCreator = new PreparedStatementCreator() {
@Override
@SuppressFBWarnings(value = {"OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
"SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING"},
justification = "findbugs does not trust jdbctemplate, sql is constant in practice")
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(
"DELETE FROM tenant_capacity WHERE tenant_id = ?;");

View File

@ -150,10 +150,6 @@
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-cmdb</artifactId>

View File

@ -17,7 +17,6 @@ package com.alibaba.nacos.naming.boot;
import com.alibaba.nacos.naming.misc.Loggers;
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.context.WebServerInitializedEvent;
@ -39,7 +38,6 @@ public class RunningConfig implements ApplicationListener<WebServerInitializedEv
@Autowired
private ServletContext servletContext;
@SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
@Override
public void onApplicationEvent(WebServerInitializedEvent event) {

View File

@ -22,7 +22,6 @@ import com.alibaba.nacos.naming.misc.HttpClient;
import com.alibaba.nacos.naming.misc.Loggers;
import com.alibaba.nacos.naming.misc.SwitchDomain;
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -57,7 +56,6 @@ public class DistroFilter implements Filter {
}
@SuppressFBWarnings("HRS_REQUEST_PARAMETER_TO_HTTP_HEADER")
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) servletRequest;

View File

@ -691,12 +691,6 @@
<version>1.9.10</version>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>