HBASE-18315 Eliminate the findbugs warnings for hbase-rest
This commit is contained in:
parent
501176d40d
commit
18d29e4794
|
@ -125,9 +125,6 @@ public class RESTServer implements Constants {
|
||||||
static void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {
|
static void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {
|
||||||
restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);
|
restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);
|
||||||
if (restCSRFEnabled) {
|
if (restCSRFEnabled) {
|
||||||
Set<String> restCsrfMethodsToIgnore = new HashSet<>();
|
|
||||||
restCsrfMethodsToIgnore.addAll(getTrimmedStringList(conf,
|
|
||||||
REST_CSRF_METHODS_TO_IGNORE_KEY, REST_CSRF_METHODS_TO_IGNORE_DEFAULT));
|
|
||||||
Map<String, String> restCsrfParams = RestCsrfPreventionFilter
|
Map<String, String> restCsrfParams = RestCsrfPreventionFilter
|
||||||
.getFilterParams(conf, "hbase.rest-csrf.");
|
.getFilterParams(conf, "hbase.rest-csrf.");
|
||||||
FilterHolder holder = new FilterHolder();
|
FilterHolder holder = new FilterHolder();
|
||||||
|
|
|
@ -129,11 +129,11 @@ public class NamespacesInstanceModel implements Serializable, ProtobufMessageHan
|
||||||
sb.append(namespaceName);
|
sb.append(namespaceName);
|
||||||
sb.append("\'");
|
sb.append("\'");
|
||||||
if(properties != null){
|
if(properties != null){
|
||||||
for(String key: properties.keySet()){
|
for (Map.Entry<String, String> entry : properties.entrySet()) {
|
||||||
sb.append(", ");
|
sb.append(", ");
|
||||||
sb.append(key);
|
sb.append(entry.getKey());
|
||||||
sb.append(" => '");
|
sb.append(" => '");
|
||||||
sb.append(properties.get(key));
|
sb.append(entry.getValue());
|
||||||
sb.append("\'");
|
sb.append("\'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,10 +145,11 @@ public class NamespacesInstanceModel implements Serializable, ProtobufMessageHan
|
||||||
public byte[] createProtobufOutput() {
|
public byte[] createProtobufOutput() {
|
||||||
NamespaceProperties.Builder builder = NamespaceProperties.newBuilder();
|
NamespaceProperties.Builder builder = NamespaceProperties.newBuilder();
|
||||||
if(properties != null){
|
if(properties != null){
|
||||||
for(String key: properties.keySet()){
|
for (Map.Entry<String, String> entry : properties.entrySet()) {
|
||||||
|
String key = entry.getKey();
|
||||||
NamespaceProperties.Property.Builder property = NamespaceProperties.Property.newBuilder();
|
NamespaceProperties.Property.Builder property = NamespaceProperties.Property.newBuilder();
|
||||||
property.setKey(key);
|
property.setKey(key);
|
||||||
property.setValue(properties.get(key));
|
property.setValue(entry.getValue());
|
||||||
builder.addProps(property);
|
builder.addProps(property);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue