question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accept setting data-provider of subclasses

See original GitHub issue

Not sure if I’m missing some Java generics basics, but why it isn’t possible to set a DataProvider<Bar, ?> to a ComboBox<Foo>, if Bar extends Foo?

In other words, can the signature of HasDataProvider#setDataProvider be changed from:

void setDataProvider(DataProvider<T, ?> dataProvider);

to

void setDataProvider(DataProvider<? extends T, ?> dataProvider);

? It would really simplify the codebase, since now I need a DP for every subtype I have.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
plekucommented, Apr 6, 2020

@knoobie sure - but this is not a priority in itself and we will not break all data provider components just because of this. In case we need to make breaking things anyway, then we can include this too, but otherwise this is a secondary priority.

For any new added API, we will take this into account and not tie the type parameter like we did earlier.

0reactions
plekucommented, Jul 6, 2020

As now we went with not breaking any existing data providers and partly hiding the data provider as an abstraction level so one does not have use a data provider to set the data to the component (either in-memory or lazy). So while it is still fine to use data providers, it is not mandatory and thus I don’t see this breaking change happening as it would further complicate things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Defining dataProviderClass in a subclass · Issue #1691 - GitHub
First define a custom annotation that lets you express the data provider class and name. import java.lang.annotation.Retention; import java.lang ...
Read more >
How to properly test subclasses with phpspec dataprovider
If I hard-code those values then the test is green. However I want to test varios prices and results, so I decided to...
Read more >
running groups of classes which inherit test methods from a ...
I created a base class which contained an elaborate data provider and a series of (integration) tests which depend on being run in...
Read more >
Interface DataProvider<T,​F> - Vaadin
The DataProvider interface is used by listing components implementing HasDataProvider or HasFilterableDataProvider .
Read more >
NEFilterDataProvider | Apple Developer Documentation
To create a Filter Data Provider extension, you must first create a subclass of NEFilterDataProvider and override the methods listed below. Methods to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found