JSF 2.2 FlashELResolver direct usage of ELFlash

From: Ken Finnigan <>
Date: Mon, 8 Jul 2013 10:45:51 -0400 (EDT)


On line 260 of FlashELResolver, in Mojarra 2.2.0, it makes a direct call to ELFlash to set a flag.

This prevents a developer from developing their own Flash implementation, that can be retrieved from the FlashFactory, and
have it function as expected within the FlashELResolver.

On closer inspection of the flag being set on ELFlash, it appears to only be used within the ELFlash.get() method. However, the structure of the code within that method means
that whether the flag is set or not, the result of the get() method will be identical, as both situations result in a call to ELFlash. getPhaseMapForReading().get(key).

I have a two fold question around this:

1) Can we remove the direct usage of ELFlash from FlashELFactory?

2) And is the best way to remove that direct usage by simply removing the setKeepFlag() method, and associated get and clear, from ELFlash? As opposed to adding methods onto Flash.

Ken Finnigan

Principal Software Engineer / JBoss Enterprise Middleware Red Hat, Inc.