From 042b590c9e8745e334258d6f9e7086741c0003fd Mon Sep 17 00:00:00 2001
From: Nils Christian Ehmke <nie@informatik.uni-kiel.de>
Date: Sat, 28 Jul 2012 14:30:58 +0200
Subject: [PATCH] Modifications for quality reasons.

---
 .../kieker/webgui/beans/IProjectBean.java     | 43 +++++++++++++++++++
 .../webgui/beans/application/ForwardBean.java | 20 +++++++++
 .../session/CurrentCockpitEditorBean.java     |  6 ++-
 3 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java
index dfdcc0f1..c45c5ff2 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/IProjectBean.java
@@ -1,11 +1,54 @@
+/***************************************************************************
+ * Copyright 2012 by
+ *  + Christian-Albrechts-University of Kiel
+ *    + Department of Computer Science
+ *      + Software Engineering Group 
+ *  and others.
+ *
+ * Licensed 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 kieker.webgui.beans;
 
+/**
+ * This is the interface for beans which can be used to navigate from one page to another.
+ * 
+ * @author Nils Christian Ehmke
+ * @version 1.0
+ */
 public interface IProjectBean {
 
+	/**
+	 * This method should clear the bean.
+	 * 
+	 * @return The next page.
+	 */
 	public String clearProject();
 
+	/**
+	 * This method should deliver the current project name within the bean.
+	 * 
+	 * @return The project name.
+	 */
 	public String getProjectName();
 
+	/**
+	 * This method should set the new project of the bean.
+	 * 
+	 * @param name
+	 *            The new project name.
+	 * @return The next page.
+	 */
 	public String setProject(final String name);
 
 }
diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java
index ae88e99b..1d08384c 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ForwardBean.java
@@ -1,3 +1,23 @@
+/***************************************************************************
+ * Copyright 2012 by
+ *  + Christian-Albrechts-University of Kiel
+ *    + Department of Computer Science
+ *      + Software Engineering Group 
+ *  and others.
+ *
+ * Licensed 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 kieker.webgui.beans.application;
 
 import javax.faces.bean.ApplicationScoped;
diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java
index 69252c59..a5c8f53e 100644
--- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java
+++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentCockpitEditorBean.java
@@ -344,8 +344,10 @@ public class CurrentCockpitEditorBean implements IProjectBean {
 	 */
 	public void validateDisplayConnectorName(final FacesContext context, final UIComponent toValidate, final Object value) {
 		synchronized (this) {
-			final boolean nameExists = this.existsDisplayConnectorName((String) value);
-			((UIInput) toValidate).setValid(!nameExists);
+			if ((value instanceof String) && (toValidate instanceof UIInput)) {
+				final boolean nameExists = this.existsDisplayConnectorName((String) value);
+				((UIInput) toValidate).setValid(!nameExists);
+			}
 		}
 	}
 
-- 
GitLab