FTの公開用リポジトリ
Revision | 686046c9d57b70ed3bf9c030aeeb97d57ac1f3d3 (tree) |
---|---|
Zeit | 2018-04-01 14:53:57 |
Autor | Toyoaki Furusawa <toythe01@gmai...> |
Commiter | Toyoaki Furusawa |
1.04b
@@ -1604,13 +1604,14 @@ public class Fson { | ||
1604 | 1604 | //注意:fakeであっても、f_nameが存在する属性ならオブジェクトを返す。 |
1605 | 1605 | target = Tool.getFieldValue(obj, f_name); |
1606 | 1606 | if (json != null) { |
1607 | - if (target == null || json.matches("^\\([\\.\\w]+\\).+$")) { | |
1607 | + Field t_fld = Tool.getField(obj.getClass(), f_name); | |
1608 | + | |
1609 | + //指定されているのが、最初の値もしくは任意であるなら、作れるか試みる。 | |
1610 | + Class<?> f_class = t_fld.getType(); | |
1611 | + if (target == null || json.matches("^\\([\\.\\w]+\\).+$") || Tool.isPrimitive2(f_class)) { | |
1608 | 1612 | //(1)まだ値が設定されていない。とりあえず、中身が空のオブジェクトを作ろうとする。 |
1609 | 1613 | //(2)明にcastされている。サブクラスなどの可能性あり。 |
1610 | - Field t_fld = Tool.getField(obj.getClass(), f_name); | |
1611 | - | |
1612 | - //指定されているのが、最初の値もしくは任意であるなら、作れるか試みる。 | |
1613 | - Class<?> f_class = t_fld.getType(); | |
1614 | + //(3)上書きするしかない基本型とその類型 | |
1614 | 1615 | try { |
1615 | 1616 | target = fromJson(json, f_class); |
1616 | 1617 |
@@ -2202,13 +2202,15 @@ public class Tool { | ||
2202 | 2202 | //デバッグモードの時、スタックを出力する。 |
2203 | 2203 | |
2204 | 2204 | String t_result = ""; //$NON-NLS-1$ |
2205 | - StackTraceElement[] elms = e.getStackTrace(); | |
2206 | - String sps = ""; //$NON-NLS-1$ | |
2205 | + if (e != null) { | |
2206 | + StackTraceElement[] elms = e.getStackTrace(); | |
2207 | + String sps = ""; //$NON-NLS-1$ | |
2207 | 2208 | |
2208 | - for (int i = 0; i < elms.length && i < n; i++) { | |
2209 | - if (i >= offset) { | |
2210 | - t_result += sps + elms[i].toString() + "\n"; //$NON-NLS-1$ | |
2211 | - sps += ">"; //$NON-NLS-1$ | |
2209 | + for (int i = 0; i < elms.length && i < n; i++) { | |
2210 | + if (i >= offset) { | |
2211 | + t_result += sps + elms[i].toString() + "\n"; //$NON-NLS-1$ | |
2212 | + sps += ">"; //$NON-NLS-1$ | |
2213 | + } | |
2212 | 2214 | } |
2213 | 2215 | } |
2214 | 2216 |
@@ -249,6 +249,9 @@ public class PageAction { | ||
249 | 249 | |
250 | 250 | //xpathが変わっている可能性もあるのでもう一回確認。 |
251 | 251 | WebElement elm = drv.findElement(getLocator()); |
252 | +// if (ExpectedConditions.elementToBeClickable(elm).apply(drv) == elm) { | |
253 | + //clickable判定ではiggridのテストを通過できなかった。識別子の指定で見えていないのに成功することがあるようだ。 | |
254 | + | |
252 | 255 | if (ExpectedConditions.visibilityOf(elm).apply(drv) == elm) { |
253 | 256 | //見えていたらスクロールする必要なし。 |
254 | 257 | //※ 但しz-indexで上層に要素があり、イベントが遮られる可能性あり。 |