Author: dazarov
Date: 2011-03-09 18:03:01 -0500 (Wed, 09 Mar 2011)
New Revision: 29657
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
Log:
https://issues.jboss.org/browse/JBIDE-8547
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-03-09
21:38:23 UTC (rev 29656)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/marker/CDIProblemMarkerResolutionGenerator.java 2011-03-09
23:03:01 UTC (rev 29657)
@@ -156,7 +156,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){
@@ -168,7 +175,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);
}
@@ -197,9 +212,7 @@
IInjectionPoint ip = CDIUtil.findInjectionPoint(allBeans, element, start);
- //if(ip instanceof IInjectionPointField)
- return ip;
- //return null;
+ return ip;
}
private List<IBean> findBeans(IInjectionPoint injectionPoint){