You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/04/27 07:16:13 UTC

[groovy] 04/05: minor refactor: remove javadoc warnings (cont'd)

This is an automated email from the ASF dual-hosted git repository.

paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit d6854eed2ab504f2841e79f1d7f68354981d677f
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Apr 27 14:38:16 2019 +1000

    minor refactor: remove javadoc warnings (cont'd)
---
 .../groovy/jmx/builder/JmxBuilderModelMBean.java   |  5 +-
 .../src/main/java/groovy/json/JsonBuilder.java     |  4 +-
 .../src/main/java/groovy/json/JsonGenerator.java   |  2 +-
 .../java/groovy/json/StreamingJsonBuilder.java     | 36 ++++-----
 .../codehaus/groovy/runtime/NioGroovyMethods.java  | 16 ++--
 .../main/java/groovy/servlet/GroovyServlet.java    | 20 ++---
 .../src/main/java/groovy/sql/DataSet.java          |  4 +
 .../java/groovy/sql/ResultSetMetaDataWrapper.java  |  2 +-
 .../groovy-sql/src/main/java/groovy/sql/Sql.java   | 86 +++++++++++-----------
 .../groovy/text/StreamingTemplateEngine.java       | 30 ++++----
 .../main/groovy/groovy/text/XmlTemplateEngine.java |  4 +-
 .../groovy/util/JavadocAssertionTestBuilder.groovy |  3 +-
 .../groovy/util/slurpersupport/GPathResult.java    |  4 +-
 .../src/main/java/groovy/xml/MarkupBuilder.java    | 14 ++--
 .../src/main/java/groovy/yaml/YamlBuilder.java     |  4 +-
 15 files changed, 122 insertions(+), 112 deletions(-)

diff --git a/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java b/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
index 8cd1f0f..2250e2a 100644
--- a/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
+++ b/subprojects/groovy-jmx/src/main/java/groovy/jmx/builder/JmxBuilderModelMBean.java
@@ -72,7 +72,7 @@ public class JmxBuilderModelMBean extends RequiredModelMBean implements Notifica
     /**
      * Registers listeners for operation calls (i.e. method, getter, and setter calls) when
      * invoked on this bean from the MBeanServer.  Descriptor should contain a map with layout
-     * item -> [Map[methodListener:[target:"", tpe:"", callback:&amp;Closure], ... ,]]
+     * {@code item -> [Map[methodListener:[target:"", tpe:"", callback:&Closure], ... ,]]}
      *
      * @param descriptor MetaMap descriptor containing description of operation call listeners
      */
@@ -109,7 +109,8 @@ public class JmxBuilderModelMBean extends RequiredModelMBean implements Notifica
 
     /**
      * Sets up event listeners for this MBean as described in the descriptor.
-     * The descriptor contains a map with layout {item -> Map[event:"...", from:ObjectName, callback:&amp;Closure],...,}
+     * The descriptor contains a map with layout
+     * {item -&gt; Map[event:"...", from:ObjectName, callback:&amp;Closure],...,}
      *
      * @param server     the MBeanServer is to be registered.
      * @param descriptor a map containing info about the event
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
index 999d53a..6a1ca8e 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonBuilder.java
@@ -193,7 +193,7 @@ public class JsonBuilder extends GroovyObjectSupport implements Writable {
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
      * def json = new groovy.json.JsonBuilder()
-     * json authors, { Author author ->
+     * json authors, { Author author {@code ->}
      *      name author.name
      * }
      *
@@ -400,7 +400,7 @@ public class JsonBuilder extends GroovyObjectSupport implements Writable {
      * json { temperature 37 }
      *
      * def out = new StringWriter()
-     * out << json
+     * out {@code <<} json
      *
      * assert out.toString() == '{"temperature":37}'
      * </code></pre>
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
index be61d67..bd9e89a 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/JsonGenerator.java
@@ -225,7 +225,7 @@ public interface JsonGenerator {
          * Example:
          * <pre><code class="groovyTestCase">
          *     def generator = new groovy.json.JsonGenerator.Options()
-         *                         .addConverter(URL) { URL u ->
+         *                         .addConverter(URL) { URL u {@code ->}
          *                             u.getHost()
          *                         }
          *                         .build()
diff --git a/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java b/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
index 9dd6086..f69dd36 100644
--- a/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
+++ b/subprojects/groovy-json/src/main/java/groovy/json/StreamingJsonBuilder.java
@@ -48,7 +48,7 @@ import java.util.Map;
  * <p>
  * Example:
  * <pre class="groovyTestCase">
- *     new StringWriter().with { w ->
+ *     new StringWriter().with { w {@code ->}
  *         def builder = new groovy.json.StreamingJsonBuilder(w)
  *         builder.people {
  *             person {
@@ -135,7 +135,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json name: "Tim", age: 31
      *
@@ -155,7 +155,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
     /**
      * The empty args call will create a key whose value will be an empty JSON object:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person()
      *
@@ -175,7 +175,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   def result = json([1, 2, 3])
      *
@@ -198,7 +198,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   def result = json 1, 2, 3
      *
@@ -225,9 +225,9 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * }
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
-     *     json authors, { Author author ->
+     *     json authors, { Author author {@code ->}
      *         name author.name
      *     }
      *
@@ -253,7 +253,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json {
      *      name "Tim"
@@ -279,7 +279,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *   def json = new groovy.json.StreamingJsonBuilder(w)
      *   json.person {
      *      name "Tim"
@@ -312,9 +312,9 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * }
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
-     *     json.people authors, { Author author ->
+     *     json.people authors, { Author author {@code ->}
      *         name author.name
      *     }
      *
@@ -348,7 +348,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * in case the same key is used.
      *
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person(name: "Tim", age: 35) { town "Manchester" }
      *
@@ -403,7 +403,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * <p>
      * Example with a classical builder-style:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person {
      *         name "Tim"
@@ -416,7 +416,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      *
      * Or alternatively with a method call taking named arguments:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person name: "Tim", age: 32
      *
@@ -431,7 +431,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      * the closure properties overriding the map key/values
      * in case the same key is used.
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person(name: "Tim", age: 35) { town "Manchester" }
      *
@@ -441,7 +441,7 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
      *
      * The empty args call will create a key whose value will be an empty JSON object:
      * <pre class="groovyTestCase">
-     * new StringWriter().with { w ->
+     * new StringWriter().with { w {@code ->}
      *     def json = new groovy.json.StreamingJsonBuilder(w)
      *     json.person()
      *
@@ -628,10 +628,10 @@ public class StreamingJsonBuilder extends GroovyObjectSupport {
          * }
          * def authorList = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
          *
-         * new StringWriter().with { w ->
+         * new StringWriter().with { w {@code ->}
          *     def json = new groovy.json.StreamingJsonBuilder(w)
          *     json.book {
-         *        authors authorList, { Author author ->
+         *        authors authorList, { Author author {@code ->}
          *         name author.name
          *       }
          *     }
diff --git a/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java b/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
index e5234e9..947d28c 100644
--- a/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
+++ b/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java
@@ -465,7 +465,7 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * </pre>
      * or with some help from <code>ExpandoMetaClass</code>, you could do something like:
      * <pre>
-     * myFile.metaClass.setText = { String s -> delegate.setText(s, 'UTF-8') }
+     * myFile.metaClass.setText = { String s {@code ->} delegate.setText(s, 'UTF-8') }
      * myfile.text = 'some text'
      * </pre>
      *
@@ -965,8 +965,8 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * <pre>
      * def totalSize = 0
      * def count = 0
-     * def sortByTypeThenName = { a, b ->
-     *     a.isFile() != b.isFile() ? a.isFile() <=> b.isFile() : a.name <=> b.name
+     * def sortByTypeThenName = { a, b {@code ->}
+     *     a.isFile() != b.isFile() ? a.isFile() {@code <=>} b.isFile() : a.name {@code <=>} b.name
      * }
      * rootDir.traverse(
      *         type         : FILES,
@@ -976,7 +976,7 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      *                         totalSize = 0; count = 0 },
      *         postRoot     : true
      *         sort         : sortByTypeThenName
-     * ) {it -> totalSize += it.size(); count++ }
+     * ) {it {@code ->} totalSize += it.size(); count++ }
      * </pre>
      *
      * @param self    a Path (that happens to be a folder/directory)
@@ -1197,14 +1197,14 @@ public class NioGroovyMethods extends DefaultGroovyMethodsSupport {
      * // collect names of files in baseDir matching supplied regex pattern
      * import static groovy.io.FileType.*
      * def names = []
-     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names << it.name }
+     * baseDir.eachFileMatch FILES, ~/foo\d\.txt/, { names {@code <<} it.name }
      * assert names == ['foo1.txt', 'foo2.txt']
      *
      * // remove all *.bak files in baseDir
-     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { Path bak -> bak.delete() }
+     * baseDir.eachFileMatch FILES, ~/.*\.bak/, { Path bak {@code ->} bak.delete() }
      *
-     * // print out files > 4K in size from baseDir
-     * baseDir.eachFileMatch FILES, { new Path(baseDir, it).size() > 4096 }, { println "$it.name ${it.size()}" }
+     * // print out files &gt; 4K in size from baseDir
+     * baseDir.eachFileMatch FILES, { new Path(baseDir, it).size() {@code >} 4096 }, { println "$it.name ${it.size()}" }
      * </pre>
      *
      * @param self       a Path (that happens to be a folder/directory)
diff --git a/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java b/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
index 73b044d..ea0ac9a 100644
--- a/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
+++ b/subprojects/groovy-servlet/src/main/java/groovy/servlet/GroovyServlet.java
@@ -52,16 +52,18 @@ import java.io.IOException;
  * web.xml entry:
  *
  * <pre>
- *    &lt;servlet>
- *      &lt;servlet-name>Groovy&lt;/servlet-name>
- *      &lt;servlet-class>groovy.servlet.GroovyServlet&lt;/servlet-class>
- *    &lt;/servlet>
+ * {@code
+ *    <servlet>
+ *      <servlet-name>Groovy</servlet-name>
+ *      <servlet-class>groovy.servlet.GroovyServlet</servlet-class>
+ *    </servlet>
  *
- *    &lt;servlet-mapping>
- *      &lt;servlet-name>Groovy&lt;/servlet-name>
- *      &lt;url-pattern>*.groovy&lt;/url-pattern>
- *      &lt;url-pattern>*.gdo&lt;/url-pattern>
- *    &lt;/servlet-mapping>
+ *    <servlet-mapping>
+ *      <servlet-name>Groovy</servlet-name>
+ *      <url-pattern>*.groovy</url-pattern>
+ *      <url-pattern>*.gdo</url-pattern>
+ *    </servlet-mapping>
+ * }
  * </pre>
  *
  * <p>The URL pattern does not require the "*.groovy" mapping.  You can, for
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
index 7d3c922..0ea6b91 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/DataSet.java
@@ -40,6 +40,7 @@ import java.util.Set;
  * and querying databases using POGO fields and operators rather than
  * JDBC-level API calls and RDBMS column names. So, instead of a query like:
  * <pre>
+ * {@code
  * def db = // an instance of groovy.sql.Sql
  * def sql = '''select * from Person
  *     where (purchaseCount > ? and birthMonth = ?)
@@ -48,9 +49,11 @@ import java.util.Set;
  *     order by firstName DESC, age'''
  * def params = [10, "January", "Zulu", "Alpha", 99, 5, "Bert"]
  * def sortedPeopleOfInterest = db.rows(sql, params)
+ * }
  * </pre>
  * You can write code like this:
  * <pre>
+ * @{code
  * def person = new DataSet(db, 'Person') // or db.dataSet('Person'), or db.dataSet(Person)
  * def janFrequentBuyers = person.findAll { it.purchaseCount > 10 && it.lastName == "January" }
  * def sortedPeopleOfInterest = janFrequentBuyers.
@@ -60,6 +63,7 @@ import java.util.Set;
  *     sort{ it.firstName }.reverse().
  *     findAll{ it.firstName != 'Bert' }.
  *     sort{ it.age }
+ * }
  * </pre>
  * Currently, the Groovy source code for any accessed POGO must be on the
  * classpath at runtime. Also, at the moment, the expressions (or nested expressions) can only contain
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java b/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
index 025d171..b73360f 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/ResultSetMetaDataWrapper.java
@@ -29,7 +29,7 @@ import java.sql.ResultSetMetaData;
  * This class defines a wrapper for accessing a specific column in <code>ResultSetMetaData</code>.
  * This allows iteration over columns using idiomatic Groovy, e.g.:
  * <pre>
- * meta.each {col ->
+ * meta.each {col {@code ->}
  *   println col.columnName
  * }
  * </pre>
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
index 8081138..52589c5 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/Sql.java
@@ -110,7 +110,7 @@ import static org.apache.groovy.sql.extensions.SqlExtensions.toRowResult;
  * Now try a query using <code>eachRow</code>:
  * <pre>
  * println 'Some GR8 projects:'
- * sql.eachRow('select * from PROJECT') { row ->
+ * sql.eachRow('select * from PROJECT') { row {@code ->}
  *     println "${row.name.padRight(10)} ($row.url)"
  * }
  * </pre>
@@ -135,7 +135,7 @@ import static org.apache.groovy.sql.extensions.SqlExtensions.toRowResult;
  * </pre>
  * Also, <code>eachRow</code> and <code>rows</code> support paging.  Here's an example: 
  * <pre>
- * sql.eachRow('select * from PROJECT', 2, 2) { row ->
+ * sql.eachRow('select * from PROJECT', 2, 2) { row {@code ->}
  *     println "${row.name.padRight(10)} ($row.url)"
  * }
  * </pre>
@@ -883,7 +883,7 @@ public class Sql implements AutoCloseable {
      * def fieldName = 'firstname'
      * def fieldOp = Sql.expand('like')
      * def fieldVal = '%a%'
-     * sql.query "select * from PERSON where ${Sql.expand(fieldName)} $fieldOp ${fieldVal}", { ResultSet rs ->
+     * sql.query "select * from PERSON where ${Sql.expand(fieldName)} $fieldOp ${fieldVal}", { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname')
      * }
      * // query will be 'select * from PERSON where firstname like ?'
@@ -954,11 +954,11 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usages:
      * <pre>
-     * sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs ->
+     * sql.query("select * from PERSON where firstname like 'S%'") { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname') + ' ' + rs.getString(3)
      * }
      *
-     * sql.query("call get_people_places()") { ResultSet rs ->
+     * sql.query("call get_people_places()") { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.toRowResult().firstname
      * }
      * </pre>
@@ -994,7 +994,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * sql.query('select * from PERSON where lastname like ?', ['%a%']) { ResultSet rs ->
+     * sql.query('select * from PERSON where lastname like ?', ['%a%']) { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('lastname')
      * }
      * </pre>
@@ -1069,7 +1069,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * sql.query "select * from PERSON where location_id < $location", { ResultSet rs ->
+     * sql.query "select * from PERSON where location_id {@code <} $location", { ResultSet rs {@code ->}
      *     while (rs.next()) println rs.getString('firstname')
      * }
      * </pre>
@@ -1095,7 +1095,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usages:
      * <pre>
-     * sql.eachRow("select * from PERSON where firstname like 'S%'") { row ->
+     * sql.eachRow("select * from PERSON where firstname like 'S%'") { row {@code ->}
      *    println "$row.firstname ${row[2]}}"
      * }
      *
@@ -1152,13 +1152,13 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
@@ -1344,13 +1344,13 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
@@ -1416,7 +1416,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * sql.eachRow("select * from PERSON where lastname like ?", ['%a%']) { row ->
+     * sql.eachRow("select * from PERSON where lastname like ?", ['%a%']) { row {@code ->}
      *     println "${row[1]} $row.lastname"
      * }
      * </pre>
@@ -1537,17 +1537,17 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def printColNames = { meta ->
+     * def printColNames = { meta {@code ->}
      *     (1..meta.columnCount).each {
      *         print meta.getColumnLabel(it).padRight(20)
      *     }
      *     println()
      * }
-     * def printRow = { row ->
+     * def printRow = { row {@code ->}
      *     row.toRowResult().values().each{ print it.toString().padRight(20) }
      *     println()
      * }
-     * sql.eachRow("select * from PERSON where location_id < $location", printColNames, printRow)
+     * sql.eachRow("select * from PERSON where location_id {@code <} $location", printColNames, printRow)
      * </pre>
      * <p>
      * Resource handling is performed automatically where appropriate.
@@ -1636,7 +1636,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * sql.eachRow("select * from PERSON where location_id < $location") { row ->
+     * sql.eachRow("select * from PERSON where location_id {@code <} $location") { row {@code ->}
      *     println row.firstname
      * }
      * </pre>
@@ -1704,7 +1704,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      * def ans = sql.rows("select * from PERSON", printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
@@ -1906,7 +1906,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Example usage:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      * def ans = sql.rows("select * from PERSON where lastname like ?", ['%a%'], printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
@@ -1914,7 +1914,7 @@ public class Sql implements AutoCloseable {
      * This method supports named and named ordinal parameters by supplying such
      * parameters in the <code>params</code> list. Here is an example:
      * <pre>
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
      *
      * def mapParam = [foo: 'Smith']
      * def domainParam = new MyDomainClass(bar: 'John')
@@ -2083,7 +2083,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def ans = sql.rows("select * from PERSON where location_id < $location")
+     * def ans = sql.rows("select * from PERSON where location_id {@code <} $location")
      * println "Found ${ans.size()} rows"
      * </pre>
      * <p>
@@ -2107,8 +2107,8 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def printNumCols = { meta -> println "Found $meta.columnCount columns" }
-     * def ans = sql.rows("select * from PERSON where location_id < $location", printNumCols)
+     * def printNumCols = { meta {@code ->} println "Found $meta.columnCount columns" }
+     * def ans = sql.rows("select * from PERSON where location_id {@code <} $location", printNumCols)
      * println "Found ${ans.size()} rows"
      * </pre>
      * <p>
@@ -2195,7 +2195,7 @@ public class Sql implements AutoCloseable {
      * Example usage:
      * <pre>
      * def location = 25
-     * def ans = sql.firstRow("select * from PERSON where location_id < $location")
+     * def ans = sql.firstRow("select * from PERSON where location_id {@code <} $location")
      * println ans.firstname
      * </pre>
      * <p>
@@ -2344,12 +2344,12 @@ public class Sql implements AutoCloseable {
      * Example usages:
      * <pre>
      * boolean first = true
-     * sql.execute "{call FindAllByFirst('J')}", { isResultSet, result ->
+     * sql.execute "{call FindAllByFirst('J')}", { isResultSet, result {@code ->}
      *   if (first) {
      *     first = false
-     *     assert !isResultSet && result == 0
+     *     assert !isResultSet {@code &&} result == 0
      *   } else {
-     *     assert isResultSet && result == [[ID:1, FIRSTNAME:'James', LASTNAME:'Strachan'], [ID:4, FIRSTNAME:'Jean', LASTNAME:'Gabin']]
+     *     assert isResultSet {@code &&} result == [[ID:1, FIRSTNAME:'James', LASTNAME:'Strachan'], [ID:4, FIRSTNAME:'Jean', LASTNAME:'Gabin']]
      *   }
      * }
      * </pre>
@@ -3111,7 +3111,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * we can now call the stored procedure as follows:
      * <pre>
-     * sql.call '{call Hemisphere(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * sql.call '{call Hemisphere(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3153,7 +3153,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * and here is how you access the stored function for all databases:
      * <pre>
-     * sql.call("{? = call FullName(?)}", [Sql.VARCHAR, 'Sam']) { name ->
+     * sql.call("{? = call FullName(?)}", [Sql.VARCHAR, 'Sam']) { name {@code ->}
      *     assert name == 'Sam Pullara'
      * }
      * </pre>
@@ -3179,7 +3179,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Scott'
      * def last = 'Davis'
-     * sql.call "{call Hemisphere($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * sql.call "{call Hemisphere($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3189,7 +3189,7 @@ public class Sql implements AutoCloseable {
      * Once created, it can be called like this:
      * <pre>
      * def first = 'Sam'
-     * sql.call("{$Sql.VARCHAR = call FullName($first)}") { name ->
+     * sql.call("{$Sql.VARCHAR = call FullName($first)}") { name {@code ->}
      *     assert name == 'Sam Pullara'
      * }
      * </pre>
@@ -3220,7 +3220,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Jeff'
      * def last = 'Sheets'
-     * def rows = sql.callWithRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * def rows = sql.callWithRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3249,7 +3249,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Once created, the stored procedure can be called like this:
      * <pre>
-     * def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * def rows = sql.callWithRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3279,7 +3279,7 @@ public class Sql implements AutoCloseable {
      * <pre>
      * def first = 'Jeff'
      * def last = 'Sheets'
-     * def rowsList = sql.callWithAllRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells ->
+     * def rowsList = sql.callWithAllRows "{call Hemisphere2($first, $last, ${Sql.VARCHAR})}", { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3308,7 +3308,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Once created, the stored procedure can be called like this:
      * <pre>
-     * def rowsList = sql.callWithAllRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells ->
+     * def rowsList = sql.callWithAllRows '{call Hemisphere2(?, ?, ?)}', ['Guillaume', 'Laforge', Sql.VARCHAR], { dwells {@code ->}
      *     println dwells
      * }
      * </pre>
@@ -3501,7 +3501,7 @@ public class Sql implements AutoCloseable {
      * configured using this closure. The statement being configured is passed into the closure
      * as its single argument, e.g.:
      * <pre>
-     * sql.withStatement{ stmt -> stmt.maxRows = 10 }
+     * sql.withStatement{ stmt {@code ->} stmt.maxRows = 10 }
      * def firstTenRows = sql.rows("select * from table")
      * </pre>
      *
@@ -3624,7 +3624,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Use it like this:
      * <pre>
-     * def updateCounts = sql.withBatch { stmt ->
+     * def updateCounts = sql.withBatch { stmt {@code ->}
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
@@ -3668,7 +3668,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Use it like this for batchSize of 20:
      * <pre>
-     * def updateCounts = sql.withBatch(20) { stmt ->
+     * def updateCounts = sql.withBatch(20) { stmt {@code ->}
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
      *     stmt.addBatch("insert into TABLENAME ...")
@@ -3732,7 +3732,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * An example:
      * <pre>
-     * def updateCounts = sql.withBatch('insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
+     * def updateCounts = sql.withBatch('insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps {@code ->}
      *     ps.addBatch([10, 12, 5])
      *     ps.addBatch([7, 3, 98])
      *     ps.addBatch(22, 67, 11)
@@ -3782,7 +3782,7 @@ public class Sql implements AutoCloseable {
      * <p>
      * Below is an example using a batchSize of 20:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?, ?, ?)') { ps {@code ->}
      *     ps.addBatch(10, 12, 5)      // varargs style
      *     ps.addBatch([7, 3, 98])     // list
      *     ps.addBatch([22, 67, 11])
@@ -3791,7 +3791,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * Named parameters (into maps or domain objects) are also supported:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (:foo, :bar, :baz)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (:foo, :bar, :baz)') { ps {@code ->}
      *     ps.addBatch([foo:10, bar:12, baz:5])  // map
      *     ps.addBatch(foo:7, bar:3, baz:98)     // Groovy named args allow outer brackets to be dropped
      *     ...
@@ -3799,7 +3799,7 @@ public class Sql implements AutoCloseable {
      * </pre>
      * Named ordinal parameters (into maps or domain objects) are also supported:
      * <pre>
-     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?1.foo, ?2.bar, ?2.baz)') { ps ->
+     * def updateCounts = sql.withBatch(20, 'insert into TABLENAME(a, b, c) values (?1.foo, ?2.bar, ?2.baz)') { ps {@code ->}
      *     ps.addBatch([[foo:22], [bar:67, baz:11]])  // list of maps or domain objects
      *     ps.addBatch([foo:10], [bar:12, baz:5])     // varargs allows outer brackets to be dropped
      *     ps.addBatch([foo:7], [bar:3, baz:98])
@@ -3807,7 +3807,7 @@ public class Sql implements AutoCloseable {
      * }
      * // swap to batch size of 5 and illustrate simple and domain object cases ...
      * class Person { String first, last }
-     * def updateCounts2 = sql.withBatch(5, 'insert into PERSON(id, first, last) values (?1, ?2.first, ?2.last)') { ps ->
+     * def updateCounts2 = sql.withBatch(5, 'insert into PERSON(id, first, last) values (?1, ?2.first, ?2.last)') { ps {@code ->}
      *     ps.addBatch(1, new Person(first:'Peter', last:'Pan'))
      *     ps.addBatch(2, new Person(first:'Snow', last:'White'))
      *     ...
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
index a902404..8be0abc 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/StreamingTemplateEngine.java
@@ -69,9 +69,9 @@ import java.util.Map;
  *   title     : 'Groovy for COBOL programmers'
  * ]
  * def text = '''\
- * Dear <% out.print firstname %> ${lastname},
+ * Dear {@code <%} out.print firstname {@code %>} ${lastname},
  *
- * We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> \
+ * We {@code <%} if (accepted) out.print 'are pleased' else out.print 'regret' {@code %>} \
  * to inform you that your paper entitled
  * '$title' was ${ accepted ? 'accepted' : 'rejected' }.
  *
@@ -119,8 +119,8 @@ import java.util.Map;
  * context lines, ie:
  * <pre>
  *  groovy.text.TemplateExecutionException: Template parse error at line 4:
- *           3: We <% if (accepted) out.print 'are pleased' else out.print 'regret' %> to inform you that your paper entitled
- *       --> 4: '$txitle' was ${ accepted ? 'accepted' : 'rejected' }.
+ *           3: We {@code <%} if (accepted) out.print 'are pleased' else out.print 'regret' {@code %>} to inform you that your paper entitled
+ *       {@code -->} 4: '$txitle' was ${ accepted ? 'accepted' : 'rejected' }.
  *           5:
  * at test.run(test.groovy:18)
  *
@@ -168,11 +168,9 @@ public class StreamingTemplateEngine extends TemplateEngine {
     }
 
     /**
-     * <p>Creates a template instance using the template source from the provided Reader.</p>
-     *
-     * <p>The template can be applied repeatedly on different bindings to produce custom
-     * output.</p>
+     * Creates a template instance using the template source from the provided Reader.
      *
+     * The template can be applied repeatedly on different bindings to produce custom output.
      *
      * <strong>Technical detail</strong><br />
      * Under the hood the returned template is represented as a four argument
@@ -182,21 +180,21 @@ public class StreamingTemplateEngine extends TemplateEngine {
      * In essence we start with a closure on the form:
      *
      * <pre>
-     *   { parentClass, stringSectionList, binding, out ->
+     *   { parentClass, stringSectionList, binding, out {@code ->}
      *      //code generated by parsing the template data
-     *   }                                                                             *
+     *   }
      * </pre>
      *
-     * , we then curry in the parentClass and stringSectionList arguments so that the StreamingTemplate
+     * We then curry in the parentClass and stringSectionList arguments so that the StreamingTemplate
      * instance returned from 'createTemplate' internally contains a template closure on the form:
      *
      * <pre>
-     *   { binding, out ->
+     *   { binding, out {@code ->}
      *      //code generated by parsing the template data
-     *   }                                                                             *
+     *   }
      * </pre>
      *
-     * Calling template.make(binding), curries in the 'binding' argument:
+     * Calling {@code template.make(binding)}, curries in the 'binding' argument:
      *
      * <pre>
      *   public Writable make(final Map map) {
@@ -205,11 +203,11 @@ public class StreamingTemplateEngine extends TemplateEngine {
      *   }
      * </pre>
      *
-     * which only leaves the 'out' argument unbound. The only method on the {@link groovy.lang.Writable writable} interface is
+     * This only leaves the 'out' argument unbound. The only method on the {@link groovy.lang.Writable writable} interface is
      * {@link groovy.lang.Writable#writeTo writeTo(Writer out)} so groovy rules about casting a closure to a one-method-interface
      * apply and the above works. I.e. we return the now one argument closure as the Writable
      * which can be serialized to System.out, a file, etc according to the Writable interface contract.
-     * </p>
+     *
      * @see groovy.text.TemplateEngine#createTemplate(java.io.Reader)
      */
     @Override
diff --git a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
index 6f505af..70db3c3 100644
--- a/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
+++ b/subprojects/groovy-templates/src/main/groovy/groovy/text/XmlTemplateEngine.java
@@ -54,7 +54,7 @@ import java.util.Map;
  * <p>
  * Comments and processing instructions
  * will be removed as part of processing and special XML characters such as
- * &lt;, &gt;, &quot and &apos; will be escaped using the respective XML notation.
+ * &lt;, &gt;, &quot; and &apos; will be escaped using the respective XML notation.
  * The output will also be indented using standard XML pretty printing.
  * <p>
  * The xmlns namespace definition for <code>gsp:</code> tags will be removed
@@ -74,7 +74,7 @@ import java.util.Map;
  *   &lt;gsp:expression&gt;greeting&lt;/gsp:expression&gt;
  *   &lt;foo:to&gt;$firstname "$nickname" $lastname&lt;/foo:to&gt;
  *   How are you today?
- * &lt;/document>
+ * &lt;/document&gt;
  * '''
  * def template = engine.createTemplate(text).make(binding)
  * println template.toString()
diff --git a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
index 54900a2..b1e3a2a 100644
--- a/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
+++ b/subprojects/groovy-test/src/main/groovy/groovy/util/JavadocAssertionTestBuilder.groovy
@@ -26,7 +26,8 @@ import java.util.regex.Pattern
  * attribute assignment. Example:
  * <pre>&lt;pre class="groovyTestCase"&gt; assert "example".size() == 7 &lt;/pre&gt;</pre>
  * When extracting the code for the test, single-line snippets of code without braces within a {{@code @code} ...}
- * tag will have the javadoc {@code code} tag stripped.
+ * tag will have the javadoc {@code code} tag stripped. Similarly, html entities are converted back when extracting
+ * code, so {@code &lt;} and {@code &gt;} will be converted to {@code <} and {@code >}.
  */
 class JavadocAssertionTestBuilder {
     // TODO write tests for this classes functionality
diff --git a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
index 3e37a1c..abd1c66 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/util/slurpersupport/GPathResult.java
@@ -412,7 +412,7 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
      * &lt;characterList&gt;
      *   &lt;character/&gt;
      *   &lt;character&gt;
-     *     &lt;name>Gromit&lt;/name&gt;
+     *     &lt;name&gt;Gromit&lt;/name&gt;
      *   &lt;/character&gt;
      * &lt;/characterList&gt;"""
      *
@@ -452,7 +452,7 @@ public abstract class GPathResult extends GroovyObjectSupport implements Writabl
      * <pre class="groovyTestCase">
      * import groovy.util.slurpersupport.*
      * def text = """
-     * &lt;characterList>
+     * &lt;characterList&gt;
      *   &lt;character&gt;Wallace&lt;/character&gt;
      *   &lt;character&gt;Gromit&lt;/character&gt;
      *   &lt;character&gt;Shaun&lt;/character&gt;
diff --git a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
index d67e842..c469f95 100644
--- a/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
+++ b/subprojects/groovy-xml/src/main/java/groovy/xml/MarkupBuilder.java
@@ -33,19 +33,23 @@ import java.util.Map;
  * The builder supports various 'pretty printed' formats.
  * <p>
  * Example:
- * <pre>new MarkupBuilder().root {
+ * <pre>
+ * new MarkupBuilder().root {
  *   a( a1:'one' ) {
- *     b { mkp.yield( '3 < 5' ) }
+ *     b { mkp.yield( '3 {@code <} 5' ) }
  *     c( a2:'two', 'blah' )
  *   }
- * }</pre>
+ * }
+ * </pre>
  * Will print the following to System.out:
- * <pre>&lt;root&gt;
+ * <pre>
+ * &lt;root&gt;
  *   &lt;a a1='one'&gt;
  *     &lt;b&gt;3 &amp;lt; 5&lt;/b&gt;
  *     &lt;c a2='two'&gt;blah&lt;/c&gt;
  *   &lt;/a&gt;
- * &lt;/root&gt;</pre>
+ * &lt;/root&gt;
+ * </pre>
  * Notes:
  * <ul>
  *    <li><code>mkp</code> is a special namespace used to escape
diff --git a/subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlBuilder.java b/subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlBuilder.java
index 34f8606..fa2ebf1 100644
--- a/subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlBuilder.java
+++ b/subprojects/groovy-yaml/src/main/java/groovy/yaml/YamlBuilder.java
@@ -126,7 +126,7 @@ public class YamlBuilder extends GroovyObjectSupport implements Writable {
      * def authors = [new Author (name: "Guillaume"), new Author (name: "Jochen"), new Author (name: "Paul")]
      *
      * def yaml = new groovy.yaml.YamlBuilder()
-     * yaml authors, { Author author ->
+     * yaml authors, { Author author {@code ->}
      *      name author.name
      * }
      *
@@ -284,7 +284,7 @@ public class YamlBuilder extends GroovyObjectSupport implements Writable {
      * yaml { temperature 37 }
      *
      * def out = new StringWriter()
-     * out << yaml
+     * out {@code <<} yaml
      *
      * assert out.toString() == '''---
      * temperature: 37