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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ClassFile.java (-4 / +11 lines)
Lines 8348-8357 Link Here
8348
									poolContents, 1,
8348
									poolContents, 1,
8349
									constantPoolOffsets[utf8index]));
8349
									constantPoolOffsets[utf8index]));
8350
					int classNameLength = className.length;
8350
					int classNameLength = className.length;
8351
					System.arraycopy(className, 0, (constantPoolName = new char[classNameLength + 3]), 2, classNameLength);
8351
					if (className[0] != '[') {
8352
					constantPoolName[0] = '[';
8352
						// this is a type name (class or interface). So we add appropriate '[', 'L' and ';'.
8353
					constantPoolName[1] = 'L';
8353
						System.arraycopy(className, 0, (constantPoolName = new char[classNameLength + 3]), 2, classNameLength);
8354
					constantPoolName[classNameLength + 2] = ';';
8354
						constantPoolName[0] = '[';
8355
						constantPoolName[1] = 'L';
8356
						constantPoolName[classNameLength + 2] = ';';
8357
					} else {
8358
						// if class name is already an array, we just need to add one dimension
8359
						System.arraycopy(className, 0, (constantPoolName = new char[classNameLength + 1]), 1, classNameLength);
8360
						constantPoolName[0] = '[';
8361
					}
8355
					frame.stackItems[frame.numberOfStackItems - 1] = new VerificationTypeInfo(0, constantPoolName);
8362
					frame.stackItems[frame.numberOfStackItems - 1] = new VerificationTypeInfo(0, constantPoolName);
8356
					pc += 3;
8363
					pc += 3;
8357
					break;
8364
					break;
(-)src/org/eclipse/jdt/core/tests/compiler/regression/StackMapAttributeTest.java (+21 lines)
Lines 6096-6099 Link Here
6096
			},
6096
			},
6097
		"SUCCESS");
6097
		"SUCCESS");
6098
	}
6098
	}
6099
6100
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=237931
6101
	public void test039() {
6102
		this.runConformTest(
6103
			new String[] {
6104
				"X.java",
6105
				"public class X {\n" + 
6106
				"	public String[][] foo(String s) {\n" + 
6107
				"		return\n" + 
6108
				"			new String[][] { {\" \", s != null ? s : \"\" },\n" + 
6109
				"				{\" \", s != null ? s : \"\" },\n" + 
6110
				"				{\" \", s != null ? s : \"\" },\n" + 
6111
				"				{\" \", s != null ? s : \"\" } };\n" + 
6112
				"	}\n" + 
6113
				"	public static void main(String[] args) {\n" + 
6114
				"		System.out.println(\"SUCCESS\");\n" + 
6115
				"	}\n" + 
6116
				"}",
6117
			},
6118
		"SUCCESS");
6119
	}
6099
}
6120
}

Return to bug 237931