View | Details | Raw Unified | Return to bug 262304 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/codegen/ConstantPool.java (+7 lines)
Lines 999-1002 Link Here
999
    this.currentIndex = 1;
999
    this.currentIndex = 1;
1000
    this.currentOffset = 0;
1000
    this.currentOffset = 0;
1001
}
1001
}
1002
public void resetForAttributeName(char[] attributeName, int constantPoolIndex, int constantPoolOffset) {
1003
	this.currentIndex = constantPoolIndex;
1004
	this.currentOffset = constantPoolOffset;
1005
	if (this.UTF8Cache.get(attributeName) >= constantPoolIndex) {
1006
		this.UTF8Cache.remove(attributeName);
1007
	}
1008
}
1002
}
1009
}
(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (+7 lines)
Lines 6507-6512 Link Here
6507
		}
6507
		}
6508
6508
6509
		int annotationAttributeOffset = this.contentsOffset;
6509
		int annotationAttributeOffset = this.contentsOffset;
6510
		int constantPOffset = this.constantPool.currentOffset;
6511
		int constantPoolIndex = this.constantPool.currentIndex;
6510
		if (invisibleAnnotationsCounter != 0) {
6512
		if (invisibleAnnotationsCounter != 0) {
6511
			if (this.contentsOffset + 10 >= this.contents.length) {
6513
			if (this.contentsOffset + 10 >= this.contents.length) {
6512
				resizeContents(10);
6514
				resizeContents(10);
Lines 6546-6555 Link Here
6546
				attributesNumber++;
6548
				attributesNumber++;
6547
			} else {
6549
			} else {
6548
				this.contentsOffset = annotationAttributeOffset;
6550
				this.contentsOffset = annotationAttributeOffset;
6551
				// reset the constant pool to its state before the clinit
6552
				this.constantPool.resetForAttributeName(AttributeNamesConstants.RuntimeInvisibleAnnotationsName, constantPoolIndex, constantPOffset);
6549
			}
6553
			}
6550
		}
6554
		}
6551
6555
6552
		annotationAttributeOffset = this.contentsOffset;
6556
		annotationAttributeOffset = this.contentsOffset;
6557
		constantPOffset = this.constantPool.currentOffset;
6558
		constantPoolIndex = this.constantPool.currentIndex;
6553
		if (visibleAnnotationsCounter != 0) {
6559
		if (visibleAnnotationsCounter != 0) {
6554
			if (this.contentsOffset + 10 >= this.contents.length) {
6560
			if (this.contentsOffset + 10 >= this.contents.length) {
6555
				resizeContents(10);
6561
				resizeContents(10);
Lines 6589-6594 Link Here
6589
				attributesNumber++;
6595
				attributesNumber++;
6590
			} else {
6596
			} else {
6591
				this.contentsOffset = annotationAttributeOffset;
6597
				this.contentsOffset = annotationAttributeOffset;
6598
				this.constantPool.resetForAttributeName(AttributeNamesConstants.RuntimeVisibleAnnotationsName, constantPoolIndex, constantPOffset);
6592
			}
6599
			}
6593
		}
6600
		}
6594
		return attributesNumber;
6601
		return attributesNumber;

Return to bug 262304