Add logging when netty channels are closed due to inactivity.

--- core/server/worker/src/main/java/alluxio/worker/netty/IdleReadHandler.java
+++ core/server/worker/src/main/java/alluxio/worker/netty/IdleReadHandler.java
@@ -15,11 +15,15 @@
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.timeout.IdleState;
 import io.netty.handler.timeout.IdleStateEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * Closes the channel if it has been idle for too long.
  */
 public class IdleReadHandler extends ChannelDuplexHandler {
+  private static final Logger LOG = LoggerFactory.getLogger(IdleReadHandler.class);
+
   /**
    * Creates a new idle read handler.
    */
@@ -29,6 +33,7 @@
   public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
     if (evt instanceof IdleStateEvent) {
       if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
+        LOG.warn("Closing netty channel to {} due to inactivity.", ctx.channel().remoteAddress());
         ctx.close();
       }
     }

<|original_code|>
/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.worker.netty;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;

/**
 * Closes the channel if it has been idle for too long.
 */
public class IdleReadHandler extends ChannelDuplexHandler {
  /**
   * Creates a new idle read handler.
   */
  public IdleReadHandler() {}

  @Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
    if (evt instanceof IdleStateEvent) {
      if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
        ctx.close();
      }
    }
  }
}

<|edits_diff|>
--- core/server/worker/src/main/java/alluxio/worker/netty/IdleReadHandler.java
+++ core/server/worker/src/main/java/alluxio/worker/netty/IdleReadHandler.java
@@ -15,11 +15,15 @@
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.timeout.IdleState;
 import io.netty.handler.timeout.IdleStateEvent;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;

 /**
  * Closes the channel if it has been idle for too long.
  */
 public class IdleReadHandler extends ChannelDuplexHandler {
+  private static final Logger LOG = LoggerFactory.getLogger(IdleReadHandler.class);
+
   /**
    * Creates a new idle read handler.
    */
<|current_version|>
/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.worker.netty;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Closes the channel if it has been idle for too long.
 */
public class IdleReadHandler extends ChannelDuplexHandler {
  private static final Logger LOG = LoggerFactory.getLogger(IdleReadHandler.class);

  /**
   * Creates a new idle read handler.
   */
  public IdleReadHandler() {}

  @Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
    if (evt instanceof IdleStateEvent) {
      if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
        ctx.close();
      }
    }
  }
}

<|next_version|>
/*
 * The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
 * (the "License"). You may not use this work except in compliance with the License, which is
 * available at www.apache.org/licenses/LICENSE-2.0
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied, as more fully set forth in the License.
 *
 * See the NOTICE file distributed with this work for information regarding copyright ownership.
 */

package alluxio.worker.netty;

import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Closes the channel if it has been idle for too long.
 */
public class IdleReadHandler extends ChannelDuplexHandler {
  private static final Logger LOG = LoggerFactory.getLogger(IdleReadHandler.class);

  /**
   * Creates a new idle read handler.
   */
  public IdleReadHandler() {}

  @Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
    if (evt instanceof IdleStateEvent) {
      if (((IdleStateEvent) evt).state() == IdleState.READER_IDLE) {
        LOG.warn("Closing netty channel to {} due to inactivity.", ctx.channel().remoteAddress());
        ctx.close();
      }
    }
  }
}


Fix Metadata serialization (serialize null values)

--- cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/_Metadata.java
+++ cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/_Metadata.java
@@ -16,6 +16,7 @@

 package org.cloudfoundry.client.v3;

+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import org.cloudfoundry.AllowNulls;
@@ -35,6 +36,7 @@
      * The metadata annotations
      */
     @JsonProperty("annotations")
+    @JsonInclude
     @AllowNulls
     @Nullable
     abstract Map<String, String> getAnnotations();
@@ -43,6 +45,7 @@
      * The metadata labels
      */
     @JsonProperty("labels")
+    @JsonInclude
     @AllowNulls
     @Nullable
     abstract Map<String, String> getLabels();

<|original_code|>
/*
 * Copyright 2013-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      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.cloudfoundry.client.v3;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.AllowNulls;
import org.cloudfoundry.Nullable;
import org.immutables.value.Value;

import java.util.Map;

/**
 * The metadata payload for a resource
 */
@JsonDeserialize
@Value.Immutable
abstract class _Metadata {

    /**
     * The metadata annotations
     */
    @JsonProperty("annotations")
    @AllowNulls
    @Nullable
    abstract Map<String, String> getAnnotations();

    /**
     * The metadata labels
     */
    @JsonProperty("labels")
    @AllowNulls
    @Nullable
    abstract Map<String, String> getLabels();

}

<|edits_diff|>
--- cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/_Metadata.java
+++ cloudfoundry-client/src/main/java/org/cloudfoundry/client/v3/_Metadata.java
@@ -16,6 +16,7 @@

 package org.cloudfoundry.client.v3;

+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
 import org.cloudfoundry.AllowNulls;
@@ -35,6 +36,7 @@
      * The metadata annotations
      */
     @JsonProperty("annotations")
+    @JsonInclude
     @AllowNulls
     @Nullable
     abstract Map<String, String> getAnnotations();
<|current_version|>
/*
 * Copyright 2013-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      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.cloudfoundry.client.v3;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.AllowNulls;
import org.cloudfoundry.Nullable;
import org.immutables.value.Value;

import java.util.Map;

/**
 * The metadata payload for a resource
 */
@JsonDeserialize
@Value.Immutable
abstract class _Metadata {

    /**
     * The metadata annotations
     */
    @JsonProperty("annotations")
    @JsonInclude
    @AllowNulls
    @Nullable
    abstract Map<String, String> getAnnotations();

    /**
     * The metadata labels
     */
    @JsonProperty("labels")
    @AllowNulls
    @Nullable
    abstract Map<String, String> getLabels();

}

<|next_version|>
/*
 * Copyright 2013-2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      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.cloudfoundry.client.v3;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.AllowNulls;
import org.cloudfoundry.Nullable;
import org.immutables.value.Value;

import java.util.Map;

/**
 * The metadata payload for a resource
 */
@JsonDeserialize
@Value.Immutable
abstract class _Metadata {

    /**
     * The metadata annotations
     */
    @JsonProperty("annotations")
    @JsonInclude
    @AllowNulls
    @Nullable
    abstract Map<String, String> getAnnotations();

    /**
     * The metadata labels
     */
    @JsonProperty("labels")
    @JsonInclude
    @AllowNulls
    @Nullable
    abstract Map<String, String> getLabels();

}


storage: Add alias for VariantAnnotation.geneCancerAssociations to handle property renaming

--- opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/io/json/mixin/VariantAnnotationMixin.java
+++ opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/io/json/mixin/VariantAnnotationMixin.java
@@ -16,7 +16,11 @@

 package org.opencb.opencga.storage.core.variant.io.json.mixin;

+import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.opencb.biodata.models.variant.avro.GeneCancerAssociation;
+
+import java.util.List;

 /**
  * Created by jacobo on 2/02/15.
@@ -24,4 +28,8 @@

 @JsonIgnoreProperties({"proteinSubstitutionScores", "variantTraitAssociation"})
 public abstract class VariantAnnotationMixin {
+
+    @JsonAlias("cancerGeneAssociations")
+    public abstract List<GeneCancerAssociation> getGeneCancerAssociations();
+
 }

<|original_code|>
/*
 * Copyright 2015-2017 OpenCB
 *
 * 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.opencb.opencga.storage.core.variant.io.json.mixin;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Created by jacobo on 2/02/15.
 */

@JsonIgnoreProperties({"proteinSubstitutionScores", "variantTraitAssociation"})
public abstract class VariantAnnotationMixin {
}

<|edits_diff|>
--- opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/io/json/mixin/VariantAnnotationMixin.java
+++ opencga-storage/opencga-storage-core/src/main/java/org/opencb/opencga/storage/core/variant/io/json/mixin/VariantAnnotationMixin.java
@@ -16,7 +16,11 @@

 package org.opencb.opencga.storage.core.variant.io.json.mixin;

+import com.fasterxml.jackson.annotation.JsonAlias;
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.opencb.biodata.models.variant.avro.GeneCancerAssociation;
+
+import java.util.List;

 /**
  * Created by jacobo on 2/02/15.
<|current_version|>
/*
 * Copyright 2015-2017 OpenCB
 *
 * 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.opencb.opencga.storage.core.variant.io.json.mixin;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.opencb.biodata.models.variant.avro.GeneCancerAssociation;

import java.util.List;

/**
 * Created by jacobo on 2/02/15.
 */

@JsonIgnoreProperties({"proteinSubstitutionScores", "variantTraitAssociation"})
public abstract class VariantAnnotationMixin {
}

<|next_version|>
/*
 * Copyright 2015-2017 OpenCB
 *
 * 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.opencb.opencga.storage.core.variant.io.json.mixin;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.opencb.biodata.models.variant.avro.GeneCancerAssociation;

import java.util.List;

/**
 * Created by jacobo on 2/02/15.
 */

@JsonIgnoreProperties({"proteinSubstitutionScores", "variantTraitAssociation"})
public abstract class VariantAnnotationMixin {

    @JsonAlias("cancerGeneAssociations")
    public abstract List<GeneCancerAssociation> getGeneCancerAssociations();

}


fix: Select PreprocMessage first to reduce duplicated rows error

--- src/main/java/org/bricolages/streaming/preproc/PreprocMessageRepository.java
+++ src/main/java/org/bricolages/streaming/preproc/PreprocMessageRepository.java
@@ -1,11 +1,15 @@
 package org.bricolages.streaming.preproc;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.dao.DataIntegrityViolationException;
+import lombok.*;

 public interface PreprocMessageRepository extends JpaRepository<PreprocMessage, Long> {
     PreprocMessage findByMessageId(String msgid);

     default public PreprocMessage upsert(PreprocMessage msg) {
+        // to reduce duplicated rows error
+        val curr = findByMessageId(msg.getMessageId());
+        if (curr != null) return curr;
         try {
             return save(msg);
         }

<|original_code|>
package org.bricolages.streaming.preproc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.dao.DataIntegrityViolationException;

public interface PreprocMessageRepository extends JpaRepository<PreprocMessage, Long> {
    PreprocMessage findByMessageId(String msgid);

    default public PreprocMessage upsert(PreprocMessage msg) {
        try {
            return save(msg);
        }
        catch (DataIntegrityViolationException ex) {
            // no need to update
            return findByMessageId(msg.getMessageId());
        }
    }
}

<|edits_diff|>
--- src/main/java/org/bricolages/streaming/preproc/PreprocMessageRepository.java
+++ src/main/java/org/bricolages/streaming/preproc/PreprocMessageRepository.java
@@ -1,6 +1,7 @@
 package org.bricolages.streaming.preproc;
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.dao.DataIntegrityViolationException;
+import lombok.*;

 public interface PreprocMessageRepository extends JpaRepository<PreprocMessage, Long> {
     PreprocMessage findByMessageId(String msgid);
<|current_version|>
package org.bricolages.streaming.preproc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.dao.DataIntegrityViolationException;
import lombok.*;

public interface PreprocMessageRepository extends JpaRepository<PreprocMessage, Long> {
    PreprocMessage findByMessageId(String msgid);

    default public PreprocMessage upsert(PreprocMessage msg) {
        try {
            return save(msg);
        }
        catch (DataIntegrityViolationException ex) {
            // no need to update
            return findByMessageId(msg.getMessageId());
        }
    }
}

<|next_version|>
package org.bricolages.streaming.preproc;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.dao.DataIntegrityViolationException;
import lombok.*;

public interface PreprocMessageRepository extends JpaRepository<PreprocMessage, Long> {
    PreprocMessage findByMessageId(String msgid);

    default public PreprocMessage upsert(PreprocMessage msg) {
        // to reduce duplicated rows error
        val curr = findByMessageId(msg.getMessageId());
        if (curr != null) return curr;
        try {
            return save(msg);
        }
        catch (DataIntegrityViolationException ex) {
            // no need to update
            return findByMessageId(msg.getMessageId());
        }
    }
}


Add stub function for rotating

Add stub function for rotating

--- src/org/usfirst/frc/team4761/robot/subsystems/Shooter.java
+++ src/org/usfirst/frc/team4761/robot/subsystems/Shooter.java
@@ -1,4 +1,6 @@
 package org.usfirst.frc.team4761.robot.subsystems;
+
+import org.usfirst.frc.team4761.robot.XAxisRelativeDirection;

 import edu.wpi.first.wpilibj.command.Subsystem;

@@ -18,5 +20,9 @@
     public void shoot() {
     	//TODO: Implement shooting
     }
+
+    public void rotate(XAxisRelativeDirection direction) {
+    	//TODO: Implement turning (must be very precise)
+    }
 }

<|original_code|>
package org.usfirst.frc.team4761.robot.subsystems;

import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 */
public class Shooter extends Subsystem {

    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }

    public void shoot() {
    	//TODO: Implement shooting
    }
}

<|edits_diff|>
--- src/org/usfirst/frc/team4761/robot/subsystems/Shooter.java
+++ src/org/usfirst/frc/team4761/robot/subsystems/Shooter.java
@@ -1,4 +1,6 @@
 package org.usfirst.frc.team4761.robot.subsystems;
+
+import org.usfirst.frc.team4761.robot.XAxisRelativeDirection;

 import edu.wpi.first.wpilibj.command.Subsystem;

<|current_version|>
package org.usfirst.frc.team4761.robot.subsystems;

import org.usfirst.frc.team4761.robot.XAxisRelativeDirection;

import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 */
public class Shooter extends Subsystem {

    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }

    public void shoot() {
    	//TODO: Implement shooting
    }
}

<|next_version|>
package org.usfirst.frc.team4761.robot.subsystems;

import org.usfirst.frc.team4761.robot.XAxisRelativeDirection;

import edu.wpi.first.wpilibj.command.Subsystem;

/**
 *
 */
public class Shooter extends Subsystem {

    // Put methods for controlling this subsystem
    // here. Call these from Commands.

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }

    public void shoot() {
    	//TODO: Implement shooting
    }

    public void rotate(XAxisRelativeDirection direction) {
    	//TODO: Implement turning (must be very precise)
    }
}


Fix for problem with tags

Fix for problem with tags

--- xamoomsdk/src/main/java/com/xamoom/android/xamoomsdk/Utils/ListUtil.java
+++ xamoomsdk/src/main/java/com/xamoom/android/xamoomsdk/Utils/ListUtil.java
@@ -20,14 +20,18 @@
     }

     StringBuilder sb = new StringBuilder();
+    sb.append("[");
     int counter = 0;
     for (String item : list) {
       counter++;
+      sb.append("'");
       sb.append(item);
+      sb.append("'");
       if (counter != list.size()) {
         sb.append(seperator);
       }
     }
+    sb.append("]");
     return sb.toString();
   }
 }

<|original_code|>
package com.xamoom.android.xamoomsdk.Utils;

import java.util.List;

/**
 * ListUtil to join lists of string.
 * (Because TextUtil gets mocked in tests)
 */
public class ListUtil {
  /**
   * Will return joined list with seperator.
   *
   * @param list List of Strings.
   * @param seperator String to seperate them.
   * @return Joined list.
   */
  public static String joinStringList(List<String> list, String seperator) {
    if (list == null || seperator == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    int counter = 0;
    for (String item : list) {
      counter++;
      sb.append(item);
      if (counter != list.size()) {
        sb.append(seperator);
      }
    }
    return sb.toString();
  }
}

<|edits_diff|>
--- xamoomsdk/src/main/java/com/xamoom/android/xamoomsdk/Utils/ListUtil.java
+++ xamoomsdk/src/main/java/com/xamoom/android/xamoomsdk/Utils/ListUtil.java
@@ -20,10 +20,13 @@
     }

     StringBuilder sb = new StringBuilder();
+    sb.append("[");
     int counter = 0;
     for (String item : list) {
       counter++;
+      sb.append("'");
       sb.append(item);
+      sb.append("'");
       if (counter != list.size()) {
         sb.append(seperator);
       }
<|current_version|>
package com.xamoom.android.xamoomsdk.Utils;

import java.util.List;

/**
 * ListUtil to join lists of string.
 * (Because TextUtil gets mocked in tests)
 */
public class ListUtil {
  /**
   * Will return joined list with seperator.
   *
   * @param list List of Strings.
   * @param seperator String to seperate them.
   * @return Joined list.
   */
  public static String joinStringList(List<String> list, String seperator) {
    if (list == null || seperator == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    sb.append("[");
    int counter = 0;
    for (String item : list) {
      counter++;
      sb.append("'");
      sb.append(item);
      sb.append("'");
      if (counter != list.size()) {
        sb.append(seperator);
      }
    }
    return sb.toString();
  }
}

<|next_version|>
package com.xamoom.android.xamoomsdk.Utils;

import java.util.List;

/**
 * ListUtil to join lists of string.
 * (Because TextUtil gets mocked in tests)
 */
public class ListUtil {
  /**
   * Will return joined list with seperator.
   *
   * @param list List of Strings.
   * @param seperator String to seperate them.
   * @return Joined list.
   */
  public static String joinStringList(List<String> list, String seperator) {
    if (list == null || seperator == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    sb.append("[");
    int counter = 0;
    for (String item : list) {
      counter++;
      sb.append("'");
      sb.append(item);
      sb.append("'");
      if (counter != list.size()) {
        sb.append(seperator);
      }
    }
    sb.append("]");
    return sb.toString();
  }
}


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

git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@1296 0d517254-b314-0410-acde-c619094fa49f

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Fix test, get username etc from env vars

--- src/test/java/fi/helsinki/cs/tmc/cli/tmcstuff/TmcUtilTest.java
+++ src/test/java/fi/helsinki/cs/tmc/cli/tmcstuff/TmcUtilTest.java
@@ -21,6 +21,7 @@
         Course course;

         app = new Application();
+        app.createTmcCore(new Settings());
         course = TmcUtil.findCourse(app.getTmcCore(), "demo");
         assertNotNull(course);
     }
@@ -31,6 +32,7 @@
         Course course;

         app = new Application();
+        app.createTmcCore(new Settings());
         course = TmcUtil.findCourse(app.getTmcCore(), "afuwhf");
         assertNull(course);
     }

<|original_code|>
package fi.helsinki.cs.tmc.cli.tmcstuff;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import fi.helsinki.cs.tmc.cli.Application;

import fi.helsinki.cs.tmc.core.TmcCore;
import fi.helsinki.cs.tmc.core.domain.Course;

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

import java.util.Locale;

public class TmcUtilTest {

    @Test
    public void findCouseIfItExists() {
        Application app;
        Course course;

        app = new Application();
        course = TmcUtil.findCourse(app.getTmcCore(), "demo");
        assertNotNull(course);
    }

    @Test
    public void returnNullIfCourseWontExist() {
        Application app;
        Course course;

        app = new Application();
        course = TmcUtil.findCourse(app.getTmcCore(), "afuwhf");
        assertNull(course);
    }
}

<|edits_diff|>
--- src/test/java/fi/helsinki/cs/tmc/cli/tmcstuff/TmcUtilTest.java
+++ src/test/java/fi/helsinki/cs/tmc/cli/tmcstuff/TmcUtilTest.java
@@ -21,6 +21,7 @@
         Course course;

         app = new Application();
+        app.createTmcCore(new Settings());
         course = TmcUtil.findCourse(app.getTmcCore(), "demo");
         assertNotNull(course);
     }
<|current_version|>
package fi.helsinki.cs.tmc.cli.tmcstuff;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import fi.helsinki.cs.tmc.cli.Application;

import fi.helsinki.cs.tmc.core.TmcCore;
import fi.helsinki.cs.tmc.core.domain.Course;

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

import java.util.Locale;

public class TmcUtilTest {

    @Test
    public void findCouseIfItExists() {
        Application app;
        Course course;

        app = new Application();
        app.createTmcCore(new Settings());
        course = TmcUtil.findCourse(app.getTmcCore(), "demo");
        assertNotNull(course);
    }

    @Test
    public void returnNullIfCourseWontExist() {
        Application app;
        Course course;

        app = new Application();
        course = TmcUtil.findCourse(app.getTmcCore(), "afuwhf");
        assertNull(course);
    }
}

<|next_version|>
package fi.helsinki.cs.tmc.cli.tmcstuff;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import fi.helsinki.cs.tmc.cli.Application;

import fi.helsinki.cs.tmc.core.TmcCore;
import fi.helsinki.cs.tmc.core.domain.Course;

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

import java.util.Locale;

public class TmcUtilTest {

    @Test
    public void findCouseIfItExists() {
        Application app;
        Course course;

        app = new Application();
        app.createTmcCore(new Settings());
        course = TmcUtil.findCourse(app.getTmcCore(), "demo");
        assertNotNull(course);
    }

    @Test
    public void returnNullIfCourseWontExist() {
        Application app;
        Course course;

        app = new Application();
        app.createTmcCore(new Settings());
        course = TmcUtil.findCourse(app.getTmcCore(), "afuwhf");
        assertNull(course);
    }
}


Set dataset id in membership

Set dataset id in membership

--- java-vtl-script/src/main/java/no/ssb/vtl/script/expressions/MembershipExpression.java
+++ java-vtl-script/src/main/java/no/ssb/vtl/script/expressions/MembershipExpression.java
@@ -3,6 +3,8 @@
 import no.ssb.vtl.model.VTLObject;

 import javax.script.Bindings;
+
+import static com.google.common.base.Preconditions.checkNotNull;

 public class MembershipExpression extends VariableExpression {

@@ -10,6 +12,7 @@

     public MembershipExpression(Class<?> type, String dataset, String right) {
         super(type, right);
+        this.dataset = checkNotNull(dataset);
     }

     public String getDatasetIdentifier() {

<|original_code|>
package no.ssb.vtl.script.expressions;

import no.ssb.vtl.model.VTLObject;

import javax.script.Bindings;

public class MembershipExpression extends VariableExpression {

    private String dataset;

    public MembershipExpression(Class<?> type, String dataset, String right) {
        super(type, right);
    }

    public String getDatasetIdentifier() {
        return dataset;
    }

    @Override
    public VTLObject resolve(Bindings bindings) {
        return super.resolve((Bindings) bindings.get(dataset));
    }
}

<|edits_diff|>
--- java-vtl-script/src/main/java/no/ssb/vtl/script/expressions/MembershipExpression.java
+++ java-vtl-script/src/main/java/no/ssb/vtl/script/expressions/MembershipExpression.java
@@ -3,6 +3,8 @@
 import no.ssb.vtl.model.VTLObject;

 import javax.script.Bindings;
+
+import static com.google.common.base.Preconditions.checkNotNull;

 public class MembershipExpression extends VariableExpression {

<|current_version|>
package no.ssb.vtl.script.expressions;

import no.ssb.vtl.model.VTLObject;

import javax.script.Bindings;

import static com.google.common.base.Preconditions.checkNotNull;

public class MembershipExpression extends VariableExpression {

    private String dataset;

    public MembershipExpression(Class<?> type, String dataset, String right) {
        super(type, right);
    }

    public String getDatasetIdentifier() {
        return dataset;
    }

    @Override
    public VTLObject resolve(Bindings bindings) {
        return super.resolve((Bindings) bindings.get(dataset));
    }
}

<|next_version|>
package no.ssb.vtl.script.expressions;

import no.ssb.vtl.model.VTLObject;

import javax.script.Bindings;

import static com.google.common.base.Preconditions.checkNotNull;

public class MembershipExpression extends VariableExpression {

    private String dataset;

    public MembershipExpression(Class<?> type, String dataset, String right) {
        super(type, right);
        this.dataset = checkNotNull(dataset);
    }

    public String getDatasetIdentifier() {
        return dataset;
    }

    @Override
    public VTLObject resolve(Bindings bindings) {
        return super.resolve((Bindings) bindings.get(dataset));
    }
}


Add to Misc creative tab

Add to Misc creative tab

--- src/main/java/org/techern/infinitewater/blocks/BlockInfinitelySpreadingWater.java
+++ src/main/java/org/techern/infinitewater/blocks/BlockInfinitelySpreadingWater.java
@@ -2,6 +2,7 @@

 import net.minecraft.block.Block;
 import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;

 /**
  * A {@link Block} for infinitely spreading water
@@ -18,6 +19,7 @@
     public BlockInfinitelySpreadingWater() {
         super(Material.WATER);

+        this.setCreativeTab(CreativeTabs.MISC);
         this.setUnlocalizedName("infinitely_spreading_water");
         this.setRegistryName("infinitely_spreading_water");
         this.setBlockUnbreakable();

<|original_code|>
package org.techern.infinitewater.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

/**
 * A {@link Block} for infinitely spreading water
 *
 * @since 1.0.0
 */
public class BlockInfinitelySpreadingWater extends Block {

    /**
     * Creates a new {@link BlockInfinitelySpreadingWater}
     *
     * @since 1.0.0
     */
    public BlockInfinitelySpreadingWater() {
        super(Material.WATER);

        this.setUnlocalizedName("infinitely_spreading_water");
        this.setRegistryName("infinitely_spreading_water");
        this.setBlockUnbreakable();
    }
}

<|edits_diff|>
--- src/main/java/org/techern/infinitewater/blocks/BlockInfinitelySpreadingWater.java
+++ src/main/java/org/techern/infinitewater/blocks/BlockInfinitelySpreadingWater.java
@@ -2,6 +2,7 @@

 import net.minecraft.block.Block;
 import net.minecraft.block.material.Material;
+import net.minecraft.creativetab.CreativeTabs;

 /**
  * A {@link Block} for infinitely spreading water
<|current_version|>
package org.techern.infinitewater.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

/**
 * A {@link Block} for infinitely spreading water
 *
 * @since 1.0.0
 */
public class BlockInfinitelySpreadingWater extends Block {

    /**
     * Creates a new {@link BlockInfinitelySpreadingWater}
     *
     * @since 1.0.0
     */
    public BlockInfinitelySpreadingWater() {
        super(Material.WATER);

        this.setUnlocalizedName("infinitely_spreading_water");
        this.setRegistryName("infinitely_spreading_water");
        this.setBlockUnbreakable();
    }
}

<|next_version|>
package org.techern.infinitewater.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;

/**
 * A {@link Block} for infinitely spreading water
 *
 * @since 1.0.0
 */
public class BlockInfinitelySpreadingWater extends Block {

    /**
     * Creates a new {@link BlockInfinitelySpreadingWater}
     *
     * @since 1.0.0
     */
    public BlockInfinitelySpreadingWater() {
        super(Material.WATER);

        this.setCreativeTab(CreativeTabs.MISC);
        this.setUnlocalizedName("infinitely_spreading_water");
        this.setRegistryName("infinitely_spreading_water");
        this.setBlockUnbreakable();
    }
}


Add bean validation for uv.application.reminderNotificationCron

--- src/main/java/org/synyx/urlaubsverwaltung/application/ApplicationProperties.java
+++ src/main/java/org/synyx/urlaubsverwaltung/application/ApplicationProperties.java
@@ -2,14 +2,19 @@

 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.stereotype.Component;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotEmpty;

 @Component
 @ConfigurationProperties("uv.application")
+@Validated
 public class ApplicationProperties {

     /**
      * Checks remind date about waiting applications by default every day at 07:00 am
      */
+    @NotEmpty
     private String reminderNotificationCron = "0 0 7 * * *";

     public String getReminderNotificationCron() {

<|original_code|>
package org.synyx.urlaubsverwaltung.application;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties("uv.application")
public class ApplicationProperties {

    /**
     * Checks remind date about waiting applications by default every day at 07:00 am
     */
    private String reminderNotificationCron = "0 0 7 * * *";

    public String getReminderNotificationCron() {
        return reminderNotificationCron;
    }

    public void setReminderNotificationCron(String reminderNotificationCron) {
        this.reminderNotificationCron = reminderNotificationCron;
    }
}

<|edits_diff|>
--- src/main/java/org/synyx/urlaubsverwaltung/application/ApplicationProperties.java
+++ src/main/java/org/synyx/urlaubsverwaltung/application/ApplicationProperties.java
@@ -2,9 +2,13 @@

 import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.stereotype.Component;
+import org.springframework.validation.annotation.Validated;
+
+import javax.validation.constraints.NotEmpty;

 @Component
 @ConfigurationProperties("uv.application")
+@Validated
 public class ApplicationProperties {

     /**
<|current_version|>
package org.synyx.urlaubsverwaltung.application;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

@Component
@ConfigurationProperties("uv.application")
@Validated
public class ApplicationProperties {

    /**
     * Checks remind date about waiting applications by default every day at 07:00 am
     */
    private String reminderNotificationCron = "0 0 7 * * *";

    public String getReminderNotificationCron() {
        return reminderNotificationCron;
    }

    public void setReminderNotificationCron(String reminderNotificationCron) {
        this.reminderNotificationCron = reminderNotificationCron;
    }
}

<|next_version|>
package org.synyx.urlaubsverwaltung.application;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

@Component
@ConfigurationProperties("uv.application")
@Validated
public class ApplicationProperties {

    /**
     * Checks remind date about waiting applications by default every day at 07:00 am
     */
    @NotEmpty
    private String reminderNotificationCron = "0 0 7 * * *";

    public String getReminderNotificationCron() {
        return reminderNotificationCron;
    }

    public void setReminderNotificationCron(String reminderNotificationCron) {
        this.reminderNotificationCron = reminderNotificationCron;
    }
}


Edit injection language fragment action is not available for Python Docstring language

--- python/src/com/jetbrains/python/documentation/doctest/PyDocstringLanguageDialect.java
+++ python/src/com/jetbrains/python/documentation/doctest/PyDocstringLanguageDialect.java
@@ -1,5 +1,6 @@
 package com.jetbrains.python.documentation.doctest;

+import com.intellij.codeInsight.intention.impl.QuickEditAction;
 import com.intellij.lang.InjectableLanguage;
 import com.intellij.lang.Language;
 import com.jetbrains.python.PythonLanguage;
@@ -14,5 +15,6 @@

   protected PyDocstringLanguageDialect() {
     super(PythonLanguage.getInstance(), "PyDocstring");
+    putUserData(QuickEditAction.EDIT_ACTION_AVAILABLE, false);
   }
 }

<|original_code|>
package com.jetbrains.python.documentation.doctest;

import com.intellij.lang.InjectableLanguage;
import com.intellij.lang.Language;
import com.jetbrains.python.PythonLanguage;

/**
 * User : ktisha
 */
public class PyDocstringLanguageDialect extends Language implements InjectableLanguage {
  public static PyDocstringLanguageDialect getInstance() {
    return (PyDocstringLanguageDialect)PyDocstringFileType.INSTANCE.getLanguage();
  }

  protected PyDocstringLanguageDialect() {
    super(PythonLanguage.getInstance(), "PyDocstring");
  }
}

<|edits_diff|>
--- python/src/com/jetbrains/python/documentation/doctest/PyDocstringLanguageDialect.java
+++ python/src/com/jetbrains/python/documentation/doctest/PyDocstringLanguageDialect.java
@@ -1,5 +1,6 @@
 package com.jetbrains.python.documentation.doctest;

+import com.intellij.codeInsight.intention.impl.QuickEditAction;
 import com.intellij.lang.InjectableLanguage;
 import com.intellij.lang.Language;
 import com.jetbrains.python.PythonLanguage;
<|current_version|>
package com.jetbrains.python.documentation.doctest;

import com.intellij.codeInsight.intention.impl.QuickEditAction;
import com.intellij.lang.InjectableLanguage;
import com.intellij.lang.Language;
import com.jetbrains.python.PythonLanguage;

/**
 * User : ktisha
 */
public class PyDocstringLanguageDialect extends Language implements InjectableLanguage {
  public static PyDocstringLanguageDialect getInstance() {
    return (PyDocstringLanguageDialect)PyDocstringFileType.INSTANCE.getLanguage();
  }

  protected PyDocstringLanguageDialect() {
    super(PythonLanguage.getInstance(), "PyDocstring");
  }
}

<|next_version|>
package com.jetbrains.python.documentation.doctest;

import com.intellij.codeInsight.intention.impl.QuickEditAction;
import com.intellij.lang.InjectableLanguage;
import com.intellij.lang.Language;
import com.jetbrains.python.PythonLanguage;

/**
 * User : ktisha
 */
public class PyDocstringLanguageDialect extends Language implements InjectableLanguage {
  public static PyDocstringLanguageDialect getInstance() {
    return (PyDocstringLanguageDialect)PyDocstringFileType.INSTANCE.getLanguage();
  }

  protected PyDocstringLanguageDialect() {
    super(PythonLanguage.getInstance(), "PyDocstring");
    putUserData(QuickEditAction.EDIT_ACTION_AVAILABLE, false);
  }
}


Enable CrossOrigin in REST service for films

--- film-rest-service/src/main/java/io/github/web/rest/service/FilmsRestController.java
+++ film-rest-service/src/main/java/io/github/web/rest/service/FilmsRestController.java
@@ -1,6 +1,7 @@
 package io.github.web.rest.service;

 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -12,6 +13,7 @@
     @Autowired
     private FilmsService filmsService;

+    @CrossOrigin
     @RequestMapping(value = "/", method = RequestMethod.GET)
     public Film getTeams(
             @RequestParam(value = "t", required = false) String title) {

<|original_code|>
package io.github.web.rest.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FilmsRestController {

    @Autowired
    private FilmsService filmsService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public Film getTeams(
            @RequestParam(value = "t", required = false) String title) {

        System.out.println("Incoming request for film " + title);
        Film out = filmsService.getFilmByTitle(title);
        System.out.println("Response: " + out);

        return out;
    }

}

<|edits_diff|>
--- film-rest-service/src/main/java/io/github/web/rest/service/FilmsRestController.java
+++ film-rest-service/src/main/java/io/github/web/rest/service/FilmsRestController.java
@@ -1,6 +1,7 @@
 package io.github.web.rest.service;

 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.CrossOrigin;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
<|current_version|>
package io.github.web.rest.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FilmsRestController {

    @Autowired
    private FilmsService filmsService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public Film getTeams(
            @RequestParam(value = "t", required = false) String title) {

        System.out.println("Incoming request for film " + title);
        Film out = filmsService.getFilmByTitle(title);
        System.out.println("Response: " + out);

        return out;
    }

}

<|next_version|>
package io.github.web.rest.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FilmsRestController {

    @Autowired
    private FilmsService filmsService;

    @CrossOrigin
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public Film getTeams(
            @RequestParam(value = "t", required = false) String title) {

        System.out.println("Incoming request for film " + title);
        Film out = filmsService.getFilmByTitle(title);
        System.out.println("Response: " + out);

        return out;
    }

}


Throw exceptions if accessing configuration/environment during bootstrap phase.

--- src/main/java/com/hubspot/dropwizard/guice/DropwizardEnvironmentModule.java
+++ src/main/java/com/hubspot/dropwizard/guice/DropwizardEnvironmentModule.java
@@ -2,10 +2,14 @@

 import com.google.common.base.Optional;
 import com.google.inject.AbstractModule;
+import com.google.inject.CreationException;
 import com.google.inject.Provider;
 import com.google.inject.Provides;
+import com.google.inject.spi.Message;
 import com.yammer.dropwizard.config.Configuration;
 import com.yammer.dropwizard.config.Environment;
+
+import java.util.Arrays;

 public class DropwizardEnvironmentModule<T extends Configuration> extends AbstractModule {
 	private T configuration;
@@ -32,12 +36,18 @@

 	@Provides
 	public Environment providesEnvironment() {
+		if (environment == null) {
+			throw new CreationException(Arrays.asList(new Message("The dropwizard environment has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
+		}
 		return environment;
 	}

 	private class CustomConfigurationProvider implements Provider<T> {
 		@Override
 		public T get() {
+			if (configuration == null) {
+				throw new CreationException(Arrays.asList(new Message("The dropwizard configuration has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
+			}
 			return configuration;
 		}
 	}

<|original_code|>
package com.hubspot.dropwizard.guice;

import com.google.common.base.Optional;
import com.google.inject.AbstractModule;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.yammer.dropwizard.config.Configuration;
import com.yammer.dropwizard.config.Environment;

public class DropwizardEnvironmentModule<T extends Configuration> extends AbstractModule {
	private T configuration;
	private Environment environment;
	private Class<? super T> configurationClass;

	public DropwizardEnvironmentModule(Class<T> configurationClass) {
		this.configurationClass = configurationClass;
	}

	@Override
	protected void configure() {
		Provider<T> provider = new CustomConfigurationProvider();
		bind(configurationClass).toProvider(provider);
		if (configurationClass != Configuration.class) {
			bind(Configuration.class).toProvider(provider);
		}
	}

	public void setEnvironmentData(T configuration, Environment environment) {
		this.configuration = configuration;
		this.environment = environment;
	}

	@Provides
	public Environment providesEnvironment() {
		return environment;
	}

	private class CustomConfigurationProvider implements Provider<T> {
		@Override
		public T get() {
			return configuration;
		}
	}
}

<|edits_diff|>
--- src/main/java/com/hubspot/dropwizard/guice/DropwizardEnvironmentModule.java
+++ src/main/java/com/hubspot/dropwizard/guice/DropwizardEnvironmentModule.java
@@ -2,10 +2,14 @@

 import com.google.common.base.Optional;
 import com.google.inject.AbstractModule;
+import com.google.inject.CreationException;
 import com.google.inject.Provider;
 import com.google.inject.Provides;
+import com.google.inject.spi.Message;
 import com.yammer.dropwizard.config.Configuration;
 import com.yammer.dropwizard.config.Environment;
+
+import java.util.Arrays;

 public class DropwizardEnvironmentModule<T extends Configuration> extends AbstractModule {
 	private T configuration;
@@ -32,6 +36,9 @@

 	@Provides
 	public Environment providesEnvironment() {
+		if (environment == null) {
+			throw new CreationException(Arrays.asList(new Message("The dropwizard environment has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
+		}
 		return environment;
 	}

<|current_version|>
package com.hubspot.dropwizard.guice;

import com.google.common.base.Optional;
import com.google.inject.AbstractModule;
import com.google.inject.CreationException;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.spi.Message;
import com.yammer.dropwizard.config.Configuration;
import com.yammer.dropwizard.config.Environment;

import java.util.Arrays;

public class DropwizardEnvironmentModule<T extends Configuration> extends AbstractModule {
	private T configuration;
	private Environment environment;
	private Class<? super T> configurationClass;

	public DropwizardEnvironmentModule(Class<T> configurationClass) {
		this.configurationClass = configurationClass;
	}

	@Override
	protected void configure() {
		Provider<T> provider = new CustomConfigurationProvider();
		bind(configurationClass).toProvider(provider);
		if (configurationClass != Configuration.class) {
			bind(Configuration.class).toProvider(provider);
		}
	}

	public void setEnvironmentData(T configuration, Environment environment) {
		this.configuration = configuration;
		this.environment = environment;
	}

	@Provides
	public Environment providesEnvironment() {
		if (environment == null) {
			throw new CreationException(Arrays.asList(new Message("The dropwizard environment has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
		}
		return environment;
	}

	private class CustomConfigurationProvider implements Provider<T> {
		@Override
		public T get() {
			return configuration;
		}
	}
}

<|next_version|>
package com.hubspot.dropwizard.guice;

import com.google.common.base.Optional;
import com.google.inject.AbstractModule;
import com.google.inject.CreationException;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.spi.Message;
import com.yammer.dropwizard.config.Configuration;
import com.yammer.dropwizard.config.Environment;

import java.util.Arrays;

public class DropwizardEnvironmentModule<T extends Configuration> extends AbstractModule {
	private T configuration;
	private Environment environment;
	private Class<? super T> configurationClass;

	public DropwizardEnvironmentModule(Class<T> configurationClass) {
		this.configurationClass = configurationClass;
	}

	@Override
	protected void configure() {
		Provider<T> provider = new CustomConfigurationProvider();
		bind(configurationClass).toProvider(provider);
		if (configurationClass != Configuration.class) {
			bind(Configuration.class).toProvider(provider);
		}
	}

	public void setEnvironmentData(T configuration, Environment environment) {
		this.configuration = configuration;
		this.environment = environment;
	}

	@Provides
	public Environment providesEnvironment() {
		if (environment == null) {
			throw new CreationException(Arrays.asList(new Message("The dropwizard environment has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
		}
		return environment;
	}

	private class CustomConfigurationProvider implements Provider<T> {
		@Override
		public T get() {
			if (configuration == null) {
				throw new CreationException(Arrays.asList(new Message("The dropwizard configuration has not yet been set. This is likely caused by trying to access the dropwizard environment during the bootstrap phase.")));
			}
			return configuration;
		}
	}
}


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;
}


Revert "reverse changes to MorhiaFixtures which is specific to 1.2.1"

This reverts commit 4e00685568a7eb9edcf39bd20d2c5272f5d365aa.

--- src/play/test/MorphiaFixtures.java
+++ src/play/test/MorphiaFixtures.java
@@ -16,6 +16,7 @@
     }

     public static void deleteAll() {
+    	idCache.clear();
         Datastore ds = ds();
         for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
             ds.getCollection(clz).drop();
@@ -23,12 +24,14 @@
     }

     public static void delete(Class<? extends Model> ... types) {
+    	idCache.clear();
         for (Class<? extends Model> type: types) {
             ds().getCollection(type).drop();
         }
     }

     public static void delete(List<Class<? extends Model>> classes) {
+    	idCache.clear();
         for (Class<? extends Model> type: classes) {
             ds().getCollection(type).drop();
         }

<|original_code|>
package play.test;

import java.util.List;

import play.Play;
import play.modules.morphia.Model;
import play.modules.morphia.MorphiaPlugin;
import play.test.Fixtures;

import com.google.code.morphia.Datastore;

public class MorphiaFixtures extends Fixtures {

	private static Datastore ds() {
        return MorphiaPlugin.ds();
    }

    public static void deleteAll() {
        Datastore ds = ds();
        for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
            ds.getCollection(clz).drop();
        }
    }

    public static void delete(Class<? extends Model> ... types) {
        for (Class<? extends Model> type: types) {
            ds().getCollection(type).drop();
        }
    }

    public static void delete(List<Class<? extends Model>> classes) {
        for (Class<? extends Model> type: classes) {
            ds().getCollection(type).drop();
        }
    }

    public static void deleteAllModels() {
        deleteAll();
    }
}

<|edits_diff|>
--- src/play/test/MorphiaFixtures.java
+++ src/play/test/MorphiaFixtures.java
@@ -16,6 +16,7 @@
     }

     public static void deleteAll() {
+    	idCache.clear();
         Datastore ds = ds();
         for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
             ds.getCollection(clz).drop();
@@ -23,6 +24,7 @@
     }

     public static void delete(Class<? extends Model> ... types) {
+    	idCache.clear();
         for (Class<? extends Model> type: types) {
             ds().getCollection(type).drop();
         }
<|current_version|>
package play.test;

import java.util.List;

import play.Play;
import play.modules.morphia.Model;
import play.modules.morphia.MorphiaPlugin;
import play.test.Fixtures;

import com.google.code.morphia.Datastore;

public class MorphiaFixtures extends Fixtures {

	private static Datastore ds() {
        return MorphiaPlugin.ds();
    }

    public static void deleteAll() {
    	idCache.clear();
        Datastore ds = ds();
        for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
            ds.getCollection(clz).drop();
        }
    }

    public static void delete(Class<? extends Model> ... types) {
    	idCache.clear();
        for (Class<? extends Model> type: types) {
            ds().getCollection(type).drop();
        }
    }

    public static void delete(List<Class<? extends Model>> classes) {
        for (Class<? extends Model> type: classes) {
            ds().getCollection(type).drop();
        }
    }

    public static void deleteAllModels() {
        deleteAll();
    }
}

<|next_version|>
package play.test;

import java.util.List;

import play.Play;
import play.modules.morphia.Model;
import play.modules.morphia.MorphiaPlugin;
import play.test.Fixtures;

import com.google.code.morphia.Datastore;

public class MorphiaFixtures extends Fixtures {

	private static Datastore ds() {
        return MorphiaPlugin.ds();
    }

    public static void deleteAll() {
    	idCache.clear();
        Datastore ds = ds();
        for (Class<Model> clz: Play.classloader.getAssignableClasses(Model.class)) {
            ds.getCollection(clz).drop();
        }
    }

    public static void delete(Class<? extends Model> ... types) {
    	idCache.clear();
        for (Class<? extends Model> type: types) {
            ds().getCollection(type).drop();
        }
    }

    public static void delete(List<Class<? extends Model>> classes) {
    	idCache.clear();
        for (Class<? extends Model> type: classes) {
            ds().getCollection(type).drop();
        }
    }

    public static void deleteAllModels() {
        deleteAll();
    }
}


Use ScaleType.FIT_START to align graph and plot better.

--- src/com/antonyt/coveredimageview/example/CoveredImageViewActivity.java
+++ src/com/antonyt/coveredimageview/example/CoveredImageViewActivity.java
@@ -5,6 +5,7 @@
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
+import android.widget.ImageView.ScaleType;

 import com.antonyt.coveredimageview.CoveredImageView;
 import com.antonyt.coveredimageview.R;
@@ -21,6 +22,7 @@
         setContentView(R.layout.activity_main);

         final CoveredImageView image = (CoveredImageView) findViewById(R.id.image);
+        image.setScaleType(ScaleType.FIT_START);
         image.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View v) {

<|original_code|>

package com.antonyt.coveredimageview.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.antonyt.coveredimageview.CoveredImageView;
import com.antonyt.coveredimageview.R;

/**
 * Example activity to demonstrate the {@link CoveredImageView}. Click on the
 * image to repeat the reveal animation.
 */
public class CoveredImageViewActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final CoveredImageView image = (CoveredImageView) findViewById(R.id.image);
        image.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                image.reveal(2000);
            }
        });
    }
}

<|edits_diff|>
--- src/com/antonyt/coveredimageview/example/CoveredImageViewActivity.java
+++ src/com/antonyt/coveredimageview/example/CoveredImageViewActivity.java
@@ -5,6 +5,7 @@
 import android.os.Bundle;
 import android.view.View;
 import android.view.View.OnClickListener;
+import android.widget.ImageView.ScaleType;

 import com.antonyt.coveredimageview.CoveredImageView;
 import com.antonyt.coveredimageview.R;
<|current_version|>

package com.antonyt.coveredimageview.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView.ScaleType;

import com.antonyt.coveredimageview.CoveredImageView;
import com.antonyt.coveredimageview.R;

/**
 * Example activity to demonstrate the {@link CoveredImageView}. Click on the
 * image to repeat the reveal animation.
 */
public class CoveredImageViewActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final CoveredImageView image = (CoveredImageView) findViewById(R.id.image);
        image.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                image.reveal(2000);
            }
        });
    }
}

<|next_version|>

package com.antonyt.coveredimageview.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView.ScaleType;

import com.antonyt.coveredimageview.CoveredImageView;
import com.antonyt.coveredimageview.R;

/**
 * Example activity to demonstrate the {@link CoveredImageView}. Click on the
 * image to repeat the reveal animation.
 */
public class CoveredImageViewActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final CoveredImageView image = (CoveredImageView) findViewById(R.id.image);
        image.setScaleType(ScaleType.FIT_START);
        image.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                image.reveal(2000);
            }
        });
    }
}


Add back the empty initial response for ANONYMOUS

--- protonj2-clients/amqperative-client/src/main/java/org/messaginghub/amqperative/impl/sasl/AnonymousMechanism.java
+++ protonj2-clients/amqperative-client/src/main/java/org/messaginghub/amqperative/impl/sasl/AnonymousMechanism.java
@@ -17,6 +17,7 @@
 package org.messaginghub.amqperative.impl.sasl;

 import org.apache.qpid.proton4j.amqp.Symbol;
+import org.apache.qpid.proton4j.buffer.ProtonBuffer;

 /**
  * Implements the Anonymous SASL authentication mechanism.
@@ -29,4 +30,9 @@
     public Symbol getName() {
         return ANONYMOUS;
     }
+
+    @Override
+    public ProtonBuffer getInitialResponse() {
+        return EMPTY;
+    }
 }

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

import org.apache.qpid.proton4j.amqp.Symbol;

/**
 * Implements the Anonymous SASL authentication mechanism.
 */
public class AnonymousMechanism extends AbstractMechanism {

    public static final Symbol ANONYMOUS = Symbol.valueOf("ANONYMOUS");

    @Override
    public Symbol getName() {
        return ANONYMOUS;
    }
}

<|edits_diff|>
--- protonj2-clients/amqperative-client/src/main/java/org/messaginghub/amqperative/impl/sasl/AnonymousMechanism.java
+++ protonj2-clients/amqperative-client/src/main/java/org/messaginghub/amqperative/impl/sasl/AnonymousMechanism.java
@@ -17,6 +17,7 @@
 package org.messaginghub.amqperative.impl.sasl;

 import org.apache.qpid.proton4j.amqp.Symbol;
+import org.apache.qpid.proton4j.buffer.ProtonBuffer;

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

import org.apache.qpid.proton4j.amqp.Symbol;
import org.apache.qpid.proton4j.buffer.ProtonBuffer;

/**
 * Implements the Anonymous SASL authentication mechanism.
 */
public class AnonymousMechanism extends AbstractMechanism {

    public static final Symbol ANONYMOUS = Symbol.valueOf("ANONYMOUS");

    @Override
    public Symbol getName() {
        return ANONYMOUS;
    }
}

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

import org.apache.qpid.proton4j.amqp.Symbol;
import org.apache.qpid.proton4j.buffer.ProtonBuffer;

/**
 * Implements the Anonymous SASL authentication mechanism.
 */
public class AnonymousMechanism extends AbstractMechanism {

    public static final Symbol ANONYMOUS = Symbol.valueOf("ANONYMOUS");

    @Override
    public Symbol getName() {
        return ANONYMOUS;
    }

    @Override
    public ProtonBuffer getInitialResponse() {
        return EMPTY;
    }
}


Make IntelliJ stop crying by adding unnecessary @Repository annotation

--- src/main/java/io/github/mikesaelim/poleposition/persistence/ArticlePersistenceRepository.java
+++ src/main/java/io/github/mikesaelim/poleposition/persistence/ArticlePersistenceRepository.java
@@ -1,6 +1,8 @@
 package io.github.mikesaelim.poleposition.persistence;

 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;

+@Repository
 public interface ArticlePersistenceRepository extends JpaRepository<ArticlePersistence, String> {
 }

<|original_code|>
package io.github.mikesaelim.poleposition.persistence;

import org.springframework.data.jpa.repository.JpaRepository;

public interface ArticlePersistenceRepository extends JpaRepository<ArticlePersistence, String> {
}

<|edits_diff|>
--- src/main/java/io/github/mikesaelim/poleposition/persistence/ArticlePersistenceRepository.java
+++ src/main/java/io/github/mikesaelim/poleposition/persistence/ArticlePersistenceRepository.java
@@ -1,6 +1,7 @@
 package io.github.mikesaelim.poleposition.persistence;

 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;

 public interface ArticlePersistenceRepository extends JpaRepository<ArticlePersistence, String> {
 }
<|current_version|>
package io.github.mikesaelim.poleposition.persistence;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

public interface ArticlePersistenceRepository extends JpaRepository<ArticlePersistence, String> {
}

<|next_version|>
package io.github.mikesaelim.poleposition.persistence;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface ArticlePersistenceRepository extends JpaRepository<ArticlePersistence, String> {
}


Add example tests to show build success

Add example tests to show build success

--- src/test/java/com/google/sps/AuthInfoTest.java
+++ src/test/java/com/google/sps/AuthInfoTest.java
@@ -7,8 +7,12 @@

 @RunWith(JUnit4.class)
 public final class AuthInfoTest {
+
   @Test
   public void example() {
+    // placeholder test to show that tests are evaluated
     Assert.assertEquals(1 + 1, 2);
+    Assert.assertEquals(2 * 2, 4);
+    Assert.assertEquals(1337, 1500 - 163);
   }
 }

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

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class AuthInfoTest {
  @Test
  public void example() {
    Assert.assertEquals(1 + 1, 2);
  }
}
<|edits_diff|>
--- src/test/java/com/google/sps/AuthInfoTest.java
+++ src/test/java/com/google/sps/AuthInfoTest.java
@@ -7,8 +7,10 @@

 @RunWith(JUnit4.class)
 public final class AuthInfoTest {
+
   @Test
   public void example() {
+    // placeholder test to show that tests are evaluated
     Assert.assertEquals(1 + 1, 2);
   }
 }
<|current_version|>
package com.google.sps.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class AuthInfoTest {

  @Test
  public void example() {
    // placeholder test to show that tests are evaluated
    Assert.assertEquals(1 + 1, 2);
  }
}
<|next_version|>
package com.google.sps.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class AuthInfoTest {

  @Test
  public void example() {
    // placeholder test to show that tests are evaluated
    Assert.assertEquals(1 + 1, 2);
    Assert.assertEquals(2 * 2, 4);
    Assert.assertEquals(1337, 1500 - 163);
  }
}


Allow to set maxReviewers on a project from the WebUI

Change-Id: I8c3d9d7659b935652004fad29c22b23a6326d2d0
Signed-off-by: Edwin Kempin <b444e279ad95fdef4fbdd82c813b624595df204a@sap.com>

--- src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlameModule.java
+++ src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlameModule.java
@@ -15,8 +15,10 @@
 package com.googlesource.gerrit.plugins.reviewersbyblame;

 import com.google.gerrit.common.ChangeListener;
+import com.google.gerrit.extensions.annotations.Exports;
 import com.google.gerrit.extensions.registration.DynamicSet;
 import com.google.gerrit.server.config.FactoryModule;
+import com.google.gerrit.server.config.ProjectConfigEntry;

 public class ReviewersByBlameModule extends FactoryModule {
   @Override
@@ -24,5 +26,10 @@
     DynamicSet.bind(binder(), ChangeListener.class).to(
         ChangeUpdatedListener.class);
     factory(ReviewersByBlame.Factory.class);
+    bind(ProjectConfigEntry.class)
+        .annotatedWith(Exports.named("maxReviewers"))
+        .toInstance(new ProjectConfigEntry("Max Reviewers", 3, true,
+            "The maximum number of reviewers that should be automatically added"
+            + " to a change based on the git blame computation on the changed files."));
   }
 }

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

package com.googlesource.gerrit.plugins.reviewersbyblame;

import com.google.gerrit.common.ChangeListener;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.server.config.FactoryModule;

public class ReviewersByBlameModule extends FactoryModule {
  @Override
  protected void configure() {
    DynamicSet.bind(binder(), ChangeListener.class).to(
        ChangeUpdatedListener.class);
    factory(ReviewersByBlame.Factory.class);
  }
}

<|edits_diff|>
--- src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlameModule.java
+++ src/main/java/com/googlesource/gerrit/plugins/reviewersbyblame/ReviewersByBlameModule.java
@@ -15,8 +15,10 @@
 package com.googlesource.gerrit.plugins.reviewersbyblame;

 import com.google.gerrit.common.ChangeListener;
+import com.google.gerrit.extensions.annotations.Exports;
 import com.google.gerrit.extensions.registration.DynamicSet;
 import com.google.gerrit.server.config.FactoryModule;
+import com.google.gerrit.server.config.ProjectConfigEntry;

 public class ReviewersByBlameModule extends FactoryModule {
   @Override
<|current_version|>
// Copyright (C) 2013 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.googlesource.gerrit.plugins.reviewersbyblame;

import com.google.gerrit.common.ChangeListener;
import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.ProjectConfigEntry;

public class ReviewersByBlameModule extends FactoryModule {
  @Override
  protected void configure() {
    DynamicSet.bind(binder(), ChangeListener.class).to(
        ChangeUpdatedListener.class);
    factory(ReviewersByBlame.Factory.class);
  }
}

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

package com.googlesource.gerrit.plugins.reviewersbyblame;

import com.google.gerrit.common.ChangeListener;
import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.ProjectConfigEntry;

public class ReviewersByBlameModule extends FactoryModule {
  @Override
  protected void configure() {
    DynamicSet.bind(binder(), ChangeListener.class).to(
        ChangeUpdatedListener.class);
    factory(ReviewersByBlame.Factory.class);
    bind(ProjectConfigEntry.class)
        .annotatedWith(Exports.named("maxReviewers"))
        .toInstance(new ProjectConfigEntry("Max Reviewers", 3, true,
            "The maximum number of reviewers that should be automatically added"
            + " to a change based on the git blame computation on the changed files."));
  }
}


Add demo app version code to launch URL.

--- demos/twa-play-billing/src/main/java/com/google/androidbrowserhelper/demos/playbilling/MainActivity.java
+++ demos/twa-play-billing/src/main/java/com/google/androidbrowserhelper/demos/playbilling/MainActivity.java
@@ -16,6 +16,7 @@

 import android.app.Activity;
 import android.content.Intent;
+import android.net.Uri;
 import android.os.Bundle;
 import android.view.View;

@@ -30,6 +31,10 @@

     public void launch(View view) {
         Intent intent = new Intent(this, LauncherActivity.class);
+
+        intent.setData(
+                Uri.parse("https://beer.conn.dev?client_version=" + BuildConfig.VERSION_CODE));
+
         startActivity(intent);
     }
 }

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

package com.google.androidbrowserhelper.demos.playbilling;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.google.androidbrowserhelper.trusted.LauncherActivity;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void launch(View view) {
        Intent intent = new Intent(this, LauncherActivity.class);
        startActivity(intent);
    }
}

<|edits_diff|>
--- demos/twa-play-billing/src/main/java/com/google/androidbrowserhelper/demos/playbilling/MainActivity.java
+++ demos/twa-play-billing/src/main/java/com/google/androidbrowserhelper/demos/playbilling/MainActivity.java
@@ -16,6 +16,7 @@

 import android.app.Activity;
 import android.content.Intent;
+import android.net.Uri;
 import android.os.Bundle;
 import android.view.View;

<|current_version|>
// Copyright 2020 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.androidbrowserhelper.demos.playbilling;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import com.google.androidbrowserhelper.trusted.LauncherActivity;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void launch(View view) {
        Intent intent = new Intent(this, LauncherActivity.class);
        startActivity(intent);
    }
}

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

package com.google.androidbrowserhelper.demos.playbilling;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import com.google.androidbrowserhelper.trusted.LauncherActivity;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void launch(View view) {
        Intent intent = new Intent(this, LauncherActivity.class);

        intent.setData(
                Uri.parse("https://beer.conn.dev?client_version=" + BuildConfig.VERSION_CODE));

        startActivity(intent);
    }
}


Fix for T2-674: Hardcoded default locations. System default configurable providers are now read from a file in Taverna startup/conf directory. Failing that - they are read from a hard coded list. User can now import and export services from such files as well.

git-svn-id: 2b4c7ad77658e4b3615e54128c4b6795c159dfbb@10041 bf327186-88b3-11dd-a302-d386e5130c1c

--- src/main/java/net/sf/taverna/t2/activities/beanshell/servicedescriptions/BeanshellTemplateService.java
+++ src/main/java/net/sf/taverna/t2/activities/beanshell/servicedescriptions/BeanshellTemplateService.java
@@ -1,4 +1,6 @@
 package net.sf.taverna.t2.activities.beanshell.servicedescriptions;
+
+import java.net.URI;

 import javax.swing.Icon;

@@ -11,6 +13,9 @@
 		AbstractTemplateService<BeanshellActivityConfigurationBean> {

 	private static final String BEANSHELL = "Beanshell";
+
+	private static final URI providerId = URI
+	.create("http://taverna.sf.net/2010/service-provider/beanshell");

 	public String getName() {
 		return BEANSHELL;
@@ -36,8 +41,13 @@
 		return "A service that allows Beanshell scripts, with dependencies on libraries";
 	}

+	@SuppressWarnings("unchecked")
 	public static ServiceDescription getServiceDescription() {
 		BeanshellTemplateService bts = new BeanshellTemplateService();
 		return bts.templateService;
 	}
+
+	public String getId() {
+		return providerId.toString();
+	}
 }

<|original_code|>
package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}

	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";
	}

	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}
}

<|edits_diff|>
--- src/main/java/net/sf/taverna/t2/activities/beanshell/servicedescriptions/BeanshellTemplateService.java
+++ src/main/java/net/sf/taverna/t2/activities/beanshell/servicedescriptions/BeanshellTemplateService.java
@@ -1,4 +1,6 @@
 package net.sf.taverna.t2.activities.beanshell.servicedescriptions;
+
+import java.net.URI;

 import javax.swing.Icon;

@@ -11,6 +13,9 @@
 		AbstractTemplateService<BeanshellActivityConfigurationBean> {

 	private static final String BEANSHELL = "Beanshell";
+
+	private static final URI providerId = URI
+	.create("http://taverna.sf.net/2010/service-provider/beanshell");

 	public String getName() {
 		return BEANSHELL;
@@ -36,6 +41,7 @@
 		return "A service that allows Beanshell scripts, with dependencies on libraries";
 	}

+	@SuppressWarnings("unchecked")
 	public static ServiceDescription getServiceDescription() {
 		BeanshellTemplateService bts = new BeanshellTemplateService();
 		return bts.templateService;
<|current_version|>
package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import java.net.URI;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	private static final URI providerId = URI
	.create("http://taverna.sf.net/2010/service-provider/beanshell");

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}

	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";
	}

	@SuppressWarnings("unchecked")
	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}
}

<|next_version|>
package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import java.net.URI;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	private static final URI providerId = URI
	.create("http://taverna.sf.net/2010/service-provider/beanshell");

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}

	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";
	}

	@SuppressWarnings("unchecked")
	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}

	public String getId() {
		return providerId.toString();
	}
}