summaryrefslogtreecommitdiffstats
path: root/src/se
diff options
context:
space:
mode:
authorGustav Sörnäs <gustav@sornas.net>2021-03-02 11:09:50 +0100
committerGustav Sörnäs <gustav@sornas.net>2021-03-02 11:09:50 +0100
commitda10d781e3eb3b4e9d83e4bd8cd00d1e32b28f73 (patch)
treedafbeef85c0df6cdb734b90c896b71fa00d1384d /src/se
parent8672ffb98303ede9114a4b1e251ed447306e69cc (diff)
downloadtdde30-da10d781e3eb3b4e9d83e4bd8cd00d1e32b28f73.tar.gz
analysis
Diffstat (limited to 'src/se')
-rw-r--r--src/se/liu/gusso230/tetris/HighscoreList.java6
-rw-r--r--src/se/liu/gusso230/tetris/ImageComponent.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/se/liu/gusso230/tetris/HighscoreList.java b/src/se/liu/gusso230/tetris/HighscoreList.java
index 27543e9..ff5830b 100644
--- a/src/se/liu/gusso230/tetris/HighscoreList.java
+++ b/src/se/liu/gusso230/tetris/HighscoreList.java
@@ -27,13 +27,13 @@ public class HighscoreList {
}
public void saveToFile(File file) throws FileNotFoundException, SecurityException, IOException, DirectoryNotEmptyException {
- File tmpFile = new File(".highscores.json.tmp");
- try (PrintWriter writer = new PrintWriter(tmpFile)) {
+ File testFile = new File(".highscores.json.tmp");
+ try (PrintWriter writer = new PrintWriter(testFile)) {
Gson gson = new Gson();
writer.println(gson.toJson(this));
}
- Files.move(tmpFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ Files.move(testFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
public void readFromFile(File file) throws FileNotFoundException, NoSuchElementException {
diff --git a/src/se/liu/gusso230/tetris/ImageComponent.java b/src/se/liu/gusso230/tetris/ImageComponent.java
index 98a09f1..42a5449 100644
--- a/src/se/liu/gusso230/tetris/ImageComponent.java
+++ b/src/se/liu/gusso230/tetris/ImageComponent.java
@@ -4,7 +4,7 @@ import javax.swing.*;
import java.awt.*;
public class ImageComponent extends JComponent {
- ImageIcon icon;
+ private ImageIcon icon;
public ImageComponent(String name) {
icon = new ImageIcon(ClassLoader.getSystemResource(name));