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 154253 Details for
Bug 255640
[spec] Methods Signature.toCharArray(..) have unclear precondition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
patch_255640.txt (text/plain), 2.42 KB, created by
Olivier Thomann
on 2009-12-10 11:44:47 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2009-12-10 11:44:47 EST
Size:
2.42 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.95 >diff -u -r1.95 Signature.java >--- model/org/eclipse/jdt/core/Signature.java 12 Sep 2008 10:32:15 -0000 1.95 >+++ model/org/eclipse/jdt/core/Signature.java 10 Dec 2009 16:47:17 -0000 >@@ -138,6 +138,9 @@ > * <p> > * This class provides static methods and constants only. > * </p> >+ * <p>Note: An empty signature is considered to be syntactically incorrect. So most methods will throw >+ * an IllegalArgumentException if an empty signature is provided.</p> >+ * > * @noinstantiate This class is not intended to be instantiated by clients. > */ > public final class Signature { >@@ -2141,7 +2144,7 @@ > * @param includeReturnType <code>true</code> if the return type is to be > * included > * @return the char array representation of the method signature >- * >+ * @throws IllegalArgumentException if the method signature is syntactically incorrect > * @since 2.0 > */ > public static char[] toCharArray(char[] methodSignature, char[] methodName, char[][] parameterNames, boolean fullyQualifyTypeNames, boolean includeReturnType) { >@@ -2172,6 +2175,7 @@ > * @param isVargArgs <code>true</code> if the last argument should be displayed as a > * variable argument, <code>false</code> otherwise. > * @return the char array representation of the method signature >+ * @throws IllegalArgumentException if the method signature is syntactically incorrect > * > * @since 3.1 > */ >@@ -2242,14 +2246,16 @@ > * > * @param signature the type signature > * @return the string representation of the type >- * @exception IllegalArgumentException if the signature is not syntactically >- * correct >+ * @exception IllegalArgumentException if the signature is syntactically incorrect > * > * @since 2.0 > */ > public static char[] toCharArray(char[] signature) throws IllegalArgumentException { > int sigLength = signature.length; >- if (sigLength == 0 || signature[0] == C_PARAM_START || signature[0] == C_GENERIC_START) { >+ if (sigLength == 0) { >+ throw new IllegalArgumentException(); >+ } >+ if (signature[0] == C_PARAM_START || signature[0] == C_GENERIC_START) { > return toCharArray(signature, CharOperation.NO_CHAR, null, true, true); > } >
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 255640
: 154253