You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@freemarker.apache.org by dd...@apache.org on 2016/06/12 16:53:49 UTC

[08/50] incubator-freemarker git commit: Put back @SuppressFBWarnings annotations, but filter them out in the Ant build. This works with source code preprocessing with regular expressions, which is ugly, but is still better than losing the annotations in

Put back @SuppressFBWarnings annotations, but filter them out in the Ant build. This works with source code preprocessing with regular expressions, which is ugly, but is still better than losing the annotations in the IDE.

Revert "Removed FindBugs @SuppressFBWarnings annotations as they have caused warnings when compiling dependant code with Gradle."

This reverts commit 174c2b961574db208fabddf3529cac0df8a6a6b4.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/4a408091
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/4a408091
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/4a408091

Branch: refs/heads/2.3
Commit: 4a4080918014790873f5f3f12b22a6460362c42a
Parents: 5ab3895
Author: ddekany <dd...@apache.org>
Authored: Tue May 24 23:33:24 2016 +0200
Committer: ddekany <dd...@apache.org>
Committed: Wed May 25 00:52:40 2016 +0200

----------------------------------------------------------------------
 build.xml                                       | 37 +++++++++++++++-----
 ivy.xml                                         |  4 +--
 .../java/freemarker/core/BuiltInsForNodes.java  |  4 +--
 src/main/java/freemarker/core/Environment.java  |  6 ++--
 .../core/ISOLikeTemplateDateFormat.java         |  4 +--
 src/main/java/freemarker/core/UnifiedCall.java  |  2 +-
 .../debug/impl/RmiDebuggedEnvironmentImpl.java  |  2 +-
 .../debug/impl/RmiDebuggerService.java          |  3 +-
 .../freemarker/ext/beans/BeansModelCache.java   |  3 +-
 .../ext/beans/OverloadedMethodsSubset.java      |  4 +--
 .../ext/servlet/FreemarkerServlet.java          | 12 +++----
 .../template/DefaultIteratorAdapter.java        |  2 +-
 .../java/freemarker/template/ObjectWrapper.java |  2 +-
 src/main/java/freemarker/template/Template.java |  2 +-
 src/main/javacc/FTL.jj                          |  1 -
 src/manual/en_US/book.xml                       |  6 ++--
 .../freemarker/template/ConfigurationTest.java  |  6 ++--
 src/test/java/freemarker/test/TemplateTest.java |  2 +-
 .../freemarker/test/servlet/WebAppTestCase.java |  2 +-
 .../freemarker/test/utility/FileTestCase.java   |  2 +-
 20 files changed, 62 insertions(+), 44 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 09a46be..895543c 100644
--- a/build.xml
+++ b/build.xml
@@ -212,8 +212,27 @@
       -->Java 6: ${boot.classpath.j2se1.6}<!--
     --></echo>
 
-    <mkdir dir="build/classes" />
+    <!-- Comment out @SuppressFBWarnings, as it causes compilation warnings in dependent Gradle projects -->    
+    <delete dir="build/src-main-java-filtered" />
+    <mkdir dir="build/src-main-java-filtered" />
+    <copy toDir="build/src-main-java-filtered">
+      <fileset dir="src/main/java" />
+    </copy>
+    <replaceregexp
+        flags="gs" encoding="utf-8"
+        match='(@SuppressFBWarnings\(.+?"\s*\))' replace="/*\1*/"
+    >
+      <fileset dir="build/src-main-java-filtered" includes="**/*.java" />
+    </replaceregexp>
+    <replaceregexp
+        flags="gs" encoding="utf-8"
+        match='(import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;)' replace="// \1"
+    >
+      <fileset dir="build/src-main-java-filtered" includes="**/*.java" />
+    </replaceregexp>
     
+    <mkdir dir="build/classes" />
+
     <!-- Note: the "build.base" conf doesn't include optional FreeMarker dependencies. -->
     <ivy:cachepath conf="build.base" pathid="ivy.dep" />
     <javac destdir="build/classes" deprecation="off" 
@@ -232,13 +251,13 @@
         freemarker/ext/ant/**"
     >
       <src>
-        <pathelement location="src/main/java" />
+        <pathelement location="build/src-main-java-filtered" />
         <pathelement location="build/generated-sources" />
       </src>
     </javac>
 
     <ivy:cachepath conf="build.base" pathid="ivy.dep" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep"
@@ -253,7 +272,7 @@
     />
 
     <ivy:cachepath conf="build.jsp2.0" pathid="ivy.dep.jsp2.0" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep.jsp2.0"
@@ -271,7 +290,7 @@
     <!-- There's no build.jsp2.0, as those classes are part of the common build subset. -->
     
     <ivy:cachepath conf="build.jsp2.1" pathid="ivy.dep.jsp2.1" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep.jsp2.1"
@@ -283,7 +302,7 @@
     />
 
     <ivy:cachepath conf="build.jython2.0" pathid="ivy.dep.jython2.0" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep.jython2.0"
@@ -298,7 +317,7 @@
     />
     
     <ivy:cachepath conf="build.jython2.2" pathid="ivy.dep.jython2.2" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep.jython2.2"
@@ -308,7 +327,7 @@
     />
     
     <ivy:cachepath conf="build.jython2.5" pathid="ivy.dep.jython2.5" />
-    <javac srcdir="src/main/java" destdir="build/classes" deprecation="off" 
+    <javac srcdir="build/src-main-java-filtered" destdir="build/classes" deprecation="off" 
       debug="on" optimize="off" target="1.5" source="1.5" encoding="utf-8"
       includeantruntime="false"
       classpathref="ivy.dep.jython2.5"
@@ -318,7 +337,7 @@
     />
     
     <rmic base="build/classes" classpathref="ivy.dep"
-      includes="src/main/java/freemarker/debug/impl/Rmi*Impl.class"
+      includes="build/src-main-java-filtered/freemarker/debug/impl/Rmi*Impl.class"
       verify="yes" stubversion="1.2"
     />
     

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/ivy.xml
----------------------------------------------------------------------
diff --git a/ivy.xml b/ivy.xml
index 0fe22e0..9598c87 100644
--- a/ivy.xml
+++ b/ivy.xml
@@ -132,8 +132,8 @@
     
     <dependency org="org.zeroturnaround" name="javarebel-sdk" rev="1.2.2" conf="build.base->default" />
 
-    <!-- This was removed as @SuppressFBWarnings causes compilation warning in dependant Gradle projects -->
-    <!-- dependency org="com.google.code.findbugs" name="annotations" rev="3.0.0" conf="build.base->default" /-->
+    <!-- Not for build.base, as @SuppressFBWarnings causes compilation warnings in dependent Gradle projects -->
+    <dependency org="com.google.code.findbugs" name="annotations" rev="3.0.0" conf="IDE->default; test->default" />
     
     <!--dependency org="javax.script" name="script-api" rev="1.0" conf="build.base->default" /-->
     <!--dependency org="org.visigoths" name="cavalry" rev="1.0" conf="build.base->default" /-->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/core/BuiltInsForNodes.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/BuiltInsForNodes.java b/src/main/java/freemarker/core/BuiltInsForNodes.java
index ae0da02..2fc8c54 100644
--- a/src/main/java/freemarker/core/BuiltInsForNodes.java
+++ b/src/main/java/freemarker/core/BuiltInsForNodes.java
@@ -104,8 +104,8 @@ class BuiltInsForNodes {
 
     static class AncestorSequence extends SimpleSequence implements TemplateMethodModel {
         
-        // @SuppressFBWarnings(value="SE_BAD_FIELD",
-        //         justification="Can't make this Serializable, and not extneding SimpleSequence would be non-BC.")
+        @SuppressFBWarnings(value="SE_BAD_FIELD",
+                justification="Can't make this Serializable, and not extneding SimpleSequence would be non-BC.")
         private Environment env;
         
         AncestorSequence(Environment env) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/core/Environment.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/Environment.java b/src/main/java/freemarker/core/Environment.java
index a5d2d57..20e910c 100644
--- a/src/main/java/freemarker/core/Environment.java
+++ b/src/main/java/freemarker/core/Environment.java
@@ -250,7 +250,7 @@ public final class Environment extends Configurable {
      * 
      * @since 2.3.23
      */
-    // @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm")
+    @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm")
     public Template getCurrentTemplate() {
         int ln = instructionStackSize;
         return ln == 0 ? getMainTemplate() : instructionStack[ln - 1].getTemplate();
@@ -264,7 +264,7 @@ public final class Environment extends Configurable {
      * 
      * @since 2.3.22
      */
-    // @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm")
+    @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "False alarm")
     public DirectiveCallPlace getCurrentDirectiveCallPlace() {
         int ln = instructionStackSize;
         if (ln == 0) return null;
@@ -377,7 +377,7 @@ public final class Environment extends Configurable {
         }
     }
 
-    // @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "Not called when stack is empty")
+    @SuppressFBWarnings(value = "RANGE_ARRAY_INDEX", justification = "Not called when stack is empty")
     private TemplateElement replaceTopElement(TemplateElement element) {
         return instructionStack[instructionStackSize - 1] = element;
     }

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/core/ISOLikeTemplateDateFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/ISOLikeTemplateDateFormat.java b/src/main/java/freemarker/core/ISOLikeTemplateDateFormat.java
index de4a016..690fd0f 100644
--- a/src/main/java/freemarker/core/ISOLikeTemplateDateFormat.java
+++ b/src/main/java/freemarker/core/ISOLikeTemplateDateFormat.java
@@ -198,8 +198,8 @@ abstract class ISOLikeTemplateDateFormat  extends TemplateDateFormat {
             DateToISO8601CalendarFactory calendarFactory);
 
     @Override
-    // @SuppressFBWarnings(value = "RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN",
-    //         justification = "Known to use the singleton Boolean-s only")
+    @SuppressFBWarnings(value = "RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN",
+            justification = "Known to use the singleton Boolean-s only")
     public final Date parse(String s, int dateType) throws UnparsableValueException {
         CalendarFieldsToDateConverter calToDateConverter = factory.getCalendarFieldsToDateCalculator(env);
         TimeZone tz = forceUTC != Boolean.FALSE ? DateUtil.UTC : timeZone;

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/core/UnifiedCall.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/core/UnifiedCall.java b/src/main/java/freemarker/core/UnifiedCall.java
index b6ab518..6608b0a 100644
--- a/src/main/java/freemarker/core/UnifiedCall.java
+++ b/src/main/java/freemarker/core/UnifiedCall.java
@@ -249,7 +249,7 @@ final class UnifiedCall extends TemplateElement implements DirectiveCallPlace {
         return res;
     }
 
-    // @SuppressFBWarnings(value={ "IS2_INCONSISTENT_SYNC", "DC_DOUBLECHECK" }, justification="Performance tricks")
+    @SuppressFBWarnings(value={ "IS2_INCONSISTENT_SYNC", "DC_DOUBLECHECK" }, justification="Performance tricks")
     public Object getOrCreateCustomData(Object providerIdentity, ObjectFactory objectFactory)
             throws CallPlaceCustomDataInitializationException {
         // We are using double-checked locking, utilizing Java memory model "final" trick.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/debug/impl/RmiDebuggedEnvironmentImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/debug/impl/RmiDebuggedEnvironmentImpl.java b/src/main/java/freemarker/debug/impl/RmiDebuggedEnvironmentImpl.java
index 5575ef5..8bb1b3c 100644
--- a/src/main/java/freemarker/debug/impl/RmiDebuggedEnvironmentImpl.java
+++ b/src/main/java/freemarker/debug/impl/RmiDebuggedEnvironmentImpl.java
@@ -106,7 +106,7 @@ implements
     }
 
     // TODO See in SuppressFBWarnings
-    // @SuppressFBWarnings(value="NN_NAKED_NOTIFY", justification="Will have to be re-desigend; postponed.")
+    @SuppressFBWarnings(value="NN_NAKED_NOTIFY", justification="Will have to be re-desigend; postponed.")
     public void resume() {
         synchronized (this) {
             notify();

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/debug/impl/RmiDebuggerService.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/debug/impl/RmiDebuggerService.java b/src/main/java/freemarker/debug/impl/RmiDebuggerService.java
index 7c88459..25d1b2e 100644
--- a/src/main/java/freemarker/debug/impl/RmiDebuggerService.java
+++ b/src/main/java/freemarker/debug/impl/RmiDebuggerService.java
@@ -93,8 +93,7 @@ extends
 
     // TODO See in SuppressFBWarnings
     @Override
-    // @SuppressFBWarnings(value={ "UW_UNCOND_WAIT", "WA_NOT_IN_LOOP" },
-    //     justification="Will have to be re-desigend; postponed.")
+    @SuppressFBWarnings(value={ "UW_UNCOND_WAIT", "WA_NOT_IN_LOOP" }, justification="Will have to be re-desigend; postponed.")
     boolean suspendEnvironmentSpi(Environment env, String templateName, int line)
     throws RemoteException {
         RmiDebuggedEnvironmentImpl denv = 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/ext/beans/BeansModelCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/BeansModelCache.java b/src/main/java/freemarker/ext/beans/BeansModelCache.java
index f044980..659fe1b 100644
--- a/src/main/java/freemarker/ext/beans/BeansModelCache.java
+++ b/src/main/java/freemarker/ext/beans/BeansModelCache.java
@@ -45,8 +45,7 @@ public class BeansModelCache extends ModelCache {
     }
     
     @Override
-    // @SuppressFBWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER",
-    //     justification="Locks for factory creation only")
+    @SuppressFBWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER", justification="Locks for factory creation only")
     protected TemplateModel create(Object object) {
         Class clazz = object.getClass();
         

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/ext/beans/OverloadedMethodsSubset.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/beans/OverloadedMethodsSubset.java b/src/main/java/freemarker/ext/beans/OverloadedMethodsSubset.java
index 919c30f..eeac0d0 100644
--- a/src/main/java/freemarker/ext/beans/OverloadedMethodsSubset.java
+++ b/src/main/java/freemarker/ext/beans/OverloadedMethodsSubset.java
@@ -133,8 +133,8 @@ abstract class OverloadedMethodsSubset {
         return unwrappingHintsByParamCount;
     }
     
-    // @SuppressFBWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER",
-    //         justification="Locks for member descriptor creation only")
+    @SuppressFBWarnings(value="JLM_JSR166_UTILCONCURRENT_MONITORENTER",
+            justification="Locks for member descriptor creation only")
     final MaybeEmptyCallableMemberDescriptor getMemberDescriptorForArgs(Object[] args, boolean varArg) {
         ArgumentTypes argTypes = new ArgumentTypes(args, bugfixed);
         MaybeEmptyCallableMemberDescriptor memberDesc

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/ext/servlet/FreemarkerServlet.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/ext/servlet/FreemarkerServlet.java b/src/main/java/freemarker/ext/servlet/FreemarkerServlet.java
index 735a03b..4bc7504 100644
--- a/src/main/java/freemarker/ext/servlet/FreemarkerServlet.java
+++ b/src/main/java/freemarker/ext/servlet/FreemarkerServlet.java
@@ -511,24 +511,24 @@ public class FreemarkerServlet extends HttpServlet {
     @Deprecated
     protected boolean debug;
     
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
     private Configuration config;
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
     private ObjectWrapper wrapper;
     private ContentType contentType;
     private OverrideResponseContentType overrideResponseContentType = initParamValueToEnum(
             getDefaultOverrideResponseContentType(), OverrideResponseContentType.values());
     private ResponseCharacterEncoding responseCharacterEncoding = ResponseCharacterEncoding.LEGACY;
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
     private Charset forcedResponseCharacterEncoding;
     private OverrideResponseLocale overrideResponseLocale = OverrideResponseLocale.ALWAYS;
     private List/*<MetaInfTldSource>*/ metaInfTldSources;
     private List/*<String>*/ classpathTlds;
 
     private Object lazyInitFieldsLock = new Object();
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
     private ServletContextHashModel servletContextModel;
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="Not investing into making this Servlet serializable")
     private TaglibFactory taglibFactory;
     
     private boolean objectWrapperMismatchWarnLogged;
@@ -956,7 +956,7 @@ public class FreemarkerServlet extends HttpServlet {
         throw e;
     }
     
-    // @SuppressFBWarnings(value={ "MSF_MUTABLE_SERVLET_FIELD", "DC_DOUBLECHECK" }, justification="Performance trick")
+    @SuppressFBWarnings(value={ "MSF_MUTABLE_SERVLET_FIELD", "DC_DOUBLECHECK" }, justification="Performance trick")
     private void logWarnOnObjectWrapperMismatch() {
         // Deliberately uses double check locking.
         if (wrapper != config.getObjectWrapper() && !objectWrapperMismatchWarnLogged && LOG.isWarnEnabled()) {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/template/DefaultIteratorAdapter.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/DefaultIteratorAdapter.java b/src/main/java/freemarker/template/DefaultIteratorAdapter.java
index 1eb1101..a99d5b7 100644
--- a/src/main/java/freemarker/template/DefaultIteratorAdapter.java
+++ b/src/main/java/freemarker/template/DefaultIteratorAdapter.java
@@ -43,7 +43,7 @@ import freemarker.ext.util.WrapperTemplateModel;
 public class DefaultIteratorAdapter extends WrappingTemplateModel implements TemplateCollectionModel,
         AdapterTemplateModel, WrapperTemplateModel, Serializable {
 
-    // @SuppressFBWarnings(value="SE_BAD_FIELD", justification="We hope it's Seralizable")
+    @SuppressFBWarnings(value="SE_BAD_FIELD", justification="We hope it's Seralizable")
     private final Iterator iterator;
     private boolean iteratorOwnedBySomeone;
 

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/template/ObjectWrapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/ObjectWrapper.java b/src/main/java/freemarker/template/ObjectWrapper.java
index b65780a..8ef3730 100644
--- a/src/main/java/freemarker/template/ObjectWrapper.java
+++ b/src/main/java/freemarker/template/ObjectWrapper.java
@@ -39,7 +39,7 @@ import freemarker.ext.util.WrapperTemplateModel;
  * 
  * @see Configuration#setObjectWrapper(ObjectWrapper)
  */
-// @SuppressFBWarnings(value="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION", justification="BC")
+@SuppressFBWarnings(value="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION", justification="BC")
 public interface ObjectWrapper {
     
     /**

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/java/freemarker/template/Template.java
----------------------------------------------------------------------
diff --git a/src/main/java/freemarker/template/Template.java b/src/main/java/freemarker/template/Template.java
index 643806d..1da3aaf 100644
--- a/src/main/java/freemarker/template/Template.java
+++ b/src/main/java/freemarker/template/Template.java
@@ -215,7 +215,7 @@ public class Template extends Configurable {
      *            {@code null}. This is useful as the {@link Configuration} is normally a singleton shared by all
      *            templates, and so it's not good for specifying template-specific settings. (While {@link Template}
      *            itself has methods to specify settings just for that template, those don't influence the parsing, and
-     *            you only have opportunity to call them after the parsing anyway.) This object is often a
+     *            you only have opportunity to call them after the parsing anyway.) This objects is often a
      *            {@link TemplateConfiguration} whose parent is the {@link Configuration} parameter, and then it
      *            practically just overrides some of the parser settings, as the others are inherited from the
      *            {@link Configuration}. Note that if this is a {@link TemplateConfiguration}, you will also want to

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/main/javacc/FTL.jj
----------------------------------------------------------------------
diff --git a/src/main/javacc/FTL.jj b/src/main/javacc/FTL.jj
index 7e7246c..d934298 100644
--- a/src/main/javacc/FTL.jj
+++ b/src/main/javacc/FTL.jj
@@ -33,7 +33,6 @@ import freemarker.template.*;
 import freemarker.template.utility.*;
 import java.io.*;
 import java.util.*;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 /**
  * This class is generated by JavaCC from a grammar file.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/manual/en_US/book.xml
----------------------------------------------------------------------
diff --git a/src/manual/en_US/book.xml b/src/manual/en_US/book.xml
index 99a7205..22578d0 100644
--- a/src/manual/en_US/book.xml
+++ b/src/manual/en_US/book.xml
@@ -26562,8 +26562,10 @@ TemplateModel x = env.getVariable("x");  // get variable x</programlisting>
 
             <listitem>
               <para>Removed FindBugs <literal>@SuppressFBWarnings</literal>
-              annotations as they have caused warnings when compiling
-              dependant code with Gradle.</para>
+              annotations from the binary (<literal>freemarker.jar</literal>),
+              as they have caused warnings like this when compiling dependant
+              project with Gradle: <quote>warning: Cannot find annotation
+              method 'value()' in type 'SuppressFBWarnings'</quote></para>
             </listitem>
           </itemizedlist>
         </section>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/test/java/freemarker/template/ConfigurationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/template/ConfigurationTest.java b/src/test/java/freemarker/template/ConfigurationTest.java
index 59013c8..523b072 100644
--- a/src/test/java/freemarker/template/ConfigurationTest.java
+++ b/src/test/java/freemarker/template/ConfigurationTest.java
@@ -1183,7 +1183,7 @@ public class ConfigurationTest extends TestCase {
         assertEquals("null", env2.getSetting(Configurable.SQL_DATE_AND_TIME_TIME_ZONE_KEY));
     }
 
-    // @SuppressFBWarnings(value="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS", justification="Expected to fail")
+    @SuppressFBWarnings(value="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS", justification="Expected to fail")
     private void setTimeZoneToNull(Environment env2) {
         env2.setTimeZone(null);
     }
@@ -1306,7 +1306,7 @@ public class ConfigurationTest extends TestCase {
     }
     
     @Test
-    // @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS ", justification = "Testing wrong args")
+    @SuppressFBWarnings(value = "NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS ", justification = "Testing wrong args")
     public void testSetCustomNumberFormat() throws Exception {
         Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
         
@@ -1431,7 +1431,7 @@ public class ConfigurationTest extends TestCase {
         }
     }
     
-    // @SuppressFBWarnings(value="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS", justification="We test failures")
+    @SuppressFBWarnings(value="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS", justification="We test failures")
     @Test
     public void testSetCustomDateFormat() throws Exception {
         Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/test/java/freemarker/test/TemplateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/TemplateTest.java b/src/test/java/freemarker/test/TemplateTest.java
index f623bde..75a3e07 100644
--- a/src/test/java/freemarker/test/TemplateTest.java
+++ b/src/test/java/freemarker/test/TemplateTest.java
@@ -81,7 +81,7 @@ public abstract class TemplateTest {
         assertOutput(getConfiguration().getTemplate(name), expectedOut, false);
     }
 
-    // @SuppressFBWarnings(value="UI_INHERITANCE_UNSAFE_GETRESOURCE", justification="By design relative to subclass")
+    @SuppressFBWarnings(value="UI_INHERITANCE_UNSAFE_GETRESOURCE", justification="By design relative to subclass")
     protected void assertOutputForNamed(String name) throws IOException, TemplateException {
         String expectedOut;
         {

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/test/java/freemarker/test/servlet/WebAppTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/servlet/WebAppTestCase.java b/src/test/java/freemarker/test/servlet/WebAppTestCase.java
index ac6861d..6bd7f44 100644
--- a/src/test/java/freemarker/test/servlet/WebAppTestCase.java
+++ b/src/test/java/freemarker/test/servlet/WebAppTestCase.java
@@ -261,7 +261,7 @@ public class WebAppTestCase {
         }
     }
 
-    // @SuppressFBWarnings(value = "UI_INHERITANCE_UNSAFE_GETRESOURCE", justification = "By design relative to subclass")
+    @SuppressFBWarnings(value = "UI_INHERITANCE_UNSAFE_GETRESOURCE", justification = "By design relative to subclass")
     private String createWebAppDirAndGetURI(String webAppName) throws IOException {
         ClassPathResource resourceDir = findWebAppDirectoryResource(webAppName);
         File temporaryDir = ResourcesExtractor.extract(

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/4a408091/src/test/java/freemarker/test/utility/FileTestCase.java
----------------------------------------------------------------------
diff --git a/src/test/java/freemarker/test/utility/FileTestCase.java b/src/test/java/freemarker/test/utility/FileTestCase.java
index 76feec8..4989fb7 100644
--- a/src/test/java/freemarker/test/utility/FileTestCase.java
+++ b/src/test/java/freemarker/test/utility/FileTestCase.java
@@ -137,7 +137,7 @@ public abstract class FileTestCase extends TestCase {
         return getExpectedFileDirectory();
     }
 
-    // @SuppressFBWarnings(value="UI_INHERITANCE_UNSAFE_GETRESOURCE", justification="By design relative to subclass")
+    @SuppressFBWarnings(value="UI_INHERITANCE_UNSAFE_GETRESOURCE", justification="By design relative to subclass")
     protected final File getTestClassDirectory() throws IOException {
         URL url = this.getClass().getResource(".");
         if (url == null) throw new IOException("Couldn't get resource URL for \".\"");