From 568e290ddf15b8c40f3c691e5fc48e9179cdf095 Mon Sep 17 00:00:00 2001
From: Pavel Vojtechovsky
Date: Sat, 28 Oct 2017 11:20:07 +0200
Subject: [PATCH] fix: Remove useless code on CtElement#setParent
---
.../java/spoon/support/reflect/declaration/CtElementImpl.java | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java b/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java
index a9276cda314..3c5df57a7e4 100644
--- a/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java
+++ b/src/main/java/spoon/support/reflect/declaration/CtElementImpl.java
@@ -321,10 +321,6 @@ public CtElement getParent() throws ParentNotInitializedException {
@Override
public E setParent(E parent) {
- if (getFactory() == null) {
- this.parent = parent;
- return (E) this;
- }
this.parent = parent;
return (E) this;
}