Prevent FaceletContext.FACELET_CONTEXT_KEY constant to be inlined by compiler #1257
Comments
Reported by lfryc |
Issue-Links: |
lfryc said: Re-posting: In RichFaces 5 when we compile ActionListenerHandler against Mojarra 2.2.5 and then run the code against older 2.1 release (2.1.7), we get NullPointerException. The issue is well described in RF-13472. The problem here is that a value of FACELET_CONTEXT_KEY contstant is inlined by compiler, but the value has changed between Mojarra 2.1 ("com.sun.faces.facelets.FACELET_CONTEXT") and 2.2 ("javax.faces.FACELET_CONTEXT"). This means the code compiled against one 2.2 won't work on 2.1 and vice versa. What we can do is prevent compiler from inlining the FACELET_CONTEXT_KEY constant. As suggested on stackoverflow, it is possible to use String#intern() or String#toString():
http://stackoverflow.com/questions/377819/are-all-compile-time-constants-inlined I believe the fix should go to 2.1.x branch as well. |
File: changebundle.txt |
@manfredriem said: |
@manfredriem said: svn commit -m "Fixes https://java.net/jira/browse/JAVASERVERFACES-3155, r=edburns, intern the FACELET_CONTEXT_KEY so it does not get inlined." Once the 2.2 TCK passes I will go ahead and close the issue. Thanks! |
@manfredriem said: svn commit -m "Reverting change as it breaks the TCK" |
@manfredriem said: |
@edburns said: |
@manfredriem said: |
Marked as fixed on Tuesday, August 19th 2014, 8:27:55 am |
This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-1257 |
Affected Versions
[2.3]
The text was updated successfully, but these errors were encountered: