坦克大战(一期)-设计模式-备忘录模式1.2

DesignPatterns
bingor 2 years ago
parent 07b55675f3
commit e084821a98

@ -138,10 +138,12 @@ public class GameModel {
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
oos.close();
} catch (IOException e) {
e.printStackTrace();
if(null != oos) {
try {
oos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
@ -156,13 +158,14 @@ public class GameModel {
} catch (IOException | ClassNotFoundException e) {
e.printStackTrace();
} finally {
try {
ois.close();
} catch (IOException e) {
e.printStackTrace();
if(null != ois) {
try {
ois.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}

Loading…
Cancel
Save