Lines 1244-1249
Link Here
|
1244 |
h.removeTypeHierarchyChangedListener(this); |
1244 |
h.removeTypeHierarchyChangedListener(this); |
1245 |
} |
1245 |
} |
1246 |
} |
1246 |
} |
|
|
1247 |
|
1248 |
/* |
1249 |
* Ensures that getting a non-primary working copy does NOT trigger |
1250 |
* a type hierarchy notification for the concerned hierarchy. |
1251 |
* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=275805 |
1252 |
*/ |
1253 |
public void testGetWorkingCopy() throws CoreException { |
1254 |
ITypeHierarchy h = null; |
1255 |
ICompilationUnit superCopy = null; |
1256 |
ICompilationUnit aWorkingCopy = null; |
1257 |
|
1258 |
try { |
1259 |
|
1260 |
createJavaProject("P"); |
1261 |
createFolder("/P/p"); |
1262 |
createFile( |
1263 |
"/P/p/IX.java", |
1264 |
"package p;\n" + |
1265 |
"public interface IX {\n" + |
1266 |
"}" |
1267 |
); |
1268 |
|
1269 |
createFile( |
1270 |
"/P/p/X.java", |
1271 |
"package p;\n" + |
1272 |
"public class X implements IX{\n" + |
1273 |
"}" |
1274 |
); |
1275 |
|
1276 |
superCopy = getCompilationUnit("/P/p/IX.java"); |
1277 |
superCopy.becomeWorkingCopy(null/*no progress*/); |
1278 |
h = superCopy.getType("IX").newTypeHierarchy(null); |
1279 |
h.addTypeHierarchyChangedListener(this); |
1280 |
|
1281 |
aWorkingCopy = getCompilationUnit("P/p/X.java").getWorkingCopy(null); |
1282 |
|
1283 |
assertTrue("Should receive NO change", !this.changeReceived); |
1284 |
} finally { |
1285 |
if (h != null) |
1286 |
h.removeTypeHierarchyChangedListener(this); |
1287 |
if (aWorkingCopy != null) |
1288 |
aWorkingCopy.discardWorkingCopy(); |
1289 |
if (superCopy!= null) |
1290 |
superCopy.discardWorkingCopy(); |
1291 |
|
1292 |
deleteProject("P"); |
1293 |
} |
1294 |
} |
1295 |
|
1247 |
/** |
1296 |
/** |
1248 |
* Make a note of the change |
1297 |
* Make a note of the change |
1249 |
*/ |
1298 |
*/ |