Neilk1021 opened a new issue, #7044:
URL: https://github.com/apache/texera/issues/7044

   ### Task Summary
   
   ### Context
   Currently the jOOq table User is constructed like this when used:
   
   ``` Scala
     val GUEST: User =
       new User(null, "guest", null, null, null, null, UserRoleEnum.REGULAR, 
null, null, null, null)
   ```
   
   This means whenever we change the jOOq definition we have to find all 
instances of this constructor and add / remove params even if they aren't 
needed. It's also just hard to read.
   
   Instead, we could be using Scala's tap system which allows us to construct 
and setup an object in one pass. This is also considered more idiomatic Scala. 
   
   ```Scala
   val GUEST: User = {
     new User().tap { user =>
       user.setName("guest")
       user.setRole(UserRoleEnum.REGULAR)
     }
   }
   ```
   ### Changes:
   Find all instances of positional User constructor and replace them with a 
.tap() based equivalent. 
   
   ### Task Type
   
   - [x] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [ ] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other


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