Disable integration test on Linux

Disable integration test on Linux

See gh-19836

--- spring-boot-project/spring-boot-tools/spring-boot-cloudnativebuildpack/src/test/java/org/springframework/boot/cloudnativebuildpack/docker/DockerApiIntegrationTests.java
+++ spring-boot-project/spring-boot-tools/spring-boot-cloudnativebuildpack/src/test/java/org/springframework/boot/cloudnativebuildpack/docker/DockerApiIntegrationTests.java
@@ -19,6 +19,8 @@
 import java.io.IOException;

 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.condition.OS;

 import org.springframework.boot.cloudnativebuildpack.docker.type.ImageReference;
 import org.springframework.boot.testsupport.testcontainers.DisabledIfDockerUnavailable;
@@ -29,6 +31,7 @@
  * @author Phillip Webb
  */
 @DisabledIfDockerUnavailable
+@DisabledOnOs(OS.LINUX)
 class DockerApiIntegrationTests {

 	private final DockerApi docker = new DockerApi();

<|original_code|>
/*
 * Copyright 2012-2020 the original author or authors.
 *
 * 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
 *
 *      https://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.springframework.boot.cloudnativebuildpack.docker;

import java.io.IOException;

import org.junit.jupiter.api.Test;

import org.springframework.boot.cloudnativebuildpack.docker.type.ImageReference;
import org.springframework.boot.testsupport.testcontainers.DisabledIfDockerUnavailable;

/**
 * Integration tests for {@link DockerApi}.
 *
 * @author Phillip Webb
 */
@DisabledIfDockerUnavailable
class DockerApiIntegrationTests {

	private final DockerApi docker = new DockerApi();

	@Test
	void pullImage() throws IOException {
		this.docker.image().pull(ImageReference.of("cloudfoundry/cnb:bionic"),
				new TotalProgressPullListener(new TotalProgressBar("Pulling: ")));
	}

}

<|edits_diff|>
--- spring-boot-project/spring-boot-tools/spring-boot-cloudnativebuildpack/src/test/java/org/springframework/boot/cloudnativebuildpack/docker/DockerApiIntegrationTests.java
+++ spring-boot-project/spring-boot-tools/spring-boot-cloudnativebuildpack/src/test/java/org/springframework/boot/cloudnativebuildpack/docker/DockerApiIntegrationTests.java
@@ -19,6 +19,8 @@
 import java.io.IOException;

 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.DisabledOnOs;
+import org.junit.jupiter.api.condition.OS;

 import org.springframework.boot.cloudnativebuildpack.docker.type.ImageReference;
 import org.springframework.boot.testsupport.testcontainers.DisabledIfDockerUnavailable;
<|current_version|>
/*
 * Copyright 2012-2020 the original author or authors.
 *
 * 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
 *
 *      https://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.springframework.boot.cloudnativebuildpack.docker;

import java.io.IOException;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import org.springframework.boot.cloudnativebuildpack.docker.type.ImageReference;
import org.springframework.boot.testsupport.testcontainers.DisabledIfDockerUnavailable;

/**
 * Integration tests for {@link DockerApi}.
 *
 * @author Phillip Webb
 */
@DisabledIfDockerUnavailable
class DockerApiIntegrationTests {

	private final DockerApi docker = new DockerApi();

	@Test
	void pullImage() throws IOException {
		this.docker.image().pull(ImageReference.of("cloudfoundry/cnb:bionic"),
				new TotalProgressPullListener(new TotalProgressBar("Pulling: ")));
	}

}

<|next_version|>
/*
 * Copyright 2012-2020 the original author or authors.
 *
 * 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
 *
 *      https://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.springframework.boot.cloudnativebuildpack.docker;

import java.io.IOException;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import org.springframework.boot.cloudnativebuildpack.docker.type.ImageReference;
import org.springframework.boot.testsupport.testcontainers.DisabledIfDockerUnavailable;

/**
 * Integration tests for {@link DockerApi}.
 *
 * @author Phillip Webb
 */
@DisabledIfDockerUnavailable
@DisabledOnOs(OS.LINUX)
class DockerApiIntegrationTests {

	private final DockerApi docker = new DockerApi();

	@Test
	void pullImage() throws IOException {
		this.docker.image().pull(ImageReference.of("cloudfoundry/cnb:bionic"),
				new TotalProgressPullListener(new TotalProgressBar("Pulling: ")));
	}

}


Add documentation for SoupBinTCP exception

--- nassau/src/main/java/org/jvirtanen/nassau/soupbintcp/SoupBinTCPException.java
+++ nassau/src/main/java/org/jvirtanen/nassau/soupbintcp/SoupBinTCPException.java
@@ -2,8 +2,16 @@

 import org.jvirtanen.nassau.ProtocolException;

+/**
+ * Indicates a protocol error while handling the SoupBinTCP protocol.
+ */
 public class SoupBinTCPException extends ProtocolException {

+    /**
+     * Create an instance with the specified detail message.
+     *
+     * @param message the detail message
+     */
     public SoupBinTCPException(String message) {
         super(message);
     }

<|original_code|>
package org.jvirtanen.nassau.soupbintcp;

import org.jvirtanen.nassau.ProtocolException;

public class SoupBinTCPException extends ProtocolException {

    public SoupBinTCPException(String message) {
        super(message);
    }

}

<|edits_diff|>
--- nassau/src/main/java/org/jvirtanen/nassau/soupbintcp/SoupBinTCPException.java
+++ nassau/src/main/java/org/jvirtanen/nassau/soupbintcp/SoupBinTCPException.java
@@ -2,6 +2,9 @@

 import org.jvirtanen.nassau.ProtocolException;

+/**
+ * Indicates a protocol error while handling the SoupBinTCP protocol.
+ */
 public class SoupBinTCPException extends ProtocolException {

     public SoupBinTCPException(String message) {
<|current_version|>
package org.jvirtanen.nassau.soupbintcp;

import org.jvirtanen.nassau.ProtocolException;

/**
 * Indicates a protocol error while handling the SoupBinTCP protocol.
 */
public class SoupBinTCPException extends ProtocolException {

    public SoupBinTCPException(String message) {
        super(message);
    }

}

<|next_version|>
package org.jvirtanen.nassau.soupbintcp;

import org.jvirtanen.nassau.ProtocolException;

/**
 * Indicates a protocol error while handling the SoupBinTCP protocol.
 */
public class SoupBinTCPException extends ProtocolException {

    /**
     * Create an instance with the specified detail message.
     *
     * @param message the detail message
     */
    public SoupBinTCPException(String message) {
        super(message);
    }

}


Add client IP address to MDC for logging. PL-11395.

--- src/main/java/com/amee/restlet/AMEERequestFilter.java
+++ src/main/java/com/amee/restlet/AMEERequestFilter.java
@@ -3,6 +3,7 @@
 import org.restlet.Filter;
 import org.restlet.data.Request;
 import org.restlet.data.Response;
+import org.slf4j.MDC;

 /**
  * Filter to manage {@link RequestContext}s. Will create the {@link RequestContext} for the transaction log.
@@ -12,21 +13,33 @@
     protected int doHandle(Request request, Response response) {
         RequestContext requestContext = new RequestContext();
         try {
+
             // Create the RequestContext.
             requestContext.setRequest(request);
             request.getAttributes().put("requestContext", requestContext);
+
+            // Add the client IP address for logging.
+            MDC.put("ipAddress", request.getClientInfo().getAddress());
+
             // Delegate request handling to the super class.
             return super.doHandle(request, response);
         } catch (Throwable t) {
+
             // Record the exception in the RequestContext.
             requestContext.setError(t.getMessage());
             requestContext.error();
+
             // Wrap and re-throw the exception.
             throw new RuntimeException(t);
         } finally {
+
             // Update and record the RequestContext at the end of the request.
             requestContext.setStatus(response.getStatus());
             requestContext.record();
+            MDC.remove("ipAddress");
+
+            // User UID is added in CollectCredentialsGuard.
+            MDC.remove("userUid");
         }
     }
 }

<|original_code|>
package com.amee.restlet;

import org.restlet.Filter;
import org.restlet.data.Request;
import org.restlet.data.Response;

/**
 * Filter to manage {@link RequestContext}s. Will create the {@link RequestContext} for the transaction log.
 */
public class AMEERequestFilter extends Filter {

    protected int doHandle(Request request, Response response) {
        RequestContext requestContext = new RequestContext();
        try {
            // Create the RequestContext.
            requestContext.setRequest(request);
            request.getAttributes().put("requestContext", requestContext);
            // Delegate request handling to the super class.
            return super.doHandle(request, response);
        } catch (Throwable t) {
            // Record the exception in the RequestContext.
            requestContext.setError(t.getMessage());
            requestContext.error();
            // Wrap and re-throw the exception.
            throw new RuntimeException(t);
        } finally {
            // Update and record the RequestContext at the end of the request.
            requestContext.setStatus(response.getStatus());
            requestContext.record();
        }
    }
}
<|edits_diff|>
--- src/main/java/com/amee/restlet/AMEERequestFilter.java
+++ src/main/java/com/amee/restlet/AMEERequestFilter.java
@@ -3,6 +3,7 @@
 import org.restlet.Filter;
 import org.restlet.data.Request;
 import org.restlet.data.Response;
+import org.slf4j.MDC;

 /**
  * Filter to manage {@link RequestContext}s. Will create the {@link RequestContext} for the transaction log.
@@ -12,18 +13,26 @@
     protected int doHandle(Request request, Response response) {
         RequestContext requestContext = new RequestContext();
         try {
+
             // Create the RequestContext.
             requestContext.setRequest(request);
             request.getAttributes().put("requestContext", requestContext);
+
+            // Add the client IP address for logging.
+            MDC.put("ipAddress", request.getClientInfo().getAddress());
+
             // Delegate request handling to the super class.
             return super.doHandle(request, response);
         } catch (Throwable t) {
+
             // Record the exception in the RequestContext.
             requestContext.setError(t.getMessage());
             requestContext.error();
+
             // Wrap and re-throw the exception.
             throw new RuntimeException(t);
         } finally {
+
             // Update and record the RequestContext at the end of the request.
             requestContext.setStatus(response.getStatus());
             requestContext.record();
<|current_version|>
package com.amee.restlet;

import org.restlet.Filter;
import org.restlet.data.Request;
import org.restlet.data.Response;
import org.slf4j.MDC;

/**
 * Filter to manage {@link RequestContext}s. Will create the {@link RequestContext} for the transaction log.
 */
public class AMEERequestFilter extends Filter {

    protected int doHandle(Request request, Response response) {
        RequestContext requestContext = new RequestContext();
        try {

            // Create the RequestContext.
            requestContext.setRequest(request);
            request.getAttributes().put("requestContext", requestContext);

            // Add the client IP address for logging.
            MDC.put("ipAddress", request.getClientInfo().getAddress());

            // Delegate request handling to the super class.
            return super.doHandle(request, response);
        } catch (Throwable t) {

            // Record the exception in the RequestContext.
            requestContext.setError(t.getMessage());
            requestContext.error();

            // Wrap and re-throw the exception.
            throw new RuntimeException(t);
        } finally {

            // Update and record the RequestContext at the end of the request.
            requestContext.setStatus(response.getStatus());
            requestContext.record();
        }
    }
}
<|next_version|>
package com.amee.restlet;

import org.restlet.Filter;
import org.restlet.data.Request;
import org.restlet.data.Response;
import org.slf4j.MDC;

/**
 * Filter to manage {@link RequestContext}s. Will create the {@link RequestContext} for the transaction log.
 */
public class AMEERequestFilter extends Filter {

    protected int doHandle(Request request, Response response) {
        RequestContext requestContext = new RequestContext();
        try {

            // Create the RequestContext.
            requestContext.setRequest(request);
            request.getAttributes().put("requestContext", requestContext);

            // Add the client IP address for logging.
            MDC.put("ipAddress", request.getClientInfo().getAddress());

            // Delegate request handling to the super class.
            return super.doHandle(request, response);
        } catch (Throwable t) {

            // Record the exception in the RequestContext.
            requestContext.setError(t.getMessage());
            requestContext.error();

            // Wrap and re-throw the exception.
            throw new RuntimeException(t);
        } finally {

            // Update and record the RequestContext at the end of the request.
            requestContext.setStatus(response.getStatus());
            requestContext.record();
            MDC.remove("ipAddress");

            // User UID is added in CollectCredentialsGuard.
            MDC.remove("userUid");
        }
    }
}


Add updated_at property to base entity.

Add updated_at property to base entity.

--- src/main/java/com/uwetrottmann/trakt/v2/entities/BaseEntity.java
+++ src/main/java/com/uwetrottmann/trakt/v2/entities/BaseEntity.java
@@ -1,10 +1,13 @@
 package com.uwetrottmann.trakt.v2.entities;
+
+import org.joda.time.DateTime;

 import java.util.List;

 public abstract class BaseEntity {

     public String title;
+    public DateTime updated_at;
     public Images images;
     public List<String> available_translations;

<|original_code|>
package com.uwetrottmann.trakt.v2.entities;

import java.util.List;

public abstract class BaseEntity {

    public String title;
    public Images images;
    public List<String> available_translations;

}

<|edits_diff|>
--- src/main/java/com/uwetrottmann/trakt/v2/entities/BaseEntity.java
+++ src/main/java/com/uwetrottmann/trakt/v2/entities/BaseEntity.java
@@ -1,4 +1,6 @@
 package com.uwetrottmann.trakt.v2.entities;
+
+import org.joda.time.DateTime;

 import java.util.List;

<|current_version|>
package com.uwetrottmann.trakt.v2.entities;

import org.joda.time.DateTime;

import java.util.List;

public abstract class BaseEntity {

    public String title;
    public Images images;
    public List<String> available_translations;

}

<|next_version|>
package com.uwetrottmann.trakt.v2.entities;

import org.joda.time.DateTime;

import java.util.List;

public abstract class BaseEntity {

    public String title;
    public DateTime updated_at;
    public Images images;
    public List<String> available_translations;

}


Annotate MemberDAO DB access methods with @UnitOfWork

--- src/main/java/me/chriskramp/library/MemberResource.java
+++ src/main/java/me/chriskramp/library/MemberResource.java
@@ -1,4 +1,6 @@
 package me.chriskramp.library;
+
+import com.yammer.dropwizard.hibernate.UnitOfWork;

 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -20,17 +22,20 @@
   }

   @GET
+  @UnitOfWork
   public List<Member> getAllMembers() {
     return memberDAO.getAllMembers();
   }

   @GET
+  @UnitOfWork
   @Path("{id}")
   public Member getMember(@PathParam("id") Long id) {
     return memberDAO.findById(id);
   }

   @POST
+  @UnitOfWork
   @Path("/create")
   @Consumes(MediaType.APPLICATION_JSON)
   public Member createMember(Member member) {

<|original_code|>
package me.chriskramp.library;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/members")
@Produces(MediaType.APPLICATION_JSON)
public class MemberResource {

  private MemberDAO memberDAO;

  public MemberResource(MemberDAO memberDAO) {
    this.memberDAO = memberDAO;
  }

  @GET
  public List<Member> getAllMembers() {
    return memberDAO.getAllMembers();
  }

  @GET
  @Path("{id}")
  public Member getMember(@PathParam("id") Long id) {
    return memberDAO.findById(id);
  }

  @POST
  @Path("/create")
  @Consumes(MediaType.APPLICATION_JSON)
  public Member createMember(Member member) {
    return memberDAO.save(member);
  }
}

<|edits_diff|>
--- src/main/java/me/chriskramp/library/MemberResource.java
+++ src/main/java/me/chriskramp/library/MemberResource.java
@@ -1,4 +1,6 @@
 package me.chriskramp.library;
+
+import com.yammer.dropwizard.hibernate.UnitOfWork;

 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -20,11 +22,13 @@
   }

   @GET
+  @UnitOfWork
   public List<Member> getAllMembers() {
     return memberDAO.getAllMembers();
   }

   @GET
+  @UnitOfWork
   @Path("{id}")
   public Member getMember(@PathParam("id") Long id) {
     return memberDAO.findById(id);
<|current_version|>
package me.chriskramp.library;

import com.yammer.dropwizard.hibernate.UnitOfWork;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/members")
@Produces(MediaType.APPLICATION_JSON)
public class MemberResource {

  private MemberDAO memberDAO;

  public MemberResource(MemberDAO memberDAO) {
    this.memberDAO = memberDAO;
  }

  @GET
  @UnitOfWork
  public List<Member> getAllMembers() {
    return memberDAO.getAllMembers();
  }

  @GET
  @UnitOfWork
  @Path("{id}")
  public Member getMember(@PathParam("id") Long id) {
    return memberDAO.findById(id);
  }

  @POST
  @Path("/create")
  @Consumes(MediaType.APPLICATION_JSON)
  public Member createMember(Member member) {
    return memberDAO.save(member);
  }
}

<|next_version|>
package me.chriskramp.library;

import com.yammer.dropwizard.hibernate.UnitOfWork;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/members")
@Produces(MediaType.APPLICATION_JSON)
public class MemberResource {

  private MemberDAO memberDAO;

  public MemberResource(MemberDAO memberDAO) {
    this.memberDAO = memberDAO;
  }

  @GET
  @UnitOfWork
  public List<Member> getAllMembers() {
    return memberDAO.getAllMembers();
  }

  @GET
  @UnitOfWork
  @Path("{id}")
  public Member getMember(@PathParam("id") Long id) {
    return memberDAO.findById(id);
  }

  @POST
  @UnitOfWork
  @Path("/create")
  @Consumes(MediaType.APPLICATION_JSON)
  public Member createMember(Member member) {
    return memberDAO.save(member);
  }
}


Call init to add blocks.

Call init to add blocks.

--- src/main/java/com/pseudo_sudo/openstorage/OpenStorage.java
+++ src/main/java/com/pseudo_sudo/openstorage/OpenStorage.java
@@ -1,6 +1,7 @@
 package com.pseudo_sudo.openstorage;

 import com.pseudo_sudo.openstorage.configuration.ConfigurationController;
+import com.pseudo_sudo.openstorage.init.ModBlocks;
 import cpw.mods.fml.common.Mod;
 import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@@ -19,5 +20,7 @@
     @Mod.EventHandler
     public void preInit(FMLPreInitializationEvent event) {
         this.configurationController = new ConfigurationController(event.getSuggestedConfigurationFile());
+
+        ModBlocks.init();
     }
 }

<|original_code|>
package com.pseudo_sudo.openstorage;

import com.pseudo_sudo.openstorage.configuration.ConfigurationController;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid=OpenStorage.ID, name=OpenStorage.NAME, version=OpenStorage.VERSION)
public class OpenStorage {
    public static final String ID = "OpenStorage";
    public static final String ID_LOWER = ID.toLowerCase();
    public static final String NAME = "OpenStorage";
    public static final String VERSION = "1.7.10-0.1";

    private ConfigurationController configurationController;

    @Mod.Instance(OpenStorage.ID)
    public static OpenStorage instance;

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        this.configurationController = new ConfigurationController(event.getSuggestedConfigurationFile());
    }
}

<|edits_diff|>
--- src/main/java/com/pseudo_sudo/openstorage/OpenStorage.java
+++ src/main/java/com/pseudo_sudo/openstorage/OpenStorage.java
@@ -1,6 +1,7 @@
 package com.pseudo_sudo.openstorage;

 import com.pseudo_sudo.openstorage.configuration.ConfigurationController;
+import com.pseudo_sudo.openstorage.init.ModBlocks;
 import cpw.mods.fml.common.Mod;
 import cpw.mods.fml.common.event.FMLPreInitializationEvent;

<|current_version|>
package com.pseudo_sudo.openstorage;

import com.pseudo_sudo.openstorage.configuration.ConfigurationController;
import com.pseudo_sudo.openstorage.init.ModBlocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid=OpenStorage.ID, name=OpenStorage.NAME, version=OpenStorage.VERSION)
public class OpenStorage {
    public static final String ID = "OpenStorage";
    public static final String ID_LOWER = ID.toLowerCase();
    public static final String NAME = "OpenStorage";
    public static final String VERSION = "1.7.10-0.1";

    private ConfigurationController configurationController;

    @Mod.Instance(OpenStorage.ID)
    public static OpenStorage instance;

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        this.configurationController = new ConfigurationController(event.getSuggestedConfigurationFile());
    }
}

<|next_version|>
package com.pseudo_sudo.openstorage;

import com.pseudo_sudo.openstorage.configuration.ConfigurationController;
import com.pseudo_sudo.openstorage.init.ModBlocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

@Mod(modid=OpenStorage.ID, name=OpenStorage.NAME, version=OpenStorage.VERSION)
public class OpenStorage {
    public static final String ID = "OpenStorage";
    public static final String ID_LOWER = ID.toLowerCase();
    public static final String NAME = "OpenStorage";
    public static final String VERSION = "1.7.10-0.1";

    private ConfigurationController configurationController;

    @Mod.Instance(OpenStorage.ID)
    public static OpenStorage instance;

    @Mod.EventHandler
    public void preInit(FMLPreInitializationEvent event) {
        this.configurationController = new ConfigurationController(event.getSuggestedConfigurationFile());

        ModBlocks.init();
    }
}


Fix logger injection to demo endpoint

Fix logger injection to demo endpoint

--- demo-cdi/src/main/java/org/gluu/demo/rest/DemoEndpoint.java
+++ demo-cdi/src/main/java/org/gluu/demo/rest/DemoEndpoint.java
@@ -1,5 +1,6 @@
 package org.gluu.demo.rest;

+import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -8,6 +9,7 @@
 import org.slf4j.Logger;

 @Path("/demo")
+@ApplicationScoped
 public class DemoEndpoint {

 	@Inject

<|original_code|>
package org.gluu.demo.rest;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import org.slf4j.Logger;

@Path("/demo")
public class DemoEndpoint {

	@Inject
	private Logger log;

	@GET
	@Path("/status")
	public Response listClients() {
		log.info("Get request to demo endpoint");
		return Response.ok("success").build();
	}

}

<|edits_diff|>
--- demo-cdi/src/main/java/org/gluu/demo/rest/DemoEndpoint.java
+++ demo-cdi/src/main/java/org/gluu/demo/rest/DemoEndpoint.java
@@ -1,5 +1,6 @@
 package org.gluu.demo.rest;

+import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
<|current_version|>
package org.gluu.demo.rest;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import org.slf4j.Logger;

@Path("/demo")
public class DemoEndpoint {

	@Inject
	private Logger log;

	@GET
	@Path("/status")
	public Response listClients() {
		log.info("Get request to demo endpoint");
		return Response.ok("success").build();
	}

}

<|next_version|>
package org.gluu.demo.rest;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;

import org.slf4j.Logger;

@Path("/demo")
@ApplicationScoped
public class DemoEndpoint {

	@Inject
	private Logger log;

	@GET
	@Path("/status")
	public Response listClients() {
		log.info("Get request to demo endpoint");
		return Response.ok("success").build();
	}

}


Test for null identity context

Test for null identity context

--- domain/core-api/src/test/java/io/motown/domain/api/chargingstation/AcceptChargingStationCommandTest.java
+++ domain/core-api/src/test/java/io/motown/domain/api/chargingstation/AcceptChargingStationCommandTest.java
@@ -17,6 +17,7 @@

 import org.junit.Test;

+import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.CHARGING_STATION_ID;
 import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.IDENTITY_CONTEXT;

 public class AcceptChargingStationCommandTest {
@@ -25,4 +26,9 @@
     public void nullPointerExceptionThrownWhenCreatingCommandWithChargingStationIdNull() {
         new AcceptChargingStationCommand(null, IDENTITY_CONTEXT);
     }
+
+    @Test(expected = NullPointerException.class)
+    public void nullPointerExceptionThrownWhenCreatingCommandWithIdentityContextNull() {
+        new AcceptChargingStationCommand(CHARGING_STATION_ID, null);
+    }
 }

<|original_code|>
/**
 * Copyright (C) 2013 Motown.IO (info@motown.io)
 *
 * 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 io.motown.domain.api.chargingstation;

import org.junit.Test;

import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.IDENTITY_CONTEXT;

public class AcceptChargingStationCommandTest {

    @Test(expected = NullPointerException.class)
    public void nullPointerExceptionThrownWhenCreatingCommandWithChargingStationIdNull() {
        new AcceptChargingStationCommand(null, IDENTITY_CONTEXT);
    }
}
<|edits_diff|>
--- domain/core-api/src/test/java/io/motown/domain/api/chargingstation/AcceptChargingStationCommandTest.java
+++ domain/core-api/src/test/java/io/motown/domain/api/chargingstation/AcceptChargingStationCommandTest.java
@@ -17,6 +17,7 @@

 import org.junit.Test;

+import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.CHARGING_STATION_ID;
 import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.IDENTITY_CONTEXT;

 public class AcceptChargingStationCommandTest {
<|current_version|>
/**
 * Copyright (C) 2013 Motown.IO (info@motown.io)
 *
 * 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 io.motown.domain.api.chargingstation;

import org.junit.Test;

import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.CHARGING_STATION_ID;
import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.IDENTITY_CONTEXT;

public class AcceptChargingStationCommandTest {

    @Test(expected = NullPointerException.class)
    public void nullPointerExceptionThrownWhenCreatingCommandWithChargingStationIdNull() {
        new AcceptChargingStationCommand(null, IDENTITY_CONTEXT);
    }
}
<|next_version|>
/**
 * Copyright (C) 2013 Motown.IO (info@motown.io)
 *
 * 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 io.motown.domain.api.chargingstation;

import org.junit.Test;

import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.CHARGING_STATION_ID;
import static io.motown.domain.api.chargingstation.test.ChargingStationTestUtils.IDENTITY_CONTEXT;

public class AcceptChargingStationCommandTest {

    @Test(expected = NullPointerException.class)
    public void nullPointerExceptionThrownWhenCreatingCommandWithChargingStationIdNull() {
        new AcceptChargingStationCommand(null, IDENTITY_CONTEXT);
    }

    @Test(expected = NullPointerException.class)
    public void nullPointerExceptionThrownWhenCreatingCommandWithIdentityContextNull() {
        new AcceptChargingStationCommand(CHARGING_STATION_ID, null);
    }
}


Add @Keep annotation to not over-optimize my enums!

--- app/src/main/java/com/pr0gramm/app/services/config/Config.java
+++ app/src/main/java/com/pr0gramm/app/services/config/Config.java
@@ -1,4 +1,6 @@
 package com.pr0gramm.app.services.config;
+
+import android.support.annotation.Keep;

 import org.immutables.gson.Gson;
 import org.immutables.value.Value;
@@ -38,6 +40,7 @@
         return AdType.NONE;
     }

+    @Keep
     public enum AdType {
         NONE, FEED, MAIN;
     }

<|original_code|>
package com.pr0gramm.app.services.config;

import org.immutables.gson.Gson;
import org.immutables.value.Value;

/**
 */
@Value.Immutable
@Gson.TypeAdapters
public abstract class Config {
    @Value.Default
    public boolean extraCategories() {
        return true;
    }

    @Value.Default
    public long maxUploadSizeNormal() {
        return 6 * 1024 * 1024;
    }

    @Value.Default
    public long maxUploadSizePremium() {
        return 12 * 1024 * 1024;
    }

    @Value.Default
    public boolean searchUsingTagService() {
        return false;
    }

    @Value.Default
    public boolean secretSanta() {
        return false;
    }

    @Value.Default
    public AdType adType() {
        return AdType.NONE;
    }

    public enum AdType {
        NONE, FEED, MAIN;
    }
}

<|edits_diff|>
--- app/src/main/java/com/pr0gramm/app/services/config/Config.java
+++ app/src/main/java/com/pr0gramm/app/services/config/Config.java
@@ -1,4 +1,6 @@
 package com.pr0gramm.app.services.config;
+
+import android.support.annotation.Keep;

 import org.immutables.gson.Gson;
 import org.immutables.value.Value;
<|current_version|>
package com.pr0gramm.app.services.config;

import android.support.annotation.Keep;

import org.immutables.gson.Gson;
import org.immutables.value.Value;

/**
 */
@Value.Immutable
@Gson.TypeAdapters
public abstract class Config {
    @Value.Default
    public boolean extraCategories() {
        return true;
    }

    @Value.Default
    public long maxUploadSizeNormal() {
        return 6 * 1024 * 1024;
    }

    @Value.Default
    public long maxUploadSizePremium() {
        return 12 * 1024 * 1024;
    }

    @Value.Default
    public boolean searchUsingTagService() {
        return false;
    }

    @Value.Default
    public boolean secretSanta() {
        return false;
    }

    @Value.Default
    public AdType adType() {
        return AdType.NONE;
    }

    public enum AdType {
        NONE, FEED, MAIN;
    }
}

<|next_version|>
package com.pr0gramm.app.services.config;

import android.support.annotation.Keep;

import org.immutables.gson.Gson;
import org.immutables.value.Value;

/**
 */
@Value.Immutable
@Gson.TypeAdapters
public abstract class Config {
    @Value.Default
    public boolean extraCategories() {
        return true;
    }

    @Value.Default
    public long maxUploadSizeNormal() {
        return 6 * 1024 * 1024;
    }

    @Value.Default
    public long maxUploadSizePremium() {
        return 12 * 1024 * 1024;
    }

    @Value.Default
    public boolean searchUsingTagService() {
        return false;
    }

    @Value.Default
    public boolean secretSanta() {
        return false;
    }

    @Value.Default
    public AdType adType() {
        return AdType.NONE;
    }

    @Keep
    public enum AdType {
        NONE, FEED, MAIN;
    }
}


Check for undo-ing delete commands of task without start or deadline

--- src/main/java/seedu/address/logic/parser/NattyParser.java
+++ src/main/java/seedu/address/logic/parser/NattyParser.java
@@ -7,6 +7,7 @@

 public class NattyParser {
     private static NattyParser instance = null;
+    private static String emptyValue = "-";
     // Exists only to defeat instantiation.
     protected NattyParser() {
     }
@@ -27,6 +28,9 @@
      * @return String - Timestamp
      */
     public String parseNLPDate(String argsString) {
+        if (argsString.trim().equals(emptyValue)) {
+            return emptyValue;
+        }
         com.joestelmach.natty.Parser nParser = new com.joestelmach.natty.Parser();
         List<DateGroup> groups = nParser.parse(argsString);
         String output = "";

<|original_code|>
//@@author A0114395E
package seedu.address.logic.parser;

import java.util.List;

import com.joestelmach.natty.DateGroup;

public class NattyParser {
    private static NattyParser instance = null;
    // Exists only to defeat instantiation.
    protected NattyParser() {
    }

    // Returns the singleton instance
    public static NattyParser getInstance() {
        if (instance == null) {
            instance = new NattyParser();
        }
        return instance;
    }

    /**
     * Parses, analyses and converts 'rich text' into a timestamp
     *
     * @param String - e.g. 'Tomorrow'
     * @return String - Timestamp
     */
    public String parseNLPDate(String argsString) {
        com.joestelmach.natty.Parser nParser = new com.joestelmach.natty.Parser();
        List<DateGroup> groups = nParser.parse(argsString);
        String output = "";
        for (DateGroup group : groups) {
            output = group.getDates().get(0).toString().replace("CST", "");
        }
        return output;
    }
}

<|edits_diff|>
--- src/main/java/seedu/address/logic/parser/NattyParser.java
+++ src/main/java/seedu/address/logic/parser/NattyParser.java
@@ -7,6 +7,7 @@

 public class NattyParser {
     private static NattyParser instance = null;
+    private static String emptyValue = "-";
     // Exists only to defeat instantiation.
     protected NattyParser() {
     }
<|current_version|>
//@@author A0114395E
package seedu.address.logic.parser;

import java.util.List;

import com.joestelmach.natty.DateGroup;

public class NattyParser {
    private static NattyParser instance = null;
    private static String emptyValue = "-";
    // Exists only to defeat instantiation.
    protected NattyParser() {
    }

    // Returns the singleton instance
    public static NattyParser getInstance() {
        if (instance == null) {
            instance = new NattyParser();
        }
        return instance;
    }

    /**
     * Parses, analyses and converts 'rich text' into a timestamp
     *
     * @param String - e.g. 'Tomorrow'
     * @return String - Timestamp
     */
    public String parseNLPDate(String argsString) {
        com.joestelmach.natty.Parser nParser = new com.joestelmach.natty.Parser();
        List<DateGroup> groups = nParser.parse(argsString);
        String output = "";
        for (DateGroup group : groups) {
            output = group.getDates().get(0).toString().replace("CST", "");
        }
        return output;
    }
}

<|next_version|>
//@@author A0114395E
package seedu.address.logic.parser;

import java.util.List;

import com.joestelmach.natty.DateGroup;

public class NattyParser {
    private static NattyParser instance = null;
    private static String emptyValue = "-";
    // Exists only to defeat instantiation.
    protected NattyParser() {
    }

    // Returns the singleton instance
    public static NattyParser getInstance() {
        if (instance == null) {
            instance = new NattyParser();
        }
        return instance;
    }

    /**
     * Parses, analyses and converts 'rich text' into a timestamp
     *
     * @param String - e.g. 'Tomorrow'
     * @return String - Timestamp
     */
    public String parseNLPDate(String argsString) {
        if (argsString.trim().equals(emptyValue)) {
            return emptyValue;
        }
        com.joestelmach.natty.Parser nParser = new com.joestelmach.natty.Parser();
        List<DateGroup> groups = nParser.parse(argsString);
        String output = "";
        for (DateGroup group : groups) {
            output = group.getDates().get(0).toString().replace("CST", "");
        }
        return output;
    }
}


Fix interaction with door by replicating the BlockReginoComponent.

--- engine/src/main/java/org/terasology/world/block/regions/BlockRegionComponent.java
+++ engine/src/main/java/org/terasology/world/block/regions/BlockRegionComponent.java
@@ -18,11 +18,13 @@

 import org.terasology.entitySystem.Component;
 import org.terasology.math.Region3i;
+import org.terasology.network.Replicate;

 /**
  * @author Immortius
  */
 public class BlockRegionComponent implements Component {
+    @Replicate
     public Region3i region = Region3i.EMPTY;
     public boolean overrideBlockEntities = true;

<|original_code|>
/*
 * Copyright 2013 MovingBlocks
 *
 * 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 org.terasology.world.block.regions;

import org.terasology.entitySystem.Component;
import org.terasology.math.Region3i;

/**
 * @author Immortius
 */
public class BlockRegionComponent implements Component {
    public Region3i region = Region3i.EMPTY;
    public boolean overrideBlockEntities = true;

    public BlockRegionComponent() {
    }

    public BlockRegionComponent(Region3i region) {
        this.region = region;
    }
}

<|edits_diff|>
--- engine/src/main/java/org/terasology/world/block/regions/BlockRegionComponent.java
+++ engine/src/main/java/org/terasology/world/block/regions/BlockRegionComponent.java
@@ -18,6 +18,7 @@

 import org.terasology.entitySystem.Component;
 import org.terasology.math.Region3i;
+import org.terasology.network.Replicate;

 /**
  * @author Immortius
<|current_version|>
/*
 * Copyright 2013 MovingBlocks
 *
 * 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 org.terasology.world.block.regions;

import org.terasology.entitySystem.Component;
import org.terasology.math.Region3i;
import org.terasology.network.Replicate;

/**
 * @author Immortius
 */
public class BlockRegionComponent implements Component {
    public Region3i region = Region3i.EMPTY;
    public boolean overrideBlockEntities = true;

    public BlockRegionComponent() {
    }

    public BlockRegionComponent(Region3i region) {
        this.region = region;
    }
}

<|next_version|>
/*
 * Copyright 2013 MovingBlocks
 *
 * 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 org.terasology.world.block.regions;

import org.terasology.entitySystem.Component;
import org.terasology.math.Region3i;
import org.terasology.network.Replicate;

/**
 * @author Immortius
 */
public class BlockRegionComponent implements Component {
    @Replicate
    public Region3i region = Region3i.EMPTY;
    public boolean overrideBlockEntities = true;

    public BlockRegionComponent() {
    }

    public BlockRegionComponent(Region3i region) {
        this.region = region;
    }
}


Fix issue with startup of admin-web

Fix issue with startup of admin-web

--- admin-web/src/main/java/io/fundrequest/platform/admin/AdminApplication.java
+++ admin-web/src/main/java/io/fundrequest/platform/admin/AdminApplication.java
@@ -1,5 +1,6 @@
 package io.fundrequest.platform.admin;

+import io.fundrequest.common.FundRequestCommon;
 import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
 import io.fundrequest.core.FundRequestCore;
 import io.fundrequest.platform.github.FundRequestGithub;
@@ -20,6 +21,7 @@
                 AdminApplication.class,
                 FundRequestKeycloak.class,
                 FundRequestGithub.class,
+                FundRequestCommon.class,
                 FundRequestCore.class,
                 ProfileApplication.class,
         },

<|original_code|>
package io.fundrequest.platform.admin;

import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
import io.fundrequest.core.FundRequestCore;
import io.fundrequest.platform.github.FundRequestGithub;
import io.fundrequest.platform.keycloak.FundRequestKeycloak;
import io.fundrequest.platform.profile.ProfileApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
        basePackageClasses = {
                AdminApplication.class,
                FundRequestKeycloak.class,
                FundRequestGithub.class,
                FundRequestCore.class,
                ProfileApplication.class,
        },
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class),
                @ComponentScan.Filter(IgnoreDuringComponentScan.class)})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

}

<|edits_diff|>
--- admin-web/src/main/java/io/fundrequest/platform/admin/AdminApplication.java
+++ admin-web/src/main/java/io/fundrequest/platform/admin/AdminApplication.java
@@ -1,5 +1,6 @@
 package io.fundrequest.platform.admin;

+import io.fundrequest.common.FundRequestCommon;
 import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
 import io.fundrequest.core.FundRequestCore;
 import io.fundrequest.platform.github.FundRequestGithub;
<|current_version|>
package io.fundrequest.platform.admin;

import io.fundrequest.common.FundRequestCommon;
import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
import io.fundrequest.core.FundRequestCore;
import io.fundrequest.platform.github.FundRequestGithub;
import io.fundrequest.platform.keycloak.FundRequestKeycloak;
import io.fundrequest.platform.profile.ProfileApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
        basePackageClasses = {
                AdminApplication.class,
                FundRequestKeycloak.class,
                FundRequestGithub.class,
                FundRequestCore.class,
                ProfileApplication.class,
        },
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class),
                @ComponentScan.Filter(IgnoreDuringComponentScan.class)})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

}

<|next_version|>
package io.fundrequest.platform.admin;

import io.fundrequest.common.FundRequestCommon;
import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
import io.fundrequest.core.FundRequestCore;
import io.fundrequest.platform.github.FundRequestGithub;
import io.fundrequest.platform.keycloak.FundRequestKeycloak;
import io.fundrequest.platform.profile.ProfileApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
        basePackageClasses = {
                AdminApplication.class,
                FundRequestKeycloak.class,
                FundRequestGithub.class,
                FundRequestCommon.class,
                FundRequestCore.class,
                ProfileApplication.class,
        },
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class),
                @ComponentScan.Filter(IgnoreDuringComponentScan.class)})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

}


Add @DoNotInstrument to Opus extension test

PiperOrigin-RevId: 370740311

--- extensions/opus/src/test/java/com/google/android/exoplayer2/ext/opus/DefaultRenderersFactoryTest.java
+++ extensions/opus/src/test/java/com/google/android/exoplayer2/ext/opus/DefaultRenderersFactoryTest.java
@@ -20,9 +20,11 @@
 import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.robolectric.annotation.internal.DoNotInstrument;

 /** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
 @RunWith(AndroidJUnit4.class)
+@DoNotInstrument
 public final class DefaultRenderersFactoryTest {

   @Test

<|original_code|>
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * 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 com.google.android.exoplayer2.ext.opus;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
import org.junit.Test;
import org.junit.runner.RunWith;

/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
@RunWith(AndroidJUnit4.class)
public final class DefaultRenderersFactoryTest {

  @Test
  public void createRenderers_instantiatesOpusRenderer() {
    DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
        LibopusAudioRenderer.class, C.TRACK_TYPE_AUDIO);
  }
}

<|edits_diff|>
--- extensions/opus/src/test/java/com/google/android/exoplayer2/ext/opus/DefaultRenderersFactoryTest.java
+++ extensions/opus/src/test/java/com/google/android/exoplayer2/ext/opus/DefaultRenderersFactoryTest.java
@@ -20,6 +20,7 @@
 import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.robolectric.annotation.internal.DoNotInstrument;

 /** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
 @RunWith(AndroidJUnit4.class)
<|current_version|>
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * 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 com.google.android.exoplayer2.ext.opus;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;

/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
@RunWith(AndroidJUnit4.class)
public final class DefaultRenderersFactoryTest {

  @Test
  public void createRenderers_instantiatesOpusRenderer() {
    DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
        LibopusAudioRenderer.class, C.TRACK_TYPE_AUDIO);
  }
}

<|next_version|>
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * 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 com.google.android.exoplayer2.ext.opus;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;

/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class DefaultRenderersFactoryTest {

  @Test
  public void createRenderers_instantiatesOpusRenderer() {
    DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
        LibopusAudioRenderer.class, C.TRACK_TYPE_AUDIO);
  }
}


Add register method for both

Add register method for both

--- src/main/java/info/u_team/u_team_core/util/registry/BlockDeferredRegister.java
+++ src/main/java/info/u_team/u_team_core/util/registry/BlockDeferredRegister.java
@@ -2,6 +2,9 @@

 import java.util.function.Supplier;

+import org.apache.commons.lang3.tuple.Pair;
+
+import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
 import net.minecraft.block.Block;
 import net.minecraft.item.Item;
 import net.minecraftforge.eventbus.api.IEventBus;
@@ -22,6 +25,10 @@
 		return blocks.register(name, supplier);
 	}

+	public <I extends Block & IUBlockRegistryType> Pair<RegistryObject<I>, RegistryObject<? extends Item>> register(String name, Supplier<? extends I> supplier) {
+		return Pair.of(blocks.register(name, supplier), items.register(name, () -> supplier.get().getBlockItem()));
+	}
+
 	public void register(IEventBus bus) {
 		blocks.register(bus);
 		items.register(bus);

<|original_code|>
package info.u_team.u_team_core.util.registry;

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.*;

public class BlockDeferredRegister {

	public final DeferredRegister<Block> blocks;
	public final DeferredRegister<Item> items;

	public BlockDeferredRegister(String modid) {
		blocks = DeferredRegister.create(ForgeRegistries.BLOCKS, modid);
		items = DeferredRegister.create(ForgeRegistries.ITEMS, modid);
	}

	public <I extends Block> RegistryObject<I> registerCommon(String name, Supplier<? extends I> supplier) {
		return blocks.register(name, supplier);
	}

	public void register(IEventBus bus) {
		blocks.register(bus);
		items.register(bus);
	}

}

<|edits_diff|>
--- src/main/java/info/u_team/u_team_core/util/registry/BlockDeferredRegister.java
+++ src/main/java/info/u_team/u_team_core/util/registry/BlockDeferredRegister.java
@@ -2,6 +2,9 @@

 import java.util.function.Supplier;

+import org.apache.commons.lang3.tuple.Pair;
+
+import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
 import net.minecraft.block.Block;
 import net.minecraft.item.Item;
 import net.minecraftforge.eventbus.api.IEventBus;
<|current_version|>
package info.u_team.u_team_core.util.registry;

import java.util.function.Supplier;

import org.apache.commons.lang3.tuple.Pair;

import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.*;

public class BlockDeferredRegister {

	public final DeferredRegister<Block> blocks;
	public final DeferredRegister<Item> items;

	public BlockDeferredRegister(String modid) {
		blocks = DeferredRegister.create(ForgeRegistries.BLOCKS, modid);
		items = DeferredRegister.create(ForgeRegistries.ITEMS, modid);
	}

	public <I extends Block> RegistryObject<I> registerCommon(String name, Supplier<? extends I> supplier) {
		return blocks.register(name, supplier);
	}

	public void register(IEventBus bus) {
		blocks.register(bus);
		items.register(bus);
	}

}

<|next_version|>
package info.u_team.u_team_core.util.registry;

import java.util.function.Supplier;

import org.apache.commons.lang3.tuple.Pair;

import info.u_team.u_team_core.api.registry.IUBlockRegistryType;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.*;

public class BlockDeferredRegister {

	public final DeferredRegister<Block> blocks;
	public final DeferredRegister<Item> items;

	public BlockDeferredRegister(String modid) {
		blocks = DeferredRegister.create(ForgeRegistries.BLOCKS, modid);
		items = DeferredRegister.create(ForgeRegistries.ITEMS, modid);
	}

	public <I extends Block> RegistryObject<I> registerCommon(String name, Supplier<? extends I> supplier) {
		return blocks.register(name, supplier);
	}

	public <I extends Block & IUBlockRegistryType> Pair<RegistryObject<I>, RegistryObject<? extends Item>> register(String name, Supplier<? extends I> supplier) {
		return Pair.of(blocks.register(name, supplier), items.register(name, () -> supplier.get().getBlockItem()));
	}

	public void register(IEventBus bus) {
		blocks.register(bus);
		items.register(bus);
	}

}


Use correct Script subtypes for init scripts.

--- subprojects/core/src/main/groovy/org/gradle/configuration/InitScriptTarget.java
+++ subprojects/core/src/main/groovy/org/gradle/configuration/InitScriptTarget.java
@@ -17,6 +17,8 @@
 package org.gradle.configuration;

 import org.gradle.api.internal.GradleInternal;
+import org.gradle.groovy.scripts.BasicScript;
+import org.gradle.initialization.InitScript;

 public class InitScriptTarget extends DefaultScriptTarget {
     public InitScriptTarget(GradleInternal target) {
@@ -24,6 +26,11 @@
     }

     @Override
+    public Class<? extends BasicScript> getScriptClass() {
+        return InitScript.class;
+    }
+
+    @Override
     public String getClasspathBlockName() {
         return "initscript";
     }

<|original_code|>
/*
 * Copyright 2015 the original author or authors.
 *
 * 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 org.gradle.configuration;

import org.gradle.api.internal.GradleInternal;

public class InitScriptTarget extends DefaultScriptTarget {
    public InitScriptTarget(GradleInternal target) {
        super(target);
    }

    @Override
    public String getClasspathBlockName() {
        return "initscript";
    }
}

<|edits_diff|>
--- subprojects/core/src/main/groovy/org/gradle/configuration/InitScriptTarget.java
+++ subprojects/core/src/main/groovy/org/gradle/configuration/InitScriptTarget.java
@@ -17,6 +17,8 @@
 package org.gradle.configuration;

 import org.gradle.api.internal.GradleInternal;
+import org.gradle.groovy.scripts.BasicScript;
+import org.gradle.initialization.InitScript;

 public class InitScriptTarget extends DefaultScriptTarget {
     public InitScriptTarget(GradleInternal target) {
<|current_version|>
/*
 * Copyright 2015 the original author or authors.
 *
 * 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 org.gradle.configuration;

import org.gradle.api.internal.GradleInternal;
import org.gradle.groovy.scripts.BasicScript;
import org.gradle.initialization.InitScript;

public class InitScriptTarget extends DefaultScriptTarget {
    public InitScriptTarget(GradleInternal target) {
        super(target);
    }

    @Override
    public String getClasspathBlockName() {
        return "initscript";
    }
}

<|next_version|>
/*
 * Copyright 2015 the original author or authors.
 *
 * 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 org.gradle.configuration;

import org.gradle.api.internal.GradleInternal;
import org.gradle.groovy.scripts.BasicScript;
import org.gradle.initialization.InitScript;

public class InitScriptTarget extends DefaultScriptTarget {
    public InitScriptTarget(GradleInternal target) {
        super(target);
    }

    @Override
    public Class<? extends BasicScript> getScriptClass() {
        return InitScript.class;
    }

    @Override
    public String getClasspathBlockName() {
        return "initscript";
    }
}


Make last_jobid available for compatibility.

--- digdag-standards/src/main/java/io/digdag/standards/operator/gcp/BaseBqJobOperator.java
+++ digdag-standards/src/main/java/io/digdag/standards/operator/gcp/BaseBqJobOperator.java
@@ -32,9 +32,11 @@
         Config result = cf.create();
         Config bq = result.getNestedOrSetEmpty("bq");
         bq.set("last_job_id", job.getId());
+        bq.set("last_jobid", job.getId());
         return TaskResult.defaultBuilder(request)
                 .storeParams(result)
                 .addResetStoreParams(ConfigKey.of("bq", "last_job_id"))
+                .addResetStoreParams(ConfigKey.of("bq", "last_jobid"))
                 .build();
     }

<|original_code|>
package io.digdag.standards.operator.gcp;

import com.google.api.services.bigquery.model.Job;
import com.google.api.services.bigquery.model.JobConfiguration;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigFactory;
import io.digdag.client.config.ConfigKey;
import io.digdag.spi.OperatorContext;
import io.digdag.spi.TaskResult;

import java.nio.file.Path;

abstract class BaseBqJobOperator
        extends BaseBqOperator
{
    BaseBqJobOperator(OperatorContext context, BqClient.Factory clientFactory, GcpCredentialProvider credentialProvider)
    {
        super(context, clientFactory, credentialProvider);
    }

    @Override
    protected TaskResult run(BqClient bq, String projectId)
    {
        BqJobRunner jobRunner = new BqJobRunner(request, bq, projectId);
        Job completed = jobRunner.runJob(jobConfiguration(projectId));
        return result(completed);
    }

    private TaskResult result(Job job)
    {
        ConfigFactory cf = request.getConfig().getFactory();
        Config result = cf.create();
        Config bq = result.getNestedOrSetEmpty("bq");
        bq.set("last_job_id", job.getId());
        return TaskResult.defaultBuilder(request)
                .storeParams(result)
                .addResetStoreParams(ConfigKey.of("bq", "last_job_id"))
                .build();
    }

    protected abstract JobConfiguration jobConfiguration(String projectId);
}

<|edits_diff|>
--- digdag-standards/src/main/java/io/digdag/standards/operator/gcp/BaseBqJobOperator.java
+++ digdag-standards/src/main/java/io/digdag/standards/operator/gcp/BaseBqJobOperator.java
@@ -32,6 +32,7 @@
         Config result = cf.create();
         Config bq = result.getNestedOrSetEmpty("bq");
         bq.set("last_job_id", job.getId());
+        bq.set("last_jobid", job.getId());
         return TaskResult.defaultBuilder(request)
                 .storeParams(result)
                 .addResetStoreParams(ConfigKey.of("bq", "last_job_id"))
<|current_version|>
package io.digdag.standards.operator.gcp;

import com.google.api.services.bigquery.model.Job;
import com.google.api.services.bigquery.model.JobConfiguration;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigFactory;
import io.digdag.client.config.ConfigKey;
import io.digdag.spi.OperatorContext;
import io.digdag.spi.TaskResult;

import java.nio.file.Path;

abstract class BaseBqJobOperator
        extends BaseBqOperator
{
    BaseBqJobOperator(OperatorContext context, BqClient.Factory clientFactory, GcpCredentialProvider credentialProvider)
    {
        super(context, clientFactory, credentialProvider);
    }

    @Override
    protected TaskResult run(BqClient bq, String projectId)
    {
        BqJobRunner jobRunner = new BqJobRunner(request, bq, projectId);
        Job completed = jobRunner.runJob(jobConfiguration(projectId));
        return result(completed);
    }

    private TaskResult result(Job job)
    {
        ConfigFactory cf = request.getConfig().getFactory();
        Config result = cf.create();
        Config bq = result.getNestedOrSetEmpty("bq");
        bq.set("last_job_id", job.getId());
        bq.set("last_jobid", job.getId());
        return TaskResult.defaultBuilder(request)
                .storeParams(result)
                .addResetStoreParams(ConfigKey.of("bq", "last_job_id"))
                .build();
    }

    protected abstract JobConfiguration jobConfiguration(String projectId);
}

<|next_version|>
package io.digdag.standards.operator.gcp;

import com.google.api.services.bigquery.model.Job;
import com.google.api.services.bigquery.model.JobConfiguration;
import io.digdag.client.config.Config;
import io.digdag.client.config.ConfigFactory;
import io.digdag.client.config.ConfigKey;
import io.digdag.spi.OperatorContext;
import io.digdag.spi.TaskResult;

import java.nio.file.Path;

abstract class BaseBqJobOperator
        extends BaseBqOperator
{
    BaseBqJobOperator(OperatorContext context, BqClient.Factory clientFactory, GcpCredentialProvider credentialProvider)
    {
        super(context, clientFactory, credentialProvider);
    }

    @Override
    protected TaskResult run(BqClient bq, String projectId)
    {
        BqJobRunner jobRunner = new BqJobRunner(request, bq, projectId);
        Job completed = jobRunner.runJob(jobConfiguration(projectId));
        return result(completed);
    }

    private TaskResult result(Job job)
    {
        ConfigFactory cf = request.getConfig().getFactory();
        Config result = cf.create();
        Config bq = result.getNestedOrSetEmpty("bq");
        bq.set("last_job_id", job.getId());
        bq.set("last_jobid", job.getId());
        return TaskResult.defaultBuilder(request)
                .storeParams(result)
                .addResetStoreParams(ConfigKey.of("bq", "last_job_id"))
                .addResetStoreParams(ConfigKey.of("bq", "last_jobid"))
                .build();
    }

    protected abstract JobConfiguration jobConfiguration(String projectId);
}


Revert "Remove temporary patch for broken TestNG 6.9.13"

This reverts commit 3aaab7db09e801d66e66029a7c0719fe24084d39.

CI still has the dynamic versions lookup result in cache.
Will resubmit later.

--- subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/DefaultTemplateLibraryVersionProvider.java
+++ subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/DefaultTemplateLibraryVersionProvider.java
@@ -16,6 +16,7 @@
 package org.gradle.buildinit.plugins.internal;

 import com.google.common.base.Throwables;
+import org.gradle.api.JavaVersion;

 import java.io.IOException;
 import java.util.Properties;
@@ -33,6 +34,10 @@
     }

     public String getVersion(String module) {
+        if (module.equals("testng") && !JavaVersion.current().isJava8Compatible()) {
+            // Use the highest version that runs on Java 7
+            return "6.9.12";
+        }
         return libraryVersions.getProperty(module);
     }
 }

<|original_code|>
/*
 * Copyright 2016 the original author or authors.
 *
 * 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 org.gradle.buildinit.plugins.internal;

import com.google.common.base.Throwables;

import java.io.IOException;
import java.util.Properties;

public class DefaultTemplateLibraryVersionProvider implements TemplateLibraryVersionProvider {

    private final Properties libraryVersions = new Properties();

    public DefaultTemplateLibraryVersionProvider() {
        try {
            this.libraryVersions.load(getClass().getResourceAsStream("/org/gradle/buildinit/tasks/templates/library-versions.properties"));
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }

    public String getVersion(String module) {
        return libraryVersions.getProperty(module);
    }
}

<|edits_diff|>
--- subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/DefaultTemplateLibraryVersionProvider.java
+++ subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/DefaultTemplateLibraryVersionProvider.java
@@ -16,6 +16,7 @@
 package org.gradle.buildinit.plugins.internal;

 import com.google.common.base.Throwables;
+import org.gradle.api.JavaVersion;

 import java.io.IOException;
 import java.util.Properties;
<|current_version|>
/*
 * Copyright 2016 the original author or authors.
 *
 * 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 org.gradle.buildinit.plugins.internal;

import com.google.common.base.Throwables;
import org.gradle.api.JavaVersion;

import java.io.IOException;
import java.util.Properties;

public class DefaultTemplateLibraryVersionProvider implements TemplateLibraryVersionProvider {

    private final Properties libraryVersions = new Properties();

    public DefaultTemplateLibraryVersionProvider() {
        try {
            this.libraryVersions.load(getClass().getResourceAsStream("/org/gradle/buildinit/tasks/templates/library-versions.properties"));
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }

    public String getVersion(String module) {
        return libraryVersions.getProperty(module);
    }
}

<|next_version|>
/*
 * Copyright 2016 the original author or authors.
 *
 * 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 org.gradle.buildinit.plugins.internal;

import com.google.common.base.Throwables;
import org.gradle.api.JavaVersion;

import java.io.IOException;
import java.util.Properties;

public class DefaultTemplateLibraryVersionProvider implements TemplateLibraryVersionProvider {

    private final Properties libraryVersions = new Properties();

    public DefaultTemplateLibraryVersionProvider() {
        try {
            this.libraryVersions.load(getClass().getResourceAsStream("/org/gradle/buildinit/tasks/templates/library-versions.properties"));
        } catch (IOException e) {
            throw Throwables.propagate(e);
        }
    }

    public String getVersion(String module) {
        if (module.equals("testng") && !JavaVersion.current().isJava8Compatible()) {
            // Use the highest version that runs on Java 7
            return "6.9.12";
        }
        return libraryVersions.getProperty(module);
    }
}


Add modified get tokens of a shop function

--- backendservice/src/main/java/com/google/gpay/virtualqueue/backendservice/repository/VirtualQueueRepository.java
+++ backendservice/src/main/java/com/google/gpay/virtualqueue/backendservice/repository/VirtualQueueRepository.java
@@ -16,10 +16,12 @@

 package com.google.gpay.virtualqueue.backendservice.repository;

+import java.util.List;
 import java.util.Map;
 import java.util.UUID;

 import com.google.gpay.virtualqueue.backendservice.model.Shop;
+import com.google.gpay.virtualqueue.backendservice.model.Token;
 import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

 public interface VirtualQueueRepository {
@@ -27,4 +29,6 @@
     public UUID createShop(CreateShopRequest createShopRequest);

     public Map<UUID, Shop> getAllShops();
+
+    public List<Token> getTokensByShopId(UUID shopId);
 }

<|original_code|>
/*
Copyright 2020 Google LLC

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

    https://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 com.google.gpay.virtualqueue.backendservice.repository;

import java.util.Map;
import java.util.UUID;

import com.google.gpay.virtualqueue.backendservice.model.Shop;
import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

public interface VirtualQueueRepository {

    public UUID createShop(CreateShopRequest createShopRequest);

    public Map<UUID, Shop> getAllShops();
}

<|edits_diff|>
--- backendservice/src/main/java/com/google/gpay/virtualqueue/backendservice/repository/VirtualQueueRepository.java
+++ backendservice/src/main/java/com/google/gpay/virtualqueue/backendservice/repository/VirtualQueueRepository.java
@@ -16,10 +16,12 @@

 package com.google.gpay.virtualqueue.backendservice.repository;

+import java.util.List;
 import java.util.Map;
 import java.util.UUID;

 import com.google.gpay.virtualqueue.backendservice.model.Shop;
+import com.google.gpay.virtualqueue.backendservice.model.Token;
 import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

 public interface VirtualQueueRepository {
<|current_version|>
/*
Copyright 2020 Google LLC

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

    https://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 com.google.gpay.virtualqueue.backendservice.repository;

import java.util.List;
import java.util.Map;
import java.util.UUID;

import com.google.gpay.virtualqueue.backendservice.model.Shop;
import com.google.gpay.virtualqueue.backendservice.model.Token;
import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

public interface VirtualQueueRepository {

    public UUID createShop(CreateShopRequest createShopRequest);

    public Map<UUID, Shop> getAllShops();
}

<|next_version|>
/*
Copyright 2020 Google LLC

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

    https://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 com.google.gpay.virtualqueue.backendservice.repository;

import java.util.List;
import java.util.Map;
import java.util.UUID;

import com.google.gpay.virtualqueue.backendservice.model.Shop;
import com.google.gpay.virtualqueue.backendservice.model.Token;
import com.google.gpay.virtualqueue.backendservice.proto.CreateShopRequest;

public interface VirtualQueueRepository {

    public UUID createShop(CreateShopRequest createShopRequest);

    public Map<UUID, Shop> getAllShops();

    public List<Token> getTokensByShopId(UUID shopId);
}


package com.github.arteam.dropwizard.http2.client;

import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 * <p>
 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}

package com.github.arteam.dropwizard.http2.client;

import com.google.common.base.Strings;
import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 * <p>
 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        if (!Strings.isNullOrEmpty(name)) {
            httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, name));
        }
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}

Set user-agent from the client's name

Set user-agent from the client's name

--- src/main/java/com/github/arteam/dropwizard/http2/client/JettyHttpClientBuilder.java
+++ src/main/java/com/github/arteam/dropwizard/http2/client/JettyHttpClientBuilder.java
@@ -1,7 +1,10 @@
 package com.github.arteam.dropwizard.http2.client;

+import com.google.common.base.Strings;
 import io.dropwizard.setup.Environment;
 import org.eclipse.jetty.client.HttpClient;
+import org.eclipse.jetty.http.HttpField;
+import org.eclipse.jetty.http.HttpHeader;

 /**
  * Date: 11/26/15
@@ -33,6 +36,9 @@
                 connectionFactoryBuilder.sslContextFactory());
         httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
         httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
+        if (!Strings.isNullOrEmpty(name)) {
+            httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, name));
+        }
         environment.lifecycle().manage(httpClient);
         return httpClient;
     }

package com.github.arteam.dropwizard.http2.client;

import com.google.common.base.Strings;
import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 * <p>
 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}

<|original_code|>
package com.github.arteam.dropwizard.http2.client;

import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 *

 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}

<|edits_diff|>
--- src/main/java/com/github/arteam/dropwizard/http2/client/JettyHttpClientBuilder.java
+++ src/main/java/com/github/arteam/dropwizard/http2/client/JettyHttpClientBuilder.java
@@ -1,7 +1,10 @@
 package com.github.arteam.dropwizard.http2.client;

+import com.google.common.base.Strings;
 import io.dropwizard.setup.Environment;
 import org.eclipse.jetty.client.HttpClient;
+import org.eclipse.jetty.http.HttpField;
+import org.eclipse.jetty.http.HttpHeader;

 /**
  * Date: 11/26/15
<|current_version|>
package com.github.arteam.dropwizard.http2.client;

import com.google.common.base.Strings;
import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 *

 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}

<|next_version|>
package com.github.arteam.dropwizard.http2.client;

import com.google.common.base.Strings;
import io.dropwizard.setup.Environment;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.http.HttpField;
import org.eclipse.jetty.http.HttpHeader;

/**
 * Date: 11/26/15
 * Time: 10:22 AM
 *

 * A builder for {@link HttpClient}. It builds an instance from an external
 * configuration and ties it to Dropwizard environment.
 *
 * @author Artem Prigoda
 */
public class JettyHttpClientBuilder {

    private Environment environment;
    private Http2ClientConfiguration configuration = new Http2ClientConfiguration();

    public JettyHttpClientBuilder(Environment environment) {
        this.environment = environment;
    }

    public JettyHttpClientBuilder using(Http2ClientConfiguration configuration) {
        this.configuration = configuration;
        return this;
    }

    public HttpClient build(String name) {
        ClientTransportFactory connectionFactoryBuilder = configuration.getConnectionFactoryBuilder();
        HttpClient httpClient = new HttpClient(
                connectionFactoryBuilder.httpClientTransport(environment.metrics(), name),
                connectionFactoryBuilder.sslContextFactory());
        httpClient.setConnectTimeout(configuration.getConnectionTimeout().toMilliseconds());
        httpClient.setIdleTimeout(configuration.getIdleTimeout().toMilliseconds());
        if (!Strings.isNullOrEmpty(name)) {
            httpClient.setUserAgentField(new HttpField(HttpHeader.USER_AGENT, name));
        }
        environment.lifecycle().manage(httpClient);
        return httpClient;
    }

    public HttpClient build() {
        return build("");
    }
}


Check of the queue has waiting data before attempting to take control.

--- server/src/main/java/com/breakersoft/plow/dispatcher/pipeline/Pipeline.java
+++ server/src/main/java/com/breakersoft/plow/dispatcher/pipeline/Pipeline.java
@@ -34,9 +34,13 @@

     @Override
     public void run() {
+        if (queue.isEmpty()) {
+            return;
+        }
         if (!isRunning.compareAndSet(false, true)){
             return;
         }
+
         try {
             while (true) {
                 PipelineCommand command = queue.poll();

<|original_code|>
package com.breakersoft.plow.dispatcher.pipeline;

import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;

import com.breakersoft.plow.JobId;

public class Pipeline implements JobId, Runnable {

    private final UUID jobId;
    private final LinkedBlockingQueue<PipelineCommand> queue;
    private final AtomicBoolean isRunning;

    public Pipeline(UUID jobId) {
        this.jobId = jobId;
        this.queue = new LinkedBlockingQueue<PipelineCommand>();
        this.isRunning = new AtomicBoolean(false);
    }

    public void add(PipelineCommand command) {
        queue.add(command);
    }

    public void addAll(Collection<PipelineCommand> command) {
        queue.addAll(command);
    }

    @Override
    public UUID getJobId() {
        return jobId;
    }

    @Override
    public void run() {
        if (!isRunning.compareAndSet(false, true)){
            return;
        }
        try {
            while (true) {
                PipelineCommand command = queue.poll();
                if (command == null) {
                    return;
                }
                command.process();
            }
        }
        finally {
            isRunning.set(false);
        }
    }
}

<|edits_diff|>
--- server/src/main/java/com/breakersoft/plow/dispatcher/pipeline/Pipeline.java
+++ server/src/main/java/com/breakersoft/plow/dispatcher/pipeline/Pipeline.java
@@ -34,6 +34,9 @@

     @Override
     public void run() {
+        if (queue.isEmpty()) {
+            return;
+        }
         if (!isRunning.compareAndSet(false, true)){
             return;
         }
<|current_version|>
package com.breakersoft.plow.dispatcher.pipeline;

import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;

import com.breakersoft.plow.JobId;

public class Pipeline implements JobId, Runnable {

    private final UUID jobId;
    private final LinkedBlockingQueue<PipelineCommand> queue;
    private final AtomicBoolean isRunning;

    public Pipeline(UUID jobId) {
        this.jobId = jobId;
        this.queue = new LinkedBlockingQueue<PipelineCommand>();
        this.isRunning = new AtomicBoolean(false);
    }

    public void add(PipelineCommand command) {
        queue.add(command);
    }

    public void addAll(Collection<PipelineCommand> command) {
        queue.addAll(command);
    }

    @Override
    public UUID getJobId() {
        return jobId;
    }

    @Override
    public void run() {
        if (queue.isEmpty()) {
            return;
        }
        if (!isRunning.compareAndSet(false, true)){
            return;
        }
        try {
            while (true) {
                PipelineCommand command = queue.poll();
                if (command == null) {
                    return;
                }
                command.process();
            }
        }
        finally {
            isRunning.set(false);
        }
    }
}

<|next_version|>
package com.breakersoft.plow.dispatcher.pipeline;

import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;

import com.breakersoft.plow.JobId;

public class Pipeline implements JobId, Runnable {

    private final UUID jobId;
    private final LinkedBlockingQueue<PipelineCommand> queue;
    private final AtomicBoolean isRunning;

    public Pipeline(UUID jobId) {
        this.jobId = jobId;
        this.queue = new LinkedBlockingQueue<PipelineCommand>();
        this.isRunning = new AtomicBoolean(false);
    }

    public void add(PipelineCommand command) {
        queue.add(command);
    }

    public void addAll(Collection<PipelineCommand> command) {
        queue.addAll(command);
    }

    @Override
    public UUID getJobId() {
        return jobId;
    }

    @Override
    public void run() {
        if (queue.isEmpty()) {
            return;
        }
        if (!isRunning.compareAndSet(false, true)){
            return;
        }

        try {
            while (true) {
                PipelineCommand command = queue.poll();
                if (command == null) {
                    return;
                }
                command.process();
            }
        }
        finally {
            isRunning.set(false);
        }
    }
}


Mask ctms-common's commons-logging logger with an slf4j logger

--- src/edu/northwestern/bioinformatics/studycalendar/dao/StudyCalendarDao.java
+++ src/edu/northwestern/bioinformatics/studycalendar/dao/StudyCalendarDao.java
@@ -2,9 +2,12 @@

 import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
 import gov.nih.nci.cabig.ctms.domain.DomainObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * @author Rhett Sutphin
  */
 public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
+    protected final Logger log = LoggerFactory.getLogger(getClass());
 }

<|original_code|>
package edu.northwestern.bioinformatics.studycalendar.dao;

import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;

/**
 * @author Rhett Sutphin
 */
public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
}

<|edits_diff|>
--- src/edu/northwestern/bioinformatics/studycalendar/dao/StudyCalendarDao.java
+++ src/edu/northwestern/bioinformatics/studycalendar/dao/StudyCalendarDao.java
@@ -2,6 +2,8 @@

 import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
 import gov.nih.nci.cabig.ctms.domain.DomainObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * @author Rhett Sutphin
<|current_version|>
package edu.northwestern.bioinformatics.studycalendar.dao;

import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Rhett Sutphin
 */
public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
}

<|next_version|>
package edu.northwestern.bioinformatics.studycalendar.dao;

import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Rhett Sutphin
 */
public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
    protected final Logger log = LoggerFactory.getLogger(getClass());
}