diff options
author | pavery | 2005-04-04 17:44:35 +0000 |
---|---|---|
committer | pavery | 2005-04-04 17:44:35 +0000 |
commit | f0a29e35c0efc3ed6544baf00ac0ea45123ef808 (patch) | |
tree | 9bf2e107e1ffa129c5dd90826db94c89b85375a1 /bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp | |
parent | 681223982a326279a9227dd025f503e426590d50 (diff) | |
download | webtools.sourceediting-f0a29e35c0efc3ed6544baf00ac0ea45123ef808.tar.gz webtools.sourceediting-f0a29e35c0efc3ed6544baf00ac0ea45123ef808.tar.xz webtools.sourceediting-f0a29e35c0efc3ed6544baf00ac0ea45123ef808.zip |
[88001] null check when setting compilation unit
Diffstat (limited to 'bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp')
-rw-r--r-- | bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionRequestor.java | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionRequestor.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionRequestor.java index 02ea17d552..5adda37fb3 100644 --- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionRequestor.java +++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/JSPCompletionRequestor.java @@ -1,3 +1,15 @@ +/******************************************************************************* + * Copyright (c) 2004 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Ted Carroll - https://bugs.eclipse.org/bugs/show_bug.cgi?id=88001 + * supplied patch + *******************************************************************************/ package org.eclipse.jst.jsp.ui.internal.contentassist; import java.util.ArrayList; @@ -24,8 +36,7 @@ import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal; /** * Most "accept" methods copied from JDT ResultCollector. - * - * @author pavery + * @since 1.0 */ public class JSPCompletionRequestor extends CompletionRequestor { @@ -676,14 +687,17 @@ public class JSPCompletionRequestor extends CompletionRequestor { */ public void setCompilationUnit(ICompilationUnit compilationUnit) { fCompilationUnit = compilationUnit; - - // set some names for fixing up mangled name - // in proposals later - String cuName = getCompilationUnit().getPath().lastSegment(); - setMangledName(cuName.substring(0, cuName.lastIndexOf('.'))); - - String unmangled = JSP2ServletNameUtil.unmangle(cuName); - setJspName(unmangled.substring(unmangled.lastIndexOf('/') + 1)); + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=88001 + if(null != fCompilationUnit) + { + // set some names for fixing up mangled name + // in proposals later + String cuName = getCompilationUnit().getPath().lastSegment(); + setMangledName(cuName.substring(0, cuName.lastIndexOf('.'))); + + String unmangled = JSP2ServletNameUtil.unmangle(cuName); + setJspName(unmangled.substring(unmangled.lastIndexOf('/') + 1)); + } } /** |