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 190188 Details for
Bug 326950
[compiler][null]Do not optimize code generation based on static analysis (dead code)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix v2.0
patch326950.txt (text/plain), 34.45 KB, created by
Ayushman Jain
on 2011-03-02 14:01:43 EST
(
hide
)
Description:
proposed fix v2.0
Filename:
MIME Type:
Creator:
Ayushman Jain
Created:
2011-03-02 14:01:43 EST
Size:
34.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java,v >retrieving revision 1.69 >diff -u -r1.69 IfStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java 12 Aug 2010 16:58:28 -0000 1.69 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/IfStatement.java 2 Mar 2011 18:56:52 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2010 IBM Corporation and others. >+ * Copyright (c) 2000, 2011 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 >@@ -164,10 +164,7 @@ > if (hasThenPart) { > BranchLabel falseLabel = null; > // generate boolean condition only if needed >- if (((this.bits & ASTNode.IsElseStatementUnreachable) != 0) || >- (cst != Constant.NotAConstant && cst.booleanValue() == true)) { >- // No need to generate if condition statement when we know that only the then action >- // will be executed >+ if (cst != Constant.NotAConstant && cst.booleanValue() == true) { > this.condition.generateCode(currentScope, codeStream, false); > } else { > this.condition.generateOptimizedBoolean( >@@ -206,10 +203,7 @@ > } > } else if (hasElsePart) { > // generate boolean condition only if needed >- if (((this.bits & ASTNode.IsThenStatementUnreachable) != 0) || >- (cst != Constant.NotAConstant && cst.booleanValue() == false)) { >- // No need to generate if condition statement when we know that only the else action >- // will be executed >+ if (cst != Constant.NotAConstant && cst.booleanValue() == false) { > this.condition.generateCode(currentScope, codeStream, false); > } else { > this.condition.generateOptimizedBoolean( >Index: compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java,v >retrieving revision 1.51 >diff -u -r1.51 Statement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 22 Jan 2011 23:39:25 -0000 1.51 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/Statement.java 2 Mar 2011 18:56:52 -0000 >@@ -72,7 +72,8 @@ > // complaintLevel = 0 if was reachable up until now, 1 if fake reachable (deadcode), 2 if fatal unreachable (error) > public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int previousComplaintLevel) { > if ((flowInfo.reachMode() & FlowInfo.UNREACHABLE) != 0) { >- this.bits &= ~ASTNode.IsReachable; >+ if ((flowInfo.reachMode() & FlowInfo.UNREACHABLE_OR_DEAD) != 0) >+ this.bits &= ~ASTNode.IsReachable; // only reset this bit if unreachability is not due to null analysis > if (flowInfo == FlowInfo.DEAD_END) { > if (previousComplaintLevel < COMPLAINED_UNREACHABLE) { > scope.problemReporter().unreachableCode(this); >#P org.eclipse.jdt.core.tests >Index: Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java >=================================================================== >RCS file: /home/cvs/numbat/org.eclipse.jdt.core.tests/Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java,v >retrieving revision 1.156 >diff -u -r1.156 ConformTest.java >--- Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java 27 May 2010 14:12:25 -0000 1.156 >+++ Eclipse Java Tests Compiler/org/eclipse/jdt/tests/compiler/regression/ConformTest.java 2 Mar 2011 18:56:59 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 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 >@@ -6501,182 +6501,207 @@ > > CompilerOptions compilerOptions = new CompilerOptions(getCompilerOptions()); > String expectedOutput = compilerOptions.targetJDK <= ClassFileConstants.JDK1_5 ? >- " // Method descriptor #15 (Z)V\n" + >- " // Stack: 4, Locals: 8\n" + >- " private void foo(boolean delete);\n" + >- " 0 aload_0 [this]\n" + >- " 1 invokevirtual X.bar() : java.lang.String [16]\n" + >- " 4 astore_2 [s]\n" + >- " 5 new java.lang.StringBuffer [20]\n" + >- " 8 dup\n" + >- " 9 invokespecial java.lang.StringBuffer() [22]\n" + >- " 12 astore_3 [buffer]\n" + >- " 13 iconst_1\n" + >- " 14 anewarray java.lang.String [23]\n" + >- " 17 dup\n" + >- " 18 iconst_0\n" + >- " 19 ldc <String \"\"> [25]\n" + >- " 21 aastore\n" + >- " 22 astore 4 [datas]\n" + >- " 24 iconst_1\n" + >- " 25 anewarray java.lang.Object [3]\n" + >- " 28 dup\n" + >- " 29 iconst_0\n" + >- " 30 aload_2 [s]\n" + >- " 31 aastore\n" + >- " 32 astore 5 [data]\n" + >- " 34 aload_3 [buffer]\n" + >- " 35 aload 4 [datas]\n" + >- " 37 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >- " 40 aload 5 [data]\n" + >- " 42 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >- " 45 pop\n" + >- " 46 goto 54\n" + >- " 49 astore 6 [e]\n" + >- " 51 aload 6 [e]\n" + >- " 53 athrow\n" + >- " 54 iload_1 [delete]\n" + >- " 55 ifeq 85\n" + >- " 58 aload_3 [buffer]\n" + >- " 59 iconst_0\n" + >- " 60 aload_3 [buffer]\n" + >- " 61 invokevirtual java.lang.StringBuffer.length() : int [31]\n" + >- " 64 invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" + >- " 67 pop\n" + >- " 68 goto 85\n" + >- " 71 astore 4\n" + >- " 73 aconst_null\n" + >- " 74 astore_3 [buffer]\n" + >- " 75 goto 87\n" + >- " 78 astore 7\n" + >- " 80 aconst_null\n" + >- " 81 astore_3 [buffer]\n" + >- " 82 aload 7\n" + >- " 84 athrow\n" + >- " 85 aconst_null\n" + >- " 86 astore_3 [buffer]\n" + >- " 87 return\n" + >- " Exception Table:\n" + >- " [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" + >- " [pc: 13, pc: 68] -> 71 when : java.lang.Exception\n" + >- " [pc: 13, pc: 73] -> 78 when : any\n" + >- " Line numbers:\n" + >- " [pc: 0, line: 4]\n" + >- " [pc: 5, line: 5]\n" + >- " [pc: 13, line: 9]\n" + >- " [pc: 24, line: 10]\n" + >- " [pc: 34, line: 12]\n" + >- " [pc: 49, line: 13]\n" + >- " [pc: 51, line: 15]\n" + >- " [pc: 54, line: 19]\n" + >- " [pc: 58, line: 20]\n" + >- " [pc: 71, line: 22]\n" + >- " [pc: 73, line: 24]\n" + >- " [pc: 78, line: 23]\n" + >- " [pc: 80, line: 24]\n" + >- " [pc: 82, line: 25]\n" + >- " [pc: 85, line: 24]\n" + >- " [pc: 87, line: 26]\n" + >- " Local variable table:\n" + >- " [pc: 0, pc: 88] local: this index: 0 type: X\n" + >- " [pc: 0, pc: 88] local: delete index: 1 type: boolean\n" + >- " [pc: 5, pc: 88] local: s index: 2 type: java.lang.String\n" + >- " [pc: 13, pc: 88] local: buffer index: 3 type: java.lang.StringBuffer\n" + >- " [pc: 24, pc: 71] local: datas index: 4 type: java.lang.String[]\n" + >- " [pc: 34, pc: 71] local: data index: 5 type: java.lang.Object[]\n" + >- " [pc: 51, pc: 54] local: e index: 6 type: java.lang.Exception\n" >+ " // Method descriptor #15 (Z)V\n" + >+ " // Stack: 4, Locals: 8\n" + >+ " private void foo(boolean delete);\n" + >+ " 0 aload_0 [this]\n" + >+ " 1 invokevirtual X.bar() : java.lang.String [16]\n" + >+ " 4 astore_2 [s]\n" + >+ " 5 new java.lang.StringBuffer [20]\n" + >+ " 8 dup\n" + >+ " 9 invokespecial java.lang.StringBuffer() [22]\n" + >+ " 12 astore_3 [buffer]\n" + >+ " 13 iconst_1\n" + >+ " 14 anewarray java.lang.String [23]\n" + >+ " 17 dup\n" + >+ " 18 iconst_0\n" + >+ " 19 ldc <String \"\"> [25]\n" + >+ " 21 aastore\n" + >+ " 22 astore 4 [datas]\n" + >+ " 24 iconst_1\n" + >+ " 25 anewarray java.lang.Object [3]\n" + >+ " 28 dup\n" + >+ " 29 iconst_0\n" + >+ " 30 aload_2 [s]\n" + >+ " 31 aastore\n" + >+ " 32 astore 5 [data]\n" + >+ " 34 aload_3 [buffer]\n" + >+ " 35 aload 4 [datas]\n" + >+ " 37 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >+ " 40 aload 5 [data]\n" + >+ " 42 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >+ " 45 pop\n" + >+ " 46 goto 62\n" + >+ " 49 astore 6 [e]\n" + >+ " 51 aload 6 [e]\n" + >+ " 53 ifnull 59\n" + >+ " 56 aload 6 [e]\n" + >+ " 58 athrow\n" + >+ " 59 aconst_null\n" + >+ " 60 astore_3 [buffer]\n" + >+ " 61 return\n" + >+ " 62 iload_1 [delete]\n" + >+ " 63 ifeq 93\n" + >+ " 66 aload_3 [buffer]\n" + >+ " 67 iconst_0\n" + >+ " 68 aload_3 [buffer]\n" + >+ " 69 invokevirtual java.lang.StringBuffer.length() : int [31]\n" + >+ " 72 invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" + >+ " 75 pop\n" + >+ " 76 goto 93\n" + >+ " 79 astore 4\n" + >+ " 81 aconst_null\n" + >+ " 82 astore_3 [buffer]\n" + >+ " 83 goto 95\n" + >+ " 86 astore 7\n" + >+ " 88 aconst_null\n" + >+ " 89 astore_3 [buffer]\n" + >+ " 90 aload 7\n" + >+ " 92 athrow\n" + >+ " 93 aconst_null\n" + >+ " 94 astore_3 [buffer]\n" + >+ " 95 return\n" + >+ " Exception Table:\n" + >+ " [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" + >+ " [pc: 13, pc: 59] -> 79 when : java.lang.Exception\n" + >+ " [pc: 62, pc: 76] -> 79 when : java.lang.Exception\n" + >+ " [pc: 13, pc: 59] -> 86 when : any\n" + >+ " [pc: 62, pc: 81] -> 86 when : any\n" + >+ " Line numbers:\n" + >+ " [pc: 0, line: 4]\n" + >+ " [pc: 5, line: 5]\n" + >+ " [pc: 13, line: 9]\n" + >+ " [pc: 24, line: 10]\n" + >+ " [pc: 34, line: 12]\n" + >+ " [pc: 49, line: 13]\n" + >+ " [pc: 51, line: 14]\n" + >+ " [pc: 56, line: 15]\n" + >+ " [pc: 59, line: 24]\n" + >+ " [pc: 61, line: 16]\n" + >+ " [pc: 62, line: 19]\n" + >+ " [pc: 66, line: 20]\n" + >+ " [pc: 79, line: 22]\n" + >+ " [pc: 81, line: 24]\n" + >+ " [pc: 86, line: 23]\n" + >+ " [pc: 88, line: 24]\n" + >+ " [pc: 90, line: 25]\n" + >+ " [pc: 93, line: 24]\n" + >+ " [pc: 95, line: 26]\n" + >+ " Local variable table:\n" + >+ " [pc: 0, pc: 96] local: this index: 0 type: X\n" + >+ " [pc: 0, pc: 96] local: delete index: 1 type: boolean\n" + >+ " [pc: 5, pc: 96] local: s index: 2 type: java.lang.String\n" + >+ " [pc: 13, pc: 96] local: buffer index: 3 type: java.lang.StringBuffer\n" + >+ " [pc: 24, pc: 59] local: datas index: 4 type: java.lang.String[]\n" + >+ " [pc: 62, pc: 79] local: datas index: 4 type: java.lang.String[]\n" + >+ " [pc: 34, pc: 59] local: data index: 5 type: java.lang.Object[]\n" + >+ " [pc: 62, pc: 79] local: data index: 5 type: java.lang.Object[]\n" + >+ " [pc: 51, pc: 59] local: e index: 6 type: java.lang.Exception\n" > : " // Method descriptor #15 (Z)V\n" + >- " // Stack: 4, Locals: 8\n" + >- " private void foo(boolean delete);\n" + >- " 0 aload_0 [this]\n" + >- " 1 invokevirtual X.bar() : java.lang.String [16]\n" + >- " 4 astore_2 [s]\n" + >- " 5 new java.lang.StringBuffer [20]\n" + >- " 8 dup\n" + >- " 9 invokespecial java.lang.StringBuffer() [22]\n" + >- " 12 astore_3 [buffer]\n" + >- " 13 iconst_1\n" + >- " 14 anewarray java.lang.String [23]\n" + >- " 17 dup\n" + >- " 18 iconst_0\n" + >- " 19 ldc <String \"\"> [25]\n" + >- " 21 aastore\n" + >- " 22 astore 4 [datas]\n" + >- " 24 iconst_1\n" + >- " 25 anewarray java.lang.Object [3]\n" + >- " 28 dup\n" + >- " 29 iconst_0\n" + >- " 30 aload_2 [s]\n" + >- " 31 aastore\n" + >- " 32 astore 5 [data]\n" + >- " 34 aload_3 [buffer]\n" + >- " 35 aload 4 [datas]\n" + >- " 37 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >- " 40 aload 5 [data]\n" + >- " 42 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >- " 45 pop\n" + >- " 46 goto 54\n" + >- " 49 astore 6 [e]\n" + >- " 51 aload 6 [e]\n" + >- " 53 athrow\n" + >- " 54 iload_1 [delete]\n" + >- " 55 ifeq 85\n" + >- " 58 aload_3 [buffer]\n" + >- " 59 iconst_0\n" + >- " 60 aload_3 [buffer]\n" + >- " 61 invokevirtual java.lang.StringBuffer.length() : int [31]\n" + >- " 64 invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" + >- " 67 pop\n" + >- " 68 goto 85\n" + >- " 71 astore 4\n" + >- " 73 aconst_null\n" + >- " 74 astore_3 [buffer]\n" + >- " 75 goto 87\n" + >- " 78 astore 7\n" + >- " 80 aconst_null\n" + >- " 81 astore_3 [buffer]\n" + >- " 82 aload 7\n" + >- " 84 athrow\n" + >- " 85 aconst_null\n" + >- " 86 astore_3 [buffer]\n" + >- " 87 return\n" + >- " Exception Table:\n" + >- " [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" + >- " [pc: 13, pc: 68] -> 71 when : java.lang.Exception\n" + >- " [pc: 13, pc: 73] -> 78 when : any\n" + >- " Line numbers:\n" + >- " [pc: 0, line: 4]\n" + >- " [pc: 5, line: 5]\n" + >- " [pc: 13, line: 9]\n" + >- " [pc: 24, line: 10]\n" + >- " [pc: 34, line: 12]\n" + >- " [pc: 49, line: 13]\n" + >- " [pc: 51, line: 15]\n" + >- " [pc: 54, line: 19]\n" + >- " [pc: 58, line: 20]\n" + >- " [pc: 71, line: 22]\n" + >- " [pc: 73, line: 24]\n" + >- " [pc: 78, line: 23]\n" + >- " [pc: 80, line: 24]\n" + >- " [pc: 82, line: 25]\n" + >- " [pc: 85, line: 24]\n" + >- " [pc: 87, line: 26]\n" + >- " Local variable table:\n" + >- " [pc: 0, pc: 88] local: this index: 0 type: X\n" + >- " [pc: 0, pc: 88] local: delete index: 1 type: boolean\n" + >- " [pc: 5, pc: 88] local: s index: 2 type: java.lang.String\n" + >- " [pc: 13, pc: 88] local: buffer index: 3 type: java.lang.StringBuffer\n" + >- " [pc: 24, pc: 71] local: datas index: 4 type: java.lang.String[]\n" + >- " [pc: 34, pc: 71] local: data index: 5 type: java.lang.Object[]\n" + >- " [pc: 51, pc: 54] local: e index: 6 type: java.lang.Exception\n" + >- " Stack map table: number of frames 7\n" + >- " [pc: 49, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" + >- " [pc: 54, same]\n" + >- " [pc: 68, same]\n" + >- " [pc: 71, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer}]\n" + >- " [pc: 78, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" + >- " [pc: 85, same]\n" + >- " [pc: 87, same]\n"; >+ " // Stack: 4, Locals: 8\n" + >+ " private void foo(boolean delete);\n" + >+ " 0 aload_0 [this]\n" + >+ " 1 invokevirtual X.bar() : java.lang.String [16]\n" + >+ " 4 astore_2 [s]\n" + >+ " 5 new java.lang.StringBuffer [20]\n" + >+ " 8 dup\n" + >+ " 9 invokespecial java.lang.StringBuffer() [22]\n" + >+ " 12 astore_3 [buffer]\n" + >+ " 13 iconst_1\n" + >+ " 14 anewarray java.lang.String [23]\n" + >+ " 17 dup\n" + >+ " 18 iconst_0\n" + >+ " 19 ldc <String \"\"> [25]\n" + >+ " 21 aastore\n" + >+ " 22 astore 4 [datas]\n" + >+ " 24 iconst_1\n" + >+ " 25 anewarray java.lang.Object [3]\n" + >+ " 28 dup\n" + >+ " 29 iconst_0\n" + >+ " 30 aload_2 [s]\n" + >+ " 31 aastore\n" + >+ " 32 astore 5 [data]\n" + >+ " 34 aload_3 [buffer]\n" + >+ " 35 aload 4 [datas]\n" + >+ " 37 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >+ " 40 aload 5 [data]\n" + >+ " 42 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [27]\n" + >+ " 45 pop\n" + >+ " 46 goto 62\n" + >+ " 49 astore 6 [e]\n" + >+ " 51 aload 6 [e]\n" + >+ " 53 ifnull 59\n" + >+ " 56 aload 6 [e]\n" + >+ " 58 athrow\n" + >+ " 59 aconst_null\n" + >+ " 60 astore_3 [buffer]\n" + >+ " 61 return\n" + >+ " 62 iload_1 [delete]\n" + >+ " 63 ifeq 93\n" + >+ " 66 aload_3 [buffer]\n" + >+ " 67 iconst_0\n" + >+ " 68 aload_3 [buffer]\n" + >+ " 69 invokevirtual java.lang.StringBuffer.length() : int [31]\n" + >+ " 72 invokevirtual java.lang.StringBuffer.delete(int, int) : java.lang.StringBuffer [35]\n" + >+ " 75 pop\n" + >+ " 76 goto 93\n" + >+ " 79 astore 4\n" + >+ " 81 aconst_null\n" + >+ " 82 astore_3 [buffer]\n" + >+ " 83 goto 95\n" + >+ " 86 astore 7\n" + >+ " 88 aconst_null\n" + >+ " 89 astore_3 [buffer]\n" + >+ " 90 aload 7\n" + >+ " 92 athrow\n" + >+ " 93 aconst_null\n" + >+ " 94 astore_3 [buffer]\n" + >+ " 95 return\n" + >+ " Exception Table:\n" + >+ " [pc: 34, pc: 46] -> 49 when : java.lang.Exception\n" + >+ " [pc: 13, pc: 59] -> 79 when : java.lang.Exception\n" + >+ " [pc: 62, pc: 76] -> 79 when : java.lang.Exception\n" + >+ " [pc: 13, pc: 59] -> 86 when : any\n" + >+ " [pc: 62, pc: 81] -> 86 when : any\n" + >+ " Line numbers:\n" + >+ " [pc: 0, line: 4]\n" + >+ " [pc: 5, line: 5]\n" + >+ " [pc: 13, line: 9]\n" + >+ " [pc: 24, line: 10]\n" + >+ " [pc: 34, line: 12]\n" + >+ " [pc: 49, line: 13]\n" + >+ " [pc: 51, line: 14]\n" + >+ " [pc: 56, line: 15]\n" + >+ " [pc: 59, line: 24]\n" + >+ " [pc: 61, line: 16]\n" + >+ " [pc: 62, line: 19]\n" + >+ " [pc: 66, line: 20]\n" + >+ " [pc: 79, line: 22]\n" + >+ " [pc: 81, line: 24]\n" + >+ " [pc: 86, line: 23]\n" + >+ " [pc: 88, line: 24]\n" + >+ " [pc: 90, line: 25]\n" + >+ " [pc: 93, line: 24]\n" + >+ " [pc: 95, line: 26]\n" + >+ " Local variable table:\n" + >+ " [pc: 0, pc: 96] local: this index: 0 type: X\n" + >+ " [pc: 0, pc: 96] local: delete index: 1 type: boolean\n" + >+ " [pc: 5, pc: 96] local: s index: 2 type: java.lang.String\n" + >+ " [pc: 13, pc: 96] local: buffer index: 3 type: java.lang.StringBuffer\n" + >+ " [pc: 24, pc: 59] local: datas index: 4 type: java.lang.String[]\n" + >+ " [pc: 62, pc: 79] local: datas index: 4 type: java.lang.String[]\n" + >+ " [pc: 34, pc: 59] local: data index: 5 type: java.lang.Object[]\n" + >+ " [pc: 62, pc: 79] local: data index: 5 type: java.lang.Object[]\n" + >+ " [pc: 51, pc: 59] local: e index: 6 type: java.lang.Exception\n" + >+ " Stack map table: number of frames 8\n" + >+ " [pc: 49, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer, java.lang.String[], java.lang.Object[]}]\n" + >+ " [pc: 59, chop 2 local(s)]\n" + >+ " [pc: 62, append: {java.lang.String[], java.lang.Object[]}]\n" + >+ " [pc: 76, same]\n" + >+ " [pc: 79, full, stack: {java.lang.Exception}, locals: {X, int, java.lang.String, java.lang.StringBuffer}]\n" + >+ " [pc: 86, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" + >+ " [pc: 93, same]\n" + >+ " [pc: 95, same]\n"; > > File f = new File(OUTPUT_DIR + File.separator + "X.class"); > byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java,v >retrieving revision 1.33 >diff -u -r1.33 ConstantTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java 20 Jul 2010 20:23:20 -0000 1.33 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/ConstantTest.java 2 Mar 2011 18:57:02 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2010 IBM Corporation and others. >+ * Copyright (c) 2003, 2011 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 >@@ -41,7 +41,7 @@ > // All specified tests which does not belong to the class are skipped... > static { > // TESTS_PREFIX = "testBug95521"; >-// TESTS_NAMES = new String[] { "testBug83127a" }; >+ TESTS_NAMES = new String[] { "test009" }; > // TESTS_NUMBERS = new int[] { 14, 15, 16 }; > // TESTS_RANGE = new int[] { 23, -1 }; > } >@@ -360,129 +360,133 @@ > > String expectedOutput = > " // Method descriptor #15 ([Ljava/lang/String;)V\n" + >- " // Stack: 3, Locals: 4\n" + >- " public static void main(java.lang.String[] args);\n" + >- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 3 ldc <String \"1\"> [22]\n" + >- " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 8 aconst_null\n" + >- " 9 goto 13\n" + >- " 12 aconst_null\n" + >- " 13 aconst_null\n" + >- " 14 goto 18\n" + >- " 17 aconst_null\n" + >- " 18 if_acmpne 29\n" + >- " 21 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 24 ldc <String \"2\"> [30]\n" + >- " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 29 new java.lang.StringBuffer [32]\n" + >- " 32 dup\n" + >- " 33 ldc <String \"[\"> [34]\n" + >- " 35 invokespecial java.lang.StringBuffer(java.lang.String) [36]\n" + >- " 38 aconst_null\n" + >- " 39 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [38]\n" + >- " 42 ldc <String \"]\"> [42]\n" + >- " 44 invokevirtual java.lang.StringBuffer.append(java.lang.String) : java.lang.StringBuffer [44]\n" + >- " 47 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [47]\n" + >- " 50 ldc <String \"[null]\"> [51]\n" + >- " 52 if_acmpne 59\n" + >- " 55 iconst_1\n" + >- " 56 goto 60\n" + >- " 59 iconst_0\n" + >- " 60 istore_1 [b]\n" + >- " 61 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 64 ldc <String \"3\"> [53]\n" + >- " 66 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 69 aconst_null\n" + >- " 70 astore_2 [s]\n" + >- " 71 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 74 ldc <String \"4\"> [55]\n" + >- " 76 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 79 ldc <String \"aaa\"> [57]\n" + >- " 81 astore_3 [s2]\n" + >- " 82 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 85 ldc <String \"5\"> [59]\n" + >- " 87 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" + >- " 90 return\n" + >- " Line numbers:\n" + >- " [pc: 0, line: 3]\n" + >- " [pc: 8, line: 4]\n" + >- " [pc: 21, line: 5]\n" + >- " [pc: 29, line: 6]\n" + >- " [pc: 61, line: 7]\n" + >- " [pc: 69, line: 8]\n" + >- " [pc: 71, line: 9]\n" + >- " [pc: 79, line: 10]\n" + >- " [pc: 82, line: 11]\n" + >- " [pc: 90, line: 12]\n" + >- " Local variable table:\n" + >- " [pc: 0, pc: 91] local: args index: 0 type: java.lang.String[]\n" + >- " [pc: 61, pc: 91] local: b index: 1 type: boolean\n" + >- " [pc: 71, pc: 91] local: s index: 2 type: java.lang.String\n" + >- " [pc: 82, pc: 91] local: s2 index: 3 type: java.lang.String\n"; >+ " // Stack: 3, Locals: 4\n" + >+ " public static void main(java.lang.String[] args);\n" + >+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 3 ldc <String \"1\"> [22]\n" + >+ " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 8 aconst_null\n" + >+ " 9 goto 13\n" + >+ " 12 aconst_null\n" + >+ " 13 aconst_null\n" + >+ " 14 goto 18\n" + >+ " 17 aconst_null\n" + >+ " 18 if_acmpne 29\n" + >+ " 21 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 24 ldc <String \"2\"> [30]\n" + >+ " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 29 new java.lang.StringBuffer [32]\n" + >+ " 32 dup\n" + >+ " 33 ldc <String \"[\"> [34]\n" + >+ " 35 invokespecial java.lang.StringBuffer(java.lang.String) [36]\n" + >+ " 38 aconst_null\n" + >+ " 39 invokevirtual java.lang.StringBuffer.append(java.lang.Object) : java.lang.StringBuffer [38]\n" + >+ " 42 ldc <String \"]\"> [42]\n" + >+ " 44 invokevirtual java.lang.StringBuffer.append(java.lang.String) : java.lang.StringBuffer [44]\n" + >+ " 47 invokevirtual java.lang.StringBuffer.toString() : java.lang.String [47]\n" + >+ " 50 ldc <String \"[null]\"> [51]\n" + >+ " 52 if_acmpne 59\n" + >+ " 55 iconst_1\n" + >+ " 56 goto 60\n" + >+ " 59 iconst_0\n" + >+ " 60 istore_1 [b]\n" + >+ " 61 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 64 ldc <String \"3\"> [53]\n" + >+ " 66 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 69 aconst_null\n" + >+ " 70 astore_2 [s]\n" + >+ " 71 aload_2 [s]\n" + >+ " 72 ifnonnull 83\n" + >+ " 75 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 78 ldc <String \"4\"> [55]\n" + >+ " 80 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 83 ldc <String \"aaa\"> [57]\n" + >+ " 85 astore_3 [s2]\n" + >+ " 86 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 89 ldc <String \"5\"> [59]\n" + >+ " 91 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" + >+ " 94 return\n" + >+ " Line numbers:\n" + >+ " [pc: 0, line: 3]\n" + >+ " [pc: 8, line: 4]\n" + >+ " [pc: 21, line: 5]\n" + >+ " [pc: 29, line: 6]\n" + >+ " [pc: 61, line: 7]\n" + >+ " [pc: 69, line: 8]\n" + >+ " [pc: 71, line: 9]\n" + >+ " [pc: 83, line: 10]\n" + >+ " [pc: 86, line: 11]\n" + >+ " [pc: 94, line: 12]\n" + >+ " Local variable table:\n" + >+ " [pc: 0, pc: 95] local: args index: 0 type: java.lang.String[]\n" + >+ " [pc: 61, pc: 95] local: b index: 1 type: boolean\n" + >+ " [pc: 71, pc: 95] local: s index: 2 type: java.lang.String\n" + >+ " [pc: 86, pc: 95] local: s2 index: 3 type: java.lang.String\n"; > > String expectedOutput15 = > " // Method descriptor #15 ([Ljava/lang/String;)V\n" + >- " // Stack: 3, Locals: 4\n" + >- " public static void main(java.lang.String[] args);\n" + >- " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 3 ldc <String \"1\"> [22]\n" + >- " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 8 aconst_null\n" + >- " 9 goto 13\n" + >- " 12 aconst_null\n" + >- " 13 aconst_null\n" + >- " 14 goto 18\n" + >- " 17 aconst_null\n" + >- " 18 if_acmpne 29\n" + >- " 21 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 24 ldc <String \"2\"> [30]\n" + >- " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 29 new java.lang.StringBuilder [32]\n" + >- " 32 dup\n" + >- " 33 ldc <String \"[\"> [34]\n" + >- " 35 invokespecial java.lang.StringBuilder(java.lang.String) [36]\n" + >- " 38 aconst_null\n" + >- " 39 invokevirtual java.lang.StringBuilder.append(java.lang.Object) : java.lang.StringBuilder [38]\n" + >- " 42 ldc <String \"]\"> [42]\n" + >- " 44 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [44]\n" + >- " 47 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [47]\n" + >- " 50 ldc <String \"[null]\"> [51]\n" + >- " 52 if_acmpne 59\n" + >- " 55 iconst_1\n" + >- " 56 goto 60\n" + >- " 59 iconst_0\n" + >- " 60 istore_1 [b]\n" + >- " 61 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 64 ldc <String \"3\"> [53]\n" + >- " 66 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 69 aconst_null\n" + >- " 70 astore_2 [s]\n" + >- " 71 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 74 ldc <String \"4\"> [55]\n" + >- " 76 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >- " 79 ldc <String \"aaa\"> [57]\n" + >- " 81 astore_3 [s2]\n" + >- " 82 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >- " 85 ldc <String \"5\"> [59]\n" + >- " 87 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" + >- " 90 return\n" + >- " Line numbers:\n" + >- " [pc: 0, line: 3]\n" + >- " [pc: 8, line: 4]\n" + >- " [pc: 21, line: 5]\n" + >- " [pc: 29, line: 6]\n" + >- " [pc: 61, line: 7]\n" + >- " [pc: 69, line: 8]\n" + >- " [pc: 71, line: 9]\n" + >- " [pc: 79, line: 10]\n" + >- " [pc: 82, line: 11]\n" + >- " [pc: 90, line: 12]\n" + >- " Local variable table:\n" + >- " [pc: 0, pc: 91] local: args index: 0 type: java.lang.String[]\n" + >- " [pc: 61, pc: 91] local: b index: 1 type: boolean\n" + >- " [pc: 71, pc: 91] local: s index: 2 type: java.lang.String\n" + >- " [pc: 82, pc: 91] local: s2 index: 3 type: java.lang.String\n"; >+ " // Stack: 3, Locals: 4\n" + >+ " public static void main(java.lang.String[] args);\n" + >+ " 0 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 3 ldc <String \"1\"> [22]\n" + >+ " 5 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 8 aconst_null\n" + >+ " 9 goto 13\n" + >+ " 12 aconst_null\n" + >+ " 13 aconst_null\n" + >+ " 14 goto 18\n" + >+ " 17 aconst_null\n" + >+ " 18 if_acmpne 29\n" + >+ " 21 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 24 ldc <String \"2\"> [30]\n" + >+ " 26 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 29 new java.lang.StringBuilder [32]\n" + >+ " 32 dup\n" + >+ " 33 ldc <String \"[\"> [34]\n" + >+ " 35 invokespecial java.lang.StringBuilder(java.lang.String) [36]\n" + >+ " 38 aconst_null\n" + >+ " 39 invokevirtual java.lang.StringBuilder.append(java.lang.Object) : java.lang.StringBuilder [38]\n" + >+ " 42 ldc <String \"]\"> [42]\n" + >+ " 44 invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [44]\n" + >+ " 47 invokevirtual java.lang.StringBuilder.toString() : java.lang.String [47]\n" + >+ " 50 ldc <String \"[null]\"> [51]\n" + >+ " 52 if_acmpne 59\n" + >+ " 55 iconst_1\n" + >+ " 56 goto 60\n" + >+ " 59 iconst_0\n" + >+ " 60 istore_1 [b]\n" + >+ " 61 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 64 ldc <String \"3\"> [53]\n" + >+ " 66 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 69 aconst_null\n" + >+ " 70 astore_2 [s]\n" + >+ " 71 aload_2 [s]\n" + >+ " 72 ifnonnull 83\n" + >+ " 75 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 78 ldc <String \"4\"> [55]\n" + >+ " 80 invokevirtual java.io.PrintStream.print(java.lang.String) : void [24]\n" + >+ " 83 ldc <String \"aaa\"> [57]\n" + >+ " 85 astore_3 [s2]\n" + >+ " 86 getstatic java.lang.System.out : java.io.PrintStream [16]\n" + >+ " 89 ldc <String \"5\"> [59]\n" + >+ " 91 invokevirtual java.io.PrintStream.println(java.lang.String) : void [61]\n" + >+ " 94 return\n" + >+ " Line numbers:\n" + >+ " [pc: 0, line: 3]\n" + >+ " [pc: 8, line: 4]\n" + >+ " [pc: 21, line: 5]\n" + >+ " [pc: 29, line: 6]\n" + >+ " [pc: 61, line: 7]\n" + >+ " [pc: 69, line: 8]\n" + >+ " [pc: 71, line: 9]\n" + >+ " [pc: 83, line: 10]\n" + >+ " [pc: 86, line: 11]\n" + >+ " [pc: 94, line: 12]\n" + >+ " Local variable table:\n" + >+ " [pc: 0, pc: 95] local: args index: 0 type: java.lang.String[]\n" + >+ " [pc: 61, pc: 95] local: b index: 1 type: boolean\n" + >+ " [pc: 71, pc: 95] local: s index: 2 type: java.lang.String\n" + >+ " [pc: 86, pc: 95] local: s2 index: 3 type: java.lang.String\n"; > > if (this.complianceLevel >= ClassFileConstants.JDK1_5) { > int index = actualOutput.indexOf(expectedOutput15);
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 326950
:
189182
|
189809
|
190188
|
190384
|
190394
|
190438
|
190473