-
Notifications
You must be signed in to change notification settings - Fork 823
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
Temporarily downgrade gradle module language level #7367
Merged
ebarboni
merged 1 commit into
apache:delivery
from
mbien:downgrade-gradle-module-lang-level_delivery
May 14, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,8 +19,10 @@ | |||||
package org.netbeans.modules.gradle.spi.newproject; | ||||||
|
||||||
import java.io.File; | ||||||
import java.util.Collections; | ||||||
import java.util.List; | ||||||
import java.util.Map; | ||||||
import java.util.stream.Collectors; | ||||||
import org.netbeans.modules.gradle.newproject.GradleInitPanel; | ||||||
import org.netbeans.spi.project.ui.support.CommonProjectActions; | ||||||
import org.openide.WizardDescriptor; | ||||||
|
@@ -49,10 +51,11 @@ public enum GradleDSL { | |||||
|
||||||
@Override | ||||||
public String toString() { | ||||||
return switch(this) { | ||||||
case GROOVY -> Bundle.LBL_DSL_GROOVY(); | ||||||
case KOTLIN -> Bundle.LBL_DSL_KOTLIN(); | ||||||
}; | ||||||
switch(this) { | ||||||
case GROOVY: return Bundle.LBL_DSL_GROOVY(); | ||||||
case KOTLIN: return Bundle.LBL_DSL_KOTLIN(); | ||||||
default: throw new IllegalStateException("update switch"); | ||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -88,16 +91,17 @@ public String getId() { | |||||
|
||||||
@Override | ||||||
public String toString() { | ||||||
return switch(this) { | ||||||
case CPP_TEST -> Bundle.LBL_TFW_CPP_TEST(); | ||||||
case JUNIT -> Bundle.LBL_TFW_JUNIT(); | ||||||
case JUNIT_5 -> Bundle.LBL_TFW_JUNIT_5(); | ||||||
case KOTLIN_TEST -> Bundle.LBL_TFW_KOTLIN_TEST(); | ||||||
case SCALA_TEST -> Bundle.LBL_TFW_SCALA_TEST(); | ||||||
case SPOCK -> Bundle.LBL_TFW_SPOCK(); | ||||||
case TESTNG -> Bundle.LBL_TFW_TESTNG(); | ||||||
case XCTEST -> Bundle.LBL_TFW_XCTEST(); | ||||||
}; | ||||||
switch(this) { | ||||||
case CPP_TEST: return Bundle.LBL_TFW_CPP_TEST(); | ||||||
case JUNIT: return Bundle.LBL_TFW_JUNIT(); | ||||||
case JUNIT_5: return Bundle.LBL_TFW_JUNIT_5(); | ||||||
case KOTLIN_TEST: return Bundle.LBL_TFW_KOTLIN_TEST(); | ||||||
case SCALA_TEST: return Bundle.LBL_TFW_SCALA_TEST(); | ||||||
case SPOCK: return Bundle.LBL_TFW_SPOCK(); | ||||||
case TESTNG: return Bundle.LBL_TFW_TESTNG(); | ||||||
case XCTEST: return Bundle.LBL_TFW_XCTEST(); | ||||||
default: throw new IllegalStateException("update switch"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -108,7 +112,7 @@ public String toString() { | |||||
private TestFramework preferredTestFramework; | ||||||
private List<Integer> javaVersions; | ||||||
private List<TestFramework> testFrameworks; | ||||||
private List<String> important = List.of(); | ||||||
private List<String> important = Collections.emptyList(); | ||||||
|
||||||
private GradleInitWizard(String type, String title) { | ||||||
this.type = type; | ||||||
|
@@ -211,14 +215,14 @@ protected void collectOperations(TemplateOperation ops, Map<String, Object> para | |||||
List<String> open = important.stream() | ||||||
.map((s) -> packageBase != null ? s.replace("${package}", packageBase.replace('.', '/')) : s) //NOI18N | ||||||
.map((s) -> s.replace("${projectName}", name)) //NOI18N | ||||||
.toList(); | ||||||
.collect(Collectors.toList()); | ||||||
ops.addProjectPreload(root, open); | ||||||
} | ||||||
|
||||||
|
||||||
@Override | ||||||
protected List<? extends WizardDescriptor.Panel<WizardDescriptor>> createPanels() { | ||||||
return List.of(new GradleInitPanel()); | ||||||
return Collections.singletonList(new GradleInitPanel()); | ||||||
} | ||||||
|
||||||
@Override | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 would not throw from toString - if this is user visible the name might look strange, but still conveys the meaning.
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.
yeah but I am sure @lkishalmi will fix this properly during NB 23, so we can't really arrive at a situation where enums are added (which are btw a few lines above the
toString()
) without anyone noticing it.