Re: [java PATCH] Fix build with jna >= 3.5.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Since jna-3.5.0, all subclasses of com.sun.jna.Structure are required
> to
> implement getFieldOrder method which is supposed to return a list of
> fields the wrapped structure contains.

>  public class virConnectAuth extends Structure {
>      public Pointer credtype;
>      public int ncredtype;
>      public Libvirt.VirConnectAuthCallback cb;
>      public Pointer cbdata;
> +
> +    protected java.util.List getFieldOrder() {
> +        return java.util.Arrays.asList(new String[] {
> +            "credtype", "ncredtype", "cb", "cbdata" });
> +    }

Isn't it sufficient to write:

  return java.util.Arrays.asList("credtype", "ncredtype", "cb", "cbdata")

and let Java do the conversion from var-args to String[] with less typing
on your part?

But that's cosmetic.  ACK whether you go as-is or use shorter syntax.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]