Fixed bug in RPC and Generics mapping
[controller.git] / opendaylight / sal / yang-prototype / code-generator / binding-java-api-generator / src / main / java / org / opendaylight / controller / sal / java / api / generator / GeneratorUtil.java
index a9f0557ecc0b38622c1b5c80c51634d841c19fba..dfae4a2ceaad57c3de7555e7867913416aa78535 100644 (file)
@@ -584,6 +584,9 @@ public final class GeneratorUtil {
                     builder.append(type.getName());
                 }
             }
+            if (type.equals(Types.voidType())) {
+                return "void";
+            }
             if (type instanceof ParameterizedType) {
                 final ParameterizedType pType = (ParameterizedType) type;
                 final Type[] pTypes = pType.getActualTypeArguments();
@@ -591,9 +594,6 @@ public final class GeneratorUtil {
                 builder.append(getParameters(pTypes, imports, currentPkg));
                 builder.append(">");
             }
-            if (builder.toString().equals("Void")) {
-                return "void";
-            }
             return builder.toString();
         }
     }
@@ -609,10 +609,17 @@ public final class GeneratorUtil {
             }
 
             String wildcardParam = "";
-            if (t instanceof WildcardType) {
-                wildcardParam = "? extends ";
+            if (t.equals(Types.voidType())) {
+                builder.append("java.lang.Void" + separator);
+                continue;
+            } else {
+
+                if (t instanceof WildcardType) {
+                    wildcardParam = "? extends ";
+                }
+
+                builder.append(wildcardParam + getExplicitType(t, availableImports, currentPkg) + separator);
             }
-            builder.append(wildcardParam + getExplicitType(t, availableImports, currentPkg) + separator);
         }
         return builder.toString();
     }