Skip to content

Commit ee5044c

Browse files
committed
Use pattern matching in genericeditor tests
1 parent a6fca32 commit ee5044c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/org.eclipse.ui.genericeditor.tests/src/org/eclipse/ui/genericeditor/tests/ContextInfoTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ private String getInfoText(final Shell shell) {
126126
assertTrue(shell.isVisible());
127127
Control[] children= shell.getChildren();
128128
for (Control child : children) {
129-
if (child instanceof Text) {
130-
return ((Text) child).getText();
129+
if (child instanceof Text text) {
130+
return text.getText();
131131
}
132-
if (child instanceof StyledText) {
133-
return ((StyledText) child).getText();
132+
if (child instanceof StyledText styled) {
133+
return styled.getText();
134134
}
135135
}
136136
return null;

0 commit comments

Comments
 (0)