Skip to content

Commit d566bd4

Browse files
committedJan 11, 2014
Downgraded java to 1.6
1 parent e69985b commit d566bd4

File tree

3 files changed

+16
-22
lines changed

3 files changed

+16
-22
lines changed
 

‎build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ subprojects {
1717
apply plugin: 'maven-publish'
1818
apply plugin: 'bintray'
1919

20-
sourceCompatibility = 1.7
21-
targetCompatibility = 1.7
20+
sourceCompatibility = 1.6
21+
targetCompatibility = 1.6
2222

2323
repositories {
2424
jcenter()

‎clear-annotation-processor/src/main/java/clear/cdb/annotation/processors/TypescriptAnnotationProcessor.java

+13-19
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private void generateDTO(RoundEnvironment roundEnv, TypeElement elem) throws Exc
7979
}
8080

8181
private Map<String, Object> getDTOContext(RoundEnvironment roundEnv, TypeElement elem) {
82-
Map<String, Object> result = new HashMap<>();
82+
Map<String, Object> result = new HashMap<String, Object>();
8383
result.put("package", ((PackageElement)elem.getEnclosingElement()).getQualifiedName().toString());
8484
result.put("classSimpleName", elem.getSimpleName().toString());
8585
result.put("fields", getFields(roundEnv, elem));
@@ -98,24 +98,18 @@ private List<DTOField> getFields(RoundEnvironment roundEnv, TypeElement elem) {
9898
public String convertFromJava(Class type) {
9999
String t = type.getSimpleName().toLowerCase();
100100
if (t.contains("[]")) return "any[]";
101-
switch (t) {
102-
case "boolean":
103-
return "boolean";
104-
case "string":
105-
return "string";
106-
case "byte":
107-
case "int":
108-
case "short":
109-
case "long":
110-
case "float":
111-
case "double":
112-
return "number";
113-
case "date":
114-
return "Date";
115-
case "list":
116-
return "any[]";
117-
case "map":
118-
return "Object";
101+
if (t.equals("boolean")) {
102+
return "boolean";
103+
} else if (t.equals("string")) {
104+
return "string";
105+
} else if (t.equals("byte") || t.equals("int") || t.equals("short") || t.equals("long") || t.equals("float") || t.equals("double")) {
106+
return "number";
107+
} else if (t.equals("date")) {
108+
return "Date";
109+
} else if (t.equals("list")) {
110+
return "any[]";
111+
} else if (t.equals("map")) {
112+
return "Object";
119113
}
120114
throw new RuntimeException("Unknown Java to Typescript type conversion: " + t);
121115
}

‎clear-utils/src/main/java/clear/cdb/support/test/AnnotationProcessorTestCompiler.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private static List<Diagnostic<? extends JavaFileObject>> compileClassInternal(P
6767
DiagnosticCollector<JavaFileObject> collector = new DiagnosticCollector<JavaFileObject>();
6868

6969
try {
70-
List<String> options = new ArrayList<>();
70+
List<String> options = new ArrayList<String>();
7171
options.add(COMPILER_OPTIONS);
7272
if (additionalOptions != null) {
7373
options.add(additionalOptions);

0 commit comments

Comments
 (0)
Please sign in to comment.