mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
Better clone methods
This commit is contained in:
@ -44,7 +44,7 @@ public class MultiRecordSecurityLock extends RecordSecurityLock implements Clone
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Override
|
||||
protected MultiRecordSecurityLock clone() throws CloneNotSupportedException
|
||||
public MultiRecordSecurityLock clone()
|
||||
{
|
||||
MultiRecordSecurityLock clone = (MultiRecordSecurityLock) super.clone();
|
||||
|
||||
|
@ -57,20 +57,27 @@ public class RecordSecurityLock implements Cloneable
|
||||
**
|
||||
*******************************************************************************/
|
||||
@Override
|
||||
protected RecordSecurityLock clone() throws CloneNotSupportedException
|
||||
public RecordSecurityLock clone()
|
||||
{
|
||||
RecordSecurityLock clone = (RecordSecurityLock) super.clone();
|
||||
|
||||
/////////////////////////
|
||||
// deep-clone the list //
|
||||
/////////////////////////
|
||||
if(joinNameChain != null)
|
||||
try
|
||||
{
|
||||
clone.joinNameChain = new ArrayList<>();
|
||||
clone.joinNameChain.addAll(joinNameChain);
|
||||
}
|
||||
RecordSecurityLock clone = (RecordSecurityLock) super.clone();
|
||||
|
||||
return (clone);
|
||||
/////////////////////////
|
||||
// deep-clone the list //
|
||||
/////////////////////////
|
||||
if(joinNameChain != null)
|
||||
{
|
||||
clone.joinNameChain = new ArrayList<>();
|
||||
clone.joinNameChain.addAll(joinNameChain);
|
||||
}
|
||||
|
||||
return (clone);
|
||||
}
|
||||
catch(CloneNotSupportedException e)
|
||||
{
|
||||
throw (new RuntimeException("Could not clone", e));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user