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 175423 Details for
Bug 150980
[API] Selecting import declaration with space in outline highlights wrong range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Adoption of the new API in the JavaEditor
patch_150980_UI.txt (text/plain), 1.97 KB, created by
Olivier Thomann
on 2010-07-28 12:05:56 EDT
(
hide
)
Description:
Adoption of the new API in the JavaEditor
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-07-28 12:05:56 EDT
Size:
1.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java,v >retrieving revision 1.482 >diff -u -r1.482 JavaEditor.java >--- ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java 25 Feb 2010 07:32:27 -0000 1.482 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java 28 Jul 2010 14:28:00 -0000 >@@ -2321,35 +2321,16 @@ > length= range.getLength(); > } > } else if (reference instanceof IImportDeclaration) { >- String content= reference.getSource(); >- if (content != null) { >- int start= content.indexOf("import") + 6; //$NON-NLS-1$ >- while (start < content.length() && content.charAt(start) == ' ') >- start++; >- >- int end= content.indexOf(';'); >- do { >- end--; >- } while (end >= 0 && content.charAt(end) == ' '); >- >- offset= range.getOffset() + start; >- length= end - start + 1; >- } else { >- // fallback >+ range= ((IImportDeclaration)reference).getNameRange(); >+ if (range != null) { > offset= range.getOffset(); > length= range.getLength(); > } > } else if (reference instanceof IPackageDeclaration) { >- String name= ((IPackageDeclaration) reference).getElementName(); >- if (name != null && name.length() > 0) { >- String content= reference.getSource(); >- if (content != null) { >- int packageKeyWordIndex = content.lastIndexOf("package"); //$NON-NLS-1$ >- if (packageKeyWordIndex != -1) { >- offset= range.getOffset() + content.indexOf(name, packageKeyWordIndex + 7); >- length= name.length(); >- } >- } >+ range= ((IPackageDeclaration)reference).getNameRange(); >+ if (range != null) { >+ offset= range.getOffset(); >+ length= range.getLength(); > } > } >
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 150980
:
175364
|
175422
| 175423