diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java index 87c003c3209..04e0fc59d3d 100644 --- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java +++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java @@ -15,6 +15,7 @@ import static org.eclipse.jdt.core.IClasspathAttribute.EXTERNAL_ANNOTATION_PATH; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.io.ByteArrayOutputStream; import java.io.File; @@ -97,6 +98,7 @@ static JavaEditor openInClassfileEditor(IJavaElement element, boolean activate, if (!(element instanceof ISourceReference)) { return null; } + assertNotNull("Should be child of a classfile: "+element, element.getAncestor(IJavaElement.CLASS_FILE)); IEditorPart part= EditorUtility.openInSpecificEditor(element, JavaUI.ID_CF_EDITOR, activate); if (reveal && part != null) { EditorUtility.revealInEditor(part, element);