HBASE-18315 Eliminate the findbugs warnings for hbase-rest

This commit is contained in:
Chia-Ping Tsai 2017-08-08 10:47:15 +08:00
parent 501176d40d
commit 18d29e4794
2 changed files with 6 additions and 8 deletions

View File

@ -125,9 +125,6 @@ public class RESTServer implements Constants {
static void addCSRFFilter(ServletContextHandler ctxHandler, Configuration conf) {
restCSRFEnabled = conf.getBoolean(REST_CSRF_ENABLED_KEY, REST_CSRF_ENABLED_DEFAULT);
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
.getFilterParams(conf, "hbase.rest-csrf.");
FilterHolder holder = new FilterHolder();

View File

@ -129,11 +129,11 @@ public class NamespacesInstanceModel implements Serializable, ProtobufMessageHan
sb.append(namespaceName);
sb.append("\'");
if(properties != null){
for(String key: properties.keySet()){
for (Map.Entry<String, String> entry : properties.entrySet()) {
sb.append(", ");
sb.append(key);
sb.append(entry.getKey());
sb.append(" => '");
sb.append(properties.get(key));
sb.append(entry.getValue());
sb.append("\'");
}
}
@ -145,10 +145,11 @@ public class NamespacesInstanceModel implements Serializable, ProtobufMessageHan
public byte[] createProtobufOutput() {
NamespaceProperties.Builder builder = NamespaceProperties.newBuilder();
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();
property.setKey(key);
property.setValue(properties.get(key));
property.setValue(entry.getValue());
builder.addProps(property);
}
}