[
https://issues.apache.org/jira/browse/DRILL-6696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583921#comment-16583921
]
ASF GitHub Bot commented on DRILL-6696:
---------------------------------------
vdiravka commented on a change in pull request #1436: DRILL-6696: IOBE in
Operator Metric Registry
URL: https://github.com/apache/drill/pull/1436#discussion_r210902302
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/ops/OperatorMetricRegistry.java
##########
@@ -61,14 +66,11 @@
private static void register(final int operatorType, final Class<? extends
MetricDef> metricDef) {
// Currently registers a metric def that has enum constants
- final MetricDef[] enumConstants = metricDef.getEnumConstants();
- if (enumConstants != null) {
- final String[] names = new String[enumConstants.length];
- for (int i = 0; i < enumConstants.length; i++) {
- names[i] = enumConstants[i].name();
- }
- OPERATOR_METRICS[operatorType] = names;
- }
+ String[] names = Arrays.stream(metricDef.getEnumConstants())
Review comment:
My bad, not right `null` check. EnumConstants array should be checked.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> IOBE in Operator Metric Registry
> --------------------------------
>
> Key: DRILL-6696
> URL: https://issues.apache.org/jira/browse/DRILL-6696
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.14.0
> Reporter: Vitalii Diravka
> Assignee: Vitalii Diravka
> Priority: Major
> Fix For: 1.15.0
>
>
> There is an issue in _{{OperatorMetricRegistry}}_, OPERATOR_METRICS
> two-dimensional array doesn't check the index of element. If operator type
> value isn't a number in order - _{{ArrayIndexOutOfBoundsException}}_ will
> happen.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)