import java.util.*;
import java.io.*;

public class Util
{
    public static final String ALLERGEN_DELIMITER = "(contains";

    public static final Food[] loadRules (String inputFile, boolean debug)
    {
        /*
         * Open the data file and read it in.
         */

        BufferedReader reader = null;
        Vector<Food> values = new Vector<Food>();

        try
        {
            String line = null;

            reader = new BufferedReader(new FileReader(inputFile));
         
            while ((line = reader.readLine()) != null)
            {
                String[] foodData = line.split(" ");
                
                if (debug)
                {
                    System.out.println("Loaded ...");

                    for (int i = 0; i < foodData.length; i++)
                        System.out.println(foodData[i]);
                }
            }
        }
        catch (Throwable ex)
        {
            ex.printStackTrace();
        }
        finally
        {
            try
            {
                reader.close();
            }
            catch (Throwable ex)
            {
            }
        }

        return null;
    }

    private Util ()
    {
    }
}
@@ -552,32 +552,69 @@
 )%0A            %7B%0A
+                Food f = new Food();%0A
                 
@@ -670,245 +670,646 @@
     
-%0A                if (debug)%0A                %7B%0A                    System.out.println(%22Loaded ...%22);%0A%0A                    for (int i = 0; i %3C foodData.length; i++)%0A                        System.out.println(foodData%5Bi%5D);%0A                %7D
+boolean allergens = false;%0A%0A                for (int i = 0; i %3C foodData.length; i++)%0A                %7B%0A                    if (!allergens)%0A                    %7B%0A                        if (foodData%5Bi%5D.startsWith(ALLERGEN_DELIMITER))%0A                            allergens = true;%0A                        else%0A                            f.addIngredient(foodData%5Bi%5D);%0A                    %7D%0A                    else%0A                        f.addAllergen(foodData%5Bi%5D.substring(0, foodData%5Bi%5D.length() -1));%0A                %7D%0A%0A                values.add(f);%0A%0A                if (debug)%0A                    System.out.println(%22%5CnLoaded:%5Cn%22+f);
 %0A   

Update Util.java