Apply consistent formatting and organization conventions throughout the codebase to enhance readability and maintainability: 1. Follow the project's `.editorconfig` settings for indentation style (tabs vs spaces) and other formatting rules.
Apply consistent formatting and organization conventions throughout the codebase to enhance readability and maintainability:
Follow the project’s .editorconfig
settings for indentation style (tabs vs spaces) and other formatting rules.
dependencies {
optional("io.micrometer:context-propagation")
optional("io.micrometer:micrometer-observation")
optional("io.projectreactor:reactor-test")
optional("org.jetbrains.kotlinx:kotlinx-coroutines-core")
optional("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
}
// Preferred:
private final RowMapper<Actor> actorRowMapper = (rs, rowNum) -> {
Actor actor = new Actor();
actor.setFirstName(rs.getString("first_name"));
actor.setLastName(rs.getString("last_name"));
return actor;
};
// Not preferred:
private RowMapper<Actor> getActorMapper() {
return (rs, rowNum) -> {
// implementation
};
}
// Preferred:
jdbcTemplate.update(connection -> {
PreparedStatement ps = connection.prepareStatement(INSERT_SQL, new String[] { "id" });
ps.setString(1, name);
return ps;
}, keyHolder);
// Not preferred:
PreparedStatementCreator statementCreator = connection -> {
// implementation
};
jdbcTemplate.update(statementCreator, keyHolder);
Enter the URL of a public GitHub repository