lisa/src/main/java/it/unive/lisa/analysis/nonrelational/value/impl/stringgraphdomain/SGNUtils.java
public static StringGraphNode<?> deepClone(StringGraphNode<?> node) {
        try {
            ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
            ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteOutputStream);
            objectOutputStream.writeObject(node);
            ByteArrayInputStream byteInputStream = new ByteArrayInputStream(byteOutputStream.toByteArray());
            ObjectInputStream objectInputStream = new ObjectInputStream(byteInputStream);
            return (StringGraphNode<?>) objectInputStream.readObject();
        } catch (IOException | ClassNotFoundException ignored) {
            return null;
        }
    }
/**
     * Creates a deep copy of the current node, cloning all descendant objects
     * Credits to <a href="https://alvinalexander.com">Alvin Alexander</a>
     *
     * @param node The node to be cloned
     * @return the cloned object
     */
Creates a deep copy of the current node, cloning all descendant objects
Credits to Alvin Alexander

@param node The node to be cloned
@return the cloned object
Creates a deep copy of the current node cloning all descendant objects Credits to Alvin Alexander @param node The node to be cloned @return the cloned object
public static StringGraphNode<?> deepClone(StringGraphNode<?> node) {
        try {
            ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
            ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteOutputStream);
            objectOutputStream.writeObject(node);
            ByteArrayInputStream byteInputStream = new ByteArrayInputStream(byteOutputStream.toByteArray());
            ObjectInputStream objectInputStream = new ObjectInputStream(byteInputStream);
            return (StringGraphNode<?>) objectInputStream.readObject();
        } catch (IOException | ClassNotFoundException ignored) {
            return null;
        }
    }
public static StringGraphNode < ? > deepClone ( StringGraphNode < ? > node ) { try { ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream ( ) ; ObjectOutputStream objectOutputStream = new ObjectOutputStream ( byteOutputStream ) ; objectOutputStream . writeObject ( node ) ; ByteArrayInputStream byteInputStream = new ByteArrayInputStream ( byteOutputStream . toByteArray ( ) ) ; ObjectInputStream objectInputStream = new ObjectInputStream ( byteInputStream ) ; return ( StringGraphNode < ? > ) objectInputStream . readObject ( ) ; } catch ( IOException | ClassNotFoundException ignored ) { return null ; } }
Creates a deep copy of the current node, cloning all descendant objects
 Credits to <a href="https://alvinalexander.com">Alvin Alexander</a>
Creates a deep copy of the current node cloning all descendant objects Credits to <a href = " https : // alvinalexander . com " > Alvin Alexander< / a >