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

Collapse All | Expand All

(-)buildnotes_jdt-core.html (-1 / +3 lines)
Lines 50-56 Link Here
50
<h2>What's new in this drop</h2>
50
<h2>What's new in this drop</h2>
51
51
52
<h3>Problem Reports Fixed</h3>
52
<h3>Problem Reports Fixed</h3>
53
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331770">331770</a>
53
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331872">331872</a>
54
[compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter
55
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331770">331770</a>
54
org.eclipse.jdt.core.tests.model.JavaSearchBugsTests.testBug323514a() is failing in  N20101202-2000
56
org.eclipse.jdt.core.tests.model.JavaSearchBugsTests.testBug323514a() is failing in  N20101202-2000
55
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331632">331632</a>
57
<br><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=331632">331632</a>
56
FUP of 323514: Add performance tracking test for scenario
58
FUP of 323514: Add performance tracking test for scenario
(-)compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java (-2 / +5 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 58-64 Link Here
58
		try {
58
		try {
59
			env.missingClassFileLocation = this;
59
			env.missingClassFileLocation = this;
60
			TypeBinding leafComponentType = super.getTypeBinding(scope);
60
			TypeBinding leafComponentType = super.getTypeBinding(scope);
61
			return this.resolvedType = scope.createArrayType(leafComponentType, this.dimensions);
61
			if (leafComponentType != null) {
62
				return this.resolvedType = scope.createArrayType(leafComponentType, this.dimensions);
63
			}
64
			return null;
62
		} catch (AbortCompilation e) {
65
		} catch (AbortCompilation e) {
63
			e.updateContext(this, scope.referenceCompilationUnit().compilationResult);
66
			e.updateContext(this, scope.referenceCompilationUnit().compilationResult);
64
			throw e;
67
			throw e;
(-)compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java (-1 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 43-48 Link Here
43
				typeRef.resolvedType = this.resolvedType;
43
				typeRef.resolvedType = this.resolvedType;
44
				// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195374
44
				// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195374
45
				// reproduce javadoc 1.3.1 / 1.4.2 behavior
45
				// reproduce javadoc 1.3.1 / 1.4.2 behavior
46
				if (this.resolvedType == null) {
47
					return null;
48
				}
46
				if (typeRef instanceof SingleTypeReference &&
49
				if (typeRef instanceof SingleTypeReference &&
47
						this.resolvedType.leafComponentType().enclosingType() != null &&
50
						this.resolvedType.leafComponentType().enclosingType() != null &&
48
						scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_4) {
51
						scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_4) {
(-)src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java (-1 / +33 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Stephan Herrmann <stephan@cs.tu-berlin.de> - Contribution for Bug 331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.jdt.core.tests.compiler.regression;
12
package org.eclipse.jdt.core.tests.compiler.regression;
12
import java.io.File;
13
import java.io.File;
Lines 22-27 Link Here
22
23
23
public class ArrayTest extends AbstractRegressionTest {
24
public class ArrayTest extends AbstractRegressionTest {
24
25
26
	static {
27
//		TESTS_NUMBERS = new int[] { 18 };
28
	}
25
	public ArrayTest(String name) {
29
	public ArrayTest(String name) {
26
		super(name);
30
		super(name);
27
	}
31
	}
Lines 544-547 Link Here
544
		assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput);
548
		assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput);
545
	}		
549
	}		
546
}
550
}
551
552
// https://bugs.eclipse.org/331872 -  [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter
553
public void test018() throws Exception {
554
	if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_5)
555
		return;
556
	this.runNegativeTest(
557
		new String[] {
558
			"X.java",
559
			"public class X<p> {\n" + 
560
			"	void foo(p.O[] elems)  {\n" + 
561
			"	}\n" +
562
			"   void bar() {\n" +
563
			"        foo(new Object[0]);\n" +
564
			"   }\n" + 
565
			"}\n",
566
		},
567
		"----------\n" + 
568
		"1. ERROR in X.java (at line 2)\n" + 
569
		"	void foo(p.O[] elems)  {\n" + 
570
		"	         ^^^^^\n" + 
571
		"Illegal qualified access from the type parameter p\n" + 
572
		"----------\n" + 
573
		"2. ERROR in X.java (at line 5)\n" + 
574
		"	foo(new Object[0]);\n" + 
575
		"	^^^\n" + 
576
		"The method foo(Object[]) is undefined for the type X<p>\n" + 
577
		"----------\n");
578
}
547
}
579
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java (-1 / +32 lines)
Lines 38-44 Link Here
38
	// All specified tests which does not belong to the class are skipped...
38
	// All specified tests which does not belong to the class are skipped...
39
	static {
39
	static {
40
//		TESTS_PREFIX = "testBug95521";
40
//		TESTS_PREFIX = "testBug95521";
41
//		TESTS_NAMES = new String[] { "testBug209936" };
41
//		TESTS_NAMES = new String[] { "testBug331872" };
42
//		TESTS_NUMBERS = new int[] { 101283 };
42
//		TESTS_NUMBERS = new int[] { 101283 };
43
//		TESTS_RANGE = new int[] { 23, -1 };
43
//		TESTS_RANGE = new int[] { 23, -1 };
44
	}
44
	}
Lines 4220-4223 Link Here
4220
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4220
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4221
		);
4221
		);
4222
	}
4222
	}
4223
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=331872
4224
	public void testBug331872() {
4225
		Map options = getCompilerOptions();
4226
		options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsMethodTypeParameters, CompilerOptions.DISABLED);
4227
		this.runNegativeTest(
4228
			true,
4229
			new String[] {
4230
				"X.java",
4231
				"/**\n" +
4232
				" * @param <p> the given type parameter\n" +
4233
				" */\n" +
4234
				"public class X<p> {\n" +
4235
				"	/**\n" +
4236
				"	 * @param o the given object\n" +
4237
				"	 * @see #foo(p.O[])\n" +
4238
				"	 */\n" + 
4239
				"	public void foo(Object o) {\n" +
4240
				"	}\n" +
4241
				"}"
4242
			},
4243
			null,
4244
			options,
4245
			"----------\n" + 
4246
			"1. ERROR in X.java (at line 7)\n" + 
4247
			"	* @see #foo(p.O[])\n" + 
4248
			"	            ^^^\n" + 
4249
			"Illegal qualified access from the type parameter p\n" + 
4250
			"----------\n",
4251
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError
4252
		);
4253
	}
4223
}
4254
}

Return to bug 331872