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 73902 Details for
Bug 196354
ClassCastException in package binding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_196354.txt (text/plain), 2.06 KB, created by
Olivier Thomann
on 2007-07-16 16:58:34 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-07-16 16:58:34 EDT
Size:
2.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java,v >retrieving revision 1.156 >diff -u -r1.156 DefaultBindingResolver.java >--- dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 25 Apr 2007 16:59:24 -0000 1.156 >+++ dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java 16 Jul 2007 20:59:29 -0000 >@@ -1327,16 +1327,23 @@ > ImportReference importReference = (ImportReference) node; > Binding binding = this.scope.getTypeOrPackage(CharOperation.subarray(importReference.tokens, 0, importReference.tokens.length)); > if ((binding != null) && (binding.isValidBinding())) { >- IPackageBinding packageBinding = this.getPackageBinding((org.eclipse.jdt.internal.compiler.lookup.PackageBinding) binding); >- if (packageBinding == null) { >- return null; >+ if (binding instanceof ReferenceBinding) { >+ // this only happens if a type name has the same name as its package >+ ReferenceBinding referenceBinding = (ReferenceBinding) binding; >+ binding = referenceBinding.fPackage; > } >- this.bindingsToAstNodes.put(packageBinding, pkg); >- String key = packageBinding.getKey(); >- if (key != null) { >- this.bindingTables.bindingKeysToBindings.put(key, packageBinding); >+ if (binding instanceof org.eclipse.jdt.internal.compiler.lookup.PackageBinding) { >+ IPackageBinding packageBinding = this.getPackageBinding((org.eclipse.jdt.internal.compiler.lookup.PackageBinding) binding); >+ if (packageBinding == null) { >+ return null; >+ } >+ this.bindingsToAstNodes.put(packageBinding, pkg); >+ String key = packageBinding.getKey(); >+ if (key != null) { >+ this.bindingTables.bindingKeysToBindings.put(key, packageBinding); >+ } >+ return packageBinding; > } >- return packageBinding; > } > } > } catch (AbortCompilation e) {
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 196354
: 73902 |
73903