You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/03/23 10:15:23 UTC

[GitHub] [incubator-inlong] luchunliang commented on a change in pull request #3333: [INLONG-3332][Sort-Standalone] Fix NP and data race in ClsSink

luchunliang commented on a change in pull request #3333:
URL: https://github.com/apache/incubator-inlong/pull/3333#discussion_r833083674



##########
File path: inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/sink/cls/ClsIdConfig.java
##########
@@ -46,10 +46,12 @@
      */
     public List<String> getFieldList() {
         if (fieldList == null) {
-            this.fieldList = new ArrayList<>();
-            if (fieldNames != null) {
-                String[] fieldNameArray = fieldNames.split("\\s+");
-                this.fieldList.addAll(Arrays.asList(fieldNameArray));
+            synchronized (fieldNames) {

Review comment:
       This line will throw Exception when fieldNames==null.
   It is better to invoke this method in reload method.




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

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org