Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit e9d7c07

Browse files
author
Julia Boes
committedFeb 22, 2021
8248318: Remove superfluous use of boxing in ObjectStreamClass
Reviewed-by: jlaskey, dfuchs, rriggs, chegar
1 parent 6b7575b commit e9d7c07

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/java.base/share/classes/java/io/ObjectStreamClass.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -510,7 +510,7 @@ private ObjectStreamClass(final Class<?> cl) {
510510
AccessController.doPrivileged(new PrivilegedAction<>() {
511511
public Void run() {
512512
if (isEnum) {
513-
suid = Long.valueOf(0);
513+
suid = 0L;
514514
fields = NO_FIELDS;
515515
return null;
516516
}
@@ -555,7 +555,7 @@ public Void run() {
555555
}
556556
});
557557
} else {
558-
suid = Long.valueOf(0);
558+
suid = 0L;
559559
fields = NO_FIELDS;
560560
}
561561

@@ -673,7 +673,7 @@ void initProxy(Class<?> cl,
673673
this.superDesc = superDesc;
674674
isProxy = true;
675675
serializable = true;
676-
suid = Long.valueOf(0);
676+
suid = 0L;
677677
fields = NO_FIELDS;
678678
if (osc != null) {
679679
localDesc = osc;
@@ -698,7 +698,7 @@ void initNonProxy(ObjectStreamClass model,
698698
ObjectStreamClass superDesc)
699699
throws InvalidClassException
700700
{
701-
long suid = Long.valueOf(model.getSerialVersionUID());
701+
long suid = model.getSerialVersionUID();
702702
ObjectStreamClass osc = null;
703703
if (cl != null) {
704704
osc = lookup(cl, true);
@@ -796,7 +796,7 @@ void readNonProxy(ObjectInputStream in)
796796
throws IOException, ClassNotFoundException
797797
{
798798
name = in.readUTF();
799-
suid = Long.valueOf(in.readLong());
799+
suid = in.readLong();
800800
isProxy = false;
801801

802802
byte flags = in.readByte();
@@ -1846,7 +1846,7 @@ private static Long getDeclaredSUID(Class<?> cl) {
18461846
int mask = Modifier.STATIC | Modifier.FINAL;
18471847
if ((f.getModifiers() & mask) == mask) {
18481848
f.setAccessible(true);
1849-
return Long.valueOf(f.getLong(null));
1849+
return f.getLong(null);
18501850
}
18511851
} catch (Exception ex) {
18521852
}

0 commit comments

Comments
 (0)