Author: scabanovich
Date: 2008-10-03 05:51:09 -0400 (Fri, 03 Oct 2008)
New Revision: 10639
Modified:
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java
Log:
Error in JUnit tests
Modified:
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java 2008-10-02
20:47:21 UTC (rev 10638)
+++
trunk/common/plugins/org.jboss.tools.common.resref.ui/src/org/jboss/tools/common/resref/ui/BaseAddReferenceSupport.java 2008-10-03
09:51:09 UTC (rev 10639)
@@ -68,11 +68,16 @@
if(initialPrefix != null) {
setAttributeValue(0, "prefix", initialPrefix); //$NON-NLS-1$
}
- final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
+ if(getTarget().getModelEntity().getAttribute("scope") != null) {
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope") //$NON-NLS-1$
.getConstraint());
- if (scopeAttribute != null) {
- scopeNames = scopeAttribute.getValues();
- }
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
+ } else {
+ //just in case. should not happen
+ scopeNames = ResourceReference.SCOPE_NAMES;
+ }
int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
//$NON-NLS-1$
if(scopeIndex == 1 && scopeNames.length == 1){
Show replies by date