我正在使用GWT 2.4.我有这个类,它覆盖了clone()方法......
public class Attribute implements Serializable, Cloneable {
...
public Object clone() {
Object ret = null;
try {
ret = super.clone();
} catch (CloneNotSupportedException e) {
} // try
return ret;
}
Run Code Online (Sandbox Code Playgroud)
遗憾的是,当我尝试运行我的GWT测试类时,我得到了编译错误
[ERROR] Line 113: The method clone() is undefined for the type Object
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何在保留功能的同时重写上述内容以避免编译错误?谢谢, - 戴夫
Object.cloneGWT 编译器不支持。如果您确实需要支持,可以按照此 GWT 问题中建议的解决方法进行操作:http://code.google.com/p/google-web-toolkit/issues/detail ?id=5068
| 归档时间: |
|
| 查看次数: |
5314 次 |
| 最近记录: |