View | Details | Raw Unified | Return to bug 305001 | Differences between
and this patch

Collapse All | Expand All

(-)dom/org/eclipse/jdt/core/dom/NodeFinder.java (-2 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 149-156 Link Here
149
			IBuffer buffer= source.getBuffer();
149
			IBuffer buffer= source.getBuffer();
150
			if (buffer != null) {
150
			if (buffer != null) {
151
				IScanner scanner= ToolFactory.createScanner(false, false, false, false);
151
				IScanner scanner= ToolFactory.createScanner(false, false, false, false);
152
				scanner.setSource(buffer.getText(start, length).toCharArray());
153
				try {
152
				try {
153
					scanner.setSource(buffer.getText(start, length).toCharArray());
154
					int token= scanner.getNextToken();
154
					int token= scanner.getNextToken();
155
					if (token != ITerminalSymbols.TokenNameEOF) {
155
					if (token != ITerminalSymbols.TokenNameEOF) {
156
						int tStart= scanner.getCurrentTokenStartPosition();
156
						int tStart= scanner.getCurrentTokenStartPosition();
Lines 163-168 Link Here
163
					}
163
					}
164
				} catch (InvalidInputException e) {
164
				} catch (InvalidInputException e) {
165
					// ignore
165
					// ignore
166
				} catch (IndexOutOfBoundsException e) {
167
					// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305001
168
					return null;
166
				}
169
				}
167
			}
170
			}
168
		}
171
		}
(-)model/org/eclipse/jdt/core/IBuffer.java (-3 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 152-163 Link Here
152
 * Returns the given range of text in this buffer.
152
 * Returns the given range of text in this buffer.
153
 * <p>
153
 * <p>
154
 * The returned value is undefined if the buffer is closed.
154
 * The returned value is undefined if the buffer is closed.
155
 * </p>
155
 *
156
 *
156
 * @param offset the  zero-based starting offset
157
 * @param offset the zero-based starting offset
157
 * @param length the number of characters to retrieve
158
 * @param length the number of characters to retrieve
158
 * @return the given range of text in this buffer
159
 * @return the given range of text in this buffer
160
 * @exception IndexOutOfBoundsException when buffer is out of synch
159
 */
161
 */
160
public String getText(int offset, int length);
162
public String getText(int offset, int length) throws IndexOutOfBoundsException;
161
/**
163
/**
162
 * Returns the underlying resource for which this buffer was opened,
164
 * Returns the underlying resource for which this buffer was opened,
163
 * or <code>null</code> if this buffer was not opened on a resource.
165
 * or <code>null</code> if this buffer was not opened on a resource.
(-)model/org/eclipse/jdt/internal/core/Member.java (-2 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 279-286 Link Here
279
	final int length= range.getLength();
279
	final int length= range.getLength();
280
	if (length > 0 && buf.getChar(start) == '/') {
280
	if (length > 0 && buf.getChar(start) == '/') {
281
		IScanner scanner= ToolFactory.createScanner(true, false, false, false);
281
		IScanner scanner= ToolFactory.createScanner(true, false, false, false);
282
		scanner.setSource(buf.getText(start, length).toCharArray());
283
		try {
282
		try {
283
			scanner.setSource(buf.getText(start, length).toCharArray());
284
			int docOffset= -1;
284
			int docOffset= -1;
285
			int docEnd= -1;
285
			int docEnd= -1;
286
286
Lines 305-310 Link Here
305
			}
305
			}
306
		} catch (InvalidInputException ex) {
306
		} catch (InvalidInputException ex) {
307
			// try if there is inherited Javadoc
307
			// try if there is inherited Javadoc
308
		} catch (IndexOutOfBoundsException e) {
309
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=305001
308
		}
310
		}
309
	}
311
	}
310
	return null;
312
	return null;

Return to bug 305001