我有以下非常简单的,有目的的错误的java类:
import java.io.InputStream;
import java.util.*;
public class ArrayListError{
public ArrayListError(){
}
public static void makeArray(int i){
ArrayList list = new ArrayList(i);
}
public static void main(String[] args)
{
System.out.println("Enter a number to create arrayList:");
Scanner scanner =new Scanner(System.in);
int i= scanner.nextInt();
makeArray(i);
}
}当在evosuite cygwin( java -jar evosuite-20120511.jar -setup c:/Users/Eliezer\ Shindler/Desktop/myclasses)上运行时,我得到:
在de.unisb.cs.st.evosuite.setup.ScanProject.main(ScanProject.java:578)处的线程"main“中出现异常,原因是: com.thoughtworks.xstream.converters.ConversionException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$ClassEntry,因为它没有无参数的构造函数:无法构造de.unisb.cs.st.evosuite.callg raph.DistanceTransformer$ClassEntry,因为它没有无参数的构造函数--调试信息-消息:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer$ClassEntry,因为它没有无参数的构造函数。原因-异常: com.thoughtworks.xstream.converters.reflection.ObjectAcces sException原因-消息:无法构造de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer$ClassEntry,因为它没有无参数的构造函数类: java。是否需要util.HashSet -类型: de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$Clas sEntry路径: /set/de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ClassEntry
行号:2
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:89)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A bstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:60)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionCon verter.readItem(AbstractCollectionConverter.java:71)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.p opulateCollection(CollectionConverter.java:68)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.u nmarshal(CollectionConverter.java:61)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(A bstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnm arshaller.java:60)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller .java:137)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarsh al(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at de.unisb.cs.st.evosuite.utils.Utils.readXML(Utils.java:301)
at de.unisb.cs.st.evosuite.callgraph.Hierarchy.readFromDefaultLocation(H ierarchy.java:113)
at de.unisb.cs.st.evosuite.setup.TestTaskGenerator.<clinit>(TestTaskGene rator.java:57)
... 1 more原因: com.thoughtworks.xstream.converters.reflection.ObjectAccessException:无法构造de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$ClassEnt ry,因为它在com的com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProv ider.newInstance(PureJavaReflectionProvider.java:71) at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.instantiateNewInstance(AbstractReflectionConverter.java:308)没有无参数构造函数.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.unmarshal(AbstractReflectionConverter.java:161) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82) ...还有19个
我不明白这一点--有没有人能帮帮我--我已经为此挣扎了很久了。有关evosuite文档,请访问www.evosuite.org/documentation
发布于 2012-07-27 06:50:40
我认为这是一个内部evosuite错误,由于某种原因,在cygwin中运行它。
https://stackoverflow.com/questions/11659963
复制相似问题