Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import liquidjava.diagnostics.errors.*;
Expand Down Expand Up @@ -89,11 +90,13 @@ public Optional<Predicate> getRefinementFromAnnotation(CtElement element) throws
return constr;
}

@SuppressWarnings({ "rawtypes" })
public Optional<String> getMessageFromAnnotation(CtElement element) {
for (CtAnnotation<? extends Annotation> ann : element.getAnnotations()) {
String an = ann.getActualAnnotation().annotationType().getCanonicalName();
if (an.contentEquals("liquidjava.specification.Refinement")) {
String msg = getStringFromAnnotation(ann.getValue("msg"));
Map<String, CtExpression> values = ann.getAllValues();
String msg = getStringFromAnnotation((values.get("msg")));
if (msg != null && !msg.isEmpty()) {
return Optional.of(msg);
}
Expand Down