Fix string comparison in Python generator's abstract class (#7030)

* fix string comparison in PythonAbstractConnexionServerCodegen.java

* rename abstract class

* put public first
This commit is contained in:
William Cheng 2020-07-24 16:43:39 +08:00 committed by GitHub
parent 276a983fe8
commit 5f8e28a39d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -43,8 +43,8 @@ import java.util.*;
import static org.openapitools.codegen.utils.StringUtils.camelize;
import static org.openapitools.codegen.utils.StringUtils.underscore;
public class PythonAbstractConnexionServerCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(PythonAbstractConnexionServerCodegen.class);
public abstract class AbstractPythonConnexionServerCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPythonConnexionServerCodegen.class);
public static final String CONTROLLER_PACKAGE = "controllerPackage";
public static final String DEFAULT_CONTROLLER = "defaultController";
@ -64,7 +64,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme
protected boolean useNose = Boolean.FALSE;
protected String pythonSrcRoot;
public PythonAbstractConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) {
public AbstractPythonConnexionServerCodegen(String templateDirectory, boolean fixBodyNameValue) {
super();
modifyFeatureSet(features -> features.includeDocumentationFeatures(DocumentationFeature.Readme));
@ -248,7 +248,7 @@ public class PythonAbstractConnexionServerCodegen extends DefaultCodegen impleme
pySrcRoot = val.replaceAll("[/\\\\]+$", "");
}
if (pySrcRoot.isEmpty() || pySrcRoot == ".") {
if (pySrcRoot.isEmpty() || ".".equals(pySrcRoot)) {
this.pythonSrcRoot = "";
} else {
this.pythonSrcRoot = pySrcRoot + File.separator;

View File

@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
import java.util.EnumSet;
public class PythonAiohttpConnexionServerCodegen extends PythonAbstractConnexionServerCodegen {
public class PythonAiohttpConnexionServerCodegen extends AbstractPythonConnexionServerCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(PythonAiohttpConnexionServerCodegen.class);
public PythonAiohttpConnexionServerCodegen() {

View File

@ -24,7 +24,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.EnumSet;
public class PythonBluePlanetServerCodegen extends PythonAbstractConnexionServerCodegen {
public class PythonBluePlanetServerCodegen extends AbstractPythonConnexionServerCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(PythonBluePlanetServerCodegen.class);
protected String modelDocPath = "";

View File

@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
import java.io.File;
public class PythonFlaskConnexionServerCodegen extends PythonAbstractConnexionServerCodegen {
public class PythonFlaskConnexionServerCodegen extends AbstractPythonConnexionServerCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(PythonFlaskConnexionServerCodegen.class);
public PythonFlaskConnexionServerCodegen() {