More SonarQube detected bugs fixed:

- Use try-with-resources in AutoCloseable objects.
- End this switch case with an unconditional break, return or throw statement.
- A "NullPointerException" could be thrown.
- Use the "equals" method if value comparison was intended.
- Correct this "&" to "&&".
This commit is contained in:
klaxnek
2019-08-10 13:57:06 +02:00
parent c9744bea27
commit d04fae8e96
12 changed files with 88 additions and 59 deletions

View File

@@ -111,7 +111,7 @@ public class SaveOpenDialog extends JPanel {
RetFile = fc.getSelectedFile();
/* Adds extension if it is known and not given */
if (type != null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) {
if (type != null && !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) {
RetFile = new File(RetFile.getAbsolutePath() + "." + type.TypeExtension);
}