diff options
| author | Manoj Palat | 2016-02-23 06:12:21 +0000 |
|---|---|---|
| committer | Manoj Palat | 2016-02-23 06:12:21 +0000 |
| commit | 7696786ccdd012ef63ebfd10c568bb2b4bd4de02 (patch) | |
| tree | dd14d34ff9576ad102227a33becb7dc38fd06aa1 | |
| parent | 8b68c189b5e7c8d620620064f0049349f923eeb5 (diff) | |
| download | eclipse.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.java | 12 |
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(); + } + } } /* |
