Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvrubezhny2015-10-26 22:14:05 +0000
committervrubezhny2015-11-18 15:20:19 +0000
commit7db6859d81a67589997f2405f872067e7f49bc3b (patch)
tree5e44128df6724c6aa71dc5b3da743fd4db21f260
parent2a073eabb3c181eea71ff07652b0e62bd6127899 (diff)
downloadwebtools.jsdt-7db6859d81a67589997f2405f872067e7f49bc3b.tar.gz
webtools.jsdt-7db6859d81a67589997f2405f872067e7f49bc3b.tar.xz
webtools.jsdt-7db6859d81a67589997f2405f872067e7f49bc3b.zip
Bug 480706 - NullPointerException below RenameJavaElementAction.isRenameAvailable (190)
Issue is fixed Signed-off-by: vrubezhny <vrubezhny@exadel.com>
-rw-r--r--bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java
index d505c8679..f86349e7a 100644
--- a/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java
+++ b/bundles/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/internal/core/SelectionRequestor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -13,6 +13,7 @@ package org.eclipse.wst.jsdt.internal.core;
import java.util.ArrayList;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.wst.jsdt.core.IClassFile;
import org.eclipse.wst.jsdt.core.IField;
import org.eclipse.wst.jsdt.core.IFunction;
@@ -724,11 +725,16 @@ public void acceptMethodTypeParameter(char[] declaringTypePackageName, char[] fi
* Adds the given element to the list of resolved elements.
*/
protected void addElement(IJavaScriptElement element) {
- int elementLength = this.elementIndex + 1;
- if (elementLength == this.elements.length) {
- System.arraycopy(this.elements, 0, this.elements = new IJavaScriptElement[(elementLength*2) + 1], 0, elementLength);
+ if (SelectionEngine.DEBUG) {
+ Assert.isNotNull(element);
+ }
+ if (element != null) {
+ int elementLength = this.elementIndex + 1;
+ if (elementLength == this.elements.length) {
+ System.arraycopy(this.elements, 0, this.elements = new IJavaScriptElement[(elementLength*2) + 1], 0, elementLength);
+ }
+ this.elements[++this.elementIndex] = element;
}
- this.elements[++this.elementIndex] = element;
}
/*
* findLocalElement() cannot find local variable

Back to the top