Add newline and add missing enhance annotation.

--- byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ArrayTypeMatcher.java
+++ byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ArrayTypeMatcher.java
@@ -1,5 +1,6 @@
 package net.bytebuddy.matcher;

+import net.bytebuddy.build.HashCodeAndEqualsPlugin;
 import net.bytebuddy.description.type.TypeDefinition;

 /**
@@ -7,6 +8,7 @@
  *
  * @param <T> The type of the matched entity.
  */
+@HashCodeAndEqualsPlugin.Enhance
 public class ArrayTypeMatcher<T extends TypeDefinition> extends ElementMatcher.Junction.AbstractBase<T> {

     /**

<|original_code|>
package net.bytebuddy.matcher;

import net.bytebuddy.description.type.TypeDefinition;

/**
 * Matches an enumeration type.
 *
 * @param <T> The type of the matched entity.
 */
public class ArrayTypeMatcher<T extends TypeDefinition> extends ElementMatcher.Junction.AbstractBase<T> {

    /**
     * {@inheritDoc}
     */
    public boolean matches(T target) {
        return target.isArray();
    }

    @Override
    public String toString() {
        return "isArray()";
    }
}
<|edits_diff|>
--- byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ArrayTypeMatcher.java
+++ byte-buddy-dep/src/main/java/net/bytebuddy/matcher/ArrayTypeMatcher.java
@@ -1,5 +1,6 @@
 package net.bytebuddy.matcher;

+import net.bytebuddy.build.HashCodeAndEqualsPlugin;
 import net.bytebuddy.description.type.TypeDefinition;

 /**
<|current_version|>
package net.bytebuddy.matcher;

import net.bytebuddy.build.HashCodeAndEqualsPlugin;
import net.bytebuddy.description.type.TypeDefinition;

/**
 * Matches an enumeration type.
 *
 * @param <T> The type of the matched entity.
 */
public class ArrayTypeMatcher<T extends TypeDefinition> extends ElementMatcher.Junction.AbstractBase<T> {

    /**
     * {@inheritDoc}
     */
    public boolean matches(T target) {
        return target.isArray();
    }

    @Override
    public String toString() {
        return "isArray()";
    }
}

<|next_version|>
package net.bytebuddy.matcher;

import net.bytebuddy.build.HashCodeAndEqualsPlugin;
import net.bytebuddy.description.type.TypeDefinition;

/**
 * Matches an enumeration type.
 *
 * @param <T> The type of the matched entity.
 */
@HashCodeAndEqualsPlugin.Enhance
public class ArrayTypeMatcher<T extends TypeDefinition> extends ElementMatcher.Junction.AbstractBase<T> {

    /**
     * {@inheritDoc}
     */
    public boolean matches(T target) {
        return target.isArray();
    }

    @Override
    public String toString() {
        return "isArray()";
    }
}


Fix broken router path tests

Fix broken router path tests

--- gateway/src/test/java/com/continuuity/gateway/router/RouterPathTest.java
+++ gateway/src/test/java/com/continuuity/gateway/router/RouterPathTest.java
@@ -2,12 +2,18 @@

 import com.continuuity.common.conf.Constants;
 import junit.framework.Assert;
+import org.junit.Before;
 import org.junit.Test;

 /**
  *  To test the RouterPathLookup regular expression tests.
  */
 public class RouterPathTest {
+
+  @Before
+  public void beforeTests() {
+    RouterPathLookup.init();
+  }

   @Test
   public void testRouterFlowPathLookUp() throws Exception {

<|original_code|>
package com.continuuity.gateway.router;

import com.continuuity.common.conf.Constants;
import junit.framework.Assert;
import org.junit.Test;

/**
 *  To test the RouterPathLookup regular expression tests.
 */
public class RouterPathTest {

  @Test
  public void testRouterFlowPathLookUp() throws Exception {
    String flowPath = "/v2//apps/ResponseCodeAnalytics/flows/LogAnalyticsFlow/status";
    String result = RouterPathLookup.getRoutingPath(flowPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP, result);
  }

  @Test
  public void testRouterWorkFlowPathLookUp() throws Exception {
    String procPath = "/v2/apps/PurchaseHistory/workflows/PurchaseHistoryWorkflow/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterProcedurePathLookUp() throws Exception {
    String procPath = "/v2//apps/ResponseCodeAnalytics/procedures/StatusCodeProcedure/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterDeployPathLookUp() throws Exception {
    String procPath = "/v2//apps/";
    String result = RouterPathLookup.getRoutingPath(procPath, "PUT");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

}

<|edits_diff|>
--- gateway/src/test/java/com/continuuity/gateway/router/RouterPathTest.java
+++ gateway/src/test/java/com/continuuity/gateway/router/RouterPathTest.java
@@ -2,6 +2,7 @@

 import com.continuuity.common.conf.Constants;
 import junit.framework.Assert;
+import org.junit.Before;
 import org.junit.Test;

 /**
<|current_version|>
package com.continuuity.gateway.router;

import com.continuuity.common.conf.Constants;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 *  To test the RouterPathLookup regular expression tests.
 */
public class RouterPathTest {

  @Test
  public void testRouterFlowPathLookUp() throws Exception {
    String flowPath = "/v2//apps/ResponseCodeAnalytics/flows/LogAnalyticsFlow/status";
    String result = RouterPathLookup.getRoutingPath(flowPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP, result);
  }

  @Test
  public void testRouterWorkFlowPathLookUp() throws Exception {
    String procPath = "/v2/apps/PurchaseHistory/workflows/PurchaseHistoryWorkflow/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterProcedurePathLookUp() throws Exception {
    String procPath = "/v2//apps/ResponseCodeAnalytics/procedures/StatusCodeProcedure/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterDeployPathLookUp() throws Exception {
    String procPath = "/v2//apps/";
    String result = RouterPathLookup.getRoutingPath(procPath, "PUT");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

}

<|next_version|>
package com.continuuity.gateway.router;

import com.continuuity.common.conf.Constants;
import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;

/**
 *  To test the RouterPathLookup regular expression tests.
 */
public class RouterPathTest {

  @Before
  public void beforeTests() {
    RouterPathLookup.init();
  }

  @Test
  public void testRouterFlowPathLookUp() throws Exception {
    String flowPath = "/v2//apps/ResponseCodeAnalytics/flows/LogAnalyticsFlow/status";
    String result = RouterPathLookup.getRoutingPath(flowPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP, result);
  }

  @Test
  public void testRouterWorkFlowPathLookUp() throws Exception {
    String procPath = "/v2/apps/PurchaseHistory/workflows/PurchaseHistoryWorkflow/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterProcedurePathLookUp() throws Exception {
    String procPath = "/v2//apps/ResponseCodeAnalytics/procedures/StatusCodeProcedure/status";
    String result = RouterPathLookup.getRoutingPath(procPath, "GET");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

  @Test
  public void testRouterDeployPathLookUp() throws Exception {
    String procPath = "/v2//apps/";
    String result = RouterPathLookup.getRoutingPath(procPath, "PUT");
    Assert.assertEquals(Constants.Service.APP_FABRIC_HTTP,  result);
  }

}


Make sure naming tests work - even when eclipselink naming provider present

--- server/src/test/java/org/realityforge/replicant/server/ee/RegistryUtil.java
+++ server/src/test/java/org/realityforge/replicant/server/ee/RegistryUtil.java
@@ -3,6 +3,7 @@
 import javax.annotation.Nonnull;
 import javax.naming.Context;
 import javax.naming.NamingException;
+import javax.naming.spi.NamingManager;
 import javax.transaction.TransactionSynchronizationRegistry;
 import org.realityforge.guiceyloops.server.TestInitialContextFactory;
 import org.realityforge.guiceyloops.server.TestTransactionSynchronizationRegistry;
@@ -20,6 +21,10 @@
   {
     try
     {
+      if ( !NamingManager.hasInitialContextFactoryBuilder() )
+      {
+        NamingManager.setInitialContextFactoryBuilder( environment -> e -> TestInitialContextFactory.getContext() );
+      }
       TestInitialContextFactory.reset();
       final Context context = TestInitialContextFactory.getContext().createSubcontext( "java:comp" );
       final TestTransactionSynchronizationRegistry registry = new TestTransactionSynchronizationRegistry();

<|original_code|>
package org.realityforge.replicant.server.ee;

import javax.annotation.Nonnull;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.transaction.TransactionSynchronizationRegistry;
import org.realityforge.guiceyloops.server.TestInitialContextFactory;
import org.realityforge.guiceyloops.server.TestTransactionSynchronizationRegistry;
import org.realityforge.replicant.server.ServerConstants;
import static org.testng.Assert.*;

public final class RegistryUtil
{
  private RegistryUtil()
  {
  }

  @Nonnull
  public static TransactionSynchronizationRegistry bind()
  {
    try
    {
      TestInitialContextFactory.reset();
      final Context context = TestInitialContextFactory.getContext().createSubcontext( "java:comp" );
      final TestTransactionSynchronizationRegistry registry = new TestTransactionSynchronizationRegistry();
      registry.putResource( ServerConstants.REPLICATION_INVOCATION_KEY, "Ignored" );
      context.bind( "TransactionSynchronizationRegistry", registry );
      return registry;
    }
    catch ( final NamingException e )
    {
      fail( "Unexpected exception", e );
      throw new IllegalStateException();
    }
  }
}

<|edits_diff|>
--- server/src/test/java/org/realityforge/replicant/server/ee/RegistryUtil.java
+++ server/src/test/java/org/realityforge/replicant/server/ee/RegistryUtil.java
@@ -3,6 +3,7 @@
 import javax.annotation.Nonnull;
 import javax.naming.Context;
 import javax.naming.NamingException;
+import javax.naming.spi.NamingManager;
 import javax.transaction.TransactionSynchronizationRegistry;
 import org.realityforge.guiceyloops.server.TestInitialContextFactory;
 import org.realityforge.guiceyloops.server.TestTransactionSynchronizationRegistry;
<|current_version|>
package org.realityforge.replicant.server.ee;

import javax.annotation.Nonnull;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.NamingManager;
import javax.transaction.TransactionSynchronizationRegistry;
import org.realityforge.guiceyloops.server.TestInitialContextFactory;
import org.realityforge.guiceyloops.server.TestTransactionSynchronizationRegistry;
import org.realityforge.replicant.server.ServerConstants;
import static org.testng.Assert.*;

public final class RegistryUtil
{
  private RegistryUtil()
  {
  }

  @Nonnull
  public static TransactionSynchronizationRegistry bind()
  {
    try
    {
      TestInitialContextFactory.reset();
      final Context context = TestInitialContextFactory.getContext().createSubcontext( "java:comp" );
      final TestTransactionSynchronizationRegistry registry = new TestTransactionSynchronizationRegistry();
      registry.putResource( ServerConstants.REPLICATION_INVOCATION_KEY, "Ignored" );
      context.bind( "TransactionSynchronizationRegistry", registry );
      return registry;
    }
    catch ( final NamingException e )
    {
      fail( "Unexpected exception", e );
      throw new IllegalStateException();
    }
  }
}

<|next_version|>
package org.realityforge.replicant.server.ee;

import javax.annotation.Nonnull;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.spi.NamingManager;
import javax.transaction.TransactionSynchronizationRegistry;
import org.realityforge.guiceyloops.server.TestInitialContextFactory;
import org.realityforge.guiceyloops.server.TestTransactionSynchronizationRegistry;
import org.realityforge.replicant.server.ServerConstants;
import static org.testng.Assert.*;

public final class RegistryUtil
{
  private RegistryUtil()
  {
  }

  @Nonnull
  public static TransactionSynchronizationRegistry bind()
  {
    try
    {
      if ( !NamingManager.hasInitialContextFactoryBuilder() )
      {
        NamingManager.setInitialContextFactoryBuilder( environment -> e -> TestInitialContextFactory.getContext() );
      }
      TestInitialContextFactory.reset();
      final Context context = TestInitialContextFactory.getContext().createSubcontext( "java:comp" );
      final TestTransactionSynchronizationRegistry registry = new TestTransactionSynchronizationRegistry();
      registry.putResource( ServerConstants.REPLICATION_INVOCATION_KEY, "Ignored" );
      context.bind( "TransactionSynchronizationRegistry", registry );
      return registry;
    }
    catch ( final NamingException e )
    {
      fail( "Unexpected exception", e );
      throw new IllegalStateException();
    }
  }
}


Revert "Revert "Ignore test that causes CI to fail on Java 7 - works locally.""

This reverts commit 5d60bef3afd33f35a9789015a761f16e58c5cc4e.

--- hawtio-git/src/test/java/io/hawt/git/GitCloneTest.java
+++ hawtio-git/src/test/java/io/hawt/git/GitCloneTest.java
@@ -2,6 +2,7 @@

 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;

 import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists;
@@ -11,6 +12,7 @@
 /**
  * Tests we can clone a remote repo
  */
+@Ignore("Fails on CircleCI with Java 7")
 public class GitCloneTest {
     GitFacade git = createTestGitFacade();

<|original_code|>
package io.hawt.git;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists;
import static io.hawt.git.GitFacadeTest.assertFileContents;
import static io.hawt.git.GitFacadeTest.createTestGitFacade;

/**
 * Tests we can clone a remote repo
 */
public class GitCloneTest {
    GitFacade git = createTestGitFacade();

    @Before
    public void init() throws Exception {
        git.init();
    }

    @After
    public void destroy() throws Exception {
        git.destroy();
    }

    @Test
    public void clonedRemoteRepo() throws Exception {
        assertConfigDirectoryExists(git);

        String contents = assertFileContents(git, "master", "/ReadMe.md");
        System.out.println("Read me is: " + contents.trim());
    }
}

<|edits_diff|>
--- hawtio-git/src/test/java/io/hawt/git/GitCloneTest.java
+++ hawtio-git/src/test/java/io/hawt/git/GitCloneTest.java
@@ -2,6 +2,7 @@

 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;

 import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists;
<|current_version|>
package io.hawt.git;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists;
import static io.hawt.git.GitFacadeTest.assertFileContents;
import static io.hawt.git.GitFacadeTest.createTestGitFacade;

/**
 * Tests we can clone a remote repo
 */
public class GitCloneTest {
    GitFacade git = createTestGitFacade();

    @Before
    public void init() throws Exception {
        git.init();
    }

    @After
    public void destroy() throws Exception {
        git.destroy();
    }

    @Test
    public void clonedRemoteRepo() throws Exception {
        assertConfigDirectoryExists(git);

        String contents = assertFileContents(git, "master", "/ReadMe.md");
        System.out.println("Read me is: " + contents.trim());
    }
}

<|next_version|>
package io.hawt.git;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

import static io.hawt.git.GitFacadeTest.assertConfigDirectoryExists;
import static io.hawt.git.GitFacadeTest.assertFileContents;
import static io.hawt.git.GitFacadeTest.createTestGitFacade;

/**
 * Tests we can clone a remote repo
 */
@Ignore("Fails on CircleCI with Java 7")
public class GitCloneTest {
    GitFacade git = createTestGitFacade();

    @Before
    public void init() throws Exception {
        git.init();
    }

    @After
    public void destroy() throws Exception {
        git.destroy();
    }

    @Test
    public void clonedRemoteRepo() throws Exception {
        assertConfigDirectoryExists(git);

        String contents = assertFileContents(git, "master", "/ReadMe.md");
        System.out.println("Read me is: " + contents.trim());
    }
}


Add test for dash case

Add test for dash case

--- test/com/karateca/jstoolbox/dashcamel/CaseHelperTest.java
+++ test/com/karateca/jstoolbox/dashcamel/CaseHelperTest.java
@@ -9,6 +9,7 @@
   public void shouldTransformToCamelCase() {
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one-two-three"));
     assertEquals("one", CaseHelper.toCamelCase("one"));
+    assertEquals("o", CaseHelper.toCamelCase("o"));
   }

   @Test
@@ -20,6 +21,7 @@
   public void shouldAcceptSpaces() {
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one two-three"));
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one  two-three"));
+    assertEquals("x", CaseHelper.toCamelCase("          x        -- - - -  "));
   }

   @Test
@@ -32,4 +34,9 @@
   public void shouldCorrectUpperCase() {
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("ONE-TWO-THREE"));
   }
+
+  @Test
+  public void shouldTransformCamelToDash() {
+    assertEquals("one-two", CaseHelper.toDashCase("oneTwo"));
+  }
 }

<|original_code|>
package com.karateca.jstoolbox.dashcamel;

import org.junit.Test;

import static org.junit.Assert.*;

public class CaseHelperTest {
  @Test
  public void shouldTransformToCamelCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one-two-three"));
    assertEquals("one", CaseHelper.toCamelCase("one"));
  }

  @Test
  public void shouldTransformEmptyString() {
    assertEquals("", CaseHelper.toCamelCase(""));
  }

  @Test
  public void shouldAcceptSpaces() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one two-three"));
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one  two-three"));
  }

  @Test
  public void shouldAcceptMultipleDashes() {
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("one--two---threeee  "));
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("---one--two---threeee---"));
  }

  @Test
  public void shouldCorrectUpperCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("ONE-TWO-THREE"));
  }
}
<|edits_diff|>
--- test/com/karateca/jstoolbox/dashcamel/CaseHelperTest.java
+++ test/com/karateca/jstoolbox/dashcamel/CaseHelperTest.java
@@ -9,6 +9,7 @@
   public void shouldTransformToCamelCase() {
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one-two-three"));
     assertEquals("one", CaseHelper.toCamelCase("one"));
+    assertEquals("o", CaseHelper.toCamelCase("o"));
   }

   @Test
@@ -20,6 +21,7 @@
   public void shouldAcceptSpaces() {
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one two-three"));
     assertEquals("oneTwoThree", CaseHelper.toCamelCase("one  two-three"));
+    assertEquals("x", CaseHelper.toCamelCase("          x        -- - - -  "));
   }

   @Test
<|current_version|>
package com.karateca.jstoolbox.dashcamel;

import org.junit.Test;

import static org.junit.Assert.*;

public class CaseHelperTest {
  @Test
  public void shouldTransformToCamelCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one-two-three"));
    assertEquals("one", CaseHelper.toCamelCase("one"));
    assertEquals("o", CaseHelper.toCamelCase("o"));
  }

  @Test
  public void shouldTransformEmptyString() {
    assertEquals("", CaseHelper.toCamelCase(""));
  }

  @Test
  public void shouldAcceptSpaces() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one two-three"));
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one  two-three"));
    assertEquals("x", CaseHelper.toCamelCase("          x        -- - - -  "));
  }

  @Test
  public void shouldAcceptMultipleDashes() {
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("one--two---threeee  "));
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("---one--two---threeee---"));
  }

  @Test
  public void shouldCorrectUpperCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("ONE-TWO-THREE"));
  }
}
<|next_version|>
package com.karateca.jstoolbox.dashcamel;

import org.junit.Test;

import static org.junit.Assert.*;

public class CaseHelperTest {
  @Test
  public void shouldTransformToCamelCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one-two-three"));
    assertEquals("one", CaseHelper.toCamelCase("one"));
    assertEquals("o", CaseHelper.toCamelCase("o"));
  }

  @Test
  public void shouldTransformEmptyString() {
    assertEquals("", CaseHelper.toCamelCase(""));
  }

  @Test
  public void shouldAcceptSpaces() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one two-three"));
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("one  two-three"));
    assertEquals("x", CaseHelper.toCamelCase("          x        -- - - -  "));
  }

  @Test
  public void shouldAcceptMultipleDashes() {
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("one--two---threeee  "));
    assertEquals("oneTwoThreeee", CaseHelper.toCamelCase("---one--two---threeee---"));
  }

  @Test
  public void shouldCorrectUpperCase() {
    assertEquals("oneTwoThree", CaseHelper.toCamelCase("ONE-TWO-THREE"));
  }

  @Test
  public void shouldTransformCamelToDash() {
    assertEquals("one-two", CaseHelper.toDashCase("oneTwo"));
  }
}


Add docs to Selection Sort

Add docs to Selection Sort

--- sorting/SelectionSort.java
+++ sorting/SelectionSort.java
@@ -2,17 +2,27 @@

 public class SelectionSort {

+	/**
+	 *  Selection Sort is an in-place comparison sort.
+	 *  It has O(n^2) time complexity.
+	 */
 	public int[] selection_sort(int[] arr) {
 		int min, temp;
+        /* find the min element in the unsorted array */
 		for (int i = 0; i < arr.length; i++) {
+		    /* assume the min is the first element */
 			min = i;
+			/* test against elements after i to find the smallest */
 			for (int j = i+1; j < arr.length; j++) {
+				/* if this element is less, then it is the new minimum */
 				if (arr[j] < arr[min]) {
+					/* found new minimum; remember its index */
 					min = j;
 				}
 			}

 			if (min != i) {
+				/* swap i and min */
 				temp = arr[i];
 				arr[i] = arr[min];
 				arr[min] = temp;

<|original_code|>
import java.util.Arrays;

public class SelectionSort {

	public int[] selection_sort(int[] arr) {
		int min, temp;
		for (int i = 0; i < arr.length; i++) {
			min = i;
			for (int j = i+1; j < arr.length; j++) {
				if (arr[j] < arr[min]) {
					min = j;
				}
			}

			if (min != i) {
				temp = arr[i];
				arr[i] = arr[min];
				arr[min] = temp;
			}
		}

		return arr;
	}

}

<|edits_diff|>
--- sorting/SelectionSort.java
+++ sorting/SelectionSort.java
@@ -2,12 +2,21 @@

 public class SelectionSort {

+	/**
+	 *  Selection Sort is an in-place comparison sort.
+	 *  It has O(n^2) time complexity.
+	 */
 	public int[] selection_sort(int[] arr) {
 		int min, temp;
+        /* find the min element in the unsorted array */
 		for (int i = 0; i < arr.length; i++) {
+		    /* assume the min is the first element */
 			min = i;
+			/* test against elements after i to find the smallest */
 			for (int j = i+1; j < arr.length; j++) {
+				/* if this element is less, then it is the new minimum */
 				if (arr[j] < arr[min]) {
+					/* found new minimum; remember its index */
 					min = j;
 				}
 			}
<|current_version|>
import java.util.Arrays;

public class SelectionSort {

	/**
	 *  Selection Sort is an in-place comparison sort.
	 *  It has O(n^2) time complexity.
	 */
	public int[] selection_sort(int[] arr) {
		int min, temp;
        /* find the min element in the unsorted array */
		for (int i = 0; i < arr.length; i++) {
		    /* assume the min is the first element */
			min = i;
			/* test against elements after i to find the smallest */
			for (int j = i+1; j < arr.length; j++) {
				/* if this element is less, then it is the new minimum */
				if (arr[j] < arr[min]) {
					/* found new minimum; remember its index */
					min = j;
				}
			}

			if (min != i) {
				temp = arr[i];
				arr[i] = arr[min];
				arr[min] = temp;
			}
		}

		return arr;
	}

}

<|next_version|>
import java.util.Arrays;

public class SelectionSort {

	/**
	 *  Selection Sort is an in-place comparison sort.
	 *  It has O(n^2) time complexity.
	 */
	public int[] selection_sort(int[] arr) {
		int min, temp;
        /* find the min element in the unsorted array */
		for (int i = 0; i < arr.length; i++) {
		    /* assume the min is the first element */
			min = i;
			/* test against elements after i to find the smallest */
			for (int j = i+1; j < arr.length; j++) {
				/* if this element is less, then it is the new minimum */
				if (arr[j] < arr[min]) {
					/* found new minimum; remember its index */
					min = j;
				}
			}

			if (min != i) {
				/* swap i and min */
				temp = arr[i];
				arr[i] = arr[min];
				arr[min] = temp;
			}
		}

		return arr;
	}

}


Allow the SASL credentials provider to provide extra configuration

Some mechanisms might require external configuration data so we should
provide an optional API to allow that to be gathered from a mechanism.

--- qpid-proton4j-engine/src/main/java/org/apache/qpid/proton4j/engine/sasl/client/SaslCredentialsProvider.java
+++ qpid-proton4j-engine/src/main/java/org/apache/qpid/proton4j/engine/sasl/client/SaslCredentialsProvider.java
@@ -17,6 +17,8 @@
 package org.apache.qpid.proton4j.engine.sasl.client;

 import java.security.Principal;
+import java.util.Collections;
+import java.util.Map;

 /**
  * Interface for a supplier of login credentials used by the SASL Authenticator to
@@ -32,4 +34,8 @@

     Principal localPrincipal();

+    @SuppressWarnings("unchecked")
+    default Map<String, Object> options() {
+        return Collections.EMPTY_MAP;
+    }
 }

<|original_code|>
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.qpid.proton4j.engine.sasl.client;

import java.security.Principal;

/**
 * Interface for a supplier of login credentials used by the SASL Authenticator to
 * select and configure the client SASL mechanism.
 */
public interface SaslCredentialsProvider {

    String vhost();

    String username();

    String password();

    Principal localPrincipal();

}

<|edits_diff|>
--- qpid-proton4j-engine/src/main/java/org/apache/qpid/proton4j/engine/sasl/client/SaslCredentialsProvider.java
+++ qpid-proton4j-engine/src/main/java/org/apache/qpid/proton4j/engine/sasl/client/SaslCredentialsProvider.java
@@ -17,6 +17,8 @@
 package org.apache.qpid.proton4j.engine.sasl.client;

 import java.security.Principal;
+import java.util.Collections;
+import java.util.Map;

 /**
  * Interface for a supplier of login credentials used by the SASL Authenticator to
<|current_version|>
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.qpid.proton4j.engine.sasl.client;

import java.security.Principal;
import java.util.Collections;
import java.util.Map;

/**
 * Interface for a supplier of login credentials used by the SASL Authenticator to
 * select and configure the client SASL mechanism.
 */
public interface SaslCredentialsProvider {

    String vhost();

    String username();

    String password();

    Principal localPrincipal();

}

<|next_version|>
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.qpid.proton4j.engine.sasl.client;

import java.security.Principal;
import java.util.Collections;
import java.util.Map;

/**
 * Interface for a supplier of login credentials used by the SASL Authenticator to
 * select and configure the client SASL mechanism.
 */
public interface SaslCredentialsProvider {

    String vhost();

    String username();

    String password();

    Principal localPrincipal();

    @SuppressWarnings("unchecked")
    default Map<String, Object> options() {
        return Collections.EMPTY_MAP;
    }
}


Use basic auth when posting data.

Use basic auth when posting data.

--- src/com/watcher/car/HttpClient.java
+++ src/com/watcher/car/HttpClient.java
@@ -1,15 +1,20 @@
 package com.watcher.car;
+
+import android.util.Base64;

 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;

+import static android.util.Base64.DEFAULT;
+
 public class HttpClient {

   public void post(String data) {
     try {
       HttpURLConnection conn = openConnection("http://leetor.no-ip.org:8010/");
+      conn.setRequestProperty("Authorization", "Basic " + Base64.encodeToString("car:watcher".getBytes(), DEFAULT));
       conn.setDoOutput(true);
       OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
       wr.write(data);

<|original_code|>
package com.watcher.car;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class HttpClient {

  public void post(String data) {
    try {
      HttpURLConnection conn = openConnection("http://leetor.no-ip.org:8010/");
      conn.setDoOutput(true);
      OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
      wr.write(data);
      wr.flush();
      wr.close();

      if (conn.getResponseCode() != 200) {
        throw new RuntimeException("Failed to post data, http status: " + conn.getResponseCode());
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  private HttpURLConnection openConnection(String url) throws IOException {
    return (HttpURLConnection) (new URL(url).openConnection());
  }
}

<|edits_diff|>
--- src/com/watcher/car/HttpClient.java
+++ src/com/watcher/car/HttpClient.java
@@ -1,9 +1,13 @@
 package com.watcher.car;
+
+import android.util.Base64;

 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.net.HttpURLConnection;
 import java.net.URL;
+
+import static android.util.Base64.DEFAULT;

 public class HttpClient {

<|current_version|>
package com.watcher.car;

import android.util.Base64;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

import static android.util.Base64.DEFAULT;

public class HttpClient {

  public void post(String data) {
    try {
      HttpURLConnection conn = openConnection("http://leetor.no-ip.org:8010/");
      conn.setDoOutput(true);
      OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
      wr.write(data);
      wr.flush();
      wr.close();

      if (conn.getResponseCode() != 200) {
        throw new RuntimeException("Failed to post data, http status: " + conn.getResponseCode());
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  private HttpURLConnection openConnection(String url) throws IOException {
    return (HttpURLConnection) (new URL(url).openConnection());
  }
}

<|next_version|>
package com.watcher.car;

import android.util.Base64;

import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

import static android.util.Base64.DEFAULT;

public class HttpClient {

  public void post(String data) {
    try {
      HttpURLConnection conn = openConnection("http://leetor.no-ip.org:8010/");
      conn.setRequestProperty("Authorization", "Basic " + Base64.encodeToString("car:watcher".getBytes(), DEFAULT));
      conn.setDoOutput(true);
      OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
      wr.write(data);
      wr.flush();
      wr.close();

      if (conn.getResponseCode() != 200) {
        throw new RuntimeException("Failed to post data, http status: " + conn.getResponseCode());
      }
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }

  private HttpURLConnection openConnection(String url) throws IOException {
    return (HttpURLConnection) (new URL(url).openConnection());
  }
}


Add joystick control to the new shooter Jaguar.

--- src/com/edinarobotics/zephyr/Zephyr.java
+++ src/com/edinarobotics/zephyr/Zephyr.java
@@ -31,10 +31,12 @@
      */
     public void operatorControl() {
         Gamepad gamepad1 = new Gamepad(1);
+        Gamepad gamepad2 = new Gamepad(2);
         Components components = Components.getInstance();
         while(this.isOperatorControl()&&this.isEnabled()){
            components.leftJaguar.set(gamepad1.getLeftY());
            components.rightJaguar.set(gamepad1.getRightY());
+           components.shooterJaguar.set(gamepad2.getLeftY());
         }
         components.leftJaguar.set(0);
         components.rightJaguar.set(0);

<|original_code|>
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package com.edinarobotics.zephyr;

import com.edinarobotics.utils.gamepad.Gamepad;
import edu.wpi.first.wpilibj.SimpleRobot;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Zephyr extends SimpleRobot {
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {

    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
        Gamepad gamepad1 = new Gamepad(1);
        Components components = Components.getInstance();
        while(this.isOperatorControl()&&this.isEnabled()){
           components.leftJaguar.set(gamepad1.getLeftY());
           components.rightJaguar.set(gamepad1.getRightY());
        }
        components.leftJaguar.set(0);
        components.rightJaguar.set(0);
    }
}

<|edits_diff|>
--- src/com/edinarobotics/zephyr/Zephyr.java
+++ src/com/edinarobotics/zephyr/Zephyr.java
@@ -31,6 +31,7 @@
      */
     public void operatorControl() {
         Gamepad gamepad1 = new Gamepad(1);
+        Gamepad gamepad2 = new Gamepad(2);
         Components components = Components.getInstance();
         while(this.isOperatorControl()&&this.isEnabled()){
            components.leftJaguar.set(gamepad1.getLeftY());
<|current_version|>
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package com.edinarobotics.zephyr;

import com.edinarobotics.utils.gamepad.Gamepad;
import edu.wpi.first.wpilibj.SimpleRobot;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Zephyr extends SimpleRobot {
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {

    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
        Gamepad gamepad1 = new Gamepad(1);
        Gamepad gamepad2 = new Gamepad(2);
        Components components = Components.getInstance();
        while(this.isOperatorControl()&&this.isEnabled()){
           components.leftJaguar.set(gamepad1.getLeftY());
           components.rightJaguar.set(gamepad1.getRightY());
        }
        components.leftJaguar.set(0);
        components.rightJaguar.set(0);
    }
}

<|next_version|>
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package com.edinarobotics.zephyr;

import com.edinarobotics.utils.gamepad.Gamepad;
import edu.wpi.first.wpilibj.SimpleRobot;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Zephyr extends SimpleRobot {
    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {

    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl() {
        Gamepad gamepad1 = new Gamepad(1);
        Gamepad gamepad2 = new Gamepad(2);
        Components components = Components.getInstance();
        while(this.isOperatorControl()&&this.isEnabled()){
           components.leftJaguar.set(gamepad1.getLeftY());
           components.rightJaguar.set(gamepad1.getRightY());
           components.shooterJaguar.set(gamepad2.getLeftY());
        }
        components.leftJaguar.set(0);
        components.rightJaguar.set(0);
    }
}


Add headers to control Access

Add headers to control Access

--- services/src/main/java/no/deichman/services/resources/Work.java
+++ services/src/main/java/no/deichman/services/resources/Work.java
@@ -15,6 +15,8 @@
     public Response listWork() {
         return Response.ok("{\"message\":\"Hello World!\"}")
                 .link("http://192.168.50.50:8080/work", "work")
+                .header("Access-Control-Allow-Origin", "*")
+                .header("Access-Control-Allow-Methods", "GET")
                 .build();
     }

@@ -24,6 +26,8 @@
     public Response getWork(String workId) {
         return Response.ok(mockWorkObjectAsJSON())
                 .link(workId, workId)
+                .header("Access-Control-Allow-Origin", "*")
+                .header("Access-Control-Allow-Methods", "GET")
                 .build();
     }

<|original_code|>
package no.deichman.services.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/work")
public class Work {

    @GET
    @Path("/")
    @Produces(MediaType.APPLICATION_JSON)
    public Response listWork() {
        return Response.ok("{\"message\":\"Hello World!\"}")
                .link("http://192.168.50.50:8080/work", "work")
                .build();
    }

    @GET
    @Path("/{workId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getWork(String workId) {
        return Response.ok(mockWorkObjectAsJSON())
                .link(workId, workId)
                .build();
    }

    private String mockWorkObjectAsJSON() {
        final String WORK_MOCK = "{\"id\":\"work_00001\",\"properties\":[{\"Title\":\"Sult\"},{\"creator\":\"Knut Hamsun\"},{\"date\":\"1890\"},{\"editions\":[{\"id\":\"edition_00001\",\"properties\":[{\"isbn\":\"82-05-27748-6\"},{\"placement\":\"Voksenavdelingen, Hovedbiblioteket\"},{\"status\":\"På hylla\"}]}]}]}";
        return WORK_MOCK;
    }
}

<|edits_diff|>
--- services/src/main/java/no/deichman/services/resources/Work.java
+++ services/src/main/java/no/deichman/services/resources/Work.java
@@ -15,6 +15,8 @@
     public Response listWork() {
         return Response.ok("{\"message\":\"Hello World!\"}")
                 .link("http://192.168.50.50:8080/work", "work")
+                .header("Access-Control-Allow-Origin", "*")
+                .header("Access-Control-Allow-Methods", "GET")
                 .build();
     }

<|current_version|>
package no.deichman.services.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/work")
public class Work {

    @GET
    @Path("/")
    @Produces(MediaType.APPLICATION_JSON)
    public Response listWork() {
        return Response.ok("{\"message\":\"Hello World!\"}")
                .link("http://192.168.50.50:8080/work", "work")
                .header("Access-Control-Allow-Origin", "*")
                .header("Access-Control-Allow-Methods", "GET")
                .build();
    }

    @GET
    @Path("/{workId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getWork(String workId) {
        return Response.ok(mockWorkObjectAsJSON())
                .link(workId, workId)
                .build();
    }

    private String mockWorkObjectAsJSON() {
        final String WORK_MOCK = "{\"id\":\"work_00001\",\"properties\":[{\"Title\":\"Sult\"},{\"creator\":\"Knut Hamsun\"},{\"date\":\"1890\"},{\"editions\":[{\"id\":\"edition_00001\",\"properties\":[{\"isbn\":\"82-05-27748-6\"},{\"placement\":\"Voksenavdelingen, Hovedbiblioteket\"},{\"status\":\"På hylla\"}]}]}]}";
        return WORK_MOCK;
    }
}

<|next_version|>
package no.deichman.services.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/work")
public class Work {

    @GET
    @Path("/")
    @Produces(MediaType.APPLICATION_JSON)
    public Response listWork() {
        return Response.ok("{\"message\":\"Hello World!\"}")
                .link("http://192.168.50.50:8080/work", "work")
                .header("Access-Control-Allow-Origin", "*")
                .header("Access-Control-Allow-Methods", "GET")
                .build();
    }

    @GET
    @Path("/{workId}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getWork(String workId) {
        return Response.ok(mockWorkObjectAsJSON())
                .link(workId, workId)
                .header("Access-Control-Allow-Origin", "*")
                .header("Access-Control-Allow-Methods", "GET")
                .build();
    }

    private String mockWorkObjectAsJSON() {
        final String WORK_MOCK = "{\"id\":\"work_00001\",\"properties\":[{\"Title\":\"Sult\"},{\"creator\":\"Knut Hamsun\"},{\"date\":\"1890\"},{\"editions\":[{\"id\":\"edition_00001\",\"properties\":[{\"isbn\":\"82-05-27748-6\"},{\"placement\":\"Voksenavdelingen, Hovedbiblioteket\"},{\"status\":\"På hylla\"}]}]}]}";
        return WORK_MOCK;
    }
}


Fix height of blockconfirmation icon and reduces row height

--- gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java
+++ gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java
@@ -2,6 +2,7 @@

 import de.jensd.fx.fontawesome.AwesomeDude;
 import de.jensd.fx.fontawesome.AwesomeIcon;
+import javafx.geometry.Insets;
 import javafx.scene.control.ContentDisplay;
 import javafx.scene.control.Hyperlink;
 import javafx.scene.control.Label;
@@ -21,10 +22,13 @@
         icon.setMinWidth(20);
         icon.setOpacity(0.7);
         icon.getStyleClass().add("hyperlink");
+        icon.setPadding(new Insets(0));

         setGraphic(icon);
         setContentDisplay(ContentDisplay.RIGHT);
+        setGraphicTextGap(7.0);

+        //TODO: replace workaround of setting the style this way
         tooltipProperty().addListener((observable, oldValue, newValue) -> newValue.setStyle("-fx-text-fill: -bs-black"));
     }

<|original_code|>
package io.bisq.gui.components;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;

public class HyperlinkWithIcon extends Hyperlink {

    public HyperlinkWithIcon(String text) {
        this(text, AwesomeIcon.INFO_SIGN);
    }

    public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {

        super(text);

        Label icon = new Label();
        AwesomeDude.setIcon(icon, awesomeIcon);
        icon.setMinWidth(20);
        icon.setOpacity(0.7);
        icon.getStyleClass().add("hyperlink");

        setGraphic(icon);
        setContentDisplay(ContentDisplay.RIGHT);

        tooltipProperty().addListener((observable, oldValue, newValue) -> newValue.setStyle("-fx-text-fill: -bs-black"));
    }

    public void clear() {
        setText("");
        setGraphic(null);
    }
}

<|edits_diff|>
--- gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java
+++ gui/src/main/java/io/bisq/gui/components/HyperlinkWithIcon.java
@@ -2,6 +2,7 @@

 import de.jensd.fx.fontawesome.AwesomeDude;
 import de.jensd.fx.fontawesome.AwesomeIcon;
+import javafx.geometry.Insets;
 import javafx.scene.control.ContentDisplay;
 import javafx.scene.control.Hyperlink;
 import javafx.scene.control.Label;
@@ -21,9 +22,11 @@
         icon.setMinWidth(20);
         icon.setOpacity(0.7);
         icon.getStyleClass().add("hyperlink");
+        icon.setPadding(new Insets(0));

         setGraphic(icon);
         setContentDisplay(ContentDisplay.RIGHT);
+        setGraphicTextGap(7.0);

         tooltipProperty().addListener((observable, oldValue, newValue) -> newValue.setStyle("-fx-text-fill: -bs-black"));
     }
<|current_version|>
package io.bisq.gui.components;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import javafx.geometry.Insets;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;

public class HyperlinkWithIcon extends Hyperlink {

    public HyperlinkWithIcon(String text) {
        this(text, AwesomeIcon.INFO_SIGN);
    }

    public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {

        super(text);

        Label icon = new Label();
        AwesomeDude.setIcon(icon, awesomeIcon);
        icon.setMinWidth(20);
        icon.setOpacity(0.7);
        icon.getStyleClass().add("hyperlink");
        icon.setPadding(new Insets(0));

        setGraphic(icon);
        setContentDisplay(ContentDisplay.RIGHT);
        setGraphicTextGap(7.0);

        tooltipProperty().addListener((observable, oldValue, newValue) -> newValue.setStyle("-fx-text-fill: -bs-black"));
    }

    public void clear() {
        setText("");
        setGraphic(null);
    }
}

<|next_version|>
package io.bisq.gui.components;

import de.jensd.fx.fontawesome.AwesomeDude;
import de.jensd.fx.fontawesome.AwesomeIcon;
import javafx.geometry.Insets;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;

public class HyperlinkWithIcon extends Hyperlink {

    public HyperlinkWithIcon(String text) {
        this(text, AwesomeIcon.INFO_SIGN);
    }

    public HyperlinkWithIcon(String text, AwesomeIcon awesomeIcon) {

        super(text);

        Label icon = new Label();
        AwesomeDude.setIcon(icon, awesomeIcon);
        icon.setMinWidth(20);
        icon.setOpacity(0.7);
        icon.getStyleClass().add("hyperlink");
        icon.setPadding(new Insets(0));

        setGraphic(icon);
        setContentDisplay(ContentDisplay.RIGHT);
        setGraphicTextGap(7.0);

        //TODO: replace workaround of setting the style this way
        tooltipProperty().addListener((observable, oldValue, newValue) -> newValue.setStyle("-fx-text-fill: -bs-black"));
    }

    public void clear() {
        setText("");
        setGraphic(null);
    }
}


Add deferred register to enchantments

Add deferred register to enchantments

--- src/test/java/info/u_team/u_team_test/init/TestEnchantments.java
+++ src/test/java/info/u_team/u_team_test/init/TestEnchantments.java
@@ -1,11 +1,19 @@
 package info.u_team.u_team_test.init;

+import info.u_team.u_team_test.TestMod;
 import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
 import net.minecraft.enchantment.Enchantment;
+import net.minecraftforge.eventbus.api.IEventBus;
+import net.minecraftforge.registries.*;

 public class TestEnchantments {

+	public static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, TestMod.MODID);
+
 	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

+	public static void register(IEventBus bus) {
+		ENCHANTMENTS.register(bus);
+	}

 }

<|original_code|>
package info.u_team.u_team_test.init;

import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
import net.minecraft.enchantment.Enchantment;

public class TestEnchantments {

	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

}

<|edits_diff|>
--- src/test/java/info/u_team/u_team_test/init/TestEnchantments.java
+++ src/test/java/info/u_team/u_team_test/init/TestEnchantments.java
@@ -1,9 +1,14 @@
 package info.u_team.u_team_test.init;

+import info.u_team.u_team_test.TestMod;
 import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
 import net.minecraft.enchantment.Enchantment;
+import net.minecraftforge.eventbus.api.IEventBus;
+import net.minecraftforge.registries.*;

 public class TestEnchantments {
+
+	public static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, TestMod.MODID);

 	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

<|current_version|>
package info.u_team.u_team_test.init;

import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
import net.minecraft.enchantment.Enchantment;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.*;

public class TestEnchantments {

	public static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, TestMod.MODID);

	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

}

<|next_version|>
package info.u_team.u_team_test.init;

import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
import net.minecraft.enchantment.Enchantment;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.*;

public class TestEnchantments {

	public static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(ForgeRegistries.ENCHANTMENTS, TestMod.MODID);

	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

	public static void register(IEventBus bus) {
		ENCHANTMENTS.register(bus);
	}

}


Add isOwner EntityPlayer signature method to the interface.

--- src/main/java/net/aeronica/mods/mxtune/world/IModLockableContainer.java
+++ src/main/java/net/aeronica/mods/mxtune/world/IModLockableContainer.java
@@ -16,6 +16,7 @@
  */
 package net.aeronica.mods.mxtune.world;

+import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.world.IWorldNameable;
 import net.minecraft.world.LockCode;

@@ -29,6 +30,8 @@

     boolean isOwner(OwnerUUID ownerUUID);

+    boolean isOwner(EntityPlayer entityPlayer);
+
     void setOwner(OwnerUUID ownerUUID);

     OwnerUUID getOwner();

<|original_code|>
/*
 * Aeronica's mxTune MOD
 * Copyright {2016} Paul Boese a.k.a. Aeronica
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aeronica.mods.mxtune.world;

import net.minecraft.world.IWorldNameable;
import net.minecraft.world.LockCode;

public interface IModLockableContainer extends IWorldNameable
{
    boolean isLocked();

    void setLockCode(LockCode code);

    LockCode getLockCode();

    boolean isOwner(OwnerUUID ownerUUID);

    void setOwner(OwnerUUID ownerUUID);

    OwnerUUID getOwner();
}

<|edits_diff|>
--- src/main/java/net/aeronica/mods/mxtune/world/IModLockableContainer.java
+++ src/main/java/net/aeronica/mods/mxtune/world/IModLockableContainer.java
@@ -16,6 +16,7 @@
  */
 package net.aeronica.mods.mxtune.world;

+import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.world.IWorldNameable;
 import net.minecraft.world.LockCode;

<|current_version|>
/*
 * Aeronica's mxTune MOD
 * Copyright {2016} Paul Boese a.k.a. Aeronica
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aeronica.mods.mxtune.world;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.IWorldNameable;
import net.minecraft.world.LockCode;

public interface IModLockableContainer extends IWorldNameable
{
    boolean isLocked();

    void setLockCode(LockCode code);

    LockCode getLockCode();

    boolean isOwner(OwnerUUID ownerUUID);

    void setOwner(OwnerUUID ownerUUID);

    OwnerUUID getOwner();
}

<|next_version|>
/*
 * Aeronica's mxTune MOD
 * Copyright {2016} Paul Boese a.k.a. Aeronica
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.aeronica.mods.mxtune.world;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.IWorldNameable;
import net.minecraft.world.LockCode;

public interface IModLockableContainer extends IWorldNameable
{
    boolean isLocked();

    void setLockCode(LockCode code);

    LockCode getLockCode();

    boolean isOwner(OwnerUUID ownerUUID);

    boolean isOwner(EntityPlayer entityPlayer);

    void setOwner(OwnerUUID ownerUUID);

    OwnerUUID getOwner();
}


Add test for degenerate line fitter task.

--- src/test/java/hu/kazocsaba/math/geometry/fitting/LineFitterTest.java
+++ src/test/java/hu/kazocsaba/math/geometry/fitting/LineFitterTest.java
@@ -1,10 +1,13 @@
 package hu.kazocsaba.math.geometry.fitting;

+import hu.kazocsaba.math.geometry.DegenerateCaseException;
 import hu.kazocsaba.math.matrix.Vector2;
 import java.util.List;
 import hu.kazocsaba.math.geometry.Line2;
+import hu.kazocsaba.math.matrix.MatrixFactory;
 import hu.kazocsaba.math.matrix.immutable.ImmutableMatrixFactory;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Random;
 import org.junit.Test;
 import static org.junit.Assert.*;
@@ -30,4 +33,9 @@
 		assertEquals(1, Math.abs(refLine.getUnitDir().dot(fitLine.getUnitDir())), EPS);
 		assertEquals(0, refLine.distance(fitLine.getPoint()), EPS);
 	}
+
+	@Test(expected=DegenerateCaseException.class)
+	public void testDegenerate() {
+		LineFitter.fit2(Collections.nCopies(10, MatrixFactory.createVector(2, -4)));
+	}
 }

<|original_code|>
package hu.kazocsaba.math.geometry.fitting;

import hu.kazocsaba.math.matrix.Vector2;
import java.util.List;
import hu.kazocsaba.math.geometry.Line2;
import hu.kazocsaba.math.matrix.immutable.ImmutableMatrixFactory;
import java.util.ArrayList;
import java.util.Random;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Kazó Csaba
 */
public class LineFitterTest {
	private static final double EPS=1e-8;

	@Test
	public void testFit() {
		Line2 refLine=Line2.createFromDir(ImmutableMatrixFactory.createVector(3, 4), ImmutableMatrixFactory.createVector(-5, 2));

		Random rnd=new Random(726);

		List<Vector2> points=new ArrayList<Vector2>(50);
		for (int i=0; i<50; i++) points.add(refLine.getPointAt(rnd.nextDouble()));

		Line2 fitLine=LineFitter.fit2(points);

		assertEquals(1, Math.abs(refLine.getUnitDir().dot(fitLine.getUnitDir())), EPS);
		assertEquals(0, refLine.distance(fitLine.getPoint()), EPS);
	}
}

<|edits_diff|>
--- src/test/java/hu/kazocsaba/math/geometry/fitting/LineFitterTest.java
+++ src/test/java/hu/kazocsaba/math/geometry/fitting/LineFitterTest.java
@@ -1,10 +1,13 @@
 package hu.kazocsaba.math.geometry.fitting;

+import hu.kazocsaba.math.geometry.DegenerateCaseException;
 import hu.kazocsaba.math.matrix.Vector2;
 import java.util.List;
 import hu.kazocsaba.math.geometry.Line2;
+import hu.kazocsaba.math.matrix.MatrixFactory;
 import hu.kazocsaba.math.matrix.immutable.ImmutableMatrixFactory;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Random;
 import org.junit.Test;
 import static org.junit.Assert.*;
<|current_version|>
package hu.kazocsaba.math.geometry.fitting;

import hu.kazocsaba.math.geometry.DegenerateCaseException;
import hu.kazocsaba.math.matrix.Vector2;
import java.util.List;
import hu.kazocsaba.math.geometry.Line2;
import hu.kazocsaba.math.matrix.MatrixFactory;
import hu.kazocsaba.math.matrix.immutable.ImmutableMatrixFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Kazó Csaba
 */
public class LineFitterTest {
	private static final double EPS=1e-8;

	@Test
	public void testFit() {
		Line2 refLine=Line2.createFromDir(ImmutableMatrixFactory.createVector(3, 4), ImmutableMatrixFactory.createVector(-5, 2));

		Random rnd=new Random(726);

		List<Vector2> points=new ArrayList<Vector2>(50);
		for (int i=0; i<50; i++) points.add(refLine.getPointAt(rnd.nextDouble()));

		Line2 fitLine=LineFitter.fit2(points);

		assertEquals(1, Math.abs(refLine.getUnitDir().dot(fitLine.getUnitDir())), EPS);
		assertEquals(0, refLine.distance(fitLine.getPoint()), EPS);
	}
}

<|next_version|>
package hu.kazocsaba.math.geometry.fitting;

import hu.kazocsaba.math.geometry.DegenerateCaseException;
import hu.kazocsaba.math.matrix.Vector2;
import java.util.List;
import hu.kazocsaba.math.geometry.Line2;
import hu.kazocsaba.math.matrix.MatrixFactory;
import hu.kazocsaba.math.matrix.immutable.ImmutableMatrixFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Random;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author Kazó Csaba
 */
public class LineFitterTest {
	private static final double EPS=1e-8;

	@Test
	public void testFit() {
		Line2 refLine=Line2.createFromDir(ImmutableMatrixFactory.createVector(3, 4), ImmutableMatrixFactory.createVector(-5, 2));

		Random rnd=new Random(726);

		List<Vector2> points=new ArrayList<Vector2>(50);
		for (int i=0; i<50; i++) points.add(refLine.getPointAt(rnd.nextDouble()));

		Line2 fitLine=LineFitter.fit2(points);

		assertEquals(1, Math.abs(refLine.getUnitDir().dot(fitLine.getUnitDir())), EPS);
		assertEquals(0, refLine.distance(fitLine.getPoint()), EPS);
	}

	@Test(expected=DegenerateCaseException.class)
	public void testDegenerate() {
		LineFitter.fit2(Collections.nCopies(10, MatrixFactory.createVector(2, -4)));
	}
}


Add a missing timeout decoration

Add a missing timeout decoration

Signed-off-by: David Lee <15c338f3b79a63a0d5423e9c6562cd312918fe74@gmail.com>

--- header/src/main/java/org/zstack/header/storage/primary/TakeSnapshotMsg.java
+++ header/src/main/java/org/zstack/header/storage/primary/TakeSnapshotMsg.java
@@ -1,10 +1,13 @@
 package org.zstack.header.storage.primary;

+import org.zstack.header.core.ApiTimeout;
 import org.zstack.header.message.NeedReplyMessage;
 import org.zstack.header.storage.snapshot.VolumeSnapshotStruct;
+import org.zstack.header.volume.APICreateVolumeSnapshotMsg;

 /**
  */
+@ApiTimeout(apiClasses = {APICreateVolumeSnapshotMsg.class})
 public class TakeSnapshotMsg extends NeedReplyMessage implements PrimaryStorageMessage {
     private String primaryStorageUuid;
     private VolumeSnapshotStruct struct;

<|original_code|>
package org.zstack.header.storage.primary;

import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.storage.snapshot.VolumeSnapshotStruct;

/**
 */
public class TakeSnapshotMsg extends NeedReplyMessage implements PrimaryStorageMessage {
    private String primaryStorageUuid;
    private VolumeSnapshotStruct struct;

    @Override
    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }

    public VolumeSnapshotStruct getStruct() {
        return struct;
    }

    public void setStruct(VolumeSnapshotStruct struct) {
        this.struct = struct;
    }
}

<|edits_diff|>
--- header/src/main/java/org/zstack/header/storage/primary/TakeSnapshotMsg.java
+++ header/src/main/java/org/zstack/header/storage/primary/TakeSnapshotMsg.java
@@ -1,7 +1,9 @@
 package org.zstack.header.storage.primary;

+import org.zstack.header.core.ApiTimeout;
 import org.zstack.header.message.NeedReplyMessage;
 import org.zstack.header.storage.snapshot.VolumeSnapshotStruct;
+import org.zstack.header.volume.APICreateVolumeSnapshotMsg;

 /**
  */
<|current_version|>
package org.zstack.header.storage.primary;

import org.zstack.header.core.ApiTimeout;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.storage.snapshot.VolumeSnapshotStruct;
import org.zstack.header.volume.APICreateVolumeSnapshotMsg;

/**
 */
public class TakeSnapshotMsg extends NeedReplyMessage implements PrimaryStorageMessage {
    private String primaryStorageUuid;
    private VolumeSnapshotStruct struct;

    @Override
    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }

    public VolumeSnapshotStruct getStruct() {
        return struct;
    }

    public void setStruct(VolumeSnapshotStruct struct) {
        this.struct = struct;
    }
}

<|next_version|>
package org.zstack.header.storage.primary;

import org.zstack.header.core.ApiTimeout;
import org.zstack.header.message.NeedReplyMessage;
import org.zstack.header.storage.snapshot.VolumeSnapshotStruct;
import org.zstack.header.volume.APICreateVolumeSnapshotMsg;

/**
 */
@ApiTimeout(apiClasses = {APICreateVolumeSnapshotMsg.class})
public class TakeSnapshotMsg extends NeedReplyMessage implements PrimaryStorageMessage {
    private String primaryStorageUuid;
    private VolumeSnapshotStruct struct;

    @Override
    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }

    public VolumeSnapshotStruct getStruct() {
        return struct;
    }

    public void setStruct(VolumeSnapshotStruct struct) {
        this.struct = struct;
    }
}


Add cost to wolf totem

Add cost to wolf totem

--- src/main/java/com/corwinjv/mobtotems/blocks/tiles/TotemLogic/WolfLogic.java
+++ src/main/java/com/corwinjv/mobtotems/blocks/tiles/TotemLogic/WolfLogic.java
@@ -1,5 +1,6 @@
 package com.corwinjv.mobtotems.blocks.tiles.TotemLogic;

+import net.minecraft.init.Items;
 import net.minecraft.item.ItemStack;

 import javax.annotation.Nonnull;
@@ -13,6 +14,7 @@
     @Override
     public List<ItemStack> getCost() {
         List<ItemStack> cost = new ArrayList<>();
+        cost.add(new ItemStack(Items.BONE, 4, 0));
         return cost;
     }

<|original_code|>
package com.corwinjv.mobtotems.blocks.tiles.TotemLogic;

import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by CorwinJV on 1/25/2017.
 */
public class WolfLogic extends TotemLogic {
    @Override
    public List<ItemStack> getCost() {
        List<ItemStack> cost = new ArrayList<>();
        return cost;
    }

    @Nonnull
    @Override
    public EffectType getEffectType() {
        return EffectType.EFFECT;
    }
}

<|edits_diff|>
--- src/main/java/com/corwinjv/mobtotems/blocks/tiles/TotemLogic/WolfLogic.java
+++ src/main/java/com/corwinjv/mobtotems/blocks/tiles/TotemLogic/WolfLogic.java
@@ -1,5 +1,6 @@
 package com.corwinjv.mobtotems.blocks.tiles.TotemLogic;

+import net.minecraft.init.Items;
 import net.minecraft.item.ItemStack;

 import javax.annotation.Nonnull;
<|current_version|>
package com.corwinjv.mobtotems.blocks.tiles.TotemLogic;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by CorwinJV on 1/25/2017.
 */
public class WolfLogic extends TotemLogic {
    @Override
    public List<ItemStack> getCost() {
        List<ItemStack> cost = new ArrayList<>();
        return cost;
    }

    @Nonnull
    @Override
    public EffectType getEffectType() {
        return EffectType.EFFECT;
    }
}

<|next_version|>
package com.corwinjv.mobtotems.blocks.tiles.TotemLogic;

import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by CorwinJV on 1/25/2017.
 */
public class WolfLogic extends TotemLogic {
    @Override
    public List<ItemStack> getCost() {
        List<ItemStack> cost = new ArrayList<>();
        cost.add(new ItemStack(Items.BONE, 4, 0));
        return cost;
    }

    @Nonnull
    @Override
    public EffectType getEffectType() {
        return EffectType.EFFECT;
    }
}


Create database table for Location Pucks

--- Evere/app/src/main/java/no/nordicsemi/db/DBOpenHelper.java
+++ Evere/app/src/main/java/no/nordicsemi/db/DBOpenHelper.java
@@ -4,6 +4,8 @@
 import android.database.sqlite.SQLiteDatabase;

 import org.droidparts.persist.sql.AbstractDBOpenHelper;
+
+import no.nordicsemi.models.LocationPuck;

 public class DBOpenHelper extends AbstractDBOpenHelper {

@@ -16,6 +18,7 @@

     @Override
     protected void onCreateTables(SQLiteDatabase sqLiteDatabase) {
+        createTables(sqLiteDatabase, LocationPuck.class);
     }

     @Override

<|original_code|>
package no.nordicsemi.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import org.droidparts.persist.sql.AbstractDBOpenHelper;

public class DBOpenHelper extends AbstractDBOpenHelper {

    private static final String DB_FILE = "Evere.sql";
    private static final int DB_VERSION = 1;

    public DBOpenHelper(Context ctx) {
        super(ctx, DB_FILE, DB_VERSION);
    }

    @Override
    protected void onCreateTables(SQLiteDatabase sqLiteDatabase) {
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        /* TODO: add migration */
        dropTables(db);
        onCreate(db);
    }
}

<|edits_diff|>
--- Evere/app/src/main/java/no/nordicsemi/db/DBOpenHelper.java
+++ Evere/app/src/main/java/no/nordicsemi/db/DBOpenHelper.java
@@ -4,6 +4,8 @@
 import android.database.sqlite.SQLiteDatabase;

 import org.droidparts.persist.sql.AbstractDBOpenHelper;
+
+import no.nordicsemi.models.LocationPuck;

 public class DBOpenHelper extends AbstractDBOpenHelper {

<|current_version|>
package no.nordicsemi.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import org.droidparts.persist.sql.AbstractDBOpenHelper;

import no.nordicsemi.models.LocationPuck;

public class DBOpenHelper extends AbstractDBOpenHelper {

    private static final String DB_FILE = "Evere.sql";
    private static final int DB_VERSION = 1;

    public DBOpenHelper(Context ctx) {
        super(ctx, DB_FILE, DB_VERSION);
    }

    @Override
    protected void onCreateTables(SQLiteDatabase sqLiteDatabase) {
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        /* TODO: add migration */
        dropTables(db);
        onCreate(db);
    }
}

<|next_version|>
package no.nordicsemi.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import org.droidparts.persist.sql.AbstractDBOpenHelper;

import no.nordicsemi.models.LocationPuck;

public class DBOpenHelper extends AbstractDBOpenHelper {

    private static final String DB_FILE = "Evere.sql";
    private static final int DB_VERSION = 1;

    public DBOpenHelper(Context ctx) {
        super(ctx, DB_FILE, DB_VERSION);
    }

    @Override
    protected void onCreateTables(SQLiteDatabase sqLiteDatabase) {
        createTables(sqLiteDatabase, LocationPuck.class);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        /* TODO: add migration */
        dropTables(db);
        onCreate(db);
    }
}


Add error checking to username and password (DEV-99)

--- service-authentication/src/main/java/sg/ncl/service/authentication/controllers/AuthenticationController.java
+++ service-authentication/src/main/java/sg/ncl/service/authentication/controllers/AuthenticationController.java
@@ -5,6 +5,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
+import sg.ncl.common.exceptions.BadRequestException;
 import sg.ncl.service.authentication.AuthenticationService;

 import javax.inject.Inject;
@@ -25,6 +26,9 @@

     @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
     public String login(@RequestHeader("X-Username") String username, @RequestHeader("X-Password") String password) {
+        if (username.isEmpty() || password.isEmpty()) {
+            throw new BadRequestException();
+        }
         return authenticationService.login(username, password);
     }

<|original_code|>
package sg.ncl.service.authentication.controllers;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import sg.ncl.service.authentication.AuthenticationService;

import javax.inject.Inject;

/**
 * @author Christopher Zhong
 */
@RestController
@RequestMapping(path = "/authentication", produces = MediaType.APPLICATION_JSON_VALUE)
public class AuthenticationController {

    private final AuthenticationService authenticationService;

    @Inject
    protected AuthenticationController(final AuthenticationService authenticationService) {
        this.authenticationService = authenticationService;
    }

    @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public String login(@RequestHeader("X-Username") String username, @RequestHeader("X-Password") String password) {
        return authenticationService.login(username, password);
    }

    @RequestMapping(method = RequestMethod.DELETE)
    public void logout() {
        authenticationService.logout();
    }

}

<|edits_diff|>
--- service-authentication/src/main/java/sg/ncl/service/authentication/controllers/AuthenticationController.java
+++ service-authentication/src/main/java/sg/ncl/service/authentication/controllers/AuthenticationController.java
@@ -5,6 +5,7 @@
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
+import sg.ncl.common.exceptions.BadRequestException;
 import sg.ncl.service.authentication.AuthenticationService;

 import javax.inject.Inject;
<|current_version|>
package sg.ncl.service.authentication.controllers;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import sg.ncl.common.exceptions.BadRequestException;
import sg.ncl.service.authentication.AuthenticationService;

import javax.inject.Inject;

/**
 * @author Christopher Zhong
 */
@RestController
@RequestMapping(path = "/authentication", produces = MediaType.APPLICATION_JSON_VALUE)
public class AuthenticationController {

    private final AuthenticationService authenticationService;

    @Inject
    protected AuthenticationController(final AuthenticationService authenticationService) {
        this.authenticationService = authenticationService;
    }

    @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public String login(@RequestHeader("X-Username") String username, @RequestHeader("X-Password") String password) {
        return authenticationService.login(username, password);
    }

    @RequestMapping(method = RequestMethod.DELETE)
    public void logout() {
        authenticationService.logout();
    }

}

<|next_version|>
package sg.ncl.service.authentication.controllers;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import sg.ncl.common.exceptions.BadRequestException;
import sg.ncl.service.authentication.AuthenticationService;

import javax.inject.Inject;

/**
 * @author Christopher Zhong
 */
@RestController
@RequestMapping(path = "/authentication", produces = MediaType.APPLICATION_JSON_VALUE)
public class AuthenticationController {

    private final AuthenticationService authenticationService;

    @Inject
    protected AuthenticationController(final AuthenticationService authenticationService) {
        this.authenticationService = authenticationService;
    }

    @RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    public String login(@RequestHeader("X-Username") String username, @RequestHeader("X-Password") String password) {
        if (username.isEmpty() || password.isEmpty()) {
            throw new BadRequestException();
        }
        return authenticationService.login(username, password);
    }

    @RequestMapping(method = RequestMethod.DELETE)
    public void logout() {
        authenticationService.logout();
    }

}


Add @Provides to watchdogs resource

restapi: Add @Provides to watchdogs resource

Currently the watchdogs resource doesn't have a @Provides annotation. In
theory this shouldn't be required as the annotation is in the base
class. But in practice the application server reacts differently, in
particular if the annotation isn't present the server won't use use the
JAXB or JSON providers when the "Accept" header doesn't have a value.
This means that requests like this:

  DELETE /vms/{vm:id}/watchdogs/{watchdog:id}

Will fail with the following error message:

  Could not find MessageBodyWriter for response object of type:
  org.ovirt.engine.api.model.Action of media type:
  application/octet-stream

This specific problem can be resolved adding the "Accept" header to the
request, and that is good practice. For backwards compatibility sake
this patch adds the annotation.

Change-Id: I1bcb6263450be603b21e398196c6713ad599ce25
Bug-Url: https://bugzilla.redhat.com/1250046
Signed-off-by: Juan Hernandez <59e5b8140de97cc91c3fb6c5342dce948469af8c@redhat.com>

--- backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogResource.java
+++ backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogResource.java
@@ -1,10 +1,12 @@
 package org.ovirt.engine.api.resource;

 import javax.ws.rs.DELETE;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;

 import org.ovirt.engine.api.model.WatchDog;

+@Produces({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
 public interface WatchdogResource extends DeviceResource<WatchDog> {
     @DELETE
     Response remove();

<|original_code|>
package org.ovirt.engine.api.resource;

import javax.ws.rs.DELETE;
import javax.ws.rs.core.Response;

import org.ovirt.engine.api.model.WatchDog;

public interface WatchdogResource extends DeviceResource<WatchDog> {
    @DELETE
    Response remove();
}

<|edits_diff|>
--- backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogResource.java
+++ backend/manager/modules/restapi/interface/definition/src/main/java/org/ovirt/engine/api/resource/WatchdogResource.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.api.resource;

 import javax.ws.rs.DELETE;
+import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;

 import org.ovirt.engine.api.model.WatchDog;
<|current_version|>
package org.ovirt.engine.api.resource;

import javax.ws.rs.DELETE;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.ovirt.engine.api.model.WatchDog;

public interface WatchdogResource extends DeviceResource<WatchDog> {
    @DELETE
    Response remove();
}

<|next_version|>
package org.ovirt.engine.api.resource;

import javax.ws.rs.DELETE;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.ovirt.engine.api.model.WatchDog;

@Produces({ApiMediaType.APPLICATION_XML, ApiMediaType.APPLICATION_JSON, ApiMediaType.APPLICATION_X_YAML})
public interface WatchdogResource extends DeviceResource<WatchDog> {
    @DELETE
    Response remove();
}


Include log warn message for uncaught exceptions

Change-Id: Ia7b43a42e3c0519b27c25467bc65bc405bcd541c

--- kmf-jsonrpcconnector/kmf-jsonrpcconnector-client/src/main/java/com/kurento/kmf/jsonrpcconnector/DefaultJsonRpcHandler.java
+++ kmf-jsonrpcconnector/kmf-jsonrpcconnector-client/src/main/java/com/kurento/kmf/jsonrpcconnector/DefaultJsonRpcHandler.java
@@ -14,7 +14,12 @@
  */
 package com.kurento.kmf.jsonrpcconnector;

+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public abstract class DefaultJsonRpcHandler<P> implements JsonRpcHandler<P> {
+
+	private Logger LOG = LoggerFactory.getLogger(DefaultJsonRpcHandler.class);

 	@Override
 	public void afterConnectionEstablished(Session session) throws Exception {
@@ -32,6 +37,8 @@

 	@Override
 	public void handleUncaughtException(Session session, Exception exception) {
+		LOG.warn("Uncaught exception in handler " + this.getClass().getName(),
+				exception);
 	}

 	@Override

<|original_code|>
/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
package com.kurento.kmf.jsonrpcconnector;

public abstract class DefaultJsonRpcHandler<P> implements JsonRpcHandler<P> {

	@Override
	public void afterConnectionEstablished(Session session) throws Exception {
	}

	@Override
	public void afterConnectionClosed(Session session, String status)
			throws Exception {
	}

	@Override
	public void handleTransportError(Session session, Throwable exception)
			throws Exception {
	}

	@Override
	public void handleUncaughtException(Session session, Exception exception) {
	}

	@Override
	public Class<?> getHandlerType() {
		return this.getClass();
	}
}

<|edits_diff|>
--- kmf-jsonrpcconnector/kmf-jsonrpcconnector-client/src/main/java/com/kurento/kmf/jsonrpcconnector/DefaultJsonRpcHandler.java
+++ kmf-jsonrpcconnector/kmf-jsonrpcconnector-client/src/main/java/com/kurento/kmf/jsonrpcconnector/DefaultJsonRpcHandler.java
@@ -14,7 +14,12 @@
  */
 package com.kurento.kmf.jsonrpcconnector;

+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public abstract class DefaultJsonRpcHandler<P> implements JsonRpcHandler<P> {
+
+	private Logger LOG = LoggerFactory.getLogger(DefaultJsonRpcHandler.class);

 	@Override
 	public void afterConnectionEstablished(Session session) throws Exception {
<|current_version|>
/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
package com.kurento.kmf.jsonrpcconnector;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class DefaultJsonRpcHandler<P> implements JsonRpcHandler<P> {

	private Logger LOG = LoggerFactory.getLogger(DefaultJsonRpcHandler.class);

	@Override
	public void afterConnectionEstablished(Session session) throws Exception {
	}

	@Override
	public void afterConnectionClosed(Session session, String status)
			throws Exception {
	}

	@Override
	public void handleTransportError(Session session, Throwable exception)
			throws Exception {
	}

	@Override
	public void handleUncaughtException(Session session, Exception exception) {
	}

	@Override
	public Class<?> getHandlerType() {
		return this.getClass();
	}
}

<|next_version|>
/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
package com.kurento.kmf.jsonrpcconnector;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class DefaultJsonRpcHandler<P> implements JsonRpcHandler<P> {

	private Logger LOG = LoggerFactory.getLogger(DefaultJsonRpcHandler.class);

	@Override
	public void afterConnectionEstablished(Session session) throws Exception {
	}

	@Override
	public void afterConnectionClosed(Session session, String status)
			throws Exception {
	}

	@Override
	public void handleTransportError(Session session, Throwable exception)
			throws Exception {
	}

	@Override
	public void handleUncaughtException(Session session, Exception exception) {
		LOG.warn("Uncaught exception in handler " + this.getClass().getName(),
				exception);
	}

	@Override
	public Class<?> getHandlerType() {
		return this.getClass();
	}
}


Add a map to promoting priorities.

Add a map to promoting priorities.

--- src/org/nwapw/abacus/number/Function.java
+++ src/org/nwapw/abacus/number/Function.java
@@ -1,6 +1,13 @@
 package org.nwapw.abacus.number;

+import java.util.HashMap;
+
 public abstract class Function {
+
+    private static final HashMap<Class<? extends Number>, Integer> priorityMap =
+            new HashMap<Class<? extends Number>, Integer>() {{
+                put(NaiveNumber.class, 0);
+            }};

     protected abstract boolean matchesParams(Number[] params);
     protected abstract Number applyInternal(Number[] params);

<|original_code|>
package org.nwapw.abacus.number;

public abstract class Function {

    protected abstract boolean matchesParams(Number[] params);
    protected abstract Number applyInternal(Number[] params);

    public Number apply(Number...params) {
        if(!matchesParams(params)) return null;
        return applyInternal(params);
    }

}

<|edits_diff|>
--- src/org/nwapw/abacus/number/Function.java
+++ src/org/nwapw/abacus/number/Function.java
@@ -1,4 +1,6 @@
 package org.nwapw.abacus.number;
+
+import java.util.HashMap;

 public abstract class Function {

<|current_version|>
package org.nwapw.abacus.number;

import java.util.HashMap;

public abstract class Function {

    protected abstract boolean matchesParams(Number[] params);
    protected abstract Number applyInternal(Number[] params);

    public Number apply(Number...params) {
        if(!matchesParams(params)) return null;
        return applyInternal(params);
    }

}

<|next_version|>
package org.nwapw.abacus.number;

import java.util.HashMap;

public abstract class Function {

    private static final HashMap<Class<? extends Number>, Integer> priorityMap =
            new HashMap<Class<? extends Number>, Integer>() {{
                put(NaiveNumber.class, 0);
            }};

    protected abstract boolean matchesParams(Number[] params);
    protected abstract Number applyInternal(Number[] params);

    public Number apply(Number...params) {
        if(!matchesParams(params)) return null;
        return applyInternal(params);
    }

}


Increase the AsyncStorage capacity fromm 5mb to 100mb

--- android/app/src/main/java/com/ebudgie/MainApplication.java
+++ android/app/src/main/java/com/ebudgie/MainApplication.java
@@ -7,6 +7,7 @@
 import io.underscope.react.fbak.RNAccountKitPackage;
 import com.cboy.rn.splashscreen.SplashScreenReactPackage;
 import com.oblador.vectoricons.VectorIconsPackage;
+import com.facebook.react.modules.storage.ReactDatabaseSupplier;
 import com.facebook.react.ReactInstanceManager;
 import com.facebook.react.ReactNativeHost;
 import com.facebook.react.ReactPackage;
@@ -26,6 +27,9 @@

     @Override
     protected List<ReactPackage> getPackages() {
+      long size = 100L * 1024L * 1024L; // 100 MB
+      ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);
+
       return Arrays.<ReactPackage>asList(
           new MainReactPackage(),
             new RNAccountKitPackage(),

<|original_code|>
package com.ebudgie;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import io.underscope.react.fbak.RNAccountKitPackage;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNAccountKitPackage(),
            new SplashScreenReactPackage(),
            new VectorIconsPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

<|edits_diff|>
--- android/app/src/main/java/com/ebudgie/MainApplication.java
+++ android/app/src/main/java/com/ebudgie/MainApplication.java
@@ -7,6 +7,7 @@
 import io.underscope.react.fbak.RNAccountKitPackage;
 import com.cboy.rn.splashscreen.SplashScreenReactPackage;
 import com.oblador.vectoricons.VectorIconsPackage;
+import com.facebook.react.modules.storage.ReactDatabaseSupplier;
 import com.facebook.react.ReactInstanceManager;
 import com.facebook.react.ReactNativeHost;
 import com.facebook.react.ReactPackage;
<|current_version|>
package com.ebudgie;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import io.underscope.react.fbak.RNAccountKitPackage;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.modules.storage.ReactDatabaseSupplier;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNAccountKitPackage(),
            new SplashScreenReactPackage(),
            new VectorIconsPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

<|next_version|>
package com.ebudgie;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import io.underscope.react.fbak.RNAccountKitPackage;
import com.cboy.rn.splashscreen.SplashScreenReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.facebook.react.modules.storage.ReactDatabaseSupplier;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    protected boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      long size = 100L * 1024L * 1024L; // 100 MB
      ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);

      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNAccountKitPackage(),
            new SplashScreenReactPackage(),
            new VectorIconsPackage()
      );
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}