@Override boolean isDefaultMethod(Method method) { return method.isDefault(); }
@Override boolean isDefaultMethod(Method method) { return method.isDefault(); }
@IgnoreJRERequirement // Guarded by API check. @Override boolean isDefaultMethod(Method method) { if (Build.VERSION.SDK_INT < 24) { return false; } return method.isDefault(); }
public boolean isDefaultMethod(Method method) { return method.isDefault(); }
/** * Checks whether the given method is a query method candidate. * * @param method * @return */ private boolean isQueryMethodCandidate(Method method) { return !method.isBridge() && !method.isDefault(); }
@IgnoreJRERequirement // Guarded by API check. @Override boolean isDefaultMethod(Method method) { if (Build.VERSION.SDK_INT < 24) { return false; } return method.isDefault(); }
/** * Returns a Multimap from fieldName Strings to their getter Methods. * * It expects to be called only from TaskSerDe. Multimap is used inside org.embulk.config. */ static Multimap<String, Method> fieldGetters(Class<?> iface) { ImmutableMultimap.Builder<String, Method> builder = ImmutableMultimap.builder(); for (Method method : iface.getMethods()) { String methodName = method.getName(); String fieldName = getterFieldNameOrNull(methodName); if (fieldName != null && hasExpectedArgumentLength(method, 0) && (!method.isDefault() || method.getAnnotation(Config.class) != null)) { // If the method has default implementation, and @Config is not annotated there, the method is kept. builder.put(fieldName, method); } } return builder.build(); }
if(tmp != null) { for(Method mm: tmp) if(mm.isDefault()) methods.add(mm);
if (method.isDefault() && !method.isSynthetic()) { throw new IllegalStateException(String.format( "Default method %s.%s has @%s annotation. "
/** * Test if this method should be skipped in our check for proper forwarding, e.g. because it is just a bridge. */ private static boolean checkSkipMethodForwardCheck(Method delegateMethod, Set<Method> skipMethods) { if (delegateMethod.isBridge() || delegateMethod.isDefault() || skipMethods.contains(delegateMethod)) { return true; } // skip methods declared in Object (Mockito doesn't like them) try { Object.class.getMethod(delegateMethod.getName(), delegateMethod.getParameterTypes()); return true; } catch (Exception ignore) { } return false; } }
@Override public String serializedClass(final Class type) { Class<?> replacement = null; if (Types.isLambdaType(type)) { if (Serializable.class.isAssignableFrom(type)) { final Class<?>[] interfaces = type.getInterfaces(); if (interfaces.length > 1) { for (int i = 0; replacement == null && i < interfaces.length; i++) { final Class<?> iface = interfaces[i]; for (final Method method : iface.getMethods()) { if (!method.isDefault() && !Modifier.isStatic(method.getModifiers())) { replacement = iface; break; } } } } else { replacement = interfaces[0]; } } else { replacement = Null.class; } } return super.serializedClass(replacement == null ? type : replacement); } }
@Override public Optional<Handler> buildHandler(Class<?> sqlObjectType, Method method) { if (!method.isDefault()) { return Optional.empty();
/** * Lookup a {@link MethodHandle} for a default {@link Method}. * * @param method must be a {@link Method#isDefault() default} {@link Method}. * @return the {@link MethodHandle}. */ public static MethodHandle lookupMethodHandle(Method method) throws ReflectiveOperationException { LettuceAssert.notNull(method, "Method must not be null"); LettuceAssert.isTrue(method.isDefault(), "Method is not a default method"); return methodHandleLookup.lookup(method); }
if (method.isDefault()) {
void write() { int accessModifiers = iClass.getModifiers() & (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE); visit( V1_5, accessModifiers | ACC_SUPER | ACC_FINAL, reflectorType.getInternalName(), null, OBJECT_TYPE.getInternalName(), new String[] {iType.getInternalName()}); writeTargetField(); writeConstructor(); for (Method method : iClass.getMethods()) { if (method.isDefault()) continue; Accessor accessor = method.getAnnotation(Accessor.class); if (accessor != null) { new AccessorMethodWriter(method, accessor).write(); } else { new ReflectorMethodWriter(method).write(); } } visitEnd(); }
if (method.isDefault()) { return methodHandleCache.computeIfAbsent(method, ClusterFutureSyncInvocationHandler::lookupDefaultMethod) .bindTo(proxy).invokeWithArguments(args);
@Override public Object invoke(MethodInvocation invocation) throws Throwable { Method method = invocation.getMethod(); if (!method.isDefault()) { return invocation.proceed(); } LettuceAssert.isTrue(invocation instanceof InvocationTargetProvider, "Invocation must provide a target object via InvocationTargetProvider"); InvocationTargetProvider targetProvider = (InvocationTargetProvider) invocation; return methodHandleCache.computeIfAbsent(method, DefaultMethodInvokingInterceptor::lookupMethodHandle) .bindTo(targetProvider.getInvocationTarget()).invokeWithArguments(invocation.getArguments()); }
if (!method.isDefault() && !method.isBridge() && !method.isSynthetic()) { api.put(category, " -- " + Arrays.toString(method.getParameterTypes()) + " (PARAMETERS)"); api.put(category, " -- " + Arrays.toString(method.getExceptionTypes()) + " (EXCEPTIONS)"); } else if (method.isDefault() && apiClass.isInterface()) { api.put(category, " - " + method.getName() + " (DEFAULT METHOD)"); api.put(category, " -- " + method.getReturnType() + " (RETURN)");
if (!method.isDefault())