View | Details | Raw Unified | Return to bug 238923 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/codegen/StackMapFrameCodeStream.java (-1 / +4 lines)
Lines 536-541 Link Here
536
	addFramePosition(this.position);
536
	addFramePosition(this.position);
537
}
537
}
538
public void resetInWideMode() {
538
public void resetInWideMode() {
539
	this.resetSecretLocals();
540
	super.resetInWideMode();
541
}
542
public void resetSecretLocals() {
539
	for (int i = 0, max = this.locals.length; i < max; i++) {
543
	for (int i = 0, max = this.locals.length; i < max; i++) {
540
		LocalVariableBinding localVariableBinding = this.locals[i];
544
		LocalVariableBinding localVariableBinding = this.locals[i];
541
		if (localVariableBinding != null && localVariableBinding.isSecret()) {
545
		if (localVariableBinding != null && localVariableBinding.isSecret()) {
Lines 543-548 Link Here
543
			localVariableBinding.resetInitializations();
547
			localVariableBinding.resetInitializations();
544
		}
548
		}
545
	}
549
	}
546
	super.resetInWideMode();
547
}
550
}
548
}
551
}
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java (+5 lines)
Lines 335-340 Link Here
335
		codeStream.recordPositionsFrom(0, this.bodyEnd);
335
		codeStream.recordPositionsFrom(0, this.bodyEnd);
336
		classFile.completeCodeAttribute(codeAttributeOffset);
336
		classFile.completeCodeAttribute(codeAttributeOffset);
337
		attributeNumber++;
337
		attributeNumber++;
338
		if ((codeStream instanceof StackMapFrameCodeStream)
339
				&& needFieldInitializations
340
				&& declaringType.fields != null) {
341
			((StackMapFrameCodeStream) codeStream).resetSecretLocals();
342
		}
338
	}
343
	}
339
	classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
344
	classFile.completeMethodInfo(methodAttributeOffset, attributeNumber);
340
}
345
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java (-1 / +20 lines)
Lines 32-38 Link Here
32
	static {
32
	static {
33
//		TESTS_PREFIX = "testBug95521";
33
//		TESTS_PREFIX = "testBug95521";
34
//		TESTS_NAMES = new String[] { "testBug83127a" };
34
//		TESTS_NAMES = new String[] { "testBug83127a" };
35
//		TESTS_NUMBERS = new int[] { 37 };
35
//		TESTS_NUMBERS = new int[] { 38 };
36
//		TESTS_RANGE = new int[] { 23 -1,};
36
//		TESTS_RANGE = new int[] { 23 -1,};
37
	}
37
	}
38
	public static Test suite() {
38
	public static Test suite() {
Lines 6077-6080 Link Here
6077
			},
6077
			},
6078
		"SUCCESS");
6078
		"SUCCESS");
6079
	}
6079
	}
6080
6081
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=238923
6082
	public void test038() {
6083
		this.runConformTest(
6084
			new String[] {
6085
				"X.java",
6086
				"public class X {\n" + 
6087
				"	{\n" + 
6088
				"		for (boolean b : new boolean[] {}) {}\n" + 
6089
				"	}\n" +
6090
				"	public X() {}\n" +
6091
				"	public X(boolean b) {}\n" +
6092
				"	public static void main(String[] args) {\n" + 
6093
				"		System.out.print(\"SUCCESS\");\n" +
6094
				"	}\n" + 
6095
				"}",
6096
			},
6097
		"SUCCESS");
6098
	}
6080
}
6099
}

Return to bug 238923