From cdf4e78daf098d4fd6ab61e7c3f7d373355314af Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Tue, 9 Jul 2024 17:13:44 +0200 Subject: [PATCH] AnnotateAssistTest1d8 test failed Assert that the java element is child of a classfile debugging https://github.com/eclipse-jdt/eclipse.jdt.ui/issues/736 --- .../jdt/ui/tests/quickfix/AbstractAnnotateAssistTests.java | 2 ++ 1 file changed, 2 insertions(+) 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);