Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 360fb52

Browse files
adietishsbouchet
andauthored
fix: correct warnings & use disposable instead of discouraged project disposable (#739)
* corrected warnings reported by code analysis Signed-off-by: Andre Dietisheim <[email protected]> * use disposable instead of discouraged project Signed-off-by: Andre Dietisheim <[email protected]> * Update src/main/java/org/jboss/tools/intellij/openshift/actions/service/LinkComponentAction.java Co-authored-by: Stephane Bouchet <[email protected]> Signed-off-by: Andre Dietisheim <[email protected]> * Update src/main/java/org/jboss/tools/intellij/openshift/ui/cluster/LoginDialog.java Co-authored-by: Stephane Bouchet <[email protected]> Signed-off-by: Andre Dietisheim <[email protected]> * removed .DS_Store Signed-off-by: Andre Dietisheim <[email protected]> --------- Signed-off-by: Andre Dietisheim <[email protected]> Co-authored-by: Stephane Bouchet <[email protected]>
1 parent 956a72e commit 360fb52

38 files changed

+122
-98
lines changed

src/it/java/org/jboss/tools/intellij/openshift/utils/OdoCluster.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class OdoCluster {
2424

2525
private static final String CLUSTER_PASSWORD = System.getenv("CLUSTER_PASSWORD");
2626

27-
public boolean login(Odo odo) throws IOException {
27+
public boolean login(Odo odo) throws IOException {
2828
if (CLUSTER_URL != null && !odo.getMasterUrl().toString().startsWith(CLUSTER_URL)) {
2929
odo.login(CLUSTER_URL, CLUSTER_USER, CLUSTER_PASSWORD.toCharArray(), null);
3030
return true;

src/it/java/org/jboss/tools/intellij/openshift/utils/helm/HelmCliTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public abstract class HelmCliTest extends BasePlatformTestCase {
2121

2222
protected Helm helm;
2323

24-
private String projectName = "prj-" + new Random().nextInt();
24+
private final String projectName = "prj-" + new Random().nextInt();
2525

2626
@Override
2727
protected void setUp() throws Exception {

src/main/java/org/jboss/tools/intellij/openshift/WindowToolFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindo
5151
Content content = contentFactory.createContent(panel, "", false);
5252
ApplicationsTreeStructure structure = new ApplicationsTreeStructure(project);
5353
StructureTreeModel<ApplicationsTreeStructure> model = new StructureTreeModel<>(structure, content);
54+
content.setDisposer(structure);
5455
new MutableModelSynchronizer<>(model, structure, structure);
5556
Tree tree = new Tree(new AsyncTreeModel(model, content));
5657
tree.putClientProperty(Constants.STRUCTURE_PROPERTY, structure);

src/main/java/org/jboss/tools/intellij/openshift/actions/ActionUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.jboss.tools.intellij.openshift.telemetry.TelemetrySenderAware;
2525
import org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode;
2626
import org.jboss.tools.intellij.openshift.tree.application.ApplicationsTreeStructure;
27+
import org.jetbrains.annotations.NotNull;
2728

2829
import javax.swing.JTree;
2930
import java.awt.Component;
@@ -69,7 +70,7 @@ public static void runWithProgress(Consumer<ProgressIndicator> consumer, String
6970
ProgressManager.getInstance().run(
7071
new Task.Backgroundable(project, message, true) {
7172
@Override
72-
public void run(ProgressIndicator progress) {
73+
public void run(@NotNull ProgressIndicator progress) {
7374
consumer.accept(progress);
7475
}
7576
});

src/main/java/org/jboss/tools/intellij/openshift/actions/binding/DeleteBindingAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object
3131
try {
3232
BindingNode node = (BindingNode) selected;
3333
if (Messages.NO == Messages.showYesNoDialog("Delete binding '" + node.getName() + "'.\nAre you sure?",
34-
"Delete binding",
35-
Messages.getQuestionIcon())) {
34+
"Delete Binding",
35+
Messages.getQuestionIcon())) {
3636
sendTelemetryResults(TelemetryService.TelemetryResult.ABORTED);
3737
return;
3838
}
@@ -41,7 +41,7 @@ public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object
4141
sendTelemetryResults(TelemetryService.TelemetryResult.SUCCESS);
4242
} catch (IOException e) {
4343
sendTelemetryError(e);
44-
Messages.showWarningDialog("Error: " + e.getLocalizedMessage(), "Delete binding");
44+
Messages.showWarningDialog("Error: " + e.getLocalizedMessage(), "Delete Binding");
4545
}
4646
}
4747

src/main/java/org/jboss/tools/intellij/openshift/actions/component/DebugComponentAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private static Optional<Integer> getPort(Odo odo, Component component) throws IO
161161
String selected = UIHelper.executeInUI(() ->
162162
Messages.showEditableChooseDialog(
163163
"The component " + component.getName() + " has several ports to connect to,\nchoose the one the debugger will connect to",
164-
"Choose debugger port",
164+
"Choose Debugger Port",
165165
Messages.getQuestionIcon(),
166166
ports,
167167
ports[0],

src/main/java/org/jboss/tools/intellij/openshift/actions/component/DeleteComponentAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object
6464
clearProcessing(componentNode);
6565
sendTelemetryError(e);
6666
UIHelper.executeInUI(() ->
67-
Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Delete component"));
67+
Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Delete Component"));
6868
}
6969
},
7070
"Delete Component...",

src/main/java/org/jboss/tools/intellij/openshift/actions/component/LinkComponentAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected String getSelectedTargetComponent(Odo odo, String project, String comp
5454
targetComponent = UIHelper.executeInUI(() ->
5555
Messages.showEditableChooseDialog(
5656
"Select component",
57-
"Link component",
57+
"Link Component",
5858
Messages.getQuestionIcon(),
5959
componentsArray,
6060
componentsArray[0],

src/main/java/org/jboss/tools/intellij/openshift/actions/component/LinkServiceAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object
7373
} else {
7474
String message = "No services to link to";
7575
sendTelemetryError(message);
76-
UIHelper.executeInUI(() -> Messages.showWarningDialog(message, "Link service"));
76+
UIHelper.executeInUI(() -> Messages.showWarningDialog(message, "Link Service"));
7777
}
7878
} catch (IOException | NoSuchElementException e) {
7979
clearProcessing(namespaceNode);
8080
sendTelemetryError(e);
81-
UIHelper.executeInUI(() -> Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Link service"));
81+
UIHelper.executeInUI(() -> Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Link Service"));
8282
}
8383
},
8484
"Link Service...",
@@ -90,7 +90,7 @@ private static String getServiceName(List<Service> services) {
9090
.map(Service::getName)
9191
.toArray(String[]::new);
9292
return UIHelper.executeInUI(() -> Messages.showEditableChooseDialog("Link service",
93-
"Select service",
93+
"Select Service",
9494
Messages.getQuestionIcon(),
9595
servicesArray,
9696
servicesArray[0],

src/main/java/org/jboss/tools/intellij/openshift/actions/project/DeleteProjectAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object
5555
sendTelemetryResults(TelemetryResult.SUCCESS);
5656
} catch (IOException e) {
5757
sendTelemetryError(e);
58-
UIHelper.executeInUI(() -> Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Delete project"));
58+
UIHelper.executeInUI(() -> Messages.showErrorDialog("Error: " + e.getLocalizedMessage(), "Delete Project"));
5959
}
6060
},
6161
"Delete Project " + namespaceNode.getName(),

0 commit comments

Comments
 (0)