/** * Determine whether the given type contributes to the conflict caused by the given default interface implementation. */ private boolean contributesToConflict(JvmGenericType rootType, ConflictingDefaultOperation conflictingDefaultOperation) { Set<JvmDeclaredType> involvedInterfaces = Sets.newHashSet(); involvedInterfaces.add(conflictingDefaultOperation.getDeclaration().getDeclaringType()); for (IResolvedOperation conflictingOperation : conflictingDefaultOperation.getConflictingOperations()) { involvedInterfaces.add(conflictingOperation.getDeclaration().getDeclaringType()); } RecursionGuard<JvmDeclaredType> recursionGuard = new RecursionGuard<JvmDeclaredType>(); if (rootType.isInterface()) { int contributingCount = 0; for (JvmTypeReference typeRef : rootType.getExtendedInterfaces()) { JvmType rawType = typeRef.getType(); if (rawType instanceof JvmDeclaredType && contributesToConflict((JvmDeclaredType) rawType, involvedInterfaces, recursionGuard)) { contributingCount++; } } return contributingCount >= 2; } else { return contributesToConflict(rootType, involvedInterfaces, recursionGuard); } }
public void registerAllTypes(final JvmType type, final Function1<? super String, ? extends Boolean> acceptor) { if (((type == null) || type.eIsProxy())) { return; } if (((!this.isLocal(type)) && (acceptor.apply(type.getIdentifier())).booleanValue())) { boolean _matched = false; if (type instanceof JvmGenericType) { _matched=true; this.registerAllTypes(((JvmGenericType)type).getDeclaringType(), acceptor); JvmTypeReference _extendedClass = null; if (((JvmGenericType)type)!=null) { _extendedClass=((JvmGenericType)type).getExtendedClass(); } JvmType _type = null; if (_extendedClass!=null) { _type=_extendedClass.getType(); } this.registerAllTypes(_type, acceptor); final Consumer<JvmTypeReference> _function = (JvmTypeReference it) -> { JvmType _type_1 = null; if (it!=null) { _type_1=it.getType(); } this.registerAllTypes(_type_1, acceptor); }; ((JvmGenericType)type).getExtendedInterfaces().forEach(_function); } } }
innerType.getTypeParameters().add(typeParameter); final Iterator<JvmTypeReference> extendedTypeIterator = inferredJvmType.getExtendedInterfaces().iterator(); if (extendedTypeIterator.hasNext()) { final JvmTypeReference extendedType = extendedTypeIterator.next(); for (final JvmGenericType sourceType : Iterables.concat( Collections.singletonList(inferredJvmType), Iterables.transform(Iterables.skip(inferredJvmType.getExtendedInterfaces(), 1), it -> { return (JvmGenericType) it.getType(); }))) {