Commit 57b6bb98 authored by pcregut's avatar pcregut

The old way, we get a multiset of AnnotationSetRefList that we commit to the...

The old way, we get a multiset of AnnotationSetRefList that we commit to the output. But in fact some are repeated and we should get only one per item. This is a solution. Another is to remove the notion of structural equality. - Bug #316394 - modified version of Vipin Aravind patch
parent 7862594f
......@@ -538,21 +538,19 @@ public class ApplicationWriter extends ApplicationVisitor {
* content, because we don't know the offsets of the annotation_set_items yet.
*/
private void prepareAnnotationSetRefLists() {
for (Method method : constantPool.getMethods()) {
if (method.getNbParameterAnnotations() > 0) {
out.addPadding();
if (annotationSetRefListOffset == 0) {
annotationSetRefListOffset = out.getLength();
}
// Sets the offset.
constantPool.setAnnotationSetRefListOffset(method.getAnnotatedParameterSetRefList(), out.getLength());
// Writes fake data.
out.putInt(0); // Fake size.
for (int i = 0, size = method.getAnnotatedParameterSetRefList().getNbAnnotationSetItem(); i < size; i++) {
out.putInt(0); // Fake annotations_off.
}
}
for (AnnotationSetRefList annotationSetRefList : constantPool.getAnnotationSetRefLists()) {
out.addPadding();
if (annotationSetRefListOffset == 0) {
annotationSetRefListOffset = out.getLength();
}
// Sets the offset.
constantPool.setAnnotationSetRefListOffset(annotationSetRefList, out.getLength());
// Writes fake data.
out.putInt(0); // Fake size.
for (int i = 0, size = annotationSetRefList.getNbAnnotationSetItem(); i < size; i++) {
out.putInt(0); // Fake annotations_off.
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment