Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 126029 Details for
Bug 248878
[search] Odd API in ReferenceMatch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
New proposed patch
v01.txt (text/plain), 16.02 KB, created by
Frederic Fusier
on 2009-02-18 10:22:45 EST
(
hide
)
Description:
New proposed patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2009-02-18 10:22:45 EST
Size:
16.02 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/InternalFieldReferenceMatch.java >=================================================================== >RCS file: search/org/eclipse/jdt/internal/core/search/matching/InternalFieldReferenceMatch.java >diff -N search/org/eclipse/jdt/internal/core/search/matching/InternalFieldReferenceMatch.java >--- search/org/eclipse/jdt/internal/core/search/matching/InternalFieldReferenceMatch.java 17 Sep 2008 10:51:13 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,45 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.jdt.internal.core.search.matching; >- >-import org.eclipse.core.resources.IResource; >-import org.eclipse.jdt.core.*; >-import org.eclipse.jdt.core.search.*; >- >-/** >- * A method reference match that stores the local element >- */ >-public class InternalFieldReferenceMatch extends FieldReferenceMatch { >- >- IJavaElement localElement; >- >-public InternalFieldReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean isReadAccess, boolean isWriteAccess, boolean insideDocComment, SearchParticipant participant, IResource resource) { >- super(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource); >-} >- >-/** >- * Return the stored local element. >- * >- * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement() >- */ >-protected IJavaElement localElement() { >- return this.localElement; >-} >- >-/** >- * Store the local element in the match. >- * >- * @param element The local element to be stored >- */ >-public void localElement(IJavaElement element) { >- this.localElement = element; >-} >-} >Index: search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java,v >retrieving revision 1.46 >diff -u -r1.46 PackageReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 18 Sep 2008 15:24:57 -0000 1.46 >+++ search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 18 Feb 2009 15:20:46 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.jdt.core.IPackageFragment; > import org.eclipse.jdt.core.IPackageFragmentRoot; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.search.PackageReferenceMatch; > import org.eclipse.jdt.core.search.SearchPattern; > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.ast.*; >@@ -262,8 +263,8 @@ > if (last > positions.length) last = positions.length; > int sourceStart = (int) (positions[0] >>> 32); > int sourceEnd = ((int) positions[last - 1]); >- InternalPackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); >- packageReferenceMatch.localElement(localElement); >+ PackageReferenceMatch packageReferenceMatch = locator.newPackageReferenceMatch(element, accuracy, sourceStart, sourceEnd-sourceStart+1, reference); >+ packageReferenceMatch.setLocalElement(localElement); > this.match = packageReferenceMatch; > locator.report(this.match); > } >Index: search/org/eclipse/jdt/internal/core/search/matching/InternalPackageReferenceMatch.java >=================================================================== >RCS file: search/org/eclipse/jdt/internal/core/search/matching/InternalPackageReferenceMatch.java >diff -N search/org/eclipse/jdt/internal/core/search/matching/InternalPackageReferenceMatch.java >--- search/org/eclipse/jdt/internal/core/search/matching/InternalPackageReferenceMatch.java 17 Sep 2008 10:51:13 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,45 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.jdt.internal.core.search.matching; >- >-import org.eclipse.core.resources.IResource; >-import org.eclipse.jdt.core.*; >-import org.eclipse.jdt.core.search.*; >- >-/** >- * A package reference match that stores the local element >- */ >-public class InternalPackageReferenceMatch extends PackageReferenceMatch { >- >- IJavaElement localElement; >- >-public InternalPackageReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource) { >- super(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); >-} >- >-/** >- * Return the stored local element. >- * >- * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement() >- */ >-protected IJavaElement localElement() { >- return this.localElement; >-} >- >-/** >- * Store the local element in the match. >- * >- * @param element The local element to be stored >- */ >-public void localElement(IJavaElement element) { >- this.localElement = element; >-} >-} >Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v >retrieving revision 1.86 >diff -u -r1.86 MethodLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 18 Sep 2008 15:24:56 -0000 1.86 >+++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 18 Feb 2009 15:20:46 -0000 >@@ -333,8 +333,8 @@ > reportDeclaration(methodBinding, locator, declPattern.knownMethods); > } > } else { >- InternalMethodReferenceMatch methodReferenceMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, -1, -1, false /*not constructor*/, false/*not synthetic*/, reference); >- methodReferenceMatch.localElement(localElement); >+ MethodReferenceMatch methodReferenceMatch = locator.newMethodReferenceMatch(element, elementBinding, accuracy, -1, -1, false /*not constructor*/, false/*not synthetic*/, reference); >+ methodReferenceMatch.setLocalElement(localElement); > this.match = methodReferenceMatch; > if (this.pattern.findReferences && reference instanceof MessageSend) { > IJavaElement focus = this.pattern.focus; >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.321 >diff -u -r1.321 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 18 Feb 2009 12:08:56 -0000 1.321 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 18 Feb 2009 15:20:46 -0000 >@@ -1423,8 +1423,8 @@ > if (enclosingBinding != null) { > enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding); > } >- InternalFieldReferenceMatch match = new InternalFieldReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource); >- match.localElement(localElement); >+ FieldReferenceMatch match = new FieldReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource); >+ match.setLocalElement(localElement); > return match; > } > >@@ -1462,7 +1462,7 @@ > return new LocalVariableReferenceMatch(enclosingElement, accuracy, offset, length, isReadAccess, isWriteAccess, insideDocComment, participant, resource); > } > >-public InternalMethodReferenceMatch newMethodReferenceMatch( >+public MethodReferenceMatch newMethodReferenceMatch( > IJavaElement enclosingElement, > Binding enclosingBinding, > int accuracy, >@@ -1477,10 +1477,10 @@ > if (enclosingBinding != null) > enclosingElement = ((JavaElement) enclosingElement).resolved(enclosingBinding); > boolean isOverridden = (accuracy & PatternLocator.SUPER_INVOCATION_FLAVOR) != 0; >- return new InternalMethodReferenceMatch(enclosingElement, accuracy, offset, length, isConstructor, isSynthetic, isOverridden, insideDocComment, participant, resource); >+ return new MethodReferenceMatch(enclosingElement, accuracy, offset, length, isConstructor, isSynthetic, isOverridden, insideDocComment, participant, resource); > } > >-public InternalPackageReferenceMatch newPackageReferenceMatch( >+public PackageReferenceMatch newPackageReferenceMatch( > IJavaElement enclosingElement, > int accuracy, > int offset, >@@ -1489,7 +1489,7 @@ > SearchParticipant participant = getParticipant(); > IResource resource = this.currentPossibleMatch.resource; > boolean insideDocComment = (reference.bits & ASTNode.InsideJavadoc) != 0; >- return new InternalPackageReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); >+ return new PackageReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); > } > > public SearchMatch newTypeParameterReferenceMatch( >Index: search/org/eclipse/jdt/internal/core/search/matching/InternalMethodReferenceMatch.java >=================================================================== >RCS file: search/org/eclipse/jdt/internal/core/search/matching/InternalMethodReferenceMatch.java >diff -N search/org/eclipse/jdt/internal/core/search/matching/InternalMethodReferenceMatch.java >--- search/org/eclipse/jdt/internal/core/search/matching/InternalMethodReferenceMatch.java 17 Sep 2008 10:51:13 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,45 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2000, 2008 IBM Corporation and others. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * IBM Corporation - initial API and implementation >- *******************************************************************************/ >-package org.eclipse.jdt.internal.core.search.matching; >- >-import org.eclipse.core.resources.IResource; >-import org.eclipse.jdt.core.*; >-import org.eclipse.jdt.core.search.*; >- >-/** >- * A field reference match that stores the local element >- */ >-public class InternalMethodReferenceMatch extends MethodReferenceMatch { >- >- IJavaElement localElement; >- >-public InternalMethodReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean constructor, boolean synthetic, boolean superInvocation, boolean insideDocComment, SearchParticipant participant, IResource resource) { >- super(enclosingElement, accuracy, offset, length, constructor, synthetic, superInvocation, insideDocComment, participant, resource); >-} >- >-/** >- * Return the stored local element. >- * >- * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement() >- */ >-protected IJavaElement localElement() { >- return this.localElement; >-} >- >-/** >- * Store the local element in the match. >- * >- * @param element The local element to be stored >- */ >-public void localElement(IJavaElement element) { >- this.localElement = element; >-} >-} >Index: search/org/eclipse/jdt/core/search/ReferenceMatch.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/ReferenceMatch.java,v >retrieving revision 1.3 >diff -u -r1.3 ReferenceMatch.java >--- search/org/eclipse/jdt/core/search/ReferenceMatch.java 18 Feb 2009 09:21:46 -0000 1.3 >+++ search/org/eclipse/jdt/core/search/ReferenceMatch.java 18 Feb 2009 15:20:45 -0000 >@@ -15,13 +15,13 @@ > > /** > * An abstract Java search match that represents a reference. >- * <p> >- * This class is not intended to be subclassed by clients. >- * </p> >+ * > * @since 3.4 > */ > public abstract class ReferenceMatch extends SearchMatch { > >+ IJavaElement localElement; >+ > /** > * Creates a new reference match. > * >@@ -116,18 +116,17 @@ > * @since 3.4 > */ > final public IJavaElement getLocalElement() { >- return localElement(); >+ return this.localElement; > } > > /** >- * Return the stored local element. >+ * Store the local element in the match. > * >- * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement() >+ * @param element The local element to be stored > * >- * @noreference This method is not intended to be referenced by clients. >- * @nooverride This method is not intended to be re-implemented or extended by clients. >+ * @since 3.5 > */ >-protected IJavaElement localElement() { >- return null; >+final public void setLocalElement(IJavaElement element) { >+ this.localElement = element; > } > } >Index: search/org/eclipse/jdt/core/search/TypeReferenceMatch.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java,v >retrieving revision 1.23 >diff -u -r1.23 TypeReferenceMatch.java >--- search/org/eclipse/jdt/core/search/TypeReferenceMatch.java 17 Sep 2008 10:51:13 -0000 1.23 >+++ search/org/eclipse/jdt/core/search/TypeReferenceMatch.java 18 Feb 2009 15:20:45 -0000 >@@ -24,7 +24,6 @@ > */ > public class TypeReferenceMatch extends ReferenceMatch { > >- private IJavaElement localElement; > private IJavaElement[] otherElements; > > /** >@@ -84,26 +83,6 @@ > } > > /** >- * Return the stored local element. >- * >- * @see org.eclipse.jdt.core.search.ReferenceMatch#getLocalElement() >- */ >-protected IJavaElement localElement() { >- return this.localElement; >-} >- >-/** >- * Sets the local element of this search match. >- * >- * @param element A more specific local element that corresponds to the match, >- * or <code>null</code> if none >- * @since 3.2 >- */ >-public final void setLocalElement(IJavaElement element) { >- this.localElement = element; >-} >- >-/** > * Sets the other elements of this search match. > * > * @see #getOtherElements() >Index: .settings/.api_filters >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/.settings/.api_filters,v >retrieving revision 1.5 >diff -u -r1.5 .api_filters >--- .settings/.api_filters 27 Oct 2008 21:04:36 -0000 1.5 >+++ .settings/.api_filters 18 Feb 2009 15:20:45 -0000 >@@ -7,6 +7,14 @@ > </message_arguments> > </filter> > </resource> >+ <resource path="search/org/eclipse/jdt/core/search/ReferenceMatch.java" type="org.eclipse.jdt.core.search.ReferenceMatch"> >+ <filter id="338792546"> >+ <message_arguments> >+ <message_argument value="org.eclipse.jdt.core.search.ReferenceMatch"/> >+ <message_argument value="localElement()"/> >+ </message_arguments> >+ </filter> >+ </resource> > <resource path="model/org/eclipse/jdt/core/compiler/CompilationParticipant.java" type="org.eclipse.jdt.core.compiler.CompilationParticipant"> > <filter id="388100214"> > <message_arguments>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jerome_lanneluc
:
review+
Actions:
View
|
Diff
Attachments on
bug 248878
:
126015
| 126029