@@ -0,0 +1,1377 @@
+/*%0A * #%25L%0A * ImageJ interactive debugging tutorials.%0A * %25%25%0A * Copyright (C) 2009 - 2015 Board of Regents of the University of Wisconsin-Madison%0A * %25%25%0A * To the extent possible under law, the ImageJ developers have waived%0A * all copyright and related or neighboring rights to this tutorial code.%0A * %0A * See the CC0 1.0 Universal license for details:%0A * http://creativecommons.org/publicdomain/zero/1.0/%0A * #L%25%0A */%0A%0Apackage net.imagej.trouble.visible;%0A%0Aimport net.imagej.trouble.hidden.ObjectAnalyzer;%0Aimport net.imagej.trouble.hidden.ObjectMaker;%0A%0A/**%0A * Exercise 3: Using conditional breakpoints to avoid unnecessary debugging%0A * steps.%0A *%0A * @author Mark Hiner %3Chinerm@gmail.com%3E%0A */%0Apublic class E3ConditionalCrisis %7B%0A%0A%09public static void main(final String... args) %7B%0A%09%09// In E2, getList didn't work so well. So let's try an array this time...%0A%09%09final Object%5B%5D myArray = ObjectMaker.getArray(100);%0A%0A%09%09boolean everythingIsOK = true;%0A%09%09int i = 0;%0A%09%09while (i %3C myArray.length && everythingIsOK) %7B%0A%09%09%09// This time we're using an external library to process objects.%0A%09%09%09// If something goes wrong, this is the line where we'll want to set a%0A%09%09%09// breakpoint.%0A%09%09%09everythingIsOK = ObjectAnalyzer.processElementAtIndex(myArray, i);%0A%09%09%09i++;%0A%09%09%7D%0A%0A%09%09if (!everythingIsOK) %7B%0A%09%09%09throw new RuntimeException(%0A%09%09%09%09%22Oh noes - analysis incomplete! See console for more information.%22);%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create Exercise 3