MCPcopy Index your code
hub / github.com/java-native-access/jna / cacheOptions

Method cacheOptions

src/com/sun/jna/Native.java:2079–2101  ·  view source on GitHub ↗
(Class<?> cls, Map<String, ?> options, Object proxy)

Source from the content-addressed store, hash-verified

2077 * looking them up later.
2078 */
2079 private static Map<String, Object> cacheOptions(Class<?> cls, Map<String, ?> options, Object proxy) {
2080 Map<String, Object> libOptions = new HashMap<>(options);
2081 libOptions.put(_OPTION_ENCLOSING_LIBRARY, cls);
2082 typeOptions.put(cls, libOptions);
2083 if (proxy != null) {
2084 libraries.put(cls, new WeakReference<>(proxy));
2085 }
2086
2087 // If it's a direct mapping, AND implements a Library interface,
2088 // cache the library interface as well, so that any nested
2089 // classes get the appropriate associated options
2090 if (!cls.isInterface()
2091 && Library.class.isAssignableFrom(cls)) {
2092 Class<?> ifaces[] = cls.getInterfaces();
2093 for (Class<?> ifc : ifaces) {
2094 if (Library.class.isAssignableFrom(ifc)) {
2095 cacheOptions(ifc, libOptions, proxy);
2096 break;
2097 }
2098 }
2099 }
2100 return libOptions;
2101 }
2102
2103 private static native long registerMethod(Class<?> cls,
2104 String name,

Callers 4

loadMethod · 0.95
loadLibraryMethod · 0.95
getLibraryOptionsMethod · 0.95
registerMethod · 0.95

Calls 1

putMethod · 0.80

Tested by

no test coverage detected