Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.eclipse.debug.tests.AbstractDebugTest;
import org.junit.Test;

@SuppressWarnings("restriction")
public class SerialExecutorTest extends AbstractDebugTest {
@Override
public void tearDown() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
* Primary tests fixed width mode and calculation of {@link TextChangingEvent}s.
* </p>
*/
@SuppressWarnings("restriction")
public class ConsoleDocumentAdapterTests extends AbstractDebugTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ public void setIgnoreFixedConsole(boolean ignoreWrappeding) {
*
* @return output partition identifier
*/
@SuppressWarnings("restriction")
public static String outputPartitionType() {
return org.eclipse.ui.internal.console.IOConsolePartition.OUTPUT_PARTITION_TYPE;
}
Expand All @@ -797,7 +796,6 @@ public static String outputPartitionType() {
*
* @return input partition identifier
*/
@SuppressWarnings("restriction")
public static String inputPartitionType() {
return org.eclipse.ui.internal.console.IOConsolePartition.INPUT_PARTITION_TYPE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
/**
* Tests the ProcessConsoleManager.
*/
@SuppressWarnings("restriction")
public class ProcessConsoleManagerTests extends AbstractDebugTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public void processConsoleUTF8Input(String prefix, int numTwoByteCharacters) thr
final ILaunch launch = new Launch(null, ILaunchManager.RUN_MODE, null);
launch.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, StandardCharsets.UTF_8.toString());
final IProcess process = DebugPlugin.newProcess(launch, mockProcess, "testUtf8Input");
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider(), StandardCharsets.UTF_8.toString());
try {
console.initialize();
Expand Down Expand Up @@ -223,11 +222,9 @@ public void testInputReadJobCancel() throws Exception {
final MockProcess mockProcess = new MockProcess(MockProcess.RUN_FOREVER);
try {
final IProcess process = mockProcess.toRuntimeProcess("testInputReadJobCancel");
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider());
try {
console.initialize();
@SuppressWarnings("restriction")
final Class<?> jobFamily = org.eclipse.debug.internal.ui.views.console.ProcessConsole.class;
assertThat(Job.getJobManager().find(jobFamily)).as("check input read job started").hasSizeGreaterThan(0);
Job.getJobManager().cancel(jobFamily);
Expand Down Expand Up @@ -287,7 +284,6 @@ public void processTerminationTest(ILaunchConfiguration launchConfig, boolean te
final AtomicBoolean terminationSignaled = new AtomicBoolean(false);
final Process mockProcess = new MockProcess(null, null, terminateBeforeConsoleInitialization ? 0 : -1);
final IProcess process = DebugPlugin.newProcess(new Launch(launchConfig, ILaunchManager.RUN_MODE, null), mockProcess, name.getMethodName());
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider());
console.addPropertyChangeListener(event -> {
if (event.getSource() == console && IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE.equals(event.getProperty())) {
Expand Down Expand Up @@ -389,7 +385,6 @@ private IOConsole doConsoleOutputTest(byte[] testContent, Map<String, Object> la
final IProcess process = mockProcess.toRuntimeProcess("Output Redirect", launchConfigAttributes);
final String encoding = launchConfigAttributes != null ? (String) launchConfigAttributes.get(DebugPlugin.ATTR_CONSOLE_ENCODING) : null;
final AtomicBoolean consoleFinished = new AtomicBoolean(false);
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider(), encoding);
console.addPropertyChangeListener((PropertyChangeEvent event) -> {
if (event.getSource() == console && IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE.equals(event.getProperty())) {
Expand All @@ -409,9 +404,7 @@ private IOConsole doConsoleOutputTest(byte[] testContent, Map<String, Object> la
final IDocument doc = console.getDocument();

if (outFile != null) {
@SuppressWarnings("restriction")
String expectedPathMsg = MessageFormat.format(org.eclipse.debug.internal.ui.views.console.ConsoleMessages.ProcessConsole_1, new Object[] {
outFile.getAbsolutePath() });
String expectedPathMsg = MessageFormat.format(org.eclipse.debug.internal.ui.views.console.ConsoleMessages.ProcessConsole_1, outFile.getAbsolutePath());
assertEquals("No or wrong output of redirect file path in console.", expectedPathMsg, doc.get(doc.getLineOffset(0), doc.getLineLength(0)));
assertThat(console.getHyperlinks()).as("check redirect file path is linked").hasSize(1);
}
Expand Down Expand Up @@ -450,7 +443,6 @@ public void testOutput() throws Exception {
launchConfigAttributes.put(DebugPlugin.ATTR_CONSOLE_ENCODING, consoleEncoding);
final IProcess process = mockProcess.toRuntimeProcess("simpleOutput", launchConfigAttributes);
sysout.println(lines[1]);
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider(), consoleEncoding);
sysout.println(lines[2]);
try {
Expand Down Expand Up @@ -507,7 +499,6 @@ public void testBinaryOutputToFile() throws Exception {
launchConfigAttributes.put(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, outFile.getCanonicalPath());
launchConfigAttributes.put(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, false);
final IProcess process = mockProcess.toRuntimeProcess("redirectBinaryOutput", launchConfigAttributes);
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider(), consoleEncoding);
try {
console.initialize();
Expand Down Expand Up @@ -562,7 +553,6 @@ public void testBinaryInputFromFile() throws Exception {
launchConfigAttributes.put(IDebugUIConstants.ATTR_CAPTURE_STDIN_FILE, inFile.getCanonicalPath());
launchConfigAttributes.put(IDebugUIConstants.ATTR_CAPTURE_IN_CONSOLE, false);
final IProcess process = mockProcess.toRuntimeProcess("redirectBinaryInput", launchConfigAttributes);
@SuppressWarnings("restriction")
final org.eclipse.debug.internal.ui.views.console.ProcessConsole console = new org.eclipse.debug.internal.ui.views.console.ProcessConsole(process, new ConsoleColorProvider(), consoleEncoding);
try {
console.initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
@SuppressWarnings("deprecation")
public class LaunchConfigurationTests extends AbstractLaunchTest implements ILaunchConfigurationListener {

@SuppressWarnings({ "restriction", "unused" })
@SuppressWarnings({ "unused" })
// Only ensures org.eclipse.ui.externaltools is required
private static final org.eclipse.ui.externaltools.internal.model.BuilderUtils ref = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ public void testToolTipCalculationLogsError() throws Exception {
}

class LogListener implements ILogListener {
private Map<String, IStatus> logs = new HashMap<>();
private final Map<String, IStatus> logs = new HashMap<>();

@Override
public synchronized void logging(IStatus status, String plugin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ public class TestLogicalStructureTypeDelegate implements ILogicalStructureTypeDe

@Override
public boolean providesLogicalStructure(IValue value) {
if (value instanceof TestValue) {
TestValue testValue = (TestValue) value;
if (value instanceof TestValue testValue) {
return "raw".equals(testValue.getValueString());
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public class TestSourceDirector extends AbstractSourceLookupDirector {
public Object getSourceElement(Object element) {
if (element instanceof String) {
return element.toString() + System.currentTimeMillis();
} else if (element instanceof IStackFrame) {
IStackFrame frame = (IStackFrame) element;
} else if (element instanceof IStackFrame frame) {
return frame.getModelIdentifier() + System.currentTimeMillis();
}
return super.getSourceElement(element);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
import org.eclipse.debug.tests.ui.SpyTab.SpyTabB;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;

public class SpyTabGroup extends AbstractLaunchConfigurationTabGroup {

@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
setTabs(new ILaunchConfigurationTab[] { new SpyTabA(), new SpyTabB() });
setTabs(new SpyTabA(), new SpyTabB());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* Tests for translation of memory bytes between in-memory representation and UI
* presentation
*/
@SuppressWarnings("restriction")
public class TableRenderingTests {

private static final byte[] BYTES_1 = new byte[] { (byte) 0x87 };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ static class TestViewerFilter extends ViewerFilter {

@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof TestElement) {
TestElement te = (TestElement)element;
if (element instanceof TestElement te) {
return !fPattern.matcher(te.getLabel()).find();
}

Expand All @@ -88,8 +87,7 @@ public boolean isApplicable(ITreeModelViewer viewer, Object parentElement) {

@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof TestElement) {
TestElement te = (TestElement)element;
if (element instanceof TestElement te) {
return !fPattern.matcher(te.getLabel()).find();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public void viewerUpdatesComplete() {
}

private TreePath getTreePath(Widget w) {
if (w instanceof TreeItem) {
TreeItem item = (TreeItem)w;
if (w instanceof TreeItem item) {
LinkedList<Object> segments = new LinkedList<>();
while (item != null) {
Object segment = item.getData();
Expand Down
Loading