Author: scabanovich
Date: 2011-08-04 15:12:25 -0400 (Thu, 04 Aug 2011)
New Revision: 33598
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
Log:
JBIDE-9453
https://issues.jboss.org/browse/JBIDE-9453
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2011-08-04
19:11:28 UTC (rev 33597)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2011-08-04
19:12:25 UTC (rev 33598)
@@ -107,9 +107,12 @@
for(IBean bean : beans){
if(bean.getName() != null){
- ITextSourceReference location = bean.getNameLocation();
- if(selection.getOffset() >= location.getStartPosition() &&
(selection.getOffset()+selection.getLength()) <=
(location.getStartPosition()+location.getLength()))
- return bean;
+ //Get @Named declared directly, or stereotype that declares @Named.
+ ITextSourceReference location = bean.getNameLocation(true);
+ if(location != null) {
+ if(selection.getOffset() >= location.getStartPosition() &&
(selection.getOffset()+selection.getLength()) <=
(location.getStartPosition()+location.getLength()))
+ return bean;
+ }
}
}