This commit is contained in:
Maelig Nantel 2016-01-18 11:16:04 +01:00
parent b292ce54ce
commit 89ed3bdb75
5 changed files with 13 additions and 17 deletions

View File

@ -101,7 +101,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<!-- <version>2.1</version> -->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -256,7 +256,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng-version}</version>
<!-- <version>${testng-version}</version> -->
<scope>test</scope>
</dependency>
<dependency>
@ -268,7 +268,7 @@
<dependency>
<groupId>org.jmockit</groupId>
<artifactId>jmockit</artifactId>
<version>${jmockit-version}</version>
<!-- <version>${jmockit-version}</version> -->
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -19,7 +19,7 @@ import static org.apache.commons.lang3.StringUtils.capitalize;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
public class DefaultGenerator extends AbstractGenerator implements Generator {
Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class);
protected Logger LOGGER = LoggerFactory.getLogger(DefaultGenerator.class);
protected CodegenConfig config;
protected ClientOptInput opts;
@ -392,16 +392,11 @@ public class DefaultGenerator extends AbstractGenerator implements Generator {
}
File outputFile = new File(outputFilename);
OutputStream out = new FileOutputStream(outputFile, false);
if (in != null && out != null) {
if (in != null) {
System.out.println("writing file " + outputFile);
IOUtils.copy(in, out);
} else {
if (in == null) {
System.out.println("can't open " + templateFile + " for input");
}
if (out == null) {
System.out.println("can't open " + outputFile + " for output");
}
System.out.println("can't open " + templateFile + " for input"); // FIXME: use LOGGER instead of standart output
}
files.add(outputFile);
}

View File

@ -39,7 +39,7 @@ public class XmlExampleGenerator {
public XmlExampleGenerator(Map<String, Model> examples) {
this.examples = examples;
if (examples == null) {
examples = new HashMap<String, Model>(); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'.
this.examples = new HashMap<String, Model>();
}
}

View File

@ -9,10 +9,6 @@ import java.io.File;
import org.apache.commons.lang.StringUtils;
public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public CodegenType getTag() {
return CodegenType.CLIENT;
}
public AbstractTypeScriptClientCodegen() {
super();
@ -56,6 +52,11 @@ public abstract class AbstractTypeScriptClientCodegen extends DefaultCodegen imp
// mapped to String as a workaround
typeMapping.put("binary", "string");
}
@Override
public CodegenType getTag() {
return CodegenType.CLIENT;
}
@Override
public String escapeReservedWord(String name) {

View File

@ -22,7 +22,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CSharpClientCodegen extends DefaultCodegen implements CodegenConfig {
@SuppressWarnings("unused")
@SuppressWarnings({ "unused", "hiding" })
private static final Logger LOGGER = LoggerFactory.getLogger(CSharpClientCodegen.class);
protected boolean optionalAssemblyInfoFlag = true;
protected boolean optionalMethodArgumentFlag = true;