--- a/src/java.base/share/classes/java/lang/Object.java Sat Sep 15 22:16:16 2018 +0200
+++ b/src/java.base/share/classes/java/lang/Object.java Sat Sep 15 13:53:43 2018 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -455,7 +455,7 @@
"nanosecond timeout value out of range");
}
- if (nanos > 0) {
+ if (nanos > 0 && timeoutMillis < Long.MAX_VALUE) {
timeoutMillis++;
}