Java switch constant expression... Is there any clever way to get this to compile?
<p>I'm returning to Java dev after many years away from it. Is there anyway to get this code to compile?</p>

<pre><code>class Mpeg4
    {
    public static final int FourCC2Int(char aA, char aB, char aC, char aD)
        {
        return (aA &lt;&lt; 24) | (aB &lt;&lt; 16) | (aC &lt;&lt; 8) | (aD);
        }

    public static void main(String aArgs[]) throws Exception
        {
        int x = Integer.parseInt(aArgs[0]);

        switch (x)
            {
            case Mpeg4.FourCC2Int('f', 't', 'y', 'p'): // This won't be reduced by the compiler to a constant.
                // doSomething();
                break;

            }
        }
    }
</code></pre>

<p>I tried also to have a class constant such as</p>

<pre><code>class Mpeg4
    {
    private static final int KFtyp = Mpeg4.FourCC2Int('f', 't', 'y', 'p');

    public static void main(String aArgs[]) throws Exception
        {
        int x = Integer.parseInt(aArgs[0]);

        switch (x)
            {
            case KFtyp: // Foiled again.
                // doSomething();
                break;
            }
        }
    }
</code></pre>

<p>The language has changed quite a bit, and I've done Googling. Is there any way I can keep my code tidy
i.e. not manually reducing the 'macro' or having a potentially massive if-then-else-if block?
Maybe compiler optimisation flags might be one route? I find this situation quite lame.</p>
