Skip to content
This repository was archived by the owner on Jan 27, 2021. It is now read-only.
Open
Show file tree
Hide file tree
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 @@ -39,19 +39,9 @@
*/
package com.sun.jersey.spi.scanning;

import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

import com.sun.jersey.core.osgi.OsgiRegistry;
import com.sun.jersey.core.reflection.ReflectionHelper;
import com.sun.jersey.core.spi.scanning.ScannerListener;
import java.security.AccessController;
import java.security.PrivilegedActionException;

import jersey.repackaged.org.objectweb.asm.AnnotationVisitor;
import jersey.repackaged.org.objectweb.asm.Attribute;
import jersey.repackaged.org.objectweb.asm.ClassReader;
Expand All @@ -60,6 +50,15 @@
import jersey.repackaged.org.objectweb.asm.MethodVisitor;
import jersey.repackaged.org.objectweb.asm.Opcodes;

import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Set;

/**
* A scanner listener that processes Java class files (resource names
* ending in ".class") annotated with one or more of a set of declared
Expand Down Expand Up @@ -156,7 +155,7 @@ private final class AnnotatedClassVisitor extends ClassVisitor {
private boolean isAnnotated;

private AnnotatedClassVisitor() {
super(Opcodes.ASM5);
super(Opcodes.ASM6);
}

public void visit(int version, int access, String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
* A visitor to visit a Java annotation. The methods of this class must be
* called in the following order: ( <tt>visit</tt> | <tt>visitEnum</tt> |
* <tt>visitAnnotation</tt> | <tt>visitArray</tt> )* <tt>visitEnd</tt>.
*
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public abstract class AnnotationVisitor {

/**
* The ASM API version implemented by this visitor. The value of this field
* must be one of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
* must be one of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
*/
protected final int api;

Expand All @@ -53,27 +53,27 @@ public abstract class AnnotationVisitor {

/**
* Constructs a new {@link AnnotationVisitor}.
*
*
* @param api
* the ASM API version implemented by this visitor. Must be one
* of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
* of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
*/
public AnnotationVisitor(final int api) {
this(api, null);
}

/**
* Constructs a new {@link AnnotationVisitor}.
*
*
* @param api
* the ASM API version implemented by this visitor. Must be one
* of {@link Opcodes#ASM4} or {@link Opcodes#ASM5}.
* of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}.
* @param av
* the annotation visitor to which this visitor must delegate
* method calls. May be null.
*/
public AnnotationVisitor(final int api, final AnnotationVisitor av) {
if (api != Opcodes.ASM4 && api != Opcodes.ASM5) {
if (api < Opcodes.ASM4 || api > Opcodes.ASM6) {
throw new IllegalArgumentException();
}
this.api = api;
Expand All @@ -82,14 +82,14 @@ public AnnotationVisitor(final int api, final AnnotationVisitor av) {

/**
* Visits a primitive value of the annotation.
*
*
* @param name
* the value name.
* @param value
* the actual value, whose type must be {@link Byte},
* {@link Boolean}, {@link Character}, {@link Short},
* {@link Integer} , {@link Long}, {@link Float}, {@link Double},
* {@link String} or {@link Type} or OBJECT or ARRAY sort. This
* {@link String} or {@link Type} of OBJECT or ARRAY sort. This
* value can also be an array of byte, boolean, short, char, int,
* long, float or double values (this is equivalent to using
* {@link #visitArray visitArray} and visiting each array element
Expand All @@ -103,7 +103,7 @@ public void visit(String name, Object value) {

/**
* Visits an enumeration value of the annotation.
*
*
* @param name
* the value name.
* @param desc
Expand All @@ -119,7 +119,7 @@ public void visitEnum(String name, String desc, String value) {

/**
* Visits a nested annotation value of the annotation.
*
*
* @param name
* the value name.
* @param desc
Expand All @@ -142,7 +142,7 @@ public AnnotationVisitor visitAnnotation(String name, String desc) {
* types (such as byte, boolean, short, char, int, long, float or double)
* can be passed as value to {@link #visit visit}. This is what
* {@link ClassReader} does.
*
*
* @param name
* the value name.
* @return a visitor to visit the actual array value elements, or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/**
* An {@link AnnotationVisitor} that generates annotations in bytecode form.
*
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
Expand Down Expand Up @@ -89,7 +89,7 @@ final class AnnotationWriter extends AnnotationVisitor {

/**
* Constructs a new {@link AnnotationWriter}.
*
*
* @param cw
* the class writer to which this annotation must be added.
* @param named
Expand All @@ -104,7 +104,7 @@ final class AnnotationWriter extends AnnotationVisitor {
*/
AnnotationWriter(final ClassWriter cw, final boolean named,
final ByteVector bv, final ByteVector parent, final int offset) {
super(Opcodes.ASM5);
super(Opcodes.ASM6);
this.cw = cw;
this.named = named;
this.bv = bv;
Expand Down Expand Up @@ -237,7 +237,7 @@ public void visitEnd() {

/**
* Returns the size of this annotation writer list.
*
*
* @return the size of this annotation writer list.
*/
int getSize() {
Expand All @@ -253,7 +253,7 @@ int getSize() {
/**
* Puts the annotations of this annotation writer list into the given byte
* vector.
*
*
* @param out
* where the annotations must be put.
*/
Expand Down Expand Up @@ -281,7 +281,7 @@ void put(final ByteVector out) {

/**
* Puts the given annotation lists into the given byte vector.
*
*
* @param panns
* an array of annotation writer lists.
* @param off
Expand Down Expand Up @@ -319,7 +319,7 @@ static void put(final AnnotationWriter[] panns, final int off,
/**
* Puts the given type reference and type path into the given bytevector.
* LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported.
*
*
* @param typeRef
* a reference to the annotated type. See {@link TypeReference}.
* @param typePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

/**
* A non standard class, field, method or code attribute.
*
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
Expand All @@ -54,7 +54,7 @@ public class Attribute {

/**
* Constructs a new empty attribute.
*
*
* @param type
* the type of the attribute.
*/
Expand All @@ -65,7 +65,7 @@ protected Attribute(final String type) {
/**
* Returns <tt>true</tt> if this type of attribute is unknown. The default
* implementation of this method always returns <tt>true</tt>.
*
*
* @return <tt>true</tt> if this type of attribute is unknown.
*/
public boolean isUnknown() {
Expand All @@ -74,7 +74,7 @@ public boolean isUnknown() {

/**
* Returns <tt>true</tt> if this type of attribute is a code attribute.
*
*
* @return <tt>true</tt> if this type of attribute is a code attribute.
*/
public boolean isCodeAttribute() {
Expand All @@ -83,7 +83,7 @@ public boolean isCodeAttribute() {

/**
* Returns the labels corresponding to this attribute.
*
*
* @return the labels corresponding to this attribute, or <tt>null</tt> if
* this attribute is not a code attribute that contains labels.
*/
Expand All @@ -96,7 +96,7 @@ protected Label[] getLabels() {
* <i>new</i> {@link Attribute} object, of type {@link #type type},
* corresponding to the <tt>len</tt> bytes starting at the given offset, in
* the given class reader.
*
*
* @param cr
* the class that contains the attribute to be read.
* @param off
Expand Down Expand Up @@ -133,7 +133,7 @@ protected Attribute read(final ClassReader cr, final int off,

/**
* Returns the byte array form of this attribute.
*
*
* @param cw
* the class to which this attribute must be added. This
* parameter can be used to add to the constant pool of this
Expand Down Expand Up @@ -166,7 +166,7 @@ protected ByteVector write(final ClassWriter cw, final byte[] code,

/**
* Returns the length of the attribute list that begins with this attribute.
*
*
* @return the length of the attribute list that begins with this attribute.
*/
final int getCount() {
Expand All @@ -181,7 +181,7 @@ final int getCount() {

/**
* Returns the size of all the attributes in this attribute list.
*
*
* @param cw
* the class writer to be used to convert the attributes into
* byte arrays, with the {@link #write write} method.
Expand Down Expand Up @@ -219,7 +219,7 @@ final int getSize(final ClassWriter cw, final byte[] code, final int len,
/**
* Writes all the attributes of this attribute list in the given byte
* vector.
*
*
* @param cw
* the class writer to be used to convert the attributes into
* byte arrays, with the {@link #write write} method.
Expand Down
Loading