Merge pull request #21 from Alfresco/fix/SEARCH-956_Critical_Sonar_Reports_for_Alfresco_Data_Model

SEARCH-956 (Critical Sonar Reports: Alfresco Data Model)
This commit is contained in:
Tuna Aksoy
2018-08-03 11:12:33 +01:00
committed by GitHub

View File

@@ -44,8 +44,10 @@ public class CMISUtils
out.writeObject(source);
out.flush();
ObjectInputStream in = new ObjectInputStream(cos.getInputStream());
target = (T) in.readObject();
try (ObjectInputStream in = new ObjectInputStream(cos.getInputStream()))
{
target = (T) in.readObject();
}
} catch (Exception e)
{
throw new CmisRuntimeException("Object copy failed!", e);