diff options
author | Patrik Lindström <patrik@vaadin.com> | 2013-11-06 16:15:52 +0200 |
---|---|---|
committer | Patrik Lindström <patrik@vaadin.com> | 2013-11-06 16:16:42 +0200 |
commit | d70d6a2cac7271b2f49805611d77cd3f7eb431f1 (patch) | |
tree | 413b3f6569d0f8bc1e6a46cb12ff4ce234d0572c /client | |
parent | a12b62485dfa9c294e1a483c4b340c2be6a53588 (diff) | |
download | vaadin-framework-d70d6a2cac7271b2f49805611d77cd3f7eb431f1.tar.gz vaadin-framework-d70d6a2cac7271b2f49805611d77cd3f7eb431f1.zip |
Make component predicate matches exact (#12913)
Change-Id: Ia9a938977437a2188a6f5b207789058abce62965
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java | 11 | ||||
-rw-r--r-- | client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java b/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java index 5f5e0279ce..5123a57e5d 100644 --- a/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java +++ b/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java @@ -499,7 +499,16 @@ public class LegacyLocatorStrategy implements LocatorStrategy { String widgetClassName = split[0]; String indexString = split[1].substring(0, split[1].length() - 1); - int widgetPosition = Integer.parseInt(indexString); + + int widgetPosition; + try { + widgetPosition = Integer.parseInt(indexString); + } catch (NumberFormatException e) { + // We've probably been fed a new-style Vaadin locator with a + // string-form predicate, that doesn't match anything in the + // search space. + return null; + } // AbsolutePanel in GridLayout has been removed -> skip it if (w instanceof VGridLayout diff --git a/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java b/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java index 3390de86a4..96374e898a 100644 --- a/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java +++ b/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java @@ -241,6 +241,8 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy { } } + return null; + } else { int index = Integer.valueOf(predicateString); return index < potentialMatches.size() ? potentialMatches |