From f32780caf6bee31907dfd2f2166edabf42e5ade3 Mon Sep 17 00:00:00 2001 From: Andreas Buchen Date: Sun, 15 Mar 2020 07:54:41 +0100 Subject: [PATCH] Fixed ClassCastException when running handler to import CSV or PDF files Issue: #1432 --- .../name/abuchen/portfolio/ui/handlers/ImportCSVHandler.java | 2 +- .../name/abuchen/portfolio/ui/handlers/ImportPDFHandler.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportCSVHandler.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportCSVHandler.java index 93d9d639f7..2997a61ed9 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportCSVHandler.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportCSVHandler.java @@ -43,7 +43,7 @@ public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, CSVConfigManager configManager, @org.eclipse.e4.core.di.annotations.Optional @Named("name.abuchen.portfolio.ui.param.name") String index) { - MenuHelper.getActiveClient(part).ifPresent(client -> runImport((PortfolioPart) part, shell, context, + MenuHelper.getActiveClient(part).ifPresent(client -> runImport((PortfolioPart) part.getObject(), shell, context, configManager, index, client, null, null)); } diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportPDFHandler.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportPDFHandler.java index a7d36c3c05..cb055ceaa9 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportPDFHandler.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/handlers/ImportPDFHandler.java @@ -54,7 +54,8 @@ public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, /* package */ void doExecute(MPart part, Shell shell) { - MenuHelper.getActiveClient(part).ifPresent(client -> runImport((PortfolioPart) part, shell, client, null, null)); + MenuHelper.getActiveClient(part) + .ifPresent(client -> runImport((PortfolioPart) part.getObject(), shell, client, null, null)); } public static void runImport(PortfolioPart part, Shell shell, Client client, Account account, Portfolio portfolio)