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

addModifier documentation out of sync #1616

Closed
ghost opened this issue Oct 19, 2017 · 1 comment
Closed

addModifier documentation out of sync #1616

ghost opened this issue Oct 19, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 19, 2017

http://spoon.gforge.inria.fr/mvnsites/spoon-core/apidocs/spoon/reflect/declaration/CtModifiable.html

T addModifier(ModifierKind modifier)
Returns: true if this element changed as a result of the call

However, the code does not return a Boolean:

	@Override
	public <C extends CtModifiable> C addModifier(ModifierKind modifier) {
		if (modifiers == CtElementImpl.<ModifierKind>emptySet()) {
			this.modifiers = EnumSet.noneOf(ModifierKind.class);
		}
		getFactory().getEnvironment().getModelChangeListener().onSetAdd(this, MODIFIER, this.modifiers, modifier);
		modifiers.add(modifier);
		return (C) this;
	}

This documentation issue is applicable to all implementations of addModifier.

Recommend the Javadocs be updated to indicate whether there's a way to determine that a modifier was added versus already existed.

@monperrus
Copy link
Collaborator

monperrus commented Oct 20, 2017 via email

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

No branches or pull requests

1 participant