Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 184614 Details for
Bug 331872
[compiler] NPE in Scope.createArrayType when attempting qualified access from type parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression test
patch_331872.txt (text/plain), 4.16 KB, created by
Olivier Thomann
on 2010-12-06 10:34:39 EST
(
hide
)
Description:
Proposed fix + regression test
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-12-06 10:34:39 EST
Size:
4.16 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >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 15:33:49 -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; >#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 15:33:50 -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 <stephan@cs.tu-berlin.de> - 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<p> {\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<p>\n" + >+ "----------\n"); >+} > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 331872
:
184557
|
184614
|
184635
|
184639