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 184557 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 patch
Bug_331872.patch (text/plain), 4.12 KB, created by
Stephan Herrmann
on 2010-12-05 12:45:50 EST
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2010-12-05 12:45:50 EST
Size:
4.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java,v >retrieving revision 1.50 >diff -u -r1.50 QualifiedTypeReference.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 18 Mar 2010 16:22:38 -0000 1.50 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/QualifiedTypeReference.java 5 Dec 2010 17:35:31 -0000 >@@ -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.internal.compiler.ast; > >@@ -84,7 +85,7 @@ > return this.resolvedType; > if (i == 0 && this.resolvedType.isTypeVariable() && ((TypeVariableBinding) this.resolvedType).firstBound == null) { // cannot select from a type variable > scope.problemReporter().illegalAccessFromTypeVariable((TypeVariableBinding) this.resolvedType, this); >- return null; >+ return new ProblemReferenceBinding(this.tokens, scope.environment().createMissingType(null, this.tokens), ProblemReasons.NotFound); > } > if (i <= last && isTypeUseDeprecated(this.resolvedType, scope)) { > reportDeprecatedType(this.resolvedType, scope, i); >#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 5 Dec 2010 17:35:32 -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; >@@ -544,4 +545,37 @@ > 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 2)\n" + >+ " void foo(p.O[] elems) {\n" + >+ " ^^^\n" + >+ "p.O cannot be resolved to a type\n" + >+ "----------\n" + >+ "3. ERROR in X.java (at line 5)\n" + >+ " foo(new Object[0]);\n" + >+ " ^^^\n" + >+ "The method foo(O[]) from the type X<p> refers to the missing type O\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