} catch (BadLocationException excp) { System.out.println(JavaTextMessages.getString("AutoIndent.error.bad_location.message1"));
} catch (BadLocationException e) { JavaPlugin.log(e);
	protected void smartInsertAfterBracket(IDocument d, DocumentCommand c) {		if (c.offset == -1 || d.getLength() == 0)			return;		try {			int p= (c.offset == d.getLength() ? c.offset - 1 : c.offset);			int line= d.getLineOfOffset(p);			int start= d.getLineOffset(line);			int whiteend= findEndOfWhiteSpace(d, start, c.offset);			// shift only when line does not contain any text up to the closing bracket			if (whiteend == c.offset) {				// evaluate the line with the opening bracket that matches out closing bracket				int indLine= findMatchingOpenBracket(d, line, c.offset, 1);				if (indLine != -1 && indLine != line) {					// take the indent of the found line					StringBuffer replaceText= new StringBuffer(getIndentOfLine(d, indLine));					// add the rest of the current line including the just added close bracket					replaceText.append(d.get(whiteend, c.offset - whiteend));					replaceText.append(c.text);					// modify document command					c.length += c.offset - start;					c.offset= start;					c.text= replaceText.toString();				}			}		} catch (BadLocationException excp) {			System.out.println(JavaTextMessages.getString("AutoIndent.error.bad_location.message1")); //$NON-NLS-1$		}	}