/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }
/** * Helper method for {@link #getAnnotations} which just gets the * existing annotations, per se. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code non-null;} the set of annotations, which may be empty */ private static Annotations getAnnotations0(AttributeList attribs) { AttRuntimeVisibleAnnotations visible = (AttRuntimeVisibleAnnotations) attribs.findFirst(AttRuntimeVisibleAnnotations.ATTRIBUTE_NAME); AttRuntimeInvisibleAnnotations invisible = (AttRuntimeInvisibleAnnotations) attribs.findFirst(AttRuntimeInvisibleAnnotations.ATTRIBUTE_NAME); if (visible == null) { if (invisible == null) { return Annotations.EMPTY; } return invisible.getAnnotations(); } if (invisible == null) { return visible.getAnnotations(); } // Both are non-null, so combine them. return Annotations.combine(visible.getAnnotations(), invisible.getAnnotations()); }
/** * Parses a {@code RuntimeInvisibleAnnotations} attribute. */ private Attribute runtimeInvisibleAnnotations(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length < 2) { throwSeverelyTruncated(); } AnnotationParser ap = new AnnotationParser(cf, offset, length, observer); Annotations annotations = ap.parseAnnotationAttribute(AnnotationVisibility.BUILD); return new AttRuntimeInvisibleAnnotations(annotations, length); }