1 /* 2 RedundantModifier 3 tokens = (default)METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, \ 4 CTOR_DEF, CLASS_DEF, ENUM_DEF, RESOURCE 5 6 7 */ 8 9 10 package com.puppycrawl.tools.checkstyle.checks.modifier.redundantmodifier; 11 12 import java.io.IOException; 13 import java.io.OutputStreamWriter; 14 15 public class InputRedundantModifierTryWithResources { 16 public static void main(String[] args) { 17 OutputStreamWriter out = null; 18 try (out; final OutputStreamWriter out2 = null;) { // violation 19 out.write(1); 20 } catch (IOException ex) { 21 System.err.println(ex); 22 } 23 } 24 }