<Swing Dev> [9] Review Request: 8073420 JFrame.EXIT_ON_CLOSE can be removed in favour of WindowConstants.EXIT_ON_CLOSE

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Tue Feb 24 15:36:16 UTC 2015


  The fix looks good to me.

  Thanks,
  Alexandr.

On 2/24/2015 5:13 PM, Sergey Bylokhov wrote:
> Hello.
> Please review the fix for jdk 9.
>   - In JDK 1.2 javax.swing.WindowConstants interface was added.
>   - But unfortunately WindowConstants didn't contain EXIT_ON_CLOSE 
> constant, later in jdk 1.3 this constant was added to the JFrame 
> class, which implements WindowConstants.
>   - Later it was realized that it should be added to the 
> WindowConstants instead, and this was fixed in jdk 1.4
>
> EXIT_ON_CLOSE fields are static constant variables (JLS 4.12.4). When 
> source code references either field,
> a Java compiler is required to inline the field's value into the 
> resulting class file (JLS 14.21).
> This means that removing EXIT_ON_CLOSE from JFrame is binary compatible,
> because no class file actually refers to the field in JFrame directly 
> (JLS 13.4.9).
>
> In addition, removing EXIT_ON_CLOSE from JFrame is source compatible,
> because JFrame continues to have an EXIT_ON_CLOSE member (via
> inheritance from WindowConstants) so code which refers to
> JFrame.EXIT_ON_CLOSE will recompile.
>
> CCC request will be created after review.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8073420
> Webrevs can be found at:
> http://cr.openjdk.java.net/~serb/8073420/webrev.00/jdk
> http://cr.openjdk.java.net/~serb/8073420/webrev.00/pubs
>




More information about the swing-dev mailing list