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

Minor modifications for quality reasons.

parent 11b63109
No related branches found
No related tags found
No related merge requests found
......@@ -769,14 +769,12 @@ public final class ClassAndMethodContainer {
return method.invoke(obj, values);
} catch (final IllegalAccessException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection method call.", ex);
return defaultReturn;
} catch (final IllegalArgumentException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection method call.", ex);
return defaultReturn;
} catch (final InvocationTargetException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection method call.", ex);
return defaultReturn;
}
return defaultReturn;
}
/**
......@@ -794,18 +792,14 @@ public final class ClassAndMethodContainer {
return constructor.newInstance(values);
} catch (final InstantiationException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection constructor call.", ex);
return null;
} catch (final IllegalAccessException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection constructor call.", ex);
return null;
} catch (final IllegalArgumentException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection constructor call.", ex);
return null;
} catch (final InvocationTargetException ex) {
ClassAndMethodContainer.LOG.error("An error occured during a reflection constructor call.", ex);
return null;
}
return null;
}
/**
......
......@@ -209,16 +209,16 @@ public final class ACManager {
final Enum<?> state = analysis.getCurrentState();
if (state != null) {
if (STATE.FAILED.toString().equals(state.toString())) {
if (STATE.FAILED.toString().equals(state.toString())) { // NOPMD (deeply nested if)
retState = STATE.FAILED;
}
if (STATE.READY.toString().equals(state.toString())) {
if (STATE.READY.toString().equals(state.toString())) { // NOPMD (deeply nested if)
retState = STATE.READY;
}
if (STATE.RUNNING.toString().equals(state.toString())) {
if (STATE.RUNNING.toString().equals(state.toString())) { // NOPMD (deeply nested if)
retState = STATE.RUNNING;
}
if (STATE.TERMINATED.toString().equals(state.toString())) {
if (STATE.TERMINATED.toString().equals(state.toString())) { // NOPMD (deeply nested if)
retState = STATE.TERMINATED;
}
}
......
......@@ -36,7 +36,6 @@ import kieker.webgui.common.exception.AnalysisInitializationException;
import kieker.webgui.common.exception.AnalysisStateException;
import kieker.webgui.common.exception.ProjectNotExistingException;
import kieker.webgui.service.IProjectService;
import kieker.webgui.web.beans.application.ProjectsBean;
/**
* /**
......@@ -55,8 +54,6 @@ public final class CurrentControllerBean {
private final List<String> logEntries = new ArrayList<String>();
private String projectName;
@Autowired
private ProjectsBean projectsBean;
/**
* Creates a new instance of this class. <b>Do not use this constructor. This bean is Spring managed.</b>
......@@ -170,12 +167,11 @@ public final class CurrentControllerBean {
return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.RUNNING;
} catch (final ProjectNotExistingException ex) {
CurrentControllerBean.LOG.info("The project does not exist.", ex);
return false;
} catch (final NullPointerException ex) {
// This exception can occur, when the projectsBean has not been initialized
CurrentControllerBean.LOG.warn("A null pointer exception occured.", ex);
return false;
}
return false;
}
/**
......@@ -188,13 +184,11 @@ public final class CurrentControllerBean {
return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.READY;
} catch (final ProjectNotExistingException ex) {
CurrentControllerBean.LOG.info("The project does not exist.", ex);
return false;
} catch (final NullPointerException ex) {
// This exception can occur, when the projectsBean has not been initialized
CurrentControllerBean.LOG.warn("A null pointer exception occured.", ex);
return false;
}
return false;
}
/**
......@@ -203,18 +197,15 @@ public final class CurrentControllerBean {
* @return true if and only if the analysis is <b>not</b> available.
*/
public synchronized boolean isAnalysisNotAvailable() {
try {
return this.projectService.getCurrentState(this.projectName) == null;
} catch (final ProjectNotExistingException ex) {
CurrentControllerBean.LOG.info("The project does not exist.", ex);
return true;
} catch (final NullPointerException ex) {
// This exception can occur, when the projectsBean has not been initialized
CurrentControllerBean.LOG.warn("A null pointer exception occured.", ex);
return true;
}
return true;
}
/**
......@@ -223,18 +214,15 @@ public final class CurrentControllerBean {
* @return true if and only if the analysis has been terminated.
*/
public synchronized boolean isAnalysisTerminated() {
try {
return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.TERMINATED;
} catch (final ProjectNotExistingException ex) {
CurrentControllerBean.LOG.info("The project does not exist.", ex);
return false;
} catch (final NullPointerException ex) {
// This exception can occur, when the projectsBean has not been initialized
CurrentControllerBean.LOG.warn("A null pointer exception occured.", ex);
return false;
}
return false;
}
/**
......@@ -243,18 +231,15 @@ public final class CurrentControllerBean {
* @return true if and only if the analysis has failed.
*/
public synchronized boolean isAnalysisFailed() {
try {
return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.FAILED;
} catch (final ProjectNotExistingException ex) {
CurrentControllerBean.LOG.info("The project does not exist.", ex);
return false;
} catch (final NullPointerException ex) {
// This exception can occur, when the projectsBean has not been initialized
CurrentControllerBean.LOG.warn("A null pointer exception occured.", ex);
return false;
}
return false;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment