-4

Quite simple actually. I saw an answer, that desperately screamed for a little formatting as codeblock (quoting JavaDoc), and decided: "Why not suggest an edit?"

Imagine how flabberghasted I was when I realized I can't stop code-prettify:

highlights everywhere

for the record: I also tried <!-- language: none --> but to no avail.

Is it just the preview, or are we not getting class="nocode" anymore?

0

1 Answer 1

9

You need a newline between the paragraph and the comment.

You need to call close() method on your MessageProducer. As per the Java docs:-

<!-- language: lang-none -->

    void close()

renders as:

You need to call close() method on your MessageProducer. As per the Java docs:-

void close()

For documentation quotes, I'd not use a code block; I'd use > block quotes instead, however.

I've edited that answer now to read:

You need to call [`close()` method](http://docs.oracle.com/javaee/6/api/javax/jms/MessageProducer.html#close()) on your `MessageProducer`. As per the Java docs:-

>     void close()  
>                throws JMSException
>
> Closes the message producer.
>   
> Since a provider may allocate some resources on behalf of a `MessageProducer` outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough. 

which formats as:


You need to call close() method on your MessageProducer. As per the Java docs:-

void close()  
           throws JMSException

Closes the message producer.

Since a provider may allocate some resources on behalf of a MessageProducer outside the Java virtual machine, clients should close them when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.


I corrected the documentation quote (it was badly copied), added correct attribution by linking and formatted the throws line to match the documentation indentation.

Now the method signature is even correctly highlighted.

5
  • 2
    This should be a blockquote, not a codeblock at all.
    – Joe
    Commented Aug 14, 2014 at 12:36
  • 1
    @Joe: sure, I was addressing that too; but you do need to answer the initial problem as well. Commented Aug 14, 2014 at 12:37
  • @Vogel612: That indentation doesn't actually add anything here, does it? Commented Aug 14, 2014 at 12:37
  • @Vogel612: ah! I see where that missing word went. I'll correct. Commented Aug 14, 2014 at 12:57
  • @Vogel612: your suggested edit was indeed auto-rejected as it conflicted with an edit I made. Commented Aug 14, 2014 at 12:57

Not the answer you're looking for? Browse other questions tagged .