You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/01/26 16:08:34 UTC
[2/3] syncope git commit: [SYNCOPE-158] Fixing error and warnings
[SYNCOPE-158] Fixing error and warnings
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/87140e64
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/87140e64
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/87140e64
Branch: refs/heads/master
Commit: 87140e648829c76cbb2283da603e766d5fab6960
Parents: f32528c
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Jan 26 16:07:56 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Jan 26 16:07:56 2015 +0100
----------------------------------------------------------------------
.../org/apache/syncope/cli/SyncopeServices.java | 18 +++++++++++-------
.../org/apache/syncope/cli/util/XmlUtils.java | 18 ++++++++++++++++++
2 files changed, 29 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/87140e64/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java b/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java
index 8ac0337..978b7df 100644
--- a/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java
+++ b/cli/src/main/java/org/apache/syncope/cli/SyncopeServices.java
@@ -24,18 +24,22 @@ import org.apache.syncope.client.SyncopeClientFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class SyncopeServices {
+public final class SyncopeServices {
private static final Logger LOG = LoggerFactory.getLogger(SyncopeServices.class);
- private final static ResourceBundle syncopeProperties = ResourceBundle.getBundle("syncope");
+ private final static ResourceBundle SYNCOPE_PROPS = ResourceBundle.getBundle("syncope");
- private static final SyncopeClient client = new SyncopeClientFactoryBean()
- .setAddress(syncopeProperties.getString("syncope.rest.services"))
- .create(syncopeProperties.getString("syncope.user"), syncopeProperties.getString("syncope.password"));
+ private static final SyncopeClient CLIENT = new SyncopeClientFactoryBean()
+ .setAddress(SYNCOPE_PROPS.getString("syncope.rest.services"))
+ .create(SYNCOPE_PROPS.getString("syncope.user"), SYNCOPE_PROPS.getString("syncope.password"));
- public static Object get(final Class claz) {
+ public static Object get(final Class<?> claz) {
LOG.debug("Creting service for {}", claz.getName());
- return client.getService(claz);
+ return CLIENT.getService(claz);
+ }
+
+ private SyncopeServices() {
+ // private constructor for static utility class
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/87140e64/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java
----------------------------------------------------------------------
diff --git a/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java b/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java
index 8da1fba..6a8b2e8 100644
--- a/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.java
+++ b/cli/src/main/java/org/apache/syncope/cli/util/XmlUtils.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 distributed 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.syncope.cli.util;
import java.io.File;