eclipse-platform / eclipse-platform/eclipse.platform

Type overflow in DocumentMerger when scrolling a large file

Open
#646 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
165
Forks
174
Avg merge
2d 8h
Merged PRs (30d)
22

Description

When file is quite large, and scrolling is needed, org.eclipse.compare.internal.merge.DocumentMerger.realToVirtualPosition(char, int) method can have type overflow when multiplying (see 1022 line). This gives sometimes negative number and results in wrong scrolling position for example.

In similar method virtualToRealPosition this doesnot seem to be a problem since multiplication of numbers happen after division and overflow is unlikely to happen, so may be similar approach should be used to realToVirtualPosition function

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.