]> source.dussan.org Git - vaadin-framework.git/commitdiff
Revert to old simpleName logic (differs for inner classes) (#15544)
authorArtur Signell <artur@vaadin.com>
Wed, 14 Jan 2015 09:35:10 +0000 (11:35 +0200)
committerVaadin Code Review <review@vaadin.com>
Wed, 14 Jan 2015 10:22:31 +0000 (10:22 +0000)
All existing recorded TB tests contain Outer$Inner and not Inner so they will
fail if this is switched to using Class.getSimpleName

Change-Id: Ic79355fbc61403ed2929271d302db35e20dda38c

client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java
client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java

index 16f21d5d664f9a7a2c8a679eea8ec74d09b01fce..517d979c8e922e73252f946a12812f4dd63ee327 100644 (file)
@@ -455,7 +455,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
         if (basePath == null) {
             return null;
         }
-        String simpleName = w.getClass().getSimpleName();
+        String simpleName = Util.getSimpleName(w);
 
         /*
          * Check if the parent implements Iterable. At least VPopupView does not
@@ -475,7 +475,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
                 return basePath + PARENTCHILD_SEPARATOR + simpleName + "["
                         + pos + "]";
             }
-            String simpleName2 = child.getClass().getSimpleName();
+            String simpleName2 = Util.getSimpleName(child);
             if (simpleName.equals(simpleName2)) {
                 pos++;
             }
@@ -606,8 +606,8 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
                     // the same type before it
                     int nextIndex = 0;
                     for (Widget child : layout) {
-                        boolean matchingType = nextWidgetClassName.equals(child
-                                .getClass().getSimpleName());
+                        boolean matchingType = nextWidgetClassName.equals(Util
+                                .getSimpleName(child));
                         if (matchingType && widgetPosition == 0) {
                             // This is the n:th child that we looked for
                             break;
@@ -661,7 +661,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
                 while (iterator.hasNext()) {
 
                     Widget child = iterator.next();
-                    String simpleName2 = child.getClass().getSimpleName();
+                    String simpleName2 = Util.getSimpleName(child);
 
                     if (!widgetClassName.equals(simpleName2)
                             && child instanceof Slot) {
@@ -671,7 +671,7 @@ public class LegacyLocatorStrategy implements LocatorStrategy {
                          * directly checking the stuff inside the slot
                          */
                         child = ((Slot) child).getWidget();
-                        simpleName2 = child.getClass().getSimpleName();
+                        simpleName2 = Util.getSimpleName(child);
                     }
 
                     if (widgetClassName.equals(simpleName2)) {
index ea0fd2042eb005a0551f22739cf83b4c91a3ff97..44bdeddff3ca349f68550dd95dae8d0e377817bd 100644 (file)
@@ -644,7 +644,7 @@ public class VaadinFinderLocatorStrategy implements LocatorStrategy {
 
         // If the server-side class name didn't match, fall back to testing for
         // the explicit widget name
-        String widget = connector.getWidget().getClass().getSimpleName();
+        String widget = Util.getSimpleName(connector.getWidget());
         return widgetName.equals(widget)
                 || widgetName.equals(widget + ".class");