System.out.println("ERROR:BlockMarker.findOtherPositionsForIf(...):Parameter startLineIndex out of bounds.");
    private List findOtherPositionsforElse(int startLineIndex) {        int level = 0;        this.state.setState(STATE_SEARCH_FOR_ELSE);                IDocument document = getDocument();        int maxLineIndex = document.getNumberOfLines() - 1;        List positionsOfCorrespondingBlockElements = new LinkedList();                if(startLineIndex < 0 || startLineIndex > maxLineIndex) {            System.out.println("ERROR:BlockMarker.findOtherPositionsForIf(...):Parameter startLineIndex out of bounds.");            return positionsOfCorrespondingBlockElements;        }                int currentLineIndex;        Position directiveAsPosition;        String directiveAsString;                // Advance up the document.        for(currentLineIndex = startLineIndex;currentLineIndex >= 0; currentLineIndex--) {            directiveAsPosition = PolishDocumentUtils.extractDirectiveFromLine(getDocument(),currentLineIndex);                       directiveAsString = PolishDocumentUtils.makeStringFromPosition(getDocument(),directiveAsPosition);            if(directiveAsString == null){                System.out.println("ERROR:BlockMarker.findOtherPositionsOfIf(...):Parameter 'directiveAsString' is null.");                continue;            }            //          Use intern to speed comparison up a bit.            directiveAsString = directiveAsString.intern();	                    if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.IF_DIRECTIVES) && level == 0 && this.state.isInState(STATE_SEARCH_FOR_IF)) {	            positionsOfCorrespondingBlockElements.add(directiveAsPosition);	            break;	        }                        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.ELSE_DIRECTIVES) && level == 0 && this.state.isInState(STATE_SEARCH_FOR_ELSE)) {	            positionsOfCorrespondingBlockElements.add(directiveAsPosition);	            this.state.reset();	            this.state.addState(STATE_SEARCH_FOR_IF);	            this.state.addState(STATE_SEARCH_FOR_ELSE);	            continue;	        }            //          We found a nested if block.	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.IF_DIRECTIVES) && ! this.state.isInState(STATE_SEARCH_FOR_IF)) { 	            level = level + 1;	            continue;	        }	        // We found a endif in the wrong level.	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.ENDIF_DIRECTIVES) && ! this.state.isInState(STATE_SEARCH_FOR_ENDIF)) {	            level = level - 1;	            continue;	        }        }                // We found the corresponding if, search for the endif and other else.        this.state.reset();        this.state.addState(STATE_SEARCH_FOR_ENDIF);        this.state.addState(STATE_SEARCH_FOR_ELSE);        //      Advance down the document.        for(currentLineIndex = startLineIndex+1;currentLineIndex <= maxLineIndex; currentLineIndex++) {            directiveAsPosition = PolishDocumentUtils.extractDirectiveFromLine(getDocument(),currentLineIndex);            //          Do we have a directive in this line?            if(directiveAsPosition == null) {                // ... if not, try the next line.               continue;            }            directiveAsString = PolishDocumentUtils.makeStringFromPosition(getDocument(),directiveAsPosition);            if(directiveAsString == null){                System.out.println("ERROR:BlockMarker.findOtherPositionsOfIf(...):Parameter 'directiveAsString' is null.");                continue;            }            	        // Use intern to speed comparison up a bit.            directiveAsString = directiveAsString.intern();	        	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.ELSE_DIRECTIVES) && level == 0 && this.state.isInState(STATE_SEARCH_FOR_ELSE)) {	            positionsOfCorrespondingBlockElements.add(directiveAsPosition);	            this.state.reset();	            this.state.addState(STATE_SEARCH_FOR_ENDIF);	            this.state.addState(STATE_SEARCH_FOR_ELSE); // We may find other else on this level.	            continue;	        }	        // We found a endif on this line in the right level.	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.ENDIF_DIRECTIVES) && level == 0 && this.state.isInState(STATE_SEARCH_FOR_ENDIF)) {	            positionsOfCorrespondingBlockElements.add(directiveAsPosition);	            // Dont go any further, we reached the corresponding endif to this if.	            break;	        }	        // We found a nested if block.	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.IF_DIRECTIVES) && ! this.state.isInState(STATE_SEARCH_FOR_IF)) { 	            level = level + 1;	            continue;	        }	        // We found a endif in the wrong level.	        if(PolishDocumentUtils.isDirectiveInCategory(directiveAsString,IPolishConstants.ENDIF_DIRECTIVES) && ! this.state.isInState(STATE_SEARCH_FOR_ENDIF)) {	            level = level - 1;	            continue;	        }        }                return positionsOfCorrespondingBlockElements;    }