diff options
| author | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 10:39:40 -0500 |
|---|---|---|
| committer | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 10:39:40 -0500 |
| commit | 59c8efa7ea37643b4630f341644d7dacfddd9bd0 (patch) | |
| tree | f3c8bd4d5af2870f19e4eb0aa81399347156ab8b /vars/utils.groovy | |
| parent | dab47d3726bf12b646a2c6c39a6ff1dc1200edf5 (diff) | |
| download | jscu_refactor-59c8efa7ea37643b4630f341644d7dacfddd9bd0.tar.gz | |
Change syntax
Diffstat (limited to 'vars/utils.groovy')
| -rw-r--r-- | vars/utils.groovy | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index 793b24c..c2f0b47 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -104,17 +104,17 @@ def concurrent(configs) { /** * This method makes a "deep clone" of any object it is given. */ -public static Object deepClone(Object object) { +def deepClone(object) { try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream oos = new ObjectOutputStream(baos); - oos.writeObject(object); - ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); - ObjectInputStream ois = new ObjectInputStream(bais); - return ois.readObject(); + ByteArrayOutputStream baos = new ByteArrayOutputStream() + ObjectOutputStream oos = new ObjectOutputStream(baos) + oos.writeObject(object) + ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()) + ObjectInputStream ois = new ObjectInputStream(bais) + return ois.readObject() } catch (Exception e) { - e.printStackTrace(); - return null; + e.printStackTrace() + return null } } |
