diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java index c880814135aa51abdbc95143e98b76d36a347376..4280816144cf138f7d3a9f54ed69c8f0d1a8cb13 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java @@ -124,8 +124,7 @@ public final class ProjectsBean { // Get the current time stamp of the project... final long timeStamp = FSManager.getInstance().getCurrTimeStamp(project); // ...and make sure the user can read it. - final String dStr = new Date(timeStamp).toString(); - return dStr; + return new Date(timeStamp).toString(); } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java index 02d116a7531c215bdb6cec9b8e74b2b58ed8d8ac..f03b8dde5f688a258dac1e8b4596d64afbc6635b 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/FSManager.java @@ -60,10 +60,6 @@ import org.primefaces.model.UploadedFile; */ public final class FSManager { - /** - * This is the singleton instance of this class. - */ - private static final FSManager INSTANCE = new FSManager(); /** * This is the extension of the KAX-files. */ @@ -100,6 +96,10 @@ public final class FSManager { * This is the log object used to log messages, warnings etc. */ private static final Log LOG = LogFactory.getLog(FSManager.class); + /** + * This is the singleton instance of this class. + */ + private static final FSManager INSTANCE = new FSManager(); /** * Creates a new instance of this class. @@ -157,21 +157,27 @@ public final class FSManager { } // Create the directories - projectDir.mkdir(); - libDir.mkdir(); - viewDir.mkdir(); + final boolean projDirCreated = projectDir.mkdir(); + final boolean libDirCreated = libDir.mkdir(); + final boolean viewDirCreated = viewDir.mkdir(); + // The following part is only necessary to calm FindBugs... + @SuppressWarnings("unused") + final boolean createResults = projDirCreated && libDirCreated && viewDirCreated; // Now the empty project file try { AnalysisController.saveToFile(projectFile, emptyProject); } catch (final IOException ex) { // Something went wrong. Remove the directories and files! - viewDir.delete(); - libDir.delete(); - // Keep in mind that the potential remains of the file have to deleted before the directory. - projectFile.delete(); - projectDir.delete(); - + final boolean viewDirDeleted = viewDir.delete(); + final boolean libDirDeleted = libDir.delete(); + // Keep in mind that the potential remains of the file have to be deleted before the directory. + final boolean projectFileDeleted = projectFile.delete(); + final boolean projectDeleted = projectDir.delete(); + + // The following part is only necessary to calm FindBugs... + @SuppressWarnings("unused") + final boolean deleteResults = viewDirDeleted && libDirDeleted && projectFileDeleted && projectDeleted; // Rethrow the exception in order to inform the caller of this method throw ex; }