mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bugzilla id:314098 Modified JSS_VERSION to reflect 4.0200 for 4.2 and
4.1001 for 4.10.1 when used in the constructor. Human readable values will still be 4.2 or 4.10.1 sr=wtc
This commit is contained in:
parent
9e6573e0d5
commit
848f2d2a1c
@ -35,8 +35,6 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
package org.mozilla.jss;
|
||||
|
||||
import java.math.*;
|
||||
|
||||
public final class JSSProvider extends java.security.Provider {
|
||||
|
||||
/********************************************************************/
|
||||
@ -54,8 +52,9 @@ public final class JSSProvider extends java.security.Provider {
|
||||
private static int JSS_MAJOR_VERSION = 4;
|
||||
private static int JSS_MINOR_VERSION = 2;
|
||||
private static int JSS_PATCH_VERSION = 0;
|
||||
private static double JSS_VERSION = (double)JSS_MAJOR_VERSION +
|
||||
round(((double)JSS_MINOR_VERSION),1)/10;
|
||||
private static double JSS_VERSION = JSS_MAJOR_VERSION +
|
||||
(JSS_MINOR_VERSION * 100 +
|
||||
JSS_PATCH_VERSION)/10000.0;
|
||||
|
||||
public JSSProvider() {
|
||||
super("Mozilla-JSS", JSS_VERSION,
|
||||
@ -227,7 +226,8 @@ public final class JSSProvider extends java.security.Provider {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
String mozillaProviderVersion = new Double(JSS_VERSION).toString();
|
||||
String mozillaProviderVersion = JSS_MAJOR_VERSION + "." +
|
||||
JSS_MINOR_VERSION;
|
||||
if ( JSS_PATCH_VERSION != 0 ) {
|
||||
mozillaProviderVersion = mozillaProviderVersion + "." +
|
||||
JSS_PATCH_VERSION;
|
||||
@ -235,15 +235,4 @@ public final class JSSProvider extends java.security.Provider {
|
||||
|
||||
return "Mozilla-JSS version " + mozillaProviderVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method to round double
|
||||
* @param double value, int round value
|
||||
* @return rounded double
|
||||
*/
|
||||
private static double round(double value, int decimalPlace) {
|
||||
BigDecimal bd = new BigDecimal(value);
|
||||
bd = bd.setScale(decimalPlace,BigDecimal.ROUND_UP);
|
||||
return bd.doubleValue();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user