-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring #19
Refactoring #19
Conversation
zorglube
commented
Nov 29, 2022
- Handle AutoCloseable Connexion and Database
- Improved Resource loading
- Handle AutoCloseable Connexion and Database - Improved Resource loading
@lbruun : here is a king of rebase ;-) |
Hi zorglube. Your PR includes too many unrelated changes (something not related to what you plan to fix). It makes it impossible to review. If the aim is to "
" Then do that .. and only that. I think you have accidentally set your IDE to re-format source code files when you open them .. or something. |
Hey @lbruun, Yes IDE certainly have a formatter different than your's. I'll handle the formatting issue. About the formatting, I'll make some updates on the PR about Formatting I have made previously. See you ;-) |
@lbruun : I handled whitespaceschanges. |
import jakarta.validation.constraints.NotEmpty; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.validation.annotation.Validated; | ||
import static java.lang.String.format; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of these static imports. It makes the code less readable.
In my mind
LiquibaseUtils.getLiquibaseDatabaseShortName(...)
is a lot easier to read than
getLiquibaseDatabaseShortName(...)
because the former makes it obvious that the method is something from outside the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a matter of personal habits and preferences. Anyhow since it's your project, I'll comply.
|
||
/** | ||
* Properties for Pre-Liquibase module. | ||
* | ||
* @author lbruun | ||
*/ | ||
@Validated | ||
@ConfigurationProperties(prefix = PROPERTIES_PREFIX) | ||
@ConfigurationProperties(prefix = "preliquibase") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because after my refactoring it has become useless to have the configuration key prefix stored into a static var.
@@ -221,7 +259,41 @@ public List<String> getSqlScriptReferences() { | |||
* | |||
* @param sqlScriptReferences list of Spring Resource references. | |||
*/ | |||
public void setSqlScriptReferences(List<String> sqlScriptReferences) { | |||
// @formatter:on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this? No IDE specific stuff in the code, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an Eclipse specific comment. Like I written before, your project your rules.
@@ -87,10 +85,14 @@ limitations under the License. | |||
<type>pom</type> | |||
<scope>import</scope> | |||
</dependency> | |||
<dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the point here. Don't really know if it improves anything.
In any case the elements are now misaligned and for this reason alone I'll have to reject it (regardless if the idea is a good one or not .. which I cannot quite decide upon yet)
@@ -5,7 +5,7 @@ | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops. Why ????
This is the text from the AL2 license. It must not be touched by an (accidental) re-format of code.
@zorglube . You are still re-formatting all of the code to the way you have set your formatter. Don't touch formatting when contributing to FOSS projects. Just look at the convention used and go with that. Also, I have a bunch of other comments on things I do not like in the PR. I've commented directly in a few places. I don't want this to be too discouraging for you, but you are simply attempting to change too many things in a single PR. It therefore becomes impossible to review. I'm not able to "see the wood for the trees", so to speak. (l'arbre cache la forêt). For this reason, I'll have to reject. Your idea of taking advantage of the fact that the Liquibase Your other idea, changing the type of |
See PR #20 |
@lbruun Using the Spring Resource simplify a lot the resource loading. Using Spring Like it's written in the Spring doc : https://docs.spring.io/spring-framework/docs/6.0.x/reference/html/core.html#resources Since Pre-Liquibase is designed to be a Spring module, why not using some powerful behavior that come built-in in Spring. |
@lbruun I purposed a PR that contain an Eclipse formatter for the project, if might not be perfect today. |
I understand, I'll have a look and maybe purpose some other PR. |
But this is already the case. It is just initially represented as a String. All resource abstractions that Spring supports are supported, by definition. None of these Spring Resource abstractions are handled "by hand". As indicated the code originally comes from Spring 2.3, class |