itemambiguityexception.java
来自「基于Junit的 功能和单元测试的的测试工具。只支持Swing.」· Java 代码 · 共 24 行
JAVA
24 行
package org.uispec4j;
/**
* Thrown by UIComponents when a search cannot identify a single result.
*/
class ItemAmbiguityException extends RuntimeException {
public ItemAmbiguityException(String searchedValue, String[] foundItems) {
super(computeMessage(foundItems, searchedValue));
}
private static String computeMessage(String[] foundItems, String searchedValue) {
StringBuffer buffer =
new StringBuffer(Integer.toString(foundItems.length))
.append(" items are matching the same pattern '")
.append(searchedValue)
.append("': [");
for (int i = 0; i < foundItems.length; i++) {
buffer.append(foundItems[i]);
buffer.append((i < foundItems.length - 1) ? "," : "]");
}
return buffer.toString();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?