0

私は次の非常に単純で意図的にバグのある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)で実行すると、次のようになります。

スレッド「main」の例外java.lang.ExceptionInInitializerErroratde.unisb.cs.st.evosuite.setup.ScanProject.main(ScanProject.java:578)原因:com.thoughtworks.xstream.converters.ConversionException:コンストラクターを構成できませんde.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ ClassEntryには引数なしのコンストラクターがないため:de.unisb.cs.st.evosuite.callg raph.DistanceTransformer $ ClassEntryには引数がないため、構築できません。 no-argsコンストラクター----デバッグ情報----メッセージ:de.unisb.cs.st.evosuite.callgraph.Distanc eTransformer $ ClassEntryを構築できません。これは、no-argsコンストラクターの原因-例外:comがないためです。 Thoughtworks.xstream.converters.reflection.ObjectAcces sException原因メッセージ:de.unisb.cs.st.evosuiteを構築できません。callgraph.Distanc eTransformer $ ClassEntryには引数なしのコンストラクタークラスがないため:java.util.HashSet required-type:de.unisb.cs.st.evosuite.callgraph.DistanceTransformer $ Clas sEntry path:/ 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:com.thoughtworks.xstreamに引数なしのコンストラクターがないため、de.unisb.cs.st.evosuite.callgraph.DistanceTransformer$ClassEntryを構築できません。 converters.reflection.PureJavaReflectionProv ider.newInstance(PureJavaReflectionProvider.java:71)at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConv erter.instantiateNewInstance(AbstractReflectionConverter.java:308)at com.thoughtworks.xstream.converters.reflection.AbstractRef .unmarshal(AbstractReflectionConverter.java:161)at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshall er.java:82)... 19 more

私はこれを理解していません-誰か助けてもらえますか-私は何年もの間これに苦労してきました。evosuiteのドキュメントは、www.evosuite.org/documentationで入手できます。

4

1 に答える 1

0

何らかの理由でcygwinで実行したために発生した、内部のevosuiteエラーだったと思います。

于 2012-07-26T22:50:39.840 に答える