### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: buildnotes_jdt-core.html =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/buildnotes_jdt-core.html,v retrieving revision 1.7696 diff -u -r1.7696 buildnotes_jdt-core.html --- buildnotes_jdt-core.html 6 Dec 2010 16:26:22 -0000 1.7696 +++ buildnotes_jdt-core.html 6 Dec 2010 17:17:19 -0000 @@ -50,7 +50,9 @@

What's new in this drop

Problem Reports Fixed

-331770 +331872 +[compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter +
331770 org.eclipse.jdt.core.tests.model.JavaSearchBugsTests.testBug323514a() is failing in N20101202-2000
331632 FUP of 323514: Add performance tracking test for scenario Index: compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java,v retrieving revision 1.32 diff -u -r1.32 ArrayQualifiedTypeReference.java --- compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java 7 Mar 2009 01:08:07 -0000 1.32 +++ compiler/org/eclipse/jdt/internal/compiler/ast/ArrayQualifiedTypeReference.java 6 Dec 2010 17:17:19 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -58,7 +58,10 @@ try { env.missingClassFileLocation = this; TypeBinding leafComponentType = super.getTypeBinding(scope); - return this.resolvedType = scope.createArrayType(leafComponentType, this.dimensions); + if (leafComponentType != null) { + return this.resolvedType = scope.createArrayType(leafComponentType, this.dimensions); + } + return null; } catch (AbortCompilation e) { e.updateContext(this, scope.referenceCompilationUnit().compilationResult); throw e; Index: compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java,v retrieving revision 1.27 diff -u -r1.27 JavadocArgumentExpression.java --- compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java 12 Sep 2008 15:58:35 -0000 1.27 +++ compiler/org/eclipse/jdt/internal/compiler/ast/JavadocArgumentExpression.java 6 Dec 2010 17:17:19 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -43,6 +43,9 @@ typeRef.resolvedType = this.resolvedType; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=195374 // reproduce javadoc 1.3.1 / 1.4.2 behavior + if (this.resolvedType == null) { + return null; + } if (typeRef instanceof SingleTypeReference && this.resolvedType.leafComponentType().enclosingType() != null && scope.compilerOptions().complianceLevel <= ClassFileConstants.JDK1_4) { #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java,v retrieving revision 1.28 diff -u -r1.28 ArrayTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java 27 Aug 2009 15:26:58 -0000 1.28 +++ src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java 6 Dec 2010 17:17:19 -0000 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Stephan Herrmann - Contribution for Bug 331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter *******************************************************************************/ package org.eclipse.jdt.core.tests.compiler.regression; import java.io.File; @@ -22,6 +23,9 @@ public class ArrayTest extends AbstractRegressionTest { + static { +// TESTS_NUMBERS = new int[] { 18 }; + } public ArrayTest(String name) { super(name); } @@ -544,4 +548,32 @@ assertEquals("unexpected bytecode sequence", expectedOutput, actualOutput); } } + +// https://bugs.eclipse.org/331872 - [compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter +public void test018() throws Exception { + if (new CompilerOptions(getCompilerOptions()).complianceLevel < ClassFileConstants.JDK1_5) + return; + this.runNegativeTest( + new String[] { + "X.java", + "public class X

{\n" + + " void foo(p.O[] elems) {\n" + + " }\n" + + " void bar() {\n" + + " foo(new Object[0]);\n" + + " }\n" + + "}\n", + }, + "----------\n" + + "1. ERROR in X.java (at line 2)\n" + + " void foo(p.O[] elems) {\n" + + " ^^^^^\n" + + "Illegal qualified access from the type parameter p\n" + + "----------\n" + + "2. ERROR in X.java (at line 5)\n" + + " foo(new Object[0]);\n" + + " ^^^\n" + + "The method foo(Object[]) is undefined for the type X

\n" + + "----------\n"); +} } Index: src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java,v retrieving revision 1.49 diff -u -r1.49 JavadocTest_1_5.java --- src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 6 Oct 2010 13:57:31 -0000 1.49 +++ src/org/eclipse/jdt/core/tests/compiler/regression/JavadocTest_1_5.java 6 Dec 2010 17:17:19 -0000 @@ -38,7 +38,7 @@ // All specified tests which does not belong to the class are skipped... static { // TESTS_PREFIX = "testBug95521"; -// TESTS_NAMES = new String[] { "testBug209936" }; +// TESTS_NAMES = new String[] { "testBug331872" }; // TESTS_NUMBERS = new int[] { 101283 }; // TESTS_RANGE = new int[] { 23, -1 }; } @@ -4220,4 +4220,35 @@ JavacTestOptions.Excuse.EclipseWarningConfiguredAsError ); } + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=331872 + public void testBug331872() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportMissingJavadocTagsMethodTypeParameters, CompilerOptions.DISABLED); + this.runNegativeTest( + true, + new String[] { + "X.java", + "/**\n" + + " * @param

the given type parameter\n" + + " */\n" + + "public class X

{\n" + + " /**\n" + + " * @param o the given object\n" + + " * @see #foo(p.O[])\n" + + " */\n" + + " public void foo(Object o) {\n" + + " }\n" + + "}" + }, + null, + options, + "----------\n" + + "1. ERROR in X.java (at line 7)\n" + + " * @see #foo(p.O[])\n" + + " ^^^\n" + + "Illegal qualified access from the type parameter p\n" + + "----------\n", + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError + ); + } }