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 38291 Details for
Bug 136016
[refactoring] CCE during Use Supertype refactoring
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch and regression test
136016.txt (text/plain), 3.97 KB, created by
Jerome Lanneluc
on 2006-04-11 11:24:30 EDT
(
hide
)
Description:
Proposed patch and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2006-04-11 11:24:30 EDT
Size:
3.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java,v >retrieving revision 1.40 >diff -u -r1.40 ASTModelBridgeTests.java >--- src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 29 Mar 2006 04:03:06 -0000 1.40 >+++ src/org/eclipse/jdt/core/tests/dom/ASTModelBridgeTests.java 11 Apr 2006 15:16:06 -0000 >@@ -14,6 +14,10 @@ > import org.eclipse.jdt.core.*; > import org.eclipse.jdt.core.compiler.IProblem; > import org.eclipse.jdt.core.dom.*; >+import org.eclipse.jdt.core.search.IJavaSearchConstants; >+import org.eclipse.jdt.core.search.IJavaSearchScope; >+import org.eclipse.jdt.core.search.SearchEngine; >+import org.eclipse.jdt.core.tests.model.AbstractJavaSearchTests; > > import junit.framework.Test; > >@@ -103,6 +107,10 @@ > " }/*end*/\n" + > " }\n" + > "}", >+ "p/ABC.java", >+ "package p;\n" + >+ "public class ABC {\n" + >+ "}", > "Z.java", > "public class Z {\n" + > " /*start*/class Member {\n" + >@@ -289,6 +297,42 @@ > assertTrue("Element should exist", element.exists()); > } > >+ public void testBinaryType2() throws CoreException { >+ IClassFile classFile = getClassFile("P", "lib.jar", "p", "ABC.class"); // class with no references >+ >+ // ensure classfile is open >+ classFile.open(null); >+ >+ //search for references to p.W after adding references in exactly 1 file >+ try { >+ createFile( >+ "/P/src/Test.java", >+ "import p.ABC;\n" + >+ "public class Test extends ABC {\n" + >+ "}" >+ ); >+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {getPackageFragmentRoot("/P/src")}); >+ search(classFile.getType(), IJavaSearchConstants.REFERENCES, scope, new AbstractJavaSearchTests.JavaSearchResultCollector()); >+ } finally { >+ deleteFile("/P/src/Test.java"); >+ } >+ >+ String source = classFile.getSource(); >+ MarkerInfo markerInfo = new MarkerInfo(source); >+ markerInfo.astStarts = new int[] {source.indexOf("public")}; >+ markerInfo.astEnds = new int[] {source.lastIndexOf('}') + 1}; >+ ASTNode node = buildAST(markerInfo, classFile); >+ IBinding binding = ((TypeDeclaration) node).resolveBinding(); >+ assertNotNull("No binding", binding); >+ IJavaElement element = binding.getJavaElement(); >+ assertElementEquals( >+ "Unexpected Java element", >+ "ABC [in ABC.class [in p [in lib.jar [in P]]]]", >+ element >+ ); >+ assertTrue("Element should exist", element.exists()); >+ } >+ > /* > * Ensures that the IJavaElement for a binary member type coming from an anoumous class file is correct. > * (regression test for bug 100636 [model] Can't find overriden methods of protected nonstatic inner class.) >#P org.eclipse.jdt.core >Index: search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java,v >retrieving revision 1.32 >diff -u -r1.32 PackageReferenceLocator.java >--- search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 29 Mar 2006 03:14:00 -0000 1.32 >+++ search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java 11 Apr 2006 15:16:07 -0000 >@@ -31,7 +31,7 @@ > char[] fileName = typeBinding.getFileName(); > if (fileName != null) { > // retrieve the actual file name from the full path (sources are generally only containing it already) >- CharOperation.replace(fileName, '/', '\\'); >+ fileName = CharOperation.replaceOnCopy(fileName, '/', '\\'); // ensure to not do any side effect on file name (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=136016) > fileName = CharOperation.lastSegment(fileName, '\\'); > > try {
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 136016
: 38291