[
https://issues.apache.org/jira/browse/FLINK-8037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16329624#comment-16329624
]
ASF GitHub Bot commented on FLINK-8037:
---------------------------------------
Github user greghogan commented on a diff in the pull request:
https://github.com/apache/flink/pull/5205#discussion_r162199532
--- Diff: flink-core/src/main/java/org/apache/flink/util/AbstractID.java ---
@@ -186,7 +186,7 @@ private static long byteArrayToLong(byte[] ba, int
offset) {
long l = 0;
for (int i = 0; i < SIZE_OF_LONG; ++i) {
- l |= (ba[offset + SIZE_OF_LONG - 1 - i] & 0xffL) << (i
<< 3);
+ l |= (ba[offset + SIZE_OF_LONG - 1 - i] & 0xffL) <<
((long) i << 3);
--- End diff --
Agreed, I don't see any reason why this would be flagged per the Java
Language Specification. The nested shift also looks to be invalid according to
the Java BNF per the Java Language Specification. Will revert this change.
> Missing cast in integer arithmetic in
> TransactionalIdsGenerator#generateIdsToAbort
> ----------------------------------------------------------------------------------
>
> Key: FLINK-8037
> URL: https://issues.apache.org/jira/browse/FLINK-8037
> Project: Flink
> Issue Type: Bug
> Reporter: Ted Yu
> Assignee: Greg Hogan
> Priority: Minor
>
> {code}
> public Set<String> generateIdsToAbort() {
> Set<String> idsToAbort = new HashSet<>();
> for (int i = 0; i < safeScaleDownFactor; i++) {
> idsToAbort.addAll(generateIdsToUse(i * poolSize *
> totalNumberOfSubtasks));
> {code}
> The operands are integers where generateIdsToUse() expects long parameter.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)