@@ -58,6 +58,7 @@ public class UtplsqlRunner implements RealtimeReporterEventConsumer {
58
58
private final List <String > schemaList ;
59
59
private final List <String > includeObjectList ;
60
60
private final List <String > excludeObjectList ;
61
+ private Context context ;
61
62
private String connectionName ;
62
63
private Connection producerConn ;
63
64
private Connection consumerConn ;
@@ -68,7 +69,7 @@ public class UtplsqlRunner implements RealtimeReporterEventConsumer {
68
69
private JFrame frame ; // for testing purposes only (outside of SQL Developer)
69
70
private Thread producerThread ;
70
71
private Thread consumerThread ;
71
- private Context context ; // required for debugging
72
+ private boolean debug = false ;
72
73
73
74
public UtplsqlRunner (final List <String > pathList , final String connectionName ) {
74
75
this .withCodeCoverage = false ;
@@ -77,6 +78,7 @@ public UtplsqlRunner(final List<String> pathList, final String connectionName) {
77
78
this .includeObjectList = null ;
78
79
this .excludeObjectList = null ;
79
80
setConnection (connectionName );
81
+ this .context = Context .newIdeContext ();
80
82
}
81
83
82
84
public UtplsqlRunner (final List <String > pathList , final List <String > schemaList ,
@@ -87,6 +89,7 @@ public UtplsqlRunner(final List<String> pathList, final List<String> schemaList,
87
89
this .includeObjectList = includeObjectList ;
88
90
this .excludeObjectList = excludeObjectList ;
89
91
setConnection (connectionName );
92
+ this .context = Context .newIdeContext ();
90
93
}
91
94
92
95
/**
@@ -127,8 +130,8 @@ private void setConnection(final String connectionName) {
127
130
this .connectionName = connectionName ;
128
131
}
129
132
130
- public void enableDebugging (Context context ) {
131
- this .context = context ;
133
+ public void enableDebugging () {
134
+ this .debug = true ;
132
135
}
133
136
134
137
public void dispose () {
@@ -140,6 +143,7 @@ public void dispose() {
140
143
}
141
144
}
142
145
146
+ @ SuppressWarnings ("StatementWithEmptyBody" )
143
147
@ Override
144
148
public void process (final RealtimeReporterEvent event ) {
145
149
logger .fine (event ::toString );
@@ -305,7 +309,7 @@ private void produce() {
305
309
if (withCodeCoverage ) {
306
310
dao .produceReportWithCoverage (realtimeReporterId , coverageReporterId , pathList , schemaList , includeObjectList , excludeObjectList );
307
311
} else {
308
- if (context == null ) {
312
+ if (! debug ) {
309
313
dao .produceReport (realtimeReporterId , pathList );
310
314
} else {
311
315
produceReportWithDebugger (dao .getProduceReportPlsql (realtimeReporterId , pathList ));
@@ -355,6 +359,7 @@ private boolean initGUI() {
355
359
if (isRunningInSqlDeveloper ()) {
356
360
RunnerFactory .showDockable ();
357
361
panel = dockable .getRunnerPanel ();
362
+ context .setView (dockable );
358
363
} else {
359
364
frame = new JFrame ("utPLSQL Runner Panel" );
360
365
frame .setDefaultCloseOperation (JFrame .EXIT_ON_CLOSE );
0 commit comments