Apply patch from Dinesh Bolkensteyn to
fix the NPE. The indentation check should still be reporting an error in the tryBlock.
This commit is contained in:
parent
6267c7260d
commit
b441a1e751
|
|
@ -1146,9 +1146,14 @@ resources
|
|||
{#resources = #([RESOURCES, "RESOURCES"], #resources);}
|
||||
;
|
||||
|
||||
|
||||
resource
|
||||
: modifiers typeSpec[true] IDENT ASSIGN expression
|
||||
: modifiers typeSpec[true] IDENT resource_assign
|
||||
{#resource = #([RESOURCE, "RESOURCE"], #resource);}
|
||||
;
|
||||
|
||||
resource_assign
|
||||
: ASSIGN^ expression
|
||||
;
|
||||
|
||||
// an exception handler
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ class InputValidTryResourcesIndent
|
|||
// Taken from JDK7 java.lang.Package src code.
|
||||
private static Manifest loadManifest(String fn) {
|
||||
try (FileInputStream fis = new FileInputStream(fn);
|
||||
JarInputStream jis = new JarInputStream(fis, false))
|
||||
// This should be an error
|
||||
JarInputStream jis = new JarInputStream(fis, false))
|
||||
{
|
||||
return jis.getManifest();
|
||||
} catch (IOException e)
|
||||
|
|
|
|||
|
|
@ -734,13 +734,12 @@ public class IndentationCheckTest extends BaseCheckTestSupport
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testTryResources() throws Exception
|
||||
{
|
||||
final DefaultConfiguration checkConfig =
|
||||
createCheckConfig(IndentationCheck.class);
|
||||
final String[] expected = {
|
||||
"something is expected, but there is a NullPointerException",
|
||||
//"something is expected, but there is nothing",
|
||||
};
|
||||
verify(checkConfig, getPath("indentation/InputValidTryResourcesIndent.java"),
|
||||
expected);
|
||||
|
|
|
|||
Loading…
Reference in New Issue