int (final Instruction[] flow, final PsiElement element) { for (int i=0;i<flow.length;i++) { // Check if canceled ProgressManager.checkCanceled(); if (element == flow[i].getElement()){ return i; } } return -1; }