Skip to content

Java:ecj is disabled for create a java database #6933

@yuansec

Description

@yuansec

I use ecj to create codeql database,Have been generated some class files,But an error was returned "No source code was seen and extracted"
my log:
D:\xxxxx>codeql database create test-db-14 --language=java --overwrite --command="java -jar ecj-4.6.3.jar -1.8 src -d out"
Initializing database at D:\xxxxxx\test-db-14.
Running build command: [java, -jar, ecj-4.6.3.jar, -1.8, src, -d, out]
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 1. WARNING in D:\xxxxxx\src\main\java\RmiServer.java (at line 4)
[2021-10-21 22:33:10] [build-stderr] import java.rmi.RemoteException;
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^^^^^^^^^^^^^^^^^^
[2021-10-21 22:33:10] [build-stderr] The import java.rmi.RemoteException is never used
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 2. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 22)
[2021-10-21 22:33:10] [build-stderr] protected Map jjj;
[2021-10-21 22:33:10] [build-stderr] ^^^
[2021-10-21 22:33:10] [build-stderr] Map is a raw type. References to generic type Map<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 3. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 23)
[2021-10-21 22:33:10] [build-stderr] private String priv;
[2021-10-21 22:33:10] [build-stderr] ^^^^
[2021-10-21 22:33:10] [build-stderr] The value of the field Woman.priv is not used
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 4. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 34)
[2021-10-21 22:33:10] [build-stderr] HashMap hashMap = new HashMap();
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^
[2021-10-21 22:33:10] [build-stderr] HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 5. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 34)
[2021-10-21 22:33:10] [build-stderr] HashMap hashMap = new HashMap();
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^
[2021-10-21 22:33:10] [build-stderr] HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 6. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 35)
[2021-10-21 22:33:10] [build-stderr] hashMap.put("test","jjj");
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^^^^^^^^^^^^^^^^^^^
[2021-10-21 22:33:10] [build-stderr] Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 7. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 39)
[2021-10-21 22:33:10] [build-stderr] public Map getJjj() {
[2021-10-21 22:33:10] [build-stderr] ^^^
[2021-10-21 22:33:10] [build-stderr] Map is a raw type. References to generic type Map<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 8. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 41)
[2021-10-21 22:33:10] [build-stderr] HashMap hashMap = new HashMap();
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^
[2021-10-21 22:33:10] [build-stderr] HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 9. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 41)
[2021-10-21 22:33:10] [build-stderr] HashMap hashMap = new HashMap();
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^
[2021-10-21 22:33:10] [build-stderr] HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 10. WARNING in D:\Software2\codeql-code\Fastjson\src\main\java\Woman.java (at line 42)
[2021-10-21 22:33:10] [build-stderr] hashMap.put("test","jjj");
[2021-10-21 22:33:10] [build-stderr] ^^^^^^^^^^^^^^^^^^^^^^^^^
[2021-10-21 22:33:10] [build-stderr] Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap<K,V> should be parameterized
[2021-10-21 22:33:10] [build-stderr] ----------
[2021-10-21 22:33:10] [build-stderr] 10 problems (10 warnings)
Finalizing database at D:\xxxx\test-db-14.
No source code was seen and extracted to D:\xxxx\test-db-14.
This can occur if the specified build commands failed to compile or process any code.

  • Confirm that there is some source code for the specified language in the project.
  • For codebases written in Go, JavaScript, TypeScript, and Python, do not specify
    an explicit --command.
  • For other languages, the --command must specify a "clean" build which compiles
    all the source code files without reusing existing build artefacts.

How can I solve the problem? Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    JavaacknowledgedGitHub staff acknowledges this issuebugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions