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 65052 Details for
Bug 180713
Anonymous type rendered as number in hover
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression tests
180713a.txt (text/plain), 2.90 KB, created by
Jerome Lanneluc
on 2007-04-26 11:23:53 EDT
(
hide
)
Description:
Proposed fix and regression tests
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2007-04-26 11:23:53 EDT
Size:
2.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/Signature.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java,v >retrieving revision 1.87 >diff -u -r1.87 Signature.java >--- model/org/eclipse/jdt/core/Signature.java 24 Nov 2006 01:32:02 -0000 1.87 >+++ model/org/eclipse/jdt/core/Signature.java 26 Apr 2007 15:19:13 -0000 >@@ -2495,6 +2495,8 @@ > } > int p = start + 1; > int checkpoint = buffer.length(); >+ int innerTypeStart = -1; >+ boolean inAnonymousType = false; > while (true) { > if (p >= string.length) { > throw new IllegalArgumentException(); >@@ -2527,6 +2529,8 @@ > } > break; > case C_DOLLAR : >+ innerTypeStart = buffer.length(); >+ inAnonymousType = false; > if (resolved) { > // once we hit "$" there are no more package prefixes > removePackageQualifiers = false; >@@ -2540,7 +2544,15 @@ > } > break; > default : >- buffer.append(c); >+ if (innerTypeStart != -1 && !inAnonymousType && Character.isDigit(c)) { >+ inAnonymousType = true; >+ buffer.setLength(innerTypeStart); // remove '.' >+ buffer.insert(0, "new "); //$NON-NLS-1$ >+ buffer.append("(){}"); //$NON-NLS-1$ >+ } >+ if (!inAnonymousType) >+ buffer.append(c); >+ innerTypeStart = -1; > } > p++; > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/SignatureTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/SignatureTests.java,v >retrieving revision 1.43 >diff -u -r1.43 SignatureTests.java >--- src/org/eclipse/jdt/core/tests/model/SignatureTests.java 6 Nov 2006 14:20:15 -0000 1.43 >+++ src/org/eclipse/jdt/core/tests/model/SignatureTests.java 26 Apr 2007 15:19:14 -0000 >@@ -813,6 +813,18 @@ > assertEquals("Signature#toQualifiedName is not correct3", "", > Signature.toQualifiedName(new String[0])); > } >+ >+/* >+ * Ensures that the toString() signature of an anonymous type is correct >+ * (regression test for bug 180713 Anonymous type rendered as number in hover) >+ */ >+public void testToStringAnonymousType() { >+ assertEquals( >+ "Signature#toString is not correct", >+ "new X(){}", >+ Signature.toString("LX$123;")); >+} >+ > /** > * @see Signature#toString(String) > */ >@@ -1031,6 +1043,17 @@ > Signature.toString("Lx.y.A$Inner;")); > } > >+/* >+ * Ensures that the toString() signature of a member type with a number in its name is correct >+ * (regression test for bug 180713 Anonymous type rendered as number in hover) >+ */ >+public void testToStringInnerType2() { >+ assertEquals( >+ "Signature#toString is not correct", >+ "X.Y1", >+ Signature.toString("LX$Y1;")); >+} >+ > /** > * @see Signature#getTypeSignatureKind(String) > */
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 180713
:
62776
| 65052 |
65184