From e68077dc870ca45bff88762d191802e6764a9152 Mon Sep 17 00:00:00 2001 From: chibash Date: Wed, 12 Aug 2015 07:07:26 +0900 Subject: [PATCH] fixed minor problems in javadoc etc. --- src/main/javassist/CtBehavior.java | 10 +++++----- src/main/javassist/CtClass.java | 20 ++++++++++---------- src/main/javassist/CtClassType.java | 15 ++++++++------- src/main/javassist/CtField.java | 10 +++++----- src/main/javassist/CtMember.java | 18 +++++++++--------- 5 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/main/javassist/CtBehavior.java b/src/main/javassist/CtBehavior.java index f82c0f2e..75af53b8 100644 --- a/src/main/javassist/CtBehavior.java +++ b/src/main/javassist/CtBehavior.java @@ -159,20 +159,20 @@ public abstract class CtBehavior extends CtMember { } /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param clz the name of annotation class. + * @param typeName the name of annotation type. * @return true if the annotation is found, * otherwise false. - * @since 3.11 + * @since 3.21 */ - public boolean hasAnnotation(String clz) { + public boolean hasAnnotation(String typeName) { MethodInfo mi = getMethodInfo2(); AnnotationsAttribute ainfo = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.invisibleTag); AnnotationsAttribute ainfo2 = (AnnotationsAttribute) mi.getAttribute(AnnotationsAttribute.visibleTag); - return CtClassType.hasAnnotationType(clz, + return CtClassType.hasAnnotationType(typeName, getDeclaringClass().getClassPool(), ainfo, ainfo2); } diff --git a/src/main/javassist/CtClass.java b/src/main/javassist/CtClass.java index 8c39e376..8aafc445 100644 --- a/src/main/javassist/CtClass.java +++ b/src/main/javassist/CtClass.java @@ -582,35 +582,35 @@ public abstract class CtClass { } /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param clz the annotation class. + * @param annotationType the annotation type. * @return true if the annotation is found, otherwise false. * @since 3.11 */ - public boolean hasAnnotation(Class clz) { - return hasAnnotation(clz.getName()); + public boolean hasAnnotation(Class annotationType) { + return hasAnnotation(annotationType.getName()); } /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param annotClzName the name of annotation class. + * @param annotationTypeName the name of annotation type. * @return true if the annotation is found, otherwise false. - * @since 3.11 + * @since 3.21 */ - public boolean hasAnnotation(String annotClzName) { + public boolean hasAnnotation(String annotationTypeName) { return false; } /** - * Returns the annotation if the class has the specified annotation class. + * Returns the annotation if the class has the specified annotation type. * For example, if an annotation @Author is associated * with this class, an Author object is returned. * The member values can be obtained by calling methods on * the Author object. * - * @param clz the annotation class. + * @param clz the annotation type. * @return the annotation if found, otherwise null. * @since 3.11 */ diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java index cf171f09..3a0f2cd7 100644 --- a/src/main/javassist/CtClassType.java +++ b/src/main/javassist/CtClassType.java @@ -452,15 +452,18 @@ class CtClassType extends CtClass { } //@Override - public boolean hasAnnotation(String annotClzName) { + public boolean hasAnnotation(String annotationName) { ClassFile cf = getClassFile2(); AnnotationsAttribute ainfo = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.invisibleTag); AnnotationsAttribute ainfo2 = (AnnotationsAttribute) cf.getAttribute(AnnotationsAttribute.visibleTag); - return hasAnnotationType(annotClzName, getClassPool(), ainfo, ainfo2); + return hasAnnotationType(annotationName, getClassPool(), ainfo, ainfo2); } + /** + * @deprecated + */ static boolean hasAnnotationType(Class clz, ClassPool cp, AnnotationsAttribute a1, AnnotationsAttribute a2) @@ -468,7 +471,7 @@ class CtClassType extends CtClass { return hasAnnotationType(clz.getName(), cp, a1, a2); } - static boolean hasAnnotationType(String annotationClzNm, ClassPool cp, + static boolean hasAnnotationType(String annotationTypeName, ClassPool cp, AnnotationsAttribute a1, AnnotationsAttribute a2) { @@ -484,16 +487,14 @@ class CtClassType extends CtClass { else anno2 = a2.getAnnotations(); - // String typeName = clz.getName(); - String typeName = annotationClzNm; if (anno1 != null) for (int i = 0; i < anno1.length; i++) - if (anno1[i].getTypeName().equals(typeName)) + if (anno1[i].getTypeName().equals(annotationTypeName)) return true; if (anno2 != null) for (int i = 0; i < anno2.length; i++) - if (anno2[i].getTypeName().equals(typeName)) + if (anno2[i].getTypeName().equals(annotationTypeName)) return true; return false; diff --git a/src/main/javassist/CtField.java b/src/main/javassist/CtField.java index bf5125e2..76f64f2a 100644 --- a/src/main/javassist/CtField.java +++ b/src/main/javassist/CtField.java @@ -242,19 +242,19 @@ public class CtField extends CtMember { } /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param clz the name of annotation class. + * @param typeName the name of annotation type. * @return true if the annotation is found, otherwise false. - * @since 3.11 + * @since 3.21 */ - public boolean hasAnnotation(String clz) { + public boolean hasAnnotation(String typeName) { FieldInfo fi = getFieldInfo2(); AnnotationsAttribute ainfo = (AnnotationsAttribute) fi.getAttribute(AnnotationsAttribute.invisibleTag); AnnotationsAttribute ainfo2 = (AnnotationsAttribute) fi.getAttribute(AnnotationsAttribute.visibleTag); - return CtClassType.hasAnnotationType(clz, getDeclaringClass().getClassPool(), + return CtClassType.hasAnnotationType(typeName, getDeclaringClass().getClassPool(), ainfo, ainfo2); } diff --git a/src/main/javassist/CtMember.java b/src/main/javassist/CtMember.java index 63a26b56..3c5da768 100644 --- a/src/main/javassist/CtMember.java +++ b/src/main/javassist/CtMember.java @@ -208,9 +208,9 @@ public abstract class CtMember { public abstract void setModifiers(int mod); /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param clz the annotation class. + * @param clz the annotation type. * @return true if the annotation is found, otherwise false. * @since 3.11 */ @@ -219,26 +219,26 @@ public abstract class CtMember { } /** - * Returns true if the class has the specified annotation class. + * Returns true if the class has the specified annotation type. * - * @param annotClzName the name of annotation class. + * @param annotationTypeName the name of annotation type. * @return true if the annotation is found, otherwise false. - * @since 3.11 + * @since 3.21 */ - public abstract boolean hasAnnotation(String annotClzName); + public abstract boolean hasAnnotation(String annotationTypeName); /** - * Returns the annotation if the class has the specified annotation class. + * Returns the annotation if the class has the specified annotation type. * For example, if an annotation @Author is associated * with this member, an Author object is returned. * The member values can be obtained by calling methods on * the Author object. * - * @param clz the annotation class. + * @param annotationType the annotation type. * @return the annotation if found, otherwise null. * @since 3.11 */ - public abstract Object getAnnotation(Class clz) throws ClassNotFoundException; + public abstract Object getAnnotation(Class annotationType) throws ClassNotFoundException; /** * Returns the annotations associated with this member. -- 2.39.5