Skip to content

Commit 9b363fd

Browse files
Merge pull request #193 from sgaertner/pr/Binding_Validation_CaseIns_Fix
Fixed case-insensitive component keyPath validation
2 parents 944ec11 + 291ea66 commit 9b363fd

File tree

1 file changed

+8
-2
lines changed
  • wolips/plugins/org.objectstyle.wolips.bindings/java/org/objectstyle/wolips/bindings/wod

1 file changed

+8
-2
lines changed

wolips/plugins/org.objectstyle.wolips.bindings/java/org/objectstyle/wolips/bindings/wod/TypeCache.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public List<BindingValueKey> getBindingValueAccessorKeys(IJavaProject javaProjec
169169
//System.out.println("TypeCacheEntry.getBindingValueAccessorKeys: " + name + ": " + bindingValueAccessorKeys);
170170
if (bindingValueAccessorKeys == null) {
171171
//System.out.println("TypeCache.getBindingValueAccessorKeys: MISS " + type.getElementName() + ": " + name);
172-
bindingValueAccessorKeys = BindingReflectionUtils.getBindingKeys(javaProject, _type, name, true, BindingReflectionUtils.ACCESSORS_OR_VOID, false, TypeCache.this);
172+
bindingValueAccessorKeys = getBindingKeys(javaProject, name, BindingReflectionUtils.ACCESSORS_OR_VOID);
173173
// MS: Don't cache this for now -- I don't know how many end up in here and how long they
174174
// hang around, but I think the answer is "a lot" and "for a long time". However, it's a huge performance win.
175175

@@ -192,7 +192,7 @@ public List<BindingValueKey> getBindingValueMutatorKeys(IJavaProject javaProject
192192
List<BindingValueKey> bindingValueMutatorKeys = _bindingValueMutatorKeys.get(name);
193193
if (bindingValueMutatorKeys == null) {
194194
//System.out.println("TypeCache.getBindingValueMutatorKeys: MISS " + type.getElementName() + ": " + name);
195-
bindingValueMutatorKeys = BindingReflectionUtils.getBindingKeys(javaProject, _type, name, true, BindingReflectionUtils.MUTATORS_ONLY, false, TypeCache.this);
195+
bindingValueMutatorKeys = getBindingKeys(javaProject, name, BindingReflectionUtils.MUTATORS_ONLY);
196196
// MS: Don't cache this for now -- I don't know how many end up in here and how long they
197197
// hang around, but I think the answer is "a lot" and "for a long time". However, it's a huge performance win.
198198

@@ -210,6 +210,12 @@ public List<BindingValueKey> getBindingValueMutatorKeys(IJavaProject javaProject
210210
}
211211
}
212212

213+
private List<BindingValueKey> getBindingKeys(IJavaProject javaProject, String name, int accessorsOrMutators) throws JavaModelException {
214+
return BindingReflectionUtils.getBindingKeys(javaProject, _type, name, true, accessorsOrMutators, false, TypeCache.this)
215+
// filter out case-insensitive matches by performing an exact check
216+
.stream().filter(bvk -> bvk.getBindingName().equals(name)).toList();
217+
}
218+
213219
/**
214220
* Resolves a type name in the context of the declaring type.
215221
*

0 commit comments

Comments
 (0)