Tokeiimporter throws Error root.asJsonObject.get(TOP_LEVEL_OBJECT) must not be null
See original GitHub issueBug
Expected Behavior
WHEN running tokei . --output json > tokei_results.json
AND afterwards running ccsh tokeiimporter -o tokei_results.cc.json tokei_results.json
THEN no error occurs
Actual Behavior
WHEN running tokei . --output json > tokei_results.json
AND afterwards running ccsh tokeiimporter -o tokei_results.cc.json tokei_results.json
THEN an error occurs: root.asJsonObject.get(TOP_LEVEL_OBJECT) must not be null
% tokei . --output json > tokei_results.json
% ccsh tokeiimporter -o tokei.cc.json tokei_results.json
Exception in thread "main" picocli.CommandLine$ExecutionException: Error while calling command (de.maibornwolff.codecharta.importer.tokeiimporter.TokeiImporter@7ce6a65d): java.lang.IllegalStateException: root.asJsonObject.get(TOP_LEVEL_OBJECT) must not be null
at picocli.CommandLine.execute(CommandLine.java:1016)
at picocli.CommandLine.access$900(CommandLine.java:142)
at picocli.CommandLine$RunAll.handleParseResult(CommandLine.java:1229)
at picocli.CommandLine.parseWithHandlers(CommandLine.java:1305)
at picocli.CommandLine.parseWithHandler(CommandLine.java:1258)
at de.maibornwolff.codecharta.tools.ccsh.Ccsh$Companion.main(Ccsh.kt:66)
at de.maibornwolff.codecharta.tools.ccsh.Ccsh.main(Ccsh.kt)
Caused by: java.lang.IllegalStateException: root.asJsonObject.get(TOP_LEVEL_OBJECT) must not be null
at de.maibornwolff.codecharta.importer.tokeiimporter.TokeiImporter$call$1.invokeSuspend(TokeiImporter.kt:73)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Example file
Steps to Reproduce the Problem
- Install
tokeiaccording to the README - Run
tokei . --output json > tokei_results.json - Run
ccsh tokeiimporter -o tokei.cc.json tokei_results.json
Specifications
- is released in online-demo: yes
- CodeCharta Version: 1.50.0
- OS: macOS
- Shell: zsh
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Can an array be top-level JSON-text? - Stack Overflow
Yes, an array is legal as top-level JSON-text. ... Yes, but you should consider making the root an object instead in some scenarios, ......
Read more >NullPointerException during parsing object #1298 - GitHub
I'm getting some blob from network and trying to parse it. ... I'm sure that top-level String is not null, and the data...
Read more >JSONObjectUtils (Nimbus JOSE + JWT v9.5) - javadoc.io
Must not be null . Returns: The JSON object. Throws: ParseException - If the string cannot be parsed to a valid JSON object....
Read more >Working with JSON in Swift - Swift Blog - Apple Developer
The JSONSerialization class method jsonObject(with:options:) returns a value of type Any and throws an error if the data couldn't be parsed.
Read more >JSONObject - Android Developers
When the requested type is a String, other non-null values will be coerced using String#valueOf(Object) . Although null cannot be coerced, the sentinel ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Should we file this as a feature request then? Or change the Issue to Update the Tokei Importer to be able to parse tokei files generate with the newer 12.0 version.
@alschmut Priorty has been set to urgent. This will be fixed for our release on friday. 😃