Skip to content
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

[java][Micronaut] avoid Double Brace Initialization (DBI) #11609

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ public JavaMicronautAbstractCodegen() {
cliOptions.add(CliOption.newBoolean(OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR, "Allow only to create models with all the required properties provided in constructor", requiredPropertiesInConstructor));

CliOption buildToolOption = new CliOption(OPT_BUILD, "Specify for which build tool to generate files").defaultValue(buildTool);
buildToolOption.setEnum(new HashMap<String, String>() {{
put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
}});
Map buildToolOptionMap = new HashMap<String, String>();
buildToolOptionMap.put(OPT_BUILD_GRADLE, "Gradle configuration is generated for the project");
buildToolOptionMap.put(OPT_BUILD_MAVEN, "Maven configuration is generated for the project");
buildToolOptionMap.put(OPT_BUILD_ALL, "Both Gradle and Maven configurations are generated");
buildToolOption.setEnum(buildToolOptionMap);
cliOptions.add(buildToolOption);

CliOption testToolOption = new CliOption(OPT_TEST, "Specify which test tool to generate files for").defaultValue(testTool);
testToolOption.setEnum(new HashMap<String, String>() {{
put(OPT_TEST_JUNIT, "Use JUnit as test tool");
put(OPT_TEST_SPOCK, "Use Spock as test tool");
}});
Map testToolOptionMap = new HashMap<String, String>();
testToolOptionMap.put(OPT_TEST_JUNIT, "Use JUnit as test tool");
testToolOptionMap.put(OPT_TEST_SPOCK, "Use Spock as test tool");
testToolOption.setEnum(testToolOptionMap);
cliOptions.add(testToolOption);

// Remove the date library option
Expand Down