Cómo NO hacer un parse de argumendos de línea de comandos

Leyendo Worse Than Failure llegué a este curioso ejemplo de cómo no deben tratarse los argumentos pasados a un programa:

public static void  main (String args[])
{
    // Get a hash value for the first argument
    int hash = getHashValue(args[0].toCharArray());

    switch(hash)
    {
        case 972346: // The first argument was "help"
            ...
            break;
        case -91058: // The first argument was "single"
            ...
            break;
        case -4830672: // The first argument was "multi"
            ...
            break;
        // etc
    }
}

CC 2009 El Módem. Some rights reserved.