< prev index next >
src/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -232,18 +232,17 @@
*
* @return the init lifetime remaining in seconds
* @exception GSSException may be thrown
*/
public int getInitLifetime() throws GSSException {
- int retVal = 0;
Date d = getEndTime();
if (d == null) {
return 0;
}
- retVal = (int)(d.getTime() - (new Date().getTime()));
- return retVal/1000;
+ long retVal = d.getTime() - System.currentTimeMillis();
+ return (int)(retVal/1000);
}
/**
* Returns the accept lifetime remaining.
*
< prev index next >