-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactored: Implementation and Design Smells #1636
base: main
Are you sure you want to change the base?
Conversation
…t method into smaller methods following SRP using Extract Method
…r the get method into smaller methods following SRP using Extract Method" This reverts commit 42ce2da.
…t method into smaller methods following SRP using Extract Method
…onal checks in 2 methods
…p method refactoring for Gradle and Maven Build
There are a lot of new POM files (e.g. |
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.
Hello @akshat799 , I've left some comments for your consideration.
@@ -86,7 +87,8 @@ private GradleBuild createGradleBuild(BuildItemResolver buildItemResolver, | |||
|
|||
@Bean | |||
public BuildCustomizer<GradleBuild> defaultGradleBuildCustomizer(ProjectDescription description) { | |||
return (build) -> build.settings().sourceCompatibility(description.getLanguage().jvmVersion()); | |||
return (build) -> build.settings() |
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 don't see how that improves things. Please revert.
@@ -46,7 +47,7 @@ public DefaultMavenBuildCustomizer(ProjectDescription description, InitializrMet | |||
public void customize(MavenBuild build) { | |||
build.settings().addOverrideIfEmpty(true); | |||
build.settings().name(this.description.getName()).description(this.description.getDescription()); | |||
build.properties().property("java.version", this.description.getLanguage().jvmVersion()); | |||
build.properties().property("java.version", ((AbstractLanguage) this.description.getLanguage()).jvmVersion()); |
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 don't see how that improves things. Please revert.
@@ -100,7 +100,8 @@ public KotlinProjectSettings kotlinProjectSettings(ObjectProvider<KotlinVersionR | |||
String kotlinVersion = kotlinVersionResolver | |||
.getIfAvailable(() -> new InitializrMetadataKotlinVersionResolver(metadata)) | |||
.resolveKotlinVersion(this.description); | |||
return new SimpleKotlinProjectSettings(kotlinVersion, this.description.getLanguage().jvmVersion()); | |||
return new SimpleKotlinProjectSettings(kotlinVersion, |
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 don't see how that improves things. Please revert.
@@ -46,7 +46,7 @@ public String id() { | |||
return this.id; | |||
} | |||
|
|||
@Override | |||
// @Override |
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.
Please revert.
* @return the JVM version or {@value DEFAULT_JVM_VERSION} if not set | ||
*/ | ||
String jvmVersion(); | ||
// /** |
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.
Please revert.
* @param <P> the type of the plugin container | ||
* @author Akshat Gulati | ||
*/ | ||
public interface BuildExtensionsAndPlugins<E, P> { |
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's the reason for that abstraction? I can't see any usages of it.
@@ -37,7 +37,7 @@ void javaLanguage() { | |||
assertThat(java).isInstanceOf(JavaLanguage.class); | |||
assertThat(java.id()).isEqualTo("java"); | |||
assertThat(java.toString()).isEqualTo("java"); | |||
assertThat(java.jvmVersion()).isEqualTo("11"); | |||
assertThat(((JavaLanguage) java).jvmVersion()).isEqualTo("11"); |
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 don't see how that improves things. Please revert.
@@ -46,7 +46,7 @@ void kotlinLanguage() { | |||
assertThat(kotlin).isInstanceOf(KotlinLanguage.class); | |||
assertThat(kotlin.id()).isEqualTo("kotlin"); | |||
assertThat(kotlin.toString()).isEqualTo("kotlin"); | |||
assertThat(kotlin.jvmVersion()).isEqualTo("1.8"); | |||
assertThat(((KotlinLanguage) kotlin).jvmVersion()).isEqualTo("1.8"); |
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 don't see how that improves things. Please revert.
@@ -55,7 +55,7 @@ void groovyLanguage() { | |||
assertThat(groovy).isInstanceOf(GroovyLanguage.class); | |||
assertThat(groovy.id()).isEqualTo("groovy"); | |||
assertThat(groovy.toString()).isEqualTo("groovy"); | |||
assertThat(groovy.jvmVersion()).isEqualTo("1.8"); | |||
assertThat(((GroovyLanguage) groovy).jvmVersion()).isEqualTo("1.8"); |
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 don't see how that improves things. Please revert.
@@ -274,7 +275,7 @@ void convertShouldSetLanguageForProjectDescriptionFromRequest() { | |||
request.setJavaVersion("1.8"); | |||
ProjectDescription description = this.converter.convert(request, this.metadata); | |||
assertThat(description.getLanguage().id()).isEqualTo("java"); | |||
assertThat(description.getLanguage().jvmVersion()).isEqualTo("1.8"); | |||
assertThat(((AbstractLanguage) description.getLanguage()).jvmVersion()).isEqualTo("1.8"); |
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 don't see how that improves things. Please revert.
You also need to sign the commits, as explained here. |
Implementation Smell Refactoring:
Design Smell Refactoring: