GAGging for it

89 views
Skip to first unread message

Paul Cowan

unread,
Apr 1, 2010, 6:23:46 AM4/1/10
to google-annota...@googlegroups.com
G'day all,

Great work, very impressed with the library. Can see it being very
useful for us.

There's just one thing I think that's missing:

@DoNotTouch(
withoutConsulting = "er...@example.com",
onPainOf = TORTURE)
public void adjustEndOfMonthBalances(
...

with the corresponding

public enum TamperingConsequences {
DEATH,
TORTURE,
SPANKING,
PAY_CUT,
SILENT_TREATMENT,
DIRTY_LOOK,
SWABBING_THE_POOP_DECK
}

I think we can all agree how valuable this could be for those really
delicate parts of the code which need to be protected at all costs.

Cheers, and keep up the good work,

Paul

Jörn Zaefferer

unread,
Apr 1, 2010, 10:01:40 AM4/1/10
to Google Annotations Gallery
How about @Checksum that gets enforced at compile time if the checksum
of the annotated code changes? You'd need some tool to calculate the
checksum of just that part of the code, but then...

On Apr 1, 12:23 pm, Paul Cowan <p...@mailcow.com> wrote:
> G'day all,
>
> Great work, very impressed with the library. Can see it being very
> useful for us.
>
> There's just one thing I think that's missing:
>
>         @DoNotTouch(

>              withoutConsulting = "e...@example.com",

Leo Deegan

unread,
Apr 1, 2010, 12:37:51 PM4/1/10
to google-annota...@googlegroups.com
DoNotTouch sounds great. I can drop it in there if you like. The checksum sounds a bit challenging, since the enforcement is done dynamically at runtime. I'd have to investigate whether enough information is provided by ASM to calculate a checksum.

--
To unsubscribe, reply using "remove me" as the subject.

Paul Cowan

unread,
Apr 1, 2010, 5:12:59 PM4/1/10
to google-annota...@googlegroups.com
On 2/04/2010 3:37 AM, Leo Deegan wrote:
> DoNotTouch sounds great. I can drop it in there if you like.

I'd love you to. I hereby assign all copyright, my soul, and my
firstborn to Google Inc etc etc, whatever you need.

Another possibility, for those particularly brilliant bits of code:

@FlashOfInspiration(location=TRAFFIC_JAM)
public int perfectHash(Object o) {
....

public enum InspirationLocation {
BED,
BORING_MEETING,
TRAFFIC_JAM,
GYM_WORKOUT,
SHOWER,
BATH,
TOILET
}


(Maybe this doesn't need a separate annotation; it could also work just
as an 'inspirationLocation' attribute on, say, @Magic).

Cheers,

Paul

Leo Deegan

unread,
Apr 1, 2010, 5:25:51 PM4/1/10
to google-annota...@googlegroups.com
Ha! That's great. I think FlashOfInspiration deserves its own annotation. With DoNotTouch, I was thinking about it a bit. What do you think of something a little more snappy like HandsOff?



Paul


☻Mike Samuel

unread,
Apr 1, 2010, 5:30:18 PM4/1/10
to google-annota...@googlegroups.com

That's been supported by javadoc tags since before there even were
code annotations
@see <a href="data:image/jpeg;base64,abcd...">camera-phone snap of napkin</a>
@see napkin in left pocket of the jacket that has the widgy collar
that won't stay down


> Cheers,

Cowan

unread,
Apr 1, 2010, 5:53:43 PM4/1/10
to Google Annotations Gallery
On Apr 2, 8:25 am, Leo Deegan <leodee...@google.com> wrote:
> Ha! That's great. I think FlashOfInspiration deserves its own annotation.
> With DoNotTouch, I was thinking about it a bit. What do you think of
> something a little more snappy like HandsOff?

Yeah, I like it. I was actually toying with 'HandsOff' initially. Just
wasn't sure it worked as well with the attributes (withoutConsulting
and onPainOf).

But yeah, I agree it's a bit more snappy.

Paul

Leo Deegan

unread,
Apr 1, 2010, 6:00:41 PM4/1/10
to google-annota...@googlegroups.com
@Cowan - Cool, I'll take a stab at it and see if I can make the attributes as cohesive as possible with the annotation.

@Mike - was that tongue-in-cheek or was that really the original intent of @see :P


Paul


Jörn Zaefferer

unread,
Apr 2, 2010, 9:30:22 AM4/2/10
to google-annota...@googlegroups.com
How about @CantTouchThis(HAMMERTIME)

Leo Deegan

unread,
Apr 2, 2010, 12:17:20 PM4/2/10
to google-annota...@googlegroups.com
Brilliant. I think what would be funny is if the enum had only one value (HAMMERTIME) and @CantTouchThis required that enum with no default.

Jörn Zaefferer

unread,
Apr 3, 2010, 10:50:45 AM4/3/10
to google-annota...@googlegroups.com
I like it!

Jörn

Leo Deegan

unread,
Apr 5, 2010, 12:51:16 AM4/5/10
to Google Annotations Gallery
Added to version 1.0.1:
* @HandsOff (with a snarky list of consequences)
* @AhaMoment (a briefer form of @FlashOfInspiration)
* @CantTouchThis(Stop.HAMMERTIME)

Thanks for the suggestions, good stuff. Let me know if mods are
warranted.

On Apr 3, 7:50 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:


> I like it!
>
> Jörn
>
>
>
> On Fri, Apr 2, 2010 at 6:17 PM, Leo Deegan <leodee...@google.com> wrote:
> > Brilliant. I think what would be funny is if the enum had only one value
> > (HAMMERTIME) and @CantTouchThis required that enum with no default.
>
> > On Fri, Apr 2, 2010 at 6:30 AM, Jörn Zaefferer <
> > joern.zaeffe...@googlemail.com> wrote:
>
> >> How about @CantTouchThis(HAMMERTIME)
>

> >> On Fri, Apr 2, 2010 at 12:00 AM, Leo Deegan <leodee...@google.com> wrote:
> >> > @Cowan - Cool, I'll take a stab at it and see if I can make the
> >> attributes
> >> > as cohesive as possible with the annotation.
> >> > @Mike - was that tongue-in-cheek or was that really the original intent
> >> of
> >> > @see :P
>

Reply all
Reply to author
Forward
0 new messages