Calling withSourceDeps on a SpoofaxLanguageSpecConfigBuilder is futile
I’m trying to build a language spec config using the
SpoofaxLanguageSpecConfigBuilder, but calling
SpoofaxLanguageSpecConfigBuilderhas no effect. The problem is that both
SpoofaxLanguageSpecConfigBuilderand its ancestor
LanguageComponentConfigBuilderhave a field
SpoofaxLanguageSpecConfigBuilderwill invoke the ancestor
LanguageComponentConfigBuilder. The latter will update the version of projectConfigBuilder defined in the ancestor. Finally, when invoking
SpoofaxLanguageSpecConfigBuilder, it will use the version of projectConfigBuilder defined in the child.
tl;dr: Two instances with the name
SpoofaxLanguageSpecConfigBuilder.withSourceDepsupdates the ancestor instance, but a subsequent call to
SpoofaxLanguageSpecConfigBuilder.buildwill use the child version, such that the changes made to the source dependencies magically disappear.
I believe the solution would be to have the parent class call getProjectConfigBuilder and override this method in the child class such that it returns the instance that’s stored in the child class, and not the one in the parent class.Submitted by Martijn on 4 May 2018 at 15:32
Log in to post comments