From 39d3bfcc4f08e67fe22cd6054a569cf4beba41fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Date: Mon, 29 Jun 2020 19:05:05 +0200 Subject: [PATCH] Fixed NLS warnings, potential NPE and removed excess semicolon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Torbjörn Svensson Change-Id: I266a72dadae318ae301ca11d2ea2d74082219a24 --- .../dap/InitializeLaunchConfigurations.java | 24 +++++++++---------- .../eclipse/cdt/debug/dap/MemoryBlock.java | 2 +- .../expression/VMExpressionUpdate.java | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../dap/gdbjtag/DapGdbJtagLaunchDelegate.java | 8 +++---- .../META-INF/MANIFEST.MF | 2 +- .../cdt/debug/gdbjtag/core/Activator.java | 2 +- .../core/GDBJtagDSFFinalLaunchSequence.java | 18 +++++++------- .../jtagdevice/DefaultGDBJtagDeviceImpl.java | 6 ++--- .../GDBJtagDeviceContributionFactory.java | 4 ++-- .../ContainerCommandLauncherFactory.java | 2 +- .../docker/launcher/ContainerPropertyTab.java | 10 ++++---- .../docker/launcher/ContainerTab.java | 18 +++++++------- .../docker/launcher/DataVolumeModel.java | 4 ++-- .../docker/launcher/ExposedPortModel.java | 6 ++--- .../docker/launcher/GdbDebuggerPage.java | 2 +- .../docker/launcher/SWTImagesFactory.java | 10 ++++---- .../ui/launchbar/ContainerGCCToolChain.java | 4 ++-- .../NewContainerTargetWizardPage.java | 6 ++--- .../ui/preferences/PreferenceInitializer.java | 2 +- .../core/DefaultLaunchDescriptorType.java | 2 +- .../launchbar/core/target/ILaunchTarget.java | 2 +- 22 files changed, 70 insertions(+), 68 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/InitializeLaunchConfigurations.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/InitializeLaunchConfigurations.java index 7416d431a05..c5cbb6e3513 100644 --- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/InitializeLaunchConfigurations.java +++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/InitializeLaunchConfigurations.java @@ -40,22 +40,22 @@ public class InitializeLaunchConfigurations { public Optional getVSCodeLocation(String appendPathSuffix) { String res = null; if (Platform.getOS().equals(Platform.OS_LINUX)) { - res = "/usr/share/code"; + res = "/usr/share/code"; //$NON-NLS-1$ } else if (Platform.getOS().equals(Platform.OS_WIN32)) { - res = "C:/Program Files (x86)/Microsoft VS Code"; + res = "C:/Program Files (x86)/Microsoft VS Code"; //$NON-NLS-1$ } else if (Platform.getOS().equals(Platform.OS_MACOSX)) { - res = "/Applications/Visual Studio Code.app"; + res = "/Applications/Visual Studio Code.app"; //$NON-NLS-1$ IPath path = new Path(appendPathSuffix); // resources/ maps to Contents/Resources on macOS - if (path.segmentCount() > 1 && path.segment(0).equals("resources")) { + if (path.segmentCount() > 1 && path.segment(0).equals("resources")) { //$NON-NLS-1$ path = path.removeFirstSegments(1); - appendPathSuffix = new Path("/Contents/Resources").append(path).toOSString(); + appendPathSuffix = new Path("/Contents/Resources").append(path).toOSString(); //$NON-NLS-1$ } } if (res != null && new File(res).isDirectory()) { - if (res.contains(" ") && Platform.getOS().equals(Platform.OS_WIN32)) { - return Optional.of("\"" + res + appendPathSuffix + "\""); + if (res.contains(" ") && Platform.getOS().equals(Platform.OS_WIN32)) { //$NON-NLS-1$ + return Optional.of("\"" + res + appendPathSuffix + "\""); //$NON-NLS-1$ //$NON-NLS-2$ } return Optional.of(res + appendPathSuffix); } @@ -64,16 +64,16 @@ public class InitializeLaunchConfigurations { public Optional getNodeJsLocation() { { - String nodeJsLocation = System.getProperty("org.eclipse.wildwebdeveloper.nodeJSLocation"); + String nodeJsLocation = System.getProperty("org.eclipse.wildwebdeveloper.nodeJSLocation"); //$NON-NLS-1$ if (nodeJsLocation != null && Files.exists(Paths.get(nodeJsLocation))) { return Optional.of(nodeJsLocation); } } - String res = "/path/to/node"; - String[] command = new String[] { "/bin/bash", "-c", "which node" }; + String res = "/path/to/node"; //$NON-NLS-1$ + String[] command = new String[] { "/bin/bash", "-c", "which node" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (Platform.getOS().equals(Platform.OS_WIN32)) { - command = new String[] { "cmd", "/c", "where node" }; + command = new String[] { "cmd", "/c", "where node" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } try (BufferedReader reader = new BufferedReader( @@ -86,7 +86,7 @@ public class InitializeLaunchConfigurations { // Try default install path as last resort if (res == null && Platform.getOS().equals(Platform.OS_MACOSX)) { - res = "/usr/local/bin/node"; + res = "/usr/local/bin/node"; //$NON-NLS-1$ } if (res != null && Files.exists(Paths.get(res))) { diff --git a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/MemoryBlock.java b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/MemoryBlock.java index e88837abaec..11275752658 100644 --- a/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/MemoryBlock.java +++ b/debug/org.eclipse.cdt.debug.dap/src/org/eclipse/cdt/debug/dap/MemoryBlock.java @@ -136,7 +136,7 @@ public class MemoryBlock extends CDTDebugElement implements IMemoryBlockExtensio @Override public MemoryByte[] getBytesFromAddress(BigInteger address, long units) throws DebugException { MemoryRequestArguments memoryRequestArguments = new MemoryRequestArguments(); - memoryRequestArguments.setAddress("0x" + address.toString(16)); + memoryRequestArguments.setAddress("0x" + address.toString(16)); //$NON-NLS-1$ memoryRequestArguments.setLength(units); CompletableFuture memory = getDebugProtocolServer().memory(memoryRequestArguments); MemoryContents body = complete(memory); diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java index fb6eb636204..0ded1ac5703 100644 --- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java +++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/expression/VMExpressionUpdate.java @@ -85,7 +85,7 @@ class VMExpressionUpdate extends VMViewerUpdate implements IExpressionUpdate { if (VMViewerUpdateTracing.DEBUG_VMUPDATES && !isCanceled() && VMViewerUpdateTracing.matchesFilterRegex(this.getClass())) { DsfUIPlugin.debug(DsfPlugin.getDebugTime() + " " + LoggingUtils.toString(this) + " marked done; element = " //$NON-NLS-1$//$NON-NLS-2$ - + LoggingUtils.toString(getElement()) + "\n expression = " + + LoggingUtils.toString(getElement()) + "\n expression = " //$NON-NLS-1$ + (fExpressionElement != null ? LoggingUtils.toString(fExpressionElement) : "")); //$NON-NLS-1$ } diff --git a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF index 52c407c4ba9..34adf36ce08 100644 --- a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF +++ b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-Vendor: %Bundle-Vendor Bundle-SymbolicName: org.eclipse.cdt.debug.dap.gdbjtag;singleton:=true -Bundle-Version: 1.100.100.qualifier +Bundle-Version: 1.100.200.qualifier Bundle-Activator: org.eclipse.cdt.debug.dap.gdbjtag.Activator Require-Bundle: org.apache.commons.io, org.eclipse.core.runtime, diff --git a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/DapGdbJtagLaunchDelegate.java b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/DapGdbJtagLaunchDelegate.java index cfa1d4f40bb..c749f23b789 100644 --- a/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/DapGdbJtagLaunchDelegate.java +++ b/jtag/org.eclipse.cdt.debug.dap.gdbjtag/src/org/eclipse/cdt/debug/dap/gdbjtag/DapGdbJtagLaunchDelegate.java @@ -112,7 +112,7 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate { String symbolsOffset = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); if (symbolsOffset != null && symbolsOffset.length() > 0) { - symbolsOffset = "0x" + symbolsOffset; + symbolsOffset = "0x" + symbolsOffset; //$NON-NLS-1$ } List commands = new ArrayList<>(); jtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); @@ -170,7 +170,7 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate { String imageOffset = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); if (imageOffset != null && imageOffset.length() > 0) { - imageOffset = "0x" + CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, + imageOffset = "0x" + CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_IMAGE_OFFSET, //$NON-NLS-1$ IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); } List commands = new ArrayList<>(); @@ -353,7 +353,7 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate { private GDBJtagDeviceContribution getGDBJtagDeviceContribution(Map attributes) throws CoreException { if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID)) { - String deviceId = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, ""); + String deviceId = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, ""); //$NON-NLS-1$ if (!deviceId.isEmpty()) { return GDBJtagDeviceContributionFactory.getInstance().findByDeviceId(deviceId); } @@ -361,7 +361,7 @@ public class DapGdbJtagLaunchDelegate extends DapLaunchDelegate { // Fall back to old behavior with name only if ID is missing if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE)) { - String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); + String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$ if (!deviceName.isEmpty()) { return GDBJtagDeviceContributionFactory.getInstance().findByDeviceName(deviceName); } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF index 686cc84fa77..523ef937545 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true -Bundle-Version: 9.5.0.qualifier +Bundle-Version: 9.5.100.qualifier Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java index 646a4531ca9..d799d78c49f 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/Activator.java @@ -26,7 +26,7 @@ import org.osgi.framework.BundleContext; public class Activator extends Plugin { // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.cdt.debug.gdbjtag.core"; + public static final String PLUGIN_ID = "org.eclipse.cdt.debug.gdbjtag.core"; //$NON-NLS-1$ // The shared instance private static Activator plugin; diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java index 89c623f0640..0ac827ac3a3 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java @@ -195,7 +195,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { } /** @since 8.2 */ - protected static final String GROUP_JTAG = "GROUP_JTAG"; + protected static final String GROUP_JTAG = "GROUP_JTAG"; //$NON-NLS-1$ @Override protected String[] getExecutionOrder(String group) { @@ -209,14 +209,16 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { })); // Now insert our steps before the data model initialized event is sent - orderList.add(orderList.indexOf("stepDataModelInitializationComplete"), GROUP_JTAG); + orderList.add(orderList.indexOf("stepDataModelInitializationComplete"), GROUP_JTAG); //$NON-NLS-1$ return orderList.toArray(new String[orderList.size()]); } // Finally, deal with our groups and their steps. if (GROUP_JTAG.equals(group)) { - return new String[] { "stepInitializeJTAGFinalLaunchSequence", "stepRetrieveJTAGDevice", //$NON-NLS-2$ + return new String[] { // + "stepInitializeJTAGFinalLaunchSequence", //$NON-NLS-1$ + "stepRetrieveJTAGDevice", //$NON-NLS-1$ "stepLoadSymbols", //$NON-NLS-1$ "stepConnectToTarget", //$NON-NLS-1$ "stepResetBoard", //$NON-NLS-1$ @@ -354,7 +356,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { String symbolsOffset = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_SYMBOLS_OFFSET, IGDBJtagConstants.DEFAULT_SYMBOLS_OFFSET); if (symbolsOffset.length() > 0) { - symbolsOffset = "0x" + symbolsOffset; + symbolsOffset = "0x" + symbolsOffset; //$NON-NLS-1$ } List commands = new ArrayList<>(); fGdbJtagDevice.doLoadSymbol(symbolsFileName, symbolsOffset, commands); @@ -553,8 +555,8 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { String imageOffset = CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); if (imageOffset.length() > 0) { - imageOffset = (imageFileName.endsWith(".elf")) ? "" //$NON-NLS-2$ - : "0x" + CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, + imageOffset = (imageFileName.endsWith(".elf")) ? "" //$NON-NLS-1$//$NON-NLS-2$ + : "0x" + CDebugUtils.getAttribute(getAttributes(), IGDBJtagConstants.ATTR_IMAGE_OFFSET, //$NON-NLS-1$ IGDBJtagConstants.DEFAULT_IMAGE_OFFSET); } List commands = new ArrayList<>(); @@ -756,7 +758,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { private GDBJtagDeviceContribution getGDBJtagDeviceContribution() { Map attributes = getAttributes(); if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE_ID)) { - String deviceId = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, ""); + String deviceId = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE_ID, ""); //$NON-NLS-1$ if (!deviceId.isEmpty()) { return GDBJtagDeviceContributionFactory.getInstance().findByDeviceId(deviceId); } @@ -764,7 +766,7 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { // Fall back to old behavior with name only if ID is missing if (attributes.containsKey(IGDBJtagConstants.ATTR_JTAG_DEVICE)) { - String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); + String deviceName = CDebugUtils.getAttribute(attributes, IGDBJtagConstants.ATTR_JTAG_DEVICE, ""); //$NON-NLS-1$ if (!deviceName.isEmpty()) { return GDBJtagDeviceContributionFactory.getInstance().findByDeviceName(deviceName); } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java index ac5d4b38b16..08b68303f4c 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java @@ -77,16 +77,16 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice { @Override public void doLoadImage(String imageFileName, String imageOffset, Collection commands) { - addCmd(commands, "load " + escapeScpaces(imageFileName) + ' ' + imageOffset); + addCmd(commands, "load " + escapeScpaces(imageFileName) + ' ' + imageOffset); //$NON-NLS-1$ } @Override public void doLoadSymbol(String symbolFileName, String symbolOffset, Collection commands) { String file = escapeScpaces(symbolFileName); if (symbolOffset == null || (symbolOffset.length() == 0)) { - addCmd(commands, "symbol-file " + file); + addCmd(commands, "symbol-file " + file); //$NON-NLS-1$ } else { - addCmd(commands, "add-symbol-file " + file + " " + symbolOffset); + addCmd(commands, "add-symbol-file " + file + " " + symbolOffset); //$NON-NLS-1$ //$NON-NLS-2$ } } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java index afda65663ba..921dff40634 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/GDBJtagDeviceContributionFactory.java @@ -87,8 +87,8 @@ public class GDBJtagDeviceContributionFactory { String elementValue = configurationElement.getAttribute(name); if (elementValue == null) Activator.log(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, - "Extension " + configurationElement.getDeclaringExtension().getUniqueIdentifier() - + " missing required attribute: " + name, + "Extension " + configurationElement.getDeclaringExtension().getUniqueIdentifier() //$NON-NLS-1$ + + " missing required attribute: " + name, //$NON-NLS-1$ null)); return elementValue; } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java index 24a48609bc5..28359b5d233 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java @@ -329,7 +329,7 @@ public class ContainerCommandLauncherFactory implements ICommandLauncherFactory, .append("HEADERS").append(getCleanName(connectionName)) //$NON-NLS-1$ .append(getCleanName(imageName)); toolchain.setProperty("cdt.needScannerRefresh", //$NON-NLS-1$ - pluginPath.toFile().exists() ? "false" : "true"); //$NON-NLS-2$ + pluginPath.toFile().exists() ? "false" : "true"); //$NON-NLS-1$ //$NON-NLS-2$ } } return includePaths; diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java index 3e175f2093f..4164122fe73 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java @@ -134,7 +134,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab int index = connectionSelector.getSelectionIndex(); if (index < 0) { connection = null; - connectionName = ""; + connectionName = ""; //$NON-NLS-1$ return; } if (connection != null) @@ -142,7 +142,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab connection = connections[index]; connectionUri = connection.getUri(); if (!connectionName.equals(connection.getName())) { - imageCombo.setText(""); + imageCombo.setText(""); //$NON-NLS-1$ initialImageId = null; refreshImages(); setVolumeControlsEnabled(new Button[] { addButton }, false); @@ -308,7 +308,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(addButton); addButton.setText(WizardMessages.getString("ImageRunResourceVolVarPage.addButton")); //$NON-NLS-1$ addButton.addSelectionListener(onAddDataVolume(dataVolumesTableViewer)); - if (imageCombo.getText() != null && !imageCombo.getText().equals("")) { + if (imageCombo.getText() != null && !imageCombo.getText().equals("")) { //$NON-NLS-1$ setVolumeControlsEnabled(new Button[] { addButton }, true); } final Button editButton = new Button(buttonsContainers, SWT.NONE); @@ -967,8 +967,8 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab connection = null; model.setConnection(null); model.setSelectedImage(null); - connectionUri = ""; - connectionSelector.setText(""); + connectionUri = ""; //$NON-NLS-1$ + connectionSelector.setText(""); //$NON-NLS-1$ } connectionSelector.addModifyListener(connectionModifyListener); } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java index 2842dcc0eae..5eab9ec1ca8 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java @@ -78,7 +78,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab private List directoriesList; private String imageName; private String connectionName; - private String connectionUri = ""; + private String connectionUri = ""; //$NON-NLS-1$ private Boolean keepValue; private Boolean stdinValue; private Boolean privilegedValue; @@ -217,7 +217,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab Composite composite = createComposite(parent, 1, 1, GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END); composite.setFont(font); - newButton = createPushButton(composite, Messages.ContainerTab_New_Button, null); //$NON-NLS-1$ + newButton = createPushButton(composite, Messages.ContainerTab_New_Button, null); newButton.setLayoutData(new GridData(GridData.FILL_BOTH)); GridData gdb = new GridData(GridData.VERTICAL_ALIGN_CENTER); gdb.grabExcessHorizontalSpace = false; @@ -231,7 +231,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab } }); - removeButton = createPushButton(composite, Messages.ContainerTab_Remove_Button, null); //$NON-NLS-1$ + removeButton = createPushButton(composite, Messages.ContainerTab_Remove_Button, null); removeButton.setLayoutData(new GridData(GridData.FILL_BOTH)); removeButton.addSelectionListener(new SelectionAdapter() { @Override @@ -612,7 +612,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab tableViewer.setChecked(m, true); } } - connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, ""); + connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$ int defaultIndex = 0; connections = DockerConnectionManager.getInstance().getConnections(); if (connections.length > 0) { @@ -628,7 +628,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab connectionUri = connections[0].getUri(); } } - imageName = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, ""); + imageName = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, ""); //$NON-NLS-1$ imageCombo.setText(imageName); keepValue = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false); keepButton.setSelection(keepValue); @@ -638,7 +638,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab privilegedButton.setSelection(privilegedValue); } catch (CoreException e) { setErrorMessage( - Messages.bind(Messages.ContainerTab_Error_Reading_Configuration, e.getStatus().getMessage())); //$NON-NLS-1$ + Messages.bind(Messages.ContainerTab_Error_Reading_Configuration, e.getStatus().getMessage())); DockerLaunchUIPlugin.log(e); } } @@ -663,7 +663,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab String image = launchConfig.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null); if (image == null) return false; - int index = image.lastIndexOf(':'); //$NON-NLS-1$ + int index = image.lastIndexOf(':'); if (index <= 0) return false; if (connection.hasImage(image.substring(0, index), image.substring(index + 1))) { @@ -722,8 +722,8 @@ public class ContainerTab extends AbstractLaunchConfigurationTab } else { setErrorMessage(Messages.ContainerTab_Error_No_Connections); connection = null; - connectionUri = ""; - connectionSelector.setText(""); + connectionUri = ""; //$NON-NLS-1$ + connectionSelector.setText(""); //$NON-NLS-1$ } connectionSelector.addModifyListener(connectionModifyListener); } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java index fe7bfe98709..6e4474d1ac8 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java @@ -177,7 +177,7 @@ public class DataVolumeModel extends BaseDatabindingModel implements Comparable< model.setHostPathMount(convertToWin32Path(Platform.getOS(), items[0])); model.containerPath = items[1]; model.mountType = MountType.HOST_FILE_SYSTEM; - if (items[2].equals("ro")) { + if (items[2].equals("ro")) { //$NON-NLS-1$ model.setReadOnly(true); } else { model.setReadOnly(false); @@ -242,7 +242,7 @@ public class DataVolumeModel extends BaseDatabindingModel implements Comparable< } firePropertyChange(MOUNT_TYPE, this.mountType, this.mountType = mountType); if (this.mountType == MountType.NONE) { - setMount(""); + setMount(""); //$NON-NLS-1$ } } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java index 12e9a8cacfe..3202c8326bc 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java @@ -79,8 +79,8 @@ public class ExposedPortModel extends BaseDatabindingModel implements Comparable public static List toArrayString(final Collection exposedPorts) { final List exposedPortList = new ArrayList<>(); for (ExposedPortModel exposedPort : exposedPorts) { - final String exposedPortString = exposedPort.toString(); if (exposedPort != null) { + final String exposedPortString = exposedPort.toString(); exposedPortList.add(exposedPortString); } } @@ -101,7 +101,7 @@ public class ExposedPortModel extends BaseDatabindingModel implements Comparable final int firstColumnSeparator = exposedPortInfo.indexOf(SEPARATOR); if (firstColumnSeparator == -1 && exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR) != -1) { final String type = exposedPortInfo.substring(exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR)); // $NON-NLS-1$ - final ExposedPortModel exposedPort = new ExposedPortModel(privatePort, type, "", privatePort); // $NON-NLS-1$ + final ExposedPortModel exposedPort = new ExposedPortModel(privatePort, type, "", privatePort); //$NON-NLS-1$ return exposedPort; // $NON-NLS-1$ } else { final int secondColumnSeparator = exposedPortInfo.indexOf(SEPARATOR, firstColumnSeparator + 1); @@ -223,7 +223,7 @@ public class ExposedPortModel extends BaseDatabindingModel implements Comparable public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(containerPort + CONTAINER_TYPE_SEPARATOR + portType + SEPARATOR - + (hostAddress != null ? hostAddress : "") + SEPARATOR + hostPort + SEPARATOR + selected); + + (hostAddress != null ? hostAddress : "") + SEPARATOR + hostPort + SEPARATOR + selected); //$NON-NLS-1$ return buffer.toString(); } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java index d5a20d1933a..ee973c37c6d 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java @@ -113,7 +113,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer { setErrorMessage(null); setMessage(null); } else { - setErrorMessage(Messages.GDBDebuggerPage0); //$NON-NLS-1$ + setErrorMessage(Messages.GDBDebuggerPage0); setMessage(null); } return valid; diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java index f05af735723..b542aaa3b82 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java @@ -46,11 +46,11 @@ public class SWTImagesFactory { public static final String IMG_WARNING = NAME_PREFIX + "warning_obj.gif"; //$NON-NLS-1$ public static final String IMG_ERROR = NAME_PREFIX + "error_obj.gif"; //$NON-NLS-1$ - public static final ImageDescriptor DESC_CONTAINER = createManaged("", IMG_CONTAINER); - public static final ImageDescriptor DESC_FOLDER_CLOSED = createManaged("", IMG_FOLDER_CLOSED); - public static final ImageDescriptor DESC_FILE = createManaged("", IMG_FILE); - public static final ImageDescriptor DESC_WARNING = createManaged("", IMG_WARNING); - public static final ImageDescriptor DESC_ERROR = createManaged("", IMG_ERROR); + public static final ImageDescriptor DESC_CONTAINER = createManaged("", IMG_CONTAINER); //$NON-NLS-1$ + public static final ImageDescriptor DESC_FOLDER_CLOSED = createManaged("", IMG_FOLDER_CLOSED); //$NON-NLS-1$ + public static final ImageDescriptor DESC_FILE = createManaged("", IMG_FILE); //$NON-NLS-1$ + public static final ImageDescriptor DESC_WARNING = createManaged("", IMG_WARNING); //$NON-NLS-1$ + public static final ImageDescriptor DESC_ERROR = createManaged("", IMG_ERROR); //$NON-NLS-1$ private static ImageDescriptor createManaged(String prefix, String name) { return createManaged(imageRegistry, prefix, name); diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java index afcd8d5669e..be0bd7fb2d3 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java @@ -213,7 +213,7 @@ public class ContainerGCCToolChain extends PlatformObject implements IToolChain, if (baseScannerInfo.getDefinedSymbols() != null) { for (Map.Entry macro : baseScannerInfo.getDefinedSymbols().entrySet()) { if (macro.getValue() != null && !macro.getValue().isEmpty()) { - commandLine.add("-D" + macro.getKey() + "=" + macro.getValue()); //$NON-NLS-1$ + commandLine.add("-D" + macro.getKey() + "=" + macro.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ } else { commandLine.add("-D" + macro.getKey()); //$NON-NLS-1$ } @@ -331,7 +331,7 @@ public class ContainerGCCToolChain extends PlatformObject implements IToolChain, if (baseScannerInfo.getDefinedSymbols() != null) { for (Map.Entry macro : baseScannerInfo.getDefinedSymbols().entrySet()) { if (macro.getValue() != null && !macro.getValue().isEmpty()) { - commandLine.add("-D" + macro.getKey() + "=" + macro.getValue()); //$NON-NLS-1$ + commandLine.add("-D" + macro.getKey() + "=" + macro.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ } else { commandLine.add("-D" + macro.getKey()); //$NON-NLS-1$ } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java index 986d441745c..fd582c7e1ee 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java @@ -58,7 +58,7 @@ public class NewContainerTargetWizardPage extends WizardPage private IDockerImageListener wizardPage; private String imageName; private String connectionName; - private String connectionUri = ""; + private String connectionUri = ""; //$NON-NLS-1$ public NewContainerTargetWizardPage(ILaunchTarget launchTarget) { super(NewContainerTargetWizardPage.class.getName()); @@ -259,8 +259,8 @@ public class NewContainerTargetWizardPage extends WizardPage } else { setErrorMessage(Messages.NewContainerTargetWizardPage_no_connections); connection = null; - connectionUri = ""; - connectionSelector.setText(""); + connectionUri = ""; //$NON-NLS-1$ + connectionSelector.setText(""); //$NON-NLS-1$ } connectionSelector.addModifyListener(connectionModifyListener); } diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/PreferenceInitializer.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/PreferenceInitializer.java index 3e989fa6700..06b755cf0f0 100644 --- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/PreferenceInitializer.java +++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/PreferenceInitializer.java @@ -23,7 +23,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { @Override public void initializeDefaultPreferences() { IPreferenceStore store = DockerLaunchUIPlugin.getDefault().getPreferenceStore(); - store.setDefault(PreferenceConstants.DEFAULT_IMAGE, ""); + store.setDefault(PreferenceConstants.DEFAULT_IMAGE, ""); //$NON-NLS-1$ store.setDefault(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false); } diff --git a/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java index 0d1bcfaef9e..f00b8237a35 100644 --- a/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java +++ b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/DefaultLaunchDescriptorType.java @@ -57,7 +57,7 @@ public class DefaultLaunchDescriptorType implements ILaunchDescriptorType { String category = type.getCategory(); return type.isPublic() && !(config.getAttribute(ILaunchManager.ATTR_PRIVATE, false)) - && !("org.eclipse.ui.externaltools.builder".equals(category)); // $NON-NLS-1$ + && !("org.eclipse.ui.externaltools.builder".equals(category)); //$NON-NLS-1$ } @Override diff --git a/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java index e05b0763a03..d45b44a06fe 100644 --- a/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java +++ b/launchbar/org.eclipse.launchbar.core/src/org/eclipse/launchbar/core/target/ILaunchTarget.java @@ -36,7 +36,7 @@ public interface ILaunchTarget extends IAdaptable { @Override public ILaunchTargetWorkingCopy getWorkingCopy() { throw new UnsupportedOperationException(Messages.ILaunchTarget_notSupported); - }; + } }; /**