Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
fdc9b3a0
Commit
fdc9b3a0
authored
Feb 22, 2005
by
Bryce McKinlay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check in missed file from last commit.
From-SVN: r95381
parent
ec88bf8b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
39 deletions
+39
-39
libjava/java/io/ObjectStreamClass.java
+39
-39
No files found.
libjava/java/io/ObjectStreamClass.java
View file @
fdc9b3a0
...
@@ -452,27 +452,33 @@ public class ObjectStreamClass implements Serializable
...
@@ -452,27 +452,33 @@ public class ObjectStreamClass implements Serializable
}
}
private
Method
findMethod
(
Method
[]
methods
,
String
name
,
Class
[]
params
,
private
Method
findMethod
(
Method
[]
methods
,
String
name
,
Class
[]
params
,
Class
returnType
)
Class
returnType
,
boolean
mustBePrivate
)
{
{
outer:
outer:
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
methods
.
length
;
i
++)
{
final
Method
m
=
methods
[
i
];
int
mods
=
m
.
getModifiers
();
if
(
Modifier
.
isStatic
(
mods
)
||
(
mustBePrivate
&&
!
Modifier
.
isPrivate
(
mods
)))
{
{
if
(
methods
[
i
].
getName
().
equals
(
name
)
&&
continue
;
methods
[
i
].
getReturnType
()
==
returnType
)
}
if
(
m
.
getName
().
equals
(
name
)
&&
m
.
getReturnType
()
==
returnType
)
{
{
Class
[]
mp
=
m
ethods
[
i
]
.
getParameterTypes
();
Class
[]
mp
=
m
.
getParameterTypes
();
if
(
mp
.
length
==
params
.
length
)
if
(
mp
.
length
==
params
.
length
)
{
{
for
(
int
j
=
0
;
j
<
mp
.
length
;
j
++)
for
(
int
j
=
0
;
j
<
mp
.
length
;
j
++)
{
{
if
(
mp
[
j
]
!=
params
[
j
])
if
(
mp
[
j
]
!=
params
[
j
])
{
{
continue
outer
;
continue
outer
;
}
}
}
}
final
Method
m
=
methods
[
i
];
AccessController
.
doPrivileged
(
new
SetAccessibleAction
(
m
));
SetAccessibleAction
setAccessible
=
new
SetAccessibleAction
(
m
);
AccessController
.
doPrivileged
(
setAccessible
);
return
m
;
return
m
;
}
}
}
}
...
@@ -485,9 +491,14 @@ outer:
...
@@ -485,9 +491,14 @@ outer:
Method
[]
methods
=
forClass
().
getDeclaredMethods
();
Method
[]
methods
=
forClass
().
getDeclaredMethods
();
readObjectMethod
=
findMethod
(
methods
,
"readObject"
,
readObjectMethod
=
findMethod
(
methods
,
"readObject"
,
new
Class
[]
{
ObjectInputStream
.
class
},
new
Class
[]
{
ObjectInputStream
.
class
},
Void
.
TYPE
);
Void
.
TYPE
,
true
);
writeObjectMethod
=
findMethod
(
methods
,
"writeObject"
,
new
Class
[]
{
ObjectOutputStream
.
class
},
Void
.
TYPE
,
true
);
readResolveMethod
=
findMethod
(
methods
,
"readResolve"
,
readResolveMethod
=
findMethod
(
methods
,
"readResolve"
,
new
Class
[
0
],
Object
.
class
);
new
Class
[
0
],
Object
.
class
,
false
);
writeReplaceMethod
=
findMethod
(
methods
,
"writeReplace"
,
new
Class
[
0
],
Object
.
class
,
false
);
}
}
private
ObjectStreamClass
(
Class
cl
)
private
ObjectStreamClass
(
Class
cl
)
...
@@ -517,21 +528,9 @@ outer:
...
@@ -517,21 +528,9 @@ outer:
// only set this bit if CL is NOT Externalizable
// only set this bit if CL is NOT Externalizable
flags
|=
ObjectStreamConstants
.
SC_SERIALIZABLE
;
flags
|=
ObjectStreamConstants
.
SC_SERIALIZABLE
;
try
if
(
writeObjectMethod
!=
null
)
{
Method
writeMethod
=
cl
.
getDeclaredMethod
(
"writeObject"
,
writeMethodArgTypes
);
int
modifiers
=
writeMethod
.
getModifiers
();
if
(
writeMethod
.
getReturnType
()
==
Void
.
TYPE
&&
Modifier
.
isPrivate
(
modifiers
)
&&
!
Modifier
.
isStatic
(
modifiers
))
flags
|=
ObjectStreamConstants
.
SC_WRITE_METHOD
;
flags
|=
ObjectStreamConstants
.
SC_WRITE_METHOD
;
}
}
catch
(
NoSuchMethodException
oh_well
)
{
}
}
// Sets fields to be a sorted array of the serializable fields of
// Sets fields to be a sorted array of the serializable fields of
...
@@ -851,11 +850,11 @@ outer:
...
@@ -851,11 +850,11 @@ outer:
{
{
return
(
Externalizable
)
constructor
.
newInstance
(
null
);
return
(
Externalizable
)
constructor
.
newInstance
(
null
);
}
}
catch
(
Throwable
t
)
catch
(
Exception
x
)
{
{
throw
(
InvalidClassException
)
throw
(
InvalidClassException
)
new
InvalidClassException
(
clazz
.
getName
(),
new
InvalidClassException
(
clazz
.
getName
(),
"Unable to instantiate"
).
initCause
(
t
);
"Unable to instantiate"
).
initCause
(
x
);
}
}
}
}
...
@@ -884,10 +883,12 @@ outer:
...
@@ -884,10 +883,12 @@ outer:
Method
readObjectMethod
;
Method
readObjectMethod
;
Method
readResolveMethod
;
Method
readResolveMethod
;
Method
writeReplaceMethod
;
Method
writeObjectMethod
;
boolean
realClassIsSerializable
;
boolean
realClassIsSerializable
;
boolean
realClassIsExternalizable
;
boolean
realClassIsExternalizable
;
ObjectStreamField
[]
fieldMapping
;
ObjectStreamField
[]
fieldMapping
;
C
lass
firstNonSerializableParent
;
C
onstructor
firstNonSerializableParentConstructor
;
private
Constructor
constructor
;
// default constructor for Externalizable
private
Constructor
constructor
;
// default constructor for Externalizable
boolean
isProxyClass
=
false
;
boolean
isProxyClass
=
false
;
...
@@ -896,23 +897,21 @@ outer:
...
@@ -896,23 +897,21 @@ outer:
// but it will avoid showing up as a discrepancy when comparing SUIDs.
// but it will avoid showing up as a discrepancy when comparing SUIDs.
private
static
final
long
serialVersionUID
=
-
6120832682080437368L
;
private
static
final
long
serialVersionUID
=
-
6120832682080437368L
;
}
// interfaces are compared only by name
// interfaces are compared only by name
class
InterfaceComparator
implements
Comparator
private
static
final
class
InterfaceComparator
implements
Comparator
{
{
public
int
compare
(
Object
o1
,
Object
o2
)
public
int
compare
(
Object
o1
,
Object
o2
)
{
{
return
((
Class
)
o1
).
getName
().
compareTo
(((
Class
)
o2
).
getName
());
return
((
Class
)
o1
).
getName
().
compareTo
(((
Class
)
o2
).
getName
());
}
}
}
}
// Members (Methods and Constructors) are compared first by name,
// Members (Methods and Constructors) are compared first by name,
// conflicts are resolved by comparing type signatures
// conflicts are resolved by comparing type signatures
class
MemberComparator
implements
Comparator
private
static
final
class
MemberComparator
implements
Comparator
{
{
public
int
compare
(
Object
o1
,
Object
o2
)
public
int
compare
(
Object
o1
,
Object
o2
)
{
{
Member
m1
=
(
Member
)
o1
;
Member
m1
=
(
Member
)
o1
;
...
@@ -926,4 +925,5 @@ class MemberComparator implements Comparator
...
@@ -926,4 +925,5 @@ class MemberComparator implements Comparator
else
else
return
comp
;
return
comp
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment