changeset 44924:dbfcc317533b

8138672: Math. negativeZeroFloatBits and Math. negativeZeroDoubleBits should be final Reviewed-by: psandoz, bpb
author darcy
date Thu, 04 May 2017 20:43:00 -0700
parents 9a62aeffc28c
children 32eeee1c0abd 6ffb25c80c5c
files jdk/src/java.base/share/classes/java/lang/Math.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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,