diff graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java @ 13818:d2f520f46180

added more unit tests for meta.api, discovering and fixing an issue with HotSpotResolvedJavaField.getModifiers() in the process
author Doug Simon <doug.simon@oracle.com>
date Thu, 30 Jan 2014 00:48:41 +0100
parents eec9f21a40b7
children d587baa55dd7
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Wed Jan 29 15:02:19 2014 -0800
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Thu Jan 30 00:48:41 2014 +0100
@@ -432,23 +432,10 @@
         return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass);
     }
 
-    private static final int SYNTHETIC;
-    static {
-        try {
-            // Unfortunately, Modifier.SYNTHETIC is not public so we have
-            // to jump though hoops to get it.
-            Field field = Modifier.class.getDeclaredField("SYNTHETIC");
-            field.setAccessible(true);
-            SYNTHETIC = field.getInt(null);
-        } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
-            throw GraalInternalError.shouldNotReachHere(e.toString());
-        }
-    }
-
     @Override
     public boolean isSynthetic() {
         int modifiers = getAllModifiers();
-        return (SYNTHETIC & modifiers) != 0;
+        return (runtime().getConfig().syntheticFlag & modifiers) != 0;
     }
 
     public boolean isDefault() {