[FE][Bug] Fix overflow in RuntimeProfile.sortChildren. (#5377)
If the difference between the two times exceeds Integer.MAX_VALUE, the compare's return value will overflow and the flow exception may be triggered when sorting profile.
This commit is contained in:
@ -369,9 +369,8 @@ public class RuntimeProfile {
|
||||
@Override
|
||||
public int compare(Pair<RuntimeProfile, Boolean> profile1, Pair<RuntimeProfile, Boolean> profile2)
|
||||
{
|
||||
long distance = profile2.first.getCounterTotalTime().getValue()
|
||||
- profile1.first.getCounterTotalTime().getValue();
|
||||
return (int) distance;
|
||||
return Long.valueOf(profile2.first.getCounterTotalTime().getValue())
|
||||
.compareTo(profile1.first.getCounterTotalTime().getValue());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user