Program: 42938
Project: 42938
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  ApplicationManager.getApplication().runReadAction(new Runnable(){
    @Override public void run(){
      findModel.setStringToFind(getText());
      results=findAllVisible();
      String[] strings=calcWords(getText(),editor);
      for (      String string : strings) {
        findModel.setStringToFind(string);
        results.addAll(findAllVisible());
      }
      HashSet hashSet=new HashSet();
      hashSet.addAll(results);
      results.clear();
      results.addAll(hashSet);
      final int caretOffset=editor.getCaretModel().getOffset();
      RelativePoint caretPoint=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(caretOffset));
      final Point cP=caretPoint.getOriginalPoint();
      Collections.sort(results,new Comparator<Integer>(){
        @Override public int compare(        Integer o1,        Integer o2){
          RelativePoint o1Point=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(o1));
          RelativePoint o2Point=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(o2));
          Point o1P=o1Point.getOriginalPoint();
          Point o2P=o2Point.getOriginalPoint();
          double i1=Point.distance(o1P.x,o1P.y,cP.x,cP.y);
          double i2=Point.distance(o2P.x,o2P.y,cP.x,cP.y);
          if (i1 > i2) {
            return 1;
          }
 else           if (i1 == i2) {
            return 0;
          }
 else {
            return -1;
          }
        }
      }
);
      startResult=0;
      endResult=ALLOWED_RESULTS;
      showBalloons(results,startResult,endResult);
    }
  }
);
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (getText().length() < 2) {
    return;
  }
  ApplicationManager.getApplication().runReadAction(new Runnable(){
    @Override public void run(){
      System.out.println(getText());
      findModel.setStringToFind(getText());
      results=findAllVisible();
      String[] strings=calcWords(getText(),editor);
      for (      String string : strings) {
        findModel.setStringToFind(string);
        results.addAll(findAllVisible());
      }
      HashSet hashSet=new HashSet();
      hashSet.addAll(results);
      results.clear();
      results.addAll(hashSet);
      final int caretOffset=editor.getCaretModel().getOffset();
      RelativePoint caretPoint=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(caretOffset));
      final Point cP=caretPoint.getOriginalPoint();
      Collections.sort(results,new Comparator<Integer>(){
        @Override public int compare(        Integer o1,        Integer o2){
          RelativePoint o1Point=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(o1));
          RelativePoint o2Point=getPointFromVisualPosition(editor,editor.offsetToVisualPosition(o2));
          Point o1P=o1Point.getOriginalPoint();
          Point o2P=o2Point.getOriginalPoint();
          double i1=Point.distance(o1P.x,o1P.y,cP.x,cP.y);
          double i2=Point.distance(o2P.x,o2P.y,cP.x,cP.y);
          if (i1 > i2) {
            return 1;
          }
 else           if (i1 == i2) {
            return 0;
          }
 else {
            return -1;
          }
        }
      }
);
      startResult=0;
      endResult=ALLOWED_RESULTS;
      showBalloons(results,startResult,endResult);
    }
  }
);
}