-
-
Notifications
You must be signed in to change notification settings - Fork 376
Description
I have encountered an strange bug when using Spoon, either with version 6.2 or 7.0
The source code I am analyzing is https://github.com/apache/commons-math/blob/master/src/main/java/org/apache/commons/math4/linear/ArrayRealVector.java
After building the model using the following code on the above source file:
Launcher launcher = new Launcher();
launcher.addInputResource(targetClassLocation);
launcher.setSourceOutputDirectory(location + File.separator + "spoon");
launcher.getEnvironment().setSourceClasspath(classPath.split("::"));
launcher.buildModel();
List<CtElement> originalClasses = launcher.getFactory().Package().getRootPackage() .getElements(new TypeFilter(CtClass.class));
WriteLinesToFile.writeToFiles(originalClasses.get(0).toString(), "ArrayRealVector.java");
The output file "ArrayRealVector.java" is different with the original source file "ArrayRealVector.java".
The key work this becomes super.
Analyzed:
I do not know how this would happen, which seems to be a serious bug.

