@Test public void testClone() { Block b1 = sample1(); Block b2 = b1.clone(); UnitTestUtil.helpTestEquivalence(0, b1, b2); assertNotSame(b1.getStatements().get(0), b2.getStatements().get(0)); }
public Block clone() { Block copy = new Block(); copy.setAtomic(atomic); copy.statements = LanguageObject.Util.deepClone(statements, Statement.class); if (exceptionStatements != null) { copy.exceptionStatements = LanguageObject.Util.deepClone(exceptionStatements, Statement.class); } copy.exceptionGroup = this.exceptionGroup; copy.setLabel(label); return copy; }
Block extends Statement implements Labeled { public Block clone() { Block copy = new Block(); copy.setAtomic(atomic); copy.statements = LanguageObject.Util.deepClone(statements, Statement.class); if (exceptionStatements != null) { copy.exceptionStatements = LanguageObject.Util.deepClone(exceptionStatements, Statement.class); } copy.exceptionGroup = this.exceptionGroup; copy.setLabel(label); return copy; } }
Block extends Statement implements Labeled { public Block clone() { Block copy = new Block(); copy.setAtomic(atomic); copy.statements = LanguageObject.Util.deepClone(statements, Statement.class); if (exceptionStatements != null) { copy.exceptionStatements = LanguageObject.Util.deepClone(exceptionStatements, Statement.class); } copy.exceptionGroup = this.exceptionGroup; copy.setLabel(label); return copy; } Block();  Block(Statement statement); }
Block extends Statement implements Labeled { public Block clone() { Block copy = new Block(); copy.setAtomic(atomic); copy.statements = LanguageObject.Util.deepClone(statements, Statement.class); if (exceptionStatements != null) { copy.exceptionStatements = LanguageObject.Util.deepClone(exceptionStatements, Statement.class); } copy.exceptionGroup = this.exceptionGroup; copy.setLabel(label); return copy; } Block();  Block(Statement statement); String getLabel(); void setLabel(String label); List<Statement> getStatements(); void setStatements(List<Statement> statements); void addStatement(Statement statement); void addStatement(Statement statement, boolean exception); void acceptVisitor(LanguageVisitor visitor); Block clone(); boolean equals(Object obj); int hashCode(); String toString(); boolean isAtomic(); void setAtomic(boolean atomic); @Override int getType(); String getExceptionGroup(); void setExceptionGroup(String exceptionGroup); List<Statement> getExceptionStatements(); void setExceptionStatements(List<Statement> exceptionStatements); }
Block extends Statement implements Labeled { public Block clone() { Block copy = new Block(); copy.setAtomic(atomic); copy.statements = LanguageObject.Util.deepClone(statements, Statement.class); if (exceptionStatements != null) { copy.exceptionStatements = LanguageObject.Util.deepClone(exceptionStatements, Statement.class); } copy.exceptionGroup = this.exceptionGroup; copy.setLabel(label); return copy; } Block();  Block(Statement statement); String getLabel(); void setLabel(String label); List<Statement> getStatements(); void setStatements(List<Statement> statements); void addStatement(Statement statement); void addStatement(Statement statement, boolean exception); void acceptVisitor(LanguageVisitor visitor); Block clone(); boolean equals(Object obj); int hashCode(); String toString(); boolean isAtomic(); void setAtomic(boolean atomic); @Override int getType(); String getExceptionGroup(); void setExceptionGroup(String exceptionGroup); List<Statement> getExceptionStatements(); void setExceptionStatements(List<Statement> exceptionStatements);  }