public class MinimizerWriter extends java.lang.Object implements CodeWriter
CodeWriter
that, for an error-revealing test class, writes both the original and
minimized class. Minimizes the methods of the test class using Minimize.mainMinimize(Path,
String, int, boolean)
.Modifier and Type | Field and Description |
---|---|
private JavaFileWriter |
javaFileWriter
The
JavaFileWriter used to write classes. |
Constructor and Description |
---|
MinimizerWriter(JavaFileWriter javaFileWriter)
Creates a
MinimizerWriter using the given JavaFileWriter . |
Modifier and Type | Method and Description |
---|---|
java.nio.file.Path |
writeClassCode(java.lang.String packageName,
java.lang.String classname,
java.lang.String classCode)
Writes the given class using this
CodeWriter . |
java.nio.file.Path |
writeUnmodifiedClassCode(java.lang.String packageName,
java.lang.String classname,
java.lang.String classCode)
Writes the given class.
|
private final JavaFileWriter javaFileWriter
JavaFileWriter
used to write classes.public MinimizerWriter(JavaFileWriter javaFileWriter)
MinimizerWriter
using the given JavaFileWriter
.javaFileWriter
- the JavaFileWriter
for writing the classespublic java.nio.file.Path writeClassCode(java.lang.String packageName, java.lang.String classname, java.lang.String classCode) throws RandoopOutputException
CodeWriter
. May modify the class text before writing
it. May write additional files (but those are not returned).
Writes both the original class and the minimized class. Returns the original class.
writeClassCode
in interface CodeWriter
packageName
- the package name of the classclassname
- the simple name of the classclassCode
- the text of a Java class, must be compilablePath
object for the Java file writtenRandoopOutputException
- if there is an error while writing the codepublic java.nio.file.Path writeUnmodifiedClassCode(java.lang.String packageName, java.lang.String classname, java.lang.String classCode) throws RandoopOutputException
CodeWriter
writeUnmodifiedClassCode
in interface CodeWriter
packageName
- the package name of the classclassname
- the simple name of the classclassCode
- the text of the class to be written, must be compilablePath
object for the Java file writtenRandoopOutputException
- if there is an error while writing the code