aboutsummaryrefslogtreecommitdiffstats
path: root/weaver
diff options
context:
space:
mode:
authoraclement <aclement>2011-01-31 20:34:13 +0000
committeraclement <aclement>2011-01-31 20:34:13 +0000
commit0fb3c077c71da5a112c71ad44c62552fc725477e (patch)
tree650dc81685baf2c7df23606f69b1f26a7fcc5ee7 /weaver
parent0e41055181ef493d028281486bbd118db8697159 (diff)
downloadaspectj-0fb3c077c71da5a112c71ad44c62552fc725477e.tar.gz
aspectj-0fb3c077c71da5a112c71ad44c62552fc725477e.zip
335783
Diffstat (limited to 'weaver')
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java21
1 files changed, 15 insertions, 6 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
index bcbcabc83..4ca0d175a 100644
--- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -1041,7 +1041,8 @@ public final class LazyClassGen {
* Create a field in the type containing the shadow where the annotation retrieved during binding can be stored - for later fast
* access.
*
- * @param shadow the shadow at which the @annotation result is being cached
+ * @param shadow
+ * the shadow at which the @annotation result is being cached
* @return a field
*/
public Field getAnnotationCachingField(BcelShadow shadow, ResolvedType toType) {
@@ -1116,13 +1117,21 @@ public final class LazyClassGen {
}
if (serialVersionUIDRequiresInitialization) {
+ InstructionList[] ilSVUID = new InstructionList[1];
+ ilSVUID[0] = new InstructionList();
+ ilSVUID[0].append(InstructionFactory.PUSH(getConstantPool(), calculatedSerialVersionUID));
+ ilSVUID[0].append(getFactory().createFieldAccess(getClassName(), "serialVersionUID", BasicType.LONG,
+ Constants.PUTSTATIC));
if (il == null) {
- il = new InstructionList[1];
+ il = ilSVUID;
+ } else {
+ InstructionList[] newIl = new InstructionList[il.length + ilSVUID.length];
+ System.arraycopy(il, 0, newIl, 0, il.length);
+ System.arraycopy(ilSVUID, 0, newIl, il.length, ilSVUID.length);
+ il = newIl;
}
- il[0] = new InstructionList();
- il[0].append(InstructionFactory.PUSH(getConstantPool(), calculatedSerialVersionUID));
- il[0].append(getFactory().createFieldAccess(getClassName(), "serialVersionUID", BasicType.LONG, Constants.PUTSTATIC));
}
+
LazyMethodGen prevMethod;
LazyMethodGen nextMethod = null;
if (this.isInterface()) { // Cannot sneak stuff into another static method in an interface
@@ -1204,7 +1213,7 @@ public final class LazyClassGen {
list.append(InstructionFactory.PUSH(getConstantPool(), shadow.getKind().getName()));
// create the signature
- if ( world.isTargettingAspectJRuntime12() || !isFastSJPAvailable || !sig.getKind().equals(Member.METHOD)) {
+ if (world.isTargettingAspectJRuntime12() || !isFastSJPAvailable || !sig.getKind().equals(Member.METHOD)) {
list.append(InstructionFactory.createLoad(factoryType, 0));
}