IDEMPIERE-6160 Remove Eclipse warnings (#2379)

This commit is contained in:
Carlos Ruiz 2024-05-29 15:07:59 +02:00
parent 69995b178b
commit 5994292dbb
4 changed files with 24 additions and 4 deletions

View File

@ -245,7 +245,8 @@ public abstract class OFXBankStatementHandler extends DefaultHandler
if (isOfx1)
{
m_reader = new BufferedReader(new InputStreamReader(new OFX1ToXML(reader)));
OFX1ToXML in = new OFX1ToXML(reader);
m_reader = new BufferedReader(new InputStreamReader(in));
}
else
{
@ -257,9 +258,12 @@ public abstract class OFXBankStatementHandler extends DefaultHandler
{
m_errorMessage = new StringBuffer("ErrorReadingData");
m_errorDescription = new StringBuffer(e.getMessage());
closeBufferedReader();
return result;
}
finally
{
closeBufferedReader();
}
return result;
} // attachInput

View File

@ -17,6 +17,7 @@
package org.compiere.impexp;
import java.io.FileInputStream;
import java.io.IOException;
import org.compiere.model.MBankStatementLoader;
import org.xml.sax.SAXException;
@ -70,6 +71,13 @@ public final class OFXFileBankStatementLoader extends OFXBankStatementHandler im
m_errorMessage = new StringBuffer("ErrorReadingData");
m_errorDescription = new StringBuffer();
}
finally
{
if (m_stream != null)
try {
m_stream.close();
} catch (IOException e) {}
}
return result;
} // init

View File

@ -831,6 +831,13 @@ public class ConfigurationData
if (log.isLoggable(Level.FINE)) log.fine(host + ":" + port + " - " + e.getMessage());
return false;
}
finally
{
if (pingSocket != null)
try {
pingSocket.close();
} catch (IOException e) {}
}
if (!shouldBeUsed)
log.warning("Open Socket " + host + ":" + port + " - " + pingSocket);

View File

@ -346,8 +346,9 @@ public class PayPrint {
if (pdfFile != null)
{
// increase the check document no by the number of pages of the generated pdf file
PdfReader document = new PdfReader(pdfFile.getAbsolutePath());
lastDocumentNo += document.getNumberOfPages();
try (PdfReader document = new PdfReader(pdfFile.getAbsolutePath())) {
lastDocumentNo += document.getNumberOfPages();
}
pdfList.add(pdfFile);
}
}