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 25603 Details for
Bug 99903
[1.5][search] range wrong for package-info
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to fix this issue
v00.txt (text/plain), 3.25 KB, created by
Frederic Fusier
on 2005-08-03 05:24:33 EDT
(
hide
)
Description:
Patch to fix this issue
Filename:
MIME Type:
Creator:
Frederic Fusier
Created:
2005-08-03 05:24:33 EDT
Size:
3.25 KB
patch
obsolete
>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.249.2.2 >diff -u -r1.249.2.2 MatchLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 8 Jul 2005 17:06:10 -0000 1.249.2.2 >+++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 2 Aug 2005 19:02:05 -0000 >@@ -613,6 +613,22 @@ > return createTypeHandle(typeName.substring(0, lastDollar)); > } > /** >+ * Creates an IImportDeclaration from the given import statement >+ */ >+protected IJavaElement createPackageDeclarationHandle(CompilationUnitDeclaration unit) { >+ if (unit.isPackageInfo()) { >+ char[] packName = CharOperation.concatWith(unit.currentPackage.getImportName(), '.'); >+ Openable openable = this.currentPossibleMatch.openable; >+ if (openable instanceof CompilationUnit) { >+ return ((CompilationUnit) openable).getPackageDeclaration(new String(packName)); >+ } >+// if (openable != null) { >+// return openable.getParent(); >+// } >+ } >+ return createTypeHandle(new String(unit.getMainTypeName())); >+} >+/** > * Creates an IType from the given simple top level type name. > */ > protected IType createTypeHandle(String simpleTypeName) { >@@ -1969,7 +1985,7 @@ > for (int i = 0, l = nodes.length; i < l; i++) > nodeSet.matchingNodes.removeKey(nodes[i]); > } else { >- IJavaElement element = createTypeHandle(new String(unit.getMainTypeName())); >+ IJavaElement element = createPackageDeclarationHandle(unit); > for (int i = 0, l = nodes.length; i < l; i++) { > ASTNode node = nodes[i]; > Integer level = (Integer) nodeSet.matchingNodes.removeKey(node); >@@ -1983,7 +1999,7 @@ > if (matchedUnitContainer) { > ImportReference pkg = unit.currentPackage; > if (pkg != null && pkg.annotations != null) { >- IJavaElement element = createTypeHandle(new String(unit.getMainTypeName())); >+ IJavaElement element = createPackageDeclarationHandle(unit); > if (element != null) { > reportMatching(pkg.annotations, element, null, nodeSet, true, encloses(element)); > } >Index: search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java,v >retrieving revision 1.43.2.1 >diff -u -r1.43.2.1 TypeReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 28 Jun 2005 21:27:27 -0000 1.43.2.1 >+++ search/org/eclipse/jdt/internal/core/search/matching/TypeReferenceLocator.java 2 Aug 2005 19:02:06 -0000 >@@ -418,7 +418,7 @@ > return; > } > if (refBinding.isLocalType()) { >- // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=84049 >+ // see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=82673 > LocalTypeBinding local = (LocalTypeBinding) refBinding; > IJavaElement focus = ((InternalSearchPattern)pattern).focus; > if (focus != null && local.enclosingMethod != null && focus.getParent().getElementType() == IJavaElement.METHOD) {
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 99903
:
23034
| 25603 |
25604