From a9ca915dc39c87267a7a763d51e87a819e9799c7 Mon Sep 17 00:00:00 2001
From: acolyer <acolyer>
Date: Fri, 9 Sep 2005 10:48:58 +0000
Subject: tests and fix for pr109124, not correctly recognizing synthetic
 fields under 1.5

---
 weaver/src/org/aspectj/weaver/bcel/BcelField.java | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'weaver')

diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelField.java b/weaver/src/org/aspectj/weaver/bcel/BcelField.java
index ad8edab0d..0e6f0f162 100644
--- a/weaver/src/org/aspectj/weaver/bcel/BcelField.java
+++ b/weaver/src/org/aspectj/weaver/bcel/BcelField.java
@@ -34,6 +34,8 @@ import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.GenericSigna
 
 final class BcelField extends ResolvedMemberImpl {
 
+	private static int AccSynthetic = 0x1000;
+	
 	private Field field;
 	private boolean isAjSynthetic;
 	private boolean isSynthetic = false;
@@ -78,6 +80,12 @@ final class BcelField extends ResolvedMemberImpl {
 		for (int i = attrs.length - 1; i >= 0; i--) {
 			if (attrs[i] instanceof Synthetic) isSynthetic = true;
 		}
+		
+		// in 1.5, synthetic is a modifier, not an attribute
+		if ((field.getModifiers() & AccSynthetic) != 0) {
+			isSynthetic = true;
+		}
+		
 	}
 	
 	
-- 
cgit v1.2.3