Skip to content
Snippets Groups Projects
Commit 72281146 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Some minor quality modifications

parent 8cd5592f
No related branches found
No related tags found
No related merge requests found
......@@ -11,12 +11,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
......
......
#FindBugs User Preferences
#Wed Jul 11 22:19:24 CEST 2012
#Sat Jul 21 23:42:58 CEST 2012
cloud_id=edu.umd.cs.findbugs.cloud.doNothingCloud
detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true
detectorAtomicityProblem=AtomicityProblem|true
......@@ -81,6 +81,7 @@ detectorInfiniteLoop=InfiniteLoop|true
detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true
detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true
detectorInitializationChain=InitializationChain|true
detectorInitializeNonnullFieldsInConstructor=InitializeNonnullFieldsInConstructor|true
detectorInstantiateStaticClass=InstantiateStaticClass|true
detectorIntCast2LongAsInstant=IntCast2LongAsInstant|true
detectorInvalidJUnitTest=InvalidJUnitTest|true
......
......
......@@ -743,20 +743,6 @@
<property name="tokens" value="LAND, BAND, LOR, BOR, BXOR"/>
</module>
<!-- This metric measures the number of instantiations of other classes within the given class. !-->
<!-- See http://checkstyle.sf.net/config_metrics.html !-->
<module name="ClassDataAbstractionCoupling">
<property name="severity" value="info"/>
<property name="max" value="7"/>
</module>
<!-- The number of other classes a given class relies on. !-->
<!-- See http://checkstyle.sf.net/config_metrics.html !-->
<module name="ClassFanOutComplexity">
<property name="severity" value="info"/>
<property name="max" value="20"/>
</module>
<!-- Checks cyclomatic complexity against a specified limit. !-->
<!-- See http://checkstyle.sf.net/config_metrics.html !-->
<module name="CyclomaticComplexity">
......
......
......@@ -264,7 +264,7 @@
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>config/quality-config/cs-conf.xml</configLocation>
<configLocation>${project.basedir}/config/quality-config/cs-conf.xml</configLocation>
</configuration>
<executions>
<execution>
......@@ -282,7 +282,7 @@
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<excludeFilterFile>config/quality-config/fb-filter.xml</excludeFilterFile>
<excludeFilterFile>${project.basedir}/config/quality-config/fb-filter.xml</excludeFilterFile>
</configuration>
<executions>
<execution>
......@@ -299,9 +299,7 @@
<version>2.7.1</version>
<configuration>
<rulesets>
<ruleset>
config/quality-config/pmdrules.xml
</ruleset>
<ruleset>${project.basedir}/config/quality-config/pmdrules.xml</ruleset>
</rulesets>
<targetJdk>1.6</targetJdk>
</configuration>
......
......
......@@ -28,10 +28,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
......@@ -178,8 +176,6 @@ public final class CurrentAnalysisEditorBean {
/**
* This method sets the project stored within this bean and returns the new page for the navigation - depending on the given values.
*
* @param newProject
* The project to be stored within this bean.
* @param newName
* The name of the project.
* @return The name of the page for the project work space, if the project has been accepted, '' if it is null.
......@@ -215,7 +211,13 @@ public final class CurrentAnalysisEditorBean {
}
}
/**
* Assembles and returns the available components as a primefaces tree. Keep in mind that the tree is currently assembled every time this method is called.
*
* @return The tree with all available filters, readers and repositories.
*/
public TreeNode getAvailableComponentsAsRoot() {
synchronized (this) {
// Create the necessary roots
final TreeNode root = new DefaultTreeNode("Root", null);
final TreeNode readerRoot = new DefaultTreeNode("Reader", root);
......@@ -229,9 +231,20 @@ public final class CurrentAnalysisEditorBean {
return root;
}
}
/**
* This method is used to "assemble" the tree containing the available components based on the given parameters.
*
* @param root
* The root-node used for the tree.
* @param clazzList
* The list of available classes which will be used to fill the tree.
* @param leafName
* The typename of the leaf-nodes.
*/
private static void assembleTree(final TreeNode root, final List<Class<?>> clazzList, final String leafName) {
final HashMap<String, TreeNode> map = new HashMap<String, TreeNode>();
final Map<String, TreeNode> map = new HashMap<String, TreeNode>(); // NOPMD (No concurrent access)
for (final Class<?> clazz : clazzList) {
// Get the single components of the class name
......@@ -313,7 +326,6 @@ public final class CurrentAnalysisEditorBean {
* @param lib
* The library used to load the plugins and repositories.
*/
@SuppressWarnings("unchecked")
private void addToToolPalette(final MIDependency lib) {
synchronized (this) {
try {
......@@ -553,6 +565,7 @@ public final class CurrentAnalysisEditorBean {
* The class to be used as a base.
* @param plugin
* The plugin to be filled.
* @return true iff the plugin has been intialized properly.
*/
private boolean fillDisplays(final Class<AbstractPlugin> clazz, final MIPlugin plugin) {
synchronized (this) {
......@@ -595,6 +608,7 @@ public final class CurrentAnalysisEditorBean {
* The class to be used as a base.
* @param plugin
* The plugin to be filled.
* @return true iff the plugin has been intialized properly.
*/
private boolean fillPorts(final Class<AbstractPlugin> clazz, final MIPlugin plugin) {
synchronized (this) {
......@@ -661,6 +675,7 @@ public final class CurrentAnalysisEditorBean {
* The class to be used as a base.
* @param repository
* The repository to be filled.
* @return true iff the repository has been intialized properly.
*/
private boolean fillProperties(final Class<AbstractRepository> clazz, final MIRepository repository) {
try {
......@@ -699,6 +714,7 @@ public final class CurrentAnalysisEditorBean {
* The class to be used as a base.
* @param plugin
* The plugin to be filled.
* @return true iff the plugin has been intialized properly.
*/
private boolean fillProperties(final Class<AbstractPlugin> clazz, final MIPlugin plugin) {
try {
......
......
......@@ -77,8 +77,6 @@ public class CurrentCockpitBean {
/**
* This method sets the project stored within this bean and returns the new page for the navigation.
*
* @param newProject
* The project to be stored in this bean.
* @param newName
* The name of the project.
* @return The name of the page for the cockpit.
......
......
......@@ -102,8 +102,6 @@ public class CurrentCockpitEditorBean {
/**
* This method sets the project stored within this bean and returns the new page for the navigation.
*
* @param newProject
* The project to be stored in this bean.
* @param newName
* The name of the project.
* @return The name of the page for the analysis view work space.
......
......
......@@ -73,8 +73,6 @@ public class CurrentControllerBean {
/**
* This method sets the project stored within this bean and returns the new page for the navigation.
*
* @param newProject
* The project to be stored in this bean.
* @param newName
* The name of the project.
* @return The name of the page for the cockpit.
......@@ -137,7 +135,9 @@ public class CurrentControllerBean {
*/
public void startAnalysis() {
try {
synchronized (this) {
ACManager.getInstance().startAnalysisController(this.projectName);
}
} catch (final ProjectAlreadyStartedException ex) {
CurrentControllerBean.LOG.info("The analysis is already running.", ex);
CurrentControllerBean.showMessage(FacesMessage.SEVERITY_WARN, "The analysis is already running.");
......@@ -152,7 +152,9 @@ public class CurrentControllerBean {
*/
public void stopAnalysis() {
try {
synchronized (this) {
ACManager.getInstance().stopAnalysisController(this.projectName);
}
} catch (final AnalysisNotRunningException ex) {
CurrentControllerBean.LOG.info("The analysis has not been started yet.", ex);
CurrentControllerBean.showMessage(FacesMessage.SEVERITY_WARN, "The analysis has not been started yet.");
......@@ -166,7 +168,9 @@ public class CurrentControllerBean {
*/
public void instantiateAnalysis() {
try {
synchronized (this) {
ACManager.getInstance().instantiateAnalysisController(this.projectName);
}
} catch (final NullPointerException ex) { // NOPMD (Exception is explicitly thrown)
CurrentControllerBean.LOG.error("An error occurred while instantiating the analysis.", ex);
CurrentControllerBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occurred while instantiating the analysis.");
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment