AMBARI-22325. Fix RAT/checkstyle errors (adoroszlai)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7d2cc8e4 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7d2cc8e4 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7d2cc8e4 Branch: refs/heads/branch-feature-AMBARI-14714-blueprintv2 Commit: 7d2cc8e4c37ce22cda5b1e4934222f0196485016 Parents: 5a0d882 Author: Attila Doroszlai <adorosz...@hortonworks.com> Authored: Sat Nov 18 09:23:07 2017 +0100 Committer: Doroszlai, Attila <adorosz...@hortonworks.com> Committed: Fri Dec 8 20:24:25 2017 +0100 ---------------------------------------------------------------------- .../server/topology/BlueprintV2Factory.java | 2 +- .../ambari/server/topology/BlueprintV2Impl.java | 8 +++----- .../ambari/server/topology/Credential.java | 3 ++- .../topology/ProvisionClusterTemplate.java | 21 +++++++++++++++++++- .../ProvisionClusterTemplateFactory.java | 20 ++++++++++++++++++- .../topology/ProvisionClusterTemplateTest.java | 21 +++++++++++++++++++- 6 files changed, 65 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java index 8971399..6ce27ef 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Factory.java @@ -173,7 +173,7 @@ public class BlueprintV2Factory { } public boolean isPrettyPrintJson() { - return objectMapper.isEnabled(SerializationFeature.INDENT_OUTPUT);; + return objectMapper.isEnabled(SerializationFeature.INDENT_OUTPUT); } public void setPrettyPrintJson(boolean prettyPrintJson) { http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java index edab552..26bdfe2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/BlueprintV2Impl.java @@ -52,7 +52,7 @@ public class BlueprintV2Impl implements BlueprintV2 { private Collection<RepositoryVersion> repositoryVersions = new ArrayList<>(0); private Map<String, ServiceGroup> serviceGroups; private Setting setting; - private final Configuration configuration = new Configuration(new HashMap<>(), new HashMap<>());; + private final Configuration configuration = new Configuration(new HashMap<>(), new HashMap<>()); // Transient fields @JsonIgnore @@ -320,10 +320,8 @@ public class BlueprintV2Impl implements BlueprintV2 { @Override public boolean shouldSkipFailure() { - Optional<String> shouldSkipFailure = setting.getSettingValue( - Setting.SETTING_NAME_DEPLOYMENT_SETTINGS, - Setting.SETTING_NAME_SKIP_FAILURE); - return shouldSkipFailure.isPresent() ? shouldSkipFailure.get().equalsIgnoreCase("true") : false; + return setting.getSettingValue(Setting.SETTING_NAME_DEPLOYMENT_SETTINGS, Setting.SETTING_NAME_SKIP_FAILURE) + .map(Boolean::parseBoolean).orElse(false); } @Override http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/main/java/org/apache/ambari/server/topology/Credential.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/Credential.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/Credential.java index 25b9521..637cfe8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/Credential.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/Credential.java @@ -19,9 +19,10 @@ package org.apache.ambari.server.topology; +import org.apache.ambari.server.security.encryption.CredentialStoreType; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.ambari.server.security.encryption.CredentialStoreType; /** * Holds credential info submitted in a cluster create template. http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplate.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplate.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplate.java index 60f0fc2..5ef6517 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplate.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplate.java @@ -1,10 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distribut + * ed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.ambari.server.topology; import java.util.Collection; +import org.apache.ambari.server.controller.internal.ProvisionAction; + import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -import org.apache.ambari.server.controller.internal.ProvisionAction; public class ProvisionClusterTemplate { http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplateFactory.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplateFactory.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplateFactory.java index c66b6f6..c0c280f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplateFactory.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ProvisionClusterTemplateFactory.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distribut + * ed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.ambari.server.topology; import java.io.IOException; @@ -15,7 +33,7 @@ public class ProvisionClusterTemplateFactory { } public boolean isPrettyPrintJson() { - return objectMapper.isEnabled(SerializationFeature.INDENT_OUTPUT);; + return objectMapper.isEnabled(SerializationFeature.INDENT_OUTPUT); } public void setPrettyPrintJson(boolean prettyPrintJson) { http://git-wip-us.apache.org/repos/asf/ambari/blob/7d2cc8e4/ambari-server/src/test/java/org/apache/ambari/server/topology/ProvisionClusterTemplateTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/topology/ProvisionClusterTemplateTest.java b/ambari-server/src/test/java/org/apache/ambari/server/topology/ProvisionClusterTemplateTest.java index b9179b6..b02a00a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/topology/ProvisionClusterTemplateTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/topology/ProvisionClusterTemplateTest.java @@ -1,10 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distribut + * ed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.ambari.server.topology; import java.io.IOException; +import org.junit.Test; + import com.google.common.base.Charsets; import com.google.common.io.Resources; -import org.junit.Test; public class ProvisionClusterTemplateTest {