mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8274835: Remove unnecessary castings in java.base
Reviewed-by: mullan, naoto, lancea, bpb
This commit is contained in:
parent
3b2585c02b
commit
5a2452c80e
15 changed files with 32 additions and 35 deletions
|
@ -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
|
||||
|
@ -1146,13 +1146,12 @@ public abstract class Signature extends SignatureSpi {
|
|||
public Object clone() throws CloneNotSupportedException {
|
||||
chooseFirstProvider();
|
||||
if (sigSpi instanceof Cloneable) {
|
||||
// Because 'algorithm' and 'provider' are private
|
||||
// members of our supertype, we must perform a cast to
|
||||
// access them.
|
||||
// Because 'algorithm' is private member of our supertype,
|
||||
// we must perform a cast to access it.
|
||||
Signature that = new CloneableDelegate(
|
||||
(SignatureSpi)sigSpi.clone(),
|
||||
((Signature)this).algorithm);
|
||||
that.provider = ((Signature)this).provider;
|
||||
that.provider = this.provider;
|
||||
return that;
|
||||
} else {
|
||||
throw new CloneNotSupportedException();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue