diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java index 7135925a3b..840e0bc0dd 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/GenericJavaIdClassReference.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. + * Copyright (c) 2010, 2011 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -263,9 +263,12 @@ public class GenericJavaIdClassReference } public TextRange getValidationTextRange(CompilationUnit astRoot) { + TextRange textRange = this.getAnnotationTextRange(astRoot); + return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot); + } + + protected TextRange getAnnotationTextRange(CompilationUnit astRoot) { IdClassAnnotation annotation = this.getIdClassAnnotation(); - return (annotation == null) ? - this.getTypeMapping().getValidationTextRange(astRoot) : - annotation.getTextRange(astRoot); + return (annotation == null) ? null : annotation.getTextRange(astRoot); } } |