Bug 89682 - mark occurrences inconsistent with defnition vs. reference for location props
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java
index 58ade9a..182069f 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/AntPropertyNode.java
@@ -31,6 +31,7 @@
private String fValue= null;
private String fReferencedName;
+ private String fOccurrencesStartingPoint= IAntModelConstants.ATTR_VALUE;
/*
* The set of properties defined by this node
@@ -41,9 +42,9 @@
public AntPropertyNode(Task task, Attributes attributes) {
super(task);
String label = attributes.getValue(IAntModelConstants.ATTR_NAME);
- if(label == null) {
+ if (label == null) {
label = attributes.getValue(IAntModelConstants.ATTR_FILE);
- if(label != null) {
+ if (label != null) {
fReferencedName= label;
label= "file="+label; //$NON-NLS-1$
} else {
@@ -53,21 +54,21 @@
label= "resource="+label; //$NON-NLS-1$
} else {
label = attributes.getValue(IAntModelConstants.ATTR_ENVIRONMENT);
- if(label != null) {
+ if (label != null) {
label= "environment=" + label; //$NON-NLS-1$
}
}
}
} else {
fValue= attributes.getValue(IAntModelConstants.ATTR_VALUE);
+ if (fValue == null) {
+ fOccurrencesStartingPoint= IAntModelConstants.ATTR_LOCATION;
+ fValue= attributes.getValue(fOccurrencesStartingPoint); //$NON-NLS-1$
+ }
}
setBaseLabel(label);
}
- public String getValue() {
- return fValue;
- }
-
public String getProperty(String propertyName) {
if (fProperties != null) {
return (String)fProperties.get(propertyName);
@@ -168,7 +169,7 @@
public boolean isRegionPotentialReference(IRegion region) {
if (super.isRegionPotentialReference(region)) {
String textToSearch= getAntModel().getText(getOffset(), getLength());
- int valueOffset= textToSearch.indexOf("value"); //$NON-NLS-1$
+ int valueOffset= textToSearch.indexOf(fOccurrencesStartingPoint); //$NON-NLS-1$
if (valueOffset > -1) {
valueOffset= textToSearch.indexOf('"', valueOffset);
if (valueOffset > -1) {
@@ -198,7 +199,7 @@
}
}
if (fValue != null) {
- int valueOffset= textToSearch.indexOf("value"); //$NON-NLS-1$
+ int valueOffset= textToSearch.indexOf(fOccurrencesStartingPoint); //$NON-NLS-1$
int endOffset= getOffset() + getLength();
identifier= new StringBuffer("{").append(identifier).append('}').toString(); //$NON-NLS-1$
while(valueOffset < endOffset) {
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/IAntModelConstants.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/IAntModelConstants.java
index 98dcec0..f9c4f6e 100644
--- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/IAntModelConstants.java
+++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/model/IAntModelConstants.java
@@ -20,6 +20,7 @@
*/
public static final String ATTR_NAME= "name"; //$NON-NLS-1$
public static final String ATTR_VALUE= "value"; //$NON-NLS-1$
+ public static final String ATTR_LOCATION= "location"; //$NON-NLS-1$
public static final String ATTR_DEFAULT= "default"; //$NON-NLS-1$
public static final String ATTR_RESOURCE= "resource"; //$NON-NLS-1$
public static final String ATTR_ENVIRONMENT= "environment"; //$NON-NLS-1$