dev@glassfish.java.net

Re: Head's Up: REST-related Annotation Changes

From: Jason Lee <jason.d.lee_at_oracle.com>
Date: Fri, 14 Oct 2011 11:19:12 -0500

On 10/14/11 11:09 AM, Marina Vatkina wrote:
> Thanks for the diffs.
>
> 1. RecoverTransactionsInternal is used only internally and not exposed
> to the client.
Hmm. That one was in the String[][] in the REST module for some reason,
so I added the annotation. If you feel it shouldn't be exposed, we can
easily remove it.

> 2. Where do the descriptions come from? Why are they so different? Can
> they be 18n-ed?
I'm not entirely sure where they come from, to be honest. The original
metadata was added to and modified by several people, with no clear
control, process, etc, so it was likely whatever the developer had in
his/her head at the time. :) Currently, there is no support for i18n in
the code that processes the annotations, but the need for that did occur
to me as I was making all of these changes. I'll try to get that added,
at which point we'll have to revisit all of these annotations. I'm
hoping to write a small utility that analyzes all of the AdminCommand
instances with respect to the REST annotations (e.g., make a list of
those not annotated, try to make sure the HTTP verb is the correct one,
etc). Adding a check to this for non-i18n'd descriptions should be
pretty simple to do.
> Also, please do not replace explicit import statements with a * - it's
> better to see all the dependencies.
Right. NetBeans did that, which I didn't notice at the time. I'll have
to figure out how to make it stop doing that. :) I committed all of the
changes a couple of days ago as I hadn't heard any objections, so there
are at least a couple of options: You can fix the imports,
descriptions, etc as you see fit yourself, or I can go back and do the
same. I don't mind doing that (since I caused it :), but it might be a
few days before I can get back to it, as I have some 3.1.2 perf work
that has been given high priority. If you don't mind waiting, I'll try
to get that done before, hopefully, the end of next week. (Should I/we
remove the annotations on RecoverTransactionsInternal?)

Thanks for the feedback.

-- 
Jason Lee
Senior Member of Technical Staff, Oracle
GlassFish Team
Phone +1 (405) 216-3193
http://blogs.steeplesoft.com