MCPcopy Create free account
hub / github.com/apache/tomcat / checkSqlCodes

Method checkSqlCodes

java/org/apache/tomcat/dbcp/dbcp2/Utils.java:88–96  ·  view source on GitHub ↗

Checks for conflicts between two collections. If any overlap is found between the two provided collections, an IllegalArgumentException is thrown. @param codes1 The first collection of SQL state codes. @param codes2 The second collection of SQL state codes. @throws IllegalArgumentE

(final Collection<String> codes1, final Collection<String> codes2)

Source from the content-addressed store, hash-verified

86 * @since 2.13.0
87 */
88 static void checkSqlCodes(final Collection<String> codes1, final Collection<String> codes2) {
89 if (codes1 != null && codes2 != null) {
90 final Set<String> test = new HashSet<>(codes1);
91 test.retainAll(codes2);
92 if (!test.isEmpty()) {
93 throw new IllegalArgumentException(test + " cannot be in both disconnectionSqlCodes and disconnectionIgnoreSqlCodes.");
94 }
95 }
96 }
97
98 /**
99 * Clones the given char[] if not null.

Calls 2

retainAllMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected