Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java')
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java
index 65d1ab157d..55a35e93d2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaGeneratorContainer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
+ * Copyright (c) 2009, 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.
@@ -12,7 +12,6 @@ package org.eclipse.jpt.jpa.core.internal.jpa1.context.java;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.Filter;
@@ -220,6 +219,7 @@ public class GenericJavaGeneratorContainer
return null;
}
+
// ********** validation **********
@Override
@@ -277,7 +277,19 @@ public class GenericJavaGeneratorContainer
}
public TextRange getValidationTextRange(CompilationUnit astRoot) {
+ TextRange textRange = this.getResourceTextRange(astRoot);
+ return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
+ }
+
+ protected TextRange getResourceTextRange(CompilationUnit astRoot) {
return this.owner.getResourceAnnotatedElement().getTextRange(astRoot);
}
+
+ // ********** misc **********
+
+ @Override
+ public JavaJpaContextNode getParent() {
+ return (JavaJpaContextNode) super.getParent();
+ }
}

Back to the top