yinwang0 / pysonar2

PySonar2: a semantic indexer for Python with interprocedual type inference

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Maven compilation issue

maldil opened this issue · comments

My expectation is to use pysonar to infer types of a large python code. I got stuck in the beginning, that is at the compilation of the project. It gives following errors which regards "Module is ambiguous" .

My system details
mvn -verion Apache Maven 3.5.4 ( Maven home: /Applications/apache-maven-3.5.4 Java version: 10.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home

I am wondering whether I have missed a basic stuff.

On a different note, even though the description of the repo says to checkout tags/v2.1.1, I noticed, only v2.0 and v2.1 exists. Further, I noticed another pysonar project in https://github.com/lambdalabdesigner/pysonar2. Can I know the difference of these two projects?

Errors

[INFO] Scanning for projects... [INFO] [INFO] ------------------------< org.yinwang:pysonar >------------------------- [INFO] Building pysonar2 2.1.1 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pysonar --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 5 resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pysonar --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 111 source files to /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/target/classes [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/$.java:[7,33] sun.net.www.protocol.file.FileURLConnection is internal proprietary API and may be removed in a future release [WARNING] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/$.java:[216,45] sun.net.www.protocol.file.FileURLConnection is internal proprietary API and may be removed in a future release [WARNING] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/Visitor1.java: Some input files use unchecked or unsafe operations. [WARNING] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/Visitor1.java: Recompile with -Xlint:unchecked for details. [WARNING] Some messages have been simplified; recompile with -Xdiags:verbose to get full output [INFO] 5 warnings [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/TypeInferencer.java:[45,23] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/Visitor1.java:[199,13] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/Visitor0.java:[196,13] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/Visitor2.java:[194,13] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/Binding.java:[94,36] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/Binding.java:[95,22] reference to Module is ambiguous both class org.yinwang.pysonar.ast.Module in org.yinwang.pysonar.ast and class java.lang.Module in java.lang match [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/TypeInferencer.java:[45,17] visit(Module,org.yinwang.pysonar.State) in org.yinwang.pysonar.visitor.TypeInferencer cannot implement <N,O>visit(java.util.List<N>,P) in org.yinwang.pysonar.visitor.Visitor1 return type org.yinwang.pysonar.types.Type is not compatible with java.util.List<O> [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/TypeInferencer.java:[56,17] name clash: class TypeInferencer has two methods with the same erasure, yet neither overrides the other first method: visit(Module,org.yinwang.pysonar.State) in org.yinwang.pysonar.visitor.Visitor1 second method: visit(org.yinwang.pysonar.ast.ListComp,org.yinwang.pysonar.State) in org.yinwang.pysonar.visitor.Visitor1 [ERROR] /Users/malinda/Documents/RectrofitinMLtoCode/Python/Codes/pysonar2/src/main/java/org/yinwang/pysonar/visitor/TypeInferencer.java:[62,17] name clash: class TypeInferencer has two methods with the same erasure, yet neither overrides the other first method: visit(Module,org.yinwang.pysonar.State) in org.yinwang.pysonar.visitor.Visitor1 second method: visit(org.yinwang.pysonar.ast.ListComp,org.yinwang.pysonar.State) in org.yinwang.pysonar.visitor.Visitor1

The cause is Java 9 introduced java.lang.Module, which conflicts with pysonar's Module class name.

https://docs.oracle.com/javase/9/docs/api/java/lang/class-use/Module.html

Fill push a fix soon.