Skip to content

RuntimeException: 'Range not present on node' during code analysis #148

@divsan93

Description

@divsan93

Error Description

When running the code analyzer version 2.3.5, the following Java exception was encountered:

java.lang.RuntimeException: java.lang.RuntimeException: Range not present on node {
}
        at com.ibm.cldk.CodeAnalyzer.run(CodeAnalyzer.java:121)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1767)
        at picocli.CommandLine.access$900(CommandLine.java:145)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2139)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2106)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1973)
        at picocli.CommandLine.execute(CommandLine.java:1902)
        at com.ibm.cldk.CodeAnalyzer.main(CodeAnalyzer.java:110)
Caused by: java.lang.RuntimeException: Range not present on node {
}
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.storeInitialTextForOneNode(LexicalPreservingPrinter.java:494)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.access$300(LexicalPreservingPrinter.java:62)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter$2.process(LexicalPreservingPrinter.java:479)
        at com.github.javaparser.ast.visitor.TreeVisitor.visitBreadthFirst(TreeVisitor.java:79)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.lambda$storeInitialText$3(LexicalPreservingPrinter.java:482)
        at java.base/java.util.Optional.ifPresent(Optional.java:183)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.storeInitialText(LexicalPreservingPrinter.java:462)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.lambda$setup$0(LexicalPreservingPrinter.java:98)
        at java.base/java.util.Optional.ifPresent(Optional.java:183)
        at com.github.javaparser.printer.lexicalpreservation.LexicalPreservingPrinter.setup(LexicalPreservingPrinter.java:97)
        at com.ibm.cldk.SymbolTable.extractAll(SymbolTable.java:1164)
        at com.ibm.cldk.CodeAnalyzer.analyze(CodeAnalyzer.java:196)
        at com.ibm.cldk.CodeAnalyzer.run(CodeAnalyzer.java:119)

Steps to reproduce

To reproduce the above error, run codeanalyzer(2.3.5) on the following project:
https://github.com/apache/commons-logging

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions