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 84568 Details for
Bug 211366
[search] does not return references to types in binary classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Second additional patch
v02.txt (text/plain), 9.39 KB, created by
Frederic Fusier
on 2007-12-05 16:10:16 EST
(
hide
)
Description:
Second additional patch
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2007-12-05 16:10:16 EST
Size:
9.39 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java,v >retrieving revision 1.136 >diff -u -r1.136 JavaSearchBugsTests.java >--- src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 5 Dec 2007 18:47:37 -0000 1.136 >+++ src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java 5 Dec 2007 21:05:16 -0000 >@@ -9273,12 +9273,13 @@ > addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b211366.jar", false); > try { > IType type = getClassFile("JavaSearchBugs", "lib/b211366.jar", "test", "Bug.class").getType(); >+ this.resultCollector.showMatchKind = true; > search(type, REFERENCES); > assertSearchResults( >- "lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >- "lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >- "lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >- "lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH" >+ "TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH" > ); > } > finally { >@@ -9292,6 +9293,7 @@ > SearchPattern rightPattern = SearchPattern.createPattern(type, REFERENCES); > SearchPattern leftPattern = SearchPattern.createPattern(type, DECLARATIONS); > SearchPattern pattern = SearchPattern.createOrPattern(leftPattern, rightPattern); >+ this.resultCollector.showMatchKind = true; > new SearchEngine(workingCopies).search( > pattern, > new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, >@@ -9300,11 +9302,51 @@ > null > ); > assertSearchResults( >- "lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >- "lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >- "lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >- "lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH\n" + >- "lib/b211366.jar test.Bug [No source] EXACT_MATCH" >+ "TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH\n" + >+ "TypeDeclarationMatch: lib/b211366.jar test.Bug [No source] EXACT_MATCH" >+ ); >+ } >+ finally { >+ removeClasspathEntry(JAVA_PROJECT, new Path("/JavaSearchBugs/lib/b211366.jar")); >+ } >+} >+public void testBug211366_ComplexOrPattern() throws CoreException { >+ addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib/b211366.jar", false); >+ try { >+ IType bType = getClassFile("JavaSearchBugs", "lib/b211366.jar", "test", "Bug.class").getType(); >+ SearchPattern leftPattern = SearchPattern.createOrPattern( >+ SearchPattern.createPattern("field", FIELD, DECLARATIONS, SearchPattern.R_CASE_SENSITIVE), >+ SearchPattern.createPattern(bType, REFERENCES)); >+ SearchPattern rightPattern = SearchPattern.createOrPattern( >+ SearchPattern.createPattern("Member", TYPE, DECLARATIONS, SearchPattern.R_EXACT_MATCH), >+ SearchPattern.createOrPattern( >+ SearchPattern.createPattern("method", METHOD, DECLARATIONS, SearchPattern.R_EXACT_MATCH), >+ SearchPattern.createPattern("Bug", TYPE, REFERENCES, SearchPattern.R_EXACT_MATCH))); >+ IPackageFragmentRoot root = JAVA_PROJECT.getPackageFragmentRoot("/JavaSearchBugs/lib/b211366.jar"); >+ this.resultCollector.sorted = true; >+ this.resultCollector.showMatchKind = true; >+ new SearchEngine(workingCopies).search( >+ SearchPattern.createOrPattern(leftPattern, rightPattern), >+ new SearchParticipant[] {SearchEngine.getDefaultSearchParticipant()}, >+ SearchEngine.createJavaSearchScope(new IJavaElement[] { root }), >+ this.resultCollector, >+ null >+ ); >+ assertSearchResults( >+ "FieldDeclarationMatch: lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH\n" + >+ "MethodDeclarationMatch: lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >+ "TypeDeclarationMatch: lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.Test [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestInner$Member [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar pack.TestMembers.field [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH\n" + >+ "TypeReferenceMatch: lib/b211366.jar void pack.TestMembers.method(java.lang.Object, java.lang.String) [No source] EXACT_MATCH" > ); > } > finally { >Index: src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java,v >retrieving revision 1.31 >diff -u -r1.31 AbstractJavaSearchTests.java >--- src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 28 Nov 2007 08:03:33 -0000 1.31 >+++ src/org/eclipse/jdt/core/tests/model/AbstractJavaSearchTests.java 5 Dec 2007 21:04:51 -0000 >@@ -61,6 +61,7 @@ > public boolean showSynthetic; > public boolean showOffset = false; > public int showFlavors = 0; >+ public boolean showMatchKind = false; > public int count = 0; > List lines = new ArrayList(); > boolean sorted; >@@ -85,7 +86,13 @@ > try { > IResource resource = match.getResource(); > IJavaElement element = getElement(match); >- line = new StringBuffer(getPathString(resource, element)); >+ line = new StringBuffer(); >+ if (this.showMatchKind) { >+ String matchClassName = this.match.getClass().getName(); >+ line.append(matchClassName.substring(matchClassName.lastIndexOf('.')+1)); >+ line.append(": "); >+ } >+ line.append(getPathString(resource, element)); > if (this.showProject) { > IProject project = element.getJavaProject().getProject(); > line.append(" [in "); >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java,v >retrieving revision 1.37 >diff -u -r1.37 ClassFileMatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java 5 Dec 2007 18:47:38 -0000 1.37 >+++ search/org/eclipse/jdt/internal/core/search/matching/ClassFileMatchLocator.java 5 Dec 2007 21:05:24 -0000 >@@ -329,7 +329,8 @@ > BinaryTypeBinding binaryTypeBinding = null; > if (checkAnnotations(typeReferencePattern, annotations, binaryType.getTagBits())) { > classFileBinaryType = new ResolvedBinaryType((JavaElement) classFileBinaryType.getParent(), classFileBinaryType.getElementName(), classFileBinaryType.getKey()); >- locator.reportBinaryMemberDeclaration(null, classFileBinaryType, null, binaryType, SearchMatch.A_ACCURATE); >+ SearchMatch match = new TypeReferenceMatch(classFileBinaryType, SearchMatch.A_ACCURATE, -1, 0, false, locator.getParticipant(), locator.currentPossibleMatch.resource); >+ locator.report(match); > } > > // Look for references in methods annotations >@@ -342,7 +343,8 @@ > IMethod methodHandle = classFileBinaryType.getMethod( > new String(method.isConstructor() ? binaryTypeBinding.compoundName[binaryTypeBinding.compoundName.length-1] : method.getSelector()), > CharOperation.toStrings(Signature.getParameterTypes(convertClassFileFormat(method.getMethodDescriptor())))); >- locator.reportBinaryMemberDeclaration(null, methodHandle, null, binaryType, SearchMatch.A_ACCURATE); >+ SearchMatch match = new TypeReferenceMatch(methodHandle, SearchMatch.A_ACCURATE, -1, 0, false, locator.getParticipant(), locator.currentPossibleMatch.resource); >+ locator.report(match); > } > } > } >@@ -354,7 +356,8 @@ > FieldInfo field = fields[i]; > if (checkAnnotations(typeReferencePattern, field.getAnnotations(), field.getTagBits())) { > IField fieldHandle = classFileBinaryType.getField(new String(field.getName())); >- locator.reportBinaryMemberDeclaration(null, fieldHandle, null, binaryType, SearchMatch.A_ACCURATE); >+ SearchMatch match = new TypeReferenceMatch(fieldHandle, SearchMatch.A_ACCURATE, -1, 0, false, locator.getParticipant(), locator.currentPossibleMatch.resource); >+ locator.report(match); > } > } > }
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 211366
:
84031
|
84401
|
84407
|
84557
| 84568