View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.indentation.indentation; //indent:0 exp:0
2   
3   import java.io.FileInputStream; //indent:0 exp:0
4   import java.io.IOException; //indent:0 exp:0
5   import java.util.jar.JarInputStream; //indent:0 exp:0
6   import java.util.jar.Manifest; //indent:0 exp:0
7   
8   
9   /**                                                                           //indent:0 exp:0
10   * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
11   *                                                                            //indent:1 exp:1
12   * arrayInitIndent = 4                                                        //indent:1 exp:1
13   * basicOffset = 4                                                            //indent:1 exp:1
14   * braceAdjustment = 0                                                        //indent:1 exp:1
15   * caseIndent = 4                                                             //indent:1 exp:1
16   * forceStrictCondition = false                                               //indent:1 exp:1
17   * lineWrappingIndentation = 4                                                //indent:1 exp:1
18   * tabWidth = 4                                                               //indent:1 exp:1
19   * throwsIndent = 4                                                           //indent:1 exp:1
20   *                                                                            //indent:1 exp:1
21   *                                                                            //indent:1 exp:1
22   */                                                                           //indent:1 exp:1
23  class InputIndentationValidTryResourcesIndent //indent:0 exp:0
24  { //indent:0 exp:0
25      // Taken from JDK7 java.lang.Package src code. //indent:4 exp:4
26      private static Manifest loadManifest(String fn) { //indent:4 exp:4
27          try (FileInputStream fis = new FileInputStream(fn); //indent:8 exp:8
28              JarInputStream jis = new JarInputStream(fis, false)) //indent:12 exp:12
29          { //indent:8 exp:8
30              return jis.getManifest(); //indent:12 exp:12
31          } catch (IOException e) //indent:8 exp:8
32          { //indent:8 exp:8
33              return null; //indent:12 exp:12
34          } //indent:8 exp:8
35      } //indent:4 exp:4
36  } //indent:0 exp:0