title: Java Program - "Erroneous tree type" Issue
body: <p>I have been going thorough some practice problems and have a question on this code. I was able to figure it out using a different method, but I don't understand why this example doesn't work.The code asks for input until the user enters the same input twice, where it should then display the duplicate input before ending the program.</p>
  
  <p>I am getting: </p>
  
  <pre><code>Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: any&gt;
  </code></pre>
  
  <p>Error on the last line with the <em>word</em> variable. Any ideas?</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Scanner;
  
  public class MoreThanOnce {
  
      public static void main(String[] args) {
          Scanner reader = new Scanner(System.in);
          // create here the ArrayList 
          ArrayList&lt;String&gt; words = new ArrayList&lt;String&gt;();
          while (true){
              System.out.print("Type a word: ");
              String word = reader.nextLine();
              if(!words.contains(word)){
                  words.add(word);
              }else{
                  break;
              }
  
  
          }
          System.out.println("You gave the word " + word + " twice");
  
      }
  }
  </code></pre>