From: Oliver B. <ob...@us...> - 2008-10-18 10:17:16
|
Update of /cvsroot/patterntesting/PatternTesting05/src/test/java/patterntesting/check In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv597/src/test/java/patterntesting/check Modified Files: ImmutableAspectTest.java Log Message: transient attributes are allowed to be changed Index: ImmutableAspectTest.java =================================================================== RCS file: /cvsroot/patterntesting/PatternTesting05/src/test/java/patterntesting/check/ImmutableAspectTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ImmutableAspectTest.java 17 Oct 2008 21:32:16 -0000 1.1 +++ ImmutableAspectTest.java 18 Oct 2008 08:58:04 -0000 1.2 @@ -37,16 +37,20 @@ public class ImmutableAspectTest { private int x = 0; + private transient int y = 1; + private final int z = 2; /** * This test changes the internal attribute x. So if you mark this test * as @Immutable you should see a warning. */ - //@Immutable + @Immutable @Test public void testMutable() { - x = 1; - assertEquals(1, x); + //x = 1; // should give a warning + y = 2; // this is allowed because y is transient + //z = 3; // not allowed -> final + assertEquals(2, y); } /** @@ -63,6 +67,9 @@ /** * $Log$ + * Revision 1.2 2008/10/18 08:58:04 oboehm + * transient attributes are allowed to be changed + * * Revision 1.1 2008/10/17 21:32:16 oboehm * ImmutableAspect moved to patterntesting.check * |