|
16 | 16 | package org.utplsql.sqldev.parser; |
17 | 17 |
|
18 | 18 | import java.sql.Connection; |
19 | | -import java.sql.SQLException; |
20 | 19 | import java.util.ArrayList; |
21 | 20 | import java.util.Arrays; |
22 | 21 | import java.util.List; |
|
26 | 25 | import javax.swing.text.JTextComponent; |
27 | 26 |
|
28 | 27 | import org.utplsql.sqldev.dal.UtplsqlDao; |
29 | | -import org.utplsql.sqldev.exception.GenericDatabaseAccessException; |
30 | 28 | import org.utplsql.sqldev.exception.GenericRuntimeException; |
| 29 | +import org.utplsql.sqldev.model.DatabaseTools; |
31 | 30 | import org.utplsql.sqldev.model.parser.PlsqlObject; |
32 | 31 | import org.utplsql.sqldev.model.parser.Unit; |
33 | 32 | import org.utplsql.sqldev.model.ut.Annotation; |
@@ -126,22 +125,14 @@ private void populateUnits() { |
126 | 125 | } |
127 | 126 | } |
128 | 127 |
|
129 | | - private String getSchema(Connection conn) { |
130 | | - try { |
131 | | - return conn.getSchema(); |
132 | | - } catch (SQLException e) { |
133 | | - throw new GenericDatabaseAccessException("getSchema failed", e); |
134 | | - } |
135 | | - } |
136 | | - |
137 | 128 | private void processAnnotations(final Connection conn, final String owner) { |
138 | 129 | this.owner = owner; |
139 | 130 | if (conn != null) { |
140 | 131 | final UtplsqlDao dao = new UtplsqlDao(conn); |
141 | 132 | if (dao.isUtAnnotationManagerInstalled()) { |
142 | 133 | for (final PlsqlObject o : objects) { |
143 | 134 | final List<String> segments = Arrays.asList(fixName(o.getName()).split("\\.")); |
144 | | - final String schema = owner != null ? owner : getSchema(conn); |
| 135 | + final String schema = owner != null ? owner : DatabaseTools.getSchema(conn); |
145 | 136 | final List<Annotation> annotations = dao.annotations(schema, |
146 | 137 | segments.get(segments.size() - 1).toUpperCase()); |
147 | 138 | if (annotations.stream().anyMatch(it -> it.getName().equals("suite"))) { |
|
0 commit comments