diff --git a/ocaml/sdk-gen/java/templates/Types.mustache b/ocaml/sdk-gen/java/templates/Types.mustache index 9efae5e0d0c..1af54721669 100644 --- a/ocaml/sdk-gen/java/templates/Types.mustache +++ b/ocaml/sdk-gen/java/templates/Types.mustache @@ -174,6 +174,19 @@ public class Types } {{/errors}} + public static class BadAsyncResult extends XenAPIException { + public final String result; + + /** + * Create a new BadAsyncResult + */ + public BadAsyncResult(String result) + { + super(result); + this.result = result; + } + } + {{#types}} /** * Converts an {@link Object} to a {@link {{{name}}}} object. @@ -215,24 +228,12 @@ public class Types {{/generate_reference_task_result_func}} {{/types}} - - public static class BadAsyncResult extends XenAPIException - { - public final String result; - - public BadAsyncResult(String result) - { - super(result); - this.result = result; - } - } - private static String parseResult(String result) throws BadAsyncResult { Pattern pattern = Pattern.compile("(.*)"); Matcher matcher = pattern.matcher(result); if (!matcher.find() || matcher.groupCount() != 1) { - throw new Types.BadAsyncResult("Can't interpret: " + result); + throw new Types.BadAsyncResult("Can't parse: " + result); } return matcher.group(1);