# HG changeset patch # User Christos Kotselidis # Date 1363974246 -3600 # Node ID 9a02c90900449011bf09714486a5f5c21d0e05b0 # Parent 373d7774a14de02bad0c0a8a9a5144d2d9d3e63d# Parent 9208719445e22d02f7b574f21bb47ee0e158b95b -Merge diff -r 373d7774a14d -r 9a02c9090044 graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/ClassSubstitutionVerifier.java --- a/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/ClassSubstitutionVerifier.java Fri Mar 22 16:18:46 2013 +0100 +++ b/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/ClassSubstitutionVerifier.java Fri Mar 22 18:44:06 2013 +0100 @@ -71,16 +71,19 @@ TypeMirror type = resolveAnnotationValue(TypeMirror.class, typeValue); String className = resolveAnnotationValue(String.class, stringValue); boolean optional = resolveAnnotationValue(Boolean.class, optionalValue); - if (!classSubstition.getAnnotationType().equals(type)) { + + if (type.getKind() != TypeKind.DECLARED) { + env.getMessager().printMessage(Kind.ERROR, "The provided class must be a declared type.", sourceElement, classSubstition, typeValue); + return null; + } + + if (!classSubstition.getAnnotationType().asElement().equals(((DeclaredType) type).asElement())) { if (!className.equals(STRING_VALUE_DEFAULT)) { String msg = "The usage of value and className is exclusive."; env.getMessager().printMessage(Kind.ERROR, msg, sourceElement, classSubstition, stringValue); env.getMessager().printMessage(Kind.ERROR, msg, sourceElement, classSubstition, typeValue); } - if (type.getKind() != TypeKind.DECLARED) { - env.getMessager().printMessage(Kind.ERROR, "The provided class must be a declared type.", sourceElement, classSubstition, typeValue); - return null; - } + return (TypeElement) ((DeclaredType) type).asElement(); }