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 178670 Details for
Bug 324840
[compiler] Improving debug strings for Break statement, IntLiteral and CaseStatement
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix + regression tests
patch_324840.txt (text/plain), 12.70 KB, created by
Olivier Thomann
on 2010-09-10 22:40:08 EDT
(
hide
)
Description:
Proposed fix + regression tests
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2010-09-10 22:40:08 EDT
Size:
12.70 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java,v >retrieving revision 1.13 >diff -u -r1.13 BreakStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java 7 Mar 2009 01:08:07 -0000 1.13 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/BreakStatement.java 11 Sep 2010 02:39:17 -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 >@@ -82,8 +82,8 @@ > } > > public StringBuffer printStatement(int tab, StringBuffer output) { >- printIndent(tab, output).append("break "); //$NON-NLS-1$ >- if (this.label != null) output.append(this.label); >+ printIndent(tab, output).append("break"); //$NON-NLS-1$ >+ if (this.label != null) output.append(' ').append(this.label); > return output.append(';'); > } > >Index: compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java,v >retrieving revision 1.34 >diff -u -r1.34 CaseStatement.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 14 Oct 2009 18:13:28 -0000 1.34 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/CaseStatement.java 11 Sep 2010 02:39:17 -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 >@@ -53,12 +53,12 @@ > public StringBuffer printStatement(int tab, StringBuffer output) { > printIndent(tab, output); > if (this.constantExpression == null) { >- output.append("default : "); //$NON-NLS-1$ >+ output.append("default :"); //$NON-NLS-1$ > } else { > output.append("case "); //$NON-NLS-1$ >- this.constantExpression.printExpression(0, output).append(" : "); //$NON-NLS-1$ >+ this.constantExpression.printExpression(0, output).append(" :"); //$NON-NLS-1$ > } >- return output.append(';'); >+ return output; > } > > /** >Index: compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java,v >retrieving revision 1.28 >diff -u -r1.28 IntLiteral.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 21 Oct 2009 16:19:38 -0000 1.28 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/IntLiteral.java 11 Sep 2010 02:39:17 -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 >@@ -30,18 +30,6 @@ > this(token, s,e); > this.value = value; > } >- >-public IntLiteral(int intValue) { >- //special optimized constructor : the cst is the argument >- //value that should not be used >- // tokens = null ; >- // sourceStart = 0; >- // sourceEnd = 0; >- super(null,0,0); >- this.constant = IntConstant.fromValue(intValue); >- this.value = intValue; >-} >- > public void computeConstant() { > //a special constant is use for the potential Integer.MAX_VALUE+1 > //which is legal if used with a - as prefix....cool.... >@@ -133,15 +121,6 @@ > (this.source[9] == '8') && > (((this.bits & ASTNode.ParenthesizedMASK) >> ASTNode.ParenthesizedSHIFT) == 0)); > } >- >-public StringBuffer printExpression(int indent, StringBuffer output){ >- if (this.source == null) { >- /* special optimized IntLiteral that are created by the compiler */ >- return output.append(String.valueOf(this.value)); >- } >- return super.printExpression(indent, output); >-} >- > public void traverse(ASTVisitor visitor, BlockScope scope) { > visitor.visit(this, scope); > visitor.endVisit(this, scope); >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java,v >retrieving revision 1.52 >diff -u -r1.52 CompletionParserTest2.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java 22 Apr 2010 04:39:01 -0000 1.52 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/CompletionParserTest2.java 11 Sep 2010 02:39:20 -0000 >@@ -7863,7 +7863,7 @@ > String expectedCompletionNodeToString = "<CompleteOnName:zzz>"; > String expectedParentNodeToString = > "switch (1) {\n" + >- "case <CompleteOnName:zzz> : ;\n" + >+ "case <CompleteOnName:zzz> :\n" + > "}"; > String completionIdentifier = "zzz"; > String expectedReplacedSource = "zzz"; >@@ -7874,7 +7874,7 @@ > " void foo() {\n" + > " {\n" + > " switch (1) {\n" + >- " case <CompleteOnName:zzz> : ;\n" + >+ " case <CompleteOnName:zzz> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -7943,8 +7943,8 @@ > String expectedCompletionNodeToString = "<CompleteOnName:zzz>"; > String expectedParentNodeToString = > "switch (1) {\n" + >- "case Something : ;\n" + >- "case <CompleteOnName:zzz> : ;\n" + >+ "case Something :\n" + >+ "case <CompleteOnName:zzz> :\n" + > "}"; > String completionIdentifier = "zzz"; > String expectedReplacedSource = "zzz"; >@@ -7955,8 +7955,8 @@ > " void foo() {\n" + > " {\n" + > " switch (1) {\n" + >- " case Something : ;\n" + >- " case <CompleteOnName:zzz> : ;\n" + >+ " case Something :\n" + >+ " case <CompleteOnName:zzz> :\n" + > " }\n" + > " }\n" + > " }\n" + >Index: src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java,v >retrieving revision 1.13 >diff -u -r1.13 EnumCompletionParserTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java 28 Apr 2009 17:17:31 -0000 1.13 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/EnumCompletionParserTest.java 11 Sep 2010 02:39:20 -0000 >@@ -116,7 +116,7 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -127,7 +127,7 @@ > " void foo() {\n" + > " {\n" + > " switch (c) {\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -183,8 +183,8 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case BAR : ;\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case BAR :\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -195,8 +195,8 @@ > " void foo() {\n" + > " {\n" + > " switch (c) {\n" + >- " case BAR : ;\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case BAR :\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -253,9 +253,9 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case BAR : ;\n" + >- " break ;\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case BAR :\n" + >+ " break;\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -266,9 +266,9 @@ > " void foo() {\n" + > " {\n" + > " switch (c) {\n" + >- " case BAR : ;\n" + >- " break ;\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case BAR :\n" + >+ " break;\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -324,9 +324,9 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case BAR : ;\n" + >- " break ;\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case BAR :\n" + >+ " break;\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -337,9 +337,9 @@ > " void foo() {\n" + > " {\n" + > " switch (c) {\n" + >- " case BAR : ;\n" + >- " break ;\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case BAR :\n" + >+ " break;\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -395,9 +395,9 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case BAR : ;\n" + >- " break ;\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case BAR :\n" + >+ " break;\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -408,9 +408,9 @@ > " void foo() {\n" + > " {\n" + > " switch (c) {\n" + >- " case BAR : ;\n" + >- " break ;\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case BAR :\n" + >+ " break;\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >@@ -472,9 +472,9 @@ > expectedCompletionNodeToString = "<CompleteOnName:FOO>"; > expectedParentNodeToString = > "switch (c) {\n" + >- "case BAR : ;\n" + >- " break ;\n" + >- "case <CompleteOnName:FOO> : ;\n" + >+ "case BAR :\n" + >+ " break;\n" + >+ "case <CompleteOnName:FOO> :\n" + > "}"; > completionIdentifier = "FOO"; > expectedReplacedSource = "FOO"; >@@ -486,9 +486,9 @@ > " {\n" + > " {\n" + > " switch (c) {\n" + >- " case BAR : ;\n" + >- " break ;\n" + >- " case <CompleteOnName:FOO> : ;\n" + >+ " case BAR :\n" + >+ " break;\n" + >+ " case <CompleteOnName:FOO> :\n" + > " }\n" + > " }\n" + > " }\n" + >Index: src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java,v >retrieving revision 1.5 >diff -u -r1.5 EnumSelectionTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java 28 Apr 2009 17:17:27 -0000 1.5 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/EnumSelectionTest.java 11 Sep 2010 02:39:20 -0000 >@@ -39,7 +39,7 @@ > " void foo() {\n" + > " {\n" + > " switch (e) {\n" + >- " case <SelectOnName:A> : ;\n" + >+ " case <SelectOnName:A> :\n" + > " }\n" + > " }\n" + > " }\n" + >Index: src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java,v >retrieving revision 1.23 >diff -u -r1.23 FieldAccessCompletionTest.java >--- src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java 28 Apr 2009 17:17:32 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/compiler/parser/FieldAccessCompletionTest.java 11 Sep 2010 02:39:21 -0000 >@@ -2095,7 +2095,7 @@ > " int i;\n" + > " {\n" + > " switch (i) {\n" + >- " case <CompleteOnMemberAccess:fred().x> : ;\n" + >+ " case <CompleteOnMemberAccess:fred().x> :\n" + > " }\n" + > " }\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 324840
:
178648
| 178670