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

Collapse All | Expand All

(-)search/org/eclipse/jdt/internal/core/search/matching/InternalFieldReferenceMatch.java (-45 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.matching;
12
13
import org.eclipse.core.resources.IResource;
14
import org.eclipse.jdt.core.*;
15
import org.eclipse.jdt.core.search.*;
16
17
/**
18
 * A method reference match that stores the local element
19
 */
20
public class InternalFieldReferenceMatch extends FieldReferenceMatch {
21
22
	IJavaElement localElement;
23
24
public InternalFieldReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean isReadAccess, boolean isWriteAccess, boolean insideDocComment, SearchParticipant participant, IResource resource) {
25
	super(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource);
26
}
27
28
/**
29
 * Return the stored local element.
30
 *
31
 * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement()
32
 */
33
protected IJavaElement localElement() {
34
	return this.localElement;
35
}
36
37
/**
38
 * Store the local element in the match.
39
 *
40
 * @param element The local element to be stored
41
 */
42
public void localElement(IJavaElement element) {
43
	this.localElement = element;
44
}
45
}
(-)search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java (-2 / +3 lines)
Lines 16-21 Link Here
16
import org.eclipse.jdt.core.IPackageFragment;
16
import org.eclipse.jdt.core.IPackageFragment;
17
import org.eclipse.jdt.core.IPackageFragmentRoot;
17
import org.eclipse.jdt.core.IPackageFragmentRoot;
18
import org.eclipse.jdt.core.JavaModelException;
18
import org.eclipse.jdt.core.JavaModelException;
19
import org.eclipse.jdt.core.search.PackageReferenceMatch;
19
import org.eclipse.jdt.core.search.SearchPattern;
20
import org.eclipse.jdt.core.search.SearchPattern;
20
import org.eclipse.jdt.core.compiler.CharOperation;
21
import org.eclipse.jdt.core.compiler.CharOperation;
21
import org.eclipse.jdt.internal.compiler.ast.*;
22
import org.eclipse.jdt.internal.compiler.ast.*;
Lines 262-269 Link Here
262
	if (last > positions.length) last = positions.length;
263
	if (last > positions.length) last = positions.length;
263
	int sourceStart = (int) (positions[0] >>> 32);
264
	int sourceStart = (int) (positions[0] >>> 32);
264
	int sourceEnd = ((int) positions[last - 1]);
265
	int sourceEnd = ((int) positions[last - 1]);
265
	InternalPackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference);
266
	PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference);
266
	packageReferenceMatch.localElement(localElement);
267
	packageReferenceMatch.setLocalElement(localElement);
267
	this.match = packageReferenceMatch;
268
	this.match = packageReferenceMatch;
268
	locator.report(this.match);
269
	locator.report(this.match);
269
}
270
}
(-)search/org/eclipse/jdt/internal/core/search/matching/InternalPackageReferenceMatch.java (-45 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.matching;
12
13
import org.eclipse.core.resources.IResource;
14
import org.eclipse.jdt.core.*;
15
import org.eclipse.jdt.core.search.*;
16
17
/**
18
 * A package reference match that stores the local element
19
 */
20
public class InternalPackageReferenceMatch extends PackageReferenceMatch {
21
22
	IJavaElement localElement;
23
24
public InternalPackageReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource) {
25
	super(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource);
26
}
27
28
/**
29
 * Return the stored local element.
30
 *
31
 * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement()
32
 */
33
protected IJavaElement localElement() {
34
	return this.localElement;
35
}
36
37
/**
38
 * Store the local element in the match.
39
 *
40
 * @param element The local element to be stored
41
 */
42
public void localElement(IJavaElement element) {
43
	this.localElement = element;
44
}
45
}
(-)search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java (-2 / +2 lines)
Lines 333-340 Link Here
333
			reportDeclaration(methodBinding, locator, declPattern.knownMethods);
333
			reportDeclaration(methodBinding, locator, declPattern.knownMethods);
334
		}
334
		}
335
	} else {
335
	} else {
336
		InternalMethodReferenceMatch methodReferenceMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, -1, -1, false /*not constructor*/, false/*not synthetic*/, reference);
336
		MethodReferenceMatch methodReferenceMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, -1, -1, false /*not constructor*/, false/*not synthetic*/, reference);
337
		methodReferenceMatch.localElement(localElement);
337
		methodReferenceMatch.setLocalElement(localElement);
338
		this.match = methodReferenceMatch;
338
		this.match = methodReferenceMatch;
339
		if (this.pattern.findReferences && reference instanceof MessageSend) {
339
		if (this.pattern.findReferences && reference instanceof MessageSend) {
340
			IJavaElement focus = this.pattern.focus;
340
			IJavaElement focus = this.pattern.focus;
(-)search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java (-6 / +6 lines)
Lines 1423-1430 Link Here
1423
	if (enclosingBinding != null) {
1423
	if (enclosingBinding != null) {
1424
		enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding);
1424
		enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding);
1425
	}
1425
	}
1426
	InternalFieldReferenceMatch match = new InternalFieldReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource);
1426
	FieldReferenceMatch match = new FieldReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource);
1427
	match.localElement(localElement);
1427
	match.setLocalElement(localElement);
1428
	return match;
1428
	return match;
1429
}
1429
}
1430
1430
Lines 1462-1468 Link Here
1462
	return new LocalVariableReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource);
1462
	return new LocalVariableReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource);
1463
}
1463
}
1464
1464
1465
public InternalMethodReferenceMatch newMethodReferenceMatch(
1465
public MethodReferenceMatch newMethodReferenceMatch(
1466
		IJavaElement enclosingElement,
1466
		IJavaElement enclosingElement,
1467
		Binding enclosingBinding,
1467
		Binding enclosingBinding,
1468
		int accuracy,
1468
		int accuracy,
Lines 1477-1486 Link Here
1477
	if (enclosingBinding != null)
1477
	if (enclosingBinding != null)
1478
		enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding);
1478
		enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding);
1479
	boolean isOverridden = (accuracy & PatternLocator.SUPER_INVOCATION_FLAVOR) != 0;
1479
	boolean isOverridden = (accuracy & PatternLocator.SUPER_INVOCATION_FLAVOR) != 0;
1480
	return new InternalMethodReferenceMatch(enclosingElement, accuracy, offset, length, isConstructor, isSynthetic, isOverridden, insideDocComment, participant, resource);
1480
	return new MethodReferenceMatch(enclosingElement, accuracy, offset, length, isConstructor, isSynthetic, isOverridden, insideDocComment, participant, resource);
1481
}
1481
}
1482
1482
1483
public InternalPackageReferenceMatch newPackageReferenceMatch(
1483
public PackageReferenceMatch newPackageReferenceMatch(
1484
		IJavaElement enclosingElement,
1484
		IJavaElement enclosingElement,
1485
		int accuracy,
1485
		int accuracy,
1486
		int offset,
1486
		int offset,
Lines 1489-1495 Link Here
1489
	SearchParticipant participant = getParticipant();
1489
	SearchParticipant participant = getParticipant();
1490
	IResource resource = this.currentPossibleMatch.resource;
1490
	IResource resource = this.currentPossibleMatch.resource;
1491
	boolean insideDocComment = (reference.bits & ASTNode.InsideJavadoc) != 0;
1491
	boolean insideDocComment = (reference.bits & ASTNode.InsideJavadoc) != 0;
1492
	return new InternalPackageReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource);
1492
	return new PackageReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource);
1493
}
1493
}
1494
1494
1495
public SearchMatch newTypeParameterReferenceMatch(
1495
public SearchMatch newTypeParameterReferenceMatch(
(-)search/org/eclipse/jdt/internal/core/search/matching/InternalMethodReferenceMatch.java (-45 lines)
Removed Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.core.search.matching;
12
13
import org.eclipse.core.resources.IResource;
14
import org.eclipse.jdt.core.*;
15
import org.eclipse.jdt.core.search.*;
16
17
/**
18
 * A field reference match that stores the local element
19
 */
20
public class InternalMethodReferenceMatch extends MethodReferenceMatch {
21
22
	IJavaElement localElement;
23
24
public InternalMethodReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean constructor, boolean synthetic, boolean superInvocation, boolean insideDocComment, SearchParticipant participant, IResource resource) {
25
	super(enclosingElement, accuracy, offset, length, constructor, synthetic, superInvocation, insideDocComment, participant, resource);
26
}
27
28
/**
29
 * Return the stored local element.
30
 *
31
 * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement()
32
 */
33
protected IJavaElement localElement() {
34
	return this.localElement;
35
}
36
37
/**
38
 * Store the local element in the match.
39
 *
40
 * @param element The local element to be stored
41
 */
42
public void localElement(IJavaElement element) {
43
	this.localElement = element;
44
}
45
}
(-)search/org/eclipse/jdt/core/search/ReferenceMatch.java (-10 / +9 lines)
Lines 15-27 Link Here
15
15
16
/**
16
/**
17
 * An abstract Java search match that represents a reference.
17
 * An abstract Java search match that represents a reference.
18
 * <p>
18
 * 
19
 * This class is not intended to be subclassed by clients.
20
 * </p>
21
 * @since 3.4
19
 * @since 3.4
22
 */
20
 */
23
public abstract class ReferenceMatch extends SearchMatch {
21
public abstract class ReferenceMatch extends SearchMatch {
24
22
23
	IJavaElement localElement;
24
25
/**
25
/**
26
 * Creates a new reference match.
26
 * Creates a new reference match.
27
 *
27
 *
Lines 116-133 Link Here
116
 * @since 3.4
116
 * @since 3.4
117
 */
117
 */
118
final public IJavaElement getLocalElement() {
118
final public IJavaElement getLocalElement() {
119
	return localElement();
119
	return this.localElement;
120
}
120
}
121
121
122
/**
122
/**
123
 * Return the stored local element.
123
 * Store the local element in the match.
124
 *
124
 *
125
 * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement()
125
 * @param element The local element to be stored
126
 * 
126
 * 
127
 * @noreference This method is not intended to be referenced by clients.
127
 * @since 3.5
128
 * @nooverride This method is not intended to be re-implemented or extended by clients.
129
 */
128
 */
130
protected IJavaElement localElement() {
129
final public void setLocalElement(IJavaElement element) {
131
	return null;
130
	this.localElement = element;
132
}
131
}
133
}
132
}
(-)search/org/eclipse/jdt/core/search/TypeReferenceMatch.java (-21 lines)
Lines 24-30 Link Here
24
 */
24
 */
25
public class TypeReferenceMatch extends ReferenceMatch {
25
public class TypeReferenceMatch extends ReferenceMatch {
26
26
27
	private IJavaElement localElement;
28
	private IJavaElement[] otherElements;
27
	private IJavaElement[] otherElements;
29
28
30
/**
29
/**
Lines 84-109 Link Here
84
}
83
}
85
84
86
/**
85
/**
87
 * Return the stored local element.
88
 *
89
 * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement()
90
 */
91
protected IJavaElement localElement() {
92
	return this.localElement;
93
}
94
95
/**
96
 * Sets the local element of this search match.
97
 *
98
 * @param element A more specific local element that corresponds to the match,
99
 * 	or <code>null</code> if none
100
 * @since 3.2
101
 */
102
public final void setLocalElement(IJavaElement element) {
103
	this.localElement = element;
104
}
105
106
/**
107
 * Sets the other elements of this search match.
86
 * Sets the other elements of this search match.
108
 *
87
 *
109
 * @see #getOtherElements()
88
 * @see #getOtherElements()
(-).settings/.api_filters (+8 lines)
Lines 7-12 Link Here
7
            </message_arguments>
7
            </message_arguments>
8
        </filter>
8
        </filter>
9
    </resource>
9
    </resource>
10
    <resource path="search/org/eclipse/jdt/core/search/ReferenceMatch.java" type="org.eclipse.jdt.core.search.ReferenceMatch">
11
        <filter id="338792546">
12
            <message_arguments>
13
                <message_argument value="org.eclipse.jdt.core.search.ReferenceMatch"/>
14
                <message_argument value="localElement()"/>
15
            </message_arguments>
16
        </filter>
17
    </resource>
10
    <resource path="model/org/eclipse/jdt/core/compiler/CompilationParticipant.java" type="org.eclipse.jdt.core.compiler.CompilationParticipant">
18
    <resource path="model/org/eclipse/jdt/core/compiler/CompilationParticipant.java" type="org.eclipse.jdt.core.compiler.CompilationParticipant">
11
        <filter id="388100214">
19
        <filter id="388100214">
12
            <message_arguments>
20
            <message_arguments>

Return to bug 248878