Skip to content
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

Implemment getInstance() method for all ConfigurationType to avoid reference to different ConfigurationType objects #2478

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

t-rufang
Copy link
Contributor

@lcadzy @konjac Kindly reminded, please use ArisSparkConfigurationType.getInstance() rather than new ArisSparkConfigurationType() when you want to refer a new configuration type. Or else you will encounter that RunManager.getInstance(project).getConfigurationSettingsList(ArisSparkConfigurationType.class) can't find the configuration you created before.

Root cause is that type comparison within getConfigurationSettingsList uses ===. In kotlin a === b evaluates to true if and only if a and b point to the same object.

  override fun getConfigurationSettingsList(type: ConfigurationType) = allSettings.filterSmart { it.type === type }

…ference to different ConfigurationType objects
@t-rufang t-rufang merged commit 77d3d70 into microsoft:develop Dec 11, 2018
@wezhang wezhang added this to the v3.16.0 milestone Dec 12, 2018
@t-rufang t-rufang deleted the configtype branch April 10, 2020 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants