[xwiki-devs] [xwiki-notifications] r35963 - platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-code/src/main/java/org/xwiki/rendering/internal/parser/pygments

Vincent Massol vincent at massol.net
Thu Mar 24 08:15:41 UTC 2011


On Mar 24, 2011, at 8:28 AM, tmortagne (SVN) wrote:

> Author: tmortagne
> Date: 2011-03-24 08:28:33 +0100 (Thu, 24 Mar 2011)
> New Revision: 35963
> 
> Modified:
>   platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-code/src/main/java/org/xwiki/rendering/internal/parser/pygments/PygmentsParser.java
> Log:
> XWIKI-6164: PyGments: Failed to highlight content when web server is rendering another page in the same time
> 
> Modified: platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-code/src/main/java/org/xwiki/rendering/internal/parser/pygments/PygmentsParser.java
> ===================================================================
> --- platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-code/src/main/java/org/xwiki/rendering/internal/parser/pygments/PygmentsParser.java	2011-03-24 02:11:29 UTC (rev 35962)
> +++ platform/core/trunk/xwiki-rendering/xwiki-rendering-macros/xwiki-rendering-macro-code/src/main/java/org/xwiki/rendering/internal/parser/pygments/PygmentsParser.java	2011-03-24 07:28:33 UTC (rev 35963)
> @@ -210,7 +210,7 @@
>      * @return the highlighted version of the provided source.
>      * @throws ParseException the highlighting failed.
>      */
> -    private List<Block> highlight(String syntaxId, String code) throws ParseException
> +    private synchronized List<Block> highlight(String syntaxId, String code) throws ParseException
>     {
>         PythonInterpreter interpreter = getPythonInterpreter();

Cool that we fixed this one!

IMO we need a comment mentioning that getPythonInterpreter() is not thread safe (if that's the problem).

Thanks
-Vincent

>         BlocksGeneratorPygmentsListener listener = new BlocksGeneratorPygmentsListener(this.plainTextParser);
> 
> _______________________________________________
> notifications mailing list
> notifications at xwiki.org
> http://lists.xwiki.org/mailman/listinfo/notifications




More information about the devs mailing list