del warnings spotbugs-annotations #981
This commit is contained in:
parent
adcc955563
commit
178b80ea41
@ -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>
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
@ -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());
|
||||
|
@ -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 = ?;");
|
||||
|
@ -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 = ?;");
|
||||
|
@ -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>
|
||||
|
@ -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) {
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user