Work by Jianfei is licensed under a Creative Commons wei 3.0 Unported License.
1. We will get an error if write the getInstance method like below, cause the StaticEnvLib() throw a exception but there is no try- catch to catch it during the return new method.
public static StaticEnvLib getInstance()
{
return new StaticEnvLib();
}
public StaticEnvLib() throws IOException {
String filename = "H:\\Darwin.ini";
BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(filename), "UTF-8"));
read(reader);
reader.close();
}
2. Modify the StaticEnvLib to like below.
public StaticEnvLib() {
String filename = "H:\\Darwin.ini";
BufferedReader reader = new BufferedReader(new InputStreamReader(
new FileInputStream(filename), "UTF-8"));
read(reader);
reader.close();
}
Work by Jianfei is licensed under a Creative Commons wei 3.0 Unported License.