Skip to content

Commit 87ecd21

Browse files
committed
remove debug
1 parent 22fc0e6 commit 87ecd21

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

src/main/java/edu/stevens/swe/research/java/cli/analyzer/tasks/ParseTestCaseToLlmContextTask.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -166,48 +166,28 @@ private boolean isTestMethod(MethodDeclaration md) {
166166
private List<Path> findAllTestDirectories(Path projectRoot) {
167167
List<Path> testDirectories = new ArrayList<>();
168168

169-
System.out.println("DEBUG: Starting directory search from: " + projectRoot);
170-
System.out.println("DEBUG: Project root exists: " + Files.exists(projectRoot));
171-
System.out.println("DEBUG: Project root is directory: " + Files.isDirectory(projectRoot));
172-
System.out.println("DEBUG: Project root is readable: " + Files.isReadable(projectRoot));
173-
174-
// Check if basic src/test/java structure exists
175-
Path srcTestJava = projectRoot.resolve("src").resolve("test").resolve("java");
176-
System.out.println("DEBUG: Standard test path: " + srcTestJava);
177-
System.out.println("DEBUG: Standard test path exists: " + Files.exists(srcTestJava));
178-
System.out.println("DEBUG: Standard test path is directory: " + Files.isDirectory(srcTestJava));
179-
180169
try (Stream<Path> paths = Files.walk(projectRoot)) {
181170
List<Path> candidateDirectories = paths.filter(Files::isDirectory)
182171
.filter(this::isTestDirectory)
183172
.collect(java.util.stream.Collectors.toList());
184173

185-
System.out.println("DEBUG: Found " + candidateDirectories.size() + " candidate test directories");
186-
for (Path candidate : candidateDirectories) {
187-
System.out.println("DEBUG: Candidate: " + candidate);
188-
}
189-
190174
// Remove nested directories - only keep the most specific src/test/java directories
191175
for (Path candidate : candidateDirectories) {
192176
boolean isNested = false;
193177
for (Path other : candidateDirectories) {
194178
if (!candidate.equals(other) && candidate.startsWith(other)) {
195179
isNested = true;
196-
System.out.println("DEBUG: " + candidate + " is nested under " + other + ", skipping");
197180
break;
198181
}
199182
}
200183
if (!isNested) {
201184
testDirectories.add(candidate);
202-
System.out.println("DEBUG: Adding final test directory: " + candidate);
203185
}
204186
}
205187
} catch (IOException e) {
206188
System.err.println("Error walking project directory: " + e.getMessage());
207-
e.printStackTrace();
208189
}
209190

210-
System.out.println("DEBUG: Final test directories count: " + testDirectories.size());
211191
return testDirectories;
212192
}
213193

@@ -221,13 +201,6 @@ private boolean isTestDirectory(Path dir) {
221201
// Normalize path separators for cross-platform compatibility
222202
String normalizedPath = pathString.replace('\\', '/');
223203

224-
// Debug output for troubleshooting
225-
if (pathString.contains("test") && pathString.contains("java")) {
226-
System.out.println("DEBUG: Checking potential test directory: " + pathString);
227-
System.out.println("DEBUG: Normalized path: " + normalizedPath);
228-
System.out.println("DEBUG: Dir name: " + dirName);
229-
}
230-
231204
// Skip hidden directories and common non-source directories
232205
if (dirName.startsWith(".") ||
233206
normalizedPath.contains("/.") ||
@@ -239,23 +212,18 @@ private boolean isTestDirectory(Path dir) {
239212
normalizedPath.contains("/.git/") ||
240213
normalizedPath.contains("/.gradle/") ||
241214
normalizedPath.contains("/.m2/")) {
242-
if (pathString.contains("test") && pathString.contains("java")) {
243-
System.out.println("DEBUG: Skipped due to filter: " + normalizedPath);
244-
}
245215
return false;
246216
}
247217

248218
// Standard Maven/Gradle test directory patterns (cross-platform)
249219
if (normalizedPath.endsWith("/src/test/java")) {
250-
System.out.println("DEBUG: Found test directory (standard pattern): " + normalizedPath);
251220
return true;
252221
}
253222

254223
// Additional test directory patterns for different project structures
255224
// Be more specific to avoid false positives
256225
if (normalizedPath.contains("/src/test/") && normalizedPath.endsWith("/java") &&
257226
!normalizedPath.contains("/build/") && !normalizedPath.contains("/target/")) {
258-
System.out.println("DEBUG: Found test directory (extended pattern): " + normalizedPath);
259227
return true;
260228
}
261229

@@ -267,7 +235,6 @@ private boolean isTestDirectory(Path dir) {
267235
if (srcParent != null && srcParent.getFileName().toString().equals("src")) {
268236
// Ensure it's not in a build directory (using normalized path)
269237
if (!normalizedPath.contains("/build/") && !normalizedPath.contains("/target/") && !normalizedPath.contains("/bin/")) {
270-
System.out.println("DEBUG: Found test directory (multi-module pattern): " + normalizedPath);
271238
return true;
272239
}
273240
}

0 commit comments

Comments
 (0)