2828import java .awt .event .FocusEvent ;
2929import java .awt .event .FocusListener ;
3030import java .awt .event .WindowEvent ;
31- import java .sql .Connection ;
32- import java .sql .SQLException ;
33- import java .util .logging .Logger ;
3431
3532import javax .swing .BorderFactory ;
3633import javax .swing .JButton ;
4340import javax .swing .ScrollPaneConstants ;
4441import javax .swing .SwingUtilities ;
4542
46- import org .springframework .core .task .SimpleAsyncTaskExecutor ;
4743import org .utplsql .sqldev .coverage .CodeCoverageReporter ;
48- import org .utplsql .sqldev .exception . GenericDatabaseAccessException ;
44+ import org .utplsql .sqldev .model . DatabaseTools ;
4945import org .utplsql .sqldev .model .StringTools ;
5046import org .utplsql .sqldev .resources .UtplsqlResources ;
5147
5248public class CodeCoverageReporterDialog extends JFrame implements ActionListener , FocusListener {
5349 private static final long serialVersionUID = 5503685225300993401L ;
54- private static final Logger logger = Logger .getLogger (CodeCoverageReporterDialog .class .getName ());
5550
5651 private CodeCoverageReporter reporter ;
5752 private JButton runButton ;
@@ -180,16 +175,6 @@ public void exit() {
180175 dispatchEvent (new WindowEvent (this , WindowEvent .WINDOW_CLOSING ));
181176 }
182177
183- private void abortConnection (final Connection conn , final SimpleAsyncTaskExecutor taskExecutor ) {
184- try {
185- conn .abort (taskExecutor );
186- } catch (SQLException e ) {
187- final String msg = "Error aborting connection due to " + e .getMessage ();
188- logger .severe (() -> msg );
189- throw new GenericDatabaseAccessException (msg , e );
190- }
191- }
192-
193178 @ Override
194179 public void actionPerformed (final ActionEvent e ) {
195180 if (e .getSource () == runButton ) {
@@ -212,7 +197,7 @@ public void actionPerformed(final ActionEvent e) {
212197 // database session is not cancelled. This is not a bug.
213198 // to cancel the session you have to kill it via "ALTER SYSTEM KILL SESSION".
214199 // However, the abort frees all resources on the client side.
215- abortConnection (reporter .getConnection (), new SimpleAsyncTaskExecutor ());
200+ DatabaseTools . abortConnection (reporter .getConnection ());
216201 }
217202 }
218203 }
0 commit comments