comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/compiler/AbstractCompiler.java @ 16753:f78eafd5ba9e

Truffle-DSL: the processor compiler abstraction now supports declaration oder for enclosed elements of types for JDT which is not conforming to specification.
author Christian Humer <christian.humer@gmail.com>
date Mon, 11 Aug 2014 15:53:05 +0200
parents 288c23143d47
children
comparison
equal deleted inserted replaced
16752:0e05342037d7 16753:f78eafd5ba9e
40 40
41 protected static Object field(Object o, String fieldName) throws Exception { 41 protected static Object field(Object o, String fieldName) throws Exception {
42 if (o == null) { 42 if (o == null) {
43 return null; 43 return null;
44 } 44 }
45 Field field = o.getClass().getField(fieldName); 45 Class<?> clazz = o.getClass();
46 Field field = null;
47 try {
48 field = clazz.getField(fieldName);
49 } catch (NoSuchFieldException e) {
50 while (clazz != null) {
51 try {
52 field = clazz.getDeclaredField(fieldName);
53 break;
54 } catch (NoSuchFieldException e1) {
55 clazz = clazz.getSuperclass();
56 }
57 }
58 if (field == null) {
59 throw e;
60 }
61 }
46 field.setAccessible(true); 62 field.setAccessible(true);
47 return field.get(o); 63 return field.get(o);
48 } 64 }
49 65
50 protected static String parseHeader(String content) { 66 protected static String parseHeader(String content) {