remove supportJava6 (#16664)

This commit is contained in:
William Cheng 2023-09-26 10:14:36 +08:00 committed by GitHub
parent 1cff462d90
commit 6c1a937663
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 0 additions and 21 deletions

View File

@ -67,7 +67,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true| |sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/gen/java| |sourceFolder|source folder for generated code| |src/gen/java|
|supportJava6|Whether to support Java6 with the Jersey2 library.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi| |testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|a title describing the application| |OpenAPI Server| |title|a title describing the application| |OpenAPI Server|
|useBeanValidation|Use BeanValidation API annotations| |true| |useBeanValidation|Use BeanValidation API annotations| |true|

View File

@ -70,7 +70,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String DATE_LIBRARY = "dateLibrary"; public static final String DATE_LIBRARY = "dateLibrary";
public static final String SUPPORT_ASYNC = "supportAsync"; public static final String SUPPORT_ASYNC = "supportAsync";
public static final String WITH_XML = "withXml"; public static final String WITH_XML = "withXml";
public static final String SUPPORT_JAVA6 = "supportJava6";
public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping";
public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix";
public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum";
@ -121,7 +120,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean serializeBigDecimalAsString = false; protected boolean serializeBigDecimalAsString = false;
protected String apiDocPath = "docs/"; protected String apiDocPath = "docs/";
protected String modelDocPath = "docs/"; protected String modelDocPath = "docs/";
protected boolean supportJava6 = false;
protected boolean disableHtmlEscaping = false; protected boolean disableHtmlEscaping = false;
protected String booleanGetterPrefix = "get"; protected String booleanGetterPrefix = "get";
protected boolean ignoreAnyOfInEnum = false; protected boolean ignoreAnyOfInEnum = false;
@ -361,11 +359,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
} }
if (additionalProperties.containsKey(SUPPORT_JAVA6)) {
this.setSupportJava6(Boolean.parseBoolean(additionalProperties.get(SUPPORT_JAVA6).toString()));
}
additionalProperties.put(SUPPORT_JAVA6, supportJava6);
if (additionalProperties.containsKey(DISABLE_HTML_ESCAPING)) { if (additionalProperties.containsKey(DISABLE_HTML_ESCAPING)) {
this.setDisableHtmlEscaping(Boolean.parseBoolean(additionalProperties.get(DISABLE_HTML_ESCAPING).toString())); this.setDisableHtmlEscaping(Boolean.parseBoolean(additionalProperties.get(DISABLE_HTML_ESCAPING).toString()));
} }
@ -2118,10 +2111,6 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
return version + "-SNAPSHOT"; return version + "-SNAPSHOT";
} }
public void setSupportJava6(boolean value) {
this.supportJava6 = value;
}
@Override @Override
public String toRegularExpression(String pattern) { public String toRegularExpression(String pattern) {
return escapeText(pattern); return escapeText(pattern);

View File

@ -406,8 +406,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
if (!loadTestDataFromFile) { if (!loadTestDataFromFile) {
op.imports.add("ArrayList"); op.imports.add("ArrayList");
buffer.append("new ArrayList<"); buffer.append("new ArrayList<");
if (supportJava6)
buffer.append(var.dataType);
buffer.append(">();"); buffer.append(">();");
} }
var.index = var.size(); var.index = var.size();
@ -467,8 +465,6 @@ public class JavaCXFExtServerCodegen extends JavaCXFServerCodegen implements CXF
if (!loadTestDataFromFile) { if (!loadTestDataFromFile) {
op.imports.add("HashMap"); op.imports.add("HashMap");
buffer.append("new HashMap<"); buffer.append("new HashMap<");
if (supportJava6)
buffer.append("String, ").append(var.dataType);
buffer.append(">();"); buffer.append(">();");
} }
var.index = var.size(); var.index = var.size();

View File

@ -59,9 +59,7 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen {
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_JERSEY_LIBRARY); CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_JERSEY_LIBRARY);
supportedLibraries.put(LIBRARY_JERSEY2, "Jersey core 2.x"); supportedLibraries.put(LIBRARY_JERSEY2, "Jersey core 2.x");
library.setEnum(supportedLibraries); library.setEnum(supportedLibraries);
cliOptions.add(library); cliOptions.add(library);
cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey2 library."));
} }
@Override @Override

View File

@ -170,7 +170,6 @@ public class JavaPKMSTServerCodegen extends AbstractJavaCodegen {
if (this.additionalProperties.containsKey(SPRINGADMIN_URI)) { if (this.additionalProperties.containsKey(SPRINGADMIN_URI)) {
this.setSpringBootAdminUri((String) this.additionalProperties.get(SPRINGADMIN_URI)); this.setSpringBootAdminUri((String) this.additionalProperties.get(SPRINGADMIN_URI));
} }
this.additionalProperties.put(SUPPORT_JAVA6, false);
this.additionalProperties.put("java8", true); this.additionalProperties.put("java8", true);
if (this.additionalProperties.containsKey(WITH_XML)) { if (this.additionalProperties.containsKey(WITH_XML)) {

View File

@ -218,7 +218,6 @@ public class JavaJAXRSCXFExtServerCodegenTest extends JavaJaxrsBaseTest {
additionalProperties.put(AbstractJavaCodegen.DATE_LIBRARY, "MyDateLibrary"); additionalProperties.put(AbstractJavaCodegen.DATE_LIBRARY, "MyDateLibrary");
additionalProperties.put(AbstractJavaCodegen.DISABLE_HTML_ESCAPING, "true"); additionalProperties.put(AbstractJavaCodegen.DISABLE_HTML_ESCAPING, "true");
additionalProperties.put(AbstractJavaCodegen.SUPPORT_ASYNC, "true"); additionalProperties.put(AbstractJavaCodegen.SUPPORT_ASYNC, "true");
additionalProperties.put(AbstractJavaCodegen.SUPPORT_JAVA6, "false");
additionalProperties.put(AbstractJavaCodegen.WITH_XML, "true"); additionalProperties.put(AbstractJavaCodegen.WITH_XML, "true");
additionalProperties.put(AbstractJavaCodegen.OPENAPI_NULLABLE, "false"); additionalProperties.put(AbstractJavaCodegen.OPENAPI_NULLABLE, "false");
// Options processed by AbstractJavaJAXRSServerCodegen // Options processed by AbstractJavaJAXRSServerCodegen
@ -468,7 +467,6 @@ public class JavaJAXRSCXFExtServerCodegenTest extends JavaJaxrsBaseTest {
assertNull(additionalProperties.get(AbstractJavaCodegen.DATE_LIBRARY)); assertNull(additionalProperties.get(AbstractJavaCodegen.DATE_LIBRARY));
assertEquals(additionalProperties.get(AbstractJavaCodegen.DISABLE_HTML_ESCAPING), Boolean.FALSE); assertEquals(additionalProperties.get(AbstractJavaCodegen.DISABLE_HTML_ESCAPING), Boolean.FALSE);
assertNull(additionalProperties.get(AbstractJavaCodegen.SUPPORT_ASYNC)); assertNull(additionalProperties.get(AbstractJavaCodegen.SUPPORT_ASYNC));
assertEquals(additionalProperties.get(AbstractJavaCodegen.SUPPORT_JAVA6), Boolean.FALSE);
assertEquals(additionalProperties.get(AbstractJavaCodegen.WITH_XML), false); assertEquals(additionalProperties.get(AbstractJavaCodegen.WITH_XML), false);
assertEquals(additionalProperties.get(AbstractJavaCodegen.OPENAPI_NULLABLE), true); assertEquals(additionalProperties.get(AbstractJavaCodegen.OPENAPI_NULLABLE), true);
// Options processed by AbstractJavaJAXRSServerCodegen // Options processed by AbstractJavaJAXRSServerCodegen