Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
STS-3207 ClassCastException resolved. Now the "Show Console" context
Browse files Browse the repository at this point in the history
menu for application instances is enabled again.
  • Loading branch information
nierajsingh committed Mar 4, 2013
1 parent 04092cd commit 7d2be59
Showing 1 changed file with 18 additions and 9 deletions.
Expand Up @@ -1115,17 +1115,26 @@ private void fillServicesContextMenu(IMenuManager manager) {

private void fillInstancesContextMenu(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) instancesViewer.getSelection();
if (selection.isEmpty())
if (selection.isEmpty()) {
return;

InstanceStats stats = (InstanceStats) selection.getFirstElement();
ApplicationModule appModule = getApplication();

try {
manager.add(new ShowConsoleAction(cloudServer, appModule.getApplication(), Integer.parseInt(stats.getId())));
}
catch (NumberFormatException e) {
// ignore

Object instanceObject = selection.getFirstElement();

if (instanceObject instanceof InstanceStatsAndInfo) {

InstanceStats stats = ((InstanceStatsAndInfo) instanceObject).getStats();

if (stats != null) {
ApplicationModule appModule = getApplication();

try {
manager.add(new ShowConsoleAction(cloudServer, appModule.getApplication(), Integer.parseInt(stats.getId())));
}
catch (NumberFormatException e) {
// ignore
}
}
}
}

Expand Down

0 comments on commit 7d2be59

Please sign in to comment.