NIFI-1317: removed duplicate 'name' instance variable

Reviewed by Tony Kurc (tkurc@apache.org). This closes #169
This commit is contained in:
Oleg Zhurakousky 2016-01-14 00:42:36 -05:00 committed by Tony Kurc
parent c3ac772b92
commit 92062f9beb
2 changed files with 3 additions and 9 deletions

View File

@ -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

View File

@ -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();
}