java: Avoid warnings in the tests and examples.

Avoid warnings about missing serial version, and fix a warning about
raw types.
This commit is contained in:
Richard W.M. Jones
2014-02-13 13:16:39 +00:00
parent ab2df2e659
commit 2954541fdd
3 changed files with 16 additions and 10 deletions

View File

@@ -23,7 +23,8 @@ public class CreateDisk
g.set_trace (true); g.set_trace (true);
// Attach the disk image to libguestfs. // Attach the disk image to libguestfs.
Map<String, Object> optargs = new HashMap<String, Object>() { @SuppressWarnings("serial") Map<String, Object> optargs =
new HashMap<String, Object>() {
{ {
put ("format", "raw"); put ("format", "raw");
put ("readonly", Boolean.FALSE); put ("readonly", Boolean.FALSE);

View File

@@ -28,7 +28,8 @@ public class InspectVM
GuestFS g = new GuestFS (); GuestFS g = new GuestFS ();
// Attach the disk image read-only to libguestfs. // Attach the disk image read-only to libguestfs.
Map<String, Object> optargs = new HashMap<String, Object>() { @SuppressWarnings("serial") Map<String, Object> optargs =
new HashMap<String, Object>() {
{ {
//put ("format", "raw"); //put ("format", "raw");
put ("readonly", Boolean.TRUE); put ("readonly", Boolean.TRUE);
@@ -65,7 +66,7 @@ public class InspectVM
// Sort keys by length, shortest first, so that we end up // Sort keys by length, shortest first, so that we end up
// mounting the filesystems in the correct order. // mounting the filesystems in the correct order.
Map<String,String> mps = g.inspect_get_mountpoints (root); Map<String,String> mps = g.inspect_get_mountpoints (root);
List<String> mps_keys = new ArrayList (mps.keySet ()); List<String> mps_keys = new ArrayList<String> (mps.keySet ());
Collections.sort (mps_keys, COMPARE_KEYS_LEN); Collections.sort (mps_keys, COMPARE_KEYS_LEN);
for (String mp : mps_keys) { for (String mp : mps_keys) {

View File

@@ -29,31 +29,35 @@ public class GuestFS070OptArgs
g.add_drive ("/dev/null"); g.add_drive ("/dev/null");
HashMap<String,Object> optargs; @SuppressWarnings("serial")
HashMap<String,Object> optargs =
optargs = new HashMap<String,Object>() { new HashMap<String,Object>() {
{ {
put ("readonly", Boolean.TRUE); put ("readonly", Boolean.TRUE);
} }
}; };
g.add_drive ("/dev/null", optargs); g.add_drive ("/dev/null", optargs);
optargs = new HashMap<String,Object>() { @SuppressWarnings("serial")
HashMap<String,Object> optargs2 =
new HashMap<String,Object>() {
{ {
put ("readonly", Boolean.TRUE); put ("readonly", Boolean.TRUE);
put ("format", "raw"); put ("format", "raw");
} }
}; };
g.add_drive ("/dev/null", optargs); g.add_drive ("/dev/null", optargs2);
optargs = new HashMap<String,Object>() { @SuppressWarnings("serial")
HashMap<String,Object> optargs3 =
new HashMap<String,Object>() {
{ {
put ("readonly", Boolean.TRUE); put ("readonly", Boolean.TRUE);
put ("format", "raw"); put ("format", "raw");
put ("iface", "virtio"); put ("iface", "virtio");
} }
}; };
g.add_drive ("/dev/null", optargs); g.add_drive ("/dev/null", optargs3);
} }
catch (Exception exn) { catch (Exception exn) {
System.err.println (exn); System.err.println (exn);