Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVikas Chandra2016-02-05 09:44:50 +0000
committerVikas Chandra2016-02-05 09:44:50 +0000
commitef3ba4eb6b6dbd0f29e02b1a8e2f9bd2314082c7 (patch)
tree3acc4c4606a66923ef58987a13091cde007000ae
parent959b771a4b0220ae684cf5815b7993c1e6107dd9 (diff)
downloadeclipse.pde.ui-ef3ba4eb6b6dbd0f29e02b1a8e2f9bd2314082c7.tar.gz
eclipse.pde.ui-ef3ba4eb6b6dbd0f29e02b1a8e2f9bd2314082c7.tar.xz
eclipse.pde.ui-ef3ba4eb6b6dbd0f29e02b1a8e2f9bd2314082c7.zip
Bug 487291 - Class cast exception during PDE search
-rw-r--r--ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java
index 79acd1a19b..59c5822cba 100644
--- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java
+++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/search/ClassSearchParticipant.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2015 IBM Corporation and others.
+ * Copyright (c) 2005, 2016 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
@@ -73,7 +73,7 @@ public class ClassSearchParticipant implements IQueryParticipant {
if (querySpecification.getLimitTo() != S_LIMIT_REF && querySpecification.getLimitTo() != S_LIMIT_ALL)
return;
- String search;
+ String search = null;
if (querySpecification instanceof ElementQuerySpecification) {
IJavaElement element = ((ElementQuerySpecification) querySpecification).getElement();
if (element instanceof IType)
@@ -85,12 +85,14 @@ public class ClassSearchParticipant implements IQueryParticipant {
fSearchFor = S_FOR_TYPES;
else if (type == IJavaElement.PACKAGE_FRAGMENT || type == IJavaElement.PACKAGE_FRAGMENT_ROOT)
fSearchFor = S_FOR_PACKAGES;
- } else {
+ } else if (querySpecification instanceof PatternQuerySpecification){
fSearchFor = ((PatternQuerySpecification) querySpecification).getSearchFor();
search = ((PatternQuerySpecification) querySpecification).getPattern();
}
if (fSearchFor != S_FOR_TYPES && fSearchFor != S_FOR_PACKAGES)
return;
+ if (search == null)
+ return;
fSearchPattern = PatternConstructor.createPattern(search, true);
fSearchRequestor = requestor;

Back to the top