Skip to content
Permalink
Browse files
8248318: Remove superfluous use of boxing in ObjectStreamClass
Reviewed-by: jlaskey, dfuchs, rriggs, chegar
  • Loading branch information
FrauBoes committed Feb 22, 2021
1 parent 6b7575b commit e9d7c07bdadec1df313a845079a5690c338b8109
Showing with 7 additions and 7 deletions.
  1. +7 −7 src/java.base/share/classes/java/io/ObjectStreamClass.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, 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
@@ -510,7 +510,7 @@ private ObjectStreamClass(final Class<?> cl) {
AccessController.doPrivileged(new PrivilegedAction<>() {
public Void run() {
if (isEnum) {
suid = Long.valueOf(0);
suid = 0L;
fields = NO_FIELDS;
return null;
}
@@ -555,7 +555,7 @@ public Void run() {
}
});
} else {
suid = Long.valueOf(0);
suid = 0L;
fields = NO_FIELDS;
}

@@ -673,7 +673,7 @@ void initProxy(Class<?> cl,
this.superDesc = superDesc;
isProxy = true;
serializable = true;
suid = Long.valueOf(0);
suid = 0L;
fields = NO_FIELDS;
if (osc != null) {
localDesc = osc;
@@ -698,7 +698,7 @@ void initNonProxy(ObjectStreamClass model,
ObjectStreamClass superDesc)
throws InvalidClassException
{
long suid = Long.valueOf(model.getSerialVersionUID());
long suid = model.getSerialVersionUID();
ObjectStreamClass osc = null;
if (cl != null) {
osc = lookup(cl, true);
@@ -796,7 +796,7 @@ void readNonProxy(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
name = in.readUTF();
suid = Long.valueOf(in.readLong());
suid = in.readLong();
isProxy = false;

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

1 comment on commit e9d7c07

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on e9d7c07 Feb 22, 2021

Please sign in to comment.