Community
Participate
Working Groups
N20050525 The APIs Signature#removeCaptureFromMethod(...) remove the capture information from a method signature. To be consistent, we need to offer to clients the hability to remove the capture information from a type signature. Since the implementation of removeCaptureFromMethod(...) consists in removing the '!' character from the given signature, this implementation will also work for type signatures. Propose to rename removeCaptureFromMethod(...) to removeCaptureFrom(...) that would take a type or method signature. Note that several APIs on Signature already take a type or method signature.
Jim, can you please approve this ? There is currently no known clients in the Eclipse SDK. But once the change is made, JDT UI would use it to remove the capture information in the hover.
approved - I assume you'll rename both the String and char[] methods, and fix their specs accordingly. Also, the implementation appears to handle at most 1 capture per signature. I'm not sure that is sufficient for cleansing type signatures (or even method signatures, for that matter). Please review Philippe with Philippe to make sure that implementation is up to the task.
I think the implementation removes all occurrences of a capture just fine.
You're right; code is fine (I was focussing on the System.arrayCopy, and didn't read it closely enough).
Thanks Jim. I will make the change right away.
Renamed both the String and char[] methods. The spec now looks like: /** * Removes any capture information from the given type or method signature * and returns the resulting signature. * Returns the type or method signature itself if no capture information is * present. * <p> * For example: * <pre> * <code> * removeCapture("LTest<!+Ljava.lang.Throwable;>;") * will return: "LTest<+Ljava.lang.Throwable;>;" * </code> * </pre> * </p> * * @param methodOrTypeSignature the signature which may have been captured * @return a new signature without capture information or the signature itself * if no specific capture information is present * @exception NullPointerException if <code>methodOrTypeSignature</code> is null * * @since 3.1 */ public static String removeCapture(String methodOrTypeSignature)
Verified in i20050527-0010