View | Details | Raw Unified | Return to bug 128962
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedAllocationExpression.java (-1 / +1 lines)
Lines 75-81 Link Here
75
			flowContext.checkExceptionHandlers(
75
			flowContext.checkExceptionHandlers(
76
				thrownExceptions,
76
				thrownExceptions,
77
				this,
77
				this,
78
				flowInfo,
78
				flowInfo.unconditionalCopy(),
79
				currentScope);
79
				currentScope);
80
		}
80
		}
81
		manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
81
		manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
(-)compiler/org/eclipse/jdt/internal/compiler/ast/AllocationExpression.java (-1 / +1 lines)
Lines 48-54 Link Here
48
		flowContext.checkExceptionHandlers(
48
		flowContext.checkExceptionHandlers(
49
			thrownExceptions,
49
			thrownExceptions,
50
			this,
50
			this,
51
			flowInfo,
51
			flowInfo.unconditionalCopy(),
52
			currentScope);
52
			currentScope);
53
	}
53
	}
54
	manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
54
	manageEnclosingInstanceAccessIfNecessary(currentScope, flowInfo);
(-)src/org/eclipse/jdt/core/tests/compiler/regression/NullReferenceTest.java (-3 / +98 lines)
Lines 34-41 Link Here
34
  	static {
34
  	static {
35
//    	TESTS_NAMES = new String[] { "test011" };
35
//    	TESTS_NAMES = new String[] { "test011" };
36
//    	TESTS_NUMBERS = new int[] { 516 };   
36
//    	TESTS_NUMBERS = new int[] { 516 };   
37
//    	TESTS_NUMBERS = new int[] { 519 };   
37
//    	TESTS_NUMBERS = new int[] { 2999 };   
38
//    	TESTS_NUMBERS = new int[] { 2999 };   
38
//    	TESTS_RANGE = new int[] { 2050, -1 }; 
39
//    	TESTS_RANGE = new int[] { 2050, -1 }; 
40
    	TESTS_RANGE = new int[] { 519, 522 }; 
39
//  	TESTS_RANGE = new int[] { 1, 2049 }; 
41
//  	TESTS_RANGE = new int[] { 1, 2049 }; 
40
//  	TESTS_RANGE = new int[] { 449, 451 }; 
42
//  	TESTS_RANGE = new int[] { 449, 451 }; 
41
//    	TESTS_RANGE = new int[] { 900, 999 }; 
43
//    	TESTS_RANGE = new int[] { 900, 999 }; 
Lines 4053-4065 Link Here
4053
4055
4054
// null analysis -- try/finally
4056
// null analysis -- try/finally
4055
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
4057
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
4056
// incorrect analysis within try finally with a constructor
4058
// incorrect analysis within try finally with a constructor throwing an exception
4057
public void _test0519_try_finally() {
4059
public void test0519_try_finally_constructor_exc() {
4058
	this.runConformTest(
4060
	this.runConformTest(
4059
		new String[] {
4061
		new String[] {
4060
			"X.java",
4062
			"X.java",
4061
			"public class X {\n" + 
4063
			"public class X {\n" + 
4062
			"  public void foo(Y y) throws  E {\n" + 
4064
			"  public void foo(Y y) throws E {\n" + 
4065
			"    try {\n" + 
4066
			"      new Y();\n" + 
4067
			"      y.bar();\n" + // should be quiet
4068
			"    } finally {\n" + 
4069
			"      y = null;\n" + 
4070
			"    }\n" + 
4071
			"  }\n" + 
4072
			"}\n" + 
4073
			"class Y {\n" + 
4074
			"    Y() throws E {\n" + 
4075
			"    }\n" + 
4076
			"    void bar() throws E {\n" + 
4077
			"    }\n" + 
4078
			"}\n" + 
4079
			"class E extends Exception {\n" + 
4080
			"    private static final long serialVersionUID = 1L;\n" + 
4081
			"}\n" + 
4082
			"\n"},
4083
		"");
4084
}
4085
4086
// null analysis -- try/finally
4087
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
4088
// incorrect analysis within try finally with a constructor throwing an exception
4089
// variant
4090
public void test0520_try_finally_constructor_exc() {
4091
	this.runConformTest(
4092
		new String[] {
4093
			"X.java",
4094
			"public class X {\n" + 
4095
			"  public void foo(Y y) throws E {\n" + 
4096
			"    try {\n" + 
4097
			"      new Y();\n" + 
4098
			"      y.bar();\n" + // should be quiet
4099
			"    } finally {\n" + 
4100
			"      y = null;\n" + 
4101
			"    }\n" + 
4102
			"  }\n" + 
4103
			"}\n" + 
4104
			"class Y {\n" + 
4105
			"    Y() throws E {\n" + 
4106
			"    }\n" + 
4107
			"    void bar() throws E {\n" + 
4108
			"    }\n" + 
4109
			"}\n" + 
4110
			"class E extends Exception {\n" + 
4111
			"    private static final long serialVersionUID = 1L;\n" + 
4112
			"}\n" + 
4113
			"\n"},
4114
		"");
4115
}
4116
4117
// null analysis -- try/finally
4118
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
4119
// incorrect analysis within try finally with a constructor throwing an exception
4120
// variant
4121
public void test0521_try_finally_constructor_exc() {
4122
	this.runConformTest(
4123
		new String[] {
4124
			"X.java",
4125
			"public class X {\n" + 
4126
			"  public void foo(Y y) throws E {\n" + 
4127
			"    try {\n" + 
4128
			"      new Y();\n" + 
4129
			"      y.bar();\n" + // should be quiet
4130
			"    } finally {\n" + 
4131
			"      y = null;\n" + 
4132
			"    }\n" + 
4133
			"  }\n" + 
4134
			"}\n" + 
4135
			"class Y {\n" + 
4136
			"    Y() throws E {\n" + 
4137
			"    }\n" + 
4138
			"    void bar() throws E {\n" + 
4139
			"    }\n" + 
4140
			"}\n" + 
4141
			"class E extends Exception {\n" + 
4142
			"    private static final long serialVersionUID = 1L;\n" + 
4143
			"}\n" + 
4144
			"\n"},
4145
		"");
4146
}
4147
4148
// null analysis -- try/finally
4149
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=128962
4150
// incorrect analysis within try finally with a constructor throwing an exception
4151
// variant
4152
public void test0522_try_finally_constructor_exc() {
4153
	this.runConformTest(
4154
		new String[] {
4155
			"X.java",
4156
			"public class X {\n" + 
4157
			"  public void foo(Y y) throws E {\n" + 
4063
			"    try {\n" + 
4158
			"    try {\n" + 
4064
			"      new Y();\n" + 
4159
			"      new Y();\n" + 
4065
			"      y.bar();\n" + // should be quiet
4160
			"      y.bar();\n" + // should be quiet

Return to bug 128962