]> source.dussan.org Git - aspectj.git/commitdiff
227029: multithreaded bug in reflection
authoraclement <aclement>
Fri, 18 Apr 2008 16:43:09 +0000 (16:43 +0000)
committeraclement <aclement>
Fri, 18 Apr 2008 16:43:09 +0000 (16:43 +0000)
weaver5/java5-src/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java

index eccfd962c108bc993e04909501c2606ccba60381..ff2c0bc7c1821e7b400e752903481891633ac390 100644 (file)
@@ -105,10 +105,11 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends
        public ResolvedMember[] getDeclaredFields() {
                if (fields == null) {
                        Field[] reflectFields = this.myType.getDeclaredFields();
-                       this.fields = new ResolvedMember[reflectFields.length];
+                       ResolvedMember[] rFields = new ResolvedMember[reflectFields.length];
                        for (int i = 0; i < reflectFields.length; i++) {
-                               this.fields[i] = createGenericFieldMember(reflectFields[i]);
+                               rFields[i] = createGenericFieldMember(reflectFields[i]);
                        }
+                       this.fields = rFields;
                }
                return fields;
        }