- Revision
- 1445
- Author
- rfscholte
- Date
- 2011-10-26 14:27:11 -0500 (Wed, 26 Oct 2011)
Log Message
More javadoc
Modified Paths
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaPackage.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaAnnotation.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaConstructor.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaField.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaMethod.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaParameter.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaSource.java
- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaType.java
Diff
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaPackage.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaPackage.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaPackage.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -48,7 +48,7 @@ * * For instance: the package of <code>java.lang.reflect</code> is <code>java.lang</code> * - * @return the parent package + * @return the parent package, otherwise <code>null</code> */ JavaPackage getParentPackage(); @@ -60,7 +60,7 @@ Collection<JavaPackage> getSubPackages(); /** - * The name of this package + * Equivalent of {@link Package#getName()} * * @return the name, should never be <code>null</code> */ @@ -72,4 +72,11 @@ * @return the classLibrary, should never be <code>null</code> */ ClassLibrary getJavaClassLibrary(); + + /** + * Equivalent of {@link Package#toString()} + * + * @return the string representation of the package. + */ + String toString(); } \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/JavaType.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -25,6 +25,46 @@ */ public interface JavaType { + JavaType VOID = new JavaType() + { + private final String value = "void"; + + public String getCanonicalName() + { + return value; + } + + public String getGenericCanonicalName() + { + return value; + } + + public String getFullyQualifiedName() + { + return value; + } + + public String getGenericFullyQualifiedName() + { + return value; + } + + public String getValue() + { + return value; + } + + public String getGenericValue() + { + return value; + } + + public String toGenericString() + { + return value; + } + }; + /** * Equivalent of (@link {@link java.lang.Class#getCanonicalName()}. *
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaAnnotation.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaAnnotation.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaAnnotation.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -65,9 +65,8 @@ if ( properties != null ) { - for ( Iterator<Entry<String, AnnotationValue>> i = this.properties.entrySet().iterator(); i.hasNext(); ) + for ( Entry<String, AnnotationValue> entry : properties.entrySet() ) { - Entry<String, AnnotationValue> entry = i.next(); String name = entry.getKey(); AnnotationValue value = entry.getValue(); @@ -165,4 +164,4 @@ result.append( ')' ); return result.toString(); } -} +} \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaConstructor.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaConstructor.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaConstructor.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -27,6 +27,7 @@ this.typeParameters = typeParameters; } + /** {@inheritDoc} */ public List<JavaTypeVariable<JavaConstructor>> getTypeParameters() { return typeParameters; @@ -42,6 +43,7 @@ return super.signatureMatches( parameterTypes, varArgs ); } + /** {@inheritDoc} */ public String getCodeBlock() { return getModelWriter().writeConstructor( this ).toString();
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaField.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaField.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaField.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -29,38 +29,33 @@ private String initializationExpression; private boolean enumConstant; - public DefaultJavaField() { + public DefaultJavaField() + { } - public DefaultJavaField(String name) { - setName(name); + public DefaultJavaField( String name ) + { + setName( name ); } - public DefaultJavaField(T type, String name) { + public DefaultJavaField( T type, String name ) + { this( name ); this.type = type; } - - /* - * (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMember#getDeclaringClass() - */ - public JavaClass getDeclaringClass() { - return getParentClass(); + + /** {@inheritDoc} */ + public JavaClass getDeclaringClass() + { + return getParentClass(); } - /** - * Retrieve the Type of this field - * - * @return the Type of this field - */ + /** {@inheritDoc} */ public JavaClass getType() { return type; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaField#getCodeBlock() - */ + /** {@inheritDoc} */ public String getCodeBlock() { return getModelWriter().writeField( this ).toString(); @@ -70,10 +65,8 @@ this.type = type; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaField#getDeclarationSignature(boolean) - */ - public String getDeclarationSignature(boolean withModifiers) { + /** {@inheritDoc} */ + public String getDeclarationSignature(boolean withModifiers) { StringBuffer result = new StringBuffer(); if (withModifiers) { for (String modifier : getModifiers()) { @@ -87,33 +80,28 @@ return result.toString(); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaField#getCallSignature() - */ - public String getCallSignature() { + /** {@inheritDoc} */ + public String getCallSignature() + { return getName(); } + /** {@inheritDoc} */ + public String getInitializationExpression() + { + return initializationExpression; + } - /* - * (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaField#getInitializationExpression() - */ - public String getInitializationExpression(){ - return initializationExpression; + public void setInitializationExpression( String initializationExpression ) + { + this.initializationExpression = initializationExpression; } - - public void setInitializationExpression(String initializationExpression){ - this.initializationExpression = initializationExpression; - } - /* - * (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaField#isEnumConstant() - */ - public boolean isEnumConstant() { - return enumConstant; - } + /** {@inheritDoc} */ + public boolean isEnumConstant() + { + return enumConstant; + } public void setEnumConstant(boolean enumConstant) { this.enumConstant = enumConstant;
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaMethod.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaMethod.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaMethod.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -63,9 +63,7 @@ setName(name); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getReturns() - */ + /** {@inheritDoc} */ public JavaClass getReturns() { return returns; } @@ -75,14 +73,13 @@ this.typeParameters = typeParameters; } + /** {@inheritDoc} */ public List<JavaTypeVariable<JavaMethod>> getTypeParameters() { return typeParameters; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getCodeBlock() - */ + /** {@inheritDoc} */ public String getCodeBlock() { return getModelWriter().writeMethod( this ).toString(); @@ -94,65 +91,76 @@ private String getSignature( boolean withModifiers, boolean isDeclaration ) { StringBuffer result = new StringBuffer(); - if ( withModifiers ) { - for ( String modifier : getModifiers() ) + if ( withModifiers ) + { + for ( String modifier : getModifiers() ) { // check for public, protected and private - if ( modifier.startsWith( "p" ) ) { + if ( modifier.startsWith( "p" ) ) + { result.append( modifier ).append( ' ' ); } } - for ( String modifier : getModifiers() ) + for ( String modifier : getModifiers() ) { // check for public, protected and private - if ( !modifier.startsWith( "p" ) ) + if ( !modifier.startsWith( "p" ) ) { result.append( modifier ).append( ' ' ); } } } - if(isDeclaration) { - result.append(returns.getCanonicalName()); - result.append(' '); + if ( isDeclaration ) + { + result.append( returns.getCanonicalName() ); + result.append( ' ' ); } - result.append(getName()); - result.append('('); - for (ListIterator<JavaParameter> iter = getParameters().listIterator(); iter.hasNext();) { + result.append( getName() ); + result.append( '(' ); + for ( ListIterator<JavaParameter> iter = getParameters().listIterator(); iter.hasNext(); ) + { JavaParameter parameter = iter.next(); - if (isDeclaration) { - result.append(parameter.getType().getCanonicalName()); - if (parameter.isVarArgs()) { - result.append("..."); + if ( isDeclaration ) + { + result.append( parameter.getType().getCanonicalName() ); + if ( parameter.isVarArgs() ) + { + result.append( "..." ); } - result.append(' '); + result.append( ' ' ); } - result.append(parameter.getName()); - if (iter.hasNext()) + result.append( parameter.getName() ); + if ( iter.hasNext() ) { - result.append(", "); + result.append( ", " ); } } - result.append(')'); - if (isDeclaration && !getExceptions().isEmpty() ) { - result.append(" throws "); - for(Iterator<JavaClass> excIter = getExceptions().iterator();excIter.hasNext();) { - result.append(excIter.next().getCanonicalName()); - if(excIter.hasNext()) { - result.append(", "); - } + result.append( ')' ); + if ( isDeclaration && !getExceptions().isEmpty() ) + { + result.append( " throws " ); + for ( Iterator<JavaClass> excIter = getExceptions().iterator(); excIter.hasNext(); ) + { + result.append( excIter.next().getCanonicalName() ); + if ( excIter.hasNext() ) + { + result.append( ", " ); } + } } return result.toString(); } + /** {@inheritDoc} */ public String getDeclarationSignature( boolean withModifiers ) { return getSignature(withModifiers, true); } + /** {@inheritDoc} */ public String getCallSignature() { return getSignature(false, false); @@ -163,7 +171,8 @@ * * @param returns the return type */ - public void setReturns(T returns) { + public void setReturns(T returns) + { this.returns = returns; } @@ -233,33 +242,31 @@ return hashCode; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#isPropertyAccessor() - */ - public boolean isPropertyAccessor() { + /** {@inheritDoc} */ + public boolean isPropertyAccessor() + { if ( isStatic() ) { return false; } - if ( getParameters().size() != 0 ) { + if ( getParameters().size() != 0 ) + { return false; } - - if ( getName().startsWith( "is" ) ) + if ( getName().startsWith( "is" ) ) { - return ( getName().length() > 2 && Character.isUpperCase( getName().charAt(2) ) ); + return ( getName().length() > 2 && Character.isUpperCase( getName().charAt( 2 ) ) ); } - if ( getName().startsWith( "get" ) ) + if ( getName().startsWith( "get" ) ) { - return ( getName().length() > 3 && Character.isUpperCase( getName().charAt(3) ) ); + return ( getName().length() > 3 && Character.isUpperCase( getName().charAt( 3 ) ) ); } return false; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#isPropertyMutator() - */ - public boolean isPropertyMutator() { + /** {@inheritDoc} */ + public boolean isPropertyMutator() + { if ( isStatic() ) { return false; @@ -277,9 +284,7 @@ return false; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getPropertyType() - */ + /** {@inheritDoc} */ public JavaType getPropertyType() { if ( isPropertyAccessor() ) @@ -293,26 +298,26 @@ return null; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getPropertyName() - */ - public String getPropertyName() { + /** {@inheritDoc} */ + public String getPropertyName() + { int start = -1; - if ( getName().startsWith( "get" ) || getName().startsWith( "set" ) ) + if ( getName().startsWith( "get" ) || getName().startsWith( "set" ) ) { start = 3; - } - else if ( getName().startsWith( "is" ) ) + } + else if ( getName().startsWith( "is" ) ) { start = 2; - } - else + } + else { return null; } - return Introspector.decapitalize( getName().substring(start) ); + return Introspector.decapitalize( getName().substring( start ) ); } + /** {@inheritDoc} */ public String toString() { StringBuffer result = new StringBuffer(); @@ -382,24 +387,19 @@ return result.toString(); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getGenericReturnType() - */ + /** {@inheritDoc} */ public JavaClass getGenericReturnType() { return returns; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getReturnType() - */ - public JavaType getReturnType() { - return getReturnType( false ); - } + /** {@inheritDoc} */ + public JavaType getReturnType() + { + return getReturnType( false ); + } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaMethod#getReturnType(boolean) - */ + /** {@inheritDoc} */ public JavaType getReturnType( boolean resolve ) { return returns; @@ -418,4 +418,4 @@ } return signatureMatches( parameterTypes, varArg ); } -} +} \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaPackage.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -47,11 +47,7 @@ this.name= name; } - /** - * Equivalent of {@link Package#getName()} - * - * @return the name of the package - */ + /** {@inheritDoc} */ public String getName() { return name; } @@ -60,6 +56,7 @@ this.name = name; } + /** {@inheritDoc} */ public String getCodeBlock() { return getModelWriter().writePackage(this).toString(); } @@ -69,6 +66,7 @@ this.classLibrary = classLibrary; } + /** {@inheritDoc} */ public ClassLibrary getJavaClassLibrary() { return classLibrary; @@ -78,9 +76,7 @@ classes.add(clazz); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaPackage#getClasses() - */ + /** {@inheritDoc} */ public Collection<JavaClass> getClasses() { //avoid infinitive recursion if (this == classLibrary.getJavaPackage( name )) { @@ -91,6 +87,7 @@ } } + /** {@inheritDoc} */ public JavaClass getClassByName(String name) { JavaClass result = null; @@ -107,12 +104,14 @@ return result; } + /** {@inheritDoc} */ public JavaPackage getParentPackage() { String parentName = name.substring( 0, name.lastIndexOf( '.' ) ); return classLibrary.getJavaPackage( parentName ); } + /** {@inheritDoc} */ public List<JavaPackage> getSubPackages() { String expected = name + "."; Collection<JavaPackage> jPackages = classLibrary.getJavaPackages(); @@ -126,6 +125,7 @@ return retList; } + @Override public boolean equals( Object o ) { if ( this == o ) @@ -142,15 +142,12 @@ return ( name.equals( that.getName() ) ); } + @Override public int hashCode() { return 11 + name.hashCode(); } - - /** - * Equivalent of {@link Package#toString()} - * - * @return the string representation of the package. - */ + + @Override public String toString() { return "package " + name; }
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaParameter.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaParameter.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaParameter.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -34,35 +34,38 @@ private JavaMethod parentMethod; private boolean varArgs; - public DefaultJavaParameter(T type, String name) { - this(type, name, false); + public DefaultJavaParameter( T type, String name ) + { + this( type, name, false ); } - public DefaultJavaParameter(T type, String name, boolean varArgs) { + public DefaultJavaParameter( T type, String name, boolean varArgs ) + { this.name = name; this.type = type; this.varArgs = varArgs; } - public String getCodeBlock() { - return getModelWriter().writeParameter(this).toString(); + /** {@inheritDoc} */ + public String getCodeBlock() + { + return getModelWriter().writeParameter( this ).toString(); } - - public void setName(String name) { - this.name = name; - } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getName() - */ - public String getName() { + public void setName( String name ) + { + this.name = name; + } + + /** {@inheritDoc} */ + public String getName() + { return name; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getType() - */ - public JavaType getType() { + /** {@inheritDoc} */ + public JavaType getType() + { return type; } @@ -70,84 +73,86 @@ { return type; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getParentMethod() - */ - public JavaMethod getParentMethod() { + + /** {@inheritDoc} */ + public JavaMethod getParentMethod() + { return parentMethod; } - public void setParentMethod(JavaMethod parentMethod) { + public void setParentMethod( JavaMethod parentMethod ) + { this.parentMethod = parentMethod; } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getParentClass() - */ + /** {@inheritDoc} */ public JavaClass getParentClass() { return getParentMethod().getParentClass(); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#isVarArgs() - */ + /** {@inheritDoc} */ public boolean isVarArgs() { return varArgs; } + /** {@inheritDoc} */ public String getFullyQualifiedName() { return type.getFullyQualifiedName(); } + /** {@inheritDoc} */ public String getCanonicalName() { return type.getCanonicalName(); } + /** {@inheritDoc} */ public String getValue() { return type.getValue(); } + /** {@inheritDoc} */ public String getGenericCanonicalName() { return type.getGenericCanonicalName(); } + /** {@inheritDoc} */ public String getGenericFullyQualifiedName() { return type.getGenericFullyQualifiedName(); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getResolvedValue() - */ - public String getResolvedValue() { + /** {@inheritDoc} */ + public String getResolvedValue() + { return DefaultJavaType.getResolvedValue( type, getParentMethod().getTypeParameters() ); } + /** {@inheritDoc} */ public String getResolvedFullyQualifiedName() { return DefaultJavaType.getResolvedFullyQualifiedName( type, getParentMethod().getTypeParameters() ); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaParameter#getResolvedGenericValue() - */ + /** {@inheritDoc} */ public String getResolvedGenericValue() { return DefaultJavaType.getResolvedGenericValue( type, getParentMethod().getTypeParameters() ); } + /** {@inheritDoc} */ public String getResolvedGenericFullyQualifiedName() { return DefaultJavaType.getResolvedGenericFullyQualifiedName( type, getParentMethod().getTypeParameters() ); } @Override - public int hashCode() { + public int hashCode() + { return 13 + ( isVarArgs() ? 1 : 0 ) + getType().hashCode(); } @@ -168,10 +173,12 @@ } @Override - public String toString() { + public String toString() + { return getResolvedValue() + " "+ name; } + /** {@inheritDoc} */ public String getGenericValue() { return type.getGenericValue(); @@ -181,5 +188,4 @@ { return type.toGenericString(); } - -} +} \ No newline at end of file
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaSource.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaSource.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaSource.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -107,20 +107,17 @@ classes.add(cls); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaSource#getClasses() - */ + /** {@inheritDoc} */ public List<JavaClass> getClasses() { return Collections.unmodifiableList( classes ); } - /* (non-Javadoc) - * @see com.thoughtworks.qdox.model.JavaSource#getCodeBlock() - */ + /** {@inheritDoc} */ public String getCodeBlock() { return getModelWriter().writeSource( this ).toString(); } + /** {@inheritDoc} */ public String toString() { return getCodeBlock(); }
Modified: trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaType.java (1444 => 1445)
--- trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaType.java 2011-10-25 19:49:32 UTC (rev 1444) +++ trunk/qdox/src/main/java/com/thoughtworks/qdox/model/impl/DefaultJavaType.java 2011-10-26 19:27:11 UTC (rev 1445) @@ -25,6 +25,7 @@ import java.util.LinkedList; import java.util.List; +import com.thoughtworks.qdox.GenericsTest; import com.thoughtworks.qdox.library.ClassLibrary; import com.thoughtworks.qdox.model.BeanProperty; import com.thoughtworks.qdox.model.DocletTag; @@ -328,7 +329,7 @@ /** * @since 1.3 */ - public boolean isA( DefaultJavaType type ) + public boolean isA( JavaType type ) { if ( this == type ) { @@ -448,7 +449,7 @@ if ( !actualTypeArguments.isEmpty() ) { DefaultJavaType typeResult = - new DefaultJavaType( base.getFullyQualifiedName(), base.getValue(), ((DefaultJavaType)base).getDimensions(), + new DefaultJavaType( base.getFullyQualifiedName(), base.getValue(), getDimensions( base ), ((DefaultJavaType)base).getJavaClassParent() ); List<JavaType> actualTypes = new LinkedList<JavaType>(); @@ -461,14 +462,24 @@ } return result; } + + private static int getDimensions( JavaType type ) + { + return type instanceof JavaClass ? ( (JavaClass) type ).getDimensions() : 0; + } + + private static JavaClass getDeclaringClass( JavaType type ) + { + return type instanceof JavaClass ? ( (JavaClass) type ).getDeclaringClass() : null; + } private static int getTypeVariableIndex( JavaClass declaringClass, String fqn ) { int typeIndex = -1; - for ( Object typeVariable : declaringClass.getTypeParameters() ) + for ( JavaTypeVariable<?> typeVariable : declaringClass.getTypeParameters() ) { typeIndex++; - if ( ((DefaultJavaTypeVariable<?>) typeVariable).getFullyQualifiedName().equals( fqn ) ) + if ( typeVariable.getFullyQualifiedName().equals( fqn ) ) { return typeIndex; }
To unsubscribe from this list please visit:
