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 159088 Details for
Bug 246594
[model] API request: ITypeParameter#getBoundsSignatures() or #getSignature()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed API
patch_246594.txt (text/plain), 4.54 KB, created by
Jay Arthanareeswaran
on 2010-02-15 01:15:06 EST
(
hide
)
Description:
Proposed API
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2010-02-15 01:15:06 EST
Size:
4.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/core/ITypeParameter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeParameter.java,v >retrieving revision 1.10 >diff -u -r1.10 ITypeParameter.java >--- model/org/eclipse/jdt/core/ITypeParameter.java 27 Jun 2008 16:04:01 -0000 1.10 >+++ model/org/eclipse/jdt/core/ITypeParameter.java 15 Feb 2010 06:11:42 -0000 >@@ -42,6 +42,35 @@ > String[] getBounds() throws JavaModelException; > > /** >+ * Returns the signature for this type parameter. The signature may either >+ * be unresolved (for source types) or resolved (for binary types). >+ * >+ * @return the signature for this formal type parameter >+ * @throws JavaModelException if this element doesn't exist or if an exception >+ * occurs while accessing its corresponding resource. >+ * @see Signature >+ * @since 3.6 >+ */ >+ String getSignature() throws JavaModelException; >+ >+ /** >+ * Returns the signatures for the bounds of this type parameter. If this >+ * type has no bounds, returns an empty <code>String</code> >+ * <p> >+ * The bounds signatures may be either unresolved (for source types) or >+ * resolved (for binary types). See {@link Signature} for details. >+ * </p> >+ * >+ * @return the bounds signatures of this type parameter in the order >+ * declared in the source or class file, an empty array if none >+ * @exception JavaModelException if this element does not exist or if an >+ * exception occurs while accessing its corresponding resource. >+ * @see Signature >+ * @since 3.6 >+ */ >+ String[] getBoundsSignature() throws JavaModelException; >+ >+ /** > * Returns the declaring member of this type parameter. This can be either an <code>IType</code> > * or an <code>IMethod</code>. > * <p> >Index: model/org/eclipse/jdt/internal/core/TypeParameter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeParameter.java,v >retrieving revision 1.15 >diff -u -r1.15 TypeParameter.java >--- model/org/eclipse/jdt/internal/core/TypeParameter.java 27 Aug 2009 15:27:02 -0000 1.15 >+++ model/org/eclipse/jdt/internal/core/TypeParameter.java 15 Feb 2010 06:11:42 -0000 >@@ -10,7 +10,13 @@ > *******************************************************************************/ > package org.eclipse.jdt.internal.core; > >-import org.eclipse.jdt.core.*; >+import org.eclipse.jdt.core.IClassFile; >+import org.eclipse.jdt.core.IMember; >+import org.eclipse.jdt.core.ISourceRange; >+import org.eclipse.jdt.core.ITypeParameter; >+import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.Signature; >+import org.eclipse.jdt.core.SourceRange; > import org.eclipse.jdt.core.compiler.CharOperation; > > public class TypeParameter extends SourceRefElement implements ITypeParameter { >@@ -18,12 +24,18 @@ > static final ITypeParameter[] NO_TYPE_PARAMETERS = new ITypeParameter[0]; > > protected String name; >- >+ protected String signature; >+ > public TypeParameter(JavaElement parent, String name) { > super(parent); > this.name = name; > } >- >+ >+ public TypeParameter(JavaElement parent, String name, String signature) { >+ this(parent, name); >+ this.signature = signature; >+ } >+ > public boolean equals(Object o) { > if (!(o instanceof TypeParameter)) return false; > return super.equals(o); >@@ -33,6 +45,31 @@ > TypeParameterElementInfo info = (TypeParameterElementInfo) getElementInfo(); > return CharOperation.toStrings(info.bounds); > } >+ >+ public String[] getBoundsSignature() throws JavaModelException { >+ >+ String[] boundSignatures = null; >+ boolean isResolved = (this.parent instanceof BinaryMember); >+ >+ TypeParameterElementInfo info = (TypeParameterElementInfo) this.getElementInfo(); >+ char[][] bounds = info.bounds; >+ >+ if (bounds == null) { >+ boundSignatures = CharOperation.NO_STRINGS; >+ } else { >+ int boundsLength = bounds.length; >+ boundSignatures = new String[boundsLength]; >+ for (int j = 0; j < boundsLength; j++) { >+ boundSignatures[j] = new String(Signature.createCharArrayTypeSignature(bounds[j], isResolved)); >+ } >+ } >+ return boundSignatures; >+ } >+ >+ >+ public String getSignature() throws JavaModelException { >+ return new String(Signature.createTypeParameterSignature(this.getElementName(), getBoundsSignature())); >+ } > > public IMember getDeclaringMember() { > return (IMember) getParent();
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 246594
:
159088
|
159530
|
160033