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

Some minor code modifications to calm FindBugs.

parent 15fb5943
No related branches found
No related tags found
No related merge requests found
...@@ -124,8 +124,7 @@ public final class ProjectsBean { ...@@ -124,8 +124,7 @@ public final class ProjectsBean {
// Get the current time stamp of the project... // Get the current time stamp of the project...
final long timeStamp = FSManager.getInstance().getCurrTimeStamp(project); final long timeStamp = FSManager.getInstance().getCurrTimeStamp(project);
// ...and make sure the user can read it. // ...and make sure the user can read it.
final String dStr = new Date(timeStamp).toString(); return new Date(timeStamp).toString();
return dStr;
} }
......
...@@ -60,10 +60,6 @@ import org.primefaces.model.UploadedFile; ...@@ -60,10 +60,6 @@ import org.primefaces.model.UploadedFile;
*/ */
public final class FSManager { 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. * This is the extension of the KAX-files.
*/ */
...@@ -100,6 +96,10 @@ public final class FSManager { ...@@ -100,6 +96,10 @@ public final class FSManager {
* This is the log object used to log messages, warnings etc. * This is the log object used to log messages, warnings etc.
*/ */
private static final Log LOG = LogFactory.getLog(FSManager.class); 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. * Creates a new instance of this class.
...@@ -157,21 +157,27 @@ public final class FSManager { ...@@ -157,21 +157,27 @@ public final class FSManager {
} }
// Create the directories // Create the directories
projectDir.mkdir(); final boolean projDirCreated = projectDir.mkdir();
libDir.mkdir(); final boolean libDirCreated = libDir.mkdir();
viewDir.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 // Now the empty project file
try { try {
AnalysisController.saveToFile(projectFile, emptyProject); AnalysisController.saveToFile(projectFile, emptyProject);
} catch (final IOException ex) { } catch (final IOException ex) {
// Something went wrong. Remove the directories and files! // Something went wrong. Remove the directories and files!
viewDir.delete(); final boolean viewDirDeleted = viewDir.delete();
libDir.delete(); final boolean libDirDeleted = libDir.delete();
// Keep in mind that the potential remains of the file have to deleted before the directory. // Keep in mind that the potential remains of the file have to be deleted before the directory.
projectFile.delete(); final boolean projectFileDeleted = projectFile.delete();
projectDir.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 // Rethrow the exception in order to inform the caller of this method
throw ex; throw ex;
} }
......
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