-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix identifiable stream #2520
Fix identifiable stream #2520
Conversation
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
@@ -1194,38 +1195,38 @@ default Network setMinimumAcceptableValidationLevel(ValidationLevel validationLe | |||
return this; | |||
} | |||
|
|||
default <I extends Identifiable<I>> Stream<I> getIdentifiableStream(IdentifiableType identifiableType) { | |||
default Stream<Identifiable<?>> getIdentifiableStream(IdentifiableType identifiableType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't work with previous signature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does, but the <I extends Identifiable<I>>
is not needed, we only need identifiables when we use it.
Besides before we could write this:
Stream<VoltageLevel> loads = network.getIdentifiableStream(IdentifiableType.LOAD);
So that's another fix in fact
Kudos, SonarCloud Quality Gate passed! |
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
ClassCastException
whennetwork.getIdentifiableStream(IdentifiableType.BATTERY)