imaffe opened a new issue #556: [rocketmq-connect-runtime: unused variable in 
removeConnectorConfig()]
URL: https://github.com/apache/rocketmq-externals/issues/556
 
 
   The issue tracker is **ONLY** used for bug report and feature request. 
   
   Any question or RocketMQ proposal please use our [mailing 
lists](http://rocketmq.apache.org/about/contact/).
   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   In ConfigManagementServiceImpl.removeConnectorConfig(), it was
   ```
      @Override
       public void removeConnectorConfig(String connectorName) {
   
           ConnectKeyValue config = new ConnectKeyValue();
           config.put(RuntimeConfigDefine.UPDATE_TIMESATMP, 
System.currentTimeMillis());
           config.put(RuntimeConfigDefine.CONFIG_DELETED, 1);
           Map<String, ConnectKeyValue> connectorConfig = new HashMap<>();
           connectorConfig.put(connectorName, config);
           List<ConnectKeyValue> taskConfigList = new ArrayList<>();
           taskConfigList.add(config);
           connectorKeyValueStore.put(connectorName, config);
           putTaskConfigs(connectorName, taskConfigList);
           sendSynchronizeConfig();
       }
   ```
   
   but I found that these two line
   ```
           Map<String, ConnectKeyValue> connectorConfig = new HashMap<>();
           connectorConfig.put(connectorName, config);
   ``` created a local variable `connectorConfig` but was never used.
   
   So I'm wondering maybe it means 
   ```
       @Override
       public void removeConnectorConfig(String connectorName) {
   
           ConnectKeyValue config = new ConnectKeyValue();
           config.put(RuntimeConfigDefine.UPDATE_TIMESATMP, 
System.currentTimeMillis());
           config.put(RuntimeConfigDefine.CONFIG_DELETED, 1);
           List<ConnectKeyValue> taskConfigList = new ArrayList<>();
           taskConfigList.add(config);
   
           connectorKeyValueStore.put(connectorName, config);
           try {
               putConnectorConfig(connectorName, config);
           } catch (Exception e) {
               e.printStackTrace();
           }
           putTaskConfigs(connectorName, taskConfigList);
           sendSynchronizeConfig();
       }
   ```
   This makes more sense to me. Wondering did I understand it wrong?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to