Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManoj Palat2016-02-23 06:12:21 +0000
committerManoj Palat2016-02-23 06:12:21 +0000
commit7696786ccdd012ef63ebfd10c568bb2b4bd4de02 (patch)
treedd14d34ff9576ad102227a33becb7dc38fd06aa1
parent8b68c189b5e7c8d620620064f0049349f923eeb5 (diff)
downloadeclipse.jdt.core-7696786ccdd012ef63ebfd10c568bb2b4bd4de02.tar.gz
eclipse.jdt.core-7696786ccdd012ef63ebfd10c568bb2b4bd4de02.tar.xz
eclipse.jdt.core-7696786ccdd012ef63ebfd10c568bb2b4bd4de02.zip
Fix for Bug 488266[1.9][compiler] NPE in isModuleInfo()P20160223-1200
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
index 21622c182a..7fdeb80830 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java
@@ -102,11 +102,13 @@ public CompilationUnitDeclaration(ProblemReporter problemReporter, CompilationRe
//by definition of a compilation unit....
this.sourceStart = 0;
this.sourceEnd = sourceLength - 1;
- if (this.isModuleInfo()) {
- this.module = this.moduleDeclaration != null ? this.moduleDeclaration.moduleName : ModuleEnvironment.UNNAMED;
- } else if (compilationResult != null && compilationResult.compilationUnit != null) {
- this.module = compilationResult.compilationUnit.module();
- }
+ if (compilationResult != null) {
+ if (this.isModuleInfo()) {
+ this.module = this.moduleDeclaration != null ? this.moduleDeclaration.moduleName : ModuleEnvironment.UNNAMED;
+ } else if (compilationResult.compilationUnit != null) {
+ this.module = compilationResult.compilationUnit.module();
+ }
+ }
}
/*

Back to the top