Search in sources :

Example 1 with FieldInfo

use of com.oracle.svm.configure.config.FieldInfo in project graal by oracle.

the class TypeMethodsWithFlagsTest method doTestFields.

private static void doTestFields(TypeConfiguration typeConfig) {
    ConfigurationType fieldTestType = getConfigTypeOrFail(typeConfig, "MethodAndFieldTest");
    Assert.assertNull(ConfigurationType.TestBackdoor.getFieldInfoIfPresent(fieldTestType, "SimpleField"));
    Assert.assertNull(ConfigurationType.TestBackdoor.getFieldInfoIfPresent(fieldTestType, "AllowWriteField"));
    FieldInfo newField = ConfigurationType.TestBackdoor.getFieldInfoIfPresent(fieldTestType, "NewField");
    Assert.assertFalse(newField.isFinalButWritable());
    FieldInfo newWritableField = getFieldInfoOrFail(fieldTestType, "NewAllowWriteField");
    Assert.assertTrue(newWritableField.isFinalButWritable());
    FieldInfo newlyWritableField = getFieldInfoOrFail(fieldTestType, "NewNowWritableField");
    Assert.assertTrue(newlyWritableField.isFinalButWritable());
}
Also used : ConfigurationType(com.oracle.svm.configure.config.ConfigurationType) FieldInfo(com.oracle.svm.configure.config.FieldInfo)

Example 2 with FieldInfo

use of com.oracle.svm.configure.config.FieldInfo in project graal by oracle.

the class TypeMethodsWithFlagsTest method getFieldInfoOrFail.

private static FieldInfo getFieldInfoOrFail(ConfigurationType type, String field) {
    FieldInfo fieldInfo = ConfigurationType.TestBackdoor.getFieldInfoIfPresent(type, field);
    Assert.assertNotNull(fieldInfo);
    return fieldInfo;
}
Also used : FieldInfo(com.oracle.svm.configure.config.FieldInfo)

Aggregations

FieldInfo (com.oracle.svm.configure.config.FieldInfo)2 ConfigurationType (com.oracle.svm.configure.config.ConfigurationType)1