summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor V Rubezhny2013-11-06 16:12:32 (EST)
committer Chris Jaun2013-11-06 16:12:32 (EST)
commit0b42b983175685012b049844276df46dd05c53e8 (patch)
tree22bd46723dfbd5ea7a39a7b492bf07d5528c3783
parenta31d054d380f50292c62eb09ac1794ae8002c93d (diff)
downloadwebtools.jsdt.core-0b42b983175685012b049844276df46dd05c53e8.zip
webtools.jsdt.core-0b42b983175685012b049844276df46dd05c53e8.tar.gz
webtools.jsdt.core-0b42b983175685012b049844276df46dd05c53e8.tar.bz2
[392400] NullPointerException atv201311062114
org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.<init>(SourceTypeBinding.java:49)
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java6
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java3
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java2
3 files changed, 6 insertions, 5 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
index c408291..6e24e40 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/ast/TypeDeclaration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2011, 2013 IBM Corporation and others.
* 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
@@ -751,7 +751,7 @@ public void resolve() {
// if the type is package-info, the javadoc was resolved as part of the compilation unit javadoc
this.javadoc.resolve(this.scope);
}
- } else if (sourceType != null && !sourceType.isLocalType()) {
+ } else if (this.scope != null && sourceType != null && !sourceType.isLocalType()) {
this.scope.problemReporter().javadocMissing(this.sourceStart, this.sourceEnd, sourceType.modifiers);
}
@@ -947,7 +947,7 @@ public void traverse(ASTVisitor visitor, ClassScope classScope) {
* This method is doing either up/down propagation.
*/
void updateMaxFieldCount() {
- if (this.binding == null)
+ if (this.scope == null || this.binding == null)
return; // error scenario
TypeDeclaration outerMostType = this.scope.outerMostClassScope().referenceType();
if (this.maxFieldCount > outerMostType.maxFieldCount) {
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
index 8837a9f..1a93707 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/ReferenceBinding.java
@@ -272,7 +272,8 @@ public ReferenceBinding closestMatch() {
}
public void computeId() {
-
+ if (this.compoundName == null) return;
+
switch (this.compoundName.length) {
case 1 :
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
index f3f663d..8f87c68 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -149,7 +149,7 @@ public class SourceTypeBinding extends ReferenceBinding {
this();
this.compoundName = compoundName;
this.fPackage = fPackage;
- this.fileName = scope.referenceCompilationUnit().getFileName();
+ this.fileName = scope == null ? null : scope.referenceCompilationUnit().getFileName();
if (scope instanceof ClassScope) {
this.classScope = (ClassScope) scope;
if (this.classScope.referenceContext != null) {