Suggestion: @HereBeDragons

18 views
Skip to first unread message

Pablo J. Cabrera Muñoz

unread,
Apr 6, 2010, 1:52:22 PM4/6/10
to Google Annotations Gallery
How about it?

Leo Deegan

unread,
Apr 6, 2010, 2:05:36 PM4/6/10
to google-annota...@googlegroups.com
I like it. What would the Javadoc description say?

On Tue, Apr 6, 2010 at 10:52 AM, Pablo J. Cabrera Muñoz <pablo.cab...@gmail.com> wrote:
How about it?


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

Leo Deegan

unread,
Apr 6, 2010, 2:06:17 PM4/6/10
to google-annota...@googlegroups.com
Something like "Indicates that the annotated code is where dragons be."?

Pablo J. Cabrera Muñoz

unread,
Apr 6, 2010, 2:20:59 PM4/6/10
to Google Annotations Gallery
What about...

Indicates that the annotated code must not be touched by ordinary
people. Only gurus, wizards and mythical explorers would be allowed to
touch it at his own peril.

@see http://en.wikipedia.org/wiki/Here_be_dragons

... or something like it.

☻Mike Samuel

unread,
Apr 6, 2010, 3:03:17 PM4/6/10
to google-annota...@googlegroups.com
On Tue, Apr 6, 2010 at 11:20, Pablo J. Cabrera Muñoz
<pablo.cab...@gmail.com> wrote:
> What about...
>
> Indicates that the annotated code must not be touched by ordinary
> people. Only gurus, wizards and mythical explorers would be allowed to
> touch it at his own peril.
>
> @see http://en.wikipedia.org/wiki/Here_be_dragons

Since dragons tend to inhabit unknown portions of maps, maybe the
example code should be:

@HereBeDragons
public static <K, V>
V getMember(Class<K> keyType, Map<? extends K, ? extends V> map,
Object location) {
return location != null && !keyType.isInstance(location) ?
map.get(location) : null;
}

and a useful piece of code that a client can use to provide some level
of protection from an API that exposes dragons:

private static void maybeSlayDragons(Map<?, ?> map) {
if (Locale.getDefault().equals(Locale.ENGLISH) &&
isStGeorgesDay(new Date())) {
map.clear();

☻Mike Samuel

unread,
Apr 6, 2010, 3:03:59 PM4/6/10
to google-annota...@googlegroups.com
On Tue, Apr 6, 2010 at 12:03, ☻Mike Samuel <msa...@google.com> wrote:
> On Tue, Apr 6, 2010 at 11:20, Pablo J. Cabrera Muñoz
> <pablo.cab...@gmail.com> wrote:
>> What about...
>>
>> Indicates that the annotated code must not be touched by ordinary
>> people. Only gurus, wizards and mythical explorers would be allowed to
>> touch it at his own peril.
>>
>> @see http://en.wikipedia.org/wiki/Here_be_dragons
>
> Since dragons tend to inhabit unknown portions of maps, maybe the
> example code should be:
>
>  @HereBeDragons
>  public static <K, V>
>  V getMember(Class<K> keyType, Map<? extends K, ? extends V> map,
> Object location) {

Sorry, the getMember method should of course be called explore or sallyForth.

Jörn Zaefferer

unread,
Apr 6, 2010, 3:50:40 PM4/6/10
to google-annota...@googlegroups.com
Here be Javadoc.

Paul Cowan

unread,
Apr 6, 2010, 6:53:02 PM4/6/10
to google-annota...@googlegroups.com
On 07/04/10 03:52, Pablo J. Cabrera Mu�oz wrote:
> How about it?

Love it. Can think of a million places we could use this in our codebase...

@HereBe(DRAGONS)
@HereBe(SEA_MONSTERS)
@HereBe(RAVENOUS_BUGBLATTER_BEASTS)
@HereBe(RODENTS_OF_UNUSUAL_SIZE)

Paul

Leo Deegan

unread,
Apr 6, 2010, 7:02:10 PM4/6/10
to google-annota...@googlegroups.com
You guys are a riot. I like it. I'll try to get this into the next version.

On Tue, Apr 6, 2010 at 3:53 PM, Paul Cowan <pa...@mailcow.com> wrote:
On 07/04/10 03:52, Pablo J. Cabrera Muñoz wrote:
How about it?

Love it. Can think of a million places we could use this in our codebase...

@HereBe(DRAGONS)
@HereBe(SEA_MONSTERS)
@HereBe(RAVENOUS_BUGBLATTER_BEASTS)
@HereBe(RODENTS_OF_UNUSUAL_SIZE)

Paul
Reply all
Reply to author
Forward
0 new messages