Update docs for Data object

Update docs for Data object

--- src/main/java/io/cryptolens/models/DataObject.java
+++ src/main/java/io/cryptolens/models/DataObject.java
@@ -3,12 +3,27 @@
 import com.google.gson.annotations.SerializedName;

 public class DataObject {
+    /**
+     * The unique identifier of the data object.
+     */
     @SerializedName(value = "id", alternate = {"Id"})
     public int Id;
+
+    /**
+     * The name of the data object (max 10 chars).
+     */
     @SerializedName(value = "name", alternate = {"Name"})
     public String Name;
+
+    /**
+     * A string value associated with the data object (max 10,000 chars).
+     */
     @SerializedName(value = "stringValue", alternate = {"StringValue"})
     public String StringValue;
+
+    /**
+     * An int32 value associated with the data object.
+     */
     @SerializedName(value = "intValue", alternate = {"IntValue"})
     public int IntValue;
 }

<|original_code|>
package io.cryptolens.models;

import com.google.gson.annotations.SerializedName;

public class DataObject {
    @SerializedName(value = "id", alternate = {"Id"})
    public int Id;
    @SerializedName(value = "name", alternate = {"Name"})
    public String Name;
    @SerializedName(value = "stringValue", alternate = {"StringValue"})
    public String StringValue;
    @SerializedName(value = "intValue", alternate = {"IntValue"})
    public int IntValue;
}

<|edits_diff|>
--- src/main/java/io/cryptolens/models/DataObject.java
+++ src/main/java/io/cryptolens/models/DataObject.java
@@ -3,10 +3,21 @@
 import com.google.gson.annotations.SerializedName;

 public class DataObject {
+    /**
+     * The unique identifier of the data object.
+     */
     @SerializedName(value = "id", alternate = {"Id"})
     public int Id;
+
+    /**
+     * The name of the data object (max 10 chars).
+     */
     @SerializedName(value = "name", alternate = {"Name"})
     public String Name;
+
+    /**
+     * A string value associated with the data object (max 10,000 chars).
+     */
     @SerializedName(value = "stringValue", alternate = {"StringValue"})
     public String StringValue;
     @SerializedName(value = "intValue", alternate = {"IntValue"})
<|current_version|>
package io.cryptolens.models;

import com.google.gson.annotations.SerializedName;

public class DataObject {
    /**
     * The unique identifier of the data object.
     */
    @SerializedName(value = "id", alternate = {"Id"})
    public int Id;

    /**
     * The name of the data object (max 10 chars).
     */
    @SerializedName(value = "name", alternate = {"Name"})
    public String Name;

    /**
     * A string value associated with the data object (max 10,000 chars).
     */
    @SerializedName(value = "stringValue", alternate = {"StringValue"})
    public String StringValue;
    @SerializedName(value = "intValue", alternate = {"IntValue"})
    public int IntValue;
}

<|next_version|>
package io.cryptolens.models;

import com.google.gson.annotations.SerializedName;

public class DataObject {
    /**
     * The unique identifier of the data object.
     */
    @SerializedName(value = "id", alternate = {"Id"})
    public int Id;

    /**
     * The name of the data object (max 10 chars).
     */
    @SerializedName(value = "name", alternate = {"Name"})
    public String Name;

    /**
     * A string value associated with the data object (max 10,000 chars).
     */
    @SerializedName(value = "stringValue", alternate = {"StringValue"})
    public String StringValue;

    /**
     * An int32 value associated with the data object.
     */
    @SerializedName(value = "intValue", alternate = {"IntValue"})
    public int IntValue;
}


Fix MongoDB auto configuration issue in integration tests

--- src/main/java/org/trustedanalytics/les/Application.java
+++ src/main/java/org/trustedanalytics/les/Application.java
@@ -17,12 +17,16 @@

 import com.mangofactory.swagger.plugin.EnableSwagger;
 import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
+import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration;
 import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;

 @EnableOAuth2Resource
 @SpringBootApplication
 @EnableSwagger
+@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
 public class Application {
     public static void main(String[] args) {
         SpringApplication.run(Application.class, args);

<|original_code|>
/**
 * Copyright (c) 2015 Intel Corporation
 *
 * 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.trustedanalytics.les;

import com.mangofactory.swagger.plugin.EnableSwagger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;

@EnableOAuth2Resource
@SpringBootApplication
@EnableSwagger
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

<|edits_diff|>
--- src/main/java/org/trustedanalytics/les/Application.java
+++ src/main/java/org/trustedanalytics/les/Application.java
@@ -17,7 +17,10 @@

 import com.mangofactory.swagger.plugin.EnableSwagger;
 import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
+import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration;
 import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;

 @EnableOAuth2Resource
<|current_version|>
/**
 * Copyright (c) 2015 Intel Corporation
 *
 * 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.trustedanalytics.les;

import com.mangofactory.swagger.plugin.EnableSwagger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration;
import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;

@EnableOAuth2Resource
@SpringBootApplication
@EnableSwagger
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}

<|next_version|>
/**
 * Copyright (c) 2015 Intel Corporation
 *
 * 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.trustedanalytics.les;

import com.mangofactory.swagger.plugin.EnableSwagger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.MongoDataAutoConfiguration;
import org.springframework.cloud.security.oauth2.resource.EnableOAuth2Resource;

@EnableOAuth2Resource
@SpringBootApplication
@EnableSwagger
@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class, MongoDataAutoConfiguration.class})
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}


Add ignore for unknown json properties in config file

--- common/src/main/java/org/jboss/da/common/json/DAConfig.java
+++ common/src/main/java/org/jboss/da/common/json/DAConfig.java
@@ -1,8 +1,11 @@
 package org.jboss.da.common.json;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;

 import lombok.Getter;
 import lombok.Setter;

+@JsonIgnoreProperties(ignoreUnknown = true)
 public class DAConfig extends AbstractModuleConfig {

     @Getter

<|original_code|>
package org.jboss.da.common.json;

import lombok.Getter;
import lombok.Setter;

public class DAConfig extends AbstractModuleConfig {

    @Getter
    @Setter
    private String keycloakServer;

    @Getter
    @Setter
    private String keycloakClientid;

    @Getter
    @Setter
    private String keycloakUsername;

    @Getter
    @Setter
    private String keycloakPassword;

    @Getter
    @Setter
    private String pncServer;

    @Getter
    @Setter
    private String keycloakRealm;

    @Getter
    @Setter
    private String aproxServer;

    @Getter
    @Setter
    private String aproxGroup;

    @Getter
    @Setter
    private String backupScmUrl;

    @Getter
    @Setter
    private String backupScmBranch;

    @Getter
    @Setter
    private String repourUrl;

}

<|edits_diff|>
--- common/src/main/java/org/jboss/da/common/json/DAConfig.java
+++ common/src/main/java/org/jboss/da/common/json/DAConfig.java
@@ -1,4 +1,6 @@
 package org.jboss.da.common.json;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;

 import lombok.Getter;
 import lombok.Setter;
<|current_version|>
package org.jboss.da.common.json;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import lombok.Getter;
import lombok.Setter;

public class DAConfig extends AbstractModuleConfig {

    @Getter
    @Setter
    private String keycloakServer;

    @Getter
    @Setter
    private String keycloakClientid;

    @Getter
    @Setter
    private String keycloakUsername;

    @Getter
    @Setter
    private String keycloakPassword;

    @Getter
    @Setter
    private String pncServer;

    @Getter
    @Setter
    private String keycloakRealm;

    @Getter
    @Setter
    private String aproxServer;

    @Getter
    @Setter
    private String aproxGroup;

    @Getter
    @Setter
    private String backupScmUrl;

    @Getter
    @Setter
    private String backupScmBranch;

    @Getter
    @Setter
    private String repourUrl;

}

<|next_version|>
package org.jboss.da.common.json;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import lombok.Getter;
import lombok.Setter;

@JsonIgnoreProperties(ignoreUnknown = true)
public class DAConfig extends AbstractModuleConfig {

    @Getter
    @Setter
    private String keycloakServer;

    @Getter
    @Setter
    private String keycloakClientid;

    @Getter
    @Setter
    private String keycloakUsername;

    @Getter
    @Setter
    private String keycloakPassword;

    @Getter
    @Setter
    private String pncServer;

    @Getter
    @Setter
    private String keycloakRealm;

    @Getter
    @Setter
    private String aproxServer;

    @Getter
    @Setter
    private String aproxGroup;

    @Getter
    @Setter
    private String backupScmUrl;

    @Getter
    @Setter
    private String backupScmBranch;

    @Getter
    @Setter
    private String repourUrl;

}


Fix raw ender buckets not creating full fluid blocks in the world

--- java/squeek/veganoption/blocks/BlockRawEnder.java
+++ java/squeek/veganoption/blocks/BlockRawEnder.java
@@ -1,5 +1,6 @@
 package squeek.veganoption.blocks;

+import net.minecraft.block.BlockDoublePlant;
 import net.minecraft.block.material.Material;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.world.IBlockAccess;
@@ -14,6 +15,7 @@
 	public BlockRawEnder(Fluid fluid)
 	{
 		super(fluid, materialRawEnder);
+		this.setDefaultState(blockState.getBaseState().withProperty(LEVEL, 7));
 	}

 	@Override

<|original_code|>
package squeek.veganoption.blocks;

import net.minecraft.block.material.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;

public class BlockRawEnder extends BlockFluidFinite
{
	public static Material materialRawEnder = Material.WATER;

	public BlockRawEnder(Fluid fluid)
	{
		super(fluid, materialRawEnder);
	}

	@Override
	public boolean canDisplace(IBlockAccess world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.canDisplace(world, pos);
	}

	@Override
	public boolean displaceIfPossible(World world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.displaceIfPossible(world, pos);
	}
}

<|edits_diff|>
--- java/squeek/veganoption/blocks/BlockRawEnder.java
+++ java/squeek/veganoption/blocks/BlockRawEnder.java
@@ -1,5 +1,6 @@
 package squeek.veganoption.blocks;

+import net.minecraft.block.BlockDoublePlant;
 import net.minecraft.block.material.Material;
 import net.minecraft.util.math.BlockPos;
 import net.minecraft.world.IBlockAccess;
<|current_version|>
package squeek.veganoption.blocks;

import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;

public class BlockRawEnder extends BlockFluidFinite
{
	public static Material materialRawEnder = Material.WATER;

	public BlockRawEnder(Fluid fluid)
	{
		super(fluid, materialRawEnder);
	}

	@Override
	public boolean canDisplace(IBlockAccess world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.canDisplace(world, pos);
	}

	@Override
	public boolean displaceIfPossible(World world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.displaceIfPossible(world, pos);
	}
}

<|next_version|>
package squeek.veganoption.blocks;

import net.minecraft.block.BlockDoublePlant;
import net.minecraft.block.material.Material;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidFinite;
import net.minecraftforge.fluids.Fluid;

public class BlockRawEnder extends BlockFluidFinite
{
	public static Material materialRawEnder = Material.WATER;

	public BlockRawEnder(Fluid fluid)
	{
		super(fluid, materialRawEnder);
		this.setDefaultState(blockState.getBaseState().withProperty(LEVEL, 7));
	}

	@Override
	public boolean canDisplace(IBlockAccess world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.canDisplace(world, pos);
	}

	@Override
	public boolean displaceIfPossible(World world, BlockPos pos)
	{
		//if (world.getBlock(x, y, z).getMaterial().isLiquid())
		//	return false;
		return super.displaceIfPossible(world, pos);
	}
}


Add 'deployment' name for json root

Add 'deployment' name for json root

--- featuros/src/main/java/io/fourfinanceit/featuros/deployment/Deployment.java
+++ featuros/src/main/java/io/fourfinanceit/featuros/deployment/Deployment.java
@@ -1,5 +1,6 @@
 package io.fourfinanceit.featuros.deployment;

+import com.fasterxml.jackson.annotation.JsonRootName;
 import org.springframework.hateoas.Identifiable;

 import javax.persistence.Column;
@@ -8,6 +9,7 @@
 import javax.persistence.Id;
 import java.time.Instant;

+@JsonRootName("deployment")
 @Entity
 class Deployment implements Identifiable<Long> {

<|original_code|>
package io.fourfinanceit.featuros.deployment;

import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.time.Instant;

@Entity
class Deployment implements Identifiable<Long> {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String product;

    @Column(name = "group_")
    private String group;

    private String version;

    private Instant date;

    /**
     * @deprecated persistence only
     */
    @Deprecated
    private Deployment() {
    }

    public Deployment(String name, String product, String group, String version, Instant date) {
        this.name = name;
        this.product = product;
        this.group = group;
        this.version = version;
        this.date = date;
    }

    @Override
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getProduct() {
        return product;
    }

    public String getGroup() {
        return group;
    }

    public String getVersion() {
        return version;
    }

    public Instant getDate() {
        return date;
    }
}

<|edits_diff|>
--- featuros/src/main/java/io/fourfinanceit/featuros/deployment/Deployment.java
+++ featuros/src/main/java/io/fourfinanceit/featuros/deployment/Deployment.java
@@ -1,5 +1,6 @@
 package io.fourfinanceit.featuros.deployment;

+import com.fasterxml.jackson.annotation.JsonRootName;
 import org.springframework.hateoas.Identifiable;

 import javax.persistence.Column;
<|current_version|>
package io.fourfinanceit.featuros.deployment;

import com.fasterxml.jackson.annotation.JsonRootName;
import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.time.Instant;

@Entity
class Deployment implements Identifiable<Long> {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String product;

    @Column(name = "group_")
    private String group;

    private String version;

    private Instant date;

    /**
     * @deprecated persistence only
     */
    @Deprecated
    private Deployment() {
    }

    public Deployment(String name, String product, String group, String version, Instant date) {
        this.name = name;
        this.product = product;
        this.group = group;
        this.version = version;
        this.date = date;
    }

    @Override
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getProduct() {
        return product;
    }

    public String getGroup() {
        return group;
    }

    public String getVersion() {
        return version;
    }

    public Instant getDate() {
        return date;
    }
}

<|next_version|>
package io.fourfinanceit.featuros.deployment;

import com.fasterxml.jackson.annotation.JsonRootName;
import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.time.Instant;

@JsonRootName("deployment")
@Entity
class Deployment implements Identifiable<Long> {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String product;

    @Column(name = "group_")
    private String group;

    private String version;

    private Instant date;

    /**
     * @deprecated persistence only
     */
    @Deprecated
    private Deployment() {
    }

    public Deployment(String name, String product, String group, String version, Instant date) {
        this.name = name;
        this.product = product;
        this.group = group;
        this.version = version;
        this.date = date;
    }

    @Override
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getProduct() {
        return product;
    }

    public String getGroup() {
        return group;
    }

    public String getVersion() {
        return version;
    }

    public Instant getDate() {
        return date;
    }
}


Add query for getting sample by external identifier.

--- src/main/java/ca/corefacility/bioinformatics/irida/repositories/SampleRepository.java
+++ src/main/java/ca/corefacility/bioinformatics/irida/repositories/SampleRepository.java
@@ -1,5 +1,6 @@
 package ca.corefacility.bioinformatics.irida.repositories;

+import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.PagingAndSortingRepository;

 import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
@@ -10,6 +11,7 @@
  * A repository for storing Sample objects
  *
  * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
+ * @author Franklin Bristow <franklin.bristow@phac-aspc.gc.ca>
  */
 public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

@@ -25,5 +27,6 @@
 	 * @throws EntityNotFoundException
 	 *             if a sample with this identifier doesn't exist
 	 */
+	@Query("select j.sample from ProjectSampleJoin j where j.project = ?1 and j.sample.externalSampleId = ?2")
 	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
 }

<|original_code|>
package ca.corefacility.bioinformatics.irida.repositories;

import org.springframework.data.repository.PagingAndSortingRepository;

import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
import ca.corefacility.bioinformatics.irida.model.Project;
import ca.corefacility.bioinformatics.irida.model.Sample;

/**
 * A repository for storing Sample objects
 *
 * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
 */
public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

	/**
	 * Get a {@link Sample} with the given string sample identifier from a
	 * specific project.
	 *
	 * @param project
	 *            The {@link Project} that the {@link Sample} belongs to.
	 * @param externalSampleId
	 *            The string sample identifier for a sample
	 * @return The {@link Sample} for this identifier
	 * @throws EntityNotFoundException
	 *             if a sample with this identifier doesn't exist
	 */
	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
}

<|edits_diff|>
--- src/main/java/ca/corefacility/bioinformatics/irida/repositories/SampleRepository.java
+++ src/main/java/ca/corefacility/bioinformatics/irida/repositories/SampleRepository.java
@@ -1,5 +1,6 @@
 package ca.corefacility.bioinformatics.irida.repositories;

+import org.springframework.data.jpa.repository.Query;
 import org.springframework.data.repository.PagingAndSortingRepository;

 import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
@@ -10,6 +11,7 @@
  * A repository for storing Sample objects
  *
  * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
+ * @author Franklin Bristow <franklin.bristow@phac-aspc.gc.ca>
  */
 public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

<|current_version|>
package ca.corefacility.bioinformatics.irida.repositories;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
import ca.corefacility.bioinformatics.irida.model.Project;
import ca.corefacility.bioinformatics.irida.model.Sample;

/**
 * A repository for storing Sample objects
 *
 * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
 * @author Franklin Bristow <franklin.bristow@phac-aspc.gc.ca>
 */
public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

	/**
	 * Get a {@link Sample} with the given string sample identifier from a
	 * specific project.
	 *
	 * @param project
	 *            The {@link Project} that the {@link Sample} belongs to.
	 * @param externalSampleId
	 *            The string sample identifier for a sample
	 * @return The {@link Sample} for this identifier
	 * @throws EntityNotFoundException
	 *             if a sample with this identifier doesn't exist
	 */
	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
}

<|next_version|>
package ca.corefacility.bioinformatics.irida.repositories;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
import ca.corefacility.bioinformatics.irida.model.Project;
import ca.corefacility.bioinformatics.irida.model.Sample;

/**
 * A repository for storing Sample objects
 *
 * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
 * @author Franklin Bristow <franklin.bristow@phac-aspc.gc.ca>
 */
public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

	/**
	 * Get a {@link Sample} with the given string sample identifier from a
	 * specific project.
	 *
	 * @param project
	 *            The {@link Project} that the {@link Sample} belongs to.
	 * @param externalSampleId
	 *            The string sample identifier for a sample
	 * @return The {@link Sample} for this identifier
	 * @throws EntityNotFoundException
	 *             if a sample with this identifier doesn't exist
	 */
	@Query("select j.sample from ProjectSampleJoin j where j.project = ?1 and j.sample.externalSampleId = ?2")
	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
}


Fix error in draft pool deserialization

Fix error in draft pool deserialization

--- src/main/java/com/ljs/scratch/ootp/rating/Scale.java
+++ src/main/java/com/ljs/scratch/ootp/rating/Scale.java
@@ -1,12 +1,18 @@
 package com.ljs.scratch.ootp.rating;

+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.ljs.scratch.ootp.ootp5.site.ZeroToTen;

 /**
  *
  * @author lstephen
  */
 @JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
+@JsonSubTypes({
+    @Type(ZeroToTen.class)
+})
 public interface Scale<T> {

     Rating<T, ? extends Scale<T>> ratingOf(T value);

<|original_code|>
package com.ljs.scratch.ootp.rating;

import com.fasterxml.jackson.annotation.JsonTypeInfo;

/**
 *
 * @author lstephen
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
public interface Scale<T> {

    Rating<T, ? extends Scale<T>> ratingOf(T value);

    Rating<T, ? extends Scale<T>> parse(String s);

    Rating<Integer, OneToOneHundred> normalize(T value);

}

<|edits_diff|>
--- src/main/java/com/ljs/scratch/ootp/rating/Scale.java
+++ src/main/java/com/ljs/scratch/ootp/rating/Scale.java
@@ -1,6 +1,9 @@
 package com.ljs.scratch.ootp.rating;

+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.ljs.scratch.ootp.ootp5.site.ZeroToTen;

 /**
  *
<|current_version|>
package com.ljs.scratch.ootp.rating;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.ljs.scratch.ootp.ootp5.site.ZeroToTen;

/**
 *
 * @author lstephen
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
public interface Scale<T> {

    Rating<T, ? extends Scale<T>> ratingOf(T value);

    Rating<T, ? extends Scale<T>> parse(String s);

    Rating<Integer, OneToOneHundred> normalize(T value);

}

<|next_version|>
package com.ljs.scratch.ootp.rating;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.ljs.scratch.ootp.ootp5.site.ZeroToTen;

/**
 *
 * @author lstephen
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
@JsonSubTypes({
    @Type(ZeroToTen.class)
})
public interface Scale<T> {

    Rating<T, ? extends Scale<T>> ratingOf(T value);

    Rating<T, ? extends Scale<T>> parse(String s);

    Rating<Integer, OneToOneHundred> normalize(T value);

}


Improve joda objects model in rest

Improve joda objects model in rest

--- jg-backend/interface/jg-rest-ws/src/main/java/org/jgrades/rest/RestDocsConfig.java
+++ jg-backend/interface/jg-rest-ws/src/main/java/org/jgrades/rest/RestDocsConfig.java
@@ -1,6 +1,8 @@
 package org.jgrades.rest;

 import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.LocalTime;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import springfox.documentation.builders.PathSelectors;
@@ -21,6 +23,8 @@
                 .build()
                 .pathMapping("/")
                 .directModelSubstitute(DateTime.class, Long.class)
+                .directModelSubstitute(LocalDate.class, String.class)
+                .directModelSubstitute(LocalTime.class, String.class)
                 .enableUrlTemplating(true);
     }

<|original_code|>
package org.jgrades.rest;

import org.joda.time.DateTime;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class RestDocsConfig {
    @Bean
    public Docket jGradesRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .pathMapping("/")
                .directModelSubstitute(DateTime.class, Long.class)
                .enableUrlTemplating(true);
    }

}

<|edits_diff|>
--- jg-backend/interface/jg-rest-ws/src/main/java/org/jgrades/rest/RestDocsConfig.java
+++ jg-backend/interface/jg-rest-ws/src/main/java/org/jgrades/rest/RestDocsConfig.java
@@ -1,6 +1,8 @@
 package org.jgrades.rest;

 import org.joda.time.DateTime;
+import org.joda.time.LocalDate;
+import org.joda.time.LocalTime;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 import springfox.documentation.builders.PathSelectors;
<|current_version|>
package org.jgrades.rest;

import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.LocalTime;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class RestDocsConfig {
    @Bean
    public Docket jGradesRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .pathMapping("/")
                .directModelSubstitute(DateTime.class, Long.class)
                .enableUrlTemplating(true);
    }

}

<|next_version|>
package org.jgrades.rest;

import org.joda.time.DateTime;
import org.joda.time.LocalDate;
import org.joda.time.LocalTime;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

@Configuration
@EnableSwagger2
public class RestDocsConfig {
    @Bean
    public Docket jGradesRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .pathMapping("/")
                .directModelSubstitute(DateTime.class, Long.class)
                .directModelSubstitute(LocalDate.class, String.class)
                .directModelSubstitute(LocalTime.class, String.class)
                .enableUrlTemplating(true);
    }

}


Add a constructor that takes a cause Exception.

git-svn-id: fcb33a7ee5ec38b96370833547f088a4e742b712@1638 c76caeb1-94fd-44dd-870f-0c9d92034fc1

--- org/xbill/DNS/WireParseException.java
+++ org/xbill/DNS/WireParseException.java
@@ -22,4 +22,9 @@
 	super(s);
 }

+public
+WireParseException(String s, Throwable cause) {
+	super(s, cause);
 }
+
+}

<|original_code|>
// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)

package org.xbill.DNS;

import java.io.*;

/**
 * An exception thrown when a DNS message is invalid.
 *
 * @author Brian Wellington
 */

public class WireParseException extends IOException {

public
WireParseException() {
	super();
}

public
WireParseException(String s) {
	super(s);
}

}

<|edits_diff|>
--- org/xbill/DNS/WireParseException.java
+++ org/xbill/DNS/WireParseException.java
@@ -22,4 +22,7 @@
 	super(s);
 }

+public
+WireParseException(String s, Throwable cause) {
+	super(s, cause);
 }
<|current_version|>
// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)

package org.xbill.DNS;

import java.io.*;

/**
 * An exception thrown when a DNS message is invalid.
 *
 * @author Brian Wellington
 */

public class WireParseException extends IOException {

public
WireParseException() {
	super();
}

public
WireParseException(String s) {
	super(s);
}

public
WireParseException(String s, Throwable cause) {
	super(s, cause);
}

<|next_version|>
// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)

package org.xbill.DNS;

import java.io.*;

/**
 * An exception thrown when a DNS message is invalid.
 *
 * @author Brian Wellington
 */

public class WireParseException extends IOException {

public
WireParseException() {
	super();
}

public
WireParseException(String s) {
	super(s);
}

public
WireParseException(String s, Throwable cause) {
	super(s, cause);
}

}


Add default method for finding strings rather than byte[]

--- core/src/main/java/org/lemurproject/galago/core/index/KeyIterator.java
+++ core/src/main/java/org/lemurproject/galago/core/index/KeyIterator.java
@@ -2,6 +2,7 @@
 package org.lemurproject.galago.core.index;

 import org.lemurproject.galago.core.retrieval.iterator.BaseIterator;
+import org.lemurproject.galago.utility.ByteUtil;

 import java.io.IOException;

@@ -20,6 +21,10 @@

   // moves iterator to some particular key
   public boolean findKey(byte[] key) throws IOException;
+
+  default boolean findKey(String key) throws IOException {
+    return findKey(ByteUtil.fromString(key));
+  }

   // moves iterator to a particular key (forward direction only)
   public boolean skipToKey(byte[] key) throws IOException;

<|original_code|>
// BSD License (http://lemurproject.org/galago-license)
package org.lemurproject.galago.core.index;

import org.lemurproject.galago.core.retrieval.iterator.BaseIterator;

import java.io.IOException;

/**
 * Each iterator from an index has an extra two methods,
 * getValueString() and nextKey(), that allows the data from
 * the index to be easily printed.  DumpIndex uses this functionality
 * to dump the contents of any Galago index.
 *
 * (2/22/2011, irmarc): Refactored into the index package to indicate this is functionality
 *                      that a disk-based iterator should have.
 *
 * @author trevor, irmarc
 */
public interface KeyIterator extends Comparable<KeyIterator> {

  // moves iterator to some particular key
  public boolean findKey(byte[] key) throws IOException;

  // moves iterator to a particular key (forward direction only)
  public boolean skipToKey(byte[] key) throws IOException;

  // moves iterator to the next key
  public boolean nextKey() throws IOException;

  // true if the iterator has moved past the last key
  public boolean isDone();

  // resets iterator to the first key
  public void reset() throws IOException;

  // Access to key data
  public byte[] getKey() throws IOException;
  public String getKeyString() throws IOException;

  // Access to the key's value. (Not all may be implemented)
  public byte[] getValueBytes() throws IOException;
  public String getValueString() throws IOException;
  public BaseIterator getValueIterator() throws IOException;
}

<|edits_diff|>
--- core/src/main/java/org/lemurproject/galago/core/index/KeyIterator.java
+++ core/src/main/java/org/lemurproject/galago/core/index/KeyIterator.java
@@ -2,6 +2,7 @@
 package org.lemurproject.galago.core.index;

 import org.lemurproject.galago.core.retrieval.iterator.BaseIterator;
+import org.lemurproject.galago.utility.ByteUtil;

 import java.io.IOException;

<|current_version|>
// BSD License (http://lemurproject.org/galago-license)
package org.lemurproject.galago.core.index;

import org.lemurproject.galago.core.retrieval.iterator.BaseIterator;
import org.lemurproject.galago.utility.ByteUtil;

import java.io.IOException;

/**
 * Each iterator from an index has an extra two methods,
 * getValueString() and nextKey(), that allows the data from
 * the index to be easily printed.  DumpIndex uses this functionality
 * to dump the contents of any Galago index.
 *
 * (2/22/2011, irmarc): Refactored into the index package to indicate this is functionality
 *                      that a disk-based iterator should have.
 *
 * @author trevor, irmarc
 */
public interface KeyIterator extends Comparable<KeyIterator> {

  // moves iterator to some particular key
  public boolean findKey(byte[] key) throws IOException;

  // moves iterator to a particular key (forward direction only)
  public boolean skipToKey(byte[] key) throws IOException;

  // moves iterator to the next key
  public boolean nextKey() throws IOException;

  // true if the iterator has moved past the last key
  public boolean isDone();

  // resets iterator to the first key
  public void reset() throws IOException;

  // Access to key data
  public byte[] getKey() throws IOException;
  public String getKeyString() throws IOException;

  // Access to the key's value. (Not all may be implemented)
  public byte[] getValueBytes() throws IOException;
  public String getValueString() throws IOException;
  public BaseIterator getValueIterator() throws IOException;
}

<|next_version|>
// BSD License (http://lemurproject.org/galago-license)
package org.lemurproject.galago.core.index;

import org.lemurproject.galago.core.retrieval.iterator.BaseIterator;
import org.lemurproject.galago.utility.ByteUtil;

import java.io.IOException;

/**
 * Each iterator from an index has an extra two methods,
 * getValueString() and nextKey(), that allows the data from
 * the index to be easily printed.  DumpIndex uses this functionality
 * to dump the contents of any Galago index.
 *
 * (2/22/2011, irmarc): Refactored into the index package to indicate this is functionality
 *                      that a disk-based iterator should have.
 *
 * @author trevor, irmarc
 */
public interface KeyIterator extends Comparable<KeyIterator> {

  // moves iterator to some particular key
  public boolean findKey(byte[] key) throws IOException;

  default boolean findKey(String key) throws IOException {
    return findKey(ByteUtil.fromString(key));
  }

  // moves iterator to a particular key (forward direction only)
  public boolean skipToKey(byte[] key) throws IOException;

  // moves iterator to the next key
  public boolean nextKey() throws IOException;

  // true if the iterator has moved past the last key
  public boolean isDone();

  // resets iterator to the first key
  public void reset() throws IOException;

  // Access to key data
  public byte[] getKey() throws IOException;
  public String getKeyString() throws IOException;

  // Access to the key's value. (Not all may be implemented)
  public byte[] getValueBytes() throws IOException;
  public String getValueString() throws IOException;
  public BaseIterator getValueIterator() throws IOException;
}


Add get amount method in offer

Add get amount method in offer

--- main/src/main/java/com/bloatit/framework/Offer.java
+++ main/src/main/java/com/bloatit/framework/Offer.java
@@ -1,5 +1,6 @@
 package com.bloatit.framework;

+import java.math.BigDecimal;
 import java.util.Date;

 import com.bloatit.framework.right.OfferRight;
@@ -49,6 +50,10 @@
         return new Description(dao.getDescription());
     }

+    public BigDecimal getAmount() {
+        return dao.getAmount();
+    }
+
     @Override
     protected DaoKudosable getDaoKudosable() {
         return dao;

<|original_code|>
package com.bloatit.framework;

import java.util.Date;

import com.bloatit.framework.right.OfferRight;
import com.bloatit.framework.right.RightManager.Action;
import com.bloatit.model.data.DaoComment;
import com.bloatit.model.data.DaoKudosable;
import com.bloatit.model.data.DaoOffer;

public final class Offer extends Kudosable {

    private final DaoOffer dao;

    public static Offer create(final DaoOffer dao) {
        if (dao == null) {
            return null;
        }
        return new Offer(dao);
    }

    public Offer(final DaoOffer dao) {
        super();
        this.dao = dao;
    }

    public DaoOffer getDao() {
        return dao;
    }

    public Date getDateExpire() {
        return dao.getDateExpire();
    }

    public boolean canSetdatExpire() {
        return new OfferRight.DateExpire().canAccess(calculateRole(this), Action.WRITE);
    }

    public void setDateExpire(final Date dateExpire) {
        new OfferRight.DateExpire().tryAccess(calculateRole(this), Action.WRITE);
        dao.setDateExpire(dateExpire);
    }

    public Demand getDemand() {
        return Demand.create(dao.getDemand());
    }

    public Description getDescription() {
        return new Description(dao.getDescription());
    }

    @Override
    protected DaoKudosable getDaoKudosable() {
        return dao;
    }

}

<|edits_diff|>
--- main/src/main/java/com/bloatit/framework/Offer.java
+++ main/src/main/java/com/bloatit/framework/Offer.java
@@ -1,5 +1,6 @@
 package com.bloatit.framework;

+import java.math.BigDecimal;
 import java.util.Date;

 import com.bloatit.framework.right.OfferRight;
<|current_version|>
package com.bloatit.framework;

import java.math.BigDecimal;
import java.util.Date;

import com.bloatit.framework.right.OfferRight;
import com.bloatit.framework.right.RightManager.Action;
import com.bloatit.model.data.DaoComment;
import com.bloatit.model.data.DaoKudosable;
import com.bloatit.model.data.DaoOffer;

public final class Offer extends Kudosable {

    private final DaoOffer dao;

    public static Offer create(final DaoOffer dao) {
        if (dao == null) {
            return null;
        }
        return new Offer(dao);
    }

    public Offer(final DaoOffer dao) {
        super();
        this.dao = dao;
    }

    public DaoOffer getDao() {
        return dao;
    }

    public Date getDateExpire() {
        return dao.getDateExpire();
    }

    public boolean canSetdatExpire() {
        return new OfferRight.DateExpire().canAccess(calculateRole(this), Action.WRITE);
    }

    public void setDateExpire(final Date dateExpire) {
        new OfferRight.DateExpire().tryAccess(calculateRole(this), Action.WRITE);
        dao.setDateExpire(dateExpire);
    }

    public Demand getDemand() {
        return Demand.create(dao.getDemand());
    }

    public Description getDescription() {
        return new Description(dao.getDescription());
    }

    @Override
    protected DaoKudosable getDaoKudosable() {
        return dao;
    }

}

<|next_version|>
package com.bloatit.framework;

import java.math.BigDecimal;
import java.util.Date;

import com.bloatit.framework.right.OfferRight;
import com.bloatit.framework.right.RightManager.Action;
import com.bloatit.model.data.DaoComment;
import com.bloatit.model.data.DaoKudosable;
import com.bloatit.model.data.DaoOffer;

public final class Offer extends Kudosable {

    private final DaoOffer dao;

    public static Offer create(final DaoOffer dao) {
        if (dao == null) {
            return null;
        }
        return new Offer(dao);
    }

    public Offer(final DaoOffer dao) {
        super();
        this.dao = dao;
    }

    public DaoOffer getDao() {
        return dao;
    }

    public Date getDateExpire() {
        return dao.getDateExpire();
    }

    public boolean canSetdatExpire() {
        return new OfferRight.DateExpire().canAccess(calculateRole(this), Action.WRITE);
    }

    public void setDateExpire(final Date dateExpire) {
        new OfferRight.DateExpire().tryAccess(calculateRole(this), Action.WRITE);
        dao.setDateExpire(dateExpire);
    }

    public Demand getDemand() {
        return Demand.create(dao.getDemand());
    }

    public Description getDescription() {
        return new Description(dao.getDescription());
    }

    public BigDecimal getAmount() {
        return dao.getAmount();
    }

    @Override
    protected DaoKudosable getDaoKudosable() {
        return dao;
    }

}


Fix root element of authz-config.json to be 'policies'

--- modules/security/src/main/java/io/liveoak/security/spi/AuthzPolicyGroup.java
+++ modules/security/src/main/java/io/liveoak/security/spi/AuthzPolicyGroup.java
@@ -2,6 +2,8 @@

 import java.util.ArrayList;
 import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;

 /**
  * @author Bob McWhirter
@@ -24,6 +26,7 @@
         this.entries = entries;
     }

+    @JsonProperty("policies")
     private List<AuthzPolicyEntry> entries;

 }

<|original_code|>
package io.liveoak.security.spi;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Bob McWhirter
 */
public class AuthzPolicyGroup {

    public AuthzPolicyGroup() {
        this.entries = new ArrayList<>();
    }

    public AuthzPolicyGroup(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    public List<AuthzPolicyEntry> entries() {
        return this.entries;
    }

    public void entries(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    private List<AuthzPolicyEntry> entries;

}

<|edits_diff|>
--- modules/security/src/main/java/io/liveoak/security/spi/AuthzPolicyGroup.java
+++ modules/security/src/main/java/io/liveoak/security/spi/AuthzPolicyGroup.java
@@ -2,6 +2,8 @@

 import java.util.ArrayList;
 import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;

 /**
  * @author Bob McWhirter
<|current_version|>
package io.liveoak.security.spi;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author Bob McWhirter
 */
public class AuthzPolicyGroup {

    public AuthzPolicyGroup() {
        this.entries = new ArrayList<>();
    }

    public AuthzPolicyGroup(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    public List<AuthzPolicyEntry> entries() {
        return this.entries;
    }

    public void entries(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    private List<AuthzPolicyEntry> entries;

}

<|next_version|>
package io.liveoak.security.spi;

import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * @author Bob McWhirter
 */
public class AuthzPolicyGroup {

    public AuthzPolicyGroup() {
        this.entries = new ArrayList<>();
    }

    public AuthzPolicyGroup(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    public List<AuthzPolicyEntry> entries() {
        return this.entries;
    }

    public void entries(List<AuthzPolicyEntry> entries) {
        this.entries = entries;
    }

    @JsonProperty("policies")
    private List<AuthzPolicyEntry> entries;

}


Fix some mixin warnings aboufields that d don't exist

--- src/optifine_dummy/java/net/optifine/render/ChunkVisibility.java
+++ src/optifine_dummy/java/net/optifine/render/ChunkVisibility.java
@@ -1,5 +1,12 @@
 package net.optifine.render;

 public class ChunkVisibility {
+    private static int counter;
+    private static int iMaxStatic;

+    private static int iMaxStaticFinal;
+
+    //private static World worldLast = null;
+    private static int pcxLast;
+    private static int pczLast;
 }

<|original_code|>
package net.optifine.render;

public class ChunkVisibility {

}

<|edits_diff|>
--- src/optifine_dummy/java/net/optifine/render/ChunkVisibility.java
+++ src/optifine_dummy/java/net/optifine/render/ChunkVisibility.java
@@ -1,5 +1,7 @@
 package net.optifine.render;

 public class ChunkVisibility {
+    private static int counter;
+    private static int iMaxStatic;

 }
<|current_version|>
package net.optifine.render;

public class ChunkVisibility {
    private static int counter;
    private static int iMaxStatic;

}

<|next_version|>
package net.optifine.render;

public class ChunkVisibility {
    private static int counter;
    private static int iMaxStatic;

    private static int iMaxStaticFinal;

    //private static World worldLast = null;
    private static int pcxLast;
    private static int pczLast;
}


Add .gz and bgzf.gz files to infer unit tests

--- src/test/java/org/seqdoop/hadoop_bam/TestVCFFormat.java
+++ src/test/java/org/seqdoop/hadoop_bam/TestVCFFormat.java
@@ -15,12 +15,15 @@
   public void testInferFromFilePath() throws IOException {
     assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf"));
     assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.gz"));
+    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.bgzf.gz"));
     assertNull(VCFFormat.inferFromFilePath("test.sam"));
   }

   @Test
   public void testInferFromData() throws IOException {
     assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf")));
+    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf.gz")));
+    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf.bgzf.gz")));
     assertNull(VCFFormat.inferFromData(stream("test.sam")));
   }

<|original_code|>
package org.seqdoop.hadoop_bam;

import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class TestVCFFormat {

  @Test
  public void testInferFromFilePath() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf"));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.gz"));
    assertNull(VCFFormat.inferFromFilePath("test.sam"));
  }

  @Test
  public void testInferFromData() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf")));
    assertNull(VCFFormat.inferFromData(stream("test.sam")));
  }

  private InputStream stream(String resource) throws IOException {
    return ClassLoader.getSystemClassLoader().getResource(resource).openStream();
  }
}

<|edits_diff|>
--- src/test/java/org/seqdoop/hadoop_bam/TestVCFFormat.java
+++ src/test/java/org/seqdoop/hadoop_bam/TestVCFFormat.java
@@ -15,6 +15,7 @@
   public void testInferFromFilePath() throws IOException {
     assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf"));
     assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.gz"));
+    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.bgzf.gz"));
     assertNull(VCFFormat.inferFromFilePath("test.sam"));
   }

<|current_version|>
package org.seqdoop.hadoop_bam;

import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class TestVCFFormat {

  @Test
  public void testInferFromFilePath() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf"));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.gz"));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.bgzf.gz"));
    assertNull(VCFFormat.inferFromFilePath("test.sam"));
  }

  @Test
  public void testInferFromData() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf")));
    assertNull(VCFFormat.inferFromData(stream("test.sam")));
  }

  private InputStream stream(String resource) throws IOException {
    return ClassLoader.getSystemClassLoader().getResource(resource).openStream();
  }
}

<|next_version|>
package org.seqdoop.hadoop_bam;

import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class TestVCFFormat {

  @Test
  public void testInferFromFilePath() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf"));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.gz"));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromFilePath("test.vcf.bgzf.gz"));
    assertNull(VCFFormat.inferFromFilePath("test.sam"));
  }

  @Test
  public void testInferFromData() throws IOException {
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf")));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf.gz")));
    assertEquals(VCFFormat.VCF, VCFFormat.inferFromData(stream("test.vcf.bgzf.gz")));
    assertNull(VCFFormat.inferFromData(stream("test.sam")));
  }

  private InputStream stream(String resource) throws IOException {
    return ClassLoader.getSystemClassLoader().getResource(resource).openStream();
  }
}


Add courseScores hashmap for course priority ranking

--- src/main/java/com/google/sps/data/GenerateScheduleRequest.java
+++ src/main/java/com/google/sps/data/GenerateScheduleRequest.java
@@ -1,6 +1,7 @@
 package com.google.sps.data;

 import java.util.List;
+import java.util.HashMap;

 public class GenerateScheduleRequest {
   List<Course> courses;
@@ -21,6 +22,10 @@
     return this.criterion.preferredSubject;
   }

+  public HashMap<String, Integer> getCourseScores() {
+    return this.criterion.courseScores;
+  }
+
   public Invariants getCredits() {
     return this.basicInfo.credits;
   }
@@ -37,6 +42,7 @@
 class InputCriterion {
   List<TimeRange> timePreferences;
   String preferredSubject;
+  HashMap<String, Integer> courseScores;
 }

 class BasicInfo {

<|original_code|>
package com.google.sps.data;

import java.util.List;

public class GenerateScheduleRequest {
  List<Course> courses;
  InputCriterion criterion;
  BasicInfo basicInfo;

  public GenerateScheduleRequest(){};

  public List<Course> getCourses() {
    return this.courses;
  }

  public List<TimeRange> getTimePreferences() {
    return this.criterion.timePreferences;
  }

  public String getPreferredSubject() {
    return this.criterion.preferredSubject;
  }

  public Invariants getCredits() {
    return this.basicInfo.credits;
  }

  public String getTermStartDate() {
    return this.basicInfo.termDates.startDate;
  }

  public String getTermEndDate() {
    return this.basicInfo.termDates.endDate;
  }
}

class InputCriterion {
  List<TimeRange> timePreferences;
  String preferredSubject;
}

class BasicInfo {
  Invariants credits;
  TermDates termDates;
}

class TermDates {
  String startDate;
  String endDate;
}

<|edits_diff|>
--- src/main/java/com/google/sps/data/GenerateScheduleRequest.java
+++ src/main/java/com/google/sps/data/GenerateScheduleRequest.java
@@ -1,6 +1,7 @@
 package com.google.sps.data;

 import java.util.List;
+import java.util.HashMap;

 public class GenerateScheduleRequest {
   List<Course> courses;
@@ -19,6 +20,10 @@

   public String getPreferredSubject() {
     return this.criterion.preferredSubject;
+  }
+
+  public HashMap<String, Integer> getCourseScores() {
+    return this.criterion.courseScores;
   }

   public Invariants getCredits() {
<|current_version|>
package com.google.sps.data;

import java.util.List;
import java.util.HashMap;

public class GenerateScheduleRequest {
  List<Course> courses;
  InputCriterion criterion;
  BasicInfo basicInfo;

  public GenerateScheduleRequest(){};

  public List<Course> getCourses() {
    return this.courses;
  }

  public List<TimeRange> getTimePreferences() {
    return this.criterion.timePreferences;
  }

  public String getPreferredSubject() {
    return this.criterion.preferredSubject;
  }

  public HashMap<String, Integer> getCourseScores() {
    return this.criterion.courseScores;
  }

  public Invariants getCredits() {
    return this.basicInfo.credits;
  }

  public String getTermStartDate() {
    return this.basicInfo.termDates.startDate;
  }

  public String getTermEndDate() {
    return this.basicInfo.termDates.endDate;
  }
}

class InputCriterion {
  List<TimeRange> timePreferences;
  String preferredSubject;
}

class BasicInfo {
  Invariants credits;
  TermDates termDates;
}

class TermDates {
  String startDate;
  String endDate;
}

<|next_version|>
package com.google.sps.data;

import java.util.List;
import java.util.HashMap;

public class GenerateScheduleRequest {
  List<Course> courses;
  InputCriterion criterion;
  BasicInfo basicInfo;

  public GenerateScheduleRequest(){};

  public List<Course> getCourses() {
    return this.courses;
  }

  public List<TimeRange> getTimePreferences() {
    return this.criterion.timePreferences;
  }

  public String getPreferredSubject() {
    return this.criterion.preferredSubject;
  }

  public HashMap<String, Integer> getCourseScores() {
    return this.criterion.courseScores;
  }

  public Invariants getCredits() {
    return this.basicInfo.credits;
  }

  public String getTermStartDate() {
    return this.basicInfo.termDates.startDate;
  }

  public String getTermEndDate() {
    return this.basicInfo.termDates.endDate;
  }
}

class InputCriterion {
  List<TimeRange> timePreferences;
  String preferredSubject;
  HashMap<String, Integer> courseScores;
}

class BasicInfo {
  Invariants credits;
  TermDates termDates;
}

class TermDates {
  String startDate;
  String endDate;
}


Add basic competition object without additional info

--- project/src/main/java/com/google/sps/data/CompetitionSummary.java
+++ project/src/main/java/com/google/sps/data/CompetitionSummary.java
@@ -13,6 +13,7 @@
 // limitations under the License.

 package com.google.sps.data;
+import com.google.auto.value.AutoValue;

 /**
  * A summary of a competition the user is in
@@ -31,6 +32,7 @@
   public abstract long startDate();
   public abstract long endDate();
   public abstract int rank();
+  public abstract int rankYesterday();
   public abstract int netWorth();
   public abstract int amountAvailable();
 }

<|original_code|>
// Copyright 2021 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.sps.data;

/**
 * A summary of a competition the user is in
 */
@AutoValue
public abstract class CompetitionSummary {
  public static CompetitionSummary create(long id, String competitionName, String organiserName, String organiserEmail,
  long startDate, long endDate, int rank, int rankYesterday, int netWorth, int amountAvailable) {
    return new AutoValue_CompetitionSummary(id, competitionName, organiserName, organiserEmail, startDate, endDate,
      rank, rankYesterday, netWorth, amountAvailable);
  }
  public abstract long id();
  public abstract String competitionName();
  public abstract String organiserName();
  public abstract String organiserEmail();
  public abstract long startDate();
  public abstract long endDate();
  public abstract int rank();
  public abstract int netWorth();
  public abstract int amountAvailable();
}
<|edits_diff|>
--- project/src/main/java/com/google/sps/data/CompetitionSummary.java
+++ project/src/main/java/com/google/sps/data/CompetitionSummary.java
@@ -13,6 +13,7 @@
 // limitations under the License.

 package com.google.sps.data;
+import com.google.auto.value.AutoValue;

 /**
  * A summary of a competition the user is in
<|current_version|>
// Copyright 2021 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.sps.data;
import com.google.auto.value.AutoValue;

/**
 * A summary of a competition the user is in
 */
@AutoValue
public abstract class CompetitionSummary {
  public static CompetitionSummary create(long id, String competitionName, String organiserName, String organiserEmail,
  long startDate, long endDate, int rank, int rankYesterday, int netWorth, int amountAvailable) {
    return new AutoValue_CompetitionSummary(id, competitionName, organiserName, organiserEmail, startDate, endDate,
      rank, rankYesterday, netWorth, amountAvailable);
  }
  public abstract long id();
  public abstract String competitionName();
  public abstract String organiserName();
  public abstract String organiserEmail();
  public abstract long startDate();
  public abstract long endDate();
  public abstract int rank();
  public abstract int netWorth();
  public abstract int amountAvailable();
}
<|next_version|>
// Copyright 2021 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.sps.data;
import com.google.auto.value.AutoValue;

/**
 * A summary of a competition the user is in
 */
@AutoValue
public abstract class CompetitionSummary {
  public static CompetitionSummary create(long id, String competitionName, String organiserName, String organiserEmail,
  long startDate, long endDate, int rank, int rankYesterday, int netWorth, int amountAvailable) {
    return new AutoValue_CompetitionSummary(id, competitionName, organiserName, organiserEmail, startDate, endDate,
      rank, rankYesterday, netWorth, amountAvailable);
  }
  public abstract long id();
  public abstract String competitionName();
  public abstract String organiserName();
  public abstract String organiserEmail();
  public abstract long startDate();
  public abstract long endDate();
  public abstract int rank();
  public abstract int rankYesterday();
  public abstract int netWorth();
  public abstract int amountAvailable();
}


Disable test as it sometimes fails on the CI

Motivation:

Temporary disable test that wwas introduced as part of f60d08fd32b7287f65077f99a88bac645834098f as it sometimes fail on the CI. We need to figure out why it fails there (can not reproduce so far even on the CI after ssh into it).

Modifications:

Ignore test.

Result:

More stable builds until we figure out the flackyness.

--- testsuite-shading/src/test/java/io/netty/testsuite/shading/ShadingIT.java
+++ testsuite-shading/src/test/java/io/netty/testsuite/shading/ShadingIT.java
@@ -16,6 +16,7 @@
 package io.netty.testsuite.shading;

 import io.netty.util.internal.PlatformDependent;
+import org.junit.Ignore;
 import org.junit.Test;

 import java.lang.reflect.Method;
@@ -27,6 +28,7 @@
         testShading0(PlatformDependent.isOsx() ? "io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll");
     }

+    @Ignore("Figure out why this sometimes fail on the CI")
     @Test
     public void testShadingTcnative() throws Exception {
         testShading0("io.netty.handler.ssl.OpenSsl");

<|original_code|>
/*
 * Copyright 2018 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.testsuite.shading;

import io.netty.util.internal.PlatformDependent;
import org.junit.Test;

import java.lang.reflect.Method;

public class ShadingIT {

    @Test
    public void testShadingNativeTransport() throws Exception {
        testShading0(PlatformDependent.isOsx() ? "io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll");
    }

    @Test
    public void testShadingTcnative() throws Exception {
        testShading0("io.netty.handler.ssl.OpenSsl");
    }

    private static void testShading0(String classname) throws Exception {
        String shadingPrefix = System.getProperty("shadingPrefix");
        final Class<?> clazz = Class.forName(shadingPrefix + '.' + classname);
        Method method = clazz.getMethod("ensureAvailability");
        method.invoke(null);
    }
}

<|edits_diff|>
--- testsuite-shading/src/test/java/io/netty/testsuite/shading/ShadingIT.java
+++ testsuite-shading/src/test/java/io/netty/testsuite/shading/ShadingIT.java
@@ -16,6 +16,7 @@
 package io.netty.testsuite.shading;

 import io.netty.util.internal.PlatformDependent;
+import org.junit.Ignore;
 import org.junit.Test;

 import java.lang.reflect.Method;
<|current_version|>
/*
 * Copyright 2018 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.testsuite.shading;

import io.netty.util.internal.PlatformDependent;
import org.junit.Ignore;
import org.junit.Test;

import java.lang.reflect.Method;

public class ShadingIT {

    @Test
    public void testShadingNativeTransport() throws Exception {
        testShading0(PlatformDependent.isOsx() ? "io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll");
    }

    @Test
    public void testShadingTcnative() throws Exception {
        testShading0("io.netty.handler.ssl.OpenSsl");
    }

    private static void testShading0(String classname) throws Exception {
        String shadingPrefix = System.getProperty("shadingPrefix");
        final Class<?> clazz = Class.forName(shadingPrefix + '.' + classname);
        Method method = clazz.getMethod("ensureAvailability");
        method.invoke(null);
    }
}

<|next_version|>
/*
 * Copyright 2018 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.testsuite.shading;

import io.netty.util.internal.PlatformDependent;
import org.junit.Ignore;
import org.junit.Test;

import java.lang.reflect.Method;

public class ShadingIT {

    @Test
    public void testShadingNativeTransport() throws Exception {
        testShading0(PlatformDependent.isOsx() ? "io.netty.channel.kqueue.KQueue" : "io.netty.channel.epoll.Epoll");
    }

    @Ignore("Figure out why this sometimes fail on the CI")
    @Test
    public void testShadingTcnative() throws Exception {
        testShading0("io.netty.handler.ssl.OpenSsl");
    }

    private static void testShading0(String classname) throws Exception {
        String shadingPrefix = System.getProperty("shadingPrefix");
        final Class<?> clazz = Class.forName(shadingPrefix + '.' + classname);
        Method method = clazz.getMethod("ensureAvailability");
        method.invoke(null);
    }
}


Add logging to status queue clearing

Add logging to status queue clearing

--- skype-reporting/src/main/java/org/asg/report/CleanJob.java
+++ skype-reporting/src/main/java/org/asg/report/CleanJob.java
@@ -1,14 +1,18 @@
 package org.asg.report;

+import org.apache.log4j.Logger;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;

 public class CleanJob implements Job {
+
+	private final static Logger LOGGER = Logger.getLogger(CleanJob.class);

 	public void execute(JobExecutionContext context)
 			throws JobExecutionException {
 		App.statuses.clear();
+		LOGGER.info("Status Queue was just cleared");
 	}

<|original_code|>
package org.asg.report;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class CleanJob implements Job {

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		App.statuses.clear();
	}

}

<|edits_diff|>
--- skype-reporting/src/main/java/org/asg/report/CleanJob.java
+++ skype-reporting/src/main/java/org/asg/report/CleanJob.java
@@ -1,10 +1,13 @@
 package org.asg.report;

+import org.apache.log4j.Logger;
 import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;

 public class CleanJob implements Job {
+
+	private final static Logger LOGGER = Logger.getLogger(CleanJob.class);

 	public void execute(JobExecutionContext context)
 			throws JobExecutionException {
<|current_version|>
package org.asg.report;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class CleanJob implements Job {

	private final static Logger LOGGER = Logger.getLogger(CleanJob.class);

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		App.statuses.clear();
	}

}

<|next_version|>
package org.asg.report;

import org.apache.log4j.Logger;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class CleanJob implements Job {

	private final static Logger LOGGER = Logger.getLogger(CleanJob.class);

	public void execute(JobExecutionContext context)
			throws JobExecutionException {
		App.statuses.clear();
		LOGGER.info("Status Queue was just cleared");
	}

}


Add help menu to menu bar.

Add help menu to menu bar.

--- edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/menu/MenuBar.java
+++ edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/menu/MenuBar.java
@@ -8,6 +8,7 @@

 	private FileMenu fileMenu;
 	private DocumentMenu documentMenu;
+	private HelpMenu helpMenu;

 	public MenuBar() {
 		this.addMenus();
@@ -16,8 +17,10 @@
 	private void addMenus() {
 		this.fileMenu = new FileMenu();
 		this.documentMenu = new DocumentMenu();
+		this.helpMenu = new HelpMenu();

 		super.add(this.fileMenu);
 		super.add(this.documentMenu);
+		super.add(this.helpMenu);
 	}
 }

<|original_code|>
package com.github.aureliano.edocs.app.gui.menu;

import javax.swing.JMenuBar;

public class MenuBar extends JMenuBar {

	private static final long serialVersionUID = 5179328504511930019L;

	private FileMenu fileMenu;
	private DocumentMenu documentMenu;

	public MenuBar() {
		this.addMenus();
	}

	private void addMenus() {
		this.fileMenu = new FileMenu();
		this.documentMenu = new DocumentMenu();

		super.add(this.fileMenu);
		super.add(this.documentMenu);
	}
}
<|edits_diff|>
--- edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/menu/MenuBar.java
+++ edocs-app/src/main/java/com/github/aureliano/edocs/app/gui/menu/MenuBar.java
@@ -8,6 +8,7 @@

 	private FileMenu fileMenu;
 	private DocumentMenu documentMenu;
+	private HelpMenu helpMenu;

 	public MenuBar() {
 		this.addMenus();
@@ -16,6 +17,7 @@
 	private void addMenus() {
 		this.fileMenu = new FileMenu();
 		this.documentMenu = new DocumentMenu();
+		this.helpMenu = new HelpMenu();

 		super.add(this.fileMenu);
 		super.add(this.documentMenu);
<|current_version|>
package com.github.aureliano.edocs.app.gui.menu;

import javax.swing.JMenuBar;

public class MenuBar extends JMenuBar {

	private static final long serialVersionUID = 5179328504511930019L;

	private FileMenu fileMenu;
	private DocumentMenu documentMenu;
	private HelpMenu helpMenu;

	public MenuBar() {
		this.addMenus();
	}

	private void addMenus() {
		this.fileMenu = new FileMenu();
		this.documentMenu = new DocumentMenu();
		this.helpMenu = new HelpMenu();

		super.add(this.fileMenu);
		super.add(this.documentMenu);
	}
}
<|next_version|>
package com.github.aureliano.edocs.app.gui.menu;

import javax.swing.JMenuBar;

public class MenuBar extends JMenuBar {

	private static final long serialVersionUID = 5179328504511930019L;

	private FileMenu fileMenu;
	private DocumentMenu documentMenu;
	private HelpMenu helpMenu;

	public MenuBar() {
		this.addMenus();
	}

	private void addMenus() {
		this.fileMenu = new FileMenu();
		this.documentMenu = new DocumentMenu();
		this.helpMenu = new HelpMenu();

		super.add(this.fileMenu);
		super.add(this.documentMenu);
		super.add(this.helpMenu);
	}
}


AND-7076: Set limit for GET request for recents endpoint

The default limit of 100 is set for GET recent items.

--- box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestRecentItems.java
+++ box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestRecentItems.java
@@ -15,6 +15,8 @@
      */
     public static class GetRecentItems extends BoxRequestList<BoxIteratorRecentItems, BoxRequestRecentItems.GetRecentItems> implements BoxCacheableRequest<BoxIteratorRecentItems> {
         private static final long serialVersionUID = 8123965031279971506L;
+        private static final String LIMIT = "limit";
+        private static final String DEFAULT_LIMIT = "100";

         /**
          * Creates a get recent items request
@@ -24,6 +26,7 @@
          */
         public GetRecentItems(String recentItemsUrl, BoxSession session) {
             super(BoxIteratorRecentItems.class, null, recentItemsUrl, session);
+            mQueryMap.put(LIMIT, DEFAULT_LIMIT);
         }

         @Override

<|original_code|>
package com.box.androidsdk.content.requests;

import com.box.androidsdk.content.BoxException;
import com.box.androidsdk.content.BoxFutureTask;
import com.box.androidsdk.content.models.BoxIteratorRecentItems;
import com.box.androidsdk.content.models.BoxSession;

/**
 * BoxRequest to perform operations on the global recents endpoint
 */
public class BoxRequestRecentItems {

    /**
     * Request to get the Recent Items
     */
    public static class GetRecentItems extends BoxRequestList<BoxIteratorRecentItems, BoxRequestRecentItems.GetRecentItems> implements BoxCacheableRequest<BoxIteratorRecentItems> {
        private static final long serialVersionUID = 8123965031279971506L;

        /**
         * Creates a get recent items request
         *
         * @param recentItemsUrl    URL of the recents items endpoint.
         * @param session   the authenticated session that will be used to make the request with.
         */
        public GetRecentItems(String recentItemsUrl, BoxSession session) {
            super(BoxIteratorRecentItems.class, null, recentItemsUrl, session);
        }

        @Override
        public BoxIteratorRecentItems sendForCachedResult() throws BoxException {
            return super.handleSendForCachedResult();
        }

        @Override
        public BoxFutureTask<BoxIteratorRecentItems> toTaskForCachedResult() throws BoxException {
            return super.handleToTaskForCachedResult();
        }
    }
}

<|edits_diff|>
--- box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestRecentItems.java
+++ box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestRecentItems.java
@@ -15,6 +15,8 @@
      */
     public static class GetRecentItems extends BoxRequestList<BoxIteratorRecentItems, BoxRequestRecentItems.GetRecentItems> implements BoxCacheableRequest<BoxIteratorRecentItems> {
         private static final long serialVersionUID = 8123965031279971506L;
+        private static final String LIMIT = "limit";
+        private static final String DEFAULT_LIMIT = "100";

         /**
          * Creates a get recent items request
<|current_version|>
package com.box.androidsdk.content.requests;

import com.box.androidsdk.content.BoxException;
import com.box.androidsdk.content.BoxFutureTask;
import com.box.androidsdk.content.models.BoxIteratorRecentItems;
import com.box.androidsdk.content.models.BoxSession;

/**
 * BoxRequest to perform operations on the global recents endpoint
 */
public class BoxRequestRecentItems {

    /**
     * Request to get the Recent Items
     */
    public static class GetRecentItems extends BoxRequestList<BoxIteratorRecentItems, BoxRequestRecentItems.GetRecentItems> implements BoxCacheableRequest<BoxIteratorRecentItems> {
        private static final long serialVersionUID = 8123965031279971506L;
        private static final String LIMIT = "limit";
        private static final String DEFAULT_LIMIT = "100";

        /**
         * Creates a get recent items request
         *
         * @param recentItemsUrl    URL of the recents items endpoint.
         * @param session   the authenticated session that will be used to make the request with.
         */
        public GetRecentItems(String recentItemsUrl, BoxSession session) {
            super(BoxIteratorRecentItems.class, null, recentItemsUrl, session);
        }

        @Override
        public BoxIteratorRecentItems sendForCachedResult() throws BoxException {
            return super.handleSendForCachedResult();
        }

        @Override
        public BoxFutureTask<BoxIteratorRecentItems> toTaskForCachedResult() throws BoxException {
            return super.handleToTaskForCachedResult();
        }
    }
}

<|next_version|>
package com.box.androidsdk.content.requests;

import com.box.androidsdk.content.BoxException;
import com.box.androidsdk.content.BoxFutureTask;
import com.box.androidsdk.content.models.BoxIteratorRecentItems;
import com.box.androidsdk.content.models.BoxSession;

/**
 * BoxRequest to perform operations on the global recents endpoint
 */
public class BoxRequestRecentItems {

    /**
     * Request to get the Recent Items
     */
    public static class GetRecentItems extends BoxRequestList<BoxIteratorRecentItems, BoxRequestRecentItems.GetRecentItems> implements BoxCacheableRequest<BoxIteratorRecentItems> {
        private static final long serialVersionUID = 8123965031279971506L;
        private static final String LIMIT = "limit";
        private static final String DEFAULT_LIMIT = "100";

        /**
         * Creates a get recent items request
         *
         * @param recentItemsUrl    URL of the recents items endpoint.
         * @param session   the authenticated session that will be used to make the request with.
         */
        public GetRecentItems(String recentItemsUrl, BoxSession session) {
            super(BoxIteratorRecentItems.class, null, recentItemsUrl, session);
            mQueryMap.put(LIMIT, DEFAULT_LIMIT);
        }

        @Override
        public BoxIteratorRecentItems sendForCachedResult() throws BoxException {
            return super.handleSendForCachedResult();
        }

        @Override
        public BoxFutureTask<BoxIteratorRecentItems> toTaskForCachedResult() throws BoxException {
            return super.handleToTaskForCachedResult();
        }
    }
}


Disable test in headless environments

Disable test in headless environments

--- console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ClipboardAccessTest.java
+++ console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ClipboardAccessTest.java
@@ -3,8 +3,11 @@
 import org.junit.Before;
 import org.junit.Test;

+import java.awt.GraphicsEnvironment;
+
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeFalse;

 public class ClipboardAccessTest {
@@ -14,6 +17,7 @@

   @Before
   public void setUp() throws Exception {
+    assumeFalse("Run only in desktop", GraphicsEnvironment.isHeadless());
     testling = new ClipboardAccess();
   }

<|original_code|>
package de.marza.firstspirit.modules.logging.console.utilities;

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

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

public class ClipboardAccessTest {

  private ClipboardAccess testling;

  @Before
  public void setUp() throws Exception {
    testling = new ClipboardAccess();
  }

  @Test
  public void transfer() throws Exception {
    testling.copy("Test 123");

    assertThat(testling.paste(), is("Test 123"));
  }

}
<|edits_diff|>
--- console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ClipboardAccessTest.java
+++ console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ClipboardAccessTest.java
@@ -3,8 +3,11 @@
 import org.junit.Before;
 import org.junit.Test;

+import java.awt.GraphicsEnvironment;
+
 import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
+import static org.junit.Assume.assumeFalse;

 public class ClipboardAccessTest {
<|current_version|>
package de.marza.firstspirit.modules.logging.console.utilities;

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

import java.awt.GraphicsEnvironment;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeFalse;

public class ClipboardAccessTest {

  private ClipboardAccess testling;

  @Before
  public void setUp() throws Exception {
    testling = new ClipboardAccess();
  }

  @Test
  public void transfer() throws Exception {
    testling.copy("Test 123");

    assertThat(testling.paste(), is("Test 123"));
  }

}
<|next_version|>
package de.marza.firstspirit.modules.logging.console.utilities;

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

import java.awt.GraphicsEnvironment;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeFalse;

public class ClipboardAccessTest {

  private ClipboardAccess testling;

  @Before
  public void setUp() throws Exception {
    assumeFalse("Run only in desktop", GraphicsEnvironment.isHeadless());
    testling = new ClipboardAccess();
  }

  @Test
  public void transfer() throws Exception {
    testling.copy("Test 123");

    assertThat(testling.paste(), is("Test 123"));
  }

}


Fix Sonar Major violation: Javadoc Type

NXP-11577: Fix Sonar Major violation: Javadoc Type

--- nuxeo-drive-server/nuxeo-drive-core/src/main/java/org/nuxeo/drive/service/impl/RootDefinitionsHelper.java
+++ nuxeo-drive-server/nuxeo-drive-core/src/main/java/org/nuxeo/drive/service/impl/RootDefinitionsHelper.java
@@ -8,12 +8,20 @@
 import org.apache.commons.lang.StringUtils;
 import org.nuxeo.ecm.core.api.IdRef;

+/**
+ * Helper to handle synchronization root definitions.
+ *
+ * @author Antoine Taillefer
+ */
 public class RootDefinitionsHelper {

     private RootDefinitionsHelper() {
         // Utility class
     }

+    /**
+     * Parses the given synchronization root definitions string.
+     */
     public static Map<String, Set<IdRef>> parseRootDefinitions(
             String rootDefinitions) {
         Map<String, Set<IdRef>> lastActiveRootRefs = new LinkedHashMap<String, Set<IdRef>>();

<|original_code|>
package org.nuxeo.drive.service.impl;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.nuxeo.ecm.core.api.IdRef;

public class RootDefinitionsHelper {

    private RootDefinitionsHelper() {
        // Utility class
    }

    public static Map<String, Set<IdRef>> parseRootDefinitions(
            String rootDefinitions) {
        Map<String, Set<IdRef>> lastActiveRootRefs = new LinkedHashMap<String, Set<IdRef>>();
        if (rootDefinitions != null) {
            String[] rootDefinitionComponents = StringUtils.split(
                    rootDefinitions, ",");
            for (String rootDefinition : rootDefinitionComponents) {
                String[] rootComponents = StringUtils.split(rootDefinition, ":");
                String repoName = rootComponents[0].trim();
                Set<IdRef> refs = lastActiveRootRefs.get(repoName);
                if (refs == null) {
                    refs = new HashSet<IdRef>();
                    lastActiveRootRefs.put(repoName, refs);
                }
                refs.add(new IdRef(rootComponents[1].trim()));
            }
        }
        return lastActiveRootRefs;
    }

}

<|edits_diff|>
--- nuxeo-drive-server/nuxeo-drive-core/src/main/java/org/nuxeo/drive/service/impl/RootDefinitionsHelper.java
+++ nuxeo-drive-server/nuxeo-drive-core/src/main/java/org/nuxeo/drive/service/impl/RootDefinitionsHelper.java
@@ -8,6 +8,11 @@
 import org.apache.commons.lang.StringUtils;
 import org.nuxeo.ecm.core.api.IdRef;

+/**
+ * Helper to handle synchronization root definitions.
+ *
+ * @author Antoine Taillefer
+ */
 public class RootDefinitionsHelper {

     private RootDefinitionsHelper() {
<|current_version|>
package org.nuxeo.drive.service.impl;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.nuxeo.ecm.core.api.IdRef;

/**
 * Helper to handle synchronization root definitions.
 *
 * @author Antoine Taillefer
 */
public class RootDefinitionsHelper {

    private RootDefinitionsHelper() {
        // Utility class
    }

    public static Map<String, Set<IdRef>> parseRootDefinitions(
            String rootDefinitions) {
        Map<String, Set<IdRef>> lastActiveRootRefs = new LinkedHashMap<String, Set<IdRef>>();
        if (rootDefinitions != null) {
            String[] rootDefinitionComponents = StringUtils.split(
                    rootDefinitions, ",");
            for (String rootDefinition : rootDefinitionComponents) {
                String[] rootComponents = StringUtils.split(rootDefinition, ":");
                String repoName = rootComponents[0].trim();
                Set<IdRef> refs = lastActiveRootRefs.get(repoName);
                if (refs == null) {
                    refs = new HashSet<IdRef>();
                    lastActiveRootRefs.put(repoName, refs);
                }
                refs.add(new IdRef(rootComponents[1].trim()));
            }
        }
        return lastActiveRootRefs;
    }

}

<|next_version|>
package org.nuxeo.drive.service.impl;

import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.StringUtils;
import org.nuxeo.ecm.core.api.IdRef;

/**
 * Helper to handle synchronization root definitions.
 *
 * @author Antoine Taillefer
 */
public class RootDefinitionsHelper {

    private RootDefinitionsHelper() {
        // Utility class
    }

    /**
     * Parses the given synchronization root definitions string.
     */
    public static Map<String, Set<IdRef>> parseRootDefinitions(
            String rootDefinitions) {
        Map<String, Set<IdRef>> lastActiveRootRefs = new LinkedHashMap<String, Set<IdRef>>();
        if (rootDefinitions != null) {
            String[] rootDefinitionComponents = StringUtils.split(
                    rootDefinitions, ",");
            for (String rootDefinition : rootDefinitionComponents) {
                String[] rootComponents = StringUtils.split(rootDefinition, ":");
                String repoName = rootComponents[0].trim();
                Set<IdRef> refs = lastActiveRootRefs.get(repoName);
                if (refs == null) {
                    refs = new HashSet<IdRef>();
                    lastActiveRootRefs.put(repoName, refs);
                }
                refs.add(new IdRef(rootComponents[1].trim()));
            }
        }
        return lastActiveRootRefs;
    }

}


Add IDs for group navigation items

HAL-301: Add IDs for group navigation items

--- gui/src/main/java/org/jboss/as/console/client/widgets/tree/GroupItem.java
+++ gui/src/main/java/org/jboss/as/console/client/widgets/tree/GroupItem.java
@@ -4,10 +4,13 @@

 public class GroupItem extends TreeItem {

+    private final static String ID_PREFIX = "nav_group_item_";
+
     public GroupItem(String title) {
         super();

         setText(title);
+        getElement().setId(ID_PREFIX + title.replace(' ', '_').toLowerCase());
         getElement().setAttribute("style", "cursor:pointer;");
     }

<|original_code|>
package org.jboss.as.console.client.widgets.tree;

import com.google.gwt.user.client.ui.TreeItem;

public class GroupItem extends TreeItem {

    public GroupItem(String title) {
        super();

        setText(title);
        getElement().setAttribute("style", "cursor:pointer;");
    }

    @Override
    public void setSelected(boolean selected) {
        super.setSelected(selected);
    }
}

<|edits_diff|>
--- gui/src/main/java/org/jboss/as/console/client/widgets/tree/GroupItem.java
+++ gui/src/main/java/org/jboss/as/console/client/widgets/tree/GroupItem.java
@@ -3,6 +3,8 @@
 import com.google.gwt.user.client.ui.TreeItem;

 public class GroupItem extends TreeItem {
+
+    private final static String ID_PREFIX = "nav_group_item_";

     public GroupItem(String title) {
         super();
<|current_version|>
package org.jboss.as.console.client.widgets.tree;

import com.google.gwt.user.client.ui.TreeItem;

public class GroupItem extends TreeItem {

    private final static String ID_PREFIX = "nav_group_item_";

    public GroupItem(String title) {
        super();

        setText(title);
        getElement().setAttribute("style", "cursor:pointer;");
    }

    @Override
    public void setSelected(boolean selected) {
        super.setSelected(selected);
    }
}

<|next_version|>
package org.jboss.as.console.client.widgets.tree;

import com.google.gwt.user.client.ui.TreeItem;

public class GroupItem extends TreeItem {

    private final static String ID_PREFIX = "nav_group_item_";

    public GroupItem(String title) {
        super();

        setText(title);
        getElement().setId(ID_PREFIX + title.replace(' ', '_').toLowerCase());
        getElement().setAttribute("style", "cursor:pointer;");
    }

    @Override
    public void setSelected(boolean selected) {
        super.setSelected(selected);
    }
}


Fix FreeMarker locale, so we don't get . as a thousands separator.

--- src/main/java/org/gbif/portal/struts/freemarker/GbifFreemarkerManager.java
+++ src/main/java/org/gbif/portal/struts/freemarker/GbifFreemarkerManager.java
@@ -1,5 +1,6 @@
 package org.gbif.portal.struts.freemarker;

+import java.util.Locale;
 import javax.servlet.ServletContext;

 import freemarker.template.TemplateException;
@@ -19,6 +20,9 @@
     config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
     // adding date rendering methods
     config.setSharedVariable("niceDate", new NiceDateTemplateMethodModel());
+    // fixed locale, so we don't get dots as decimal separators or US "middle endian" dates.
+    // chose UK, as (from the constants available) that gives unambiguous short dates like "12-Jan-2016".
+    config.setLocale(Locale.UK);
   }

 }

<|original_code|>
package org.gbif.portal.struts.freemarker;

import javax.servlet.ServletContext;

import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GbifFreemarkerManager extends FreemarkerManager {
  private static final Logger LOG = LoggerFactory.getLogger(GbifFreemarkerManager.class);

  @Override
  public void init(ServletContext servletContext) throws TemplateException {
    super.init(servletContext);
    LOG.info("Init custom GBIF Freemarker Manager");
    // custom ftl exception handling
    config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    // adding date rendering methods
    config.setSharedVariable("niceDate", new NiceDateTemplateMethodModel());
  }

}

<|edits_diff|>
--- src/main/java/org/gbif/portal/struts/freemarker/GbifFreemarkerManager.java
+++ src/main/java/org/gbif/portal/struts/freemarker/GbifFreemarkerManager.java
@@ -1,5 +1,6 @@
 package org.gbif.portal.struts.freemarker;

+import java.util.Locale;
 import javax.servlet.ServletContext;

 import freemarker.template.TemplateException;
<|current_version|>
package org.gbif.portal.struts.freemarker;

import java.util.Locale;
import javax.servlet.ServletContext;

import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GbifFreemarkerManager extends FreemarkerManager {
  private static final Logger LOG = LoggerFactory.getLogger(GbifFreemarkerManager.class);

  @Override
  public void init(ServletContext servletContext) throws TemplateException {
    super.init(servletContext);
    LOG.info("Init custom GBIF Freemarker Manager");
    // custom ftl exception handling
    config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    // adding date rendering methods
    config.setSharedVariable("niceDate", new NiceDateTemplateMethodModel());
  }

}

<|next_version|>
package org.gbif.portal.struts.freemarker;

import java.util.Locale;
import javax.servlet.ServletContext;

import freemarker.template.TemplateException;
import freemarker.template.TemplateExceptionHandler;
import org.apache.struts2.views.freemarker.FreemarkerManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GbifFreemarkerManager extends FreemarkerManager {
  private static final Logger LOG = LoggerFactory.getLogger(GbifFreemarkerManager.class);

  @Override
  public void init(ServletContext servletContext) throws TemplateException {
    super.init(servletContext);
    LOG.info("Init custom GBIF Freemarker Manager");
    // custom ftl exception handling
    config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
    // adding date rendering methods
    config.setSharedVariable("niceDate", new NiceDateTemplateMethodModel());
    // fixed locale, so we don't get dots as decimal separators or US "middle endian" dates.
    // chose UK, as (from the constants available) that gives unambiguous short dates like "12-Jan-2016".
    config.setLocale(Locale.UK);
  }

}