diff options
author | kmoore | 2008-09-02 22:06:03 +0000 |
---|---|---|
committer | kmoore | 2008-09-02 22:06:03 +0000 |
commit | 7d3f203b40d1841178ba821439a8305fd5748618 (patch) | |
tree | 7098dbe67bd1c67d6378129fe570cedd67359794 | |
parent | 22d76b3c21552c89e754c8cdfae32db24aa62ecc (diff) | |
download | webtools.dali-7d3f203b40d1841178ba821439a8305fd5748618.tar.gz webtools.dali-7d3f203b40d1841178ba821439a8305fd5748618.tar.xz webtools.dali-7d3f203b40d1841178ba821439a8305fd5748618.zip |
225332 - Exception thrown when JRE System Library on build path doesn't exist - check that TypeDeclaration.resolveBinding does not return null
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java index a4697ebf26..5d9cf19905 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/resource/java/JpaCompilationUnitImpl.java @@ -201,13 +201,16 @@ public class JpaCompilationUnitImpl * the same name as the compilation unit (file); * NB: this type could be in error if there is an annotation or enum * with the same name preceding it in the compilation unit + * + * Return null if resolveBinding() on the TypeDeclaration returns null + * This can occur if the project JRE is removed (bug 225332) */ protected TypeDeclaration getPrimaryType(CompilationUnit astRoot) { String primaryTypeName = this.getPrimaryTypeName(); for (AbstractTypeDeclaration atd : types(astRoot)) { if ((atd.getNodeType() == ASTNode.TYPE_DECLARATION) && atd.getName().getFullyQualifiedName().equals(primaryTypeName)) { - return (TypeDeclaration) atd; + return atd.resolveBinding() != null ? (TypeDeclaration) atd : null; } } return null; |