NIFI-1317: removed duplicate 'name' instance variable

Reviewed by Tony Kurc ([email protected]). This closes #169


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/92062f9b
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/92062f9b
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/92062f9b

Branch: refs/heads/NIFI-259
Commit: 92062f9beb2690dceec5876ab48ea2af0bc877b7
Parents: c3ac772
Author: Oleg Zhurakousky <[email protected]>
Authored: Thu Jan 14 00:42:36 2016 -0500
Committer: Tony Kurc <[email protected]>
Committed: Thu Jan 14 00:43:09 2016 -0500

----------------------------------------------------------------------
 .../apache/nifi/controller/AbstractConfiguredComponent.java | 3 ++-
 .../org/apache/nifi/controller/StandardProcessorNode.java   | 9 +--------
 2 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/92062f9b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
index 978c612..df93cc0 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
@@ -45,7 +45,7 @@ public abstract class AbstractConfiguredComponent implements 
ConfigurableCompone
     private final ValidationContextFactory validationContextFactory;
     private final ControllerServiceProvider serviceProvider;
 
-    private final AtomicReference<String> name = new AtomicReference<>();
+    private final AtomicReference<String> name;
     private final AtomicReference<String> annotationData = new 
AtomicReference<>();
 
     private final Lock lock = new ReentrantLock();
@@ -57,6 +57,7 @@ public abstract class AbstractConfiguredComponent implements 
ConfigurableCompone
         this.component = component;
         this.validationContextFactory = validationContextFactory;
         this.serviceProvider = serviceProvider;
+        this.name = new 
AtomicReference<>(component.getClass().getSimpleName());
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/nifi/blob/92062f9b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
index 567c3c7..aade16b 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
@@ -93,7 +93,6 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
     private final AtomicBoolean lossTolerant;
     private final AtomicReference<ScheduledState> scheduledState;
     private final AtomicReference<String> comments;
-    private final AtomicReference<String> name;
     private final AtomicReference<Position> position;
     private final AtomicReference<String> annotationData;
     private final AtomicReference<String> schedulingPeriod; // stored as 
string so it's presented to user as they entered it
@@ -134,7 +133,6 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
         final Set<Relationship> emptySetOfRelationships = new HashSet<>();
         undefinedRelationshipsToTerminate = new 
AtomicReference<>(emptySetOfRelationships);
         comments = new AtomicReference<>("");
-        name = new AtomicReference<>(processor.getClass().getSimpleName());
         schedulingPeriod = new AtomicReference<>("0 sec");
         schedulingNanos = new AtomicLong(MINIMUM_SCHEDULING_NANOS);
         yieldPeriod = new AtomicReference<>(DEFAULT_YIELD_PERIOD);
@@ -344,11 +342,6 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
         return Collections.unmodifiableSet(relationships);
     }
 
-    @Override
-    public String getName() {
-        return name.get();
-    }
-
     /**
      * @return the value of the processor's {@link CapabilityDescription} 
annotation, if one exists, else <code>null</code>.
      */
@@ -375,7 +368,7 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
             if (isRunning()) {
                 throw new IllegalStateException("Cannot modify Processor 
configuration while the Processor is running");
             }
-            this.name.set(name);
+            super.setName(name);
         } finally {
             writeLock.unlock();
         }

Reply via email to