aboutsummaryrefslogtreecommitdiff
path: root/vars/utils.groovy
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-11-30 10:39:40 -0500
committerMatt Rendina <mrendina@stsci.edu>2017-11-30 10:39:40 -0500
commit59c8efa7ea37643b4630f341644d7dacfddd9bd0 (patch)
treef3c8bd4d5af2870f19e4eb0aa81399347156ab8b /vars/utils.groovy
parentdab47d3726bf12b646a2c6c39a6ff1dc1200edf5 (diff)
downloadjscu_refactor-59c8efa7ea37643b4630f341644d7dacfddd9bd0.tar.gz
Change syntax
Diffstat (limited to 'vars/utils.groovy')
-rw-r--r--vars/utils.groovy18
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
}
}