Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
IVYDE-386 Fix ClassCastException
Browse files Browse the repository at this point in the history
  • Loading branch information
jaikiran committed Mar 1, 2018
1 parent f3b18d0 commit fc68846
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -111,7 +111,7 @@ protected IContributionItem[] getContributionItems() {
}
}

List<MenuManager> items;
List<IContributionItem> items;
MenuManager menuManager;
if (onlyContainers) {
// we we have only containers, no need to have a root menu entry
Expand All @@ -120,7 +120,7 @@ protected IContributionItem[] getContributionItems() {
} else {
menuManager = new MenuManager("Ivy", IvyPlugin
.getImageDescriptor("icons/logo16x16.gif"), "org.apache.ivyde.eclipse.menu");
items = Collections.singletonList(menuManager);
items = Collections.<IContributionItem>singletonList(menuManager);
}

// add resolve, refresh, reload settings
Expand Down Expand Up @@ -181,19 +181,19 @@ protected IContributionItem[] getContributionItems() {
return items.toArray(new IContributionItem[items.size()]);
}

private void addCommand(MenuManager menuManager, List<MenuManager> items,
private void addCommand(MenuManager menuManager, List<IContributionItem> items,
String commandId) {
CommandContributionItemParameter parm = new CommandContributionItemParameter(
serviceLocator, null, commandId, CommandContributionItem.STYLE_PUSH);
fillMenu(menuManager, items, new CommandContributionItem(parm));
}

private void fillMenu(MenuManager menuManager, List<MenuManager> items,
private void fillMenu(MenuManager menuManager, List<IContributionItem> items,
IContributionItem commandContributionItem) {
if (menuManager != null) {
menuManager.add(commandContributionItem);
} else {
items.add((MenuManager) commandContributionItem);
items.add(commandContributionItem);
}
}

Expand Down Expand Up @@ -252,7 +252,7 @@ private void doCollectContainer(Map<IProject, Set<IvyClasspathContainer>> contai
}

private void addCleanableForSingleContainer(MenuManager menuManager,
List<MenuManager> items, Ivy ivy) {
List<IContributionItem> items, Ivy ivy) {
List<Cleanable> allCleanables = new ArrayList<>();
List<Cleanable> repositoryCleanables = new ArrayList<>();
List<Cleanable> resolutionCleanables = new ArrayList<>();
Expand All @@ -273,7 +273,7 @@ private void addCleanableForSingleContainer(MenuManager menuManager,
}

private void addCleanableForManyContainers(MenuManager menuManager,
List<MenuManager> items, Collection<Set<IvyClasspathContainer>> containerSets) {
List<IContributionItem> items, Collection<Set<IvyClasspathContainer>> containerSets) {
List<Cleanable> allCleanables = new ArrayList<>();
List<Cleanable> repositoryCleanables = new ArrayList<>();
List<Cleanable> resolutionCleanables = new ArrayList<>();
Expand Down Expand Up @@ -306,7 +306,7 @@ private void addRepositoryCleanable(List<Cleanable> cleanables, Ivy ivy) {
}
}

public void addCleanable(MenuManager menuManager, List<MenuManager> items,
private void addCleanable(MenuManager menuManager, List<IContributionItem> items,
String name, List<Cleanable> cleanables) {
CleanCacheAction action = new CleanCacheAction(name, cleanables);
action.setText(name);
Expand Down

1 comment on commit fc68846

@twogee
Copy link
Contributor

@twogee twogee commented on fc68846 Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

Please sign in to comment.