From bf220b9c187e1b523f659ed1888f3d2e30cdc181 Mon Sep 17 00:00:00 2001 From: Christian Aistleitner Date: Sun, 14 Jun 2015 20:53:12 +0200 Subject: [PATCH] Escape unescaped angle brackets in javadoc In ab11101fb2240a15cc6fdf1e31cdd675024edc7e {@code} tags got removed from within a few javadoc
 tags, arguing that they are already in
a 
 block. But 
 on it's own does not allow unescaped use of
angle brackets, and hence javadoc building fails [1] again on Java 8.

Re-adding {@code} would be the canonical fix, as the {@code}
tag (quoting from the javadoc man page):

  Displays text in code font without interpreting the text as HTML
  markup or nested javadoc tags.

So it allows both using angle and curly brackets within {@code}.

However, as Eclipse currently chokes on braces within {@code} and
displays warnings [2], we escape the angle brackets for now to make
both eclipse and javadoc happy.

[1]

  [...]/registration/DynamicItem.java:70: error: malformed HTML
   *   DynamicSet.itemOf(binder(), new TypeLiteral>() {});
                                                  ^
See
  http://builds.quelltextlich.at/gerrit/nightly/master-java_8/2015-06-14/extension-api-javadoc.jar.build.stderr.txt
  http://builds.quelltextlich.at/gerrit/nightly/master-java_8/2015-06-14/index.html#extension-api-javadoc.jar

[2] See the corresponding Eclipse bugs:
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=258706
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=206345

Change-Id: I39b2cfd06cbc5bd5d6a46dd567ac1abf21f09ee8
---
 .../google/gerrit/extensions/registration/DynamicItem.java    | 2 +-
 .../com/google/gerrit/extensions/registration/DynamicMap.java | 4 ++--
 .../com/google/gerrit/extensions/registration/DynamicSet.java | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
index 1388637ad3..da7db17ab6 100644
--- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
+++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicItem.java
@@ -67,7 +67,7 @@ public class DynamicItem {
    * 

* Items must be defined in a Guice module before they can be bound: *

-   *   DynamicSet.itemOf(binder(), new TypeLiteral>() {});
+   *   DynamicSet.itemOf(binder(), new TypeLiteral<Thing<Foo>>() {});
    * 
* * @param binder a new binder created in the module. diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java index abf944a4d3..d3db2e9cfb 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicMap.java @@ -67,8 +67,8 @@ public abstract class DynamicMap implements Iterable> { * Maps must be defined in a Guice module before they can be bound: * *
-   * DynamicMap.mapOf(binder(), new TypeLiteral>(){});
-   * bind(new TypeLiteral>() {})
+   * DynamicMap.mapOf(binder(), new TypeLiteral<Thing<Bar>>(){});
+   * bind(new TypeLiteral<Thing<Bar>>() {})
    *   .annotatedWith(Exports.named("foo"))
    *   .to(Impl.class);
    * 
diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java index 82613c77f7..c99f233e59 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/registration/DynamicSet.java @@ -61,7 +61,7 @@ public class DynamicSet implements Iterable { *

* Sets must be defined in a Guice module before they can be bound: *

-   *   DynamicSet.setOf(binder(), new TypeLiteral>() {});
+   *   DynamicSet.setOf(binder(), new TypeLiteral<Thing<Foo>>() {});
    * 
* * @param binder a new binder created in the module.