You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Konstantin Kolinko <kn...@gmail.com> on 2014/09/12 19:26:55 UTC

Remove RuntimeVisibleParameterAnnotations from BCEL code

Hi!

Looking at ParameterAnnotationEntry class, its "annotation_table"
field is never read.

As such, that class provides no information
and the following 3 classes can be removed:
* ParameterAnnotationEntry
* ParameterAnnotations
* RuntimeVisibleParameterAnnotations

>From documentation, "RuntimeVisibleParameterAnnotations" record
"run-time-visible Java programming language annotations on the
parameters of the corresponding method."

It is a bit odd, that Tomcat never reads those, but I guess that
specifications do not require us to look for such annotations, or we
look for them using different APIs. I think WebSocket has some code.

Am I missing anything, or is it OK to remove those classes?

After this removal the Attribute.readAttribute() method will boil down
to reading just "RuntimeVisibleAnnotations" (out of original list of
~22 attributes).


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Remove RuntimeVisibleParameterAnnotations from BCEL code

Posted by Mark Thomas <ma...@apache.org>.
On 12/09/2014 18:26, Konstantin Kolinko wrote:
> Hi!
> 
> Looking at ParameterAnnotationEntry class, its "annotation_table"
> field is never read.
> 
> As such, that class provides no information
> and the following 3 classes can be removed:
> * ParameterAnnotationEntry
> * ParameterAnnotations
> * RuntimeVisibleParameterAnnotations
> 
> From documentation, "RuntimeVisibleParameterAnnotations" record
> "run-time-visible Java programming language annotations on the
> parameters of the corresponding method."
> 
> It is a bit odd, that Tomcat never reads those, but I guess that
> specifications do not require us to look for such annotations, or we
> look for them using different APIs. I think WebSocket has some code.

We use the reflection API once the class is loaded.

> Am I missing anything, or is it OK to remove those classes?

Looks good to me.

> After this removal the Attribute.readAttribute() method will boil down
> to reading just "RuntimeVisibleAnnotations" (out of original list of
> ~22 attributes).

:)

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org