/** @see ISourceReference */ public String getSource() throws JavaModelException { IOpenable openable = this.parent.getOpenableParent(); IBuffer buffer = openable.getBuffer(); if (buffer == null) { return null; } ISourceRange range = getSourceRange(); int offset = range.getOffset(); int length = range.getLength(); if (offset == -1 || length == 0) { return null; } try { return buffer.getText(offset, length); } catch (RuntimeException e) { return null; } }
/* * If the given parent was the one that increased the space limit, reset the space limit to the * given default value. */ protected void resetSpaceLimit(int defaultLimit, IOpenable parent) { if (parent.equals(this.spaceLimitParent)) { setSpaceLimit(defaultLimit); this.spaceLimitParent = null; } }