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 231752 Details for
Bug 409247
[1.8][compiler] Verify error with code allocating multidimensional array.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch that adds testcase and implements fix
0001-Bug409247.patch (text/plain), 7.50 KB, created by
Andrew Clement
on 2013-05-30 10:48:26 EDT
(
hide
)
Description:
Patch that adds testcase and implements fix
Filename:
MIME Type:
Creator:
Andrew Clement
Created:
2013-05-30 10:48:26 EDT
Size:
7.50 KB
patch
obsolete
>From a2147b6b9e38f2ff5e5ceeb276e858f5bebc1e79 Mon Sep 17 00:00:00 2001 >From: Andy Clement <andrew.clement@gmail.com> >Date: Thu, 30 May 2013 07:44:51 -0700 >Subject: [PATCH] Bug40247 > >--- > .../jdt/core/tests/compiler/regression/ArrayTest.java | 19 ++++++++++++++++++- > .../compiler/ast/ArrayAllocationExpression.java | 4 ++-- > .../jdt/internal/compiler/codegen/CodeStream.java | 6 ++---- > .../compiler/codegen/TypeAnnotationCodeStream.java | 6 ++++-- > 4 files changed, 26 insertions(+), 9 deletions(-) > >diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java >index 1205491..c8a3131 100644 >--- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java >+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ArrayTest.java >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2012 IBM Corporation and others. >+ * Copyright (c) 2000, 2013 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 >@@ -8,6 +8,8 @@ > * 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 >+ * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for >+ * Bug 409247 - [1.8][compiler] Verify error with code allocating multidimensional array > *******************************************************************************/ > package org.eclipse.jdt.core.tests.compiler.regression; > import java.io.File; >@@ -575,4 +577,19 @@ public void test018() throws Exception { > "The method foo(Object[]) is undefined for the type X<p>\n" + > "----------\n"); > } >+ >+// https://bugs.eclipse.org/bugs/show_bug.cgi?id=409247 - [1.8][compiler] Verify error with code allocating multidimensional array >+public void test019() throws Exception { >+ this.runConformTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " public static void main(String[] args) {\n" + >+ " X [][][] x = new X[10][10][];\n" + >+ " System.out.println(\"SUCCESS\");\n" + >+ " }\n" + >+ "}\n", >+ }, >+ "SUCCESS"); >+} > } >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java >index 47cdc77..418be15 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ArrayAllocationExpression.java >@@ -17,7 +17,7 @@ > * bug 403147 - [compiler][null] FUP of bug 400761: consolidate interaction between unboxing, NPE, and deferred checking > * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for > * Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) >- * >+ * Bug 409247 - [1.8][compiler] Verify error with code allocating multidimensional array > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.ast; > >@@ -79,7 +79,7 @@ public class ArrayAllocationExpression extends Expression { > codeStream.newArray(this.type, this.annotationsOnDimensions, (ArrayBinding)this.resolvedType); > } else { > // Multi-dimensional array >- codeStream.multianewarray(this.type, this.resolvedType, this.dimensions.length, this.annotationsOnDimensions); >+ codeStream.multianewarray(this.type, this.resolvedType, explicitDimCount, this.dimensions.length, this.annotationsOnDimensions); > } > if (valueRequired) { > codeStream.generateImplicitConversion(this.implicitConversion); >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java >index f6715da..b44dd65 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/CodeStream.java >@@ -18,6 +18,7 @@ > * Bug 405066 - [1.8][compiler][codegen] Implement code generation infrastructure for JSR335 > * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for > * Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) >+ * Bug 409247 - [1.8][compiler] Verify error with code allocating multidimensional array > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.codegen; > >@@ -5707,14 +5708,11 @@ public void monitorexit() { > this.bCodeStream[this.classFileOffset++] = Opcodes.OPC_monitorexit; > } > >-public void multianewarray(TypeBinding typeBinding, int dimensions) { >- this.multianewarray(null, typeBinding, dimensions, null); >-} >- > public void multianewarray( > TypeReference typeReference, > TypeBinding typeBinding, > int dimensions, >+ int declaredDimensions, > Annotation [][] annotationsOnDimensions) { > this.countLabels = 0; > this.stackDepth += (1 - dimensions); >diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java >index e1fb841..3cc928c 100644 >--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java >+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/codegen/TypeAnnotationCodeStream.java >@@ -13,6 +13,7 @@ > * IBM Corporation - initial API and implementation > * Andy Clement (GoPivotal, Inc) aclement@gopivotal.com - Contributions for > * Bug 383624 - [1.8][compiler] Revive code generation support for type annotations (from Olivier's work) >+ * Bug 409247 - [1.8][compiler] Verify error with code allocating multidimensional array > *******************************************************************************/ > package org.eclipse.jdt.internal.compiler.codegen; > >@@ -60,11 +61,12 @@ public class TypeAnnotationCodeStream extends StackMapFrameCodeStream { > TypeReference typeReference, > TypeBinding typeBinding, > int dimensions, >+ int declaredDimensions, > Annotation [][] annotationsOnDimensions) { > if (typeReference != null && (typeReference.bits & ASTNode.HasTypeAnnotations) != 0) { >- addAnnotationContext(typeReference, this.position, AnnotationTargetTypeConstants.NEW, annotationsOnDimensions, dimensions); >+ addAnnotationContext(typeReference, this.position, AnnotationTargetTypeConstants.NEW, annotationsOnDimensions, declaredDimensions); > } >- super.multianewarray(typeReference, typeBinding, dimensions, annotationsOnDimensions); >+ super.multianewarray(typeReference, typeBinding, dimensions, declaredDimensions, annotationsOnDimensions); > } > > public void new_(TypeReference typeReference, TypeBinding typeBinding) { >-- >1.7.11.2 >
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 409247
: 231752