--- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Tue Dec 20 18:02:26 2016 +0000
+++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java Fri Feb 03 14:10:33 2017 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -1797,12 +1797,19 @@
} catch (ClassNotFoundException ex) {
resolveEx = ex;
}
+
+ // Call filterCheck on the class before reading anything else
+ filterCheck(cl, -1);
+
skipCustomData();
- desc.initProxy(cl, resolveEx, readClassDesc(false));
-
- // Call filterCheck on the definition
- filterCheck(desc.forClass(), -1);
+ try {
+ totalObjectRefs++;
+ depth++;
+ desc.initProxy(cl, resolveEx, readClassDesc(false));
+ } finally {
+ depth--;
+ }
handles.finish(descHandle);
passHandle = descHandle;
@@ -1847,12 +1854,19 @@
} catch (ClassNotFoundException ex) {
resolveEx = ex;
}
+
+ // Call filterCheck on the class before reading anything else
+ filterCheck(cl, -1);
+
skipCustomData();
- desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false));
-
- // Call filterCheck on the definition
- filterCheck(desc.forClass(), -1);
+ try {
+ totalObjectRefs++;
+ depth++;
+ desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false));
+ } finally {
+ depth--;
+ }
handles.finish(descHandle);
passHandle = descHandle;