podam icon indicating copy to clipboard operation
podam copied to clipboard

Can't make it work with Guava's Optional type

Open astubbs opened this issue 13 years ago • 6 comments

Need a way to register a factory for Optional types, or more generally, a way to register a factory for any given type would be better than nothing. This is without having to modify the original class too.

astubbs avatar Nov 11 '13 07:11 astubbs

I'm looking at implementing a factory registration system to externally register custom factories for certain types (which will solve optional), instead of having to annotate classes (useful for code that's not your own). Let me know if you've got any tips or existing near solutions.

astubbs avatar Nov 15 '13 02:11 astubbs

Have implemented it myself, among other things; https://github.com/mtedone/podam/pull/24

astubbs avatar Nov 15 '13 21:11 astubbs

This is waiting for pull requests #39, #40, #41, #42 to be processed before updating work on this as it depends on those branches currently. At my company we're continuing on with my older fork that has the guava support working.

astubbs avatar Apr 15 '14 17:04 astubbs

Tests for the reported problem was pushed to new branch guava in order to avoid having Guava as dependency for PODAM https://github.com/mtedone/podam/commit/a90a32e9630b8f37bd88492bf76c580a9fe3909b Closing the issue as tests succeed.

daivanov avatar Jan 11 '15 10:01 daivanov

Daniil, it's a good idea to support additional types in PODAM without direct dependencies. We should be looking at loading external types at runtime through the Classloader. Podium users' responsibility will be to make sure that these libraries are available at runtime. For tests, we could include Guava with scope 'test' so that it won't end up in the production code. Once this work is done, we can remove the Guava branch.

mtedone avatar Jan 31 '15 13:01 mtedone

This tests is complimentary. There is no fix patch related to this test. So if there are two possibilities: remove the branch or merge it to master. guava was added in test scope: https://github.com/mtedone/podam/commit/a90a32e9630b8f37bd88492bf76c580a9fe3909b

daivanov avatar Feb 01 '15 18:02 daivanov