Index: src/main/resources/Blog/Macros =================================================================== --- src/main/resources/Blog/Macros (revision 5130) +++ src/main/resources/Blog/Macros (working copy) @@ -68,6 +68,8 @@ #set($inbitems = $xwiki.parseInt($nbitems)) #set($inbstart = $xwiki.parseInt($nbstart)) #foreach ($item in $xwiki.searchDocuments($sql, $inbitems, $inbstart)) +## The default foreach counter, $velocityCount, cannot be used outside of the foreach body! +#set($velocityCountOutsideForeachBody = $velocityCount) #set($bentrydoc = $xwiki.getDocument($item)) #if($bentrydoc.fullName == $item) #set($bentryobj = $bentrydoc.getObject("XWiki.ArticleClass")) @@ -101,13 +103,13 @@ #end ## ## prev/next links -#if(($inbstart != 0) || ($velocityCount==$inbitems)) +#if(($inbstart != 0) || ($velocityCountOutsideForeachBody==$inbitems)) <div class="pagingLinks"> #if ($inbstart!=0) #set($iprev = $inbstart - $inbitems) <span class="prevPage">[Previous>$doc.name?nbstart=${iprev}]</span> #end -#if($velocityCount==$inbitems) +#if($velocityCountOutsideForeachBody==$inbitems) #set($inext = $inbstart + $inbitems) <span class="nextPage">[Next>$doc.name?nbstart=${inext}]</span> #end Index: src/main/resources/XWiki/PhotoAlbumClassSheet =================================================================== --- src/main/resources/XWiki/PhotoAlbumClassSheet (revision 5130) +++ src/main/resources/XWiki/PhotoAlbumClassSheet (working copy) @@ -51,7 +51,12 @@ -#set($obj = $doc.getObject("XWiki.PhotoAlbumClass", 0)) +#set($obj = $doc.getObject("XWiki.PhotoAlbumClass", 0)) +#if(!$obj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($obj = "") +#end <br /> 1 $doc.display("title", $obj) Index: src/main/resources/XWiki/PresentationClassSheet =================================================================== --- src/main/resources/XWiki/PresentationClassSheet (revision 5130) +++ src/main/resources/XWiki/PresentationClassSheet (working copy) @@ -59,6 +59,11 @@ * <a href="$doc.getURL("edit","xpage=editobject")">Edit/Remove slides</a>. #set($presobj = $doc.getObject("XWiki.PresentationClass")) +#if(!$presobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($presobj = "") +#end 1.1 Presentation Template @@ -73,6 +78,11 @@ $doc.display("footer", "rendered",$presobj) #macro(slide $slideobj) +#if(!$slideobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($slideobj = "") +#end 1.1 Slide $doc.display("number", $slideobj) Title: $doc.display("title", $slideobj) Index: src/main/resources/XWiki/PresentationClassTemplate =================================================================== --- src/main/resources/XWiki/PresentationClassTemplate (revision 5130) +++ src/main/resources/XWiki/PresentationClassTemplate (working copy) @@ -132,7 +132,7 @@ -#if($request.xpage=="s5b") +#if($request.xpage and $request.xpage=="s5b") #includeForm("XWiki.PresentationClassS5Sheet") #else #if($context.action=="inline") Index: src/main/resources/XWiki/WebSearchCode =================================================================== --- src/main/resources/XWiki/WebSearchCode (revision 5130) +++ src/main/resources/XWiki/WebSearchCode (working copy) @@ -62,7 +62,7 @@ ## the generated RSS feed ## ================================================== #set($datedlist = $xwiki.arrayList) -#if($text == "") +#if(!$text or $text == "") ## No search #else #set($text = $text.replaceAll("'", "''").replaceAll("%", "\\%")) @@ -79,7 +79,7 @@ ## ----------------------------------------------------------- ## Display only a given space if $request.space is defined ## ----------------------------------------------------------- - #if($space == "All") + #if($space and $space == "All") #set ($webClause = "$excludedWebs") #else #set ($webClause = "doc.web='$space' and $excludedWebs") Index: src/main/resources/XWiki/PresentationClassEditSheet =================================================================== --- src/main/resources/XWiki/PresentationClassEditSheet (revision 5130) +++ src/main/resources/XWiki/PresentationClassEditSheet (working copy) @@ -59,6 +59,11 @@ * <a href="$doc.getURL("edit","xpage=editobject")">Edit/Remove slides</a>. #set($presobj = $doc.getObject("XWiki.PresentationClass")) +#if(!$presobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($presobj = "") +#end 1.1 Presentation Template @@ -73,6 +78,11 @@ $doc.display("footer", $presobj) #macro(slide $slideobj) +#if(!$slideobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($slideobj = "") +#end 1.1 Slide $doc.display("number", $slideobj) Title: $doc.display("title", $slideobj) Index: src/main/resources/XWiki/PresentationClassS5Sheet =================================================================== --- src/main/resources/XWiki/PresentationClassS5Sheet (revision 5130) +++ src/main/resources/XWiki/PresentationClassS5Sheet (working copy) @@ -52,6 +52,11 @@ #set($presobj = $doc.getObject("XWiki.PresentationClass")) +#if(!$presobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($presobj = "") +#end <div class="layout"> <div id="currentSlide"></div> <div id="header">$!doc.display("header", "rendered", $presobj)</div> @@ -66,6 +71,11 @@ </div> <div class="presentation"> #macro(slide $slideobj) +#if(!$slideobj) +## String type is more specific than Object type. We should avoid ambiguous method call +## see http://java.sun.com/docs/books/jls/clarifications-2-2nd-ed.html (JLS 15.12.2.2) +#set($slideobj = "") +#end <div class="slide"> <h1>$doc.display("title", $slideobj)</h1> $doc.display("content", "rendered", $slideobj) Index: src/main/resources/XWiki/CopyDocument =================================================================== --- src/main/resources/XWiki/CopyDocument (revision 5130) +++ src/main/resources/XWiki/CopyDocument (working copy) @@ -56,7 +56,7 @@ #set($targetdoc = $request.targetdoc) #set($language = $request.language) -#if ($targetdoc=="") +#if (!$targetdoc or $targetdoc=="") #set($targetdoc = $sourcedoc) #end Index: src/main/resources/Presentations/NameOfYourPresentation =================================================================== --- src/main/resources/Presentations/NameOfYourPresentation (revision 5130) +++ src/main/resources/Presentations/NameOfYourPresentation (working copy) @@ -132,7 +132,7 @@ 0 -#if($request.xpage=="s5b") +#if($request.xpage and $request.xpage=="s5b") #includeForm("XWiki.PresentationClassS5Sheet") #else #if($context.action=="inline")