Lines 104-108
Link Here
|
104 |
} |
104 |
} |
105 |
} |
105 |
} |
106 |
} |
106 |
} |
|
|
107 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=228845 |
108 |
//make sure uncommitted changes to primary working copy shows up in hierarchy |
109 |
public void test228845() throws CoreException { |
110 |
String newContents = |
111 |
"package x.y;\n" + |
112 |
"public class A extends B {\n" + |
113 |
"}"; |
114 |
|
115 |
ICompilationUnit primaryCu = this.copy.getPrimary(); |
116 |
primaryCu.becomeWorkingCopy(null); |
117 |
|
118 |
primaryCu.getBuffer().setContents(newContents); |
119 |
primaryCu.reconcile(ICompilationUnit.NO_AST, false, null, null); |
120 |
|
121 |
IFile file = null; |
122 |
try { |
123 |
file = this.createFile( |
124 |
"P/src/x/y/B.java", |
125 |
"package x.y;\n" + |
126 |
"public class B {\n" + |
127 |
"}"); |
128 |
|
129 |
IType type = this.getCompilationUnit("P/src/x/y/B.java").getType("B"); |
130 |
ITypeHierarchy h = type.newTypeHierarchy(null); // no working copies explicitly passed, should still honor primary working copies. |
131 |
|
132 |
assertHierarchyEquals( |
133 |
"Focus: B [in B.java [in x.y [in src [in P]]]]\n" + |
134 |
"Super types:\n" + |
135 |
" Object [in Object.class [in java.lang [in "+ getExternalJCLPathString() + "]]]\n" + |
136 |
"Sub types:\n" + |
137 |
" A [in [Working copy] A.java [in x.y [in src [in P]]]]\n", |
138 |
h); |
139 |
} finally { |
140 |
primaryCu.discardWorkingCopy(); |
141 |
if (file != null) { |
142 |
this.deleteResource(file); |
143 |
} |
144 |
} |
145 |
} |
107 |
|
146 |
|
108 |
} |
147 |
} |