Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make methods getAttribute(s)/setAttribute(s) of AdjustedLaunchConfigurationWorkingCopy symmetric #28

Conversation

LukasPecak
Copy link
Contributor

The current implementation produces duplicate vmArguments in the following scenario:

  1. We call getAttribute() or getAttributes() on an object of type AdjustedLaunchConfigurationWorkingCopy, which concatenates the extraVMArguments with the VM arguments from the delegate
  2. Now we pass the vmArguments to the setAttribute() method, which will modify the underlying WorkingCopy info object -> delegate.setAttribute()
  3. When we now call the getAttribute() method again, it will once again concatenate the extraVMArguments with the modified VM arguments from the delegate.getAttribute() method.

The solution here is to make the following methods symmetric:

  • getAttribute/setAttribute for String arguments
  • getAttributes/setAttributes

The setAttribute(s) methods will filter the extraVMArguments before passing the value to the delegate.setAttribute(s) method.

The current implementation produces duplicate vmArguments in the following scenario:
1. We call getAttribute() or getAttributes() on an object of type AdjustedLaunchConfigurationWorkingCopy, which concatenates the extraVMArguments with the VM arguments from the delegate
2. Now we pass the vmArguments to the setAttribute() method, which will modify the underlying WorkingCopy info object -> delegate.setAttribute()
3. When we now call the getAttribute() method again, it will once again concatenate the extraVMArguments with the modified VM arguments from the delegate.getAttribute() method.

The solution here is to make the following methods symmetric:
* getAttribute/setAttribute for String arguments
* getAttributes/setAttributes

The setAttribute(s) methods will filter the extraVMArguments before passing the value to the delegate.setAttribute(s) method.
@LukasPecak LukasPecak force-pushed the bugfix/make_setAttribute_and_getAttribute_methods_symmetric branch from 66e4660 to ec352d3 Compare November 9, 2021 15:49
@marchof
Copy link
Contributor

marchof commented Nov 10, 2021

@Godin Can you have also have a look please?

@Godin Godin self-requested a review November 18, 2021 12:37
@Godin Godin force-pushed the bugfix/make_setAttribute_and_getAttribute_methods_symmetric branch from a79a87e to 534c685 Compare November 22, 2021 12:19
@Godin Godin changed the title makes getAttribute(s)/setAttribute(s) methods symmetric Make methods getAttribute(s)/setAttribute(s) of AdjustedLaunchConfigurationWorkingCopy symmetric Nov 22, 2021
Copy link
Member

@Godin Godin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please excuse me for slow processing of this PR.

Quality of this contribution is outstanding! 👍
Thanks a lot @LukasPecak ❤️

@Godin Godin merged commit d44fa5a into eclipse-eclemma:master Nov 22, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants