Mercurial > projects > dwt-addons
diff dwtx/jface/text/projection/ProjectionMapping.d @ 136:6dcb0baaa031
Regex removal of throws decls, some instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:20:40 +0200 |
parents | 51e6e63f930e |
children | 26688fec6d23 |
line wrap: on
line diff
--- a/dwtx/jface/text/projection/ProjectionMapping.d Sun Aug 24 01:52:31 2008 +0200 +++ b/dwtx/jface/text/projection/ProjectionMapping.d Sun Aug 24 02:20:40 2008 +0200 @@ -114,7 +114,7 @@ return fCachedFragments; } - private int findSegmentIndex(int offset) throws BadLocationException { + private int findSegmentIndex(int offset) { Position[] segments= getSegments(); if (segments.length is 0) { if (offset > 0) @@ -140,7 +140,7 @@ } } - private Segment findSegment(int offset) throws BadLocationException { + private Segment findSegment(int offset) { checkImageOffset(offset); @@ -181,7 +181,7 @@ * @throws BadLocationException if the index is not valid on the master * document */ - private int findFragmentIndex(int offset, int extensionDirection) throws BadLocationException { + private int findFragmentIndex(int offset, int extensionDirection) { try { Position[] fragments= getFragments(); @@ -211,7 +211,7 @@ } } - private Fragment findFragment(int offset) throws BadLocationException { + private Fragment findFragment(int offset) { checkOriginOffset(offset); int index= findFragmentIndex(offset, NONE); @@ -242,7 +242,7 @@ * @return the image region of <code>originRegion</code> * @throws BadLocationException if the region is not a valid origin region */ - private IRegion toImageRegion(IRegion originRegion, bool exact, bool takeClosestImage) throws BadLocationException { + private IRegion toImageRegion(IRegion originRegion, bool exact, bool takeClosestImage) { if (originRegion.getLength() is 0 && !takeClosestImage) { int imageOffset= toImageOffset(originRegion.getOffset()); return imageOffset is -1 ? null : new Region(imageOffset, 0); @@ -305,7 +305,7 @@ * not exist * @throws BadLocationException if the region is not a valid origin region */ - private Fragment[] findFragments(IRegion originRegion, bool exact, bool takeClosestImage) throws BadLocationException { + private Fragment[] findFragments(IRegion originRegion, bool exact, bool takeClosestImage) { Position[] fragments= getFragments(); if (fragments.length is 0) return null; @@ -388,7 +388,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toOriginOffset(int) */ - public int toOriginOffset(int imageOffset) throws BadLocationException { + public int toOriginOffset(int imageOffset) { Segment segment= findSegment(imageOffset); int relative= imageOffset - segment.offset; return segment.fragment.offset + relative; @@ -397,7 +397,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toOriginRegion(dwtx.jface.text.IRegion) */ - public IRegion toOriginRegion(IRegion imageRegion) throws BadLocationException { + public IRegion toOriginRegion(IRegion imageRegion) { int imageOffset= imageRegion.getOffset(); int imageLength= imageRegion.getLength(); @@ -420,7 +420,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toOriginLines(int) */ - public IRegion toOriginLines(int imageLine) throws BadLocationException { + public IRegion toOriginLines(int imageLine) { IRegion imageRegion= fSlaveDocument.getLineInformation(imageLine); IRegion originRegion= toOriginRegion(imageRegion); @@ -435,7 +435,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toOriginLine(int) */ - public int toOriginLine(int imageLine) throws BadLocationException { + public int toOriginLine(int imageLine) { IRegion lines= toOriginLines(imageLine); return (lines.getLength() > 1 ? -1 : lines.getOffset()); } @@ -443,7 +443,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toImageOffset(int) */ - public int toImageOffset(int originOffset) throws BadLocationException { + public int toImageOffset(int originOffset) { Fragment fragment= findFragment(originOffset); if (fragment !is null) { int relative= originOffset - fragment.offset; @@ -455,14 +455,14 @@ /* * @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactImageRegion(dwtx.jface.text.IRegion) */ - public IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException { + public IRegion toExactImageRegion(IRegion originRegion) { return toImageRegion(originRegion, true, false); } /* * @see dwtx.jface.text.IDocumentInformationMapping#toImageRegion(dwtx.jface.text.IRegion) */ - public IRegion toImageRegion(IRegion originRegion) throws BadLocationException { + public IRegion toImageRegion(IRegion originRegion) { return toImageRegion(originRegion, false, false); } @@ -470,14 +470,14 @@ * @see dwtx.jface.text.IDocumentInformationMappingExtension2#toClosestImageRegion(dwtx.jface.text.IRegion) * @since 3.1 */ - public IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException { + public IRegion toClosestImageRegion(IRegion originRegion) { return toImageRegion(originRegion, false, true); } /* * @see dwtx.jface.text.IDocumentInformationMapping#toImageLine(int) */ - public int toImageLine(int originLine) throws BadLocationException { + public int toImageLine(int originLine) { IRegion originRegion= fMasterDocument.getLineInformation(originLine); IRegion imageRegion= toImageRegion(originRegion); if (imageRegion is null) { @@ -502,7 +502,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMapping#toClosestImageLine(int) */ - public int toClosestImageLine(int originLine) throws BadLocationException { + public int toClosestImageLine(int originLine) { try { int imageLine= toImageLine(originLine); @@ -546,7 +546,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactOriginRegions(dwtx.jface.text.IRegion) */ - public IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException { + public IRegion[] toExactOriginRegions(IRegion imageRegion) { if (imageRegion.getLength() is 0) return new IRegion[] { new Region(toOriginOffset(imageRegion.getOffset()), 0) }; @@ -597,7 +597,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactImageRegions(dwtx.jface.text.IRegion) */ - public IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException { + public IRegion[] toExactImageRegions(IRegion originRegion) { int offset= originRegion.getOffset(); if (originRegion.getLength() is 0) { @@ -642,7 +642,7 @@ /* * @see dwtx.jface.text.IDocumentInformationMappingExtension#getExactCoverage(dwtx.jface.text.IRegion) */ - public IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException { + public IRegion[] getExactCoverage(IRegion originRegion) { int originOffset= originRegion.getOffset(); int originLength= originRegion.getLength(); @@ -686,7 +686,7 @@ return result; } - private final void checkOriginRegion(IRegion originRegion) throws BadLocationException { + private final void checkOriginRegion(IRegion originRegion) { int offset= originRegion.getOffset(); int endOffset= inclusiveEnd(originRegion); int max= fMasterDocument.getLength(); @@ -694,12 +694,12 @@ throw new BadLocationException(); } - private final void checkOriginOffset(int originOffset) throws BadLocationException { + private final void checkOriginOffset(int originOffset) { if (originOffset < 0 || originOffset > fMasterDocument.getLength()) throw new BadLocationException(); } - private final void checkImageOffset(int imageOffset) throws BadLocationException { + private final void checkImageOffset(int imageOffset) { if (imageOffset < 0 || imageOffset > getImageLength()) throw new BadLocationException(); }