Skip to content

Commit 7a56d77

Browse files
committed
Fix Javadoc + compiler warnings
1 parent 5d57da2 commit 7a56d77

File tree

11 files changed

+23
-25
lines changed

11 files changed

+23
-25
lines changed

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/internal/dialogs/LaunchTerminalSettingsDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ public IDialogSettings getDialogSettings() {
688688
/**
689689
* Sets the associated dialog settings storage.
690690
*
691-
* @return The dialog settings storage.
691+
* @param dialogSettings The dialog settings storage.
692692
*/
693693
public void setDialogSettings(IDialogSettings dialogSettings) {
694694
this.dialogSettings = dialogSettings;

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/internal/handler/AbstractTriggerCommandHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public abstract class AbstractTriggerCommandHandler extends AbstractHandler {
3939
* @param commandId The command id. Must not be <code>null</code>.
4040
* @param selection The selection to pass on to the command or <code>null</code>.
4141
*/
42-
@SuppressWarnings("cast")
4342
protected void triggerCommand(String commandId, ISelection selection) {
4443
Assert.isNotNull(commandId);
4544

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/local/showin/DynamicContributionItems.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ protected IContributionItem[] getContributionItems() {
7373

7474
ImageData id = icon != null ? ExternalExecutablesUtils.loadImage(icon) : null;
7575
if (id != null) {
76+
@SuppressWarnings("deprecation")
7677
ImageDescriptor desc = ImageDescriptor.createFromImageData(id);
7778
if (desc != null)
7879
action.setImageDescriptor(desc);

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/preferences/PreferencePage.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,17 @@ public void widgetSelected(SelectionEvent e) {
291291
// Determine the filter path
292292
String text = workingDir.getText();
293293
if (Messages.PreferencePage_workingDir_userhome_label.equals(text)) {
294-
dialog.setFilterPath(uh.toOSString());
294+
if (uh != null) {
295+
dialog.setFilterPath(uh.toOSString());
296+
}
295297
} else if (Messages.PreferencePage_workingDir_eclipsehome_label.equals(text)) {
296-
dialog.setFilterPath(eh.toOSString());
298+
if (eh != null) {
299+
dialog.setFilterPath(eh.toOSString());
300+
}
297301
} else if (Messages.PreferencePage_workingDir_eclipsews_label.equals(text)) {
298-
dialog.setFilterPath(ew.toOSString());
302+
if (ew != null) {
303+
dialog.setFilterPath(ew.toOSString());
304+
}
299305
} else if (text != null && !"".equals(text.trim())) { //$NON-NLS-1$
300306
try {
301307
// Resolve possible dynamic variables
@@ -313,11 +319,11 @@ public void widgetSelected(SelectionEvent e) {
313319
if (selected != null) {
314320
IPath sp = new Path(selected);
315321

316-
if (uh.equals(sp)) {
322+
if (sp.equals(uh)) {
317323
workingDir.select(0);
318-
} else if (eh.equals(sp)) {
324+
} else if (sp.equals(eh)) {
319325
workingDir.select(1);
320-
} else if (ew.equals(sp)) {
326+
} else if (sp.equals(ew)) {
321327
workingDir.select(2);
322328
} else {
323329
workingDir.setText(sp.toOSString());
@@ -527,6 +533,7 @@ public Image getColumnImage(Object element, int columnIndex) {
527533
if (i == null) {
528534
ImageData id = ExternalExecutablesUtils.loadImage(icon);
529535
if (id != null) {
536+
@SuppressWarnings("deprecation")
530537
ImageDescriptor d = ImageDescriptor.createFromImageData(id);
531538
if (d != null)
532539
i = d.createImage();

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/services/TerminalService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,6 @@ public void openConsole(final Map<String, Object> properties, final Done done) {
257257

258258
executeServiceOperation(properties, new TerminalServiceRunnable() {
259259
@Override
260-
@SuppressWarnings("synthetic-access")
261260
public void run(final String id, final String secondaryId, final String title,
262261
final ITerminalConnector connector, final Object data, final Done done) {
263262
if (restoringView) {

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/tabs/OpenFileMouseHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public class OpenFileMouseHandler implements ITerminalMouseListener2 {
8888
}
8989
}
9090

91+
@SuppressWarnings("restriction")
9192
@Override
9293
public void mouseUp(ITerminalTextDataReadOnly terminalText, int line, int column, int button, int stateMask) {
9394
if ((stateMask & SWT.MODIFIER_MASK) != SWT.MOD1) {
@@ -134,7 +135,7 @@ public void mouseUp(ITerminalTextDataReadOnly terminalText, int line, int column
134135
// relative path: try to append to the working directory
135136
Optional<String> workingDirectory = terminal.getTerminalConnector().getWorkingDirectory();
136137
if (workingDirectory.isPresent()) {
137-
fullPath = Optional.of(workingDirectory.get() + "/" + textToOpen);
138+
fullPath = Optional.of(workingDirectory.get() + "/" + textToOpen); //$NON-NLS-1$
138139
}
139140
}
140141
// if the selection is a file location that maps to a resource
@@ -160,8 +161,9 @@ public void mouseUp(ITerminalTextDataReadOnly terminalText, int line, int column
160161
// continue
161162
}
162163
}
164+
ResourcesPlugin.getPlugin();
163165
OpenResourceDialog openResourceDialog = new OpenResourceDialog(site.getShell(),
164-
ResourcesPlugin.getPlugin().getWorkspace().getRoot(), IResource.FILE);
166+
ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE);
165167
openResourceDialog.setInitialPattern(textToOpen);
166168
if (openResourceDialog.open() != Window.OK)
167169
return;

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/tabs/TabFolderManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ public void dispose() {
225225
*
226226
* @return The created tab item or <code>null</code> if failed.
227227
*/
228-
@SuppressWarnings({ "unused" })
229228
public CTabItem createTabItem(String title, String encoding, ITerminalConnector connector, Object data,
230229
Map<String, Boolean> flags) {
231230
Assert.isNotNull(title);
@@ -832,7 +831,7 @@ public final void updateStatusLine() {
832831
buffer.append(state2msg(item, terminal.getState()));
833832
buffer.append(" - "); //$NON-NLS-1$
834833

835-
String encoding = terminal.getEncoding();
834+
String encoding = terminal.getCharset().name();
836835
if (encoding == null || "UTF-8".equals(encoding)) { //$NON-NLS-1$
837836
encoding = "Default (UTF-8)"; //$NON-NLS-1$
838837
}

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/tabs/TabFolderMenuHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ public void dispose() {
153153
* Setup the context menu for the tab folder. The method will return
154154
* immediately if the menu handler had been initialized before.
155155
*
156-
* @param tabFolder The tab folder control. Must not be <code>null</code>.
157156
*/
158157
public void initialize() {
159158
// Return immediately if the menu manager and menu got initialized already

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/tabs/TabFolderToolbarHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void selectionChanged(SelectionChangedEvent event) {
6262

6363
// The VlmConsoleTabFolderManager is listening to the selection changes of the
6464
// TabFolder and fires selection changed events.
65-
if (enable && event.getSource() instanceof TabFolderManager) {
65+
if (event != null && event.getSource() instanceof TabFolderManager) {
6666
enable = event.getSelection() instanceof StructuredSelection && !event.getSelection().isEmpty()
6767
&& (((StructuredSelection) event.getSelection()).getFirstElement() instanceof CTabItem
6868
|| ((StructuredSelection) event.getSelection()).getFirstElement() instanceof String);
@@ -141,7 +141,6 @@ public void dispose() {
141141
* Setup the context menu for the tab folder. The method will return
142142
* immediately if the toolbar handler had been initialized before.
143143
*
144-
* @param tabFolder The tab folder control. Must not be <code>null</code>.
145144
*/
146145
public void initialize() {
147146
// Return immediately if the toolbar manager got initialized already

terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/view/TerminalsView.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -689,13 +689,6 @@ public boolean show(ShowInContext context) {
689689
elements.add(adapted);
690690
continue;
691691
}
692-
693-
if (adapted != null) {
694-
if (!elements.contains(adapted))
695-
elements.add(adapted);
696-
continue;
697-
}
698-
699692
isValid = false;
700693
}
701694

0 commit comments

Comments
 (0)