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 11153 Details for
Bug 62697
Need to know if a package reference match is in Javadoc or in Code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Improved implementation of new version of API change
jdt-core-patch-20040526.txt (text/plain), 15.11 KB, created by
Jim des Rivieres
on 2004-05-26 15:03:12 EDT
(
hide
)
Description:
Improved implementation of new version of API change
Filename:
MIME Type:
Creator:
Jim des Rivieres
Created:
2004-05-26 15:03:12 EDT
Size:
15.11 KB
patch
obsolete
>Index: search/org/eclipse/jdt/core/search/FieldReferenceMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/FieldReferenceMatch.java,v >retrieving revision 1.11 >diff -u -r1.11 FieldReferenceMatch.java >--- search/org/eclipse/jdt/core/search/FieldReferenceMatch.java 22 Apr 2004 15:23:49 -0000 1.11 >+++ search/org/eclipse/jdt/core/search/FieldReferenceMatch.java 26 May 2004 18:43:37 -0000 >@@ -24,7 +24,6 @@ > */ > public class FieldReferenceMatch extends SearchMatch { > >- private boolean insideDocComment; > private boolean isReadAccess; > private boolean isWriteAccess; > >@@ -32,12 +31,13 @@ > * Creates a new field reference match. > * > * @param enclosingElement the inner-most enclosing member that references this field >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown > * @param isReadAccess whether the match represents a read access > * @param isWriteAccess whethre the match represents a write access >- * @param insideDocComment whether the match is inside a doc comment >+ * @param insideDocComment <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise > * @param participant the search participant that created the match > * @param resource the resource of the element > */ >@@ -45,16 +45,9 @@ > super(enclosingElement, accuracy, offset, length, participant, resource); > this.isReadAccess = isReadAccess; > this.isWriteAccess = isWriteAccess; >- this.insideDocComment = insideDocComment; >+ setInsideDocComment(insideDocComment); > } > >- /** >- * @see org.eclipse.jdt.core.search.SearchMatch#isInsideDocComment() >- */ >- public final boolean isInsideDocComment() { >- return this.insideDocComment; >- } >- > /** > * Returns whether the field reference is a read access to the field. > * Note that a field reference can be read and written at once in case of compound assignments (e.g. i += 0;) >Index: search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java,v >retrieving revision 1.8 >diff -u -r1.8 LocalVariableReferenceMatch.java >--- search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java 6 May 2004 13:37:11 -0000 1.8 >+++ search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java 26 May 2004 18:43:37 -0000 >@@ -24,7 +24,6 @@ > */ > public class LocalVariableReferenceMatch extends SearchMatch { > >- private boolean insideDocComment; > private boolean isReadAccess; > private boolean isWriteAccess; > >@@ -32,12 +31,13 @@ > * Creates a new local variable reference match. > * > * @param enclosingElement the inner-most enclosing member that references this local variable >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown > * @param isReadAccess whether the match represents a read access > * @param isWriteAccess whethre the match represents a write access >- * @param insideDocComment whether the match is inside a doc comment >+ * @param insideDocComment <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise > * @param participant the search participant that created the match > * @param resource the resource of the element > */ >@@ -45,14 +45,7 @@ > super(enclosingElement, accuracy, offset, length, participant, resource); > this.isReadAccess = isReadAccess; > this.isWriteAccess = isWriteAccess; >- this.insideDocComment = insideDocComment; >- } >- >- /** >- * @see org.eclipse.jdt.core.search.SearchMatch#isInsideDocComment() >- */ >- public final boolean isInsideDocComment() { >- return this.insideDocComment; >+ setInsideDocComment(insideDocComment); > } > > /** >Index: search/org/eclipse/jdt/core/search/MethodReferenceMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/MethodReferenceMatch.java,v >retrieving revision 1.9 >diff -u -r1.9 MethodReferenceMatch.java >--- search/org/eclipse/jdt/core/search/MethodReferenceMatch.java 22 Apr 2004 15:23:49 -0000 1.9 >+++ search/org/eclipse/jdt/core/search/MethodReferenceMatch.java 26 May 2004 18:43:37 -0000 >@@ -24,29 +24,20 @@ > */ > public class MethodReferenceMatch extends SearchMatch { > >- private boolean insideDocComment; >- > /** > * Creates a new method reference match. > * > * @param enclosingElement the inner-most enclosing member that references this method >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown >- * @param insideDocComment whether the match is inside a doc comment >+ * @param insideDocComment <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise > * @param participant the search participant that created the match > * @param resource the resource of the element > */ > public MethodReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource) { > super(enclosingElement, accuracy, offset, length, participant, resource); >- this.insideDocComment = insideDocComment; >+ setInsideDocComment(insideDocComment); > } >- >- /** >- * @see org.eclipse.jdt.core.search.SearchMatch#isInsideDocComment() >- */ >- public final boolean isInsideDocComment() { >- return this.insideDocComment; >- } >- > } >Index: search/org/eclipse/jdt/core/search/PackageReferenceMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/PackageReferenceMatch.java,v >retrieving revision 1.7 >diff -u -r1.7 PackageReferenceMatch.java >--- search/org/eclipse/jdt/core/search/PackageReferenceMatch.java 22 Apr 2004 09:58:25 -0000 1.7 >+++ search/org/eclipse/jdt/core/search/PackageReferenceMatch.java 26 May 2004 18:43:37 -0000 >@@ -15,10 +15,10 @@ > > /** > * A Java search match that represents a package reference. >- * The element is the inner-most enclosing member that references this package. * <p> >+ * The element is the inner-most enclosing member that references this package. >+ * <p> > * This class is intended to be instantiated and subclassed by clients. > * </p> >- > * > * @since 3.0 > */ >@@ -28,14 +28,16 @@ > * Creates a new package reference match. > * > * @param enclosingElement the inner-most enclosing member that references this package >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown >+ * @param insideDocComment <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise > * @param participant the search participant that created the match > * @param resource the resource of the element > */ >- public PackageReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, SearchParticipant participant, IResource resource) { >+ public PackageReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource) { > super(enclosingElement, accuracy, offset, length, participant, resource); >+ setInsideDocComment(insideDocComment); > } >- > } >Index: search/org/eclipse/jdt/core/search/SearchMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchMatch.java,v >retrieving revision 1.15 >diff -u -r1.15 SearchMatch.java >--- search/org/eclipse/jdt/core/search/SearchMatch.java 12 May 2004 13:27:25 -0000 1.15 >+++ search/org/eclipse/jdt/core/search/SearchMatch.java 26 May 2004 18:43:37 -0000 >@@ -51,12 +51,17 @@ > private SearchParticipant participant; > private IResource resource; > >+ private boolean insideDocComment = false; >+ > /** > * Creates a new search match. >+ * <p> >+ * Note that <code>isInsideDocComment()</code> defaults to false. >+ * </p> > * > * @param element the element that encloses or corresponds to the match, > * or <code>null</code> if none >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown > * @param participant the search participant that created the match >@@ -132,23 +137,41 @@ > public final IResource getResource() { > return this.resource; > } >- >+ > /** > * Returns whether this search match is inside a doc comment of a Java > * source file. > * >- * @return <code>true</code> if this search match is inside a Java doc >+ * @return <code>true</code> if this search match is inside a doc > * comment, and <code>false</code> otherwise > */ >- public boolean isInsideDocComment() { >+ public final boolean isInsideDocComment() { > // default is outside a doc comment >- return false; >+ return this.insideDocComment; >+ } >+ >+ /** >+ * Sets the accuracy of this match. >+ * >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} >+ */ >+ public final void setAccuracy (int accuracy) { >+ this.accuracy = accuracy; > } > > /** >+ * Sets the element of this search match. >+ * >+ * @param element the element that encloses or corresponds to the match, >+ * or <code>null</code> if none >+ */ >+ public final void setElement (Object element) { >+ this.element = element; >+ } >+ /** > * Sets the length of this search match. > * >- * @param length the length of this match, or -1 if unknown >+ * @param length the length of the match, or -1 if unknown > */ > public final void setLength(int length) { > this.length = length; >@@ -157,13 +180,42 @@ > /** > * Sets the offset of this search match. > * >- * @param offset the offset of this match, or -1 if unknown >+ * @param offset the offset the match starts at, or -1 if unknown > */ > public final void setOffset(int offset) { > this.offset = offset; > } >- >+ >+ /** >+ * Sets the participant of this match. >+ * >+ * @param participant the search participant that created this match >+ */ >+ public final void setParticipant (SearchParticipant participant) { >+ this.participant = participant; >+ } >+ > /** >+ * Sets the resource of this match. >+ * >+ * @param resource the resource of the match, or <code>null</code> if none >+ */ >+ public final void setResource (IResource resource) { >+ this.resource = resource; >+ } >+ >+ /** >+ * Sets whether this search match is inside a doc comment of a Java >+ * source file. >+ * >+ * @param insideDoc <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise >+ */ >+ public final void setInsideDocComment (boolean insideDoc) { >+ this.insideDocComment = insideDoc; >+ } >+ >+ /* (non-javadoc) > * @see java.lang.Object#toString() > */ > public String toString() { >@@ -175,8 +227,10 @@ > buffer.append(this.offset); > buffer.append("\n length="); //$NON-NLS-1$ > buffer.append(this.length); >- buffer.append("\n element="); //$NON-NLS-1$ >- buffer.append(((JavaElement)getElement()).toStringWithAncestors()); >+ if (this.element != null) { >+ buffer.append("\n element="); //$NON-NLS-1$ >+ buffer.append(((JavaElement)getElement()).toStringWithAncestors()); >+ } > buffer.append("\n"); //$NON-NLS-1$ > return buffer.toString(); > } >Index: search/org/eclipse/jdt/core/search/TypeReferenceMatch.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/TypeReferenceMatch.java,v >retrieving revision 1.9 >diff -u -r1.9 TypeReferenceMatch.java >--- search/org/eclipse/jdt/core/search/TypeReferenceMatch.java 22 Apr 2004 15:23:49 -0000 1.9 >+++ search/org/eclipse/jdt/core/search/TypeReferenceMatch.java 26 May 2004 18:43:37 -0000 >@@ -24,28 +24,20 @@ > */ > public class TypeReferenceMatch extends SearchMatch { > >- private boolean insideDocComment; >- > /** > * Creates a new type reference match. > * > * @param enclosingElement the inner-most enclosing member that references this type >- * @param accuracy one of A_ACCURATE or A_INACCURATE >+ * @param accuracy one of {@link #A_ACCURATE} or {@link #A_INACCURATE} > * @param offset the offset the match starts at, or -1 if unknown > * @param length the length of the match, or -1 if unknown >- * @param insideDocComment whether the match is inside a doc comment >+ * @param insideDocComment <code>true</code> if this search match is inside a doc >+ * comment, and <code>false</code> otherwise > * @param participant the search participant that created the match > * @param resource the resource of the element > */ > public TypeReferenceMatch(IJavaElement enclosingElement, int accuracy, int offset, int length, boolean insideDocComment, SearchParticipant participant, IResource resource) { > super(enclosingElement, accuracy, offset, length, participant, resource); >- this.insideDocComment = insideDocComment; >- } >- >- /** >- * @see org.eclipse.jdt.core.search.SearchMatch#isInsideDocComment() >- */ >- public final boolean isInsideDocComment() { >- return this.insideDocComment; >+ setInsideDocComment(insideDocComment); > } > } >Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v >retrieving revision 1.182 >diff -u -r1.182 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 24 May 2004 16:34:25 -0000 1.182 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 26 May 2004 18:43:38 -0000 >@@ -1053,7 +1053,8 @@ > ASTNode reference) { > SearchParticipant participant = getParticipant(); > IResource resource = this.currentPossibleMatch.resource; >- return new PackageReferenceMatch(enclosingElement, accuracy, offset, length, participant, resource); >+ boolean insideDocComment = (reference.bits & ASTNode.InsideJavadoc) != 0; >+ return new PackageReferenceMatch(enclosingElement, accuracy, offset, length, insideDocComment, participant, resource); > } > > public SearchMatch newTypeReferenceMatch(
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
Actions:
View
|
Diff
Attachments on
bug 62697
:
11006
|
11007
|
11145
|
11147
| 11153