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

Code clean-up: Add own private static final LOGGER in each class #26

Merged
merged 1 commit into from
May 13, 2018
Merged
Show file tree
Hide file tree
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 @@ -38,7 +38,7 @@
import java.util.Map;

public class Generator {
static Logger LOGGER = LoggerFactory.getLogger(Generator.class);
private static final Logger LOGGER = LoggerFactory.getLogger(Generator.class);

public static Map<String, CliOption> getOptions(String language) throws ApiException {
CodegenConfig config = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import java.util.stream.Collectors;

public class DefaultCodegen implements CodegenConfig {
protected static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class);

protected String inputSpec;
protected String outputFolder = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import org.openapitools.codegen.CodegenSecurity;
import org.openapitools.codegen.DefaultCodegen;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -44,6 +46,8 @@
import java.util.Map;

abstract public class AbstractAdaCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractAdaCodegen.class);

protected String packageName = "defaultPackage";
protected String projectName = "defaultProject";
protected List<Map<String, Object>> orderedModels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
protected Set<String> collectionTypes;
protected Set<String> mapTypes;

protected Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractCSharpCodegen.class);

public AbstractCSharpCodegen() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@

package org.openapitools.codegen.languages;

import io.swagger.v3.oas.models.media.Schema;

import org.openapitools.codegen.CodegenConfig;
import org.openapitools.codegen.CodegenProperty;
import org.openapitools.codegen.DefaultCodegen;
import io.swagger.v3.oas.models.media.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

abstract public class AbstractCppCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractCppCodegen.class);

public AbstractCppCodegen() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.core.util.Json;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractEiffelCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractEiffelCodegen.class);

private final Set<String> parentModels = new HashSet<>();
private final Multimap<String, CodegenModel> childrenByParent = ArrayListMultimap.create();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public abstract class AbstractGoCodegen extends DefaultCodegen implements CodegenConfig {

protected static Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class);

protected boolean withXml = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig {

static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaCodegen.class);
public static final String FULL_JAVA_UTIL = "fullJavaUtil";
public static final String DEFAULT_LIBRARY = "<default>";
public static final String DATE_LIBRARY = "dateLibrary";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class AbstractJavaJAXRSServerCodegen extends AbstractJavaCodegen

protected boolean useBeanValidation = true;

static Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJavaJAXRSServerCodegen.class);

public AbstractJavaJAXRSServerCodegen() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import java.util.Map;

public abstract class AbstractKotlinCodegen extends DefaultCodegen implements CodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class);

protected String artifactId;
protected String artifactVersion = "1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

public abstract class AbstractPhpCodegen extends DefaultCodegen implements CodegenConfig {

static Logger LOGGER = LoggerFactory.getLogger(AbstractPhpCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPhpCodegen.class);

public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
public static final String PACKAGE_PATH = "packagePath";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import org.openapitools.codegen.CodegenConstants;
import org.openapitools.codegen.DefaultCodegen;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Arrays;
Expand All @@ -34,6 +36,7 @@
import java.util.Map;

public abstract class AbstractScalaCodegen extends DefaultCodegen {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractScalaCodegen.class);

protected String modelPropertyNaming = "camelCase";
protected String invokerPackage = "org.openapitools.client";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
import org.apache.commons.lang3.StringUtils;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.*;

public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractTypeScriptClientCodegen.class);

private static final String X_DISCRIMINATOR_TYPE = "x-discriminator-value";
private static final String UNDEFINED_VALUE = "undefined";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import io.swagger.v3.oas.models.parameters.*;

import org.apache.commons.lang3.StringEscapeUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;
import java.util.HashSet;
Expand All @@ -45,6 +47,7 @@
import java.util.Set;

public class BashClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(BashClientCodegen.class);

protected String apiVersion = "1.0.0";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.parser.util.SchemaTypeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Arrays;
Expand All @@ -32,6 +34,8 @@
import java.util.Set;

public class CppQt5ClientCodegen extends AbstractCppCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(CppQt5ClientCodegen.class);

public static final String CPP_NAMESPACE = "cppNamespace";
public static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api).";
public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate client.pri.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.openapitools.codegen.utils.ModelUtils;

import io.swagger.v3.oas.models.media.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.ArrayList;
Expand All @@ -38,6 +40,8 @@
import java.util.Map;

public class DartClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(DartClientCodegen.class);

public static final String BROWSER_CLIENT = "browserClient";
public static final String PUB_NAME = "pubName";
public static final String PUB_VERSION = "pubVersion";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.openapitools.codegen.*;

public class EiffelClientCodegen extends AbstractEiffelCodegen {
static Logger LOGGER = LoggerFactory.getLogger(EiffelClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(EiffelClientCodegen.class);

protected String libraryTarget = "openapi_eiffel_client";
protected String packageName = "Eiffel";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import io.swagger.v3.oas.models.media.*;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.jws.WebParam;
import java.io.File;
Expand All @@ -37,6 +39,8 @@
import java.util.regex.Pattern;

public class ElixirClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(ElixirClientCodegen.class);

protected String apiVersion = "1.0.0";
protected String moduleName;
protected static final String defaultModuleName = "OpenAPI.Client";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.slf4j.LoggerFactory;

public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(ErlangClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(ErlangClientCodegen.class);

protected String packageName = "openapi";
protected String packageVersion = "1.0.0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import io.swagger.v3.oas.models.media.*;
import io.swagger.v3.oas.models.responses.ApiResponse;
import io.swagger.v3.oas.models.parameters.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Arrays;
Expand All @@ -36,6 +38,8 @@
import org.apache.commons.lang3.StringUtils;

public class FlashClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(FlashClientCodegen.class);

protected String packageName = "org.openapitools";
protected String packageVersion;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@
import org.apache.commons.lang3.tuple.Pair;
import org.openapitools.codegen.*;
import org.openapitools.codegen.utils.ModelUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(HaskellHttpClientCodegen.class);

// source folder where to write the files
protected String sourceFolder = "lib";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
import io.swagger.v3.oas.models.media.*;

import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.regex.Pattern;

public class HaskellServantCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(HaskellServantCodegen.class);

// source folder where to write the files
protected String sourceFolder = "src";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import io.swagger.v3.oas.models.*;
import io.swagger.v3.oas.models.parameters.*;
import io.swagger.v3.oas.models.info.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.TreeSet;
import java.util.*;
Expand All @@ -42,6 +44,7 @@
import org.apache.commons.lang3.StringUtils;

public class JavascriptClosureAngularClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(JavascriptClosureAngularClientCodegen.class);

public static final String USE_ES6 = "useEs6";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {

public static final String DATE_LIBRARY = "dateLibrary";
protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase;
static Logger LOGGER = LoggerFactory.getLogger(KotlinClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(KotlinClientCodegen.class);

protected String dateLibrary = DateLibrary.JAVA8.value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
public class KotlinServerCodegen extends AbstractKotlinCodegen {

public static final String DEFAULT_LIBRARY = Constants.KTOR;
static Logger LOGGER = LoggerFactory.getLogger(KotlinServerCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(KotlinServerCodegen.class);
private Boolean autoHeadFeatureEnabled = true;
private Boolean conditionalHeadersFeatureEnabled = false;
private Boolean hstsFeatureEnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.slf4j.LoggerFactory;

public class LuaClientCodegen extends DefaultCodegen implements CodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(LuaClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(LuaClientCodegen.class);

protected String specFolder = "spec";
protected String packageName = "openapi-client";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Arrays;
Expand All @@ -44,6 +46,8 @@
import org.apache.commons.lang3.StringUtils;

public class ObjcClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(ObjcClientCodegen.class);

public static final String CLASS_PREFIX = "classPrefix";
public static final String POD_NAME = "podName";
public static final String AUTHOR_NAME = "authorName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.Operation;
import io.swagger.v3.oas.models.media.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.Arrays;
Expand All @@ -32,6 +34,8 @@
import org.apache.commons.lang3.StringUtils;

public class PerlClientCodegen extends DefaultCodegen implements CodegenConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(PerlClientCodegen.class);

public static final String MODULE_NAME = "moduleName";
public static final String MODULE_VERSION = "moduleVersion";
protected String moduleName = "WWW::OpenAPIClient";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
@SuppressWarnings("hiding")
static Logger LOGGER = LoggerFactory.getLogger(PhpClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PhpClientCodegen.class);

public static final String VARIABLE_NAMING_CONVENTION = "variableNamingConvention";
public static final String PACKAGE_PATH = "packagePath";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public class PhpSymfonyServerCodegen extends AbstractPhpCodegen implements CodegenConfig {
@SuppressWarnings("hiding")
static Logger LOGGER = LoggerFactory.getLogger(PhpSymfonyServerCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PhpSymfonyServerCodegen.class);

public static final String BUNDLE_NAME = "bundleName";
public static final String COMPOSER_VENDOR_NAME = "composerVendorName";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import static java.util.UUID.randomUUID;

public class PowerShellClientCodegen extends DefaultCodegen implements CodegenConfig {
static Logger LOGGER = LoggerFactory.getLogger(PowerShellClientCodegen.class);
private static final Logger LOGGER = LoggerFactory.getLogger(PowerShellClientCodegen.class);

private String packageGuid = "{" + randomUUID().toString().toUpperCase() + "}";

Expand Down
Loading