question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tokeiimporter throws Error root.asJsonObject.get(TOP_LEVEL_OBJECT) must not be null

See original GitHub issue

Bug

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

tokei_results.json.zip

Steps to Reproduce the Problem

  1. Install tokei according to the README
  2. Run tokei . --output json > tokei_results.json
  3. 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:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
RomanenkoVladimircommented, Jul 16, 2020

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.

1reaction
NearWcommented, Aug 2, 2020

@alschmut Priorty has been set to urgent. This will be fixed for our release on friday. 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found