DaanHoogland commented on code in PR #12464:
URL: https://github.com/apache/cloudstack/pull/12464#discussion_r2704846113


##########
framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java:
##########
@@ -2047,16 +2048,23 @@ public boolean unremove(ID id) {
 
     @DB()
     protected void setField(final Object entity, final ResultSet rs, 
ResultSetMetaData meta, final int index) throws SQLException {
-        Attribute attr = _allColumns.get(new Pair<String, 
String>(meta.getTableName(index), meta.getColumnName(index)));
+        String tableName = meta.getTableName(index);
+        String columnName = meta.getColumnName(index);
+        Attribute attr = _allColumns.get(new Pair<>(tableName, columnName));
         if (attr == null) {
             // work around for mysql bug to return original table name instead 
of view name in db view case
             Table tbl = 
entity.getClass().getSuperclass().getAnnotation(Table.class);
             if (tbl != null) {
-                attr = _allColumns.get(new Pair<String, String>(tbl.name(), 
meta.getColumnLabel(index)));
+                attr = _allColumns.get(new Pair<>(tbl.name(), 
meta.getColumnLabel(index)));
             }
         }
-        assert (attr != null) : "How come I can't find " + 
meta.getCatalogName(index) + "." + meta.getColumnName(index);
-        setField(entity, attr.field, rs, index);
+        assert (attr != null) : "How come I can't find " + tableName + "." + 
columnName;

Review Comment:
   I think we can remove the assert



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