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

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


The following commit(s) were added to refs/heads/master by this push:
     new 06349e6  Ignore unused variables in try-with-resources
06349e6 is described below

commit 06349e644d22a42a7099d6224e5cd41cbc03bb32
Author: Christopher Tubbs <ctubb...@apache.org>
AuthorDate: Tue Feb 19 21:28:12 2019 -0500

    Ignore unused variables in try-with-resources
    
    Reduce compiler warning spam from the use of AutoCloseable trace objects
    created in try-with-resources blocks. This could allow some bugs to be
    overlooked of the type where the wrong variable is referenced inside the
    block or the resource is created, but not needed for the block.
    Unfortunately, it's not possible to ignore them by specific types.
    Otherwise, I'd just ignore the TraceScope ones.
    
    It may be useful to, instead of ignoring these warnings for TraceScope
    objects, add annotated data to the scope, so that way it's both
    referenced, and has additional meaningful data in the resulting trace
    span.
---
 pom.xml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pom.xml b/pom.xml
index 6f1f1d0..9f3f87a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -846,6 +846,8 @@
             <compilerArgs>
               <arg>-Xlint:all</arg>
               <arg>-Xlint:-processing</arg>
+              <!-- suppress try to ignore unused variable in 
try-with-resources -->
+              <arg>-Xlint:-try</arg>
               <arg>-Xmaxwarns</arg>
               <arg>5</arg>
             </compilerArgs>

Reply via email to