Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_corba
提交
76c382af
D
dragonwell8_corba
项目概览
openanolis
/
dragonwell8_corba
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_corba
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
76c382af
编写于
10月 30, 2012
作者:
N
ngmr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8000540: Improve IIOP type reuse management
Reviewed-by: alanb, ahgross, coffeys
上级
18cc65d5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
71 deletion
+39
-71
src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
...e/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
+39
-71
未找到文件。
src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
浏览文件 @
76c382af
/*
* Copyright (c) 1998, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
2
, 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
...
...
@@ -25,7 +25,7 @@
/*
* Licensed Materials - Property of IBM
* RMI-IIOP v1.0
* Copyright IBM Corp. 1998
1999
All Rights Reserved
* Copyright IBM Corp. 1998
2012
All Rights Reserved
*
*/
...
...
@@ -56,7 +56,6 @@ import java.io.Serializable;
import
java.util.Arrays
;
import
java.util.Comparator
;
import
java.util.Hashtable
;
import
com.sun.corba.se.impl.util.RepositoryId
;
...
...
@@ -83,8 +82,6 @@ public class ObjectStreamClass implements java.io.Serializable {
private
static
Object
noArgsList
[]
=
{};
private
static
Class
noTypesList
[]
=
{};
private
static
Hashtable
translatedFields
;
/** true if represents enum type */
private
boolean
isEnum
;
...
...
@@ -384,6 +381,42 @@ public class ObjectStreamClass implements java.io.Serializable {
*/
}
private
static
final
class
PersistentFieldsValue
extends
ClassValue
<
ObjectStreamField
[]>
{
PersistentFieldsValue
()
{
}
protected
ObjectStreamField
[]
computeValue
(
Class
<?>
type
)
{
try
{
Field
pf
=
type
.
getDeclaredField
(
"serialPersistentFields"
);
int
mods
=
pf
.
getModifiers
();
if
(
Modifier
.
isPrivate
(
mods
)
&&
Modifier
.
isStatic
(
mods
)
&&
Modifier
.
isFinal
(
mods
))
{
pf
.
setAccessible
(
true
);
java
.
io
.
ObjectStreamField
[]
fields
=
(
java
.
io
.
ObjectStreamField
[])
pf
.
get
(
type
);
return
translateFields
(
fields
);
}
}
catch
(
NoSuchFieldException
|
IllegalAccessException
|
IllegalArgumentException
|
ClassCastException
e
)
{
}
return
null
;
}
private
static
ObjectStreamField
[]
translateFields
(
java
.
io
.
ObjectStreamField
[]
fields
)
{
ObjectStreamField
[]
translation
=
new
ObjectStreamField
[
fields
.
length
];
for
(
int
i
=
0
;
i
<
fields
.
length
;
i
++)
{
translation
[
i
]
=
new
ObjectStreamField
(
fields
[
i
].
getName
(),
fields
[
i
].
getType
());
}
return
translation
;
}
}
private
static
final
PersistentFieldsValue
persistentFieldsValue
=
new
PersistentFieldsValue
();
/*
* Initialize class descriptor. This method is only invoked on class
* descriptors created via calls to lookupInternal(). This method is kept
...
...
@@ -416,35 +449,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* If it is declared, use the declared serialPersistentFields.
* Otherwise, extract the fields from the class itself.
*/
try
{
Field
pf
=
cl
.
getDeclaredField
(
"serialPersistentFields"
);
// serial bug 7; the serialPersistentFields were not
// being read and stored as Accessible bit was not set
pf
.
setAccessible
(
true
);
// serial bug 7; need to find if the field is of type
// java.io.ObjectStreamField
java
.
io
.
ObjectStreamField
[]
f
=
(
java
.
io
.
ObjectStreamField
[])
pf
.
get
(
cl
);
int
mods
=
pf
.
getModifiers
();
if
((
Modifier
.
isPrivate
(
mods
))
&&
(
Modifier
.
isStatic
(
mods
))
&&
(
Modifier
.
isFinal
(
mods
)))
{
fields
=
(
ObjectStreamField
[])
translateFields
((
Object
[])
pf
.
get
(
cl
));
}
}
catch
(
NoSuchFieldException
e
)
{
fields
=
null
;
}
catch
(
IllegalAccessException
e
)
{
fields
=
null
;
}
catch
(
IllegalArgumentException
e
)
{
fields
=
null
;
}
catch
(
ClassCastException
e
)
{
/* Thrown if a field serialPersistentField exists
* but it is not of type ObjectStreamField.
*/
fields
=
null
;
}
fields
=
persistentFieldsValue
.
get
(
cl
);
if
(
fields
==
null
)
{
/* Get all of the declared fields for this
...
...
@@ -641,43 +646,6 @@ public class ObjectStreamClass implements java.io.Serializable {
superclass
=
null
;
}
private
static
Object
[]
translateFields
(
Object
objs
[])
throws
NoSuchFieldException
{
try
{
java
.
io
.
ObjectStreamField
fields
[]
=
(
java
.
io
.
ObjectStreamField
[])
objs
;
Object
translation
[]
=
null
;
if
(
translatedFields
==
null
)
translatedFields
=
new
Hashtable
();
translation
=
(
Object
[])
translatedFields
.
get
(
fields
);
if
(
translation
!=
null
)
return
translation
;
else
{
Class
osfClass
=
Class
.
forName
(
"com.sun.corba.se.impl.io.ObjectStreamField"
);
translation
=
(
Object
[])
java
.
lang
.
reflect
.
Array
.
newInstance
(
osfClass
,
objs
.
length
);
Object
arg
[]
=
new
Object
[
2
];
Class
types
[]
=
{
String
.
class
,
Class
.
class
};
Constructor
constructor
=
osfClass
.
getDeclaredConstructor
(
types
);
for
(
int
i
=
fields
.
length
-
1
;
i
>=
0
;
i
--){
arg
[
0
]
=
fields
[
i
].
getName
();
arg
[
1
]
=
fields
[
i
].
getType
();
translation
[
i
]
=
constructor
.
newInstance
(
arg
);
}
translatedFields
.
put
(
fields
,
translation
);
}
return
(
Object
[])
translation
;
}
catch
(
Throwable
t
){
NoSuchFieldException
nsfe
=
new
NoSuchFieldException
();
nsfe
.
initCause
(
t
)
;
throw
nsfe
;
}
}
/*
* Set the class this version descriptor matches.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录