Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
chore: add comment describing the reason for catching the error
Browse files Browse the repository at this point in the history
  • Loading branch information
L1nc0ln committed Aug 28, 2023
1 parent cfa2b74 commit 117b8a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gui/src/main/java/de/adito/git/gui/swing/TextPaneUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ private static LineNumber _calculateLineNumberPos(@NonNull JTextComponent pEdito
.map(pRectangle -> new LineNumber(pLineIndex + 1, 0, (int) pRectangle.getY(), (int) pRectangle.getHeight()))
.orElse(new LineNumber(pLineIndex + 1, 0, 0, 0));
}
// it is possible that the modelToView causes a mutex error if called outside the EDT (very small chance though). If we wait for the EDT here,
// the result isn't properly rendered however -> quick way is to just catch the error. In the future, a rework may be done that properly uses the EDT thread
catch (Error pError)
{
LOGGER.log(Level.WARNING, "Git Plugin: Error determining line position", pError);
Expand Down

0 comments on commit 117b8a8

Please sign in to comment.