StateDescription constructor deprecated?

I installed from scratch development environment with Eclipse IDE according to the latest guide on the web page and I noticed that it reports warnings for StateDescription constructors being deprecated. Same for mvn build. When I jump to the constructor in Eclipse, the file opens but there are no signs of deprecated annotations. Can someone help me explain why building reports these as deprecated? And how and which versions of the framework source files are loaded into eclipse, since they are not part of the working sets anymore.

Yes, I can. Because it is deprecated in favor of the new StateDescriptionFragmentBuilder:

Thanks. This would mean the IDE pulls different sources for the framework than those used for compilation.

Did you erase your local .m2/ directory before setting up the new IDE? Maybe it tries to resolve outdated artifacts from over there.

Indeed erasing .m2 and installing eclipse from scratch helped. Thanks! I can work on using the new StateDescriptionFragmentBuilder now.

I took a look at the new suggested way of creating StateDescription with StateDescriptionFragmentBuilder. I use state descriptions to dynamically in runtime change channel description using a dynamic state description provider.

I suppose the new way to go would be: StateDescriptionFragmentBuilder.create().withXXX().build().toStateDescription()

This causes creation of 3 objects and copying their parameters from StateDescriptionFragmentBuilder to StateDescriptionFragment to StateDescription. As opposed to just creating StateDescription before.

Is this really the preferred way to go as it looks like a bit redundant?


They have been switching to builders for awhile. Personally, I prefer that since it insulates me from any changes to the underlying class (ie if they add something new, only the builder needs to change versus every bit of code that uses a constructor) and performance (to that degree) isn’t really an issue…

Yes, builders are the way to go.

Here you can find an explanation why it is called StateDescriptionFragmentBuilder and not StateDescriptionBuilder and why we have to convert from a to b and back.