java: Return Map<String,String> for RHashtable functions.
[libguestfs.git] / generator / generator_java.ml
index 5ac92f7..90ae263 100644 (file)
@@ -1,5 +1,5 @@
 (* libguestfs
- * Copyright (C) 2009-2010 Red Hat Inc.
+ * Copyright (C) 2009-2011 Red Hat Inc.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ let rec generate_java_java () =
 package com.redhat.et.libguestfs;
 
 import java.util.HashMap;
+import java.util.Map;
 import com.redhat.et.libguestfs.LibGuestFSException;
 import com.redhat.et.libguestfs.PV;
 import com.redhat.et.libguestfs.VG;
@@ -133,8 +134,8 @@ public class GuestFS {
         pr "   * %s\n" doc;
         pr "   * @throws LibGuestFSException\n";
         pr "   */\n";
-        pr "  ";
       );
+      pr "  ";
       generate_java_prototype ~public:true ~semicolon:false name style;
       pr "\n";
       pr "  {\n";
@@ -183,7 +184,7 @@ and generate_java_prototype ?(public=false) ?(privat=false) ?(native=false)
    | RStructList (_, typ) ->
        let name = java_name_of_struct typ in
        pr "%s[] " name;
-   | RHashtable _ -> pr "HashMap<String,String> ";
+   | RHashtable _ -> pr "Map<String,String> ";
   );
 
   if native then pr "_%s " name else pr "%s " name;