Revert "Use try-with-resources to close reader / writer"
This reverts commit 402a89eb03
.
This commit is contained in:
parent
402a89eb03
commit
d77786d16a
|
@ -32,7 +32,8 @@ public class SingleLineSqlScriptExtractor implements SqlScriptCommandExtractor {
|
|||
public List<String> extractCommands(Reader reader, Dialect dialect) {
|
||||
final List<String> statementList = new LinkedList<>();
|
||||
|
||||
try (final BufferedReader bufferedReader = new BufferedReader( reader )) {
|
||||
final BufferedReader bufferedReader = new BufferedReader( reader );
|
||||
try {
|
||||
for ( String line = bufferedReader.readLine(); line != null; line = bufferedReader.readLine() ) {
|
||||
final String trimmedLine = line.trim();
|
||||
|
||||
|
|
|
@ -51,8 +51,8 @@ public class AntlrHelper {
|
|||
tmpFile.getParentFile().mkdirs();
|
||||
tmpFile.createNewFile();
|
||||
|
||||
try (final BufferedReader reader = new BufferedReader( new FileReader( generatedJavaFile ) );
|
||||
final BufferedWriter writer = new BufferedWriter( new FileWriter( tmpFile ) )) {
|
||||
final BufferedReader reader = new BufferedReader( new FileReader( generatedJavaFile ) );
|
||||
final BufferedWriter writer = new BufferedWriter( new FileWriter( tmpFile ) );
|
||||
|
||||
boolean found = false;
|
||||
String currentLine;
|
||||
|
@ -64,7 +64,10 @@ public class AntlrHelper {
|
|||
}
|
||||
writer.write( currentLine + System.lineSeparator() );
|
||||
}
|
||||
}
|
||||
|
||||
writer.close();
|
||||
reader.close();
|
||||
|
||||
generatedJavaFile.delete();
|
||||
tmpFile.renameTo( generatedJavaFile );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue