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 72670 Details for
Bug 120766
problems when using classes of the same name
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug120766_003.txt (text/plain), 3.46 KB, created by
David Audel
on 2007-06-28 06:19:58 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2007-06-28 06:19:58 EDT
Size:
3.46 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ResolveTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests.java,v >retrieving revision 1.76 >diff -u -r1.76 ResolveTests.java >--- src/org/eclipse/jdt/core/tests/model/ResolveTests.java 27 Jun 2007 13:44:21 -0000 1.76 >+++ src/org/eclipse/jdt/core/tests/model/ResolveTests.java 28 Jun 2007 10:19:10 -0000 >@@ -1948,7 +1948,42 @@ > deleteFile(new File(jarName)); > } > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=120766 >+public void testDuplicateTypeDeclaration8() throws JavaModelException { >+ this.workingCopies = new ICompilationUnit[3]; >+ this.workingCopies[0] = getWorkingCopy( >+ "/Resolve/src/test/Test.java", >+ "package test;"+ >+ "public class Test {\n" + >+ " void foo() {\n" + >+ " test.p1.Type t = new test.p1.Type();\n" + >+ " }\n" + >+ "}\n"); >+ >+ this.workingCopies[1] = getWorkingCopy( >+ "/Resolve/src/test/p1/Type.java", >+ "package test.p1;"+ >+ "public class Type {\n" + >+ " public Type(int i) {}\n" + >+ "}\n"); >+ >+ this.workingCopies[2] = getWorkingCopy( >+ "/Resolve/src/test/p2/Type.java", >+ "package test.p2;"+ >+ "public class Type {\n" + >+ "}\n"); > >+ String str = this.workingCopies[0].getSource(); >+ int start = str.lastIndexOf("Type"); >+ int length = "Type".length(); >+ IJavaElement[] elements = this.workingCopies[0].codeSelect(start, length, this.wcOwner); >+ >+ assertElementsEqual( >+ "Unexpected elements", >+ "Type [in [Working copy] Type.java [in test.p1 [in src [in Resolve]]]]", >+ elements >+ ); >+} > public void testArrayParameterInsideParent1() throws JavaModelException { > ICompilationUnit cu = getCompilationUnit("Resolve", "src", "", "ResolveArrayParameterInsideParent1.java"); > >#P org.eclipse.jdt.core >Index: codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java,v >retrieving revision 1.27 >diff -u -r1.27 SelectionOnQualifiedAllocationExpression.java >--- codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java 28 Mar 2006 20:30:01 -0000 1.27 >+++ codeassist/org/eclipse/jdt/internal/codeassist/select/SelectionOnQualifiedAllocationExpression.java 28 Jun 2007 10:19:13 -0000 >@@ -61,11 +61,26 @@ > public TypeBinding resolveType(BlockScope scope) { > super.resolveType(scope); > >- // tolerate some error cases >- if (binding == null || >- !(binding.isValidBinding() || >- binding.problemId() == ProblemReasons.NotVisible)) >+ if (binding == null) { > throw new SelectionNodeFound(); >+ } >+ >+ // tolerate some error cases >+ if (!binding.isValidBinding()) { >+ switch (binding.problemId()) { >+ case ProblemReasons.NotVisible: >+ // visibility is ignored >+ break; >+ case ProblemReasons.NotFound: >+ if (resolvedType != null && resolvedType.isValidBinding()) { >+ throw new SelectionNodeFound(resolvedType); >+ } >+ throw new SelectionNodeFound(); >+ default: >+ throw new SelectionNodeFound(); >+ } >+ } >+ > if (anonymousType == null) > throw new SelectionNodeFound(binding); >
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 120766
: 72670