Github user olegz commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1156#discussion_r86527582
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractConfiguredComponent.java
 ---
    @@ -141,48 +181,74 @@ public void setProperty(final String name, final 
String value) {
          * @return true if removed; false otherwise
          * @throws java.lang.IllegalArgumentException if the name is null
          */
    -    @Override
    -    public boolean removeProperty(final String name) {
    +    private boolean removeProperty(final String name) {
             if (null == name) {
                 throw new IllegalArgumentException();
             }
     
    -        lock.lock();
    -        try {
    -            verifyModifiable();
    +        final PropertyDescriptor descriptor = 
component.getPropertyDescriptor(name);
    +        String value = null;
    +        if (!descriptor.isRequired() && (value = 
properties.remove(descriptor)) != null) {
     
    -            try (final NarCloseable narCloseable = 
NarCloseable.withComponentNarLoader(component.getClass())) {
    -                final PropertyDescriptor descriptor = 
component.getPropertyDescriptor(name);
    -                String value = null;
    -                if (!descriptor.isRequired() && (value = 
properties.remove(descriptor)) != null) {
    -
    -                    if (descriptor.getControllerServiceDefinition() != 
null) {
    -                        if (value != null) {
    -                            final ControllerServiceNode oldNode = 
serviceProvider.getControllerServiceNode(value);
    -                            if (oldNode != null) {
    -                                oldNode.removeReference(this);
    -                            }
    -                        }
    +            if (descriptor.getControllerServiceDefinition() != null) {
    +                if (value != null) {
    +                    final ControllerServiceNode oldNode = 
serviceProvider.getControllerServiceNode(value);
    +                    if (oldNode != null) {
    +                        oldNode.removeReference(this);
                         }
    +                }
    +            }
     
    -                    try {
    -                        component.onPropertyModified(descriptor, value, 
null);
    -                    } catch (final Exception e) {
    -                        // nothing really to do here...
    -                    }
    +            try {
    +                component.onPropertyModified(descriptor, value, null);
    +            } catch (final Exception e) {
    +                // nothing really to do here...
    --- End diff --
    
    Same as above, just doesn't look right


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to