You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by bu...@apache.org on 2017/08/09 05:51:37 UTC
[21/27] hbase git commit: HBASE-18315 Eliminate the findbugs warnings
for hbase-rest
HBASE-18315 Eliminate the findbugs warnings for hbase-rest
Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/4376233e
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/4376233e
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/4376233e
Branch: refs/heads/HBASE-18467
Commit: 4376233e2a7456da752ed1a88ad091163b7dc536
Parents: 7e7461e
Author: Chia-Ping Tsai <ch...@gmail.com>
Authored: Tue Aug 8 10:47:36 2017 +0800
Committer: Chia-Ping Tsai <ch...@gmail.com>
Committed: Tue Aug 8 10:47:36 2017 +0800
----------------------------------------------------------------------
.../java/org/apache/hadoop/hbase/rest/RESTServer.java | 3 ---
.../hadoop/hbase/rest/model/NamespacesInstanceModel.java | 11 ++++++-----
2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/4376233e/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
index 5c43287..eb3fc26 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
@@ -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();
http://git-wip-us.apache.org/repos/asf/hbase/blob/4376233e/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java
----------------------------------------------------------------------
diff --git a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java
index bcc1581..b18fd63 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/model/NamespacesInstanceModel.java
@@ -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);
}
}