private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) { TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { Element element = getMessageElement(); if (element != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError.asType()); if (mirror != null) { List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); if (values == null) { values = Collections.emptyList(); } if (values.size() != msgs.size()) { log.message(Kind.ERROR, element, mirror, ElementUtils.getAnnotationValue(mirror, "value"), String.format("Error count expected %s but was %s.", values.size(), msgs.size())); } } } } }
private void verifyExpectedMessages(ProcessorContext context, Log log, List<Message> msgs) { TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { Element element = getMessageElement(); if (element != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(element.getAnnotationMirrors(), expectError.asType()); if (mirror != null) { List<String> values = ElementUtils.getAnnotationValueList(String.class, mirror, "value"); if (values == null) { values = Collections.emptyList(); } if (values.size() != msgs.size()) { log.message(Kind.ERROR, element, mirror, ElementUtils.getAnnotationValue(mirror, "value"), String.format("Error count expected %s but was %s.", values.size(), msgs.size())); } } } } }
TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(messageElement.getAnnotationMirrors(), expectError.asType());
TypeElement expectError = context.getTruffleTypes().getExpectError(); if (expectError != null) { AnnotationMirror mirror = ElementUtils.findAnnotationMirror(messageElement.getAnnotationMirrors(), expectError.asType());