Ignore:
Timestamp:
2020-12-07T18:10:16+01:00 (4 years ago)
Author:
Don-vip
Message:

update to latest JNA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeKeyringLibrary.java

    r34504 r35665  
    4343package org.netbeans.modules.keyring.gnome;
    4444
    45 import com.sun.jna.DefaultTypeMapper;
     45import com.sun.jna.DefaultTypeMapper; // NOSONAR
    4646import com.sun.jna.FromNativeContext;
    4747import com.sun.jna.Library;
     
    6868        // http://packages.ubuntu.com/search?suite=precise&arch=any&mode=exactfilename&searchon=contents&keywords=libgnome-keyring.so.0
    6969        private static final String EXPLICIT_ONEIRIC = "/usr/lib/libgnome-keyring.so.0";
    70         private static Object load(Map<String,?> options) {
     70        private static GnomeKeyringLibrary load(Map<String,?> options) {
    7171            try {
    72                 return Native.loadLibrary(GENERIC, GnomeKeyringLibrary.class, options);
     72                return Native.load(GENERIC, GnomeKeyringLibrary.class, options);
    7373            } catch (UnsatisfiedLinkError x) {
    7474                // #203735: on Oneiric, may have trouble finding right lib.
     
    7676                // Unclear if this workaround is still needed for Oneiric with 3.4, but seems harmless to leave it in for now.
    7777                if (new File(EXPLICIT_ONEIRIC).isFile()) {
    78                     return Native.loadLibrary(EXPLICIT_ONEIRIC, GnomeKeyringLibrary.class, options);
     78                    return Native.load(EXPLICIT_ONEIRIC, GnomeKeyringLibrary.class, options);
    7979                } else {
    8080                    throw x;
     
    8585    }
    8686
    87     GnomeKeyringLibrary LIBRARY = (GnomeKeyringLibrary) LibFinder.load(Collections.singletonMap(OPTION_TYPE_MAPPER, new DefaultTypeMapper() {
     87    GnomeKeyringLibrary LIBRARY = LibFinder.load(Collections.singletonMap(OPTION_TYPE_MAPPER, new DefaultTypeMapper() {
    8888        {
    8989            addTypeConverter(Boolean.TYPE, new TypeConverter() { // #198921
     
    107107
    108108    // GnomeKeyringAttributeList gnome_keyring_attribute_list_new() = g_array_new(FALSE, FALSE, sizeof(GnomeKeyringAttribute))
    109     int GnomeKeyringAttribute_SIZE = Pointer.SIZE * 3; // conservatively: 2 pointers + 1 enum
     109    int GnomeKeyringAttribute_SIZE = Native.POINTER_SIZE * 3; // conservatively: 2 pointers + 1 enum
    110110
    111111    void gnome_keyring_attribute_list_append_string(
     
    146146        @Override
    147147        protected List<String> getFieldOrder() {
    148             return Arrays.asList( new String[] {
     148            return Arrays.asList(
    149149                "keyring",
    150150                "item_id",
    151151                "attributes",
    152                 "secret",
    153             } );
     152                "secret"
     153            );
    154154        }
    155155    }
Note: See TracChangeset for help on using the changeset viewer.