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 162986 Details for
Bug 302865
Issue with "import" a class and "import static" a method with the same name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
rough patch
patchImports.txt (text/plain), 2.70 KB, created by
Ayushman Jain
on 2010-03-25 09:21:18 EDT
(
hide
)
Description:
rough patch
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2010-03-25 09:21:18 EDT
Size:
2.70 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java,v >retrieving revision 1.126 >diff -u -r1.126 CompilationUnitScope.java >--- compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 22 Apr 2009 19:49:57 -0000 1.126 >+++ compiler/org/eclipse/jdt/internal/compiler/lookup/CompilationUnitScope.java 25 Mar 2010 13:18:57 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -396,8 +396,13 @@ > ReferenceBinding existingType = typesBySimpleNames.get(compoundName[compoundName.length - 1]); > if (existingType != null) { > // duplicate test above should have caught this case, but make sure >- if (existingType == referenceBinding) >+ if (!importReference.isStatic() && existingType == referenceBinding) { >+ if (existingType.isStatic()) { >+ // JLS 7.5.3 case >+ problemReporter().duplicateImport(importReference); >+ } > continue nextImport; >+ } > // either the type collides with a top level type or another imported type > for (int j = 0, length = this.topLevelTypes.length; j < length; j++) { > if (CharOperation.equals(this.topLevelTypes[j].sourceName, existingType.sourceName)) { >@@ -405,8 +410,19 @@ > continue nextImport; > } > } >- problemReporter().duplicateImport(importReference); >- continue nextImport; >+ boolean flag = false; >+ if (!importReference.isStatic() || (flag = existingType.isStatic())) { >+ if (flag) { >+ // JLS 7.5.3 case >+ // report some new error message saying that the static import is trying to import >+ // an already imported static type >+ // can't use problemReporter().duplicateImport(importReference) because the static import >+ // may not be an exact duplicate if its also trying to import some static method/field. >+ } else { >+ problemReporter().duplicateImport(importReference); >+ } >+ continue nextImport; >+ } > } > typesBySimpleNames.put(compoundName[compoundName.length - 1], referenceBinding); > } else if (importBinding instanceof FieldBinding) {
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 302865
:
159212
|
162986
|
164727
|
164880
|
164916
|
164951