mattcasters commented on code in PR #8590:
URL: https://github.com/apache/hop/pull/8590#discussion_r4106451201


##########
plugins/transforms/tableinput/src/main/java/org/apache/hop/pipeline/transforms/tableinput/TableInputMeta.java:
##########
@@ -383,11 +385,22 @@ public void check(
       } finally {
         db.close();
       }
-    } else {
+    } else if (!Utils.isEmpty(connection)

Review Comment:
   **[bug]** An unset connection (`null`, the field default on a new Table 
Input) never reaches this branch, and Verify still reports it twice. 
`variables.resolve(null)` returns null, and `serializer.load(null)` throws 
`HopException` (`"you need to specify the name..."`). The catch above this 
`else if` always adds `TableInputMeta.CheckResult.DatabaseMetaError` with that 
null argument, which MessageFormat renders as connection `'null'`. Because 
`connection` is empty, this new condition is false, so the remark is an uncoded 
`ERROR` in addition to `ReferencedDatabaseConnectionChecker`'s 
`CONNECTION_NOT_ASSIGNED`. A named missing connection does not throw (`load` 
returns null), which is the only case 
`aMissingConnectionIsReportedOnceByPipelineVerify` covers. The uncoded error is 
still reported as `HOP-CHECK`, so suppressing `CONNECTION_NOT_ASSIGNED` does 
not clear it.
   
   **Suggestion:** Do not call `load` when the name is empty; let the pipeline 
checker report `CONNECTION_NOT_ASSIGNED`. In the catch, skip 
`DatabaseMetaError` when the resolved name is empty or still has a variable 
token, and add a check-transforms test with `setConnection(null)` that expects 
a single `CONNECTION_NOT_ASSIGNED` remark.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to