< prev index next >
src/java.base/share/classes/java/io/ObjectInputStream.java
Print this page
rev 12962 : 6823565: Excessive use of HandleList class in de-serialization code causes OutOfMemory
Reviewed-by: shade
*** 3381,3394 ****
/**
* Registers a dependency (in exception status) of one handle on
* another. The dependent handle must be "open" (i.e., assigned, but
* not finished yet). No action is taken if either dependent or target
! * handle is NULL_HANDLE.
*/
void markDependency(int dependent, int target) {
! if (dependent == NULL_HANDLE || target == NULL_HANDLE) {
return;
}
switch (status[dependent]) {
case STATUS_UNKNOWN:
--- 3381,3395 ----
/**
* Registers a dependency (in exception status) of one handle on
* another. The dependent handle must be "open" (i.e., assigned, but
* not finished yet). No action is taken if either dependent or target
! * handle is NULL_HANDLE. Additionally, no action is taken if the
! * dependent and target are the same.
*/
void markDependency(int dependent, int target) {
! if (dependent == target || dependent == NULL_HANDLE || target == NULL_HANDLE) {
return;
}
switch (status[dependent]) {
case STATUS_UNKNOWN:
< prev index next >