Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_corba
提交
d29eff29
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,发现更多精彩内容 >>
提交
d29eff29
编写于
3月 14, 2014
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
09491167
5f994f81
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
121 addition
and
144 deletion
+121
-144
.hgtags
.hgtags
+15
-0
THIRD_PARTY_README
THIRD_PARTY_README
+2
-2
src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
...e/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
+48
-76
src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java
.../sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java
+3
-16
src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java
...om/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java
+27
-42
src/share/classes/org/omg/CORBA/ORB.java
src/share/classes/org/omg/CORBA/ORB.java
+26
-8
未找到文件。
.hgtags
浏览文件 @
d29eff29
...
...
@@ -253,6 +253,21 @@ afecd2878aee29c2d0282d2c6b3ba56e91b0b2de jdk8u20-b00
b8c71dae05574f8eca7ca6d703b16b450850b033 jdk8-b127
113e7569b49bca18846e5e5b74e644580b805902 jdk8-b128
5c72d74c6805d1b4f6192f7a3550d126acf37005 jdk8-b129
0683ee308085785d0455f4153e764e062843f178 jdk8-b130
5e5c8f0c45dd75a08089586ca50835393f00c2cb jdk8-b131
84fed37bbe640666bfc022c2e8b9fde468de35d2 jdk8-b132
5de8d42f9eb7ddcdc741445f3c21a63887d694b6 jdk8u5-b01
c750098a3ef18de28a6d739666559f0333c76c78 jdk8u5-b02
3d9b40a53134aa33031bf13581dff9fccade9048 jdk8u5-b03
596f4e4c5587c29767345555c4e48a5be0a58b83 jdk8u5-b04
1f95c888e5efe010550d95ef59020ddb15876463 jdk8u5-b05
edfa8bc86fda1b2fd064abbafb4506c80a47587e jdk8u5-b06
0a25d1c162bc046aa230577736429935716a2243 jdk8u5-b07
df6e5fc3b585a6829c98bb91546b81dc28f8e2b4 jdk8u5-b08
f5058197fa91153b7702214154d37b00f9714aaa jdk8u5-b09
d9031b5525f777299554080d6beb8b077df0a614 jdk8u5-b10
a2f7b36bfc1bc8df033fe5721b48fac1c3928a5b jdk8u5-b11
475b96f6d8cecf720ca9fd6d332dd4bafb0f654c jdk8u5-b12
bfafb13aac1c8b2d9184d59ec510b45d965b7667 jdk8u20-b02
9059a1c857044ad5ce7564ddb71a064364f8fcf5 jdk8u20-b03
abe5b0157c367a72f9059269ca633ecfe15732d2 jdk8u20-b04
...
...
THIRD_PARTY_README
浏览文件 @
d29eff29
...
...
@@ -1399,13 +1399,13 @@ THE SOFTWARE.
-------------------------------------------------------------------------------
%% This notice is provided with respect to Little CMS 2.
4
, which may be
%% This notice is provided with respect to Little CMS 2.
5
, which may be
included with JRE 8, JDK 8, and OpenJDK 8.
--- begin of LICENSE ---
Little CMS
Copyright (c) 1998-201
0
Marti Maria Saguer
Copyright (c) 1998-201
1
Marti Maria Saguer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
...
...
src/share/classes/com/sun/corba/se/impl/io/ObjectStreamClass.java
浏览文件 @
d29eff29
/*
* Copyright (c) 1998, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
4
, 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
...
...
@@ -52,6 +52,7 @@ import java.io.IOException;
import
java.io.DataOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.InvalidClassException
;
import
java.io.Externalizable
;
import
java.io.Serializable
;
import
java.util.Arrays
;
...
...
@@ -80,15 +81,15 @@ public class ObjectStreamClass implements java.io.Serializable {
public
static
final
long
kDefaultUID
=
-
1
;
private
static
Object
noArgsList
[]
=
{};
private
static
Class
noTypesList
[]
=
{};
private
static
Class
<?>
noTypesList
[]
=
{};
/** true if represents enum type */
private
boolean
isEnum
;
private
static
final
Bridge
bridge
=
(
Bridge
)
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Bridge
>
()
{
public
Bridge
run
()
{
return
Bridge
.
get
()
;
}
}
...
...
@@ -98,7 +99,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* is returned if the specified class does not implement
* java.io.Serializable or java.io.Externalizable.
*/
static
final
ObjectStreamClass
lookup
(
Class
cl
)
static
final
ObjectStreamClass
lookup
(
Class
<?>
cl
)
{
ObjectStreamClass
desc
=
lookupInternal
(
cl
);
if
(
desc
.
isSerializable
()
||
desc
.
isExternalizable
())
...
...
@@ -110,7 +111,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Find the class descriptor for the specified class.
* Package access only so it can be called from ObjectIn/OutStream.
*/
static
ObjectStreamClass
lookupInternal
(
Class
cl
)
static
ObjectStreamClass
lookupInternal
(
Class
<?>
cl
)
{
/* Synchronize on the hashtable so no two threads will do
* this at the same time.
...
...
@@ -121,14 +122,14 @@ public class ObjectStreamClass implements java.io.Serializable {
desc
=
findDescriptorFor
(
cl
);
if
(
desc
==
null
)
{
/* Check if it's serializable */
boolean
serializable
=
classSerializable
.
isAssignableFrom
(
cl
);
boolean
serializable
=
Serializable
.
class
.
isAssignableFrom
(
cl
);
/* If the class is only Serializable,
* lookup the descriptor for the superclass.
*/
ObjectStreamClass
superdesc
=
null
;
if
(
serializable
)
{
Class
superclass
=
cl
.
getSuperclass
();
Class
<?>
superclass
=
cl
.
getSuperclass
();
if
(
superclass
!=
null
)
superdesc
=
lookup
(
superclass
);
}
...
...
@@ -141,7 +142,7 @@ public class ObjectStreamClass implements java.io.Serializable {
if
(
serializable
)
{
externalizable
=
((
superdesc
!=
null
)
&&
superdesc
.
isExternalizable
())
||
classExternalizable
.
isAssignableFrom
(
cl
);
Externalizable
.
class
.
isAssignableFrom
(
cl
);
if
(
externalizable
)
{
serializable
=
false
;
}
...
...
@@ -185,7 +186,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* that have evolved from a common root class and agree to be serialized
* and deserialized using a common format.
*/
public
static
final
long
getSerialVersionUID
(
java
.
lang
.
Class
clazz
)
{
public
static
final
long
getSerialVersionUID
(
java
.
lang
.
Class
<?>
clazz
)
{
ObjectStreamClass
theosc
=
ObjectStreamClass
.
lookup
(
clazz
);
if
(
theosc
!=
null
)
{
...
...
@@ -219,7 +220,7 @@ public class ObjectStreamClass implements java.io.Serializable {
/**
* Return the actual (computed) serialVersionUID for this class.
*/
public
static
final
long
getActualSerialVersionUID
(
java
.
lang
.
Class
clazz
)
public
static
final
long
getActualSerialVersionUID
(
java
.
lang
.
Class
<?>
clazz
)
{
ObjectStreamClass
theosc
=
ObjectStreamClass
.
lookup
(
clazz
);
if
(
theosc
!=
null
)
...
...
@@ -249,7 +250,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Return the class in the local VM that this version is mapped to.
* Null is returned if there is no corresponding local class.
*/
public
final
Class
forClass
()
{
public
final
Class
<?>
forClass
()
{
return
ofClass
;
}
...
...
@@ -349,7 +350,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Create a new ObjectStreamClass from a loaded class.
* Don't call this directly, call lookup instead.
*/
private
ObjectStreamClass
(
java
.
lang
.
Class
cl
,
ObjectStreamClass
superdesc
,
private
ObjectStreamClass
(
java
.
lang
.
Class
<?>
cl
,
ObjectStreamClass
superdesc
,
boolean
serial
,
boolean
extern
)
{
ofClass
=
cl
;
/* created from this class */
...
...
@@ -433,7 +434,7 @@ public class ObjectStreamClass implements java.io.Serializable {
if
(
initialized
)
return
;
final
Class
cl
=
ofClass
;
final
Class
<?>
cl
=
ofClass
;
if
(!
serializable
||
externalizable
||
...
...
@@ -561,9 +562,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* will call it as necessary.
*/
writeObjectMethod
=
getPrivateMethod
(
cl
,
"writeObject"
,
new
Class
[]
{
java
.
io
.
ObjectOutputStream
.
class
},
Void
.
TYPE
)
;
new
Class
<?>
[]
{
java
.
io
.
ObjectOutputStream
.
class
},
Void
.
TYPE
)
;
readObjectMethod
=
getPrivateMethod
(
cl
,
"readObject"
,
new
Class
[]
{
java
.
io
.
ObjectInputStream
.
class
},
Void
.
TYPE
)
;
new
Class
<?>
[]
{
java
.
io
.
ObjectInputStream
.
class
},
Void
.
TYPE
)
;
}
return
null
;
}
...
...
@@ -589,9 +590,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* class, or null if none found. Access checks are disabled on the
* returned method (if any).
*/
private
static
Method
getPrivateMethod
(
Class
cl
,
String
name
,
Class
[]
argTypes
,
Class
returnType
)
private
static
Method
getPrivateMethod
(
Class
<?>
cl
,
String
name
,
Class
<?>
[]
argTypes
,
Class
<?>
returnType
)
{
try
{
Method
meth
=
cl
.
getDeclaredMethod
(
name
,
argTypes
);
...
...
@@ -653,7 +654,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* Fill in the reflected Fields that will be used
* for reading.
*/
final
void
setClass
(
Class
cl
)
throws
InvalidClassException
{
final
void
setClass
(
Class
<?>
cl
)
throws
InvalidClassException
{
if
(
cl
==
null
)
{
localClassDesc
=
null
;
...
...
@@ -920,9 +921,9 @@ public class ObjectStreamClass implements java.io.Serializable {
* Access checks are disabled on the returned constructor (if any), since
* the defining class may still be non-public.
*/
private
static
Constructor
getExternalizableConstructor
(
Class
cl
)
{
private
static
Constructor
getExternalizableConstructor
(
Class
<?>
cl
)
{
try
{
Constructor
cons
=
cl
.
getDeclaredConstructor
(
new
Class
[
0
]);
Constructor
cons
=
cl
.
getDeclaredConstructor
(
new
Class
<?>
[
0
]);
cons
.
setAccessible
(
true
);
return
((
cons
.
getModifiers
()
&
Modifier
.
PUBLIC
)
!=
0
)
?
cons
:
null
;
...
...
@@ -936,15 +937,15 @@ public class ObjectStreamClass implements java.io.Serializable {
* superclass, or null if none found. Access checks are disabled on the
* returned constructor (if any).
*/
private
static
Constructor
getSerializableConstructor
(
Class
cl
)
{
Class
initCl
=
cl
;
private
static
Constructor
getSerializableConstructor
(
Class
<?>
cl
)
{
Class
<?>
initCl
=
cl
;
while
(
Serializable
.
class
.
isAssignableFrom
(
initCl
))
{
if
((
initCl
=
initCl
.
getSuperclass
())
==
null
)
{
return
null
;
}
}
try
{
Constructor
cons
=
initCl
.
getDeclaredConstructor
(
new
Class
[
0
]);
Constructor
cons
=
initCl
.
getDeclaredConstructor
(
new
Class
<?>
[
0
]);
int
mods
=
cons
.
getModifiers
();
if
((
mods
&
Modifier
.
PRIVATE
)
!=
0
||
((
mods
&
(
Modifier
.
PUBLIC
|
Modifier
.
PROTECTED
))
==
0
&&
...
...
@@ -1049,7 +1050,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* items to the hash accumulating in the digest stream.
* Fold the hash into a long. Use the SHA secure hash function.
*/
private
static
long
_computeSerialVersionUID
(
Class
cl
)
{
private
static
long
_computeSerialVersionUID
(
Class
<?>
cl
)
{
if
(
DEBUG_SVUID
)
msg
(
"Computing SerialVersionUID for "
+
cl
)
;
ByteArrayOutputStream
devnull
=
new
ByteArrayOutputStream
(
512
);
...
...
@@ -1103,7 +1104,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* them from its computation.
*/
Class
interfaces
[]
=
cl
.
getInterfaces
();
Class
<?>
interfaces
[]
=
cl
.
getInterfaces
();
Arrays
.
sort
(
interfaces
,
compareClassByName
);
for
(
int
i
=
0
;
i
<
interfaces
.
length
;
i
++)
{
...
...
@@ -1233,7 +1234,7 @@ public class ObjectStreamClass implements java.io.Serializable {
return
h
;
}
private
static
long
computeStructuralUID
(
com
.
sun
.
corba
.
se
.
impl
.
io
.
ObjectStreamClass
osc
,
Class
cl
)
{
private
static
long
computeStructuralUID
(
com
.
sun
.
corba
.
se
.
impl
.
io
.
ObjectStreamClass
osc
,
Class
<?>
cl
)
{
ByteArrayOutputStream
devnull
=
new
ByteArrayOutputStream
(
512
);
long
h
=
0
;
...
...
@@ -1253,7 +1254,7 @@ public class ObjectStreamClass implements java.io.Serializable {
DataOutputStream
data
=
new
DataOutputStream
(
mdo
);
// Get SUID of parent
Class
parent
=
cl
.
getSuperclass
();
Class
<?>
parent
=
cl
.
getSuperclass
();
if
((
parent
!=
null
))
// SerialBug 1; acc. to spec the one for
// java.lang.object
...
...
@@ -1309,10 +1310,10 @@ public class ObjectStreamClass implements java.io.Serializable {
/**
* Compute the JVM signature for the class.
*/
static
String
getSignature
(
Class
clazz
)
{
static
String
getSignature
(
Class
<?>
clazz
)
{
String
type
=
null
;
if
(
clazz
.
isArray
())
{
Class
cl
=
clazz
;
Class
<?>
cl
=
clazz
;
int
dimensions
=
0
;
while
(
cl
.
isArray
())
{
dimensions
++;
...
...
@@ -1358,7 +1359,7 @@ public class ObjectStreamClass implements java.io.Serializable {
sb
.
append
(
"("
);
Class
[]
params
=
meth
.
getParameterTypes
();
// avoid clone
Class
<?>
[]
params
=
meth
.
getParameterTypes
();
// avoid clone
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
sb
.
append
(
getSignature
(
params
[
j
]));
}
...
...
@@ -1375,7 +1376,7 @@ public class ObjectStreamClass implements java.io.Serializable {
sb
.
append
(
"("
);
Class
[]
params
=
cons
.
getParameterTypes
();
// avoid clone
Class
<?>
[]
params
=
cons
.
getParameterTypes
();
// avoid clone
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
sb
.
append
(
getSignature
(
params
[
j
]));
}
...
...
@@ -1395,7 +1396,7 @@ public class ObjectStreamClass implements java.io.Serializable {
* The entries are extended from java.lang.ref.SoftReference so the
* gc will be able to free them if needed.
*/
private
static
ObjectStreamClass
findDescriptorFor
(
Class
cl
)
{
private
static
ObjectStreamClass
findDescriptorFor
(
Class
<?>
cl
)
{
int
hash
=
cl
.
hashCode
();
int
index
=
(
hash
&
0x7FFFFFFF
)
%
descriptorFor
.
length
;
...
...
@@ -1442,7 +1443,7 @@ public class ObjectStreamClass implements java.io.Serializable {
descriptorFor
[
index
]
=
e
;
}
private
static
Field
[]
getDeclaredFields
(
final
Class
clz
)
{
private
static
Field
[]
getDeclaredFields
(
final
Class
<?>
clz
)
{
return
(
Field
[])
AccessController
.
doPrivileged
(
new
PrivilegedAction
()
{
public
Object
run
()
{
return
clz
.
getDeclaredFields
();
...
...
@@ -1476,7 +1477,7 @@ public class ObjectStreamClass implements java.io.Serializable {
/*
* Class that is a descriptor for in this virtual machine.
*/
private
Class
ofClass
;
private
Class
<?>
ofClass
;
/*
* True if descriptor for a proxy class.
...
...
@@ -1548,30 +1549,17 @@ public class ObjectStreamClass implements java.io.Serializable {
* Returns true if the given class defines a static initializer method,
* false otherwise.
*/
private
static
boolean
hasStaticInitializer
(
Class
cl
)
{
private
static
boolean
hasStaticInitializer
(
Class
<?>
cl
)
{
if
(
hasStaticInitializerMethod
==
null
)
{
Class
classWithThisMethod
=
null
;
Class
<?>
classWithThisMethod
=
null
;
try
{
try
{
// When using rip-int with Merlin or when this is a Merlin
// workspace, the method we want is in sun.misc.ClassReflector
// and absent from java.io.ObjectStreamClass.
//
// When compiling rip-int with JDK 1.3.x, we have to get it
// from java.io.ObjectStreamClass.
classWithThisMethod
=
Class
.
forName
(
"sun.misc.ClassReflector"
);
}
catch
(
ClassNotFoundException
cnfe
)
{
// Do nothing. This is either not a Merlin workspace,
// or rip-int is being compiled with something other than
// Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass.
}
if
(
classWithThisMethod
==
null
)
classWithThisMethod
=
java
.
io
.
ObjectStreamClass
.
class
;
hasStaticInitializerMethod
=
classWithThisMethod
.
getDeclaredMethod
(
"hasStaticInitializer"
,
new
Class
[]
{
Class
.
class
});
new
Class
<?>
[]
{
Class
.
class
});
}
catch
(
NoSuchMethodException
ex
)
{
}
...
...
@@ -1596,22 +1584,6 @@ public class ObjectStreamClass implements java.io.Serializable {
}
/* The Class Object for java.io.Serializable */
private
static
Class
classSerializable
=
null
;
private
static
Class
classExternalizable
=
null
;
/*
* Resolve java.io.Serializable at load time.
*/
static
{
try
{
classSerializable
=
Class
.
forName
(
"java.io.Serializable"
);
classExternalizable
=
Class
.
forName
(
"java.io.Externalizable"
);
}
catch
(
Throwable
e
)
{
System
.
err
.
println
(
"Could not load java.io.Serializable or java.io.Externalizable."
);
}
}
/** use serialVersionUID from JDK 1.1. for interoperability */
private
static
final
long
serialVersionUID
=
-
6120832682080437368L
;
...
...
@@ -1649,8 +1621,8 @@ public class ObjectStreamClass implements java.io.Serializable {
private
static
class
CompareClassByName
implements
Comparator
{
public
int
compare
(
Object
o1
,
Object
o2
)
{
Class
c1
=
(
Class
)
o1
;
Class
c2
=
(
Class
)
o2
;
Class
<?>
c1
=
(
Class
)
o1
;
Class
<?>
c2
=
(
Class
)
o2
;
return
(
c1
.
getName
()).
compareTo
(
c2
.
getName
());
}
}
...
...
@@ -1764,12 +1736,12 @@ public class ObjectStreamClass implements java.io.Serializable {
*
* Copied from the Merlin java.io.ObjectStreamClass.
*/
private
static
Method
getInheritableMethod
(
Class
cl
,
String
name
,
Class
[]
argTypes
,
Class
returnType
)
private
static
Method
getInheritableMethod
(
Class
<?>
cl
,
String
name
,
Class
<?>
[]
argTypes
,
Class
<?>
returnType
)
{
Method
meth
=
null
;
Class
defCl
=
cl
;
Class
<?>
defCl
=
cl
;
while
(
defCl
!=
null
)
{
try
{
meth
=
defCl
.
getDeclaredMethod
(
name
,
argTypes
);
...
...
@@ -1801,7 +1773,7 @@ public class ObjectStreamClass implements java.io.Serializable {
*
* Copied from the Merlin java.io.ObjectStreamClass.
*/
private
static
boolean
packageEquals
(
Class
cl1
,
Class
cl2
)
{
private
static
boolean
packageEquals
(
Class
<?>
cl1
,
Class
<?>
cl2
)
{
Package
pkg1
=
cl1
.
getPackage
(),
pkg2
=
cl2
.
getPackage
();
return
((
pkg1
==
pkg2
)
||
((
pkg1
!=
null
)
&&
(
pkg1
.
equals
(
pkg2
))));
}
...
...
src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClassUtil_1_3.java
浏览文件 @
d29eff29
/*
* Copyright (c) 2000, 20
02
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
14
, 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
...
...
@@ -94,7 +94,7 @@ public final class ObjectStreamClassUtil_1_3 {
});
}
public
static
long
computeStructuralUID
(
boolean
hasWriteObject
,
Class
cl
)
{
public
static
long
computeStructuralUID
(
boolean
hasWriteObject
,
Class
<?>
cl
)
{
ByteArrayOutputStream
devnull
=
new
ByteArrayOutputStream
(
512
);
long
h
=
0
;
...
...
@@ -119,7 +119,7 @@ public final class ObjectStreamClassUtil_1_3 {
// Object method in there
// Get SUID of parent
Class
parent
=
cl
.
getSuperclass
();
Class
<?>
parent
=
cl
.
getSuperclass
();
if
((
parent
!=
null
)
&&
(
parent
!=
java
.
lang
.
Object
.
class
))
{
boolean
hasWriteObjectFlag
=
false
;
Class
[]
args
=
{
java
.
io
.
ObjectOutputStream
.
class
};
...
...
@@ -503,19 +503,6 @@ public final class ObjectStreamClassUtil_1_3 {
Class
classWithThisMethod
=
null
;
try
{
try
{
// When using rip-int with Merlin or when this is a Merlin
// workspace, the method we want is in sun.misc.ClassReflector
// and absent from java.io.ObjectStreamClass.
//
// When compiling rip-int with JDK 1.3.x, we have to get it
// from java.io.ObjectStreamClass.
classWithThisMethod
=
Class
.
forName
(
"sun.misc.ClassReflector"
);
}
catch
(
ClassNotFoundException
cnfe
)
{
// Do nothing. This is either not a Merlin workspace,
// or rip-int is being compiled with something other than
// Merlin, probably JDK 1.3. Fall back on java.io.ObjectStreaClass.
}
if
(
classWithThisMethod
==
null
)
classWithThisMethod
=
java
.
io
.
ObjectStreamClass
.
class
;
...
...
src/share/classes/com/sun/corba/se/impl/orbutil/ObjectStreamClass_1_3_1.java
浏览文件 @
d29eff29
/*
* Copyright (c) 2001, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 201
4
, 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
...
...
@@ -53,6 +53,7 @@ import java.io.DataOutputStream;
import
java.io.ByteArrayOutputStream
;
import
java.io.InvalidClassException
;
import
java.io.Serializable
;
import
java.io.Externalizable
;
import
java.util.Arrays
;
import
java.util.Comparator
;
...
...
@@ -88,7 +89,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
public
static
final
long
kDefaultUID
=
-
1
;
private
static
Object
noArgsList
[]
=
{};
private
static
Class
noTypesList
[]
=
{};
private
static
Class
<?>
noTypesList
[]
=
{};
private
static
Hashtable
translatedFields
;
...
...
@@ -96,7 +97,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* is returned if the specified class does not implement
* java.io.Serializable or java.io.Externalizable.
*/
static
final
ObjectStreamClass_1_3_1
lookup
(
Class
cl
)
static
final
ObjectStreamClass_1_3_1
lookup
(
Class
<?>
cl
)
{
ObjectStreamClass_1_3_1
desc
=
lookupInternal
(
cl
);
if
(
desc
.
isSerializable
()
||
desc
.
isExternalizable
())
...
...
@@ -108,7 +109,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Find the class descriptor for the specified class.
* Package access only so it can be called from ObjectIn/OutStream.
*/
static
ObjectStreamClass_1_3_1
lookupInternal
(
Class
cl
)
static
ObjectStreamClass_1_3_1
lookupInternal
(
Class
<?>
cl
)
{
/* Synchronize on the hashtable so no two threads will do
* this at the same time.
...
...
@@ -122,13 +123,13 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
}
/* Check if it's serializable */
boolean
serializable
=
classSerializable
.
isAssignableFrom
(
cl
);
boolean
serializable
=
Serializable
.
class
.
isAssignableFrom
(
cl
);
/* If the class is only Serializable,
* lookup the descriptor for the superclass.
*/
ObjectStreamClass_1_3_1
superdesc
=
null
;
if
(
serializable
)
{
Class
superclass
=
cl
.
getSuperclass
();
Class
<?>
superclass
=
cl
.
getSuperclass
();
if
(
superclass
!=
null
)
superdesc
=
lookup
(
superclass
);
}
...
...
@@ -141,7 +142,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
if
(
serializable
)
{
externalizable
=
((
superdesc
!=
null
)
&&
superdesc
.
isExternalizable
())
||
classExternalizable
.
isAssignableFrom
(
cl
);
Externalizable
.
class
.
isAssignableFrom
(
cl
);
if
(
externalizable
)
{
serializable
=
false
;
}
...
...
@@ -170,7 +171,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* that have evolved from a common root class and agree to be serialized
* and deserialized using a common format.
*/
public
static
final
long
getSerialVersionUID
(
java
.
lang
.
Class
clazz
)
{
public
static
final
long
getSerialVersionUID
(
java
.
lang
.
Class
<?>
clazz
)
{
ObjectStreamClass_1_3_1
theosc
=
ObjectStreamClass_1_3_1
.
lookup
(
clazz
);
if
(
theosc
!=
null
)
{
...
...
@@ -204,7 +205,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/**
* Return the actual (computed) serialVersionUID for this class.
*/
public
static
final
long
getActualSerialVersionUID
(
java
.
lang
.
Class
clazz
)
public
static
final
long
getActualSerialVersionUID
(
java
.
lang
.
Class
<?>
clazz
)
{
ObjectStreamClass_1_3_1
theosc
=
ObjectStreamClass_1_3_1
.
lookup
(
clazz
);
if
(
theosc
!=
null
)
...
...
@@ -234,7 +235,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Return the class in the local VM that this version is mapped to.
* Null is returned if there is no corresponding local class.
*/
public
final
Class
forClass
()
{
public
final
Class
<?>
forClass
()
{
return
ofClass
;
}
...
...
@@ -333,7 +334,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* Create a new ObjectStreamClass_1_3_1 from a loaded class.
* Don't call this directly, call lookup instead.
*/
private
ObjectStreamClass_1_3_1
(
java
.
lang
.
Class
cl
,
ObjectStreamClass_1_3_1
superdesc
,
private
ObjectStreamClass_1_3_1
(
java
.
lang
.
Class
<?>
cl
,
ObjectStreamClass_1_3_1
superdesc
,
boolean
serial
,
boolean
extern
)
{
ofClass
=
cl
;
/* created from this class */
...
...
@@ -376,7 +377,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
private
void
init
()
{
synchronized
(
lock
)
{
final
Class
cl
=
ofClass
;
final
Class
<?>
cl
=
ofClass
;
if
(
fields
!=
null
)
// already initialized
return
;
...
...
@@ -558,7 +559,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* will call it as necessary.
*/
try
{
Class
[]
args
=
{
java
.
io
.
ObjectOutputStream
.
class
};
Class
<?>
[]
args
=
{
java
.
io
.
ObjectOutputStream
.
class
};
writeObjectMethod
=
cl
.
getDeclaredMethod
(
"writeObject"
,
args
);
hasWriteObjectMethod
=
true
;
int
mods
=
writeObjectMethod
.
getModifiers
();
...
...
@@ -578,7 +579,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* ObjectInputStream so it can all the method directly.
*/
try
{
Class
[]
args
=
{
java
.
io
.
ObjectInputStream
.
class
};
Class
<?>
[]
args
=
{
java
.
io
.
ObjectInputStream
.
class
};
readObjectMethod
=
cl
.
getDeclaredMethod
(
"readObject"
,
args
);
int
mods
=
readObjectMethod
.
getModifiers
();
...
...
@@ -629,11 +630,11 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
if
(
translation
!=
null
)
return
translation
;
else
{
Class
osfClass
=
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
ObjectStreamField
.
class
;
Class
<?>
osfClass
=
com
.
sun
.
corba
.
se
.
impl
.
orbutil
.
ObjectStreamField
.
class
;
translation
=
(
Object
[])
java
.
lang
.
reflect
.
Array
.
newInstance
(
osfClass
,
objs
.
length
);
Object
arg
[]
=
new
Object
[
2
];
Class
types
[]
=
{
String
.
class
,
Class
.
class
};
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
();
...
...
@@ -804,7 +805,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
}
}
private
static
long
computeStructuralUID
(
ObjectStreamClass_1_3_1
osc
,
Class
cl
)
{
private
static
long
computeStructuralUID
(
ObjectStreamClass_1_3_1
osc
,
Class
<?>
cl
)
{
ByteArrayOutputStream
devnull
=
new
ByteArrayOutputStream
(
512
);
long
h
=
0
;
...
...
@@ -824,7 +825,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
DataOutputStream
data
=
new
DataOutputStream
(
mdo
);
// Get SUID of parent
Class
parent
=
cl
.
getSuperclass
();
Class
<?>
parent
=
cl
.
getSuperclass
();
if
((
parent
!=
null
))
// SerialBug 1; acc. to spec the one for
// java.lang.object
...
...
@@ -910,10 +911,10 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/**
* Compute the JVM signature for the class.
*/
static
String
getSignature
(
Class
clazz
)
{
static
String
getSignature
(
Class
<?>
clazz
)
{
String
type
=
null
;
if
(
clazz
.
isArray
())
{
Class
cl
=
clazz
;
Class
<?>
cl
=
clazz
;
int
dimensions
=
0
;
while
(
cl
.
isArray
())
{
dimensions
++;
...
...
@@ -959,7 +960,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
sb
.
append
(
"("
);
Class
[]
params
=
meth
.
getParameterTypes
();
// avoid clone
Class
<?>
[]
params
=
meth
.
getParameterTypes
();
// avoid clone
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
sb
.
append
(
getSignature
(
params
[
j
]));
}
...
...
@@ -976,7 +977,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
sb
.
append
(
"("
);
Class
[]
params
=
cons
.
getParameterTypes
();
// avoid clone
Class
<?>
[]
params
=
cons
.
getParameterTypes
();
// avoid clone
for
(
int
j
=
0
;
j
<
params
.
length
;
j
++)
{
sb
.
append
(
getSignature
(
params
[
j
]));
}
...
...
@@ -996,7 +997,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
* The entries are extended from java.lang.ref.SoftReference so the
* gc will be able to free them if needed.
*/
private
static
ObjectStreamClass_1_3_1
findDescriptorFor
(
Class
cl
)
{
private
static
ObjectStreamClass_1_3_1
findDescriptorFor
(
Class
<?>
cl
)
{
int
hash
=
cl
.
hashCode
();
int
index
=
(
hash
&
0x7FFFFFFF
)
%
descriptorFor
.
length
;
...
...
@@ -1077,7 +1078,7 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/*
* Class that is a descriptor for in this virtual machine.
*/
private
Class
ofClass
;
private
Class
<?>
ofClass
;
/*
* True if descriptor for a proxy class.
...
...
@@ -1130,22 +1131,6 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
/* Get the private static final field for serial version UID */
// private static native long getSerialVersionUIDField(Class cl);
/* The Class Object for java.io.Serializable */
private
static
Class
classSerializable
=
null
;
private
static
Class
classExternalizable
=
null
;
/*
* Resolve java.io.Serializable at load time.
*/
static
{
try
{
classSerializable
=
Class
.
forName
(
"java.io.Serializable"
);
classExternalizable
=
Class
.
forName
(
"java.io.Externalizable"
);
}
catch
(
Throwable
e
)
{
System
.
err
.
println
(
"Could not load java.io.Serializable or java.io.Externalizable."
);
}
}
/** use serialVersionUID from JDK 1.1. for interoperability */
private
static
final
long
serialVersionUID
=
-
6120832682080437368L
;
...
...
@@ -1183,8 +1168,8 @@ public class ObjectStreamClass_1_3_1 implements java.io.Serializable {
private
static
class
CompareClassByName
implements
Comparator
{
public
int
compare
(
Object
o1
,
Object
o2
)
{
Class
c1
=
(
Class
)
o1
;
Class
c2
=
(
Class
)
o2
;
Class
<?>
c1
=
(
Class
)
o1
;
Class
<?>
c2
=
(
Class
)
o2
;
return
(
c1
.
getName
()).
compareTo
(
c2
.
getName
());
}
}
...
...
src/share/classes/org/omg/CORBA/ORB.java
浏览文件 @
d29eff29
/*
* Copyright (c) 1995, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 201
4
, 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
...
...
@@ -36,6 +36,8 @@ import java.io.FileInputStream;
import
java.security.AccessController
;
import
java.security.PrivilegedAction
;
import
sun.reflect.misc.ReflectUtil
;
/**
* A class providing APIs for the CORBA Object Request Broker
* features. The <code>ORB</code> class also provides
...
...
@@ -289,20 +291,38 @@ abstract public class ORB {
(
className
.
equals
(
"com.sun.corba.se.impl.orb.ORBSingleton"
)))
{
singleton
=
new
com
.
sun
.
corba
.
se
.
impl
.
orb
.
ORBSingleton
();
}
else
{
singleton
=
create_impl
(
className
);
singleton
=
create_impl
_with_systemclassloader
(
className
);
}
}
return
singleton
;
}
private
static
ORB
create_impl
(
String
className
)
{
private
static
ORB
create_impl_with_systemclassloader
(
String
className
)
{
try
{
ReflectUtil
.
checkPackageAccess
(
className
);
ClassLoader
cl
=
ClassLoader
.
getSystemClassLoader
();
Class
<
org
.
omg
.
CORBA
.
ORB
>
orbBaseClass
=
org
.
omg
.
CORBA
.
ORB
.
class
;
Class
<?>
singletonOrbClass
=
Class
.
forName
(
className
,
true
,
cl
).
asSubclass
(
orbBaseClass
);
return
(
ORB
)
singletonOrbClass
.
newInstance
();
}
catch
(
Throwable
ex
)
{
SystemException
systemException
=
new
INITIALIZE
(
"can't instantiate default ORB implementation "
+
className
);
systemException
.
initCause
(
ex
);
throw
systemException
;
}
}
private
static
ORB
create_impl
(
String
className
)
{
ClassLoader
cl
=
Thread
.
currentThread
().
getContextClassLoader
();
if
(
cl
==
null
)
cl
=
ClassLoader
.
getSystemClassLoader
();
try
{
return
(
ORB
)
Class
.
forName
(
className
,
true
,
cl
).
newInstance
();
ReflectUtil
.
checkPackageAccess
(
className
);
Class
<
org
.
omg
.
CORBA
.
ORB
>
orbBaseClass
=
org
.
omg
.
CORBA
.
ORB
.
class
;
Class
<?>
orbClass
=
Class
.
forName
(
className
,
true
,
cl
).
asSubclass
(
orbBaseClass
);
return
(
ORB
)
orbClass
.
newInstance
();
}
catch
(
Throwable
ex
)
{
SystemException
systemException
=
new
INITIALIZE
(
"can't instantiate default ORB implementation "
+
className
);
...
...
@@ -346,7 +366,6 @@ abstract public class ORB {
}
else
{
orb
=
create_impl
(
className
);
}
orb
.
set_parameters
(
args
,
props
);
return
orb
;
}
...
...
@@ -377,7 +396,6 @@ abstract public class ORB {
}
else
{
orb
=
create_impl
(
className
);
}
orb
.
set_parameters
(
app
,
props
);
return
orb
;
}
...
...
@@ -573,7 +591,7 @@ abstract public class ORB {
try
{
// First try to load the OperationDef class
String
opDefClassName
=
"org.omg.CORBA.OperationDef"
;
Class
opDefClass
=
null
;
Class
<?>
opDefClass
=
null
;
ClassLoader
cl
=
Thread
.
currentThread
().
getContextClassLoader
();
if
(
cl
==
null
)
...
...
@@ -583,7 +601,7 @@ abstract public class ORB {
// OK, we loaded OperationDef. Now try to get the
// create_operation_list(OperationDef oper) method.
Class
[]
argc
=
{
opDefClass
};
Class
<?>
[]
argc
=
{
opDefClass
};
java
.
lang
.
reflect
.
Method
meth
=
this
.
getClass
().
getMethod
(
"create_operation_list"
,
argc
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录