Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: AbstractPlugin supports all features #191

Merged
merged 6 commits into from
Jun 27, 2021

Conversation

kaklakariada
Copy link
Contributor

@kaklakariada kaklakariada commented Jun 27, 2021

Launching WR with all plugins via ./gradlew runJfxUiWithPlugins failed an exception:

java.lang.IllegalStateException: Found multiple plugins supporting org.itsallcode.whiterabbit.api.features.MonthDataStorage: [PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.csv.CSVExporterPlugin@5f419288], PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.holidaycalculator.HolidayCalculatorPlugin@312d4c2c]]. Please add only one storage plugin 
to the classpath.
java.lang.IllegalStateException: Found multiple plugins supporting org.itsallcode.whiterabbit.api.features.MonthDataStorage: [PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.csv.CSVExporterPlugin@5f419288], PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.holidaycalculator.HolidayCalculatorPlugin@312d4c2c]]. Please add only one storage plugin 
to the classpath.
        at org.itsallcode.whiterabbit.logic.service.plugin.PluginManager.getUniqueFeature(PluginManager.java:63) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at org.itsallcode.whiterabbit.logic.service.AppService.createMonthDataStorage(AppService.java:125) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at org.itsallcode.whiterabbit.logic.service.AppService.create(AppService.java:102) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at org.itsallcode.whiterabbit.jfxui.JavaFxApp.doInitialize(JavaFxApp.java:96) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at org.itsallcode.whiterabbit.jfxui.JavaFxApp.init(JavaFxApp.java:79) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:827) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198) ~[white-rabbit-fx-1.6.0-SNAPSHOT.jar:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Exception in thread "main" java.lang.RuntimeException: Exception in Application init method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:898)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Found multiple plugins supporting org.itsallcode.whiterabbit.api.features.MonthDataStorage: [PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.csv.CSVExporterPlugin@5f419288], PluginWrapper [origin=ClassPath origin, plugin=org.itsallcode.whiterabbit.plugin.holidaycalculator.HolidayCalculatorPlugin@312d4c2c]]. Please add only one storage plugin to the classpath.
        at org.itsallcode.whiterabbit.logic.service.plugin.PluginManager.getUniqueFeature(PluginManager.java:63)
        at org.itsallcode.whiterabbit.logic.service.AppService.createMonthDataStorage(AppService.java:125)
        at org.itsallcode.whiterabbit.logic.service.AppService.create(AppService.java:102)
        at org.itsallcode.whiterabbit.jfxui.JavaFxApp.doInitialize(JavaFxApp.java:96)
        at org.itsallcode.whiterabbit.jfxui.JavaFxApp.init(JavaFxApp.java:79)
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:827)
        ... 2 more

@kaklakariada kaklakariada requested a review from ckunki June 27, 2021 09:27
@kaklakariada kaklakariada self-assigned this Jun 27, 2021
@kaklakariada kaklakariada added the bug Something isn't working label Jun 27, 2021
@kaklakariada kaklakariada added this to the Version 1.7.0 milestone Jun 27, 2021
@@ -35,17 +35,20 @@ public void close()
@Override
public boolean supports(Class<? extends PluginFeature> featureType)
{
return featureType.isAssignableFrom(featureType);
return this.featureType.isAssignableFrom(featureType);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the root cause of the bug ;)


public class CSVExporterPlugin extends AbstractPlugin<CSVProjectReportExporter>
public class CSVExporterPlugin extends AbstractPlugin<ProjectReportExporter>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The wrong class was used here.

@sonarcloud
Copy link

sonarcloud bot commented Jun 27, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

80.0% 80.0% Coverage
0.0% 0.0% Duplication

@kaklakariada kaklakariada merged commit 0d27595 into develop Jun 27, 2021
@kaklakariada kaklakariada deleted the bugfix/abstract-plugin-supports-all-features branch June 27, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants