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 118370 Details for
Bug 228845
[hierarchy] Type hierarchy should include subtypes in primary working copies
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch with code changes and test
228845.txt (text/plain), 3.01 KB, created by
Srikanth Sankaran
on 2008-11-20 10:38:59 EST
(
hide
)
Description:
Patch with code changes and test
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2008-11-20 10:38:59 EST
Size:
3.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/SourceType.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java,v >retrieving revision 1.146 >diff -u -r1.146 SourceType.java >--- model/org/eclipse/jdt/internal/core/SourceType.java 10 Oct 2008 07:28:57 -0000 1.146 >+++ model/org/eclipse/jdt/internal/core/SourceType.java 20 Nov 2008 15:31:08 -0000 >@@ -767,9 +767,11 @@ > * @see IType > */ > public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaModelException { >- CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(this, null, SearchEngine.createWorkspaceScope(), true); >- op.runOperation(monitor); >- return op.getResult(); >+ >+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845, The new type hierarchy should consider changes in primary >+ // working copy. >+ >+ return newTypeHierarchy(DefaultWorkingCopyOwner.PRIMARY, monitor); > } > /* > * @see IType#newTypeHierarchy(ICompilationUnit[], IProgressMonitor) >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java,v >retrieving revision 1.18 >diff -u -r1.18 HierarchyOnWorkingCopiesTests.java >--- src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java 27 Jun 2008 16:02:38 -0000 1.18 >+++ src/org/eclipse/jdt/core/tests/model/HierarchyOnWorkingCopiesTests.java 20 Nov 2008 15:31:11 -0000 >@@ -104,5 +104,44 @@ > } > } > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845 >+//make sure uncommitted changes to primary working copy shows up in hierarchy >+public void test228845() throws CoreException { >+ String newContents = >+ "package x.y;\n" + >+ "public class A extends B {\n" + >+ "}"; >+ >+ ICompilationUnit primaryCu = this.copy.getPrimary(); >+ primaryCu.becomeWorkingCopy(null); >+ >+ primaryCu.getBuffer().setContents(newContents); >+ primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null); >+ >+ IFile file = null; >+ try { >+ file = this.createFile( >+ "P/src/x/y/B.java", >+ "package x.y;\n" + >+ "public class B {\n" + >+ "}"); >+ >+ IType type = this.getCompilationUnit("P/src/x/y/B.java").getType("B"); >+ ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies. >+ >+ assertHierarchyEquals( >+ "Focus: B [in B.java [in x.y [in src [in P]]]]\n" + >+ "Super types:\n" + >+ " Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + >+ "Sub types:\n" + >+ " A [in [Working copy] A.java [in x.y [in src [in P]]]]\n", >+ h); >+ } finally { >+ primaryCu.discardWorkingCopy(); >+ if (file != null) { >+ this.deleteResource(file); >+ } >+ } >+} > > }
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 228845
:
118370
|
118648