< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java

Print this page
*** 2533,12 ***
  
              if (!resourceVarDecls.isEmpty() &&
                      lint.isEnabled(Lint.LintCategory.TRY)) {
                  for (JCVariableDecl resVar : resourceVarDecls) {
                      if (unrefdResources.includes(resVar.sym)) {
!                         log.warning(Lint.LintCategory.TRY, resVar.pos(),
                                      Warnings.TryResourceNotReferenced(resVar.sym));
                          unrefdResources.remove(resVar.sym);
                      }
                  }
              }
  
--- 2533,16 ---
  
              if (!resourceVarDecls.isEmpty() &&
                      lint.isEnabled(Lint.LintCategory.TRY)) {
                  for (JCVariableDecl resVar : resourceVarDecls) {
                      if (unrefdResources.includes(resVar.sym)) {
!                         // Project Loom local: we don't want to see warnings for ScopeLocalBinders.
+                         String resVarType = resVar.vartype.toString();
+                         if (! "java.lang.ScopeLocal.Binder".equals(resVarType)) {
+                             log.warning(Lint.LintCategory.TRY, resVar.pos(),
                                      Warnings.TryResourceNotReferenced(resVar.sym));
+                         }
                          unrefdResources.remove(resVar.sym);
                      }
                  }
              }
  
< prev index next >