@@ -21,6 +21,7 @@ public class TestFileDetector {
2121 private List <MethodEntity > methods ;
2222 private ClassEntity classEntity ;
2323 private ArrayList <String > imports ;
24+ private ArrayList <String > debt ;
2425
2526 /**
2627 * Constructor
@@ -41,6 +42,7 @@ public static TestFileDetector createTestFileDetector() {
4142 private void initialize (){
4243 methods = new ArrayList <>();
4344 imports = new ArrayList <>();
45+ debt = new ArrayList <>();
4446 }
4547
4648 public ClassEntity runAnalysis (Path filePath ) throws FileNotFoundException {
@@ -58,6 +60,7 @@ public ClassEntity runAnalysis(Path filePath) throws FileNotFoundException {
5860
5961 classEntity .setMethods (methods );
6062 classEntity .setImports (imports );
63+ classEntity .setTechnicalDebtComments (debt );
6164 }
6265
6366 return classEntity ;
@@ -74,25 +77,29 @@ public void visit(ClassOrInterfaceDeclaration n, Void arg) {
7477
7578 for (Comment comment :n .getAllContainedComments ()) {
7679 if (containsKeyword (comment .getContent ())){
77- System .out .println (comment .getContent ());
80+ debt .add (comment .getContent ());
81+ //System.out.println(comment.getContent());
7882 }
7983 }
8084
8185 if (n .getComment ().isPresent ()){
8286 if (containsKeyword (n .getComment ().get ().getContent ())){
83- System .out .println (n .getComment ().get ().getContent ());
87+ debt .add (n .getComment ().get ().getContent ());
88+ //System.out.println(n.getComment().get().getContent());
8489 }
8590 }
8691
8792 if (n .getJavadocComment ().isPresent ()){
8893 if (containsKeyword (n .getJavadocComment ().get ().getContent ())){
89- System .out .println (n .getJavadocComment ().get ().getContent ());
94+ debt .add (n .getJavadocComment ().get ().getContent ());
95+ //System.out.println(n.getJavadocComment().get().getContent());
9096 }
9197 }
9298
9399 for (Comment comment :n .getOrphanComments ()) {
94100 if (containsKeyword (comment .getContent ())){
95- System .out .println (comment .getContent ());
101+ debt .add (comment .getContent ());
102+ //System.out.println(comment.getContent());
96103 }
97104 }
98105
0 commit comments