Skip to content

Commit

Permalink
Fixed ClassCastException when running handler to import CSV or PDF files
Browse files Browse the repository at this point in the history
Issue: #1432
  • Loading branch information
buchen committed Mar 15, 2020
1 parent a789ef5 commit f32780c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

2 comments on commit f32780c

@cmaoling
Copy link
Contributor

Choose a reason for hiding this comment

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

@buchen @Pnda87 Sorry, das mein Beitrag hier Probleme gemacht hat.
For my education: Wie hätte ich das im Vorfeld finden können, oder warum muß hier "getObject" benutzt werden. Verstehe ich spontan nicht...
Danke!

@buchen
Copy link
Member Author

@buchen buchen commented on f32780c Mar 15, 2020

Choose a reason for hiding this comment

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

Habe ich beim Review auch nicht gesehen. PortfolioPart implementiert oder extended nicht MPart. Die Klassen mit M* gehören zum UI Modell von Eclipse e4. Mehr als Testen ging da nicht (aber selbst dann schwer zu finden weil Eclipse die Exceptions verschluckt).

Please sign in to comment.