Index: search/org/eclipse/jdt/core/search/FieldReferenceMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -24,7 +24,6 @@
*/
public class FieldReferenceMatch extends SearchMatch {
- private boolean insideDocComment;
private boolean isReadAccess;
private boolean isWriteAccess;
Index: search/org/eclipse/jdt/core/search/LocalVariableReferenceMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -24,7 +24,6 @@
*/
public class LocalVariableReferenceMatch extends SearchMatch {
- private boolean insideDocComment;
private boolean isReadAccess;
private boolean isWriteAccess;
Index: search/org/eclipse/jdt/core/search/MethodReferenceMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -24,8 +24,6 @@
*/
public class MethodReferenceMatch extends SearchMatch {
- private boolean insideDocComment;
-
/**
* Creates a new method reference match.
*
Index: search/org/eclipse/jdt/core/search/PackageReferenceMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -31,11 +31,20 @@
* @param accuracy one of A_ACCURATE or 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 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);
+ this.insideDocComment = insideDocComment;
+ }
+
+ /**
+ * @see org.eclipse.jdt.core.search.SearchMatch#isInsideDocComment()
+ */
+ public final boolean isInsideDocComment() {
+ return this.insideDocComment;
}
}
Index: search/org/eclipse/jdt/core/search/SearchMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -51,6 +51,8 @@
private SearchParticipant participant;
private IResource resource;
+ boolean insideDocComment = false;
+
/**
* Creates a new search match.
*
@@ -132,7 +134,7 @@
public final IResource getResource() {
return this.resource;
}
-
+
/**
* Returns whether this search match is inside a doc comment of a Java
* source file.
@@ -142,10 +144,27 @@
*/
public boolean isInsideDocComment() {
// default is outside a doc comment
- return false;
+ return this.insideDocComment;
+ }
+
+ /**
+ * Set the accuracy of this match.
+ *
+ * @param accuracy The accuracy to set.
+ */
+ public void setAccuracy (int accuracy) {
+ this.accuracy = accuracy;
}
/**
+ * Set the element of this search match.
+ *
+ * @param element the element of this match.
+ */
+ public 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
@@ -162,7 +181,36 @@
public final void setOffset(int offset) {
this.offset = offset;
}
-
+
+ /**
+ * Set the participant of this match.
+ *
+ * @param participant the participant of this match.
+ */
+ public void setParticipant (SearchParticipant participant) {
+ this.participant = participant;
+ }
+
+ /**
+ * Set the resource of this match.
+ *
+ * @param resource the resource of this match.
+ */
+ public void setResource (IResource resource) {
+ this.resource = resource;
+ }
+
+ /**
+ * Set whether this search match is inside a doc comment of a Java
+ * source file or not.
+ *
+ * @param insideDoc true
if this search match is inside a Java doc
+ * comment, and false
otherwise
+ */
+ public void setInsideDocComment (boolean insideDoc) {
+ this.insideDocComment = insideDoc;
+ }
+
/**
* @see java.lang.Object#toString()
*/
Index: search/org/eclipse/jdt/core/search/TypeReferenceMatch.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -0000
@@ -24,8 +24,6 @@
*/
public class TypeReferenceMatch extends SearchMatch {
- private boolean insideDocComment;
-
/**
* Creates a new type reference match.
*
Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
===================================================================
RCS file: /data/cvs/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 16:45:19 -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(