MCPcopy Create free account
hub / github.com/java-native-access/jna / defaultArg

Method defaultArg

test/com/sun/jna/PointerTest.java:195–206  ·  view source on GitHub ↗
(Class<?> type)

Source from the content-addressed store, hash-verified

193 }
194
195 private Object defaultArg(Class<?> type) {
196 if (type == boolean.class || type == Boolean.class) return Boolean.FALSE;
197 if (type == byte.class || type == Byte.class) return Byte.valueOf((byte)0);
198 if (type == char.class || type == Character.class) return Character.valueOf((char)0);
199 if (type == short.class || type == Short.class) return Short.valueOf((short)0);
200 if (type == int.class || type == Integer.class) return Integer.valueOf(0);
201 if (type == long.class || type == Long.class) return Long.valueOf(0L);
202 if (type == float.class || type == Float.class) return Float.valueOf(0);
203 if (type == double.class || type == Double.class) return Double.valueOf(0);
204 if (type == NativeLong.class) return new NativeLong(0);
205 return null;
206 }
207
208 public void testOpaquePointer() throws Exception {
209 Pointer p = Pointer.createConstant(0);

Callers 1

testOpaquePointerMethod · 0.95

Calls 1

valueOfMethod · 0.80

Tested by

no test coverage detected