Closed Sin-Mim closed 8 months ago
it seems that one input file cannot be correctly parsed with Spoon.
could you try to add a guard at LogicalExpressionAnalyzer.java:684?
Thanks for the support. I applied the patch below
diff --git a/src/main/java/fr/inria/coming/codefeatures/codeanalyze/LogicalExpressionAnalyzer.java b/src/main/java/fr/inria/coming/codefeatures/codeanalyze/LogicalExpressionAnalyzer.java
index 12051ac3..e1b47f87 100755
--- a/src/main/java/fr/inria/coming/codefeatures/codeanalyze/LogicalExpressionAnalyzer.java
+++ b/src/main/java/fr/inria/coming/codefeatures/codeanalyze/LogicalExpressionAnalyzer.java
@@ -681,7 +681,7 @@ public class LogicalExpressionAnalyzer extends AbstractCodeAnalyzer {
for (CtInvocation invocation : invocationssInStatement) {
- if(!invocation.getTarget().toString().isEmpty()) {
+ if(invocation.getTarget() != null && !invocation.getTarget().toString().isEmpty()) {
continue;
}
I am not getting the NullPointerException
anymore, but the code description features are still not being generated and there are still the following errors/warnings.
log4j:WARN File option not set for appender [file].
log4j:WARN Are you using FileAppender instead of ConsoleAppender?
log4j:ERROR No output stream or file set for the appender named [file].
I also tried it on the simple code below
// Math_70_BisectionSolver_s.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Foo!");
}
}
// Math_70_BisectionSolver_t.java
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
and got the same results (the warnings and the error above).
this works for me.
@Test
public void testissue259() throws Exception {
//java - classpath. / target / coming - 0 - SNAPSHOT - jar - with - dependencies.jar fr.inria.coming.main.ComingMain - location. / files2compare - input files - mode features - output. / out
fr.inria.coming.main.ComingMain.main(new String[] { "-location", "./repogit4testv0", "-input", "git", "-output", "out", "-mode", "features" });
}
can you try in input git
instead of files
?
I found that after adding the guard at LogicalExpressionAnalyzer.java:684
, Coming was actually generating the features correctly for both files
and git
input types. I appreciate your support.
Great, could you send a pull-request with the fix?
I have created a pull request regarding this issue.
Hi, I'm trying to run Coming in feature mode. I installed the project with maven. When I run
java -classpath ./target/coming-0-SNAPSHOT-jar-with-dependencies.jar fr.inria.coming.main.ComingMain -location ./files2compare -input files -mode features -output ./out
. I get context and repair pattern features but code features are not being generated. Also, I'm getting errors/warnings below,Am I missing something?