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.

Invalid rendering in Java after .class element in function arguments

See original GitHub issue

Describe the issue

The var args attributes of Map.of(…) function containing a .class are not properly rendered.

Which language seems to have the issue? Java language

Are you using highlight or highlightAuto?

I don’t know, I am using highlight.js with @asciidoc/reveal.js module

Sample Code to Reproduce

    Map<String, Object> producerConfig = Map.of(
      BOOTSTRAP_SERVERS_CONFIG, "localhost:9092",
      ACKS_CONFIG, "1",
      KEY_SERIALIZER_CLASS_CONFIG, IntegerSerializer.class,
      VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class
    );

Renders as Firefox_Screenshot_2021-03-21T14-19-39 454Z

The problem seems to be related to the .class element, replacing IntegerSerializer.class by a String fixes the problem.

Expected behavior The last Map element should be rendered as the previous one.

Additional context

Highlight.js 9.18.3 in Chrome with Github Theme

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gquintanacommented, Mar 21, 2021

Thank you very much for your help and your quick answers.

I manage to upgrade for real 😉

1reaction
gquintanacommented, Mar 21, 2021

The Highlight JS version used is not the one I thought. My bad, it is 9.18.1. https://jsfiddle.net/83dzw1ux/1/

This issue seems to be fixed in recent releases.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Wrong number of arguments error when invoking a method
I have class AClass and a method someMethod that gets an Object array as parameter. Object[] parameters; // lets say this object array...
Read more >
java - Parameters are passed by value, but editing them will ...
When an objects is passed into a method as a parameter, it is also the reference that is copied, so the called method...
Read more >
The Method Declaration
Java requires that a method declare the data type of the value that it returns. If a method does not return a value,...
Read more >
Java Advanced Imaging: Class RenderedOp
This method performs the actions described by the documentation of createInstance() optionally marking the node as rendered according to the parameter.
Read more >
SyntaxError: missing ) after argument list - JavaScript | MDN
There is an error with how a function is called. This might be a typo, a missing operator, or an unescaped string, for...
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