Make cycle detection atomic. No 2 threads should use getInstance at the same time. The lock is shared for all scopes. This is a problem.

--- toothpick-runtime/src/main/java/toothpick/Configuration.java
+++ toothpick-runtime/src/main/java/toothpick/Configuration.java
@@ -1,6 +1,7 @@
 package toothpick;

 import java.util.Stack;
+import java.util.concurrent.locks.ReentrantLock;
 import toothpick.config.Binding;

 import static java.lang.String.format;
@@ -23,6 +24,8 @@
   public static void development() {
     instance = new Configuration() {
       private Stack<Class> cycleDetectionStack = new Stack<>();
+      //used to make the cycle check atomic.
+      private ReentrantLock reentrantLock = new ReentrantLock();

       @Override
       void checkIllegalBinding(Binding binding) {
@@ -37,11 +40,13 @@
         }

         cycleDetectionStack.push(clazz);
+        reentrantLock.lock();
       }

       @Override
       void checkCyclesEnd() {
         cycleDetectionStack.pop();
+        reentrantLock.unlock();
       }
     };
   }

<|original_code|>
package toothpick;

import java.util.Stack;
import toothpick.config.Binding;

import static java.lang.String.format;

public abstract class Configuration {

  public static volatile Configuration instance;

  abstract void checkIllegalBinding(Binding binding);

  abstract void checkCyclesStart(Class clazz);

  abstract void checkCyclesEnd();

  static {
    //default mode is production
    production();
  }

  public static void development() {
    instance = new Configuration() {
      private Stack<Class> cycleDetectionStack = new Stack<>();

      @Override
      void checkIllegalBinding(Binding binding) {

      }

      @Override
      void checkCyclesStart(Class clazz) {
        if (cycleDetectionStack.contains(clazz)) {
          //TODO make the message better
          throw new CyclicDependencyException(format("Class %s creates a cycle", clazz.getName()));
        }

        cycleDetectionStack.push(clazz);
      }

      @Override
      void checkCyclesEnd() {
        cycleDetectionStack.pop();
      }
    };
  }

  public static void production() {
    instance = new Configuration() {
      @Override
      void checkIllegalBinding(Binding binding) {
        //do nothing
      }

      @Override
      void checkCyclesStart(Class clazz) {
        //do nothing
      }

      @Override
      void checkCyclesEnd() {
        //do nothing
      }
    };
  }

  /**
   * Allows to pass custom configurations.
   *
   * @param configuration the configuration to use
   */
  static void setConfiguration(Configuration configuration) {
    instance = configuration;
  }
}

<|edits_diff|>
--- toothpick-runtime/src/main/java/toothpick/Configuration.java
+++ toothpick-runtime/src/main/java/toothpick/Configuration.java
@@ -1,6 +1,7 @@
 package toothpick;

 import java.util.Stack;
+import java.util.concurrent.locks.ReentrantLock;
 import toothpick.config.Binding;

 import static java.lang.String.format;
@@ -23,6 +24,8 @@
   public static void development() {
     instance = new Configuration() {
       private Stack<Class> cycleDetectionStack = new Stack<>();
+      //used to make the cycle check atomic.
+      private ReentrantLock reentrantLock = new ReentrantLock();

       @Override
       void checkIllegalBinding(Binding binding) {
@@ -37,6 +40,7 @@
         }

         cycleDetectionStack.push(clazz);
+        reentrantLock.lock();
       }

       @Override
<|current_version|>
package toothpick;

import java.util.Stack;
import java.util.concurrent.locks.ReentrantLock;
import toothpick.config.Binding;

import static java.lang.String.format;

public abstract class Configuration {

  public static volatile Configuration instance;

  abstract void checkIllegalBinding(Binding binding);

  abstract void checkCyclesStart(Class clazz);

  abstract void checkCyclesEnd();

  static {
    //default mode is production
    production();
  }

  public static void development() {
    instance = new Configuration() {
      private Stack<Class> cycleDetectionStack = new Stack<>();
      //used to make the cycle check atomic.
      private ReentrantLock reentrantLock = new ReentrantLock();

      @Override
      void checkIllegalBinding(Binding binding) {

      }

      @Override
      void checkCyclesStart(Class clazz) {
        if (cycleDetectionStack.contains(clazz)) {
          //TODO make the message better
          throw new CyclicDependencyException(format("Class %s creates a cycle", clazz.getName()));
        }

        cycleDetectionStack.push(clazz);
        reentrantLock.lock();
      }

      @Override
      void checkCyclesEnd() {
        cycleDetectionStack.pop();
      }
    };
  }

  public static void production() {
    instance = new Configuration() {
      @Override
      void checkIllegalBinding(Binding binding) {
        //do nothing
      }

      @Override
      void checkCyclesStart(Class clazz) {
        //do nothing
      }

      @Override
      void checkCyclesEnd() {
        //do nothing
      }
    };
  }

  /**
   * Allows to pass custom configurations.
   *
   * @param configuration the configuration to use
   */
  static void setConfiguration(Configuration configuration) {
    instance = configuration;
  }
}

<|next_version|>
package toothpick;

import java.util.Stack;
import java.util.concurrent.locks.ReentrantLock;
import toothpick.config.Binding;

import static java.lang.String.format;

public abstract class Configuration {

  public static volatile Configuration instance;

  abstract void checkIllegalBinding(Binding binding);

  abstract void checkCyclesStart(Class clazz);

  abstract void checkCyclesEnd();

  static {
    //default mode is production
    production();
  }

  public static void development() {
    instance = new Configuration() {
      private Stack<Class> cycleDetectionStack = new Stack<>();
      //used to make the cycle check atomic.
      private ReentrantLock reentrantLock = new ReentrantLock();

      @Override
      void checkIllegalBinding(Binding binding) {

      }

      @Override
      void checkCyclesStart(Class clazz) {
        if (cycleDetectionStack.contains(clazz)) {
          //TODO make the message better
          throw new CyclicDependencyException(format("Class %s creates a cycle", clazz.getName()));
        }

        cycleDetectionStack.push(clazz);
        reentrantLock.lock();
      }

      @Override
      void checkCyclesEnd() {
        cycleDetectionStack.pop();
        reentrantLock.unlock();
      }
    };
  }

  public static void production() {
    instance = new Configuration() {
      @Override
      void checkIllegalBinding(Binding binding) {
        //do nothing
      }

      @Override
      void checkCyclesStart(Class clazz) {
        //do nothing
      }

      @Override
      void checkCyclesEnd() {
        //do nothing
      }
    };
  }

  /**
   * Allows to pass custom configurations.
   *
   * @param configuration the configuration to use
   */
  static void setConfiguration(Configuration configuration) {
    instance = configuration;
  }
}


Add ability to display toasts

Add ability to display toasts

--- app/src/main/java/jasenmoloy/wirelesscontrol/helpers/UIHelper.java
+++ app/src/main/java/jasenmoloy/wirelesscontrol/helpers/UIHelper.java
@@ -1,6 +1,8 @@
 package jasenmoloy.wirelesscontrol.helpers;

+import android.content.Context;
 import android.widget.Button;
+import android.widget.Toast;

 /**
  * Created by jasenmoloy on 5/20/16.
@@ -24,4 +26,8 @@
         button.setAlpha(0.25f); //Make the button transparent to visually show the button is disabled.
         button.setClickable(false);
     }
+
+    public static void displayToast(Context context, int duration, String text) {
+        Toast.makeText(context, text, duration).show();
+    }
 }

<|original_code|>
package jasenmoloy.wirelesscontrol.helpers;

import android.widget.Button;

/**
 * Created by jasenmoloy on 5/20/16.
 */
public class UIHelper {

    /**
     * Visually and functionally enables a button
     * @param button        The button to enable
     */
    public static void enableButton(Button button) {
        button.setAlpha(1.0f);
        button.setClickable(true);
    }

    /**
     * Visually and functionally disables a button
     * @param button        The button to disable
     */
    public static void disableButton(Button button) {
        button.setAlpha(0.25f); //Make the button transparent to visually show the button is disabled.
        button.setClickable(false);
    }
}

<|edits_diff|>
--- app/src/main/java/jasenmoloy/wirelesscontrol/helpers/UIHelper.java
+++ app/src/main/java/jasenmoloy/wirelesscontrol/helpers/UIHelper.java
@@ -1,6 +1,8 @@
 package jasenmoloy.wirelesscontrol.helpers;

+import android.content.Context;
 import android.widget.Button;
+import android.widget.Toast;

 /**
  * Created by jasenmoloy on 5/20/16.
<|current_version|>
package jasenmoloy.wirelesscontrol.helpers;

import android.content.Context;
import android.widget.Button;
import android.widget.Toast;

/**
 * Created by jasenmoloy on 5/20/16.
 */
public class UIHelper {

    /**
     * Visually and functionally enables a button
     * @param button        The button to enable
     */
    public static void enableButton(Button button) {
        button.setAlpha(1.0f);
        button.setClickable(true);
    }

    /**
     * Visually and functionally disables a button
     * @param button        The button to disable
     */
    public static void disableButton(Button button) {
        button.setAlpha(0.25f); //Make the button transparent to visually show the button is disabled.
        button.setClickable(false);
    }
}

<|next_version|>
package jasenmoloy.wirelesscontrol.helpers;

import android.content.Context;
import android.widget.Button;
import android.widget.Toast;

/**
 * Created by jasenmoloy on 5/20/16.
 */
public class UIHelper {

    /**
     * Visually and functionally enables a button
     * @param button        The button to enable
     */
    public static void enableButton(Button button) {
        button.setAlpha(1.0f);
        button.setClickable(true);
    }

    /**
     * Visually and functionally disables a button
     * @param button        The button to disable
     */
    public static void disableButton(Button button) {
        button.setAlpha(0.25f); //Make the button transparent to visually show the button is disabled.
        button.setClickable(false);
    }

    public static void displayToast(Context context, int duration, String text) {
        Toast.makeText(context, text, duration).show();
    }
}


feat(graphql): Allow unknown properties in GraphQL requests

--- src/main/java/com/conveyal/r5/api/GraphQlRequest.java
+++ src/main/java/com/conveyal/r5/api/GraphQlRequest.java
@@ -1,10 +1,13 @@
 package com.conveyal.r5.api;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

 /**
  * Dummy request for GraphQL
  *
  * Since GraphQL request is in JSON Jackson needs this to parse it correctly.
  */
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class GraphQlRequest {
     public String query;
     //FIXME: This should be Map<String, Object> and be serialized automatically with Jackson but it

<|original_code|>
package com.conveyal.r5.api;

/**
 * Dummy request for GraphQL
 *
 * Since GraphQL request is in JSON Jackson needs this to parse it correctly.
 */
public class GraphQlRequest {
    public String query;
    //FIXME: This should be Map<String, Object> and be serialized automatically with Jackson but it
    //doesn't seems to work.
    public String variables;
}

<|edits_diff|>
--- src/main/java/com/conveyal/r5/api/GraphQlRequest.java
+++ src/main/java/com/conveyal/r5/api/GraphQlRequest.java
@@ -1,4 +1,6 @@
 package com.conveyal.r5.api;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

 /**
  * Dummy request for GraphQL
<|current_version|>
package com.conveyal.r5.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Dummy request for GraphQL
 *
 * Since GraphQL request is in JSON Jackson needs this to parse it correctly.
 */
public class GraphQlRequest {
    public String query;
    //FIXME: This should be Map<String, Object> and be serialized automatically with Jackson but it
    //doesn't seems to work.
    public String variables;
}

<|next_version|>
package com.conveyal.r5.api;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Dummy request for GraphQL
 *
 * Since GraphQL request is in JSON Jackson needs this to parse it correctly.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class GraphQlRequest {
    public String query;
    //FIXME: This should be Map<String, Object> and be serialized automatically with Jackson but it
    //doesn't seems to work.
    public String variables;
}


Remove ads from porncomixonline's main page

--- app/src/main/java/me/devsaki/hentoid/activities/sources/PorncomixActivity.java
+++ app/src/main/java/me/devsaki/hentoid/activities/sources/PorncomixActivity.java
@@ -12,6 +12,7 @@
             "//porncomixinfo.com/manga-comics/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+/$",
             "//bestporncomix.com/gallery/[A-Za-z0-9\\-]+/$"
     };
+    private static final String[] DIRTY_ELEMENTS = {"iframe[name^='spot']"};

     Site getStartSite() {
         return Site.PORNCOMIX;
@@ -19,6 +20,7 @@

     @Override
     protected CustomWebViewClient getWebClient() {
+        addDirtyElements(DIRTY_ELEMENTS);
         return new CustomWebViewClient(GALLERY_FILTER, this);
     }
 }

<|original_code|>
package me.devsaki.hentoid.activities.sources;

import me.devsaki.hentoid.enums.Site;

public class PorncomixActivity extends BaseWebActivity {

    //    private static final String DOMAIN_FILTER = "porncomixonline.net";
    private static final String[] GALLERY_FILTER = {
            "//www.porncomixonline.net/manga/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+$",
            "//www.porncomixonline.net/[A-Za-z0-9\\-]+/$",
            "//porncomicszone.net/[0-9]+/[A-Za-z0-9\\-]+/[0-9]+/$",
            "//porncomixinfo.com/manga-comics/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+/$",
            "//bestporncomix.com/gallery/[A-Za-z0-9\\-]+/$"
    };

    Site getStartSite() {
        return Site.PORNCOMIX;
    }

    @Override
    protected CustomWebViewClient getWebClient() {
        return new CustomWebViewClient(GALLERY_FILTER, this);
    }
}

<|edits_diff|>
--- app/src/main/java/me/devsaki/hentoid/activities/sources/PorncomixActivity.java
+++ app/src/main/java/me/devsaki/hentoid/activities/sources/PorncomixActivity.java
@@ -12,6 +12,7 @@
             "//porncomixinfo.com/manga-comics/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+/$",
             "//bestporncomix.com/gallery/[A-Za-z0-9\\-]+/$"
     };
+    private static final String[] DIRTY_ELEMENTS = {"iframe[name^='spot']"};

     Site getStartSite() {
         return Site.PORNCOMIX;
<|current_version|>
package me.devsaki.hentoid.activities.sources;

import me.devsaki.hentoid.enums.Site;

public class PorncomixActivity extends BaseWebActivity {

    //    private static final String DOMAIN_FILTER = "porncomixonline.net";
    private static final String[] GALLERY_FILTER = {
            "//www.porncomixonline.net/manga/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+$",
            "//www.porncomixonline.net/[A-Za-z0-9\\-]+/$",
            "//porncomicszone.net/[0-9]+/[A-Za-z0-9\\-]+/[0-9]+/$",
            "//porncomixinfo.com/manga-comics/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+/$",
            "//bestporncomix.com/gallery/[A-Za-z0-9\\-]+/$"
    };
    private static final String[] DIRTY_ELEMENTS = {"iframe[name^='spot']"};

    Site getStartSite() {
        return Site.PORNCOMIX;
    }

    @Override
    protected CustomWebViewClient getWebClient() {
        return new CustomWebViewClient(GALLERY_FILTER, this);
    }
}

<|next_version|>
package me.devsaki.hentoid.activities.sources;

import me.devsaki.hentoid.enums.Site;

public class PorncomixActivity extends BaseWebActivity {

    //    private static final String DOMAIN_FILTER = "porncomixonline.net";
    private static final String[] GALLERY_FILTER = {
            "//www.porncomixonline.net/manga/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+$",
            "//www.porncomixonline.net/[A-Za-z0-9\\-]+/$",
            "//porncomicszone.net/[0-9]+/[A-Za-z0-9\\-]+/[0-9]+/$",
            "//porncomixinfo.com/manga-comics/[A-Za-z0-9\\-]+/[A-Za-z0-9\\-]+/$",
            "//bestporncomix.com/gallery/[A-Za-z0-9\\-]+/$"
    };
    private static final String[] DIRTY_ELEMENTS = {"iframe[name^='spot']"};

    Site getStartSite() {
        return Site.PORNCOMIX;
    }

    @Override
    protected CustomWebViewClient getWebClient() {
        addDirtyElements(DIRTY_ELEMENTS);
        return new CustomWebViewClient(GALLERY_FILTER, this);
    }
}


Add set status text to java file

Add set status text to java file

--- src/main/java/seedu/watodo/ui/TaskCard.java
+++ src/main/java/seedu/watodo/ui/TaskCard.java
@@ -15,6 +15,8 @@
     private HBox cardPane;
     @FXML
     private Label description;
+    @FXML
+    private Label status;
     @FXML
     private Label id;
     @FXML
@@ -41,6 +43,8 @@
         } else {
             endDate.setText("");
         }
+
+        status.setText(task.getStatus().toString());

         initTags(task);
     }

<|original_code|>
package seedu.watodo.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.watodo.model.task.ReadOnlyTask;

public class TaskCard extends UiPart<Region> {

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label description;
    @FXML
    private Label id;
    @FXML
    private Label startDate;
    @FXML
    private Label endDate;
    @FXML
    private FlowPane tags;

    public TaskCard(ReadOnlyTask task, int displayedIndex) {
        super(FXML);
        description.setText(task.getDescription().fullDescription);
        id.setText(displayedIndex + ". ");

        if (task.getStartDate() != null) {
            startDate.setText("Start Task From " + task.getStartDate());
        } else {
            startDate.setText("");
        }

        if (task.getEndDate() != null) {
            endDate.setText("Do Task By " + task.getEndDate());
        } else {
            endDate.setText("");
        }

        initTags(task);
    }

    private void initTags(ReadOnlyTask person) {
        person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
    }
}

<|edits_diff|>
--- src/main/java/seedu/watodo/ui/TaskCard.java
+++ src/main/java/seedu/watodo/ui/TaskCard.java
@@ -15,6 +15,8 @@
     private HBox cardPane;
     @FXML
     private Label description;
+    @FXML
+    private Label status;
     @FXML
     private Label id;
     @FXML
<|current_version|>
package seedu.watodo.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.watodo.model.task.ReadOnlyTask;

public class TaskCard extends UiPart<Region> {

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label description;
    @FXML
    private Label status;
    @FXML
    private Label id;
    @FXML
    private Label startDate;
    @FXML
    private Label endDate;
    @FXML
    private FlowPane tags;

    public TaskCard(ReadOnlyTask task, int displayedIndex) {
        super(FXML);
        description.setText(task.getDescription().fullDescription);
        id.setText(displayedIndex + ". ");

        if (task.getStartDate() != null) {
            startDate.setText("Start Task From " + task.getStartDate());
        } else {
            startDate.setText("");
        }

        if (task.getEndDate() != null) {
            endDate.setText("Do Task By " + task.getEndDate());
        } else {
            endDate.setText("");
        }

        initTags(task);
    }

    private void initTags(ReadOnlyTask person) {
        person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
    }
}

<|next_version|>
package seedu.watodo.ui;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import seedu.watodo.model.task.ReadOnlyTask;

public class TaskCard extends UiPart<Region> {

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label description;
    @FXML
    private Label status;
    @FXML
    private Label id;
    @FXML
    private Label startDate;
    @FXML
    private Label endDate;
    @FXML
    private FlowPane tags;

    public TaskCard(ReadOnlyTask task, int displayedIndex) {
        super(FXML);
        description.setText(task.getDescription().fullDescription);
        id.setText(displayedIndex + ". ");

        if (task.getStartDate() != null) {
            startDate.setText("Start Task From " + task.getStartDate());
        } else {
            startDate.setText("");
        }

        if (task.getEndDate() != null) {
            endDate.setText("Do Task By " + task.getEndDate());
        } else {
            endDate.setText("");
        }

        status.setText(task.getStatus().toString());

        initTags(task);
    }

    private void initTags(ReadOnlyTask person) {
        person.getTags().forEach(tag -> tags.getChildren().add(new Label(tag.tagName)));
    }
}


Add score attribute to recipe

Add score attribute to recipe

As long as the search algorith remains simple, the score is always
100/100.

--- Backend/src/dhbw/pluto/recipes/Recipe.java
+++ Backend/src/dhbw/pluto/recipes/Recipe.java
@@ -11,6 +11,7 @@
 	private String author;
 	private String text;
 	List<Ingredient> ingredients;
+	private int score = 100;

 	/*
 	 * Constructor
@@ -33,6 +34,7 @@
 	        result.put("title", title);
 	        result.put("text", text);
 	        result.put("eMail", author);
+	        result.put("score", score);
 	        JSONArray ingredientsArray = new JSONArray();
 	        for(int i = 0; i < ingredients.size(); i++) {
 	        	ingredientsArray.put(ingredients.get(i).toJSON());
@@ -49,6 +51,10 @@
 	public int getId() {
 		return id;
 	}
+
+	public void setScore(int score) {
+		this.score = score;
+	}

 }

<|original_code|>
package dhbw.pluto.recipes;

import java.util.List;

import org.json.*;

public class Recipe {

	private int id;
	private String title;
	private String author;
	private String text;
	List<Ingredient> ingredients;

	/*
	 * Constructor
	 */

	public Recipe (int id, String title, String author, String text, List<Ingredient> ingredients) {
		this.id = id;
		this.title = title;
		this.author = author;
		this.text = text;
		this.ingredients = ingredients;
	}

	//generate valid JSON
	public JSONObject toJSON() {
	    JSONObject result = new JSONObject();

	    try {
	    	result.put("id", id);
	        result.put("title", title);
	        result.put("text", text);
	        result.put("eMail", author);
	        JSONArray ingredientsArray = new JSONArray();
	        for(int i = 0; i < ingredients.size(); i++) {
	        	ingredientsArray.put(ingredients.get(i).toJSON());
	        }
	        result.put("ingredients", ingredientsArray);
	    } catch (JSONException e) {
	        // put() throws e, if key==null. Since key=<STRING>, this exception should never be thrown.
	        e.printStackTrace();
	    }

	    return result;
	}

	public int getId() {
		return id;
	}

}

<|edits_diff|>
--- Backend/src/dhbw/pluto/recipes/Recipe.java
+++ Backend/src/dhbw/pluto/recipes/Recipe.java
@@ -11,6 +11,7 @@
 	private String author;
 	private String text;
 	List<Ingredient> ingredients;
+	private int score = 100;

 	/*
 	 * Constructor
@@ -33,6 +34,7 @@
 	        result.put("title", title);
 	        result.put("text", text);
 	        result.put("eMail", author);
+	        result.put("score", score);
 	        JSONArray ingredientsArray = new JSONArray();
 	        for(int i = 0; i < ingredients.size(); i++) {
 	        	ingredientsArray.put(ingredients.get(i).toJSON());
<|current_version|>
package dhbw.pluto.recipes;

import java.util.List;

import org.json.*;

public class Recipe {

	private int id;
	private String title;
	private String author;
	private String text;
	List<Ingredient> ingredients;
	private int score = 100;

	/*
	 * Constructor
	 */

	public Recipe (int id, String title, String author, String text, List<Ingredient> ingredients) {
		this.id = id;
		this.title = title;
		this.author = author;
		this.text = text;
		this.ingredients = ingredients;
	}

	//generate valid JSON
	public JSONObject toJSON() {
	    JSONObject result = new JSONObject();

	    try {
	    	result.put("id", id);
	        result.put("title", title);
	        result.put("text", text);
	        result.put("eMail", author);
	        result.put("score", score);
	        JSONArray ingredientsArray = new JSONArray();
	        for(int i = 0; i < ingredients.size(); i++) {
	        	ingredientsArray.put(ingredients.get(i).toJSON());
	        }
	        result.put("ingredients", ingredientsArray);
	    } catch (JSONException e) {
	        // put() throws e, if key==null. Since key=<STRING>, this exception should never be thrown.
	        e.printStackTrace();
	    }

	    return result;
	}

	public int getId() {
		return id;
	}

}

<|next_version|>
package dhbw.pluto.recipes;

import java.util.List;

import org.json.*;

public class Recipe {

	private int id;
	private String title;
	private String author;
	private String text;
	List<Ingredient> ingredients;
	private int score = 100;

	/*
	 * Constructor
	 */

	public Recipe (int id, String title, String author, String text, List<Ingredient> ingredients) {
		this.id = id;
		this.title = title;
		this.author = author;
		this.text = text;
		this.ingredients = ingredients;
	}

	//generate valid JSON
	public JSONObject toJSON() {
	    JSONObject result = new JSONObject();

	    try {
	    	result.put("id", id);
	        result.put("title", title);
	        result.put("text", text);
	        result.put("eMail", author);
	        result.put("score", score);
	        JSONArray ingredientsArray = new JSONArray();
	        for(int i = 0; i < ingredients.size(); i++) {
	        	ingredientsArray.put(ingredients.get(i).toJSON());
	        }
	        result.put("ingredients", ingredientsArray);
	    } catch (JSONException e) {
	        // put() throws e, if key==null. Since key=<STRING>, this exception should never be thrown.
	        e.printStackTrace();
	    }

	    return result;
	}

	public int getId() {
		return id;
	}

	public void setScore(int score) {
		this.score = score;
	}

}


Add find files, images in repository

Add find files, images in repository

--- src/main/java/com/sajo/teamkerbell/repository/FileDBRepository.java
+++ src/main/java/com/sajo/teamkerbell/repository/FileDBRepository.java
@@ -1,8 +1,11 @@
 package com.sajo.teamkerbell.repository;

 import com.sajo.teamkerbell.entity.FileDB;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
+
+import java.util.List;

 /**
  * Created by seongahjo on 2016. 7. 2..
@@ -10,4 +13,8 @@
 @Repository
 public interface FileDBRepository extends JpaRepository<FileDB, Integer> {
     FileDB findByStoredName(String storedName);
+
+    List<FileDB> findByProjectId(Integer projectId, Pageable pageable);
+
+    List<FileDB> findByProjectIdAndFileType(Integer projectId, FileDB.FileType fileType, Pageable pageable);
 }

<|original_code|>
package com.sajo.teamkerbell.repository;

import com.sajo.teamkerbell.entity.FileDB;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * Created by seongahjo on 2016. 7. 2..
 */
@Repository
public interface FileDBRepository extends JpaRepository<FileDB, Integer> {
    FileDB findByStoredName(String storedName);
}

<|edits_diff|>
--- src/main/java/com/sajo/teamkerbell/repository/FileDBRepository.java
+++ src/main/java/com/sajo/teamkerbell/repository/FileDBRepository.java
@@ -1,8 +1,11 @@
 package com.sajo.teamkerbell.repository;

 import com.sajo.teamkerbell.entity.FileDB;
+import org.springframework.data.domain.Pageable;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.stereotype.Repository;
+
+import java.util.List;

 /**
  * Created by seongahjo on 2016. 7. 2..
<|current_version|>
package com.sajo.teamkerbell.repository;

import com.sajo.teamkerbell.entity.FileDB;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by seongahjo on 2016. 7. 2..
 */
@Repository
public interface FileDBRepository extends JpaRepository<FileDB, Integer> {
    FileDB findByStoredName(String storedName);
}

<|next_version|>
package com.sajo.teamkerbell.repository;

import com.sajo.teamkerbell.entity.FileDB;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by seongahjo on 2016. 7. 2..
 */
@Repository
public interface FileDBRepository extends JpaRepository<FileDB, Integer> {
    FileDB findByStoredName(String storedName);

    List<FileDB> findByProjectId(Integer projectId, Pageable pageable);

    List<FileDB> findByProjectIdAndFileType(Integer projectId, FileDB.FileType fileType, Pageable pageable);
}


Exclude the ASM package from being transformed

--- java/squeek/spiceoflife/asm/ASMPlugin.java
+++ java/squeek/spiceoflife/asm/ASMPlugin.java
@@ -2,7 +2,9 @@

 import java.util.Map;
 import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
+import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;

+@TransformerExclusions("squeek.spiceoflife.asm")
 public class ASMPlugin implements IFMLLoadingPlugin
 {
 	@Override

<|original_code|>
package squeek.spiceoflife.asm;

import java.util.Map;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

public class ASMPlugin implements IFMLLoadingPlugin
{
	@Override
	public String[] getASMTransformerClass()
	{
		return new String[]{ClassTransformer.class.getName()};
	}

	@Override
	public String getModContainerClass()
	{
		return null;
	}

	@Override
	public String getSetupClass()
	{
		return null;
	}

	@Override
	public void injectData(Map<String, Object> data)
	{
	}
}

<|edits_diff|>
--- java/squeek/spiceoflife/asm/ASMPlugin.java
+++ java/squeek/spiceoflife/asm/ASMPlugin.java
@@ -2,6 +2,7 @@

 import java.util.Map;
 import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
+import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;

 public class ASMPlugin implements IFMLLoadingPlugin
 {
<|current_version|>
package squeek.spiceoflife.asm;

import java.util.Map;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;

public class ASMPlugin implements IFMLLoadingPlugin
{
	@Override
	public String[] getASMTransformerClass()
	{
		return new String[]{ClassTransformer.class.getName()};
	}

	@Override
	public String getModContainerClass()
	{
		return null;
	}

	@Override
	public String getSetupClass()
	{
		return null;
	}

	@Override
	public void injectData(Map<String, Object> data)
	{
	}
}

<|next_version|>
package squeek.spiceoflife.asm;

import java.util.Map;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;

@TransformerExclusions("squeek.spiceoflife.asm")
public class ASMPlugin implements IFMLLoadingPlugin
{
	@Override
	public String[] getASMTransformerClass()
	{
		return new String[]{ClassTransformer.class.getName()};
	}

	@Override
	public String getModContainerClass()
	{
		return null;
	}

	@Override
	public String getSetupClass()
	{
		return null;
	}

	@Override
	public void injectData(Map<String, Object> data)
	{
	}
}


Fix missing @Test annotations for JUnit tests.

Forgot to add the annotations when upgrading to JUnit 4.

--- src/test/java/net/sf/commonclipse/CCPluginPreferencesTest.java
+++ src/test/java/net/sf/commonclipse/CCPluginPreferencesTest.java
@@ -5,6 +5,8 @@
 import static org.junit.Assert.assertThat;

 import java.util.regex.Pattern;
+
+import org.junit.Test;

 /**
  * Tests for CCPluginPreferences.
@@ -17,6 +19,7 @@
     /**
      * test the conversion from an array of strings to a regexp.
      */
+    @Test
     public void testRegexpConversion()
     {
         Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
@@ -26,6 +29,7 @@
     /**
      * test the conversion from an array of strings to a regexp.
      */
+    @Test
     public void testEmptyRegexpConversion()
     {
         Pattern regexp = CCPluginPreferences.generateRegExp("");
@@ -37,6 +41,7 @@
     /**
      * test the conversion from an array of strings to a regexp.
      */
+    @Test
     public void testNullRegexpConversion()
     {
         Pattern regexp = CCPluginPreferences.generateRegExp(null);

<|original_code|>
package net.sf.commonclipse;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

import java.util.regex.Pattern;

/**
 * Tests for CCPluginPreferences.
 * @author fgiust
 * @version $Revision$ ($Author$)
 */
public class CCPluginPreferencesTest
{

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
        assertThat(regexp.pattern(), equalTo("(^log$)|(^test.u.$)|(^done*$)"));
    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testEmptyRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("");
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());

    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testNullRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp(null);
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());
    }

}

<|edits_diff|>
--- src/test/java/net/sf/commonclipse/CCPluginPreferencesTest.java
+++ src/test/java/net/sf/commonclipse/CCPluginPreferencesTest.java
@@ -5,6 +5,8 @@
 import static org.junit.Assert.assertThat;

 import java.util.regex.Pattern;
+
+import org.junit.Test;

 /**
  * Tests for CCPluginPreferences.
@@ -17,6 +19,7 @@
     /**
      * test the conversion from an array of strings to a regexp.
      */
+    @Test
     public void testRegexpConversion()
     {
         Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
@@ -26,6 +29,7 @@
     /**
      * test the conversion from an array of strings to a regexp.
      */
+    @Test
     public void testEmptyRegexpConversion()
     {
         Pattern regexp = CCPluginPreferences.generateRegExp("");
<|current_version|>
package net.sf.commonclipse;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

import java.util.regex.Pattern;

import org.junit.Test;

/**
 * Tests for CCPluginPreferences.
 * @author fgiust
 * @version $Revision$ ($Author$)
 */
public class CCPluginPreferencesTest
{

    /**
     * test the conversion from an array of strings to a regexp.
     */
    @Test
    public void testRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
        assertThat(regexp.pattern(), equalTo("(^log$)|(^test.u.$)|(^done*$)"));
    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    @Test
    public void testEmptyRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("");
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());

    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    public void testNullRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp(null);
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());
    }

}

<|next_version|>
package net.sf.commonclipse;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;

import java.util.regex.Pattern;

import org.junit.Test;

/**
 * Tests for CCPluginPreferences.
 * @author fgiust
 * @version $Revision$ ($Author$)
 */
public class CCPluginPreferencesTest
{

    /**
     * test the conversion from an array of strings to a regexp.
     */
    @Test
    public void testRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("log;test?u?;done*");
        assertThat(regexp.pattern(), equalTo("(^log$)|(^test.u.$)|(^done*$)"));
    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    @Test
    public void testEmptyRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp("");
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());

    }

    /**
     * test the conversion from an array of strings to a regexp.
     */
    @Test
    public void testNullRegexpConversion()
    {
        Pattern regexp = CCPluginPreferences.generateRegExp(null);
        assertFalse(regexp.matcher("").matches());
        assertFalse(regexp.matcher("a").matches());
    }

}


Make sure the StartupEvent is fired after the runtime config is set

--- extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LifecycleEventsBuildStep.java
+++ extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LifecycleEventsBuildStep.java
@@ -6,13 +6,16 @@

 import io.quarkus.arc.runtime.ArcRecorder;
 import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.Consume;
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.ApplicationStartBuildItem;
+import io.quarkus.deployment.builditem.RuntimeConfigSetupCompleteBuildItem;
 import io.quarkus.deployment.builditem.ServiceStartBuildItem;
 import io.quarkus.deployment.builditem.ShutdownContextBuildItem;

 public class LifecycleEventsBuildStep {

+    @Consume(RuntimeConfigSetupCompleteBuildItem.class)
     @BuildStep
     @Record(RUNTIME_INIT)
     ApplicationStartBuildItem startupEvent(ArcRecorder recorder,

<|original_code|>
package io.quarkus.arc.deployment;

import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;

import java.util.List;

import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationStartBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;

public class LifecycleEventsBuildStep {

    @BuildStep
    @Record(RUNTIME_INIT)
    ApplicationStartBuildItem startupEvent(ArcRecorder recorder,
            List<ServiceStartBuildItem> startList,
            BeanContainerBuildItem beanContainer,
            ShutdownContextBuildItem shutdown) {
        recorder.handleLifecycleEvents(shutdown, beanContainer.getValue());
        return new ApplicationStartBuildItem();
    }

}

<|edits_diff|>
--- extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LifecycleEventsBuildStep.java
+++ extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/LifecycleEventsBuildStep.java
@@ -6,8 +6,10 @@

 import io.quarkus.arc.runtime.ArcRecorder;
 import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.Consume;
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.ApplicationStartBuildItem;
+import io.quarkus.deployment.builditem.RuntimeConfigSetupCompleteBuildItem;
 import io.quarkus.deployment.builditem.ServiceStartBuildItem;
 import io.quarkus.deployment.builditem.ShutdownContextBuildItem;

<|current_version|>
package io.quarkus.arc.deployment;

import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;

import java.util.List;

import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationStartBuildItem;
import io.quarkus.deployment.builditem.RuntimeConfigSetupCompleteBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;

public class LifecycleEventsBuildStep {

    @BuildStep
    @Record(RUNTIME_INIT)
    ApplicationStartBuildItem startupEvent(ArcRecorder recorder,
            List<ServiceStartBuildItem> startList,
            BeanContainerBuildItem beanContainer,
            ShutdownContextBuildItem shutdown) {
        recorder.handleLifecycleEvents(shutdown, beanContainer.getValue());
        return new ApplicationStartBuildItem();
    }

}

<|next_version|>
package io.quarkus.arc.deployment;

import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT;

import java.util.List;

import io.quarkus.arc.runtime.ArcRecorder;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.Consume;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationStartBuildItem;
import io.quarkus.deployment.builditem.RuntimeConfigSetupCompleteBuildItem;
import io.quarkus.deployment.builditem.ServiceStartBuildItem;
import io.quarkus.deployment.builditem.ShutdownContextBuildItem;

public class LifecycleEventsBuildStep {

    @Consume(RuntimeConfigSetupCompleteBuildItem.class)
    @BuildStep
    @Record(RUNTIME_INIT)
    ApplicationStartBuildItem startupEvent(ArcRecorder recorder,
            List<ServiceStartBuildItem> startList,
            BeanContainerBuildItem beanContainer,
            ShutdownContextBuildItem shutdown) {
        recorder.handleLifecycleEvents(shutdown, beanContainer.getValue());
        return new ApplicationStartBuildItem();
    }

}


Make sure to allow copy if only edges are selected

--- editor-impl/src/main/java/org/cytoscape/editor/internal/CopyTaskFactory.java
+++ editor-impl/src/main/java/org/cytoscape/editor/internal/CopyTaskFactory.java
@@ -2,6 +2,7 @@

 import java.util.List;

+import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyNode;
@@ -28,6 +29,9 @@
 		List<CyNode> selNodes = CyTableUtil.getNodesInState(networkView.getModel(), CyNetwork.SELECTED, true);
 		if (selNodes != null && selNodes.size() > 0) return true;

+		List<CyEdge> selEdges = CyTableUtil.getEdgesInState(networkView.getModel(), CyNetwork.SELECTED, true);
+		if (selEdges != null && selEdges.size() > 0) return true;
+
 		return false;
 	}

<|original_code|>
package org.cytoscape.editor.internal;

import java.util.List;

import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTableUtil;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.work.TaskIterator;

public class CopyTaskFactory extends AbstractNetworkViewTaskFactory {
	final CyNetworkManager netMgr;
	final ClipboardManagerImpl clipMgr;

	public CopyTaskFactory(final ClipboardManagerImpl clipboardMgr, final CyNetworkManager netMgr) {
		this.netMgr = netMgr;
		this.clipMgr = clipboardMgr;
	}

	@Override
	public boolean isReady(CyNetworkView networkView) {
		if (!super.isReady(networkView))
			return false;

		// Make sure we've got something selected
		List<CyNode> selNodes = CyTableUtil.getNodesInState(networkView.getModel(), CyNetwork.SELECTED, true);
		if (selNodes != null && selNodes.size() > 0) return true;

		return false;
	}

	@Override
	public TaskIterator createTaskIterator(CyNetworkView networkView) {
		return new TaskIterator(new CopyTask(networkView, clipMgr));
	}
}

<|edits_diff|>
--- editor-impl/src/main/java/org/cytoscape/editor/internal/CopyTaskFactory.java
+++ editor-impl/src/main/java/org/cytoscape/editor/internal/CopyTaskFactory.java
@@ -2,6 +2,7 @@

 import java.util.List;

+import org.cytoscape.model.CyEdge;
 import org.cytoscape.model.CyNetwork;
 import org.cytoscape.model.CyNetworkManager;
 import org.cytoscape.model.CyNode;
<|current_version|>
package org.cytoscape.editor.internal;

import java.util.List;

import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTableUtil;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.work.TaskIterator;

public class CopyTaskFactory extends AbstractNetworkViewTaskFactory {
	final CyNetworkManager netMgr;
	final ClipboardManagerImpl clipMgr;

	public CopyTaskFactory(final ClipboardManagerImpl clipboardMgr, final CyNetworkManager netMgr) {
		this.netMgr = netMgr;
		this.clipMgr = clipboardMgr;
	}

	@Override
	public boolean isReady(CyNetworkView networkView) {
		if (!super.isReady(networkView))
			return false;

		// Make sure we've got something selected
		List<CyNode> selNodes = CyTableUtil.getNodesInState(networkView.getModel(), CyNetwork.SELECTED, true);
		if (selNodes != null && selNodes.size() > 0) return true;

		return false;
	}

	@Override
	public TaskIterator createTaskIterator(CyNetworkView networkView) {
		return new TaskIterator(new CopyTask(networkView, clipMgr));
	}
}

<|next_version|>
package org.cytoscape.editor.internal;

import java.util.List;

import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyTableUtil;
import org.cytoscape.task.AbstractNetworkViewTaskFactory;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.work.TaskIterator;

public class CopyTaskFactory extends AbstractNetworkViewTaskFactory {
	final CyNetworkManager netMgr;
	final ClipboardManagerImpl clipMgr;

	public CopyTaskFactory(final ClipboardManagerImpl clipboardMgr, final CyNetworkManager netMgr) {
		this.netMgr = netMgr;
		this.clipMgr = clipboardMgr;
	}

	@Override
	public boolean isReady(CyNetworkView networkView) {
		if (!super.isReady(networkView))
			return false;

		// Make sure we've got something selected
		List<CyNode> selNodes = CyTableUtil.getNodesInState(networkView.getModel(), CyNetwork.SELECTED, true);
		if (selNodes != null && selNodes.size() > 0) return true;

		List<CyEdge> selEdges = CyTableUtil.getEdgesInState(networkView.getModel(), CyNetwork.SELECTED, true);
		if (selEdges != null && selEdges.size() > 0) return true;

		return false;
	}

	@Override
	public TaskIterator createTaskIterator(CyNetworkView networkView) {
		return new TaskIterator(new CopyTask(networkView, clipMgr));
	}
}


Scale app to fit screen

Scale app to fit screen

--- boilerplate/app/src/main/java/com/example/nickj/test/MainActivity.java
+++ boilerplate/app/src/main/java/com/example/nickj/test/MainActivity.java
@@ -17,7 +17,10 @@
         super.onCreate(savedInstanceState);

         WebView webView = new WebView(this);
+        webView.setInitialScale(1);
         webView.getSettings().setJavaScriptEnabled(true);
+        webView.getSettings().setLoadWithOverviewMode(true);
+        webView.getSettings().setUseWideViewPort(true);

         AssetManager am = getApplicationContext().getAssets();

<|original_code|>
package com.example.nickj.test;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.content.res.AssetManager;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        WebView webView = new WebView(this);
        webView.getSettings().setJavaScriptEnabled(true);

        AssetManager am = getApplicationContext().getAssets();

        String indexHTML = "If you're seeing this you need an index.html";

        try {
            InputStream is = am.open("index.html");
            indexHTML = IOUtils.toString(is, "UTF-8");
        } catch (IOException e) {
            e.printStackTrace();
        }

        webView.loadDataWithBaseURL("file:///android_asset/", indexHTML, "text/html", "UTF-8", null);

        setContentView(webView);
    }
}

<|edits_diff|>
--- boilerplate/app/src/main/java/com/example/nickj/test/MainActivity.java
+++ boilerplate/app/src/main/java/com/example/nickj/test/MainActivity.java
@@ -17,6 +17,7 @@
         super.onCreate(savedInstanceState);

         WebView webView = new WebView(this);
+        webView.setInitialScale(1);
         webView.getSettings().setJavaScriptEnabled(true);

         AssetManager am = getApplicationContext().getAssets();
<|current_version|>
package com.example.nickj.test;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.content.res.AssetManager;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        WebView webView = new WebView(this);
        webView.setInitialScale(1);
        webView.getSettings().setJavaScriptEnabled(true);

        AssetManager am = getApplicationContext().getAssets();

        String indexHTML = "If you're seeing this you need an index.html";

        try {
            InputStream is = am.open("index.html");
            indexHTML = IOUtils.toString(is, "UTF-8");
        } catch (IOException e) {
            e.printStackTrace();
        }

        webView.loadDataWithBaseURL("file:///android_asset/", indexHTML, "text/html", "UTF-8", null);

        setContentView(webView);
    }
}

<|next_version|>
package com.example.nickj.test;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.content.res.AssetManager;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        WebView webView = new WebView(this);
        webView.setInitialScale(1);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setLoadWithOverviewMode(true);
        webView.getSettings().setUseWideViewPort(true);

        AssetManager am = getApplicationContext().getAssets();

        String indexHTML = "If you're seeing this you need an index.html";

        try {
            InputStream is = am.open("index.html");
            indexHTML = IOUtils.toString(is, "UTF-8");
        } catch (IOException e) {
            e.printStackTrace();
        }

        webView.loadDataWithBaseURL("file:///android_asset/", indexHTML, "text/html", "UTF-8", null);

        setContentView(webView);
    }
}


Add transactional annotation: - merge new-api branch

--- src/main/java/com/github/solairerove/woodstock/service/impl/CategoryServiceImpl.java
+++ src/main/java/com/github/solairerove/woodstock/service/impl/CategoryServiceImpl.java
@@ -6,11 +6,13 @@
 import com.github.solairerove.woodstock.service.CategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * Created by krivitski-no on 10/14/16.
  */
 @Service
+@Transactional
 public class CategoryServiceImpl implements CategoryService {

     private final CategoryRepository repository;

<|original_code|>
package com.github.solairerove.woodstock.service.impl;

import com.github.solairerove.woodstock.domain.Category;
import com.github.solairerove.woodstock.dto.CategoryDTO;
import com.github.solairerove.woodstock.repository.CategoryRepository;
import com.github.solairerove.woodstock.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by krivitski-no on 10/14/16.
 */
@Service
public class CategoryServiceImpl implements CategoryService {

    private final CategoryRepository repository;

    @Autowired
    public CategoryServiceImpl(CategoryRepository repository) {
        this.repository = repository;
    }

    @Override
    public Category create(CategoryDTO categoryDTO) {
        Category category = new Category(categoryDTO.getName());
        return repository.save(category);
    }

    @Override
    public Category get(Long id) {
        return repository.findOne(id);
    }
}

<|edits_diff|>
--- src/main/java/com/github/solairerove/woodstock/service/impl/CategoryServiceImpl.java
+++ src/main/java/com/github/solairerove/woodstock/service/impl/CategoryServiceImpl.java
@@ -6,6 +6,7 @@
 import com.github.solairerove.woodstock.service.CategoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;

 /**
  * Created by krivitski-no on 10/14/16.
<|current_version|>
package com.github.solairerove.woodstock.service.impl;

import com.github.solairerove.woodstock.domain.Category;
import com.github.solairerove.woodstock.dto.CategoryDTO;
import com.github.solairerove.woodstock.repository.CategoryRepository;
import com.github.solairerove.woodstock.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by krivitski-no on 10/14/16.
 */
@Service
public class CategoryServiceImpl implements CategoryService {

    private final CategoryRepository repository;

    @Autowired
    public CategoryServiceImpl(CategoryRepository repository) {
        this.repository = repository;
    }

    @Override
    public Category create(CategoryDTO categoryDTO) {
        Category category = new Category(categoryDTO.getName());
        return repository.save(category);
    }

    @Override
    public Category get(Long id) {
        return repository.findOne(id);
    }
}

<|next_version|>
package com.github.solairerove.woodstock.service.impl;

import com.github.solairerove.woodstock.domain.Category;
import com.github.solairerove.woodstock.dto.CategoryDTO;
import com.github.solairerove.woodstock.repository.CategoryRepository;
import com.github.solairerove.woodstock.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by krivitski-no on 10/14/16.
 */
@Service
@Transactional
public class CategoryServiceImpl implements CategoryService {

    private final CategoryRepository repository;

    @Autowired
    public CategoryServiceImpl(CategoryRepository repository) {
        this.repository = repository;
    }

    @Override
    public Category create(CategoryDTO categoryDTO) {
        Category category = new Category(categoryDTO.getName());
        return repository.save(category);
    }

    @Override
    public Category get(Long id) {
        return repository.findOne(id);
    }
}


Add new properties to ignore due to matrix.org protocol changes

--- disturber-jar/src/main/java/com/dmytrobilokha/disturber/network/dto/JoinedRoomDto.java
+++ disturber-jar/src/main/java/com/dmytrobilokha/disturber/network/dto/JoinedRoomDto.java
@@ -1,10 +1,12 @@
 package com.dmytrobilokha.disturber.network.dto;

+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;

 /**
  * The matrix Joined Room DTO
  */
+@JsonIgnoreProperties(ignoreUnknown = true)
 public class JoinedRoomDto {

     @JsonProperty(value = "unread_notifications", required = true)

<|original_code|>
package com.dmytrobilokha.disturber.network.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The matrix Joined Room DTO
 */
public class JoinedRoomDto {

    @JsonProperty(value = "unread_notifications", required = true)
    private UnreadNotificationCountsDto unreadNotificationCounts;
    @JsonProperty(value = "timeline", required = true)
    private TimelineDto timeline;
    @JsonProperty(value = "state", required = true)
    private StateDto state;
    @JsonProperty(value = "account_data", required = true)
    private AccountDataDto accountData;
    @JsonProperty(value = "ephemeral", required = true)
    private EphemeralDto ephemeral;

    public UnreadNotificationCountsDto getUnreadNotificationCounts() {
        return unreadNotificationCounts;
    }

    public void setUnreadNotificationCounts(UnreadNotificationCountsDto unreadNotificationCounts) {
        this.unreadNotificationCounts = unreadNotificationCounts;
    }

    public TimelineDto getTimeline() {
        return timeline;
    }

    public void setTimeline(TimelineDto timeline) {
        this.timeline = timeline;
    }

    public StateDto getState() {
        return state;
    }

    public void setState(StateDto state) {
        this.state = state;
    }

    public AccountDataDto getAccountData() {
        return accountData;
    }

    public void setAccountData(AccountDataDto accountData) {
        this.accountData = accountData;
    }

    public EphemeralDto getEphemeral() {
        return ephemeral;
    }

    public void setEphemeral(EphemeralDto ephemeral) {
        this.ephemeral = ephemeral;
    }

}

<|edits_diff|>
--- disturber-jar/src/main/java/com/dmytrobilokha/disturber/network/dto/JoinedRoomDto.java
+++ disturber-jar/src/main/java/com/dmytrobilokha/disturber/network/dto/JoinedRoomDto.java
@@ -1,5 +1,6 @@
 package com.dmytrobilokha.disturber.network.dto;

+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;

 /**
<|current_version|>
package com.dmytrobilokha.disturber.network.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The matrix Joined Room DTO
 */
public class JoinedRoomDto {

    @JsonProperty(value = "unread_notifications", required = true)
    private UnreadNotificationCountsDto unreadNotificationCounts;
    @JsonProperty(value = "timeline", required = true)
    private TimelineDto timeline;
    @JsonProperty(value = "state", required = true)
    private StateDto state;
    @JsonProperty(value = "account_data", required = true)
    private AccountDataDto accountData;
    @JsonProperty(value = "ephemeral", required = true)
    private EphemeralDto ephemeral;

    public UnreadNotificationCountsDto getUnreadNotificationCounts() {
        return unreadNotificationCounts;
    }

    public void setUnreadNotificationCounts(UnreadNotificationCountsDto unreadNotificationCounts) {
        this.unreadNotificationCounts = unreadNotificationCounts;
    }

    public TimelineDto getTimeline() {
        return timeline;
    }

    public void setTimeline(TimelineDto timeline) {
        this.timeline = timeline;
    }

    public StateDto getState() {
        return state;
    }

    public void setState(StateDto state) {
        this.state = state;
    }

    public AccountDataDto getAccountData() {
        return accountData;
    }

    public void setAccountData(AccountDataDto accountData) {
        this.accountData = accountData;
    }

    public EphemeralDto getEphemeral() {
        return ephemeral;
    }

    public void setEphemeral(EphemeralDto ephemeral) {
        this.ephemeral = ephemeral;
    }

}

<|next_version|>
package com.dmytrobilokha.disturber.network.dto;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The matrix Joined Room DTO
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class JoinedRoomDto {

    @JsonProperty(value = "unread_notifications", required = true)
    private UnreadNotificationCountsDto unreadNotificationCounts;
    @JsonProperty(value = "timeline", required = true)
    private TimelineDto timeline;
    @JsonProperty(value = "state", required = true)
    private StateDto state;
    @JsonProperty(value = "account_data", required = true)
    private AccountDataDto accountData;
    @JsonProperty(value = "ephemeral", required = true)
    private EphemeralDto ephemeral;

    public UnreadNotificationCountsDto getUnreadNotificationCounts() {
        return unreadNotificationCounts;
    }

    public void setUnreadNotificationCounts(UnreadNotificationCountsDto unreadNotificationCounts) {
        this.unreadNotificationCounts = unreadNotificationCounts;
    }

    public TimelineDto getTimeline() {
        return timeline;
    }

    public void setTimeline(TimelineDto timeline) {
        this.timeline = timeline;
    }

    public StateDto getState() {
        return state;
    }

    public void setState(StateDto state) {
        this.state = state;
    }

    public AccountDataDto getAccountData() {
        return accountData;
    }

    public void setAccountData(AccountDataDto accountData) {
        this.accountData = accountData;
    }

    public EphemeralDto getEphemeral() {
        return ephemeral;
    }

    public void setEphemeral(EphemeralDto ephemeral) {
        this.ephemeral = ephemeral;
    }

}


Fix canvas not restored properly

Fix canvas not restored properly

--- library/src/main/java/it/sephiroth/android/library/tooltip/TooltipBackgroundDrawable.java
+++ library/src/main/java/it/sephiroth/android/library/tooltip/TooltipBackgroundDrawable.java
@@ -28,6 +28,7 @@

     @Override
     public void draw(Canvas canvas) {
+        canvas.save();
         if (mHighlightViews != null) {
             Rect highlightRect = new Rect();
             Rect vRect = new Rect();
@@ -45,6 +46,7 @@
         }

         canvas.drawColor(mBackgroundColor);
+        canvas.restore();
     }

     @Override

<|original_code|>
package it.sephiroth.android.library.tooltip;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.view.View;

import java.util.List;

public class TooltipBackgroundDrawable extends Drawable {

    private int mBackgroundColor;

    private List<View> mHighlightViews;

    private Drawable mHighlightDrawable;

    public TooltipBackgroundDrawable(Context context, TooltipManager.Builder builder) {
        mBackgroundColor = context.getResources().getColor(builder.backgroundColorResId);
        mHighlightViews = builder.highlightViews;
        if (builder.highlightDrawableResId > 0) {
            mHighlightDrawable = context.getResources().getDrawable(builder.highlightDrawableResId);
        }
    }

    @Override
    public void draw(Canvas canvas) {
        if (mHighlightViews != null) {
            Rect highlightRect = new Rect();
            Rect vRect = new Rect();
            for(View v: mHighlightViews) {
                v.getGlobalVisibleRect(vRect);
                highlightRect.union(vRect);
            }

            if (mHighlightDrawable != null) {
                mHighlightDrawable.setBounds(highlightRect);
                mHighlightDrawable.draw(canvas);
            }

            canvas.clipRect(highlightRect, Region.Op.DIFFERENCE);
        }

        canvas.drawColor(mBackgroundColor);
    }

    @Override
    public void setAlpha(int alpha) {
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
    }

    @Override
    public int getOpacity() {
        return 0;
    }
}

<|edits_diff|>
--- library/src/main/java/it/sephiroth/android/library/tooltip/TooltipBackgroundDrawable.java
+++ library/src/main/java/it/sephiroth/android/library/tooltip/TooltipBackgroundDrawable.java
@@ -28,6 +28,7 @@

     @Override
     public void draw(Canvas canvas) {
+        canvas.save();
         if (mHighlightViews != null) {
             Rect highlightRect = new Rect();
             Rect vRect = new Rect();
<|current_version|>
package it.sephiroth.android.library.tooltip;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.view.View;

import java.util.List;

public class TooltipBackgroundDrawable extends Drawable {

    private int mBackgroundColor;

    private List<View> mHighlightViews;

    private Drawable mHighlightDrawable;

    public TooltipBackgroundDrawable(Context context, TooltipManager.Builder builder) {
        mBackgroundColor = context.getResources().getColor(builder.backgroundColorResId);
        mHighlightViews = builder.highlightViews;
        if (builder.highlightDrawableResId > 0) {
            mHighlightDrawable = context.getResources().getDrawable(builder.highlightDrawableResId);
        }
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.save();
        if (mHighlightViews != null) {
            Rect highlightRect = new Rect();
            Rect vRect = new Rect();
            for(View v: mHighlightViews) {
                v.getGlobalVisibleRect(vRect);
                highlightRect.union(vRect);
            }

            if (mHighlightDrawable != null) {
                mHighlightDrawable.setBounds(highlightRect);
                mHighlightDrawable.draw(canvas);
            }

            canvas.clipRect(highlightRect, Region.Op.DIFFERENCE);
        }

        canvas.drawColor(mBackgroundColor);
    }

    @Override
    public void setAlpha(int alpha) {
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
    }

    @Override
    public int getOpacity() {
        return 0;
    }
}

<|next_version|>
package it.sephiroth.android.library.tooltip;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.view.View;

import java.util.List;

public class TooltipBackgroundDrawable extends Drawable {

    private int mBackgroundColor;

    private List<View> mHighlightViews;

    private Drawable mHighlightDrawable;

    public TooltipBackgroundDrawable(Context context, TooltipManager.Builder builder) {
        mBackgroundColor = context.getResources().getColor(builder.backgroundColorResId);
        mHighlightViews = builder.highlightViews;
        if (builder.highlightDrawableResId > 0) {
            mHighlightDrawable = context.getResources().getDrawable(builder.highlightDrawableResId);
        }
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.save();
        if (mHighlightViews != null) {
            Rect highlightRect = new Rect();
            Rect vRect = new Rect();
            for(View v: mHighlightViews) {
                v.getGlobalVisibleRect(vRect);
                highlightRect.union(vRect);
            }

            if (mHighlightDrawable != null) {
                mHighlightDrawable.setBounds(highlightRect);
                mHighlightDrawable.draw(canvas);
            }

            canvas.clipRect(highlightRect, Region.Op.DIFFERENCE);
        }

        canvas.drawColor(mBackgroundColor);
        canvas.restore();
    }

    @Override
    public void setAlpha(int alpha) {
    }

    @Override
    public void setColorFilter(ColorFilter cf) {
    }

    @Override
    public int getOpacity() {
        return 0;
    }
}


Add class path to asm injector

Add class path to asm injector

--- src/main/java/reborncore/mixin/implementations/asmInjector/ASMInjectorSetupClass.java
+++ src/main/java/reborncore/mixin/implementations/asmInjector/ASMInjectorSetupClass.java
@@ -1,8 +1,10 @@
 package reborncore.mixin.implementations.asmInjector;

+import javassist.LoaderClassPath;
 import org.apache.logging.log4j.LogManager;
 import reborncore.mixin.MixinManager;
 import reborncore.mixin.implementations.prebaker.MixinPrebaker;
+import reborncore.mixin.transformer.MixinTransformer;

 /**
  * Used by asm injector to load mixins into a jar at build time
@@ -14,6 +16,7 @@
 		MixinManager.logger.info("Loading mixin manager");
 		MixinManager.logger.info("Using dummy remapper");
 		MixinManager.mixinRemaper = new MixinPrebaker.DummyRemapper();
+		MixinTransformer.cp.appendClassPath(new LoaderClassPath(ASMInjectorSetupClass.class.getClassLoader()));
 		MixinManager.load();
 	}

<|original_code|>
package reborncore.mixin.implementations.asmInjector;

import org.apache.logging.log4j.LogManager;
import reborncore.mixin.MixinManager;
import reborncore.mixin.implementations.prebaker.MixinPrebaker;

/**
 * Used by asm injector to load mixins into a jar at build time
 */
public class ASMInjectorSetupClass {

	public static void main(){
		MixinManager.logger = LogManager.getLogger();
		MixinManager.logger.info("Loading mixin manager");
		MixinManager.logger.info("Using dummy remapper");
		MixinManager.mixinRemaper = new MixinPrebaker.DummyRemapper();
		MixinManager.load();
	}

}

<|edits_diff|>
--- src/main/java/reborncore/mixin/implementations/asmInjector/ASMInjectorSetupClass.java
+++ src/main/java/reborncore/mixin/implementations/asmInjector/ASMInjectorSetupClass.java
@@ -1,8 +1,10 @@
 package reborncore.mixin.implementations.asmInjector;

+import javassist.LoaderClassPath;
 import org.apache.logging.log4j.LogManager;
 import reborncore.mixin.MixinManager;
 import reborncore.mixin.implementations.prebaker.MixinPrebaker;
+import reborncore.mixin.transformer.MixinTransformer;

 /**
  * Used by asm injector to load mixins into a jar at build time
<|current_version|>
package reborncore.mixin.implementations.asmInjector;

import javassist.LoaderClassPath;
import org.apache.logging.log4j.LogManager;
import reborncore.mixin.MixinManager;
import reborncore.mixin.implementations.prebaker.MixinPrebaker;
import reborncore.mixin.transformer.MixinTransformer;

/**
 * Used by asm injector to load mixins into a jar at build time
 */
public class ASMInjectorSetupClass {

	public static void main(){
		MixinManager.logger = LogManager.getLogger();
		MixinManager.logger.info("Loading mixin manager");
		MixinManager.logger.info("Using dummy remapper");
		MixinManager.mixinRemaper = new MixinPrebaker.DummyRemapper();
		MixinManager.load();
	}

}

<|next_version|>
package reborncore.mixin.implementations.asmInjector;

import javassist.LoaderClassPath;
import org.apache.logging.log4j.LogManager;
import reborncore.mixin.MixinManager;
import reborncore.mixin.implementations.prebaker.MixinPrebaker;
import reborncore.mixin.transformer.MixinTransformer;

/**
 * Used by asm injector to load mixins into a jar at build time
 */
public class ASMInjectorSetupClass {

	public static void main(){
		MixinManager.logger = LogManager.getLogger();
		MixinManager.logger.info("Loading mixin manager");
		MixinManager.logger.info("Using dummy remapper");
		MixinManager.mixinRemaper = new MixinPrebaker.DummyRemapper();
		MixinTransformer.cp.appendClassPath(new LoaderClassPath(ASMInjectorSetupClass.class.getClassLoader()));
		MixinManager.load();
	}

}


Make profiles list null by default

Make profiles list null by default

--- jersey/src/main/java/com/example/Contact.java
+++ jersey/src/main/java/com/example/Contact.java
@@ -1,5 +1,6 @@
 package com.example;

+import java.util.ArrayList;
 import javax.xml.bind.annotation.XmlRootElement;

 @XmlRootElement
@@ -11,6 +12,7 @@
   public String middleName;
   public String dateOfBirth;
   public Integer sex;
+  public ArrayList<Profile> profiles;

   public Contact() {
     this.id = null;
@@ -20,6 +22,7 @@
     this.middleName = null;
     this.dateOfBirth = null;
     this.sex = null;
+    this.profiles = null;
   }

   public Contact(
@@ -38,5 +41,6 @@
     this.middleName = middleName;
     this.dateOfBirth = dateOfBirth;
     this.sex = sex;
+    this.profiles = null;
   }
 }

<|original_code|>
package com.example;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Contact {
  public Integer id;
  public String email;
  public String firstName;
  public String lastName;
  public String middleName;
  public String dateOfBirth;
  public Integer sex;

  public Contact() {
    this.id = null;
    this.email = null;
    this.firstName = null;
    this.lastName = null;
    this.middleName = null;
    this.dateOfBirth = null;
    this.sex = null;
  }

  public Contact(
    Integer id,
    String email,
    String firstName,
    String lastName,
    String middleName,
    String dateOfBirth,
    Integer sex
  ) {
    this.id = id;
    this.email = email;
    this.firstName = firstName;
    this.lastName = lastName;
    this.middleName = middleName;
    this.dateOfBirth = dateOfBirth;
    this.sex = sex;
  }
}

<|edits_diff|>
--- jersey/src/main/java/com/example/Contact.java
+++ jersey/src/main/java/com/example/Contact.java
@@ -1,5 +1,6 @@
 package com.example;

+import java.util.ArrayList;
 import javax.xml.bind.annotation.XmlRootElement;

 @XmlRootElement
@@ -11,6 +12,7 @@
   public String middleName;
   public String dateOfBirth;
   public Integer sex;
+  public ArrayList<Profile> profiles;

   public Contact() {
     this.id = null;
@@ -20,6 +22,7 @@
     this.middleName = null;
     this.dateOfBirth = null;
     this.sex = null;
+    this.profiles = null;
   }

   public Contact(
<|current_version|>
package com.example;

import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Contact {
  public Integer id;
  public String email;
  public String firstName;
  public String lastName;
  public String middleName;
  public String dateOfBirth;
  public Integer sex;
  public ArrayList<Profile> profiles;

  public Contact() {
    this.id = null;
    this.email = null;
    this.firstName = null;
    this.lastName = null;
    this.middleName = null;
    this.dateOfBirth = null;
    this.sex = null;
    this.profiles = null;
  }

  public Contact(
    Integer id,
    String email,
    String firstName,
    String lastName,
    String middleName,
    String dateOfBirth,
    Integer sex
  ) {
    this.id = id;
    this.email = email;
    this.firstName = firstName;
    this.lastName = lastName;
    this.middleName = middleName;
    this.dateOfBirth = dateOfBirth;
    this.sex = sex;
  }
}

<|next_version|>
package com.example;

import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Contact {
  public Integer id;
  public String email;
  public String firstName;
  public String lastName;
  public String middleName;
  public String dateOfBirth;
  public Integer sex;
  public ArrayList<Profile> profiles;

  public Contact() {
    this.id = null;
    this.email = null;
    this.firstName = null;
    this.lastName = null;
    this.middleName = null;
    this.dateOfBirth = null;
    this.sex = null;
    this.profiles = null;
  }

  public Contact(
    Integer id,
    String email,
    String firstName,
    String lastName,
    String middleName,
    String dateOfBirth,
    Integer sex
  ) {
    this.id = id;
    this.email = email;
    this.firstName = firstName;
    this.lastName = lastName;
    this.middleName = middleName;
    this.dateOfBirth = dateOfBirth;
    this.sex = sex;
    this.profiles = null;
  }
}


feat: Put graph activity intent extras into fragment's arguments

--- app/src/main/java/com/sam_chordas/android/stockhawk/ui/LineGraphActivity.java
+++ app/src/main/java/com/sam_chordas/android/stockhawk/ui/LineGraphActivity.java
@@ -15,7 +15,12 @@
         setContentView(R.layout.activity_line_graph);

         if (savedInstanceState == null) {
+            Bundle arguments = new Bundle();
+            arguments.putString(getString(R.string.line_graph_extra),
+                    getIntent().getStringExtra(getString(R.string.line_graph_extra)));
+
             LineGraphFragment fragment = new LineGraphFragment();
+            fragment.setArguments(arguments);

             getSupportFragmentManager().beginTransaction()
                     .add(R.id.stock_detail_container, fragment)

<|original_code|>
package com.sam_chordas.android.stockhawk.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.sam_chordas.android.stockhawk.R;

/**
 * Created by frano on 21/03/2016.
 */
public class LineGraphActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_line_graph);

        if (savedInstanceState == null) {
            LineGraphFragment fragment = new LineGraphFragment();

            getSupportFragmentManager().beginTransaction()
                    .add(R.id.stock_detail_container, fragment)
                    .commit();
        }
    }
}

<|edits_diff|>
--- app/src/main/java/com/sam_chordas/android/stockhawk/ui/LineGraphActivity.java
+++ app/src/main/java/com/sam_chordas/android/stockhawk/ui/LineGraphActivity.java
@@ -15,6 +15,10 @@
         setContentView(R.layout.activity_line_graph);

         if (savedInstanceState == null) {
+            Bundle arguments = new Bundle();
+            arguments.putString(getString(R.string.line_graph_extra),
+                    getIntent().getStringExtra(getString(R.string.line_graph_extra)));
+
             LineGraphFragment fragment = new LineGraphFragment();

             getSupportFragmentManager().beginTransaction()
<|current_version|>
package com.sam_chordas.android.stockhawk.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.sam_chordas.android.stockhawk.R;

/**
 * Created by frano on 21/03/2016.
 */
public class LineGraphActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_line_graph);

        if (savedInstanceState == null) {
            Bundle arguments = new Bundle();
            arguments.putString(getString(R.string.line_graph_extra),
                    getIntent().getStringExtra(getString(R.string.line_graph_extra)));

            LineGraphFragment fragment = new LineGraphFragment();

            getSupportFragmentManager().beginTransaction()
                    .add(R.id.stock_detail_container, fragment)
                    .commit();
        }
    }
}

<|next_version|>
package com.sam_chordas.android.stockhawk.ui;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.sam_chordas.android.stockhawk.R;

/**
 * Created by frano on 21/03/2016.
 */
public class LineGraphActivity extends AppCompatActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_line_graph);

        if (savedInstanceState == null) {
            Bundle arguments = new Bundle();
            arguments.putString(getString(R.string.line_graph_extra),
                    getIntent().getStringExtra(getString(R.string.line_graph_extra)));

            LineGraphFragment fragment = new LineGraphFragment();
            fragment.setArguments(arguments);

            getSupportFragmentManager().beginTransaction()
                    .add(R.id.stock_detail_container, fragment)
                    .commit();
        }
    }
}


Set a default kick reason if nothing is specified

--- bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeLoginSource.java
+++ bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeLoginSource.java
@@ -4,6 +4,8 @@

 import java.net.InetSocketAddress;

+import net.md_5.bungee.api.ChatColor;
+import net.md_5.bungee.api.chat.ComponentBuilder;
 import net.md_5.bungee.api.chat.TextComponent;
 import net.md_5.bungee.api.connection.PendingConnection;
 import net.md_5.bungee.api.event.PreLoginEvent;
@@ -29,6 +31,8 @@

         if (message != null)
             preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
+        else
+            preLoginEvent.setCancelReason(new ComponentBuilder("Kicked").color(ChatColor.WHITE).create());
     }

     @Override

<|original_code|>
package com.github.games647.fastlogin.bungee;

import com.github.games647.fastlogin.core.shared.LoginSource;

import java.net.InetSocketAddress;

import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.event.PreLoginEvent;

public class BungeeLoginSource implements LoginSource {

    private final PendingConnection connection;
    private final PreLoginEvent preLoginEvent;

    public BungeeLoginSource(PendingConnection connection, PreLoginEvent preLoginEvent) {
        this.connection = connection;
        this.preLoginEvent = preLoginEvent;
    }

    @Override
    public void setOnlineMode() {
        connection.setOnlineMode(true);
    }

    @Override
    public void kick(String message) {
        preLoginEvent.setCancelled(true);

        if (message != null)
            preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
    }

    @Override
    public InetSocketAddress getAddress() {
        return connection.getAddress();
    }

    public PendingConnection getConnection() {
        return connection;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + '{' +
                "connection=" + connection +
                '}';
    }
}

<|edits_diff|>
--- bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeLoginSource.java
+++ bungee/src/main/java/com/github/games647/fastlogin/bungee/BungeeLoginSource.java
@@ -4,6 +4,8 @@

 import java.net.InetSocketAddress;

+import net.md_5.bungee.api.ChatColor;
+import net.md_5.bungee.api.chat.ComponentBuilder;
 import net.md_5.bungee.api.chat.TextComponent;
 import net.md_5.bungee.api.connection.PendingConnection;
 import net.md_5.bungee.api.event.PreLoginEvent;
<|current_version|>
package com.github.games647.fastlogin.bungee;

import com.github.games647.fastlogin.core.shared.LoginSource;

import java.net.InetSocketAddress;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.event.PreLoginEvent;

public class BungeeLoginSource implements LoginSource {

    private final PendingConnection connection;
    private final PreLoginEvent preLoginEvent;

    public BungeeLoginSource(PendingConnection connection, PreLoginEvent preLoginEvent) {
        this.connection = connection;
        this.preLoginEvent = preLoginEvent;
    }

    @Override
    public void setOnlineMode() {
        connection.setOnlineMode(true);
    }

    @Override
    public void kick(String message) {
        preLoginEvent.setCancelled(true);

        if (message != null)
            preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
    }

    @Override
    public InetSocketAddress getAddress() {
        return connection.getAddress();
    }

    public PendingConnection getConnection() {
        return connection;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + '{' +
                "connection=" + connection +
                '}';
    }
}

<|next_version|>
package com.github.games647.fastlogin.bungee;

import com.github.games647.fastlogin.core.shared.LoginSource;

import java.net.InetSocketAddress;

import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.connection.PendingConnection;
import net.md_5.bungee.api.event.PreLoginEvent;

public class BungeeLoginSource implements LoginSource {

    private final PendingConnection connection;
    private final PreLoginEvent preLoginEvent;

    public BungeeLoginSource(PendingConnection connection, PreLoginEvent preLoginEvent) {
        this.connection = connection;
        this.preLoginEvent = preLoginEvent;
    }

    @Override
    public void setOnlineMode() {
        connection.setOnlineMode(true);
    }

    @Override
    public void kick(String message) {
        preLoginEvent.setCancelled(true);

        if (message != null)
            preLoginEvent.setCancelReason(TextComponent.fromLegacyText(message));
        else
            preLoginEvent.setCancelReason(new ComponentBuilder("Kicked").color(ChatColor.WHITE).create());
    }

    @Override
    public InetSocketAddress getAddress() {
        return connection.getAddress();
    }

    public PendingConnection getConnection() {
        return connection;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName() + '{' +
                "connection=" + connection +
                '}';
    }
}


Add scienceos init to command line interface

This shouldn't really be there but is currently necessary so that
references work before the simulation starts (this is for people
entering their homes).

--- src/main/java/uk/ac/eeci/CommandLineInterface.java
+++ src/main/java/uk/ac/eeci/CommandLineInterface.java
@@ -1,6 +1,8 @@
 package uk.ac.eeci;

 import io.improbable.scienceos.Conductor;
+import io.improbable.scienceos.Reference;
+import io.improbable.scienceos.WorkerPool;
 import org.apache.commons.cli.*;

 public class CommandLineInterface {
@@ -41,6 +43,8 @@
     }

     private void run() {
+        Reference.pool = new WorkerPool(4); // FIXME shouldnt be here
+        Reference.pool.setCurrentExecutor(Reference.pool.main); // FIXME shouldnt be here
         CitySimulation citySimulation = ScenarioBuilder.readScenario(this.inputFilePath, this.outputFilePath);
         new Conductor(citySimulation).run();
     }

<|original_code|>
package uk.ac.eeci;

import io.improbable.scienceos.Conductor;
import org.apache.commons.cli.*;

public class CommandLineInterface {

    private String inputFilePath;
    private String outputFilePath;

    public static void main(String ... args) {

        Options options = new Options();

        Option input = new Option("i", "input", true, "file path to scenario db");
        input.setRequired(true);
        options.addOption(input);

        Option output = new Option("o", "output", true, "file path for output db");
        output.setRequired(true);
        options.addOption(output);

        CommandLineParser parser = new DefaultParser();
        HelpFormatter formatter = new HelpFormatter();
        CommandLine cmd;

        try {
            cmd = parser.parse(options, args);
        } catch (ParseException e) {
            System.out.println(e.getMessage());
            formatter.printHelp("energy-agents", options);

            System.exit(1);
            return;
        }

        CommandLineInterface cli = new CommandLineInterface();
        cli.inputFilePath = cmd.getOptionValue("input");
        cli.outputFilePath = cmd.getOptionValue("output");
        cli.run();
    }

    private void run() {
        CitySimulation citySimulation = ScenarioBuilder.readScenario(this.inputFilePath, this.outputFilePath);
        new Conductor(citySimulation).run();
    }
}

<|edits_diff|>
--- src/main/java/uk/ac/eeci/CommandLineInterface.java
+++ src/main/java/uk/ac/eeci/CommandLineInterface.java
@@ -1,6 +1,8 @@
 package uk.ac.eeci;

 import io.improbable.scienceos.Conductor;
+import io.improbable.scienceos.Reference;
+import io.improbable.scienceos.WorkerPool;
 import org.apache.commons.cli.*;

 public class CommandLineInterface {
<|current_version|>
package uk.ac.eeci;

import io.improbable.scienceos.Conductor;
import io.improbable.scienceos.Reference;
import io.improbable.scienceos.WorkerPool;
import org.apache.commons.cli.*;

public class CommandLineInterface {

    private String inputFilePath;
    private String outputFilePath;

    public static void main(String ... args) {

        Options options = new Options();

        Option input = new Option("i", "input", true, "file path to scenario db");
        input.setRequired(true);
        options.addOption(input);

        Option output = new Option("o", "output", true, "file path for output db");
        output.setRequired(true);
        options.addOption(output);

        CommandLineParser parser = new DefaultParser();
        HelpFormatter formatter = new HelpFormatter();
        CommandLine cmd;

        try {
            cmd = parser.parse(options, args);
        } catch (ParseException e) {
            System.out.println(e.getMessage());
            formatter.printHelp("energy-agents", options);

            System.exit(1);
            return;
        }

        CommandLineInterface cli = new CommandLineInterface();
        cli.inputFilePath = cmd.getOptionValue("input");
        cli.outputFilePath = cmd.getOptionValue("output");
        cli.run();
    }

    private void run() {
        CitySimulation citySimulation = ScenarioBuilder.readScenario(this.inputFilePath, this.outputFilePath);
        new Conductor(citySimulation).run();
    }
}

<|next_version|>
package uk.ac.eeci;

import io.improbable.scienceos.Conductor;
import io.improbable.scienceos.Reference;
import io.improbable.scienceos.WorkerPool;
import org.apache.commons.cli.*;

public class CommandLineInterface {

    private String inputFilePath;
    private String outputFilePath;

    public static void main(String ... args) {

        Options options = new Options();

        Option input = new Option("i", "input", true, "file path to scenario db");
        input.setRequired(true);
        options.addOption(input);

        Option output = new Option("o", "output", true, "file path for output db");
        output.setRequired(true);
        options.addOption(output);

        CommandLineParser parser = new DefaultParser();
        HelpFormatter formatter = new HelpFormatter();
        CommandLine cmd;

        try {
            cmd = parser.parse(options, args);
        } catch (ParseException e) {
            System.out.println(e.getMessage());
            formatter.printHelp("energy-agents", options);

            System.exit(1);
            return;
        }

        CommandLineInterface cli = new CommandLineInterface();
        cli.inputFilePath = cmd.getOptionValue("input");
        cli.outputFilePath = cmd.getOptionValue("output");
        cli.run();
    }

    private void run() {
        Reference.pool = new WorkerPool(4); // FIXME shouldnt be here
        Reference.pool.setCurrentExecutor(Reference.pool.main); // FIXME shouldnt be here
        CitySimulation citySimulation = ScenarioBuilder.readScenario(this.inputFilePath, this.outputFilePath);
        new Conductor(citySimulation).run();
    }
}


Include task fields into taskcard - index,task,tag,due,priority

--- src/main/java/seedu/address/ui/TaskCard.java
+++ src/main/java/seedu/address/ui/TaskCard.java
@@ -4,6 +4,7 @@
 import javafx.scene.Node;
 import javafx.scene.control.Label;
 import javafx.scene.layout.HBox;
+import javafx.scene.paint.Color;
 import seedu.address.model.task.ReadOnlyTask;

 public class TaskCard extends UiPart{
@@ -47,6 +48,7 @@
         dbt.setText(task.getDueByTime().getFriendlyString());
         priority.setText(task.getPriority().value);
         tags.setText(task.tagsString());
+        tags.setTextFill(Color.GOLD);
     }

     public HBox getLayout() {

<|original_code|>
package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import seedu.address.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label detail;
    @FXML
    private Label id;
    @FXML
    private Label dbd;
    @FXML
    private Label dbt;
    @FXML
    private Label priority;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        detail.setText(task.getDetail().details);
        id.setText(displayedIndex + ". ");
        dbd.setText(task.getDueByDate().getFriendlyString());
        dbt.setText(task.getDueByTime().getFriendlyString());
        priority.setText(task.getPriority().value);
        tags.setText(task.tagsString());
    }

    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}

<|edits_diff|>
--- src/main/java/seedu/address/ui/TaskCard.java
+++ src/main/java/seedu/address/ui/TaskCard.java
@@ -4,6 +4,7 @@
 import javafx.scene.Node;
 import javafx.scene.control.Label;
 import javafx.scene.layout.HBox;
+import javafx.scene.paint.Color;
 import seedu.address.model.task.ReadOnlyTask;

 public class TaskCard extends UiPart{
<|current_version|>
package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import seedu.address.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label detail;
    @FXML
    private Label id;
    @FXML
    private Label dbd;
    @FXML
    private Label dbt;
    @FXML
    private Label priority;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        detail.setText(task.getDetail().details);
        id.setText(displayedIndex + ". ");
        dbd.setText(task.getDueByDate().getFriendlyString());
        dbt.setText(task.getDueByTime().getFriendlyString());
        priority.setText(task.getPriority().value);
        tags.setText(task.tagsString());
    }

    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}

<|next_version|>
package seedu.address.ui;

import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import seedu.address.model.task.ReadOnlyTask;

public class TaskCard extends UiPart{

    private static final String FXML = "TaskListCard.fxml";

    @FXML
    private HBox cardPane;
    @FXML
    private Label detail;
    @FXML
    private Label id;
    @FXML
    private Label dbd;
    @FXML
    private Label dbt;
    @FXML
    private Label priority;
    @FXML
    private Label tags;

    private ReadOnlyTask task;
    private int displayedIndex;

    public TaskCard(){

    }

    public static TaskCard load(ReadOnlyTask task, int displayedIndex){
        TaskCard card = new TaskCard();
        card.task = task;
        card.displayedIndex = displayedIndex;
        return UiPartLoader.loadUiPart(card);
    }

    @FXML
    public void initialize() {
        detail.setText(task.getDetail().details);
        id.setText(displayedIndex + ". ");
        dbd.setText(task.getDueByDate().getFriendlyString());
        dbt.setText(task.getDueByTime().getFriendlyString());
        priority.setText(task.getPriority().value);
        tags.setText(task.tagsString());
        tags.setTextFill(Color.GOLD);
    }

    public HBox getLayout() {
        return cardPane;
    }

    @Override
    public void setNode(Node node) {
        cardPane = (HBox)node;
    }

    @Override
    public String getFxmlPath() {
        return FXML;
    }
}