mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 01:54:47 +02:00
8190289: More refactoring for client deserialization cases
Reviewed-by: prr, azvegint, rhalade, skoivu
This commit is contained in:
parent
250b374e54
commit
7f2f3c08cb
2 changed files with 23 additions and 13 deletions
|
@ -25,13 +25,14 @@
|
||||||
|
|
||||||
package java.awt.geom;
|
package java.awt.geom;
|
||||||
|
|
||||||
import java.awt.Shape;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import sun.awt.geom.Curve;
|
import java.awt.Shape;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.io.StreamCorruptedException;
|
import java.io.StreamCorruptedException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
import sun.awt.geom.Curve;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@code Path2D} class provides a simple, yet flexible
|
* The {@code Path2D} class provides a simple, yet flexible
|
||||||
* shape which represents an arbitrary geometric path.
|
* shape which represents an arbitrary geometric path.
|
||||||
|
@ -2625,9 +2626,12 @@ public abstract class Path2D implements Shape, Cloneable {
|
||||||
throw new java.io.InvalidObjectException(iae.getMessage());
|
throw new java.io.InvalidObjectException(iae.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
pointTypes = new byte[(nT < 0) ? INIT_SIZE : nT];
|
// Accept the size from the stream only if it is less than INIT_SIZE
|
||||||
if (nC < 0) {
|
// otherwise the size will be based on the real data in the stream
|
||||||
nC = INIT_SIZE * 2;
|
pointTypes = new byte[(nT < 0 || nT > INIT_SIZE) ? INIT_SIZE : nT];
|
||||||
|
final int initX2 = INIT_SIZE * 2;
|
||||||
|
if (nC < 0 || nC > initX2) {
|
||||||
|
nC = initX2;
|
||||||
}
|
}
|
||||||
if (storedbl) {
|
if (storedbl) {
|
||||||
((Path2D.Double) this).doubleCoords = new double[nC];
|
((Path2D.Double) this).doubleCoords = new double[nC];
|
||||||
|
|
|
@ -26,21 +26,27 @@ package javax.swing.text.html;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
import java.awt.GraphicsEnvironment;
|
|
||||||
import java.awt.Toolkit;
|
|
||||||
import java.awt.HeadlessException;
|
import java.awt.HeadlessException;
|
||||||
import java.awt.Image;
|
import java.awt.Image;
|
||||||
import java.io.*;
|
import java.awt.Toolkit;
|
||||||
import java.lang.reflect.Method;
|
import java.io.IOException;
|
||||||
import java.net.URL;
|
import java.io.ObjectInputStream;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
|
import java.net.URL;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.Locale;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.SizeRequirements;
|
import javax.swing.SizeRequirements;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.AttributeSet;
|
||||||
|
import javax.swing.text.Element;
|
||||||
|
import javax.swing.text.MutableAttributeSet;
|
||||||
|
import javax.swing.text.SimpleAttributeSet;
|
||||||
|
import javax.swing.text.StyleConstants;
|
||||||
|
import javax.swing.text.StyleContext;
|
||||||
|
import javax.swing.text.View;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a set of
|
* Defines a set of
|
||||||
|
@ -3568,7 +3574,7 @@ public class CSS implements Serializable {
|
||||||
|
|
||||||
// Reconstruct the hashtable.
|
// Reconstruct the hashtable.
|
||||||
int numValues = s.readInt();
|
int numValues = s.readInt();
|
||||||
valueConvertor = new Hashtable<>(Math.max(1, numValues));
|
valueConvertor = new Hashtable<>();
|
||||||
while (numValues-- > 0) {
|
while (numValues-- > 0) {
|
||||||
Object key = s.readObject();
|
Object key = s.readObject();
|
||||||
Object value = s.readObject();
|
Object value = s.readObject();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue