Skip to content

Commit f9053e5

Browse files
committed
Updated asm to 4.1.
Released 2012-10-14. One of the listed features is 316321: asm osgi bundles based on BND. in case that's interesting to someone.
1 parent 889cead commit f9053e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7406
-7421
lines changed

src/asm/scala/tools/asm/AnnotationVisitor.java

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ public abstract class AnnotationVisitor {
5454
/**
5555
* Constructs a new {@link AnnotationVisitor}.
5656
*
57-
* @param api the ASM API version implemented by this visitor. Must be one
58-
* of {@link Opcodes#ASM4}.
57+
* @param api
58+
* the ASM API version implemented by this visitor. Must be one
59+
* of {@link Opcodes#ASM4}.
5960
*/
6061
public AnnotationVisitor(final int api) {
6162
this(api, null);
@@ -64,30 +65,35 @@ public AnnotationVisitor(final int api) {
6465
/**
6566
* Constructs a new {@link AnnotationVisitor}.
6667
*
67-
* @param api the ASM API version implemented by this visitor. Must be one
68-
* of {@link Opcodes#ASM4}.
69-
* @param av the annotation visitor to which this visitor must delegate
70-
* method calls. May be null.
68+
* @param api
69+
* the ASM API version implemented by this visitor. Must be one
70+
* of {@link Opcodes#ASM4}.
71+
* @param av
72+
* the annotation visitor to which this visitor must delegate
73+
* method calls. May be null.
7174
*/
7275
public AnnotationVisitor(final int api, final AnnotationVisitor av) {
73-
/*if (api != Opcodes.ASM4) {
76+
if (api != Opcodes.ASM4) {
7477
throw new IllegalArgumentException();
75-
}*/
78+
}
7679
this.api = api;
7780
this.av = av;
7881
}
7982

8083
/**
8184
* Visits a primitive value of the annotation.
8285
*
83-
* @param name the value name.
84-
* @param value the actual value, whose type must be {@link Byte},
85-
* {@link Boolean}, {@link Character}, {@link Short}, {@link Integer}
86-
* , {@link Long}, {@link Float}, {@link Double}, {@link String} or
87-
* {@link Type} or OBJECT or ARRAY sort. This value can also be an
88-
* array of byte, boolean, short, char, int, long, float or double
89-
* values (this is equivalent to using {@link #visitArray visitArray}
90-
* and visiting each array element in turn, but is more convenient).
86+
* @param name
87+
* the value name.
88+
* @param value
89+
* the actual value, whose type must be {@link Byte},
90+
* {@link Boolean}, {@link Character}, {@link Short},
91+
* {@link Integer} , {@link Long}, {@link Float}, {@link Double},
92+
* {@link String} or {@link Type} or OBJECT or ARRAY sort. This
93+
* value can also be an array of byte, boolean, short, char, int,
94+
* long, float or double values (this is equivalent to using
95+
* {@link #visitArray visitArray} and visiting each array element
96+
* in turn, but is more convenient).
9197
*/
9298
public void visit(String name, Object value) {
9399
if (av != null) {
@@ -98,9 +104,12 @@ public void visit(String name, Object value) {
98104
/**
99105
* Visits an enumeration value of the annotation.
100106
*
101-
* @param name the value name.
102-
* @param desc the class descriptor of the enumeration class.
103-
* @param value the actual enumeration value.
107+
* @param name
108+
* the value name.
109+
* @param desc
110+
* the class descriptor of the enumeration class.
111+
* @param value
112+
* the actual enumeration value.
104113
*/
105114
public void visitEnum(String name, String desc, String value) {
106115
if (av != null) {
@@ -111,12 +120,14 @@ public void visitEnum(String name, String desc, String value) {
111120
/**
112121
* Visits a nested annotation value of the annotation.
113122
*
114-
* @param name the value name.
115-
* @param desc the class descriptor of the nested annotation class.
123+
* @param name
124+
* the value name.
125+
* @param desc
126+
* the class descriptor of the nested annotation class.
116127
* @return a visitor to visit the actual nested annotation value, or
117-
* <tt>null</tt> if this visitor is not interested in visiting
118-
* this nested annotation. <i>The nested annotation value must be
119-
* fully visited before calling other methods on this annotation
128+
* <tt>null</tt> if this visitor is not interested in visiting this
129+
* nested annotation. <i>The nested annotation value must be fully
130+
* visited before calling other methods on this annotation
120131
* visitor</i>.
121132
*/
122133
public AnnotationVisitor visitAnnotation(String name, String desc) {
@@ -132,10 +143,11 @@ public AnnotationVisitor visitAnnotation(String name, String desc) {
132143
* can be passed as value to {@link #visit visit}. This is what
133144
* {@link ClassReader} does.
134145
*
135-
* @param name the value name.
146+
* @param name
147+
* the value name.
136148
* @return a visitor to visit the actual array value elements, or
137-
* <tt>null</tt> if this visitor is not interested in visiting
138-
* these values. The 'name' parameters passed to the methods of this
149+
* <tt>null</tt> if this visitor is not interested in visiting these
150+
* values. The 'name' parameters passed to the methods of this
139151
* visitor are ignored. <i>All the array values must be visited
140152
* before calling other methods on this annotation visitor</i>.
141153
*/

src/asm/scala/tools/asm/AnnotationWriter.java

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,20 @@ final class AnnotationWriter extends AnnotationVisitor {
9090
/**
9191
* Constructs a new {@link AnnotationWriter}.
9292
*
93-
* @param cw the class writer to which this annotation must be added.
94-
* @param named <tt>true<tt> if values are named, <tt>false</tt> otherwise.
95-
* @param bv where the annotation values must be stored.
96-
* @param parent where the number of annotation values must be stored.
97-
* @param offset where in <tt>parent</tt> the number of annotation values must
98-
* be stored.
93+
* @param cw
94+
* the class writer to which this annotation must be added.
95+
* @param named
96+
* <tt>true<tt> if values are named, <tt>false</tt> otherwise.
97+
* @param bv
98+
* where the annotation values must be stored.
99+
* @param parent
100+
* where the number of annotation values must be stored.
101+
* @param offset
102+
* where in <tt>parent</tt> the number of annotation values must
103+
* be stored.
99104
*/
100-
AnnotationWriter(
101-
final ClassWriter cw,
102-
final boolean named,
103-
final ByteVector bv,
104-
final ByteVector parent,
105-
final int offset)
106-
{
105+
AnnotationWriter(final ClassWriter cw, final boolean named,
106+
final ByteVector bv, final ByteVector parent, final int offset) {
107107
super(Opcodes.ASM4);
108108
this.cw = cw;
109109
this.named = named;
@@ -190,11 +190,8 @@ public void visit(final String name, final Object value) {
190190
}
191191

192192
@Override
193-
public void visitEnum(
194-
final String name,
195-
final String desc,
196-
final String value)
197-
{
193+
public void visitEnum(final String name, final String desc,
194+
final String value) {
198195
++size;
199196
if (named) {
200197
bv.putShort(cw.newUTF8(name));
@@ -203,10 +200,8 @@ public void visitEnum(
203200
}
204201

205202
@Override
206-
public AnnotationVisitor visitAnnotation(
207-
final String name,
208-
final String desc)
209-
{
203+
public AnnotationVisitor visitAnnotation(final String name,
204+
final String desc) {
210205
++size;
211206
if (named) {
212207
bv.putShort(cw.newUTF8(name));
@@ -259,7 +254,8 @@ int getSize() {
259254
* Puts the annotations of this annotation writer list into the given byte
260255
* vector.
261256
*
262-
* @param out where the annotations must be put.
257+
* @param out
258+
* where the annotations must be put.
263259
*/
264260
void put(final ByteVector out) {
265261
int n = 0;
@@ -286,15 +282,15 @@ void put(final ByteVector out) {
286282
/**
287283
* Puts the given annotation lists into the given byte vector.
288284
*
289-
* @param panns an array of annotation writer lists.
290-
* @param off index of the first annotation to be written.
291-
* @param out where the annotations must be put.
285+
* @param panns
286+
* an array of annotation writer lists.
287+
* @param off
288+
* index of the first annotation to be written.
289+
* @param out
290+
* where the annotations must be put.
292291
*/
293-
static void put(
294-
final AnnotationWriter[] panns,
295-
final int off,
296-
final ByteVector out)
297-
{
292+
static void put(final AnnotationWriter[] panns, final int off,
293+
final ByteVector out) {
298294
int size = 1 + 2 * (panns.length - off);
299295
for (int i = off; i < panns.length; ++i) {
300296
size += panns[i] == null ? 0 : panns[i].getSize();

0 commit comments

Comments
 (0)