[api] Update user session profile when self updating

--- openex-api/src/main/java/io/openex/config/AppConfig.java
+++ openex-api/src/main/java/io/openex/config/AppConfig.java
@@ -7,6 +7,8 @@
 import io.openex.database.model.User;
 import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.stereotype.Component;

@@ -31,6 +33,11 @@
         return (User) principal;
     }

+    public static void updateSessionUser(User user) {
+        Authentication authentication = new UsernamePasswordAuthenticationToken(user, user.getPassword(), user.getAuthorities());
+        SecurityContextHolder.getContext().setAuthentication(authentication);
+    }
+
     @Bean
     ObjectMapper openexJsonMapper() {
         ObjectMapper mapper = new ObjectMapper();

<|original_code|>
package io.openex.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import io.openex.database.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class AppConfig {

    private final static String ANONYMOUS_USER = "anonymousUser";

    // Validations
    public final static String MANDATORY_MESSAGE = "This value should not be blank.";

    public static User currentUser() {
        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        if (ANONYMOUS_USER.equals(principal)) {
            User anonymousUser = new User();
            anonymousUser.setId("anonymous");
            anonymousUser.setEmail("anonymous@openex.io");
            return anonymousUser;
        }
        assert principal instanceof User;
        return (User) principal;
    }

    @Bean
    ObjectMapper openexJsonMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
        mapper.registerModule(new Hibernate5Module());
        return mapper;
    }
}

<|edits_diff|>
--- openex-api/src/main/java/io/openex/config/AppConfig.java
+++ openex-api/src/main/java/io/openex/config/AppConfig.java
@@ -7,6 +7,8 @@
 import io.openex.database.model.User;
 import org.springframework.context.annotation.Bean;
 import org.springframework.scheduling.annotation.EnableAsync;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.stereotype.Component;

<|current_version|>
package io.openex.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import io.openex.database.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class AppConfig {

    private final static String ANONYMOUS_USER = "anonymousUser";

    // Validations
    public final static String MANDATORY_MESSAGE = "This value should not be blank.";

    public static User currentUser() {
        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        if (ANONYMOUS_USER.equals(principal)) {
            User anonymousUser = new User();
            anonymousUser.setId("anonymous");
            anonymousUser.setEmail("anonymous@openex.io");
            return anonymousUser;
        }
        assert principal instanceof User;
        return (User) principal;
    }

    @Bean
    ObjectMapper openexJsonMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
        mapper.registerModule(new Hibernate5Module());
        return mapper;
    }
}

<|next_version|>
package io.openex.config;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.util.StdDateFormat;
import com.fasterxml.jackson.datatype.hibernate5.Hibernate5Module;
import io.openex.database.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

@Component
@EnableAsync
public class AppConfig {

    private final static String ANONYMOUS_USER = "anonymousUser";

    // Validations
    public final static String MANDATORY_MESSAGE = "This value should not be blank.";

    public static User currentUser() {
        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        if (ANONYMOUS_USER.equals(principal)) {
            User anonymousUser = new User();
            anonymousUser.setId("anonymous");
            anonymousUser.setEmail("anonymous@openex.io");
            return anonymousUser;
        }
        assert principal instanceof User;
        return (User) principal;
    }

    public static void updateSessionUser(User user) {
        Authentication authentication = new UsernamePasswordAuthenticationToken(user, user.getPassword(), user.getAuthorities());
        SecurityContextHolder.getContext().setAuthentication(authentication);
    }

    @Bean
    ObjectMapper openexJsonMapper() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        mapper.setDateFormat(new StdDateFormat().withColonInTimeZone(true));
        mapper.registerModule(new Hibernate5Module());
        return mapper;
    }
}


SEAMFACES-94: Add @Named to producer for ExternalContext

--- impl/src/main/java/org/jboss/seam/faces/environment/ExternalContextProducer.java
+++ impl/src/main/java/org/jboss/seam/faces/environment/ExternalContextProducer.java
@@ -4,6 +4,7 @@
 import javax.enterprise.inject.Produces;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import javax.inject.Named;

 /**
  * <p>
@@ -27,6 +28,7 @@
  */
 public class ExternalContextProducer
 {
+   @Named
    @Produces
    @RequestScoped
    public ExternalContext getExternalContext(final FacesContext context)

<|original_code|>
package org.jboss.seam.faces.environment;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

/**
 *

 * A producer which retrieves the {@link ExternalContext} for the current
 * request of the JavaServer Faces application by calling
 * {@link FacesContext#getExternalContext()} and stores the result as a
 * request-scoped bean instance.
 *

 *
 *

 * This producer allows the {@link ExternalContext} to be injected:
 *

 *
 *

 * @Inject
 * ExternalContext ctx;
 *

 *
 * @author Lincoln Baxter, III
 * @author Dan Allen
 */
public class ExternalContextProducer
{
   @Produces
   @RequestScoped
   public ExternalContext getExternalContext(final FacesContext context)
   {
      return context.getExternalContext();
   }
}

<|edits_diff|>
--- impl/src/main/java/org/jboss/seam/faces/environment/ExternalContextProducer.java
+++ impl/src/main/java/org/jboss/seam/faces/environment/ExternalContextProducer.java
@@ -4,6 +4,7 @@
 import javax.enterprise.inject.Produces;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
+import javax.inject.Named;

 /**
  *

<|current_version|>
package org.jboss.seam.faces.environment;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.inject.Named;

/**
 *

 * A producer which retrieves the {@link ExternalContext} for the current
 * request of the JavaServer Faces application by calling
 * {@link FacesContext#getExternalContext()} and stores the result as a
 * request-scoped bean instance.
 *

 *
 *

 * This producer allows the {@link ExternalContext} to be injected:
 *

 *
 *

 * @Inject
 * ExternalContext ctx;
 *

 *
 * @author Lincoln Baxter, III
 * @author Dan Allen
 */
public class ExternalContextProducer
{
   @Produces
   @RequestScoped
   public ExternalContext getExternalContext(final FacesContext context)
   {
      return context.getExternalContext();
   }
}

<|next_version|>
package org.jboss.seam.faces.environment;

import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.inject.Named;

/**
 *

 * A producer which retrieves the {@link ExternalContext} for the current
 * request of the JavaServer Faces application by calling
 * {@link FacesContext#getExternalContext()} and stores the result as a
 * request-scoped bean instance.
 *

 *
 *

 * This producer allows the {@link ExternalContext} to be injected:
 *

 *
 *

 * @Inject
 * ExternalContext ctx;
 *

 *
 * @author Lincoln Baxter, III
 * @author Dan Allen
 */
public class ExternalContextProducer
{
   @Named
   @Produces
   @RequestScoped
   public ExternalContext getExternalContext(final FacesContext context)
   {
      return context.getExternalContext();
   }
}


Add javadocs to example system test.

Add javadocs to example system test.

As required by checkstyle settings.

--- src/test/java/nl/tudelft/jpacman/integration/StartupSystemTest.java
+++ src/test/java/nl/tudelft/jpacman/integration/StartupSystemTest.java
@@ -8,20 +8,33 @@

 import static org.assertj.core.api.Assertions.assertThat;

+/**
+ * An example test class that conducts integration tests.
+ */
 public class StartupSystemTest {

     private Launcher launcher;

+    /**
+     * Start a launcher, which can display the user interface.
+     */
     @BeforeEach
     public void before() {
         launcher = new Launcher();
     }

+    /**
+     * Close the user interface.
+     */
     @AfterEach
     public void after() {
         launcher.dispose();
     }

+    /**
+     * The simplest test that just starts the
+     * game and checks it is indeed in progress.
+     */
     @Test
     public void gameIsRunning() {
         launcher.launch();

<|original_code|>
package nl.tudelft.jpacman.integration;

import nl.tudelft.jpacman.Launcher;
import nl.tudelft.jpacman.game.Game;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

public class StartupSystemTest {

    private Launcher launcher;

    @BeforeEach
    public void before() {
        launcher = new Launcher();
    }

    @AfterEach
    public void after() {
        launcher.dispose();
    }

    @Test
    public void gameIsRunning() {
        launcher.launch();

        getGame().start();

        assertThat(getGame().isInProgress()).isTrue();
    }

    private Game getGame() {
        return launcher.getGame();
    }
}

<|edits_diff|>
--- src/test/java/nl/tudelft/jpacman/integration/StartupSystemTest.java
+++ src/test/java/nl/tudelft/jpacman/integration/StartupSystemTest.java
@@ -8,15 +8,24 @@

 import static org.assertj.core.api.Assertions.assertThat;

+/**
+ * An example test class that conducts integration tests.
+ */
 public class StartupSystemTest {

     private Launcher launcher;

+    /**
+     * Start a launcher, which can display the user interface.
+     */
     @BeforeEach
     public void before() {
         launcher = new Launcher();
     }

+    /**
+     * Close the user interface.
+     */
     @AfterEach
     public void after() {
         launcher.dispose();
<|current_version|>
package nl.tudelft.jpacman.integration;

import nl.tudelft.jpacman.Launcher;
import nl.tudelft.jpacman.game.Game;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * An example test class that conducts integration tests.
 */
public class StartupSystemTest {

    private Launcher launcher;

    /**
     * Start a launcher, which can display the user interface.
     */
    @BeforeEach
    public void before() {
        launcher = new Launcher();
    }

    /**
     * Close the user interface.
     */
    @AfterEach
    public void after() {
        launcher.dispose();
    }

    @Test
    public void gameIsRunning() {
        launcher.launch();

        getGame().start();

        assertThat(getGame().isInProgress()).isTrue();
    }

    private Game getGame() {
        return launcher.getGame();
    }
}

<|next_version|>
package nl.tudelft.jpacman.integration;

import nl.tudelft.jpacman.Launcher;
import nl.tudelft.jpacman.game.Game;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
 * An example test class that conducts integration tests.
 */
public class StartupSystemTest {

    private Launcher launcher;

    /**
     * Start a launcher, which can display the user interface.
     */
    @BeforeEach
    public void before() {
        launcher = new Launcher();
    }

    /**
     * Close the user interface.
     */
    @AfterEach
    public void after() {
        launcher.dispose();
    }

    /**
     * The simplest test that just starts the
     * game and checks it is indeed in progress.
     */
    @Test
    public void gameIsRunning() {
        launcher.launch();

        getGame().start();

        assertThat(getGame().isInProgress()).isTrue();
    }

    private Game getGame() {
        return launcher.getGame();
    }
}


Add debug animation on text change

Add debug animation on text change

--- android/java/com/sometrik/framework/FWButton.java
+++ android/java/com/sometrik/framework/FWButton.java
@@ -1,7 +1,11 @@
 package com.sometrik.framework;
+
+import com.sometrik.formtest.R;

 import android.content.Context;
 import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.widget.Button;

 public class FWButton extends Button implements NativeCommandHandler {
@@ -33,6 +37,9 @@
   @Override
   public void setValue(String v) {
     setText(v);
+    //FIXME Debug animation
+    Animation shake = AnimationUtils.loadAnimation(frame, R.anim.shake);
+    startAnimation(shake);
   }

   @Override

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

import android.content.Context;
import android.view.View;
import android.widget.Button;

public class FWButton extends Button implements NativeCommandHandler {

  FrameWork frame;

  public FWButton(FrameWork frameWork) {
    super(frameWork);
    this.frame = frameWork;

  }

  @Override
  public void addChild(View view) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void removeChild(int id) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void addOption(int optionId, String text) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void setValue(String v) {
    setText(v);
  }

  @Override
  public void setValue(int v) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public int getElementId() {
    return getId();
  }

  @Override
  public void setEnabled(Boolean enabled) {
    System.out.println("FWButton couldn't handle command");
  }

}

<|edits_diff|>
--- android/java/com/sometrik/framework/FWButton.java
+++ android/java/com/sometrik/framework/FWButton.java
@@ -1,7 +1,11 @@
 package com.sometrik.framework;
+
+import com.sometrik.formtest.R;

 import android.content.Context;
 import android.view.View;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
 import android.widget.Button;

 public class FWButton extends Button implements NativeCommandHandler {
<|current_version|>
package com.sometrik.framework;

import com.sometrik.formtest.R;

import android.content.Context;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;

public class FWButton extends Button implements NativeCommandHandler {

  FrameWork frame;

  public FWButton(FrameWork frameWork) {
    super(frameWork);
    this.frame = frameWork;

  }

  @Override
  public void addChild(View view) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void removeChild(int id) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void addOption(int optionId, String text) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void setValue(String v) {
    setText(v);
  }

  @Override
  public void setValue(int v) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public int getElementId() {
    return getId();
  }

  @Override
  public void setEnabled(Boolean enabled) {
    System.out.println("FWButton couldn't handle command");
  }

}

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

import com.sometrik.formtest.R;

import android.content.Context;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;

public class FWButton extends Button implements NativeCommandHandler {

  FrameWork frame;

  public FWButton(FrameWork frameWork) {
    super(frameWork);
    this.frame = frameWork;

  }

  @Override
  public void addChild(View view) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void removeChild(int id) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void addOption(int optionId, String text) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public void setValue(String v) {
    setText(v);
    //FIXME Debug animation
    Animation shake = AnimationUtils.loadAnimation(frame, R.anim.shake);
    startAnimation(shake);
  }

  @Override
  public void setValue(int v) {
    System.out.println("FWButton couldn't handle command");
  }

  @Override
  public int getElementId() {
    return getId();
  }

  @Override
  public void setEnabled(Boolean enabled) {
    System.out.println("FWButton couldn't handle command");
  }

}


Set state strategy for forecast view

Set state strategy for forecast view

--- app/src/main/java/com/kiliian/sunshine/mvp/views/ForecastView.java
+++ app/src/main/java/com/kiliian/sunshine/mvp/views/ForecastView.java
@@ -2,10 +2,13 @@

 import com.arellomobile.mvp.MvpView;
+import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy;
+import com.arellomobile.mvp.viewstate.strategy.StateStrategyType;
 import com.kiliian.sunshine.data.Weather;

 import java.util.List;

+@StateStrategyType(AddToEndSingleStrategy.class)
 public interface ForecastView extends MvpView {

     void showForecast(List<Weather> weatherList);

<|original_code|>
package com.kiliian.sunshine.mvp.views;

import com.arellomobile.mvp.MvpView;
import com.kiliian.sunshine.data.Weather;

import java.util.List;

public interface ForecastView extends MvpView {

    void showForecast(List<Weather> weatherList);
}

<|edits_diff|>
--- app/src/main/java/com/kiliian/sunshine/mvp/views/ForecastView.java
+++ app/src/main/java/com/kiliian/sunshine/mvp/views/ForecastView.java
@@ -2,6 +2,8 @@

 import com.arellomobile.mvp.MvpView;
+import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy;
+import com.arellomobile.mvp.viewstate.strategy.StateStrategyType;
 import com.kiliian.sunshine.data.Weather;

 import java.util.List;
<|current_version|>
package com.kiliian.sunshine.mvp.views;

import com.arellomobile.mvp.MvpView;
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy;
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType;
import com.kiliian.sunshine.data.Weather;

import java.util.List;

public interface ForecastView extends MvpView {

    void showForecast(List<Weather> weatherList);
}

<|next_version|>
package com.kiliian.sunshine.mvp.views;

import com.arellomobile.mvp.MvpView;
import com.arellomobile.mvp.viewstate.strategy.AddToEndSingleStrategy;
import com.arellomobile.mvp.viewstate.strategy.StateStrategyType;
import com.kiliian.sunshine.data.Weather;

import java.util.List;

@StateStrategyType(AddToEndSingleStrategy.class)
public interface ForecastView extends MvpView {

    void showForecast(List<Weather> weatherList);
}


Add model for message list

Add model for message list

--- app/src/main/java/org/tndata/officehours/parser/ParserModels.java
+++ app/src/main/java/org/tndata/officehours/parser/ParserModels.java
@@ -2,6 +2,7 @@

 import org.tndata.officehours.model.Course;
+import org.tndata.officehours.model.Message;
 import org.tndata.officehours.model.ResultSet;

 import java.util.List;
@@ -24,6 +25,10 @@
         public List<Course> results;
     }

+    public class MessageList extends ListResultSet{
+        public List<Message> results;
+    }
+
     private ParserModels(){

     }

<|original_code|>
package org.tndata.officehours.parser;

import org.tndata.officehours.model.Course;
import org.tndata.officehours.model.ResultSet;

import java.util.List;

/**
 * This class contains the specifications of the API responses that do not match the model
 * to let Gson take care of everything.
 *
 * @author Ismael Alonso
 * @version 1.0.0
 */
public final class ParserModels{
    private abstract class ListResultSet implements ResultSet{
        public int count;
        public String previous;
        public String next;
    }

    public class CourseList extends ListResultSet{
        public List<Course> results;
    }

    private ParserModels(){

    }
}

<|edits_diff|>
--- app/src/main/java/org/tndata/officehours/parser/ParserModels.java
+++ app/src/main/java/org/tndata/officehours/parser/ParserModels.java
@@ -2,6 +2,7 @@

 import org.tndata.officehours.model.Course;
+import org.tndata.officehours.model.Message;
 import org.tndata.officehours.model.ResultSet;

 import java.util.List;
<|current_version|>
package org.tndata.officehours.parser;

import org.tndata.officehours.model.Course;
import org.tndata.officehours.model.Message;
import org.tndata.officehours.model.ResultSet;

import java.util.List;

/**
 * This class contains the specifications of the API responses that do not match the model
 * to let Gson take care of everything.
 *
 * @author Ismael Alonso
 * @version 1.0.0
 */
public final class ParserModels{
    private abstract class ListResultSet implements ResultSet{
        public int count;
        public String previous;
        public String next;
    }

    public class CourseList extends ListResultSet{
        public List<Course> results;
    }

    private ParserModels(){

    }
}

<|next_version|>
package org.tndata.officehours.parser;

import org.tndata.officehours.model.Course;
import org.tndata.officehours.model.Message;
import org.tndata.officehours.model.ResultSet;

import java.util.List;

/**
 * This class contains the specifications of the API responses that do not match the model
 * to let Gson take care of everything.
 *
 * @author Ismael Alonso
 * @version 1.0.0
 */
public final class ParserModels{
    private abstract class ListResultSet implements ResultSet{
        public int count;
        public String previous;
        public String next;
    }

    public class CourseList extends ListResultSet{
        public List<Course> results;
    }

    public class MessageList extends ListResultSet{
        public List<Message> results;
    }

    private ParserModels(){

    }
}


Add parameter inspection to actions and ActionSpell

--- src/main/java/com/elmakers/mine/bukkit/api/action/SpellAction.java
+++ src/main/java/com/elmakers/mine/bukkit/api/action/SpellAction.java
@@ -3,10 +3,13 @@
 import com.elmakers.mine.bukkit.api.spell.Spell;
 import org.bukkit.configuration.ConfigurationSection;

+import java.util.Collection;
+
 public interface SpellAction
 {
     public void load(Spell spell, ConfigurationSection parameters);
     public ConfigurationSection getParameters(ConfigurationSection baseParameters);
+    public void getParameterNames(Collection<String> parameters);
     public boolean usesBrush();
     public boolean isUndoable();
 }

<|original_code|>
package com.elmakers.mine.bukkit.api.action;

import com.elmakers.mine.bukkit.api.spell.Spell;
import org.bukkit.configuration.ConfigurationSection;

public interface SpellAction
{
    public void load(Spell spell, ConfigurationSection parameters);
    public ConfigurationSection getParameters(ConfigurationSection baseParameters);
    public boolean usesBrush();
    public boolean isUndoable();
}

<|edits_diff|>
--- src/main/java/com/elmakers/mine/bukkit/api/action/SpellAction.java
+++ src/main/java/com/elmakers/mine/bukkit/api/action/SpellAction.java
@@ -2,6 +2,8 @@

 import com.elmakers.mine.bukkit.api.spell.Spell;
 import org.bukkit.configuration.ConfigurationSection;
+
+import java.util.Collection;

 public interface SpellAction
 {
<|current_version|>
package com.elmakers.mine.bukkit.api.action;

import com.elmakers.mine.bukkit.api.spell.Spell;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Collection;

public interface SpellAction
{
    public void load(Spell spell, ConfigurationSection parameters);
    public ConfigurationSection getParameters(ConfigurationSection baseParameters);
    public boolean usesBrush();
    public boolean isUndoable();
}

<|next_version|>
package com.elmakers.mine.bukkit.api.action;

import com.elmakers.mine.bukkit.api.spell.Spell;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Collection;

public interface SpellAction
{
    public void load(Spell spell, ConfigurationSection parameters);
    public ConfigurationSection getParameters(ConfigurationSection baseParameters);
    public void getParameterNames(Collection<String> parameters);
    public boolean usesBrush();
    public boolean isUndoable();
}


Add comments explaining relative date options

--- app/src/main/java/com/kickstarter/libs/RelativeDateOptions.java
+++ app/src/main/java/com/kickstarter/libs/RelativeDateOptions.java
@@ -9,9 +9,17 @@

 @AutoParcel
 public abstract class RelativeDateOptions implements Parcelable {
+  // Abbreviates string, e.g.: "in 1 hr"
   public abstract boolean abbreviated();
+
+  // Don't output tense, e.g.: "1 hour" instead of "in 1 hour"
   public abstract boolean absolute();
+
+  // Compare against this date instead of the current time
   public abstract @Nullable DateTime relativeToDateTime();
+
+  // Number of seconds difference permitted before an attempt to describe the relative date is abandoned.
+  // For example, "738 days ago" is not helpful to users. The threshold defaults to 30 days.
   public abstract int threshold();

   @AutoParcel.Builder

<|original_code|>
package com.kickstarter.libs;

import android.os.Parcelable;
import android.support.annotation.Nullable;

import org.joda.time.DateTime;

import auto.parcel.AutoParcel;

@AutoParcel
public abstract class RelativeDateOptions implements Parcelable {
  public abstract boolean abbreviated();
  public abstract boolean absolute();
  public abstract @Nullable DateTime relativeToDateTime();
  public abstract int threshold();

  @AutoParcel.Builder
  public abstract static class Builder {
    public abstract Builder abbreviated(boolean __);
    public abstract Builder absolute(boolean __);
    public abstract Builder relativeToDateTime(DateTime __);
    public abstract Builder threshold(int __);
    public abstract RelativeDateOptions build();
  }

  public static Builder builder() {
    return new AutoParcel_RelativeDateOptions.Builder()
      .abbreviated(false)
      .absolute(false)
      .threshold(THIRTY_DAYS_IN_SECONDS);
  }

  public abstract Builder toBuilder();

  private final static int THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30;
}

<|edits_diff|>
--- app/src/main/java/com/kickstarter/libs/RelativeDateOptions.java
+++ app/src/main/java/com/kickstarter/libs/RelativeDateOptions.java
@@ -9,8 +9,13 @@

 @AutoParcel
 public abstract class RelativeDateOptions implements Parcelable {
+  // Abbreviates string, e.g.: "in 1 hr"
   public abstract boolean abbreviated();
+
+  // Don't output tense, e.g.: "1 hour" instead of "in 1 hour"
   public abstract boolean absolute();
+
+  // Compare against this date instead of the current time
   public abstract @Nullable DateTime relativeToDateTime();
   public abstract int threshold();

<|current_version|>
package com.kickstarter.libs;

import android.os.Parcelable;
import android.support.annotation.Nullable;

import org.joda.time.DateTime;

import auto.parcel.AutoParcel;

@AutoParcel
public abstract class RelativeDateOptions implements Parcelable {
  // Abbreviates string, e.g.: "in 1 hr"
  public abstract boolean abbreviated();

  // Don't output tense, e.g.: "1 hour" instead of "in 1 hour"
  public abstract boolean absolute();

  // Compare against this date instead of the current time
  public abstract @Nullable DateTime relativeToDateTime();
  public abstract int threshold();

  @AutoParcel.Builder
  public abstract static class Builder {
    public abstract Builder abbreviated(boolean __);
    public abstract Builder absolute(boolean __);
    public abstract Builder relativeToDateTime(DateTime __);
    public abstract Builder threshold(int __);
    public abstract RelativeDateOptions build();
  }

  public static Builder builder() {
    return new AutoParcel_RelativeDateOptions.Builder()
      .abbreviated(false)
      .absolute(false)
      .threshold(THIRTY_DAYS_IN_SECONDS);
  }

  public abstract Builder toBuilder();

  private final static int THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30;
}

<|next_version|>
package com.kickstarter.libs;

import android.os.Parcelable;
import android.support.annotation.Nullable;

import org.joda.time.DateTime;

import auto.parcel.AutoParcel;

@AutoParcel
public abstract class RelativeDateOptions implements Parcelable {
  // Abbreviates string, e.g.: "in 1 hr"
  public abstract boolean abbreviated();

  // Don't output tense, e.g.: "1 hour" instead of "in 1 hour"
  public abstract boolean absolute();

  // Compare against this date instead of the current time
  public abstract @Nullable DateTime relativeToDateTime();

  // Number of seconds difference permitted before an attempt to describe the relative date is abandoned.
  // For example, "738 days ago" is not helpful to users. The threshold defaults to 30 days.
  public abstract int threshold();

  @AutoParcel.Builder
  public abstract static class Builder {
    public abstract Builder abbreviated(boolean __);
    public abstract Builder absolute(boolean __);
    public abstract Builder relativeToDateTime(DateTime __);
    public abstract Builder threshold(int __);
    public abstract RelativeDateOptions build();
  }

  public static Builder builder() {
    return new AutoParcel_RelativeDateOptions.Builder()
      .abbreviated(false)
      .absolute(false)
      .threshold(THIRTY_DAYS_IN_SECONDS);
  }

  public abstract Builder toBuilder();

  private final static int THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30;
}


Add static method to set TimestampingAuthorityFactory

--- src/main/java/org/cryptonit/cloud/timestamping/Application.java
+++ src/main/java/org/cryptonit/cloud/timestamping/Application.java
@@ -1,11 +1,16 @@
 package org.cryptonit.cloud.timestamping;

 import javax.ws.rs.Path;
+import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;

 /**
  * @author Mathias Brossard
  */
 @Path("/timestamp")
 public class Application {
+    private static TimestampingAuthorityFactory tsaFactory = null;

+    public static void setTimestampingAuthorityFactory(TimestampingAuthorityFactory factory) {
+        tsaFactory = factory;
+    }
 }

<|original_code|>
package org.cryptonit.cloud.timestamping;

import javax.ws.rs.Path;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {

}

<|edits_diff|>
--- src/main/java/org/cryptonit/cloud/timestamping/Application.java
+++ src/main/java/org/cryptonit/cloud/timestamping/Application.java
@@ -1,11 +1,13 @@
 package org.cryptonit.cloud.timestamping;

 import javax.ws.rs.Path;
+import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;

 /**
  * @author Mathias Brossard
  */
 @Path("/timestamp")
 public class Application {
+    private static TimestampingAuthorityFactory tsaFactory = null;

 }
<|current_version|>
package org.cryptonit.cloud.timestamping;

import javax.ws.rs.Path;
import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {
    private static TimestampingAuthorityFactory tsaFactory = null;

}

<|next_version|>
package org.cryptonit.cloud.timestamping;

import javax.ws.rs.Path;
import org.cryptonit.cloud.interfaces.TimestampingAuthorityFactory;

/**
 * @author Mathias Brossard
 */
@Path("/timestamp")
public class Application {
    private static TimestampingAuthorityFactory tsaFactory = null;

    public static void setTimestampingAuthorityFactory(TimestampingAuthorityFactory factory) {
        tsaFactory = factory;
    }
}


Add PromoteUser flag to Event

Add PromoteUser flag to Event

--- src/com/lamepancake/chitchat/ChatManager.java
+++ src/com/lamepancake/chitchat/ChatManager.java
@@ -5,10 +5,16 @@
  */
 package com.lamepancake.chitchat;

+import com.lamepancake.chitchat.mediator.Event;
+
 /**
  *
  * @author shane
  */
 public class ChatManager {

+    public void handleEvent(Event e)
+    {
+
+    }
 }

<|original_code|>
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lamepancake.chitchat;

/**
 *
 * @author shane
 */
public class ChatManager {

}

<|edits_diff|>
--- src/com/lamepancake/chitchat/ChatManager.java
+++ src/com/lamepancake/chitchat/ChatManager.java
@@ -4,6 +4,8 @@
  * and open the template in the editor.
  */
 package com.lamepancake.chitchat;
+
+import com.lamepancake.chitchat.mediator.Event;

 /**
  *
<|current_version|>
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lamepancake.chitchat;

import com.lamepancake.chitchat.mediator.Event;

/**
 *
 * @author shane
 */
public class ChatManager {

}

<|next_version|>
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.lamepancake.chitchat;

import com.lamepancake.chitchat.mediator.Event;

/**
 *
 * @author shane
 */
public class ChatManager {

    public void handleEvent(Event e)
    {

    }
}


Fix buildfailure by ignoring test on travis.

de.aikiit.fotorenamer.gui.ImageDirectorySelectorTest

performInit(de.aikiit.fotorenamer.gui.ImageDirectorySelectorTest)  Time elapsed: 2.873 sec  <<< ERROR!

java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

    at de.aikiit.fotorenamer.gui.ImageDirectorySelectorTest.performInit(ImageDirectorySelectorTest.java:31)

--- src/test/java/de/aikiit/fotorenamer/gui/ImageDirectorySelectorTest.java
+++ src/test/java/de/aikiit/fotorenamer/gui/ImageDirectorySelectorTest.java
@@ -15,6 +15,7 @@
  */
 package de.aikiit.fotorenamer.gui;

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

 import static org.junit.Assert.assertNotNull;
@@ -25,6 +26,7 @@
  * @author hirsch
  * @version 2011-04-08, 00:22
  */
+@Ignore("Not working on travis since no X11 present")
 public class ImageDirectorySelectorTest {
     @Test
     public void performInit() {

<|original_code|>
/**
 * Copyright 2011, Aiki IT, FotoRenamer
 *

 * 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 de.aikiit.fotorenamer.gui;

import org.junit.Test;

import static org.junit.Assert.assertNotNull;

/**
 * Test directory selector.
 *
 * @author hirsch
 * @version 2011-04-08, 00:22
 */
public class ImageDirectorySelectorTest {
    @Test
    public void performInit() {
        assertNotNull(new ImageDirectorySelector(null));
    }

}

<|edits_diff|>
--- src/test/java/de/aikiit/fotorenamer/gui/ImageDirectorySelectorTest.java
+++ src/test/java/de/aikiit/fotorenamer/gui/ImageDirectorySelectorTest.java
@@ -15,6 +15,7 @@
  */
 package de.aikiit.fotorenamer.gui;

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

 import static org.junit.Assert.assertNotNull;
<|current_version|>
/**
 * Copyright 2011, Aiki IT, FotoRenamer
 *

 * 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 de.aikiit.fotorenamer.gui;

import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertNotNull;

/**
 * Test directory selector.
 *
 * @author hirsch
 * @version 2011-04-08, 00:22
 */
public class ImageDirectorySelectorTest {
    @Test
    public void performInit() {
        assertNotNull(new ImageDirectorySelector(null));
    }

}

<|next_version|>
/**
 * Copyright 2011, Aiki IT, FotoRenamer
 *

 * 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 de.aikiit.fotorenamer.gui;

import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertNotNull;

/**
 * Test directory selector.
 *
 * @author hirsch
 * @version 2011-04-08, 00:22
 */
@Ignore("Not working on travis since no X11 present")
public class ImageDirectorySelectorTest {
    @Test
    public void performInit() {
        assertNotNull(new ImageDirectorySelector(null));
    }

}


Fix crash when Arg "Enter Number" field is left empty.

--- sample/src/main/java/eu/f3rog/blade/sample/arg/TestArgActivity.java
+++ sample/src/main/java/eu/f3rog/blade/sample/arg/TestArgActivity.java
@@ -3,6 +3,7 @@
 import android.os.Bundle;
 import android.support.v7.app.AppCompatActivity;
 import android.widget.EditText;
+import android.widget.Toast;

 import java.util.Random;

@@ -23,6 +24,11 @@

     @OnClick(R.id.btn_show_fragment)
     public void showFragment() {
+        if (mEditNumber.getText().length() == 0) {
+            Toast.makeText(this, "Input a number!", Toast.LENGTH_SHORT).show();
+            mEditNumber.requestFocus();
+            return;
+        }
         int number = Integer.parseInt(mEditNumber.getText().toString());
         String text = mEditText.getText().toString();
         Data data = new Data(number, text);

<|original_code|>
package eu.f3rog.blade.sample.arg;

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

import java.util.Random;

import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import eu.f3rog.blade.sample.R;

@Blade
public class TestArgActivity extends AppCompatActivity {

    @BindView(R.id.edt_num)
    EditText mEditNumber;
    @BindView(R.id.edt_text)
    EditText mEditText;

    @OnClick(R.id.btn_show_fragment)
    public void showFragment() {
        int number = Integer.parseInt(mEditNumber.getText().toString());
        String text = mEditText.getText().toString();
        Data data = new Data(number, text);

        double randomDouble = new Random().nextDouble();

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.frag, F.newDataFragment(randomDouble, data))
                .commit();
    }

    @OnClick(R.id.btn_show_dialog)
    public void b2() {
        F.newSampleDialogFragment("Hello mate :)").show(getSupportFragmentManager(), "some-tag");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_arg);
        ButterKnife.bind(this);
    }

}

<|edits_diff|>
--- sample/src/main/java/eu/f3rog/blade/sample/arg/TestArgActivity.java
+++ sample/src/main/java/eu/f3rog/blade/sample/arg/TestArgActivity.java
@@ -3,6 +3,7 @@
 import android.os.Bundle;
 import android.support.v7.app.AppCompatActivity;
 import android.widget.EditText;
+import android.widget.Toast;

 import java.util.Random;

<|current_version|>
package eu.f3rog.blade.sample.arg;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import android.widget.Toast;

import java.util.Random;

import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import eu.f3rog.blade.sample.R;

@Blade
public class TestArgActivity extends AppCompatActivity {

    @BindView(R.id.edt_num)
    EditText mEditNumber;
    @BindView(R.id.edt_text)
    EditText mEditText;

    @OnClick(R.id.btn_show_fragment)
    public void showFragment() {
        int number = Integer.parseInt(mEditNumber.getText().toString());
        String text = mEditText.getText().toString();
        Data data = new Data(number, text);

        double randomDouble = new Random().nextDouble();

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.frag, F.newDataFragment(randomDouble, data))
                .commit();
    }

    @OnClick(R.id.btn_show_dialog)
    public void b2() {
        F.newSampleDialogFragment("Hello mate :)").show(getSupportFragmentManager(), "some-tag");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_arg);
        ButterKnife.bind(this);
    }

}

<|next_version|>
package eu.f3rog.blade.sample.arg;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import android.widget.Toast;

import java.util.Random;

import blade.Blade;
import blade.F;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import eu.f3rog.blade.sample.R;

@Blade
public class TestArgActivity extends AppCompatActivity {

    @BindView(R.id.edt_num)
    EditText mEditNumber;
    @BindView(R.id.edt_text)
    EditText mEditText;

    @OnClick(R.id.btn_show_fragment)
    public void showFragment() {
        if (mEditNumber.getText().length() == 0) {
            Toast.makeText(this, "Input a number!", Toast.LENGTH_SHORT).show();
            mEditNumber.requestFocus();
            return;
        }
        int number = Integer.parseInt(mEditNumber.getText().toString());
        String text = mEditText.getText().toString();
        Data data = new Data(number, text);

        double randomDouble = new Random().nextDouble();

        getSupportFragmentManager().beginTransaction()
                .replace(R.id.frag, F.newDataFragment(randomDouble, data))
                .commit();
    }

    @OnClick(R.id.btn_show_dialog)
    public void b2() {
        F.newSampleDialogFragment("Hello mate :)").show(getSupportFragmentManager(), "some-tag");
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_arg);
        ButterKnife.bind(this);
    }

}


Add metrics to monitor Redis connections

--- dropwizard-redis/src/main/java/com/bendb/dropwizard/redis/JedisBundle.java
+++ dropwizard-redis/src/main/java/com/bendb/dropwizard/redis/JedisBundle.java
@@ -1,6 +1,7 @@
 package com.bendb.dropwizard.redis;

 import com.bendb.dropwizard.redis.jersey.JedisPoolBinder;
+import com.codahale.metrics.Gauge;
 import io.dropwizard.Configuration;
 import io.dropwizard.ConfiguredBundle;
 import io.dropwizard.setup.Bootstrap;
@@ -23,6 +24,10 @@
     public void run(C configuration, Environment environment) throws Exception {
         pool = getJedisFactory(configuration).build(environment);

+        environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle());
+        environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive());
+        environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters());
+
         environment.healthChecks().register("redis", new JedisHealthCheck(pool));
         environment.jersey().register(new JedisPoolBinder(pool));
     }

<|original_code|>
package com.bendb.dropwizard.redis;

import com.bendb.dropwizard.redis.jersey.JedisPoolBinder;
import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import redis.clients.jedis.JedisPool;

public abstract class JedisBundle<C extends Configuration>
        implements ConfiguredBundle<C>, JedisConfiguration<C> {
    private JedisPool pool;

    public JedisPool getPool() {
        return pool;
    }

    @Override
    public void initialize(Bootstrap<?> bootstrap) {
    }

    @Override
    public void run(C configuration, Environment environment) throws Exception {
        pool = getJedisFactory(configuration).build(environment);

        environment.healthChecks().register("redis", new JedisHealthCheck(pool));
        environment.jersey().register(new JedisPoolBinder(pool));
    }
}

<|edits_diff|>
--- dropwizard-redis/src/main/java/com/bendb/dropwizard/redis/JedisBundle.java
+++ dropwizard-redis/src/main/java/com/bendb/dropwizard/redis/JedisBundle.java
@@ -1,6 +1,7 @@
 package com.bendb.dropwizard.redis;

 import com.bendb.dropwizard.redis.jersey.JedisPoolBinder;
+import com.codahale.metrics.Gauge;
 import io.dropwizard.Configuration;
 import io.dropwizard.ConfiguredBundle;
 import io.dropwizard.setup.Bootstrap;
<|current_version|>
package com.bendb.dropwizard.redis;

import com.bendb.dropwizard.redis.jersey.JedisPoolBinder;
import com.codahale.metrics.Gauge;
import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import redis.clients.jedis.JedisPool;

public abstract class JedisBundle<C extends Configuration>
        implements ConfiguredBundle<C>, JedisConfiguration<C> {
    private JedisPool pool;

    public JedisPool getPool() {
        return pool;
    }

    @Override
    public void initialize(Bootstrap<?> bootstrap) {
    }

    @Override
    public void run(C configuration, Environment environment) throws Exception {
        pool = getJedisFactory(configuration).build(environment);

        environment.healthChecks().register("redis", new JedisHealthCheck(pool));
        environment.jersey().register(new JedisPoolBinder(pool));
    }
}

<|next_version|>
package com.bendb.dropwizard.redis;

import com.bendb.dropwizard.redis.jersey.JedisPoolBinder;
import com.codahale.metrics.Gauge;
import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import redis.clients.jedis.JedisPool;

public abstract class JedisBundle<C extends Configuration>
        implements ConfiguredBundle<C>, JedisConfiguration<C> {
    private JedisPool pool;

    public JedisPool getPool() {
        return pool;
    }

    @Override
    public void initialize(Bootstrap<?> bootstrap) {
    }

    @Override
    public void run(C configuration, Environment environment) throws Exception {
        pool = getJedisFactory(configuration).build(environment);

        environment.metrics().register("redis.connection.idle", (Gauge) () -> pool.getNumIdle());
        environment.metrics().register("redis.connection.active", (Gauge) () -> pool.getNumActive());
        environment.metrics().register("redis.connection.wait", (Gauge) () -> pool.getNumWaiters());

        environment.healthChecks().register("redis", new JedisHealthCheck(pool));
        environment.jersey().register(new JedisPoolBinder(pool));
    }
}


Make sure package is never output to Javascript

--- core/src/main/java/arez/annotations/package-info.java
+++ core/src/main/java/arez/annotations/package-info.java
@@ -1,4 +1,7 @@
 /**
  * This package contains annotations used by the annotation processor to generate model elements.
  */
+@OmitPattern
 package arez.annotations;
+
+import grim.annotations.OmitPattern;

<|original_code|>
/**
 * This package contains annotations used by the annotation processor to generate model elements.
 */
package arez.annotations;

<|edits_diff|>
--- core/src/main/java/arez/annotations/package-info.java
+++ core/src/main/java/arez/annotations/package-info.java
@@ -1,4 +1,5 @@
 /**
  * This package contains annotations used by the annotation processor to generate model elements.
  */
+@OmitPattern
 package arez.annotations;
<|current_version|>
/**
 * This package contains annotations used by the annotation processor to generate model elements.
 */
@OmitPattern
package arez.annotations;

<|next_version|>
/**
 * This package contains annotations used by the annotation processor to generate model elements.
 */
@OmitPattern
package arez.annotations;

import grim.annotations.OmitPattern;


Add Rest API restrictions to Project Iterations.

(rhbz750673)

--- zanata-common-api/src/main/java/org/zanata/rest/client/IProjectResource.java
+++ zanata-common-api/src/main/java/org/zanata/rest/client/IProjectResource.java
@@ -2,8 +2,10 @@

 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
 import javax.ws.rs.PUT;
 import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;

 import org.jboss.resteasy.client.ClientResponse;
 import org.zanata.rest.MediaTypes;
@@ -14,6 +16,10 @@
 public interface IProjectResource extends ProjectResource
 {

+   @HEAD
+   @Produces({ MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_JSON, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
+   public ClientResponse head();
+
    @GET
    @Produces( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
    public ClientResponse<Project> get();

<|original_code|>
package org.zanata.rest.client;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Produces;

import org.jboss.resteasy.client.ClientResponse;
import org.zanata.rest.MediaTypes;
import org.zanata.rest.dto.Project;
import org.zanata.rest.service.ProjectResource;

//@Path("/projects/p/{projectSlug}")
public interface IProjectResource extends ProjectResource
{

   @GET
   @Produces( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse<Project> get();

   @PUT
   @Consumes( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse put(Project project);

}

<|edits_diff|>
--- zanata-common-api/src/main/java/org/zanata/rest/client/IProjectResource.java
+++ zanata-common-api/src/main/java/org/zanata/rest/client/IProjectResource.java
@@ -2,8 +2,10 @@

 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
+import javax.ws.rs.HEAD;
 import javax.ws.rs.PUT;
 import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;

 import org.jboss.resteasy.client.ClientResponse;
 import org.zanata.rest.MediaTypes;
<|current_version|>
package org.zanata.rest.client;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.PUT;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.jboss.resteasy.client.ClientResponse;
import org.zanata.rest.MediaTypes;
import org.zanata.rest.dto.Project;
import org.zanata.rest.service.ProjectResource;

//@Path("/projects/p/{projectSlug}")
public interface IProjectResource extends ProjectResource
{

   @GET
   @Produces( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse<Project> get();

   @PUT
   @Consumes( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse put(Project project);

}

<|next_version|>
package org.zanata.rest.client;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.PUT;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.jboss.resteasy.client.ClientResponse;
import org.zanata.rest.MediaTypes;
import org.zanata.rest.dto.Project;
import org.zanata.rest.service.ProjectResource;

//@Path("/projects/p/{projectSlug}")
public interface IProjectResource extends ProjectResource
{

   @HEAD
   @Produces({ MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_JSON, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
   public ClientResponse head();

   @GET
   @Produces( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse<Project> get();

   @PUT
   @Consumes( { MediaTypes.APPLICATION_ZANATA_PROJECT_XML, MediaTypes.APPLICATION_ZANATA_PROJECT_ITERATION_JSON })
   public ClientResponse put(Project project);

}


Hide decryption success dialog from screen recorders

* MOPPAND-610

--- app/src/main/java/ee/ria/DigiDoc/android/utils/widget/NotificationDialog.java
+++ app/src/main/java/ee/ria/DigiDoc/android/utils/widget/NotificationDialog.java
@@ -9,11 +9,13 @@

 import ee.ria.DigiDoc.R;
 import ee.ria.DigiDoc.android.Activity;
+import ee.ria.DigiDoc.android.utils.SecureUtil;

 public class NotificationDialog extends Dialog {

     public NotificationDialog(@NonNull Activity context) {
         super(context);
+        SecureUtil.markAsSecure(getWindow());
         getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
         setContentView(R.layout.success_notification_dialog);
         Button okButton = findViewById(R.id.okButton);

<|original_code|>
package ee.ria.DigiDoc.android.utils.widget;

import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;

import androidx.annotation.NonNull;

import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;

public class NotificationDialog extends Dialog {

    public NotificationDialog(@NonNull Activity context) {
        super(context);
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        setContentView(R.layout.success_notification_dialog);
        Button okButton = findViewById(R.id.okButton);
        okButton.setOnClickListener(v -> {
            CheckBox checkBox = (CheckBox) findViewById(R.id.successNotificationDontShowAgain);
            if (checkBox.isChecked()) {
                context.getSettingsDataStore().setShowSuccessNotification(false);
            }
            dismiss();
        });
    }

}

<|edits_diff|>
--- app/src/main/java/ee/ria/DigiDoc/android/utils/widget/NotificationDialog.java
+++ app/src/main/java/ee/ria/DigiDoc/android/utils/widget/NotificationDialog.java
@@ -9,6 +9,7 @@

 import ee.ria.DigiDoc.R;
 import ee.ria.DigiDoc.android.Activity;
+import ee.ria.DigiDoc.android.utils.SecureUtil;

 public class NotificationDialog extends Dialog {

<|current_version|>
package ee.ria.DigiDoc.android.utils.widget;

import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;

import androidx.annotation.NonNull;

import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;
import ee.ria.DigiDoc.android.utils.SecureUtil;

public class NotificationDialog extends Dialog {

    public NotificationDialog(@NonNull Activity context) {
        super(context);
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        setContentView(R.layout.success_notification_dialog);
        Button okButton = findViewById(R.id.okButton);
        okButton.setOnClickListener(v -> {
            CheckBox checkBox = (CheckBox) findViewById(R.id.successNotificationDontShowAgain);
            if (checkBox.isChecked()) {
                context.getSettingsDataStore().setShowSuccessNotification(false);
            }
            dismiss();
        });
    }

}

<|next_version|>
package ee.ria.DigiDoc.android.utils.widget;

import android.app.Dialog;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CheckBox;

import androidx.annotation.NonNull;

import ee.ria.DigiDoc.R;
import ee.ria.DigiDoc.android.Activity;
import ee.ria.DigiDoc.android.utils.SecureUtil;

public class NotificationDialog extends Dialog {

    public NotificationDialog(@NonNull Activity context) {
        super(context);
        SecureUtil.markAsSecure(getWindow());
        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
        setContentView(R.layout.success_notification_dialog);
        Button okButton = findViewById(R.id.okButton);
        okButton.setOnClickListener(v -> {
            CheckBox checkBox = (CheckBox) findViewById(R.id.successNotificationDontShowAgain);
            if (checkBox.isChecked()) {
                context.getSettingsDataStore().setShowSuccessNotification(false);
            }
            dismiss();
        });
    }

}


Set workspace persistence and defaults.

Set workspace persistence and defaults.

--- src/main/java/com/cjmalloy/torrentfs/editor/controller/FileSystemController.java
+++ src/main/java/com/cjmalloy/torrentfs/editor/controller/FileSystemController.java
@@ -1,20 +1,26 @@
 package com.cjmalloy.torrentfs.editor.controller;

 import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.prefs.Preferences;

 import com.cjmalloy.torrentfs.editor.model.FileSystemModel;

 public class FileSystemController extends Controller<FileSystemModel>
 {
+    private static Preferences P = Preferences.userNodeForPackage(FileSystemController.class);

     public FileSystemController(FileSystemModel model)
     {
         this.model = model;
+
+        setWorkspace(Paths.get(P.get("tfsLastWorkspace", System.getProperty("user.home"))));
     }

     public void setWorkspace(Path workspace)
     {
+        P.put("tfsLastWorkspace", workspace.toString());
         model.workspace = workspace;
         update();
     }

<|original_code|>
package com.cjmalloy.torrentfs.editor.controller;

import java.nio.file.Path;

import com.cjmalloy.torrentfs.editor.model.FileSystemModel;

public class FileSystemController extends Controller<FileSystemModel>
{

    public FileSystemController(FileSystemModel model)
    {
        this.model = model;
    }

    public void setWorkspace(Path workspace)
    {
        model.workspace = workspace;
        update();
    }
}

<|edits_diff|>
--- src/main/java/com/cjmalloy/torrentfs/editor/controller/FileSystemController.java
+++ src/main/java/com/cjmalloy/torrentfs/editor/controller/FileSystemController.java
@@ -1,16 +1,21 @@
 package com.cjmalloy.torrentfs.editor.controller;

 import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.prefs.Preferences;

 import com.cjmalloy.torrentfs.editor.model.FileSystemModel;

 public class FileSystemController extends Controller<FileSystemModel>
 {
+    private static Preferences P = Preferences.userNodeForPackage(FileSystemController.class);

     public FileSystemController(FileSystemModel model)
     {
         this.model = model;
+
+        setWorkspace(Paths.get(P.get("tfsLastWorkspace", System.getProperty("user.home"))));
     }

     public void setWorkspace(Path workspace)
<|current_version|>
package com.cjmalloy.torrentfs.editor.controller;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.prefs.Preferences;

import com.cjmalloy.torrentfs.editor.model.FileSystemModel;

public class FileSystemController extends Controller<FileSystemModel>
{
    private static Preferences P = Preferences.userNodeForPackage(FileSystemController.class);

    public FileSystemController(FileSystemModel model)
    {
        this.model = model;

        setWorkspace(Paths.get(P.get("tfsLastWorkspace", System.getProperty("user.home"))));
    }

    public void setWorkspace(Path workspace)
    {
        model.workspace = workspace;
        update();
    }
}

<|next_version|>
package com.cjmalloy.torrentfs.editor.controller;

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.prefs.Preferences;

import com.cjmalloy.torrentfs.editor.model.FileSystemModel;

public class FileSystemController extends Controller<FileSystemModel>
{
    private static Preferences P = Preferences.userNodeForPackage(FileSystemController.class);

    public FileSystemController(FileSystemModel model)
    {
        this.model = model;

        setWorkspace(Paths.get(P.get("tfsLastWorkspace", System.getProperty("user.home"))));
    }

    public void setWorkspace(Path workspace)
    {
        P.put("tfsLastWorkspace", workspace.toString());
        model.workspace = workspace;
        update();
    }
}


Add Arquillian Moco API to remote deployment

--- src/main/java/org/jboss/arquillian/moco/client/MocoArchiveAppender.java
+++ src/main/java/org/jboss/arquillian/moco/client/MocoArchiveAppender.java
@@ -3,6 +3,7 @@
 import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
 import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
 import org.jboss.arquillian.moco.ReflectionHelper;
+import org.jboss.arquillian.moco.api.Moco;
 import org.jboss.arquillian.moco.container.MocoRemoteExtension;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
@@ -15,6 +16,7 @@

 		 return ShrinkWrap.create(JavaArchive.class, "arquillian-moco.jar")
 		            .addClass(ReflectionHelper.class)
+		            .addPackage(Moco.class.getPackage())
 		            .addPackage(MocoRemoteExtension.class.getPackage())
 		            .addAsServiceProvider(RemoteLoadableExtension.class, MocoRemoteExtension.class);

<|original_code|>
package org.jboss.arquillian.moco.client;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.arquillian.moco.ReflectionHelper;
import org.jboss.arquillian.moco.container.MocoRemoteExtension;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;

public class MocoArchiveAppender implements AuxiliaryArchiveAppender {

	@Override
	public Archive<?> createAuxiliaryArchive() {

		 return ShrinkWrap.create(JavaArchive.class, "arquillian-moco.jar")
		            .addClass(ReflectionHelper.class)
		            .addPackage(MocoRemoteExtension.class.getPackage())
		            .addAsServiceProvider(RemoteLoadableExtension.class, MocoRemoteExtension.class);

	}

}

<|edits_diff|>
--- src/main/java/org/jboss/arquillian/moco/client/MocoArchiveAppender.java
+++ src/main/java/org/jboss/arquillian/moco/client/MocoArchiveAppender.java
@@ -3,6 +3,7 @@
 import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
 import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
 import org.jboss.arquillian.moco.ReflectionHelper;
+import org.jboss.arquillian.moco.api.Moco;
 import org.jboss.arquillian.moco.container.MocoRemoteExtension;
 import org.jboss.shrinkwrap.api.Archive;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
<|current_version|>
package org.jboss.arquillian.moco.client;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.arquillian.moco.ReflectionHelper;
import org.jboss.arquillian.moco.api.Moco;
import org.jboss.arquillian.moco.container.MocoRemoteExtension;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;

public class MocoArchiveAppender implements AuxiliaryArchiveAppender {

	@Override
	public Archive<?> createAuxiliaryArchive() {

		 return ShrinkWrap.create(JavaArchive.class, "arquillian-moco.jar")
		            .addClass(ReflectionHelper.class)
		            .addPackage(MocoRemoteExtension.class.getPackage())
		            .addAsServiceProvider(RemoteLoadableExtension.class, MocoRemoteExtension.class);

	}

}

<|next_version|>
package org.jboss.arquillian.moco.client;

import org.jboss.arquillian.container.test.spi.RemoteLoadableExtension;
import org.jboss.arquillian.container.test.spi.client.deployment.AuxiliaryArchiveAppender;
import org.jboss.arquillian.moco.ReflectionHelper;
import org.jboss.arquillian.moco.api.Moco;
import org.jboss.arquillian.moco.container.MocoRemoteExtension;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;

public class MocoArchiveAppender implements AuxiliaryArchiveAppender {

	@Override
	public Archive<?> createAuxiliaryArchive() {

		 return ShrinkWrap.create(JavaArchive.class, "arquillian-moco.jar")
		            .addClass(ReflectionHelper.class)
		            .addPackage(Moco.class.getPackage())
		            .addPackage(MocoRemoteExtension.class.getPackage())
		            .addAsServiceProvider(RemoteLoadableExtension.class, MocoRemoteExtension.class);

	}

}


Set team responsible by default

Set team responsible by default

--- src/org/ensembl/healthcheck/testcase/eg_core/AbstractEgCoreTestCase.java
+++ src/org/ensembl/healthcheck/testcase/eg_core/AbstractEgCoreTestCase.java
@@ -7,6 +7,7 @@
 package org.ensembl.healthcheck.testcase.eg_core;

 import org.ensembl.healthcheck.DatabaseType;
+import org.ensembl.healthcheck.Team;
 import org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;

 /**
@@ -23,5 +24,6 @@
 		super();
 		this.addToGroup(EG_GROUP);
 		this.appliesToType(DatabaseType.CORE);
+		this.setTeamResponsible(Team.ENSEMBL_GENOMES);
 	}
 }

<|original_code|>
/**
 * File: SampleMetaTestCase.java
 * Created by: dstaines
 * Created on: May 1, 2009
 * CVS:  $$
 */
package org.ensembl.healthcheck.testcase.eg_core;

import org.ensembl.healthcheck.DatabaseType;
import org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;

/**
 * Base class for EnsemblGenomes core healthchecks
 *
 * @author dstaines
 *
 */
public abstract class AbstractEgCoreTestCase extends AbstractTemplatedTestCase {

	public final static String EG_GROUP = "ensembl_genomes";

	public AbstractEgCoreTestCase() {
		super();
		this.addToGroup(EG_GROUP);
		this.appliesToType(DatabaseType.CORE);
	}
}

<|edits_diff|>
--- src/org/ensembl/healthcheck/testcase/eg_core/AbstractEgCoreTestCase.java
+++ src/org/ensembl/healthcheck/testcase/eg_core/AbstractEgCoreTestCase.java
@@ -7,6 +7,7 @@
 package org.ensembl.healthcheck.testcase.eg_core;

 import org.ensembl.healthcheck.DatabaseType;
+import org.ensembl.healthcheck.Team;
 import org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;

 /**
<|current_version|>
/**
 * File: SampleMetaTestCase.java
 * Created by: dstaines
 * Created on: May 1, 2009
 * CVS:  $$
 */
package org.ensembl.healthcheck.testcase.eg_core;

import org.ensembl.healthcheck.DatabaseType;
import org.ensembl.healthcheck.Team;
import org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;

/**
 * Base class for EnsemblGenomes core healthchecks
 *
 * @author dstaines
 *
 */
public abstract class AbstractEgCoreTestCase extends AbstractTemplatedTestCase {

	public final static String EG_GROUP = "ensembl_genomes";

	public AbstractEgCoreTestCase() {
		super();
		this.addToGroup(EG_GROUP);
		this.appliesToType(DatabaseType.CORE);
	}
}

<|next_version|>
/**
 * File: SampleMetaTestCase.java
 * Created by: dstaines
 * Created on: May 1, 2009
 * CVS:  $$
 */
package org.ensembl.healthcheck.testcase.eg_core;

import org.ensembl.healthcheck.DatabaseType;
import org.ensembl.healthcheck.Team;
import org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;

/**
 * Base class for EnsemblGenomes core healthchecks
 *
 * @author dstaines
 *
 */
public abstract class AbstractEgCoreTestCase extends AbstractTemplatedTestCase {

	public final static String EG_GROUP = "ensembl_genomes";

	public AbstractEgCoreTestCase() {
		super();
		this.addToGroup(EG_GROUP);
		this.appliesToType(DatabaseType.CORE);
		this.setTeamResponsible(Team.ENSEMBL_GENOMES);
	}
}


Set this in addition to annotation introspector approach

--- RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaModule.java
+++ RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaModule.java
@@ -1,5 +1,6 @@
 package com.hubspot.rosetta.internal;

+import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.core.ObjectCodec;
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -33,6 +34,7 @@
       mapper.setSerializerProvider(new DefaultSerializerProvider.Impl());
       mapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
       mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+      mapper.setSerializationInclusion(Include.ALWAYS);
     }
   }
 }

<|original_code|>
package com.hubspot.rosetta.internal;

import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;

@SuppressWarnings("serial")
public class RosettaModule extends Module {

  @Override
  public String getModuleName() {
    return "RosettaModule";
  }

  @Override
  public Version version() {
    return Version.unknownVersion();
  }

  @Override
  public void setupModule(SetupContext context) {
    context.addBeanSerializerModifier(new StoredAsJsonBeanSerializerModifier());

    ObjectCodec codec = context.getOwner();
    if (codec instanceof ObjectMapper) {
      ObjectMapper mapper = (ObjectMapper) codec;

      context.insertAnnotationIntrospector(new RosettaAnnotationIntrospector(mapper));

      mapper.setSerializerProvider(new DefaultSerializerProvider.Impl());
      mapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }
  }
}

<|edits_diff|>
--- RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaModule.java
+++ RosettaCore/src/main/java/com/hubspot/rosetta/internal/RosettaModule.java
@@ -1,5 +1,6 @@
 package com.hubspot.rosetta.internal;

+import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.core.ObjectCodec;
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.DeserializationFeature;
<|current_version|>
package com.hubspot.rosetta.internal;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;

@SuppressWarnings("serial")
public class RosettaModule extends Module {

  @Override
  public String getModuleName() {
    return "RosettaModule";
  }

  @Override
  public Version version() {
    return Version.unknownVersion();
  }

  @Override
  public void setupModule(SetupContext context) {
    context.addBeanSerializerModifier(new StoredAsJsonBeanSerializerModifier());

    ObjectCodec codec = context.getOwner();
    if (codec instanceof ObjectMapper) {
      ObjectMapper mapper = (ObjectMapper) codec;

      context.insertAnnotationIntrospector(new RosettaAnnotationIntrospector(mapper));

      mapper.setSerializerProvider(new DefaultSerializerProvider.Impl());
      mapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    }
  }
}

<|next_version|>
package com.hubspot.rosetta.internal;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;

@SuppressWarnings("serial")
public class RosettaModule extends Module {

  @Override
  public String getModuleName() {
    return "RosettaModule";
  }

  @Override
  public Version version() {
    return Version.unknownVersion();
  }

  @Override
  public void setupModule(SetupContext context) {
    context.addBeanSerializerModifier(new StoredAsJsonBeanSerializerModifier());

    ObjectCodec codec = context.getOwner();
    if (codec instanceof ObjectMapper) {
      ObjectMapper mapper = (ObjectMapper) codec;

      context.insertAnnotationIntrospector(new RosettaAnnotationIntrospector(mapper));

      mapper.setSerializerProvider(new DefaultSerializerProvider.Impl());
      mapper.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, false);
      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
      mapper.setSerializationInclusion(Include.ALWAYS);
    }
  }
}


Add another default from JSLint.

Add another default from JSLint.

--- com.googlecode.jslint4java.eclipse/src/com/googlecode/jslint4java/eclipse/preferences/PreferencesInitializer.java
+++ com.googlecode.jslint4java.eclipse/src/com/googlecode/jslint4java/eclipse/preferences/PreferencesInitializer.java
@@ -21,6 +21,8 @@
 public class PreferencesInitializer extends AbstractPreferenceInitializer {

     private static final int DEFAULT_INDENT = 4;
+    private static final int DEFAULT_MAXERR = 50;
+
     private final Set<Option> defaultEnable = EnumSet.of(Option.EQEQEQ, Option.UNDEF, Option.WHITE);

     @Override
@@ -31,6 +33,7 @@
         }
         // Hand code these.
         node.putInt(Option.INDENT.getLowerName(), DEFAULT_INDENT);
+        node.putInt(Option.MAXERR.getLowerName(), DEFAULT_MAXERR);
     }

 }

<|original_code|>
package com.googlecode.jslint4java.eclipse.preferences;

import java.util.EnumSet;
import java.util.Set;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import com.googlecode.jslint4java.Option;
import com.googlecode.jslint4java.eclipse.JSLintPlugin;

/**
 * Set up the default preferences. By default,we enable:
 *

 *
 {@link Option#EQEQEQ}
 *
 {@link Option#UNDEF}
 *
 {@link Option#WHITE}
 *

 */
public class PreferencesInitializer extends AbstractPreferenceInitializer {

    private static final int DEFAULT_INDENT = 4;
    private final Set<Option> defaultEnable = EnumSet.of(Option.EQEQEQ, Option.UNDEF, Option.WHITE);

    @Override
    public void initializeDefaultPreferences() {
        IEclipsePreferences node = new DefaultScope().getNode(JSLintPlugin.PLUGIN_ID);
        for (Option o : defaultEnable) {
            node.putBoolean(o.getLowerName(), true);
        }
        // Hand code these.
        node.putInt(Option.INDENT.getLowerName(), DEFAULT_INDENT);
    }

}

<|edits_diff|>
--- com.googlecode.jslint4java.eclipse/src/com/googlecode/jslint4java/eclipse/preferences/PreferencesInitializer.java
+++ com.googlecode.jslint4java.eclipse/src/com/googlecode/jslint4java/eclipse/preferences/PreferencesInitializer.java
@@ -21,6 +21,8 @@
 public class PreferencesInitializer extends AbstractPreferenceInitializer {

     private static final int DEFAULT_INDENT = 4;
+    private static final int DEFAULT_MAXERR = 50;
+
     private final Set<Option> defaultEnable = EnumSet.of(Option.EQEQEQ, Option.UNDEF, Option.WHITE);

     @Override
<|current_version|>
package com.googlecode.jslint4java.eclipse.preferences;

import java.util.EnumSet;
import java.util.Set;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import com.googlecode.jslint4java.Option;
import com.googlecode.jslint4java.eclipse.JSLintPlugin;

/**
 * Set up the default preferences. By default,we enable:
 *

 *
 {@link Option#EQEQEQ}
 *
 {@link Option#UNDEF}
 *
 {@link Option#WHITE}
 *

 */
public class PreferencesInitializer extends AbstractPreferenceInitializer {

    private static final int DEFAULT_INDENT = 4;
    private static final int DEFAULT_MAXERR = 50;

    private final Set<Option> defaultEnable = EnumSet.of(Option.EQEQEQ, Option.UNDEF, Option.WHITE);

    @Override
    public void initializeDefaultPreferences() {
        IEclipsePreferences node = new DefaultScope().getNode(JSLintPlugin.PLUGIN_ID);
        for (Option o : defaultEnable) {
            node.putBoolean(o.getLowerName(), true);
        }
        // Hand code these.
        node.putInt(Option.INDENT.getLowerName(), DEFAULT_INDENT);
    }

}

<|next_version|>
package com.googlecode.jslint4java.eclipse.preferences;

import java.util.EnumSet;
import java.util.Set;

import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;

import com.googlecode.jslint4java.Option;
import com.googlecode.jslint4java.eclipse.JSLintPlugin;

/**
 * Set up the default preferences. By default,we enable:
 *

 *
 {@link Option#EQEQEQ}
 *
 {@link Option#UNDEF}
 *
 {@link Option#WHITE}
 *

 */
public class PreferencesInitializer extends AbstractPreferenceInitializer {

    private static final int DEFAULT_INDENT = 4;
    private static final int DEFAULT_MAXERR = 50;

    private final Set<Option> defaultEnable = EnumSet.of(Option.EQEQEQ, Option.UNDEF, Option.WHITE);

    @Override
    public void initializeDefaultPreferences() {
        IEclipsePreferences node = new DefaultScope().getNode(JSLintPlugin.PLUGIN_ID);
        for (Option o : defaultEnable) {
            node.putBoolean(o.getLowerName(), true);
        }
        // Hand code these.
        node.putInt(Option.INDENT.getLowerName(), DEFAULT_INDENT);
        node.putInt(Option.MAXERR.getLowerName(), DEFAULT_MAXERR);
    }

}


Add debug of all spawned processes

Add debug of all spawned processes

--- node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/ProcessStarterImpl.java
+++ node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/ProcessStarterImpl.java
@@ -1,6 +1,10 @@
 // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

 package com.yahoo.vespa.hosted.node.admin.task.util.process;
+
+import com.yahoo.log.LogLevel;
+
+import java.util.logging.Logger;

 import static com.yahoo.vespa.hosted.node.admin.task.util.file.IOExceptionUtil.uncheck;

@@ -8,8 +12,14 @@
  * @author hakonhall
  */
 public class ProcessStarterImpl implements ProcessStarter {
+    private static final Logger logger = Logger.getLogger(ProcessStarterImpl.class.getName());
+
     @Override
     public ProcessApi2 start(ProcessBuilder processBuilder) {
+        if (logger.isLoggable(LogLevel.DEBUG)) {
+            logger.log(LogLevel.DEBUG, "Spawning process: " + processBuilder.command());
+        }
+
         Process process = uncheck(() -> processBuilder.start());
         return new ProcessApi2Impl(process);
     }

<|original_code|>
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.hosted.node.admin.task.util.process;

import static com.yahoo.vespa.hosted.node.admin.task.util.file.IOExceptionUtil.uncheck;

/**
 * @author hakonhall
 */
public class ProcessStarterImpl implements ProcessStarter {
    @Override
    public ProcessApi2 start(ProcessBuilder processBuilder) {
        Process process = uncheck(() -> processBuilder.start());
        return new ProcessApi2Impl(process);
    }
}

<|edits_diff|>
--- node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/ProcessStarterImpl.java
+++ node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/process/ProcessStarterImpl.java
@@ -1,6 +1,10 @@
 // Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

 package com.yahoo.vespa.hosted.node.admin.task.util.process;
+
+import com.yahoo.log.LogLevel;
+
+import java.util.logging.Logger;

 import static com.yahoo.vespa.hosted.node.admin.task.util.file.IOExceptionUtil.uncheck;

@@ -8,6 +12,8 @@
  * @author hakonhall
  */
 public class ProcessStarterImpl implements ProcessStarter {
+    private static final Logger logger = Logger.getLogger(ProcessStarterImpl.class.getName());
+
     @Override
     public ProcessApi2 start(ProcessBuilder processBuilder) {
         Process process = uncheck(() -> processBuilder.start());
<|current_version|>
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.hosted.node.admin.task.util.process;

import com.yahoo.log.LogLevel;

import java.util.logging.Logger;

import static com.yahoo.vespa.hosted.node.admin.task.util.file.IOExceptionUtil.uncheck;

/**
 * @author hakonhall
 */
public class ProcessStarterImpl implements ProcessStarter {
    private static final Logger logger = Logger.getLogger(ProcessStarterImpl.class.getName());

    @Override
    public ProcessApi2 start(ProcessBuilder processBuilder) {
        Process process = uncheck(() -> processBuilder.start());
        return new ProcessApi2Impl(process);
    }
}

<|next_version|>
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

package com.yahoo.vespa.hosted.node.admin.task.util.process;

import com.yahoo.log.LogLevel;

import java.util.logging.Logger;

import static com.yahoo.vespa.hosted.node.admin.task.util.file.IOExceptionUtil.uncheck;

/**
 * @author hakonhall
 */
public class ProcessStarterImpl implements ProcessStarter {
    private static final Logger logger = Logger.getLogger(ProcessStarterImpl.class.getName());

    @Override
    public ProcessApi2 start(ProcessBuilder processBuilder) {
        if (logger.isLoggable(LogLevel.DEBUG)) {
            logger.log(LogLevel.DEBUG, "Spawning process: " + processBuilder.command());
        }

        Process process = uncheck(() -> processBuilder.start());
        return new ProcessApi2Impl(process);
    }
}


[WFLY-4853] Disable transactions for invocations on RemoteStatefulSB

--- testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/twoclusters/bean/common/CommonStatefulSBImpl.java
+++ testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/twoclusters/bean/common/CommonStatefulSBImpl.java
@@ -4,9 +4,12 @@

 import javax.annotation.PostConstruct;
 import javax.ejb.Remove;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
 import java.util.logging.Level;
 import java.util.logging.Logger;

+@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
 public class CommonStatefulSBImpl implements CommonStatefulSB {

     private SerialBean bean;

<|original_code|>
package org.jboss.as.test.clustering.twoclusters.bean.common;

import org.jboss.as.test.clustering.twoclusters.bean.SerialBean;

import javax.annotation.PostConstruct;
import javax.ejb.Remove;
import java.util.logging.Level;
import java.util.logging.Logger;

public class CommonStatefulSBImpl implements CommonStatefulSB {

    private SerialBean bean;
    private static final Logger log = Logger.getLogger(CommonStatefulSBImpl.class.getName());

    @PostConstruct
    private void init() {
        bean = new SerialBean();
        log.log(Level.INFO, "New SFSB created: {0}.", this);
    }

    @Override
    public int getSerial() {
        log.log(Level.INFO, "getSerial() called on non-forwarding node " + getCurrentNode());
        return bean.getSerial();
    }

    @Override
    public int getSerialAndIncrement() {
        log.log(Level.INFO, "getSerialAndIncrement() called on non-forwarding node " + getCurrentNode());
        return bean.getSerialAndIncrement();
    }

    @Override
    public byte[] getCargo() {
        log.log(Level.INFO, "getCargo() called on non-forwarding node " + getCurrentNode());
        return bean.getCargo();
    }

    @Remove
    private void destroy() {
        // Let the container do the work.
    }

    private String getCurrentNode() {
        return System.getProperty("jboss.node.name", "unknown");
    }
}

<|edits_diff|>
--- testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/twoclusters/bean/common/CommonStatefulSBImpl.java
+++ testsuite/integration/clustering/src/test/java/org/jboss/as/test/clustering/twoclusters/bean/common/CommonStatefulSBImpl.java
@@ -4,6 +4,8 @@

 import javax.annotation.PostConstruct;
 import javax.ejb.Remove;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
 import java.util.logging.Level;
 import java.util.logging.Logger;

<|current_version|>
package org.jboss.as.test.clustering.twoclusters.bean.common;

import org.jboss.as.test.clustering.twoclusters.bean.SerialBean;

import javax.annotation.PostConstruct;
import javax.ejb.Remove;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.logging.Level;
import java.util.logging.Logger;

public class CommonStatefulSBImpl implements CommonStatefulSB {

    private SerialBean bean;
    private static final Logger log = Logger.getLogger(CommonStatefulSBImpl.class.getName());

    @PostConstruct
    private void init() {
        bean = new SerialBean();
        log.log(Level.INFO, "New SFSB created: {0}.", this);
    }

    @Override
    public int getSerial() {
        log.log(Level.INFO, "getSerial() called on non-forwarding node " + getCurrentNode());
        return bean.getSerial();
    }

    @Override
    public int getSerialAndIncrement() {
        log.log(Level.INFO, "getSerialAndIncrement() called on non-forwarding node " + getCurrentNode());
        return bean.getSerialAndIncrement();
    }

    @Override
    public byte[] getCargo() {
        log.log(Level.INFO, "getCargo() called on non-forwarding node " + getCurrentNode());
        return bean.getCargo();
    }

    @Remove
    private void destroy() {
        // Let the container do the work.
    }

    private String getCurrentNode() {
        return System.getProperty("jboss.node.name", "unknown");
    }
}

<|next_version|>
package org.jboss.as.test.clustering.twoclusters.bean.common;

import org.jboss.as.test.clustering.twoclusters.bean.SerialBean;

import javax.annotation.PostConstruct;
import javax.ejb.Remove;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import java.util.logging.Level;
import java.util.logging.Logger;

@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class CommonStatefulSBImpl implements CommonStatefulSB {

    private SerialBean bean;
    private static final Logger log = Logger.getLogger(CommonStatefulSBImpl.class.getName());

    @PostConstruct
    private void init() {
        bean = new SerialBean();
        log.log(Level.INFO, "New SFSB created: {0}.", this);
    }

    @Override
    public int getSerial() {
        log.log(Level.INFO, "getSerial() called on non-forwarding node " + getCurrentNode());
        return bean.getSerial();
    }

    @Override
    public int getSerialAndIncrement() {
        log.log(Level.INFO, "getSerialAndIncrement() called on non-forwarding node " + getCurrentNode());
        return bean.getSerialAndIncrement();
    }

    @Override
    public byte[] getCargo() {
        log.log(Level.INFO, "getCargo() called on non-forwarding node " + getCurrentNode());
        return bean.getCargo();
    }

    @Remove
    private void destroy() {
        // Let the container do the work.
    }

    private String getCurrentNode() {
        return System.getProperty("jboss.node.name", "unknown");
    }
}


Add more getters to block registry object

--- src/main/java/info/u_team/u_team_core/util/registry/BlockRegistryObject.java
+++ src/main/java/info/u_team/u_team_core/util/registry/BlockRegistryObject.java
@@ -4,6 +4,7 @@

 import net.minecraft.block.Block;
 import net.minecraft.item.BlockItem;
+import net.minecraft.util.ResourceLocation;
 import net.minecraftforge.fml.RegistryObject;

 public class BlockRegistryObject<B extends Block, I extends BlockItem> implements Supplier<B> {
@@ -16,9 +17,17 @@
 		this.item = item;
 	}

+	public boolean isPresent() {
+		return block.isPresent();
+	}
+
 	@Override
 	public B get() {
 		return block.get();
+	}
+
+	public ResourceLocation getId() {
+		return block.getId();
 	}

 	public boolean hasItem() {
@@ -29,4 +38,8 @@
 		return item.get();
 	}

+	public ResourceLocation getItemId() {
+		return item.getId();
+	}
+
 }

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

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraftforge.fml.RegistryObject;

public class BlockRegistryObject<B extends Block, I extends BlockItem> implements Supplier<B> {

	private final RegistryObject<B> block;
	private final RegistryObject<I> item;

	public BlockRegistryObject(RegistryObject<B> block, RegistryObject<I> item) {
		this.block = block;
		this.item = item;
	}

	@Override
	public B get() {
		return block.get();
	}

	public boolean hasItem() {
		return item.isPresent();
	}

	public I getItem() {
		return item.get();
	}

}

<|edits_diff|>
--- src/main/java/info/u_team/u_team_core/util/registry/BlockRegistryObject.java
+++ src/main/java/info/u_team/u_team_core/util/registry/BlockRegistryObject.java
@@ -4,6 +4,7 @@

 import net.minecraft.block.Block;
 import net.minecraft.item.BlockItem;
+import net.minecraft.util.ResourceLocation;
 import net.minecraftforge.fml.RegistryObject;

 public class BlockRegistryObject<B extends Block, I extends BlockItem> implements Supplier<B> {
@@ -16,9 +17,17 @@
 		this.item = item;
 	}

+	public boolean isPresent() {
+		return block.isPresent();
+	}
+
 	@Override
 	public B get() {
 		return block.get();
+	}
+
+	public ResourceLocation getId() {
+		return block.getId();
 	}

 	public boolean hasItem() {
<|current_version|>
package info.u_team.u_team_core.util.registry;

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;

public class BlockRegistryObject<B extends Block, I extends BlockItem> implements Supplier<B> {

	private final RegistryObject<B> block;
	private final RegistryObject<I> item;

	public BlockRegistryObject(RegistryObject<B> block, RegistryObject<I> item) {
		this.block = block;
		this.item = item;
	}

	public boolean isPresent() {
		return block.isPresent();
	}

	@Override
	public B get() {
		return block.get();
	}

	public ResourceLocation getId() {
		return block.getId();
	}

	public boolean hasItem() {
		return item.isPresent();
	}

	public I getItem() {
		return item.get();
	}

}

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

import java.util.function.Supplier;

import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;

public class BlockRegistryObject<B extends Block, I extends BlockItem> implements Supplier<B> {

	private final RegistryObject<B> block;
	private final RegistryObject<I> item;

	public BlockRegistryObject(RegistryObject<B> block, RegistryObject<I> item) {
		this.block = block;
		this.item = item;
	}

	public boolean isPresent() {
		return block.isPresent();
	}

	@Override
	public B get() {
		return block.get();
	}

	public ResourceLocation getId() {
		return block.getId();
	}

	public boolean hasItem() {
		return item.isPresent();
	}

	public I getItem() {
		return item.get();
	}

	public ResourceLocation getItemId() {
		return item.getId();
	}

}


Set a minimum height to prevent the menu from surrendering it's entire space

--- src/org/pentaho/ui/xul/swing/tags/SwingMenubar.java
+++ src/org/pentaho/ui/xul/swing/tags/SwingMenubar.java
@@ -1,5 +1,6 @@
 package org.pentaho.ui.xul.swing.tags;

+import java.awt.Dimension;
 import java.awt.GridBagLayout;
 import java.util.ArrayList;

@@ -21,6 +22,7 @@
     children = new ArrayList<XulComponent>();

     menuBar = new JMenuBar();
+    menuBar.setMinimumSize(new Dimension(20,20));
     managedObject = menuBar;

   }

<|original_code|>
package org.pentaho.ui.xul.swing.tags;

import java.awt.GridBagLayout;
import java.util.ArrayList;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.containers.XulMenubar;
import org.pentaho.ui.xul.swing.SwingElement;

public class SwingMenubar extends SwingElement implements XulMenubar{

  private JMenuBar menuBar;
  public SwingMenubar(XulComponent parent, XulDomContainer domContainer, String tagName) {
    super("menubar");

    children = new ArrayList<XulComponent>();

    menuBar = new JMenuBar();
    managedObject = menuBar;

  }

  @Override
  public void layout(){
    for(XulComponent comp : children){
      if(comp instanceof SwingMenu){
        this.menuBar.add((JMenu) ((SwingMenu) comp).getManagedObject());
      }
    }
  }

}

<|edits_diff|>
--- src/org/pentaho/ui/xul/swing/tags/SwingMenubar.java
+++ src/org/pentaho/ui/xul/swing/tags/SwingMenubar.java
@@ -1,5 +1,6 @@
 package org.pentaho.ui.xul.swing.tags;

+import java.awt.Dimension;
 import java.awt.GridBagLayout;
 import java.util.ArrayList;

<|current_version|>
package org.pentaho.ui.xul.swing.tags;

import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.util.ArrayList;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.containers.XulMenubar;
import org.pentaho.ui.xul.swing.SwingElement;

public class SwingMenubar extends SwingElement implements XulMenubar{

  private JMenuBar menuBar;
  public SwingMenubar(XulComponent parent, XulDomContainer domContainer, String tagName) {
    super("menubar");

    children = new ArrayList<XulComponent>();

    menuBar = new JMenuBar();
    managedObject = menuBar;

  }

  @Override
  public void layout(){
    for(XulComponent comp : children){
      if(comp instanceof SwingMenu){
        this.menuBar.add((JMenu) ((SwingMenu) comp).getManagedObject());
      }
    }
  }

}

<|next_version|>
package org.pentaho.ui.xul.swing.tags;

import java.awt.Dimension;
import java.awt.GridBagLayout;
import java.util.ArrayList;

import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JPanel;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.containers.XulMenubar;
import org.pentaho.ui.xul.swing.SwingElement;

public class SwingMenubar extends SwingElement implements XulMenubar{

  private JMenuBar menuBar;
  public SwingMenubar(XulComponent parent, XulDomContainer domContainer, String tagName) {
    super("menubar");

    children = new ArrayList<XulComponent>();

    menuBar = new JMenuBar();
    menuBar.setMinimumSize(new Dimension(20,20));
    managedObject = menuBar;

  }

  @Override
  public void layout(){
    for(XulComponent comp : children){
      if(comp instanceof SwingMenu){
        this.menuBar.add((JMenu) ((SwingMenu) comp).getManagedObject());
      }
    }
  }

}