User Tools

Site Tools


invariant:ex1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
invariant:ex1 [2007/02/25 17:32] – created bdefraininvariant:ex1 [2021/02/05 13:53] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Invariants: Find old tracing ======+[[invariant:intro|Intro]] 
 +[[invariant:ex1|Ex1]] 
 +[[invariant:ex2|Ex2]] 
 +[[invariant:ex3|Ex3]] 
 +[[invariant:ex4|Ex4]] 
 +[[invariant:ex5|Ex5]]====== Invariants: Find old tracing ======
  
 **Task:** Signal an error for output on the standard output channel ''System.out''. **Task:** Signal an error for output on the standard output channel ''System.out''.
Line 8: Line 13:
 package answers; package answers;
  
-import figures.*; +aspect Answer1 {
- +
-aspect Answer1a {+
   declare error:   declare error:
     get(java.io.PrintStream System.out) && within(figures..*):     get(java.io.PrintStream System.out) && within(figures..*):
Line 17: Line 20:
 </code> </code>
  
 +<note>
 Note that this answer does not say that the call to the ''println()'' method is incorrect, rather, that the field get of the ''out'' field is illegal. Indeed, it is not a mistake in general to use the ''println()'' method. Note that this answer does not say that the call to the ''println()'' method is incorrect, rather, that the field get of the ''out'' field is illegal. Indeed, it is not a mistake in general to use the ''println()'' method.
 +</note>
  
 When you use this on the given system, you'll find one incorrect trace in ''SlothfulPoint''. When you use this on the given system, you'll find one incorrect trace in ''SlothfulPoint''.
  
 +----
 +
 +Comment out the offending output line and continue with [[invariant:ex2|Exercise 2]].
invariant/ex1.1172421142.txt.gz · Last modified: 2007/02/25 17:32 by bdefrain