Author: dazarov
Date: 2011-04-11 13:32:18 -0400 (Mon, 11 Apr 2011)
New Revision: 30481
Modified:
branches/jbosstools-3.2.x/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-8710
Modified:
branches/jbosstools-3.2.x/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
---
branches/jbosstools-3.2.x/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-04-11
16:44:10 UTC (rev 30480)
+++
branches/jbosstools-3.2.x/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-04-11
17:32:18 UTC (rev 30481)
@@ -162,7 +162,14 @@
IBean[] bs = injectionPoint.getCDIProject().getBeans();
String injectionPointTypeName =
injectionPoint.getClassBean().getBeanClass().getFullyQualifiedName();
- String injectionPointPackage =
injectionPointTypeName.substring(0,injectionPointTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
+ String injectionPointPackage = null;
+
+ int dotLastIndex = injectionPointTypeName.lastIndexOf(MarkerResolutionUtils.DOT);
+
+ if(dotLastIndex < 0)
+ injectionPointPackage = "";
+ else
+ injectionPointPackage = injectionPointTypeName.substring(0, dotLastIndex);
ArrayList<IBean> beans = new ArrayList<IBean>();
for(IBean bean : bs){
@@ -174,7 +181,15 @@
CDIUIPlugin.getDefault().logError(ex);
}
String beanTypeName = bean.getBeanClass().getFullyQualifiedName();
- String beanPackage =
beanTypeName.substring(0,beanTypeName.lastIndexOf(MarkerResolutionUtils.DOT));
+ String beanPackage = null;
+
+ dotLastIndex = beanTypeName.lastIndexOf(MarkerResolutionUtils.DOT);
+
+ if(dotLastIndex < 0)
+ beanPackage = "";
+ else
+ beanPackage = beanTypeName.substring(0,dotLastIndex);
+
if(isPublic || injectionPointPackage.equals(beanPackage))
beans.add(bean);
}
@@ -182,7 +197,6 @@
return beans;
}
-
private IInjectionPoint findInjectionPoint(IFile file, int start){
IJavaElement element = findJavaElement(file, start);
if(element == null)