[ref: 8889] Annotation processor support for Java > 11

This commit is contained in:
andreaTP 2022-01-03 18:22:23 +00:00 committed by Hynek Mlnařík
parent b12830ae4f
commit 4817e152e3

View file

@ -26,6 +26,7 @@ import javax.lang.model.element.Modifier;
import javax.lang.model.element.Name;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.NoType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.lang.model.util.Types;
@ -119,7 +120,7 @@ public abstract class AbstractGenerateEntityImplementationsProcessor extends Abs
protected Map<String, HashSet<ExecutableElement>> methodsPerAttributeMapping(TypeElement e) {
Map<String, HashSet<ExecutableElement>> methodsPerAttribute = getAllAbstractMethods(e)
.filter(Util::isNotIgnored)
.filter(ee -> ! (ee.getReceiverType() instanceof NoType))
.filter(ee -> !(ee.getReceiverType() instanceof NoType && ee.getReceiverType().getKind() != TypeKind.NONE))
.collect(Collectors.toMap(this::determineAttributeFromMethodName, v -> new HashSet<>(Arrays.asList(v)), (a,b) -> { a.addAll(b); return a; }));
// Merge plurals with singulars