From 0660ad3b68a396993723b3e66b20bc467e6fa982 Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Wed, 13 Mar 2013 08:23:55 -0700 Subject: [PATCH] avoid potential multi threaded issues --- weaver/src/org/aspectj/weaver/bcel/BcelObjectType.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } -- 2.39.5