Skip to content

Commit

Permalink
Allow setting name of RequiresDirective to null
Browse files Browse the repository at this point in the history
According to the child descriptor property, it's optional,
so it makes sense that you should be able to set it to null.
The Javadoc also doesn't mention anything about null not being allowed.

Signed-off-by: David Thompson <davthomp@redhat.com>
  • Loading branch information
datho7561 committed Dec 18, 2024
1 parent 07c7cda commit fc74d51
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,6 @@ public int getModifiers() {
* @return the module referenced
*/
public Name getName() {
if (this.name == null) {
// lazy init must be thread-safe for readers
synchronized (this) {
if (this.name == null) {
preLazyInit();
this.name = postLazyInit(
this.ast.newQualifiedName(new SimpleName(this.ast), new SimpleName(this.ast)),
NAME_PROPERTY);
}
}
}
return this.name;
}

Expand All @@ -224,9 +213,6 @@ public Name getName() {
* </ul>
*/
public void setName(Name name) {
if (name == null) {
throw new IllegalArgumentException();
}
ASTNode oldChild = this.name;
preReplaceChild(oldChild, name, NAME_PROPERTY);
this.name = name;
Expand Down

0 comments on commit fc74d51

Please sign in to comment.