diff options
Diffstat (limited to 'external/ikvm/runtime/vm.cs')
-rw-r--r-- | external/ikvm/runtime/vm.cs | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/external/ikvm/runtime/vm.cs b/external/ikvm/runtime/vm.cs index fd3a615908..dbb7ae81ff 100644 --- a/external/ikvm/runtime/vm.cs +++ b/external/ikvm/runtime/vm.cs @@ -1,5 +1,5 @@ /* - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Jeroen Frijters + Copyright (C) 2002-2013 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -434,11 +434,19 @@ namespace IKVM.Internal #if !STATIC_COMPILER && !STUB_GENERATOR internal static object NewAnnotation(java.lang.ClassLoader classLoader, object definition) { -#if FIRST_PASS - return null; -#else - return ikvm.@internal.AnnotationAttributeBase.newAnnotation(classLoader, definition); +#if !FIRST_PASS + java.lang.annotation.Annotation ann = null; + try + { + ann = (java.lang.annotation.Annotation)ikvm.@internal.AnnotationAttributeBase.newAnnotation(classLoader, definition); + } + catch (java.lang.TypeNotPresentException) { } + if (ann != null && sun.reflect.annotation.AnnotationType.getInstance(ann.annotationType()).retention() == java.lang.annotation.RetentionPolicy.RUNTIME) + { + return ann; + } #endif + return null; } #endif @@ -482,4 +490,9 @@ namespace IKVM.Internal #endif } } + + static class Experimental + { + internal static readonly bool JDK_8 = JVM.SafeGetEnvironmentVariable("IKVM_EXPERIMENTAL_JDK_8") != null; + } } |