@CheckForNull private static List<SymbolMetadata.AnnotationValue> valuesForGlobalAnnotation(JavaSymbol method, String annotation) { return Arrays.asList(method, method.enclosingClass(), method.packge()).stream() .map(symbol -> symbol.metadata().valuesForAnnotation(annotation)) .filter(Objects::nonNull) .findFirst() .orElse(null); }
@CheckForNull private static List<SymbolMetadata.AnnotationValue> valuesForGlobalAnnotation(JavaSymbol method, String annotation) { return Arrays.asList(method, method.enclosingClass(), method.packge()).stream() .map(symbol -> symbol.metadata().valuesForAnnotation(annotation)) .filter(Objects::nonNull) .findFirst() .orElse(null); }
private static boolean hasSuppressWarningAnnotation(TypeJavaSymbol symbol) { List<SymbolMetadata.AnnotationValue> annotations = symbol.metadata().valuesForAnnotation("java.lang.SuppressWarnings"); if (annotations != null) { for (SymbolMetadata.AnnotationValue annotationValue : annotations) { if ("serial".equals(stringLiteralValue(annotationValue.value()))) { return true; } } } return false; }
private static boolean hasSuppressWarningAnnotation(TypeJavaSymbol symbol) { List<SymbolMetadata.AnnotationValue> annotations = symbol.metadata().valuesForAnnotation("java.lang.SuppressWarnings"); if (annotations != null) { for (SymbolMetadata.AnnotationValue annotationValue : annotations) { if ("serial".equals(stringLiteralValue(annotationValue.value()))) { return true; } } } return false; }
private boolean hasSuppressWarningAnnotation(TypeJavaSymbol symbol) { List<SymbolMetadata.AnnotationValue> annotations = symbol.metadata().valuesForAnnotation("java.lang.SuppressWarnings"); if (annotations != null) { for (SymbolMetadata.AnnotationValue annotationValue : annotations) { if ("serial".equals(stringLiteralValue(annotationValue.value()))) { return true; } } } return false; }