15
15
*/
16
16
package org.utplsql.sqldev
17
17
18
- import java.util.ArrayList
19
- import java.util.HashSet
20
18
import java.util.List
21
19
import java.util.logging.Logger
22
- import java.util.regex.Pattern
23
20
import javax.swing.JSplitPane
24
21
import oracle.dbtools.raptor.utils.Connections
25
22
import oracle.dbtools.worksheet.editor.OpenWorksheetWizard
@@ -44,44 +41,13 @@ class UtplsqlWorksheet {
44
41
setConnection(connectionName)
45
42
}
46
43
47
- new (String path, String connectionName) {
48
- this . pathList = new ArrayList<String > ()
49
- this . pathList. add(path)
50
- this . preferences = PreferenceModel . getInstance(Preferences . preferences);
51
- setConnection(connectionName)
52
- }
53
-
54
44
private def setConnection (String connectionName ) {
55
45
if (connectionName !== null && preferences. unsharedWorksheet) {
56
46
this . connectionName = Connections . instance. createPrivateConnection(connectionName)
57
47
} else {
58
48
this . connectionName = connectionName;
59
49
}
60
50
}
61
-
62
- private def dedupPathList () {
63
- val set = new HashSet<String >
64
- for (path : pathList) {
65
- set. add(path)
66
- }
67
- val ret = new ArrayList<String >
68
- val p = Pattern . compile(" ((((\\ w+)\\ .)?\\ w+)\\ .)?\\ w+" )
69
- for (path : set) {
70
- val m = p. matcher(path)
71
- if (m. matches()) {
72
- val parent1 = m. group(4 ) // user
73
- val parent2 = m. group(2 ) // user.package
74
- if (parent1 == = null || ! set. contains(parent1)) {
75
- if (parent2 == = null || ! set. contains(parent2)) {
76
- ret. add(path)
77
- }
78
- }
79
- } else {
80
- logger. severe(' ' ' path: «path» did not pattern «p.toString», this is unexected!' ' ' )
81
- }
82
- }
83
- return ret
84
- }
85
51
86
52
private def getCode () '''
87
53
«IF preferences.resetPackage»
@@ -91,7 +57,7 @@ class UtplsqlWorksheet {
91
57
«IF preferences. clearScreen»
92
58
CLEAR SCREEN
93
59
«ENDIF »
94
- «val paths = dedupPathList »
60
+ «val paths = pathList »
95
61
«IF paths. size == 1 »
96
62
EXECUTE ut. run(' «paths.get(0)»' );
97
63
«ELSE »
0 commit comments