8138672: Math. negativeZeroFloatBits and Math. negativeZeroDoubleBits should be final
authordarcy
Thu, 04 May 2017 20:43:00 -0700
changeset 44924 dbfcc317533b
parent 44923 9a62aeffc28c
child 44926 32eeee1c0abd
child 46861 6ffb25c80c5c
8138672: Math. negativeZeroFloatBits and Math. negativeZeroDoubleBits should be final Reviewed-by: psandoz, bpb
jdk/src/java.base/share/classes/java/lang/Math.java
--- a/jdk/src/java.base/share/classes/java/lang/Math.java	Fri May 05 00:41:31 2017 +0000
+++ b/jdk/src/java.base/share/classes/java/lang/Math.java	Thu May 04 20:43:00 2017 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -1442,8 +1442,8 @@
     }
 
     // Use raw bit-wise conversions on guaranteed non-NaN arguments.
-    private static long negativeZeroFloatBits  = Float.floatToRawIntBits(-0.0f);
-    private static long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d);
+    private static final long negativeZeroFloatBits  = Float.floatToRawIntBits(-0.0f);
+    private static final long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d);
 
     /**
      * Returns the greater of two {@code float} values.  That is,