From: Andy Clement Date: Wed, 13 Mar 2013 15:23:55 +0000 (-0700) Subject: avoid potential multi threaded issues X-Git-Tag: AS_BETA_JAVA8_CREATED~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0660ad3b68a396993723b3e66b20bc467e6fa982;p=aspectj.git avoid potential multi threaded issues --- diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java index 649a74b99..2286a06cf 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java @@ -286,10 +286,11 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { ensureGenericSignatureUnpacked(); if (methods == null) { Method[] ms = javaClass.getMethods(); - methods = new ResolvedMember[ms.length]; + ResolvedMember[] newMethods = new ResolvedMember[ms.length]; for (int i = ms.length - 1; i >= 0; i--) { - methods[i] = new BcelMethod(this, ms[i]); + newMethods[i] = new BcelMethod(this, ms[i]); } + methods = newMethods; } return methods; } @@ -298,10 +299,11 @@ public class BcelObjectType extends AbstractReferenceTypeDelegate { ensureGenericSignatureUnpacked(); if (fields == null) { Field[] fs = javaClass.getFields(); - fields = new ResolvedMember[fs.length]; + ResolvedMember[] newfields = new ResolvedMember[fs.length]; for (int i = 0, len = fs.length; i < len; i++) { - fields[i] = new BcelField(this, fs[i]); + newfields[i] = new BcelField(this, fs[i]); } + fields = newfields; } return fields; }