private static int processAnnotation(Annotation annot, Position pos, int invocationLocation, int bestOffset) { int posBegin= pos.offset; int posEnd= posBegin + pos.length; if (isInside(invocationLocation, posBegin, posEnd)) { // covers invocation location? return invocationLocation; } else if (bestOffset != invocationLocation) { int newClosestPosition= computeBestOffset(posBegin, invocationLocation, bestOffset); if (newClosestPosition != -1) { if (newClosestPosition != bestOffset) { // new best if (JavaCorrectionProcessor.hasCorrections(annot)) { // only jump to it if there are proposals return newClosestPosition; } } } } return bestOffset; }
private static int processAnnotation(Annotation annot, Position pos, int invocationLocation, int bestOffset) { int posBegin= pos.offset; int posEnd= posBegin + pos.length; if (isInside(invocationLocation, posBegin, posEnd) && JavaCorrectionProcessor.hasCorrections(annot)) { // covers invocation location? return invocationLocation; } else if (bestOffset != invocationLocation) { int newClosestPosition= computeBestOffset(posBegin, invocationLocation, bestOffset); if (newClosestPosition != -1) { if (newClosestPosition != bestOffset) { // new best if (JavaCorrectionProcessor.hasCorrections(annot)) { // only jump to it if there are proposals return newClosestPosition; } } } } return bestOffset; }
private static int processAnnotation(Annotation annot, Position pos, int invocationLocation, int bestOffset) { int posBegin= pos.offset; int posEnd= posBegin + pos.length; if (isInside(invocationLocation, posBegin, posEnd) && JavaCorrectionProcessor.hasCorrections(annot)) { // covers invocation location? return invocationLocation; } else if (bestOffset != invocationLocation) { int newClosestPosition= computeBestOffset(posBegin, invocationLocation, bestOffset); if (newClosestPosition != -1) { if (newClosestPosition != bestOffset) { // new best if (JavaCorrectionProcessor.hasCorrections(annot)) { // only jump to it if there are proposals return newClosestPosition; } } } } return bestOffset; }