On 22/04/2014 21:21, Christopher Schultz wrote:

> Before posting, I checked just so I wouldn't embarrass myself. It
> worked just fine. My guess is that you changed the implementation
> to throw an exception after removing the 'final' which then makes
> the 'final' legal again.

I don't see any variation that includes final that compiles.

Option 1:

    int final fipsModeState;
    try {
        fipsModeState = SSL.fipsModeGet();
    } catch (Exception e) {
        throw new IllegalStateException(e);
    }


This failure looks correct to me since it should be illegal to change
the value of a final variable after it has been declared.


Option 2:
    try {
        int final fipsModeState = SSL.fipsModeGet();
    } catch (Exception e) {
        throw new IllegalStateException(e);
    }

This code snippet it OK but compilation fails as the scope of
fipsModeState is now limited to the try block and it is needed outside
of that so again, compilation fails.


How do you propose to mark fipsModeState as final and still have the
code compile?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to