You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering compilation errors with the Checker Framework when minimizing classes from the ASHE project, specifically the ASHE#run(String, String, String) method. The minimization process seems to disrupt the dependencies within the project, particularly when the target class relies on other internal classes.
Working Example
Arguments
NOTE: The arguments are different than the main branch on GitHub. The directory has changed on my local environment, which is why the typical would not use edu.njit.jerse.ashe.ASHE#run(String, String, String), but rather edu.njit.jerse.ASHE#run(String, String, String).
I used the following arguments for the Specimin minimization process:
public class ASHE {
private static final Logger LOGGER = LogManager.getLogger(ASHE.class);
public void run(String root, String targetFile, String targetMethod) throws IOException, ExecutionException, InterruptedException, TimeoutException {
JavaCodeCorrector corrector = new JavaCodeCorrector();
String speciminTempDir = corrector.minimizeTargetFile(root, targetFile, targetMethod);
final String sourceFilePath = speciminTempDir + "/" + targetFile;
boolean errorsReplacedInTargetFile = corrector.fixTargetFileErrorsWithGPT(sourceFilePath, targetMethod);
if (!errorsReplacedInTargetFile) {
if (corrector.checkedFileError(sourceFilePath).isEmpty()) {
return;
} else {
throw new RuntimeException("Errors were not replaced with GPT response.");
}
}
String methodName = JavaCodeParser.extractMethodName(targetMethod);
String originalFilePath = root + "/" + targetFile;
boolean isOriginalMethodReplaced = MethodReplacementService.replaceOriginalTargetMethod(sourceFilePath, originalFilePath, methodName);
if (!isOriginalMethodReplaced) {
throw new RuntimeException("Original method was not replaced.");
}
}
}
Exception Observed
During the compilation with Checker Framework after minimization, the following compilation errors were observed (example paths are replaced with generic ones for privacy):
21:27:40.199 [main] INFO edu.njit.jerse.ashe.services.CheckerFrameworkCompiler - Attempting to compile Java class using Checker Framework: /my/temp/dir/edu/njit/jerse/ashe/ASHE.java
21:27:40.199 [main] INFO edu.njit.jerse.ashe.services.CheckerFrameworkCompiler - Constructing compilation command for Java class: /my/temp/dir/edu/njit/jerse/ashe/ASHE.java
21:27:41.265 [main] WARN edu.njit.jerse.ashe.services.CheckerFrameworkCompiler - Compilation error for classPath /my/temp/dir/edu/njit/jerse/ashe/ASHE.java:
error: package edu.njit.jerse.ashe.services does not exist
import edu.njit.jerse.ashe.services.MethodReplacementService;
^
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:4: error: package edu.njit.jerse.ashe.utils does not exist
import edu.njit.jerse.ashe.utils.JavaCodeCorrector;
^
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:5: error: package edu.njit.jerse.ashe.utils does not exist
import edu.njit.jerse.ashe.utils.JavaCodeParser;
^
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:6: error: package org.apache.logging.log4j does not exist
import org.apache.logging.log4j.LogManager;
^
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:7: error: package org.apache.logging.log4j does not exist
import org.apache.logging.log4j.Logger;
^
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:14: error: cannot find symbol
private static final Logger LOGGER = LogManager.getLogger(ASHE.class);
^
symbol: class Logger
location: class ASHE
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:14: error: cannot find symbol
private static final Logger LOGGER = LogManager.getLogger(ASHE.class);
^
symbol: variable LogManager
location: class ASHE
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:17: error: cannot find symbol
JavaCodeCorrector corrector = new JavaCodeCorrector();
^
symbol: class JavaCodeCorrector
location: class ASHE
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:17: error: cannot find symbol
JavaCodeCorrector corrector = new JavaCodeCorrector();
^
symbol: class JavaCodeCorrector
location: class ASHE
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:28: error: cannot find symbol
String methodName = JavaCodeParser.extractMethodName(targetMethod);
^
symbol: variable JavaCodeParser
location: class ASHE
/my/temp/dir/edu/njit/jerse/ashe/ASHE.java:30: error: cannot find symbol
boolean isOriginalMethodReplaced = MethodReplacementService.replaceOriginalTargetMethod(sourceFilePath, originalFilePath, methodName);
^
symbol: variable MethodReplacementService
location: class ASHE
Suspected Issue
It appears that the Specimin minimization process might not be correctly handling or preserving the project's internal dependencies, leading to compilation failures. The issue is particularly evident when the minimized class is tightly coupled with other internal components of the project.
The text was updated successfully, but these errors were encountered:
I am encountering compilation errors with the Checker Framework when minimizing classes from the ASHE project, specifically the ASHE#run(String, String, String) method. The minimization process seems to disrupt the dependencies within the project, particularly when the target class relies on other internal classes.
Working Example
Arguments
NOTE: The arguments are different than the main branch on GitHub. The directory has changed on my local environment, which is why the typical would not use edu.njit.jerse.ashe.ASHE#run(String, String, String), but rather edu.njit.jerse.ASHE#run(String, String, String).
I used the following arguments for the Specimin minimization process:
--args=--outputDirectory "my/temp/dir" --root "my/root/to/ASHE_Automated-Software-Hardening-for-Entrypoints/src/main/java" --targetFile "edu/njit/jerse/ashe/ASHE.java" --targetMethod "edu.njit.jerse.ashe.ASHE#run(String, String, String)"
Relevant Code Snippet from ASHE.java
Exception Observed
During the compilation with Checker Framework after minimization, the following compilation errors were observed (example paths are replaced with generic ones for privacy):
Suspected Issue
It appears that the Specimin minimization process might not be correctly handling or preserving the project's internal dependencies, leading to compilation failures. The issue is particularly evident when the minimized class is tightly coupled with other internal components of the project.
The text was updated successfully, but these errors were encountered: