It seems this was not sent to the dev list for some reason. I tried removing and re-adding the dev list to receive notifications but got an error on the Coverity side. I emailed their support so hopefully we can get this resolved.
-- Michael Mior [email protected] ---------- Forwarded message --------- From: <[email protected]> Date: lun. 16 juil. 2018 à 10:08 Subject: New Defects reported by Coverity Scan for julianhyde/calcite To: <[email protected]> Hi, Please find the latest report on new defect(s) introduced to julianhyde/calcite found with Coverity Scan. 38 new defect(s) introduced to julianhyde/calcite found with Coverity Scan. 31 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 20 of 38 defect(s) ** CID 302880: Null pointer dereferences (NULL_RETURNS) /core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java: 973 in org.apache.calcite.sql.validate.SqlValidatorUtil.getTypeEntry(org.apache.calcite.jdbc.CalciteSchema, org.apache.calcite.sql.SqlIdentifier)() ________________________________________________________________________________________________________ *** CID 302880: Null pointer dereferences (NULL_RETURNS) /core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorUtil.java: 973 in org.apache.calcite.sql.validate.SqlValidatorUtil.getTypeEntry(org.apache.calcite.jdbc.CalciteSchema, org.apache.calcite.sql.SqlIdentifier)() 967 CalciteSchema schema = rootSchema; 968 for (String p : path) { 969 if (schema == rootSchema 970 && SqlNameMatchers.withCaseSensitive(true).matches(p, schema.getName())) { 971 continue; 972 } >>> CID 302880: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "schema". 973 schema = schema.getSubSchema(p, true); 974 } 975 return schema == null ? null : schema.getType(name, false); 976 } 977 978 /** ** CID 301763: Null pointer dereferences (FORWARD_NULL) /core/src/main/java/org/apache/calcite/model/ModelHandler.java: 155 in org.apache.calcite.model.ModelHandler.addFunctions(org.apache.calcite.schema.SchemaPlus, java.lang.String, java.util.List, java.lang.String, java.lang.String, boolean)() ________________________________________________________________________________________________________ *** CID 301763: Null pointer dereferences (FORWARD_NULL) /core/src/main/java/org/apache/calcite/model/ModelHandler.java: 155 in org.apache.calcite.model.ModelHandler.addFunctions(org.apache.calcite.schema.SchemaPlus, java.lang.String, java.util.List, java.lang.String, java.lang.String, boolean)() 149 ScalarFunctionImpl.create(clazz, Util.first(methodName, "eval")); 150 if (function != null) { 151 final String name; 152 if (functionName != null) { 153 name = functionName; 154 } else if (upCase) { >>> CID 301763: Null pointer dereferences (FORWARD_NULL) >>> Calling a method on null object "methodName". 155 name = methodName.toUpperCase(Locale.ROOT); 156 } else { 157 name = methodName; 158 } 159 schema.add(name, function); 160 return; ** CID 301761: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 3300 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 3270 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301761: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 3300 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 3294 return jjMoveStringLiteralDfa15_1(active0, 0x8000000000000000L, active1, 0x4000000000000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 3295 case 86: 3296 case 118: 3297 return jjMoveStringLiteralDfa15_1(active0, 0L, active1, 0L, active2, 0x6L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 3298 case 88: 3299 case 120: >>> CID 301761: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x400000000000L" looks like a copy-paste error. 3300 if ((active8 & 0x400000000000L) != 0L) 3301 return jjStartNfaWithStates_1(14, 558, 86); 3302 else if ((active9 & 0x1000L) != 0L) 3303 return jjStartNfaWithStates_1(14, 588, 86); 3304 break; 3305 case 89: /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 3270 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 3264 case 109: 3265 return jjMoveStringLiteralDfa15_1(active0, 0L, active1, 0x10000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 3266 case 78: 3267 case 110: 3268 if ((active0 & 0x800000000L) != 0L) 3269 return jjStartNfaWithStates_1(14, 35, 86); >>> CID 301761: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x20000000000L" looks like a copy-paste error. 3270 else if ((active8 & 0x20000000000L) != 0L) 3271 return jjStartNfaWithStates_1(14, 553, 86); 3272 return jjMoveStringLiteralDfa15_1(active0, 0L, active1, 0x2L, active2, 0L, active4, 0L, active5, 0x2000000000000L, active6, 0x2000000000000L, active7, 0L, active8, 0L, active9, 0L); 3273 case 79: 3274 case 111: 3275 return jjMoveStringLiteralDfa15_1(active0, 0L, active1, 0x200000000300000L, active2, 0xc000000000L, active4, 0L, active5, 0L, active6, 0L, active7, 0xc000000000000000L, active8, 0x9L, active9, 0x180L); ** CID 301759: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 12181 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301759: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 12181 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 12175 case 112: 12176 if ((active9 & 0x800000000000L) != 0L) 12177 return jjStartNfaWithStates_2(7, 623, 88); 12178 return jjMoveStringLiteralDfa8_2(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 12179 case 82: 12180 case 114: >>> CID 301759: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 12181 if ((active7 & 0x8000000000000L) != 0L) 12182 return jjStartNfaWithStates_2(7, 499, 88); 12183 else if ((active9 & 0x100000000000000L) != 0L) 12184 return jjStartNfaWithStates_2(7, 632, 88); 12185 return jjMoveStringLiteralDfa8_2(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 12186 case 83: ** CID 301757: Null pointer dereferences (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchema.java: 89 in org.apache.calcite.adapter.elasticsearch.ElasticsearchSchema.listTypes()() ________________________________________________________________________________________________________ *** CID 301757: Null pointer dereferences (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSchema.java: 89 in org.apache.calcite.adapter.elasticsearch.ElasticsearchSchema.listTypes()() 83 */ 84 private Set<String> listTypes() throws IOException { 85 final String endpoint = "/" + index + "/_mapping"; 86 final Response response = client.performRequest("GET", endpoint); 87 try (InputStream is = response.getEntity().getContent()) { 88 JsonNode root = mapper.readTree(is); >>> CID 301757: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "root". 89 if (!root.isObject() || root.size() != 1) { 90 final String message = String.format(Locale.ROOT, "Invalid response for %s/%s " 91 + "Expected object of size 1 got %s (of size %d)", response.getHost(), 92 response.getRequestLine(), root.getNodeType(), root.size()); 93 throw new IllegalStateException(message); 94 } ** CID 301749: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 12187 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301749: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 12187 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 12181 case 112: 12182 if ((active9 & 0x800000000000L) != 0L) 12183 return jjStartNfaWithStates_2(7, 623, 86); 12184 return jjMoveStringLiteralDfa8_2(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 12185 case 82: 12186 case 114: >>> CID 301749: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 12187 if ((active7 & 0x8000000000000L) != 0L) 12188 return jjStartNfaWithStates_2(7, 499, 86); 12189 else if ((active9 & 0x100000000000000L) != 0L) 12190 return jjStartNfaWithStates_2(7, 632, 86); 12191 return jjMoveStringLiteralDfa8_2(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 12192 case 83: ** CID 301748: Null pointer dereferences (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() ________________________________________________________________________________________________________ *** CID 301748: Null pointer dereferences (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() 81 * @throws IOException if couldn't connect to ES 82 */ 83 private static ElasticsearchVersion detectVersion(RestClient client, ObjectMapper mapper) 84 throws IOException { 85 HttpEntity entity = client.performRequest("GET", "/").getEntity(); 86 JsonNode node = mapper.readTree(EntityUtils.toString(entity)); >>> CID 301748: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "node". 87 return ElasticsearchVersion.fromString(node.get("version").get("number").asText()); 88 } 89 90 @Override protected String scriptedFieldPrefix() { 91 // ES2 vs ES5 scripted field difference 92 return version == ElasticsearchVersion.ES2 ** CID 301747: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 2266 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301747: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 2266 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 2260 case 112: 2261 if ((active9 & 0x800000000000L) != 0L) 2262 return jjStartNfaWithStates_1(7, 623, 86); 2263 return jjMoveStringLiteralDfa8_1(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 2264 case 82: 2265 case 114: >>> CID 301747: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 2266 if ((active7 & 0x8000000000000L) != 0L) 2267 return jjStartNfaWithStates_1(7, 499, 86); 2268 else if ((active9 & 0x100000000000000L) != 0L) 2269 return jjStartNfaWithStates_1(7, 632, 86); 2270 return jjMoveStringLiteralDfa8_1(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 2271 case 83: ** CID 301745: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 7242 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301745: Incorrect expression (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 7242 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa7_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 7236 case 112: 7237 if ((active9 & 0x800000000000L) != 0L) 7238 return jjStartNfaWithStates_0(7, 623, 86); 7239 return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 7240 case 82: 7241 case 114: >>> CID 301745: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 7242 if ((active7 & 0x8000000000000L) != 0L) 7243 return jjStartNfaWithStates_0(7, 499, 86); 7244 else if ((active9 & 0x100000000000000L) != 0L) 7245 return jjStartNfaWithStates_0(7, 632, 86); 7246 return jjMoveStringLiteralDfa8_0(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 7247 case 83: ** CID 301744: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 2264 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301744: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 2264 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_1(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 2258 case 112: 2259 if ((active9 & 0x800000000000L) != 0L) 2260 return jjStartNfaWithStates_1(7, 623, 89); 2261 return jjMoveStringLiteralDfa8_1(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 2262 case 82: 2263 case 114: >>> CID 301744: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 2264 if ((active7 & 0x8000000000000L) != 0L) 2265 return jjStartNfaWithStates_1(7, 499, 89); 2266 else if ((active9 & 0x100000000000000L) != 0L) 2267 return jjStartNfaWithStates_1(7, 632, 89); 2268 return jjMoveStringLiteralDfa8_1(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 2269 case 83: ** CID 301741: (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() ________________________________________________________________________________________________________ *** CID 301741: (NULL_RETURNS) /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() 81 * @throws IOException if couldn't connect to ES 82 */ 83 private static ElasticsearchVersion detectVersion(RestClient client, ObjectMapper mapper) 84 throws IOException { 85 HttpEntity entity = client.performRequest("GET", "/").getEntity(); 86 JsonNode node = mapper.readTree(EntityUtils.toString(entity)); >>> CID 301741: (NULL_RETURNS) >>> Calling a method on null object "node.get("version").get("number")". 87 return ElasticsearchVersion.fromString(node.get("version").get("number").asText()); 88 } 89 90 @Override protected String scriptedFieldPrefix() { 91 // ES2 vs ES5 scripted field difference 92 return version == ElasticsearchVersion.ES2 /elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java: 87 in org.apache.calcite.adapter.elasticsearch.ElasticsearchTable.detectVersion(org.elasticsearch.client.RestClient, com.fasterxml.jackson.databind.ObjectMapper)() 81 * @throws IOException if couldn't connect to ES 82 */ 83 private static ElasticsearchVersion detectVersion(RestClient client, ObjectMapper mapper) 84 throws IOException { 85 HttpEntity entity = client.performRequest("GET", "/").getEntity(); 86 JsonNode node = mapper.readTree(EntityUtils.toString(entity)); >>> CID 301741: (NULL_RETURNS) >>> Calling a method on null object "node.get("version")". 87 return ElasticsearchVersion.fromString(node.get("version").get("number").asText()); 88 } 89 90 @Override protected String scriptedFieldPrefix() { 91 // ES2 vs ES5 scripted field difference 92 return version == ElasticsearchVersion.ES2 ** CID 301733: High impact security (BAD_CERT_VERIFICATION) /core/src/main/java/org/apache/calcite/runtime/HttpUtils.java: 50 in <lambda implementing javax.net.ssl.HostnameVerifier>.verify() ________________________________________________________________________________________________________ *** CID 301733: High impact security (BAD_CERT_VERIFICATION) /core/src/main/java/org/apache/calcite/runtime/HttpUtils.java: 50 in <lambda implementing javax.net.ssl.HostnameVerifier>.verify() 44 // secure client/server comm 45 // not to establish the identity of the server 46 if (httpConn instanceof HttpsURLConnection) { 47 HttpsURLConnection httpsConn = (HttpsURLConnection) httpConn; 48 httpsConn.setSSLSocketFactory( 49 TrustAllSslSocketFactory.createSSLSocketFactory()); >>> CID 301733: High impact security (BAD_CERT_VERIFICATION) >>> The "HostnameVerifier.verify" method always returns "true". This will >>> lead to accepting all hosts. 50 httpsConn.setHostnameVerifier((arg0, arg1) -> true); 51 } 52 53 return httpConn; 54 } 55 ** CID 301731: (NULL_RETURNS) /core/src/main/java/org/apache/calcite/materialize/MaterializationService.java: 71 in <lambda implementing java.util.Comparator>.compare() /core/src/main/java/org/apache/calcite/materialize/MaterializationService.java: 71 in <lambda implementing java.util.Comparator>.compare() ________________________________________________________________________________________________________ *** CID 301731: (NULL_RETURNS) /core/src/main/java/org/apache/calcite/materialize/MaterializationService.java: 71 in <lambda implementing java.util.Comparator>.compare() 65 66 private static final Comparator<Pair<CalciteSchema.TableEntry, TileKey>> C = 67 (o0, o1) -> { 68 // We prefer rolling up from the table with the fewest rows. 69 final Table t0 = o0.left.getTable(); 70 final Table t1 = o1.left.getTable(); >>> CID 301731: (NULL_RETURNS) >>> Unboxing null object "t0.getStatistic().getRowCount()". 71 int c = Double.compare(t0.getStatistic().getRowCount(), 72 t1.getStatistic().getRowCount()); 73 if (c != 0) { 74 return c; 75 } 76 // Tie-break based on table name. /core/src/main/java/org/apache/calcite/materialize/MaterializationService.java: 71 in <lambda implementing java.util.Comparator>.compare() 65 66 private static final Comparator<Pair<CalciteSchema.TableEntry, TileKey>> C = 67 (o0, o1) -> { 68 // We prefer rolling up from the table with the fewest rows. 69 final Table t0 = o0.left.getTable(); 70 final Table t1 = o1.left.getTable(); >>> CID 301731: (NULL_RETURNS) >>> Unboxing null object "t1.getStatistic().getRowCount()". 71 int c = Double.compare(t0.getStatistic().getRowCount(), 72 t1.getStatistic().getRowCount()); 73 if (c != 0) { 74 return c; 75 } 76 // Tie-break based on table name. ** CID 301729: Null pointer dereferences (NULL_RETURNS) /core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java: 58 in <lambda implementing org.apache.calcite.rel.metadata.UnboundMetadata>.bind() ________________________________________________________________________________________________________ *** CID 301729: Null pointer dereferences (NULL_RETURNS) /core/src/main/java/org/apache/calcite/plan/hep/HepRelMetadataProvider.java: 58 in <lambda implementing org.apache.calcite.rel.metadata.UnboundMetadata>.bind() 52 } 53 HepRelVertex vertex = (HepRelVertex) rel; 54 final RelNode rel2 = vertex.getCurrentRel(); 55 UnboundMetadata<M> function = 56 rel.getCluster().getMetadataProvider().apply(rel2.getClass(), 57 metadataClass); >>> CID 301729: Null pointer dereferences (NULL_RETURNS) >>> Calling a method on null object "function". 58 return function.bind(rel2, mq); 59 }; 60 } 61 62 public <M extends Metadata> Multimap<Method, MetadataHandler<M>> handlers( 63 MetadataDef<M> def) { ** CID 301725: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 13221 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 13191 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301725: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 13221 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 13215 return jjMoveStringLiteralDfa15_2(active0, 0x8000000000000000L, active1, 0x4000000000000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 13216 case 86: 13217 case 118: 13218 return jjMoveStringLiteralDfa15_2(active0, 0L, active1, 0L, active2, 0x6L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 13219 case 88: 13220 case 120: >>> CID 301725: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x400000000000L" looks like a copy-paste error. 13221 if ((active8 & 0x400000000000L) != 0L) 13222 return jjStartNfaWithStates_2(14, 558, 86); 13223 else if ((active9 & 0x1000L) != 0L) 13224 return jjStartNfaWithStates_2(14, 588, 86); 13225 break; 13226 case 89: /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 13191 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_2(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 13185 case 109: 13186 return jjMoveStringLiteralDfa15_2(active0, 0L, active1, 0x10000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 13187 case 78: 13188 case 110: 13189 if ((active0 & 0x800000000L) != 0L) 13190 return jjStartNfaWithStates_2(14, 35, 86); >>> CID 301725: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x20000000000L" looks like a copy-paste error. 13191 else if ((active8 & 0x20000000000L) != 0L) 13192 return jjStartNfaWithStates_2(14, 553, 86); 13193 return jjMoveStringLiteralDfa15_2(active0, 0L, active1, 0x2L, active2, 0L, active4, 0L, active5, 0x2000000000000L, active6, 0x2000000000000L, active7, 0L, active8, 0L, active9, 0L); 13194 case 79: 13195 case 111: 13196 return jjMoveStringLiteralDfa15_2(active0, 0L, active1, 0x200000000300000L, active2, 0xc000000000L, active4, 0L, active5, 0L, active6, 0L, active7, 0xc000000000000000L, active8, 0x9L, active9, 0x180L); ** CID 301722: API usage errors (SWAPPED_ARGUMENTS) ________________________________________________________________________________________________________ *** CID 301722: API usage errors (SWAPPED_ARGUMENTS) /core/src/main/java/org/apache/calcite/util/mapping/Mappings.java: 1668 in org.apache.calcite.util.mapping.Mappings$8.next()() 1662 public boolean hasNext() { 1663 return parentIter.hasNext(); 1664 } 1665 1666 public IntPair next() { 1667 IntPair parentPair = parentIter.next(); >>> CID 301722: API usage errors (SWAPPED_ARGUMENTS) >>> The positions of arguments in the constructor for >>> "org.apache.calcite.util.mapping.IntPair" do not match the ordering of the >>> parameters: * "parentPair.target" is passed to "source" * "parentPair.source" is passed to "target" 1668 return new IntPair(parentPair.target, parentPair.source); 1669 } 1670 1671 public void remove() { 1672 parentIter.remove(); 1673 } ** CID 301721: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 8276 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 8246 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301721: (COPY_PASTE_ERROR) /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 8276 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 8270 return jjMoveStringLiteralDfa15_0(active0, 0x8000000000000000L, active1, 0x4000000000000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8271 case 86: 8272 case 118: 8273 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0L, active2, 0x6L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8274 case 88: 8275 case 120: >>> CID 301721: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x400000000000L" looks like a copy-paste error. 8276 if ((active8 & 0x400000000000L) != 0L) 8277 return jjStartNfaWithStates_0(14, 558, 86); 8278 else if ((active9 & 0x1000L) != 0L) 8279 return jjStartNfaWithStates_0(14, 588, 86); 8280 break; 8281 case 89: /babel/target/generated-sources/javacc/org/apache/calcite/sql/parser/babel/SqlBabelParserImplTokenManager.java: 8246 in org.apache.calcite.sql.parser.babel.SqlBabelParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 8240 case 109: 8241 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x10000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8242 case 78: 8243 case 110: 8244 if ((active0 & 0x800000000L) != 0L) 8245 return jjStartNfaWithStates_0(14, 35, 86); >>> CID 301721: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x20000000000L" looks like a copy-paste error. 8246 else if ((active8 & 0x20000000000L) != 0L) 8247 return jjStartNfaWithStates_0(14, 553, 86); 8248 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x2L, active2, 0L, active4, 0L, active5, 0x2000000000000L, active6, 0x2000000000000L, active7, 0L, active8, 0L, active9, 0L); 8249 case 79: 8250 case 111: 8251 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x200000000300000L, active2, 0xc000000000L, active4, 0L, active5, 0L, active6, 0L, active7, 0xc000000000000000L, active8, 0x9L, active9, 0x180L); ** CID 301720: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 7238 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 301720: Incorrect expression (COPY_PASTE_ERROR) /core/target/generated-sources/javacc/org/apache/calcite/sql/parser/impl/SqlParserImplTokenManager.java: 7238 in org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.jjMoveStringLiteralDfa7_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 7232 case 112: 7233 if ((active9 & 0x800000000000L) != 0L) 7234 return jjStartNfaWithStates_0(7, 623, 89); 7235 return jjMoveStringLiteralDfa8_0(active0, 0L, active1, 0L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0x80000000000L, active8, 0x1000000000L, active9, 0L); 7236 case 82: 7237 case 114: >>> CID 301720: Incorrect expression (COPY_PASTE_ERROR) >>> "active7" in "active7 & 0x8000000000000L" looks like a copy-paste error. 7238 if ((active7 & 0x8000000000000L) != 0L) 7239 return jjStartNfaWithStates_0(7, 499, 89); 7240 else if ((active9 & 0x100000000000000L) != 0L) 7241 return jjStartNfaWithStates_0(7, 632, 89); 7242 return jjMoveStringLiteralDfa8_0(active0, 0x402000000L, active1, 0x80L, active2, 0L, active3, 0L, active4, 0L, active5, 0L, active6, 0x80000L, active7, 0L, active8, 0x100008000002000L, active9, 0x1000000100600L); 7243 case 83: ** CID 301718: API usage errors (SWAPPED_ARGUMENTS) ________________________________________________________________________________________________________ *** CID 301718: API usage errors (SWAPPED_ARGUMENTS) /core/src/main/java/org/apache/calcite/interpreter/SortNode.java: 107 in <lambda implementing java.util.Comparator>.compare() 101 return RelFieldCollation.compare(c1, c2, nullComparison); 102 }; 103 default: 104 return (o1, o2) -> { 105 final Comparable c1 = (Comparable) o1.getValues()[x]; 106 final Comparable c2 = (Comparable) o2.getValues()[x]; >>> CID 301718: API usage errors (SWAPPED_ARGUMENTS) >>> The positions of arguments in the call to "compare" do not match the >>> ordering of the parameters: * "c2" is passed to "c1" * "c1" is passed to "c2" 107 return RelFieldCollation.compare(c2, c1, -nullComparison); 108 }; 109 } 110 } 111 } 112 ** CID 294782: (COPY_PASTE_ERROR) /server/target/generated-sources/javacc/org/apache/calcite/sql/parser/ddl/SqlDdlParserImplTokenManager.java: 8298 in org.apache.calcite.sql.parser.ddl.SqlDdlParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() /server/target/generated-sources/javacc/org/apache/calcite/sql/parser/ddl/SqlDdlParserImplTokenManager.java: 8268 in org.apache.calcite.sql.parser.ddl.SqlDdlParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() ________________________________________________________________________________________________________ *** CID 294782: (COPY_PASTE_ERROR) /server/target/generated-sources/javacc/org/apache/calcite/sql/parser/ddl/SqlDdlParserImplTokenManager.java: 8298 in org.apache.calcite.sql.parser.ddl.SqlDdlParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 8292 return jjMoveStringLiteralDfa15_0(active0, 0x8000000000000000L, active1, 0x4000000000000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8293 case 86: 8294 case 118: 8295 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0L, active2, 0x6L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8296 case 88: 8297 case 120: >>> CID 294782: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x400000000000L" looks like a copy-paste error. 8298 if ((active8 & 0x400000000000L) != 0L) 8299 return jjStartNfaWithStates_0(14, 558, 86); 8300 else if ((active9 & 0x1000L) != 0L) 8301 return jjStartNfaWithStates_0(14, 588, 86); 8302 break; 8303 case 89: /server/target/generated-sources/javacc/org/apache/calcite/sql/parser/ddl/SqlDdlParserImplTokenManager.java: 8268 in org.apache.calcite.sql.parser.ddl.SqlDdlParserImplTokenManager.jjMoveStringLiteralDfa14_0(long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long)() 8262 case 109: 8263 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x10000L, active2, 0L, active4, 0L, active5, 0L, active6, 0L, active7, 0L, active8, 0L, active9, 0L); 8264 case 78: 8265 case 110: 8266 if ((active0 & 0x800000000L) != 0L) 8267 return jjStartNfaWithStates_0(14, 35, 86); >>> CID 294782: (COPY_PASTE_ERROR) >>> "active8" in "active8 & 0x20000000000L" looks like a copy-paste error. 8268 else if ((active8 & 0x20000000000L) != 0L) 8269 return jjStartNfaWithStates_0(14, 553, 86); 8270 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x2L, active2, 0L, active4, 0L, active5, 0x2000000000000L, active6, 0x2000000000000L, active7, 0L, active8, 0L, active9, 0L); 8271 case 79: 8272 case 111: 8273 return jjMoveStringLiteralDfa15_0(active0, 0L, active1, 0x200000000300000L, active2, 0xc000000000L, active4, 0L, active5, 0L, active6, 0L, active7, 0xc000000000000000L, active8, 0x9L, active9, 0x180L); ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRan3op15YHpCm8RcaPivZnSpzYrHR9Xr7hTlTUQgh0vKJU5bdgHSsbcZ-2F3rrmqEmCo-3D_HDu-2BON2WuckNVJ2U1s3AlNu0xlQjz2SMnuxHg99CGbGi7oULOAmS3e4y68tiNWNblhK2Rumqp7DpoxS-2BDIvIhnPUs1FdFP282pnCaE4zUEVAicMqlE7xXBcxFVlSP0-2BnWjyA2-2Fxlvq-2FPQsKh7ymOR5D8cf7hL-2BLSoKi9xwBzjjqOZawrlFee6hEAGfOtm3Qal1ilJMhblpuiPhb1wcTR2aNSydK7XAfOSJS-2B4qSrT4w-3D To manage Coverity Scan email notifications for "[email protected]", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4dQT9urTh9J6OaFWkUm12S6zRK5KzUxS3nCgz6orzYddp3k-2Bhwsn0MyNE8k5DIfLlndlgTA7Tk1u1w47SmFZBFB1JoqxgttMa-2FqeJ2nSLBlY-3D_HDu-2BON2WuckNVJ2U1s3AlNu0xlQjz2SMnuxHg99CGbGi7oULOAmS3e4y68tiNWNbaauk2Cc-2Bv3pBxYAh-2FxLnL46teYKTcqYWdnOktAVyhynKnWGjpuqa4vfOXSW6BXVpHf0G-2BxEMieXp1yQwu2-2BkuZq6tAYrPpKTE8fZybxbAPcuhrDRRAm4aPNkBENfmW-2FEzFe94Q3PoumUjVpHKqPXOSu1In0enofP6ZE0cIPMUZE-3D
