1 Star 0 Fork 105

misaka00251/bishengjdk-11

forked from openEuler/bishengjdk-11 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-jck-failure-on-FastSerializer.patch 3.31 KB
一键复制 编辑 原始数据 按行查看 历史
misaka00251 提交于 2023-05-15 16:04 . Initial commit
diff --git a/src/java.base/share/classes/java/io/ObjectInputStream.java b/src/java.base/share/classes/java/io/ObjectInputStream.java
index a77a5d5b6..f2791a4cb 100644
--- a/src/java.base/share/classes/java/io/ObjectInputStream.java
+++ b/src/java.base/share/classes/java/io/ObjectInputStream.java
@@ -391,6 +391,11 @@ public class ObjectInputStream
new sun.security.action.GetBooleanAction(
"printFastSerializer")).booleanValue();
+ /**
+ * Magic number that is written to the stream header when using fastserilizer.
+ */
+ private static final short STREAM_MAGIC_FAST = (short)0xdeca;
+
/**
* Creates an ObjectInputStream that reads from the specified InputStream.
* A serialization stream header is read from the stream and verified.
@@ -763,7 +768,7 @@ public class ObjectInputStream
* Cache the class meta during serialization.
* Only used in FastSerilizer.
*/
- protected static ConcurrentHashMap<String,Class<?>> nameToClass = new ConcurrentHashMap<>();
+ private static ConcurrentHashMap<String,Class<?>> nameToClass = new ConcurrentHashMap<>();
/**
* Load the local class equivalent of the specified stream class
diff --git a/src/java.base/share/classes/java/io/ObjectOutputStream.java b/src/java.base/share/classes/java/io/ObjectOutputStream.java
index 8935e61dc..0e5476395 100644
--- a/src/java.base/share/classes/java/io/ObjectOutputStream.java
+++ b/src/java.base/share/classes/java/io/ObjectOutputStream.java
@@ -250,6 +250,11 @@ public class ObjectOutputStream
new sun.security.action.GetBooleanAction(
"printFastSerializer")).booleanValue();
+ /**
+ * Magic number that is written to the stream header when using fastserilizer.
+ */
+ private static final short STREAM_MAGIC_FAST = (short)0xdeca;
+
/**
* Creates an ObjectOutputStream that writes to the specified OutputStream.
* This constructor writes the serialization stream header to the
diff --git a/src/java.base/share/classes/java/io/ObjectStreamClass.java b/src/java.base/share/classes/java/io/ObjectStreamClass.java
index a5d7d2d75..e37a7841e 100644
--- a/src/java.base/share/classes/java/io/ObjectStreamClass.java
+++ b/src/java.base/share/classes/java/io/ObjectStreamClass.java
@@ -280,7 +280,7 @@ public class ObjectStreamClass implements Serializable {
*
* @return the flags for this class described by this descriptor
*/
- public byte getFlags(Object serialStream) {
+ byte getFlags(Object serialStream) {
byte flags = 0;
if (externalizable) {
flags |= ObjectStreamConstants.SC_EXTERNALIZABLE;
diff --git a/src/java.base/share/classes/java/io/ObjectStreamConstants.java b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
index 96157782a..43a480ce4 100644
--- a/src/java.base/share/classes/java/io/ObjectStreamConstants.java
+++ b/src/java.base/share/classes/java/io/ObjectStreamConstants.java
@@ -38,11 +38,6 @@ public interface ObjectStreamConstants {
*/
static final short STREAM_MAGIC = (short)0xaced;
- /**
- * Magic number that is written to the stream header when using fastserilizer.
- */
- static final short STREAM_MAGIC_FAST = (short)0xdeca;
-
/**
* Version number that is written to the stream header.
*/
--
2.19.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/misaka00251/bishengjdk-11.git
git@gitee.com:misaka00251/bishengjdk-11.git
misaka00251
bishengjdk-11
bishengjdk-11
master

搜索帮助