package eic.beike.projectx.network.projectXServer;

import eic.beike.projectx.util.ScoreEntry;

/**
 * Used to interact with the database, these are long running network operations and should not be called
 * from the UI thread.
 *
 * Created by alex on 10/1/15.
 */
public interface IDatabase {

    /**
     * Register a name for the given id.
     * @return True if registration succeded, false if it failed.
     */
   boolean register(String id, String name);

    /**
     * @return True if score was recorded correctly, false if it failed.
     */
    boolean recordScore(String playerId, int score, long time, String bus);

    /**
     * @return The best ten scores for all players on all buses.
     */
    ScoreEntry[] getTopTen();

    /**
     * @return The best ten scores for the given player.
     */
    ScoreEntry[] getPlayerTopTen(String playerId);

}

package eic.beike.projectx.network.projectXServer;

import eic.beike.projectx.util.ScoreEntry;

import java.util.List;

/**
 * Used to interact with the database, these are long running network operations and should not be called
 * from the UI thread.
 *
 * @Author alex
 */
public interface IDatabase {

    /**
     * Register a name for the given id.
     * @return True if registration succeded, false if it failed.
     */
   boolean register(String id, String name);

    /**
     * @return True if score was recorded correctly, false if it failed.
     */
    boolean recordScore(String playerId, int score, long time, String bus);

    /**
     * @return The best ten scores for all players on all buses.
     */
    List<ScoreEntry> getTopTen();

    /**
     * @return The best ten scores for the given player.
     */
    List<ScoreEntry> getPlayerTopTen(String playerId);

}

Change database interface to return List<>.


package de.danoeh.antennapod.dialog;

import android.content.Context;
import android.view.View;
import android.widget.CheckBox;
import androidx.appcompat.app.AlertDialog;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;

public class StreamingConfirmationDialog {
    private final Context context;
    private final Playable playable;

    public StreamingConfirmationDialog(Context context, Playable playable) {
        this.context = context;
        this.playable = playable;
    }

    public void show() {
        View view = View.inflate(context, R.layout.checkbox_do_not_show_again, null);
        CheckBox checkDoNotShowAgain = view.findViewById(R.id.checkbox_do_not_show_again);

        new AlertDialog.Builder(context)
                .setTitle(R.string.stream_label)
                .setMessage(R.string.confirm_mobile_streaming_notification_message)
                .setView(view)
                .setPositiveButton(R.string.stream_label, (dialog, which) -> {
                    if (checkDoNotShowAgain.isChecked()) {
                        UserPreferences.setAllowMobileStreaming(true);
                    }
                    new PlaybackServiceStarter(context, playable)
                            .callEvenIfRunning(true)
                            .startWhenPrepared(true)
                            .shouldStream(true)
                            .shouldStreamThisTime(true)
                            .start();
                })
                .setNegativeButton(R.string.cancel_label, null)
                .show();
    }
}

package de.danoeh.antennapod.dialog;

import android.content.Context;
import androidx.appcompat.app.AlertDialog;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;

public class StreamingConfirmationDialog {
    private final Context context;
    private final Playable playable;

    public StreamingConfirmationDialog(Context context, Playable playable) {
        this.context = context;
        this.playable = playable;
    }

    public void show() {
        new AlertDialog.Builder(context)
                .setTitle(R.string.stream_label)
                .setMessage(R.string.confirm_mobile_streaming_notification_message)
                .setPositiveButton(R.string.stream_label, (dialog, which) -> stream())
                .setNegativeButton(R.string.confirm_mobile_streaming_button_always, (dialog, which) -> {
                    UserPreferences.setAllowMobileStreaming(true);
                    stream();
                })
                .setNeutralButton(R.string.cancel_label, null)
                .show();
    }

    private void stream() {
        new PlaybackServiceStarter(context, playable)
                .callEvenIfRunning(true)
                .startWhenPrepared(true)
                .shouldStream(true)
                .shouldStreamThisTime(true)
                .start();
    }
}

Make mobile streaming dialog easier to understand


package io.gapi.vgen;

import com.google.api.Authentication;
import com.google.api.AuthenticationRule;
import com.google.api.Service;
import com.google.api.tools.framework.model.Interface;

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

/**
 * Utility class that provides service configuration data from an Interface.
 */
public class ServiceConfig {
  /**
   * Return the service address.
   */
  public String getServiceAddress(Interface service) {
    return service.getModel().getServiceConfig().getName();
  }

  /**
   * Return the service port.
   * TODO(cbao): Read the port from config.
   */
  public Integer getServicePort() {
    return 443;
  }

  /**
   * Return a list of scopes for authentication.
   */
  public Iterable<String> getAuthScopes(Interface service) {
    List<String> result = new ArrayList<>();
    Service config = service.getModel().getServiceConfig();
    Authentication auth = config.getAuthentication();
    for (AuthenticationRule rule : auth.getRulesList()) {
      List<String> scopes = Arrays.asList(rule.getOauth().getCanonicalScopes().split(", "));
      result.addAll(scopes);
    }
    return result;
  }
}

package io.gapi.vgen;

import com.google.api.Authentication;
import com.google.api.AuthenticationRule;
import com.google.api.Service;
import com.google.api.tools.framework.model.Interface;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * Utility class that provides service configuration data from an Interface.
 */
public class ServiceConfig {
  /**
   * Return the service address.
   */
  public String getServiceAddress(Interface service) {
    return service.getModel().getServiceConfig().getName();
  }

  /**
   * Return the service port.
   * TODO(cbao): Read the port from config.
   */
  public Integer getServicePort() {
    return 443;
  }

  /**
   * Return a list of scopes for authentication.
   */
  public Iterable<String> getAuthScopes(Interface service) {
    Set<String> result = new HashSet<>();
    Service config = service.getModel().getServiceConfig();
    Authentication auth = config.getAuthentication();
    for (AuthenticationRule rule : auth.getRulesList()) {
      // Scopes form a union and the union is used for down-scoping, so adding more scopes that
      // are subsets of the others already in the union essentially has no effect.
      // We are doing this for implementation simplicity so we don't have to compute which scopes
      // are subsets of the others.
      String scopesString = rule.getOauth().getCanonicalScopes();
      List<String> scopes = Arrays.asList(scopesString.split(","));
      for (String scope : scopes) {
        result.add(scope.trim());
      }
    }
    return result;
  }
}

Use hashset to avoid duplicate scopes.


package jp.crafterkina.pipes.common;

import lombok.Getter;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.InstanceFactory;
import net.minecraftforge.fml.common.SidedProxy;

import static jp.crafterkina.pipes.common.PipesCore.MOD_ID;

@Mod(modid = MOD_ID)
public enum PipesCore {
    INSTANCE;

    public static final String MOD_ID = "jp.crafterkina.pipes";

    @SuppressWarnings("NullableProblems")
    @SidedProxy(clientSide = "jp.crafterkina.pipes.client.ClientProxy", serverSide = "jp.crafterkina.pipes.server.ServerProxy")
    @Getter
    private static CommonProxy proxy;

    @InstanceFactory
    public static PipesCore getInstance(){
        return INSTANCE;
    }
}

package jp.crafterkina.pipes.common;

import jp.crafterkina.pipes.common.recipe.vanilla.CraftManager;
import lombok.Getter;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.InstanceFactory;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

import static jp.crafterkina.pipes.common.PipesCore.MOD_ID;

@Mod(modid = MOD_ID)
public enum PipesCore {
    INSTANCE;

    public static final String MOD_ID = "jp.crafterkina.pipes";

    @SuppressWarnings("NullableProblems")
    @SidedProxy(clientSide = "jp.crafterkina.pipes.client.ClientProxy", serverSide = "jp.crafterkina.pipes.server.ServerProxy")
    @Getter
    private static CommonProxy proxy;

    @InstanceFactory
    public static PipesCore getInstance(){
        return INSTANCE;
    }

    @EventHandler
    private void preInit(FMLPreInitializationEvent event){
        CraftManager.INSTANCE.register();
    }
}

Call CraftRecipe Register Func on preInit


package au.com.acegi.hashbench.hashers;

import java.nio.ByteBuffer;
import java.util.Map;
import java.util.zip.Adler32;

public class AdlerHasher implements Hasher {
  public static final String JRE_ADLER_32 = "adler320-jre";

  public static final void register(final Map<String, Hasher> hashers) {
    hashers.put(AdlerHasher.JRE_ADLER_32, new AdlerHasher());
  }

  private final Adler32 delegate = new Adler32();

  private AdlerHasher() {}

  @Override
  public long hash(final byte[] in, final int off, final int len) {
    this.delegate.reset();
    this.delegate.update(in, off, len);
    return this.delegate.getValue();
  }

  @Override
  public long hash(final ByteBuffer bb, final int off, final int len) {
    this.delegate.reset();

    if (bb.hasArray()) {
      this.delegate.update(bb.array(), off, len);
      return this.delegate.getValue();
    }

    final ByteBuffer view = bb.duplicate();
    view.position(off);
    view.limit(off + len);
    this.delegate.update(view);
    return this.delegate.getValue();
  }
}

package au.com.acegi.hashbench.hashers;

import java.nio.ByteBuffer;
import java.util.Map;
import java.util.zip.Adler32;

public class AdlerHasher implements Hasher {
  public static final String JRE_ADLER_32 = "adler32-jre";

  public static final void register(final Map<String, Hasher> hashers) {
    hashers.put(AdlerHasher.JRE_ADLER_32, new AdlerHasher());
  }

  private final Adler32 delegate = new Adler32();

  private AdlerHasher() {}

  @Override
  public long hash(final byte[] in, final int off, final int len) {
    this.delegate.reset();
    this.delegate.update(in, off, len);
    return this.delegate.getValue();
  }

  @Override
  public long hash(final ByteBuffer bb, final int off, final int len) {
    this.delegate.reset();

    if (bb.hasArray()) {
      this.delegate.update(bb.array(), off, len);
      return this.delegate.getValue();
    }

    final ByteBuffer view = bb.duplicate();
    view.position(off);
    view.limit(off + len);
    this.delegate.update(view);
    return this.delegate.getValue();
  }
}

Fix typo in Adler32 name.


package com.m4gik.util;

/**
 * A collection of utility methods used throughout this project. This class
 * mainly contains method for implementing the operations of presenting data.
 *
 * @author Michał Szczygieł <michal.szczygiel@wp.pl>
 *
 */
public class Util {

}

package com.m4gik.util;

/**
 * A collection of utility methods used throughout this project. This class
 * mainly contains method for implementing the operations of presenting data.
 *
 * @author Michał Szczygieł <michal.szczygiel@wp.pl>
 *
 */
public class Util {

    /**
     * Base-64 chars.
     */
    private static final String BASE64_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./";

    /**
     * Base-64 charset.
     */
    private static final char[] BASE64_CHARSET = BASE64_CHARS.toCharArray();

    /**
     * Hex charset.
     */
    private static final char[] HEX_DIGITS = "0123456789ABCDEF".toCharArray();

    /**
     * Trivial constructor to enforce Singleton pattern.
     */
    private Util() {
        super();
    }

}

Add base static fields and private constructor.


package io.github.jordao76.quotes;

import java.util.*;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.context.annotation.*;

import io.github.jordao76.quotes.domain.*;

@SpringBootApplication
public class QuoteApplication {

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

  @Bean
  public CommandLineRunner createInitialQuotes(QuoteRepository repo) {
    return (args) -> {
      if (repo.count() < 0) return;
      repo.save(Arrays.asList(
        new Quote(
          "Any sufficiently advanced technology is indistinguishable from magic.",
          "Arthur C. Clarke"),
        new Quote(
          "Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away.",
          "Antoine de Saint-Exupery"),
        new Quote(
          "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.",
          "Charles Babbage")));
    };
  }

}

package io.github.jordao76.quotes;

import java.util.*;

import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.context.annotation.*;

import io.github.jordao76.quotes.domain.*;

@SpringBootApplication
public class QuoteApplication {

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

  @Bean
  public CommandLineRunner createInitialQuotes(QuoteRepository repo) {
    return (args) -> {
      if (repo.count() > 0) return;
      repo.save(Arrays.asList(
        new Quote(
          "Any sufficiently advanced technology is indistinguishable from magic.",
          "Arthur C. Clarke"),
        new Quote(
          "Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away.",
          "Antoine de Saint-Exupery"),
        new Quote(
          "On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.",
          "Charles Babbage")));
    };
  }

}

Fix createInitialQuotes guard clause issue


/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.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://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.webservices.rest.web.v1_0.controller;

import org.openmrs.PersonAddress;
import org.openmrs.module.webservices.rest.web.RestConstants;
import org.openmrs.module.webservices.rest.web.v1_0.resource.PersonAddressResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Controller for REST web service access to {@link PersonAddress}. Supports CRUD on the resource
 * itself.
 */
@Controller
@RequestMapping(value = "/rest/" + RestConstants.VERSION_1 + "/person/{parentUuid}/addresse")
public class PersonAddressController extends BaseSubResourceController<PersonAddressResource> {

}

/**
 * The contents of this file are subject to the OpenMRS Public License
 * Version 1.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://license.openmrs.org
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * Copyright (C) OpenMRS, LLC.  All Rights Reserved.
 */
package org.openmrs.module.webservices.rest.web.v1_0.controller;

import org.openmrs.PersonAddress;
import org.openmrs.module.webservices.rest.web.RestConstants;
import org.openmrs.module.webservices.rest.web.v1_0.resource.PersonAddressResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Controller for REST web service access to {@link PersonAddress}. Supports CRUD on the resource
 * itself.
 */
@Controller
@RequestMapping(value = "/rest/" + RestConstants.VERSION_1 + "/person/{parentUuid}/address")
public class PersonAddressController extends BaseSubResourceController<PersonAddressResource> {

}

Rename subresources (e.g. person/_uuid_/attributes) to be singular, not plural


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

package com.facebook.buck.parser;

import com.facebook.buck.rules.ActionGraph;
import com.facebook.buck.rules.BuildRule;

/**
 * Matches build rules based on their association with actions in the given action graph.
 * @param <T> The interface all rules matched by the predicate implement.
 */
public interface AssociatedRulePredicate {
  public boolean isMatch(
      BuildRule buildRule,
      ActionGraph actionGraph);
}

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

package com.facebook.buck.parser;

import com.facebook.buck.rules.ActionGraph;
import com.facebook.buck.rules.BuildRule;

/**
 * Matches build rules based on their association with actions in the given action graph.
 */
public interface AssociatedRulePredicate {
  public boolean isMatch(
      BuildRule buildRule,
      ActionGraph actionGraph);
}

Remove comment about generic param that does not seem to apply.


/**
 * Created by andybb on 18.03.15.
 */

import org.junit.Test;
import static org.junit.Assert.*;

import com.mygdx.game.controllers.GameNetworkController;
import com.mygdx.game.controllers.PlayerNetworkController;

import java.util.concurrent.TimeUnit;

public class NetworkTest {
    @Test
    public void testGameInitialization() throws InterruptedException {
        GameNetworkController game1 = new GameNetworkController();
        GameNetworkController game2 = new GameNetworkController();

        game1.startGame("andybb");
        assertEquals("Username for player 1 given and in model should be equal ", "andybb", game1.getPlayerController().getPlayer().getUsername());

        TimeUnit.SECONDS.sleep(1);
        game2.startGame("mats");
        assertEquals("Username for player 2 given and in model should be equal ", "mats", game2.getPlayerController().getPlayer().getUsername());

    }

    @Test
    public void testFireOperation() throws InterruptedException{

    }
}

/**
 * Created by andybb on 18.03.15.
 */

import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.*;

import com.mygdx.game.controllers.GameNetworkController;

import java.util.concurrent.TimeUnit;

public class NetworkTest {

    private GameNetworkController game1;
    private GameNetworkController game2;

    @Before
    public void setup() {
        game1 = new GameNetworkController();
        game2 = new GameNetworkController();
    }

    @Test
    public void testGameInitialization() throws InterruptedException {

        game1.startGame("andybb");
        assertEquals("Username for player 1 given and in model should be equal ", "andybb", game1.getPlayerController().getPlayer().getUsername());

        TimeUnit.SECONDS.sleep(1);
        game2.startGame("mats");
        assertEquals("Username for player 2 given and in model should be equal ", "mats", game2.getPlayerController().getPlayer().getUsername());

        TimeUnit.SECONDS.sleep(11);
        assertEquals("The opponent of player 1 should player 2", "mats", game1.getPlayerController().getOpponent().getUsername());
        assertEquals("The opponent of player 2 should player 1", "andybb", game2.getPlayerController().getOpponent().getUsername());

    }

    @Test
    public void testFireOperation() throws InterruptedException{

    }
}

Add test to check that the opponent is set correctly


package seedu.task.logic.commands;

import java.util.Optional;

import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.control.Dialog;
import seedu.task.model.TaskManager;

/**
 * Clears the task manager.
 */
public class ClearCommand extends Command {

    public static final String COMMAND_WORD = "clear";
    public static final String MESSAGE_SUCCESS = "Task Manager has been cleared!";
    public static final String MESSAGE_FAILURE = "Task Manager has not been cleared";

    public ClearCommand() {}

    @Override
    public CommandResult execute() {
        assert model != null;
        Alert alert = new Alert(AlertType.INFORMATION);
        alert.setTitle("Clear all tasks");
        alert.setHeaderText("Are you sure you want to clear ALL TASKS in the task manager?");
        alert.setContentText("NOTE: This cannot be undone! ");

        Optional<ButtonType> result = alert.showAndWait();
        if (result.get() == ButtonType.OK){
            model.resetData(TaskManager.getEmptyTaskManager());
            return new CommandResult(MESSAGE_SUCCESS);
        } else {
            return new CommandResult(MESSAGE_FAILURE);
        }

    }
}

package seedu.task.logic.commands;

import java.util.Optional;

import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import seedu.task.model.TaskManager;

/**
 * Clears the task manager.
 */
public class ClearCommand extends Command {

    public static final String COMMAND_WORD = "clear";
    public static final String MESSAGE_SUCCESS = "Task Manager has been cleared!";
    public static final String MESSAGE_FAILURE = "Task Manager has not been cleared";
    public static final String MESSAGE_NO_TASKS = "0 tasks listed!";

    public ClearCommand() {
    }

    @Override
    public CommandResult execute() {
        assert model != null;
        if (model != null) {
            Alert alert = new Alert(AlertType.INFORMATION);
            alert.setTitle("Clear all tasks");
            alert.setHeaderText("Are you sure you want to clear ALL TASKS in the task manager?");
            Optional<ButtonType> result = alert.showAndWait();
            if (result.get() == ButtonType.OK) {
                model.resetData(TaskManager.getEmptyTaskManager());
                return new CommandResult(MESSAGE_SUCCESS);
            } else {
                return new CommandResult(MESSAGE_FAILURE);
            }
        }
        else return new CommandResult(MESSAGE_NO_TASKS);

    }
}

Allow undo command to work after the clear command


package info.u_team.u_team_test.init;

import info.u_team.u_team_core.containertype.UContainerType;
import info.u_team.u_team_core.util.registry.BaseRegistryUtil;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.container.*;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;

@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.MOD)
public class TestContainers {

	public static final ContainerType<BasicTileEntityContainer> BASIC = new UContainerType<>("basic", BasicTileEntityContainer::new);

	public static final ContainerType<BasicEnergyCreatorContainer> BASIC_ENERGY_CREATOR = new UContainerType<>("energy_creator", BasicEnergyCreatorContainer::new);

	public static final ContainerType<BasicFluidInventoryContainer> BASIC_FLUID_INVENTORY = new UContainerType<>("fluid_inventory", BasicFluidInventoryContainer::new);

	@SubscribeEvent
	public static void register(Register<ContainerType<?>> event) {
		BaseRegistryUtil.getAllGenericRegistryEntriesAndApplyNames(TestMod.MODID, ContainerType.class).forEach(event.getRegistry()::register);
	}
}

package info.u_team.u_team_test.init;

import info.u_team.u_team_core.containertype.UContainerType;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.container.*;
import net.minecraft.inventory.container.ContainerType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.*;

@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.MOD)
public class TestContainers {

	public static final DeferredRegister<ContainerType<?>> CONTAINER_TYPES = DeferredRegister.create(ForgeRegistries.CONTAINERS, TestMod.MODID);

	public static final ContainerType<BasicTileEntityContainer> BASIC = new UContainerType<>("basic", BasicTileEntityContainer::new);

	public static final ContainerType<BasicEnergyCreatorContainer> BASIC_ENERGY_CREATOR = new UContainerType<>("energy_creator", BasicEnergyCreatorContainer::new);

	public static final ContainerType<BasicFluidInventoryContainer> BASIC_FLUID_INVENTORY = new UContainerType<>("fluid_inventory", BasicFluidInventoryContainer::new);

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

Add some methods to the container for migration


package com.decker.Essentials.Category;

public class CategoryChild
{
    public CategoryChild(String iconName,String title,String url)
    {
	this.iconame=iconName;
	this.title=title;
	this.url=url;
    }

    public String iconame;
    public String title;
    public String url;
}

package com.decker.Essentials.Category;

public class CategoryChild
{
    public CategoryChild(String iconName,String title,String url)
    {
	this.IconName=iconName;
	this.Title=title;
	this.Url=url;
    }

    public String IconName;
    public String Title;
    public String Url;
}

Revert "Chage vairable to low case for adapt front side js"


package uk.ac.ebi.quickgo.rest.search.query;

/**
 * Represents the simplest of {@link QuickGOQuery} objects, containing just the field and values to query against.
 */
public class AllQuery extends QuickGOQuery {

    public AllQuery() {  }

    @Override public <T> T accept(QueryVisitor<T> visitor) {
        return visitor.visit(this);
    }

}

package uk.ac.ebi.quickgo.rest.search.query;

/**
 * Represents the simplest of {@link QuickGOQuery} objects, containing just the field and values to query against.
 */
class AllQuery extends QuickGOQuery {
    AllQuery() { }

    @Override public <T> T accept(QueryVisitor<T> visitor) {
        return visitor.visit(this);
    }

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

Add toStringMethod for easy read.


/*
 * Copyright 2007 The Kuali Foundation
 *
 * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.rice.kim.dto;

/**
 * This is the Data Transfer Object (DTO) that is used for our service layer.
 *
 * This class represents a Principal entity in the system.
 *
 * @author Kuali Rice Team (kuali-rice@googlegroups.com)
 */
public class PrincipalDTO extends AbstractEntityBaseDTO implements java.security.Principal {
    private static final long serialVersionUID = -7894319178912177679L;

    private String name;

    /**
     * This overridden method ...
     *
     * @see java.security.Principal#getName()
     */
    @Override
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
}

/*
 * Copyright 2007 The Kuali Foundation
 *
 * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.kuali.rice.kim.dto;

/**
 * This is the Data Transfer Object (DTO) that is used for our service layer.
 *
 * This class represents a Principal entity in the system.
 *
 * @author Kuali Rice Team (kuali-rice@googlegroups.com)
 */
public class PrincipalDTO extends AbstractEntityBaseDTO implements java.security.Principal {
    private static final long serialVersionUID = -7894319178912177679L;

    private String name;

    /**
     *
     * @see java.security.Principal#getName()
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
}

Synchronize DTOs with BOs. @Override caused problems


package com.yahoo.vespa.hosted.controller.api.integration.stubs;

public class MockUserManagement {

}

package com.yahoo.vespa.hosted.controller.api.integration.stubs;

import com.yahoo.vespa.hosted.controller.api.integration.user.UserId;
import com.yahoo.vespa.hosted.controller.api.integration.user.UserManagement;
import com.yahoo.vespa.hosted.controller.api.role.Role;

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author jonmv
 */
public class MockUserManagement implements UserManagement {

    private final Map<Role, Set<UserId>> memberships = new HashMap<>();

    @Override
    public void createRole(Role role) {
        if (memberships.containsKey(role))
            throw new IllegalArgumentException(role + " already exists.");

        memberships.put(role, new HashSet<>());
    }

    @Override
    public void deleteRole(Role role) {
        memberships.remove(role);
    }

    @Override
    public void addUsers(Role role, Collection<UserId> users) {
        memberships.get(role).addAll(users);
    }

    @Override
    public void removeUsers(Role role, Collection<UserId> users) {
        memberships.get(role).removeAll(users);
    }

    @Override
    public List<UserId> listUsers(Role role) {
        return List.copyOf(memberships.get(role));
    }

}

Add mock implementation of UserManagement


/**
*    Copyright 2011,2012 Big Switch Networks, Inc.
*    Originally created by David Erickson, Stanford University
*
*    Licensed under the Apache License, Version 2.0 (the "License"); you may
*    not use this file except in compliance with the License. You may obtain
*    a copy of the License at
*
*         http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
*    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*    License for the specific language governing permissions and limitations
*    under the License.
**/

package net.floodlightcontroller.core.web.serializers;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.projectfloodlight.openflow.util.HexString;

/**
 * Serialize a DPID as colon-separated hexadecimal
 */
public class DPIDSerializer extends JsonSerializer<Long> {

    @Override
    public void serialize(Long dpid, JsonGenerator jGen,
                          SerializerProvider serializer)
                                  throws IOException, JsonProcessingException {
        jGen.writeString(HexString.toHexString(dpid, 8));
    }

}

/**
*    Copyright 2011,2012 Big Switch Networks, Inc.
*    Originally created by David Erickson, Stanford University
*
*    Licensed under the Apache License, Version 2.0 (the "License"); you may
*    not use this file except in compliance with the License. You may obtain
*    a copy of the License at
*
*         http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
*    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*    License for the specific language governing permissions and limitations
*    under the License.
**/

package net.floodlightcontroller.core.web.serializers;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import org.projectfloodlight.openflow.util.HexString;
import org.projectfloodlight.openflow.types.DatapathId;
/**
 * Serialize a DPID as colon-separated hexadecimal
 */
public class DPIDSerializer extends JsonSerializer<DatapathId> {

    @Override
    public void serialize(DatapathId dpid, JsonGenerator jGen,
                          SerializerProvider serializer)
                                  throws IOException, JsonProcessingException {
        jGen.writeString(HexString.toHexString(dpid.getLong(), 8));
    }

}

Modify the Serializer for DPID (Long -> DatapathId )


package com.uwetrottmann.shopr;

import android.app.Application;

import com.uwetrottmann.shopr.algorithm.AdaptiveSelection;
import com.uwetrottmann.shopr.algorithm.Utils;

public class ShoprApp extends Application {

    private static final int MAX_RECOMMENDATIONS = 5;

    @Override
    public void onCreate() {
        super.onCreate();

        AdaptiveSelection.get().setInitialCaseBase(Utils.getLimitedCaseBase());
        AdaptiveSelection.get().setMaxRecommendations(MAX_RECOMMENDATIONS);
    }

}

package com.uwetrottmann.shopr;

import android.app.Application;

import com.uwetrottmann.shopr.algorithm.AdaptiveSelection;
import com.uwetrottmann.shopr.algorithm.Utils;

public class ShoprApp extends Application {

    private static final int MAX_RECOMMENDATIONS = 8;

    @Override
    public void onCreate() {
        super.onCreate();

        AdaptiveSelection.get().setInitialCaseBase(Utils.getLimitedCaseBase());
        AdaptiveSelection.get().setMaxRecommendations(MAX_RECOMMENDATIONS);
    }

}

Increase number of recs to 8 for now.l


package com.zakgof.db.velvet.impl.entity;

import java.util.Collection;
import java.util.List;
import java.util.Locale;

import com.zakgof.db.velvet.IVelvet.IStoreIndexDef;
import com.zakgof.db.velvet.annotation.Kind;
import com.zakgof.db.velvet.properties.IProperty;
import com.zakgof.db.velvet.properties.IPropertyAccessor;

public class AnnoEntityDef<K, V> extends EntityDef<K, V> implements IPropertyAccessor<K, V> {

    private AnnoKeyProvider<K, V> annoKeyProvider;

    public AnnoEntityDef(Class<V> valueClass, String kind, AnnoKeyProvider<K, V> annoKeyProvider, List<IStoreIndexDef<?, V>> indexes) {
        super(annoKeyProvider.getKeyClass(), valueClass, kind, annoKeyProvider, indexes);
        this.annoKeyProvider = annoKeyProvider;
    }

    public static String kindOf(Class<?> clazz) {
        Kind annotation = clazz.getAnnotation(Kind.class);
        if (annotation != null)
            return annotation.value();
        String kind = clazz.getSimpleName().toLowerCase(Locale.ENGLISH);
        return kind;
    }

    @Override
    public Collection<String> getProperties() {
        return annoKeyProvider.getProperties();
    }

    @Override
    public IProperty<?, V> get(String property) {
        return annoKeyProvider.get(property);
    }

    @Override
    public IProperty<K, V> getKey() {
        return annoKeyProvider.getKey();
    }

}

package com.zakgof.db.velvet.impl.entity;

import java.util.Collection;
import java.util.List;
import java.util.Locale;

import com.zakgof.db.velvet.IVelvet.IStoreIndexDef;
import com.zakgof.db.velvet.annotation.Kind;
import com.zakgof.db.velvet.properties.IProperty;
import com.zakgof.db.velvet.properties.IPropertyAccessor;

public class AnnoEntityDef<K, V> extends EntityDef<K, V> implements IPropertyAccessor<K, V> {

    private AnnoKeyProvider<K, V> annoKeyProvider;

    public AnnoEntityDef(Class<V> valueClass, String kind, AnnoKeyProvider<K, V> annoKeyProvider, List<IStoreIndexDef<?, V>> indexes) {
        super(annoKeyProvider.getKeyClass(), valueClass, kind, annoKeyProvider, indexes);
        this.annoKeyProvider = annoKeyProvider;
    }

    public static String kindOf(Class<?> clazz) {
        Kind annotation = clazz.getAnnotation(Kind.class);
        if (annotation != null)
            return annotation.value();
        String kind = clazz.getName().toLowerCase(Locale.ENGLISH);
        return kind;
    }

    @Override
    public Collection<String> getProperties() {
        return annoKeyProvider.getProperties();
    }

    @Override
    public IProperty<?, V> get(String property) {
        return annoKeyProvider.get(property);
    }

    @Override
    public IProperty<K, V> getKey() {
        return annoKeyProvider.getKey();
    }

}

Use full class name as a kind (fix issue with proguard)


package uk.ac.ebi.atlas.controllers;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@Scope("request")
public class RequestDiagnosticsController extends HtmlExceptionHandlingController {
    @RequestMapping(value = "/request-diagnostics", produces = "text/html;charset=UTF-8")
    public String showGenePage() {
        return "request-diagnostics";
    }
}

package uk.ac.ebi.atlas.controllers;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@Scope("request")
public class RequestDiagnosticsController extends HtmlExceptionHandlingController {
    @RequestMapping(value = "/request-diagnostics", produces = "text/html;charset=UTF-8")
    public String showRequestDiagnosticsPage() {
        return "request-diagnostics";
    }
}

Change method name to make sense (this was a bad copy-paste job!)


package com.artirigo.kontaktio;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

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

/**
 * Range and Monitor Kontakt.io beacons
 */
public class KontaktPackage implements ReactPackage {

    @Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

    @Override
    public List<NativeModule> createNativeModules(
            ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new KontaktModule(reactContext));

        return modules;
    }

}

package com.artirigo.kontaktio;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

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

/**
 * Range and Monitor Kontakt.io beacons
 */
public class KontaktPackage implements ReactPackage {

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

    @Override
    public List<NativeModule> createNativeModules(
            ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new KontaktModule(reactContext));

        return modules;
    }

}

Remove createJSModules for RN 0.47.


/*
 * Copyright 2017. nekocode (nekocode.cn@gmail.com)
 *
 * 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 cn.nekocode.resinspector;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.view.View;

/**
 * @author nekocode (nekocode.cn@gmail.com)
 */
public class ResourceInspector {

    @NonNull
    public static Context wrap(@NonNull Context base) {
        return base;
    }

    @RestrictTo(RestrictTo.Scope.LIBRARY)
    public static boolean isViewBeingInspected(@Nullable View view) {
        return false;
    }

    @RestrictTo(RestrictTo.Scope.LIBRARY)
    @Nullable
    public static String getViewLayoutResName(@Nullable View view) {
        return null;
    }
}

/*
 * Copyright 2017. nekocode (nekocode.cn@gmail.com)
 *
 * 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 cn.nekocode.resinspector;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import android.view.View;

/**
 * @author nekocode (nekocode.cn@gmail.com)
 */
public class ResourceInspector {

    @NonNull
    public static Context wrap(@NonNull Context base) {
        return base;
    }

    @RestrictTo(RestrictTo.Scope.LIBRARY)
    public static boolean isViewBeingInspected(@Nullable View view) {
        return false;
    }

    @RestrictTo(RestrictTo.Scope.LIBRARY)
    @Nullable
    public static String getViewLayoutResName(@Nullable View view) {
        return null;
    }

    public static void initialize(@NonNull final Context context) {

    }
}

Add missing method to no-op artifact


/*
 *
 *  Copyright 2012-2014 Eurocommercial Properties NV
 *
 *
 *  Licensed under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.estatio.dom.asset;

import org.estatio.dom.TitledEnum;
import org.estatio.dom.utils.StringUtils;

public enum UnitType implements TitledEnum {

    BOUTIQUE,
    CINEMA,
    DEHOR,
    EXTERNAL,
    HYPERMARKET,
    MEDIUM,
    OFFICE,
    SERVICES,
    STORAGE,
    TECHNICAL_ROOM,
    VIRTUAL,
    LAND,
    PARKING,
    ELECTRICAL_SUBSTATION;

    public String title() {
        return StringUtils.enumTitle(this.name());
    }

}

/*
 *
 *  Copyright 2012-2014 Eurocommercial Properties NV
 *
 *
 *  Licensed under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */
package org.estatio.dom.asset;

import org.estatio.dom.TitledEnum;
import org.estatio.dom.utils.StringUtils;

public enum UnitType implements TitledEnum {

    BOUTIQUE,
    CINEMA,
    DEHOR,
    EXTERNAL,
    HYPERMARKET,
    MEDIUM,
    OFFICE,
    SERVICES,
    STORAGE,
    TECHNICAL_ROOM,
    COMMON_AREA,
    VIRTUAL,
    LAND,
    PARKING,
    ELECTRICAL_SUBSTATION;

    public String title() {
        return StringUtils.enumTitle(this.name());
    }

}

Add common area to unit type


package org.spoofax.interpreter.library.ssl;

import io.usethesource.capsule.BinaryRelation;

import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.library.AbstractPrimitive;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoTerm;

public class SSL_immutable_relation_insert extends AbstractPrimitive {

    protected SSL_immutable_relation_insert() {
        super("SSL_immutable_relation_put", 0, 2);
    }

    @Override
    public boolean call(IContext env, Strategy[] sargs, IStrategoTerm[] targs) {
        if(!(env.current() instanceof StrategoImmutableRelation)) {
            return false;
        }

        final StrategoImmutableRelation map = (StrategoImmutableRelation) env.current();
        final IStrategoTerm key = targs[0];
        final IStrategoTerm value = targs[1];

        env.setCurrent(new StrategoImmutableRelation(
            (BinaryRelation.Immutable<IStrategoTerm, IStrategoTerm>) map.backingRelation.__insert(key, value)));
        return true;
    }

}

package org.spoofax.interpreter.library.ssl;

import io.usethesource.capsule.BinaryRelation;

import org.spoofax.interpreter.core.IContext;
import org.spoofax.interpreter.library.AbstractPrimitive;
import org.spoofax.interpreter.stratego.Strategy;
import org.spoofax.interpreter.terms.IStrategoTerm;

public class SSL_immutable_relation_insert extends AbstractPrimitive {

    protected SSL_immutable_relation_insert() {
        super("SSL_immutable_relation_insert", 0, 2);
    }

    @Override
    public boolean call(IContext env, Strategy[] sargs, IStrategoTerm[] targs) {
        if(!(env.current() instanceof StrategoImmutableRelation)) {
            return false;
        }

        final StrategoImmutableRelation map = (StrategoImmutableRelation) env.current();
        final IStrategoTerm key = targs[0];
        final IStrategoTerm value = targs[1];

        env.setCurrent(new StrategoImmutableRelation(
            (BinaryRelation.Immutable<IStrategoTerm, IStrategoTerm>) map.backingRelation.__insert(key, value)));
        return true;
    }

}

Fix bug in primitive name string put -> insert


package codechicken.enderstorage.plugin.jei;

import codechicken.enderstorage.recipe.RecipeBase;
import mezz.jei.api.*;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by covers1624 on 8/07/2017.
 */
@JEIPlugin//TODO FIXME TODO, Recipe handler for recoloring.
public class EnderStorageJEIPlugin implements IModPlugin {

    public static ICraftingGridHelper gridHelper;

    @Override
    public void register(IModRegistry registry) {
        IJeiHelpers helpers = registry.getJeiHelpers();
        IGuiHelper guiHelpers = helpers.getGuiHelper();

        gridHelper = guiHelpers.createCraftingGridHelper(1, 0);
        Set<Object> recipes = new HashSet<>();
        recipes.add(new ESCraftingRecipeWrapper((RecipeBase) ForgeRegistries.RECIPES.getValue(new ResourceLocation("enderstorage:ender_chest"))));
        recipes.add(new ESCraftingRecipeWrapper((RecipeBase) ForgeRegistries.RECIPES.getValue(new ResourceLocation("enderstorage:ender_tank"))));
        recipes.add(new ESCraftingRecipeWrapper((RecipeBase) ForgeRegistries.RECIPES.getValue(new ResourceLocation("enderstorage:ender_pouch"))));
        registry.addRecipes(recipes, VanillaRecipeCategoryUid.CRAFTING);
    }

}

package codechicken.enderstorage.plugin.jei;

import codechicken.enderstorage.recipe.RecipeBase;
import com.google.common.collect.Sets;
import mezz.jei.api.*;
import mezz.jei.api.gui.ICraftingGridHelper;
import mezz.jei.api.recipe.VanillaRecipeCategoryUid;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.registry.ForgeRegistries;

import java.util.HashSet;
import java.util.Set;

/**
 * Created by covers1624 on 8/07/2017.
 */
@JEIPlugin//TODO FIXME TODO, Recipe handler for recoloring.
public class EnderStorageJEIPlugin implements IModPlugin {

    public static ICraftingGridHelper gridHelper;

    @Override
    public void register(IModRegistry registry) {
        IJeiHelpers helpers = registry.getJeiHelpers();
        IGuiHelper guiHelpers = helpers.getGuiHelper();

        gridHelper = guiHelpers.createCraftingGridHelper(1, 0);
        registry.handleRecipes(RecipeBase.class, ESCraftingRecipeWrapper::new, VanillaRecipeCategoryUid.CRAFTING);
    }

}

Handle some JEI stuff differently, still broken..


/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 *
 */
package com.xpn.xwiki.util;

import junit.framework.TestCase;

/**
 * Unit tests for {@link com.xpn.xwiki.util.Util}.
 *
 * @version $Id: $
 */
public class UtilTest extends TestCase
{
    public void testConvertToAlphaNumeric()
    {
        assertEquals("Search", Util.convertToAlphaNumeric("Search"));
        assertEquals("Search", Util.convertToAlphaNumeric("S.earch"));
        assertEquals("e", Util.convertToAlphaNumeric("$%#^()"));
    }
}

/*
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 *
 */
package com.xpn.xwiki.util;

import junit.framework.TestCase;

/**
 * Unit tests for {@link com.xpn.xwiki.util.Util}.
 *
 * @version $Id: $
 */
public class UtilTest extends TestCase
{
    public void testConvertToAlphaNumeric()
    {
        assertEquals("Search", Util.convertToAlphaNumeric("Search"));
        assertEquals("Search", Util.convertToAlphaNumeric("S.earch"));
        assertEquals("e", Util.convertToAlphaNumeric("e$%#^()"));
    }
}

Add Utility API to remove all non alpha numeric chartacters from some text


package org.jboss.seam.faces.environment;

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

/**
 *

 * A producer which retrieves the Project Stage for the current
 * request of the JavaServer Faces application, storing the result as a
 * dependent-scoped bean instance.
 *

 *
 *

 * This producer is named, allowing the Project Stage to be accessed via EL:
 *

 *
 *

 * #{projectStage}
 *

 *
 * @author Brian Leathem
 */
public class ProjectStageProducer
{
   @Named
   @Produces
   public String getProjectStage(final FacesContext context)
   {
      return context.getExternalContext().getInitParameter("javax.faces.PROJECT_STAGE");
   }
}

package org.jboss.seam.faces.environment;

import javax.enterprise.inject.Produces;
import javax.faces.application.ProjectStage;
import javax.faces.context.FacesContext;
import javax.inject.Named;

/**
 *

 * A producer which retrieves the ProjectStage for the current request
 * of the JavaServer Faces application, storing the result as a
 * ApplicationScoped bean instance.
 *

 *
 *

 * This producer is named, allowing the Project Stage to be accessed via EL:
 *

 *
 *

 * #{projectStage}
 *

 *
 * @author Brian Leathem
 */
public class ProjectStageProducer
{
   @Named
   @Produces
   public ProjectStage getProjectStage(final FacesContext context)
   {
      return context.getApplication().getProjectStage();
   }
}

Make ProjectStage available from EL - using Enum


package valandur.webapi.json.serializer.entity;

import org.spongepowered.api.data.manipulator.mutable.entity.TameableData;
import valandur.webapi.WebAPI;
import valandur.webapi.api.cache.ICacheService;
import valandur.webapi.api.cache.entity.ICachedEntity;
import valandur.webapi.api.json.WebAPIBaseSerializer;

import java.io.IOException;
import java.util.Optional;
import java.util.UUID;

public class TameableDataSerializer extends WebAPIBaseSerializer<TameableData> {
    @Override
    public void serialize(TameableData value) throws IOException {
        writeStartObject();
        writeField("isTamed", value.owner().exists());

        UUID uuid = value.owner().getDirect().orElse(Optional.empty()).orElse(null);
        if (uuid != null) {
            ICacheService srv = WebAPI.getCacheService();
            ICachedEntity owner = srv.getPlayer(uuid).orElse(null);
            if (owner == null) owner = srv.getEntity(uuid).orElse(null);

            writeField("owner", owner);
        }
        writeEndObject();
    }
}

package valandur.webapi.json.serializer.entity;

import org.spongepowered.api.data.manipulator.mutable.entity.TameableData;
import valandur.webapi.WebAPI;
import valandur.webapi.api.cache.ICacheService;
import valandur.webapi.api.cache.player.ICachedPlayer;
import valandur.webapi.api.json.WebAPIBaseSerializer;

import java.io.IOException;
import java.util.Optional;
import java.util.UUID;

public class TameableDataSerializer extends WebAPIBaseSerializer<TameableData> {
    @Override
    public void serialize(TameableData value) throws IOException {
        writeStartObject();
        writeField("isTamed", value.owner().exists());

        UUID uuid = value.owner().getDirect().orElse(Optional.empty()).orElse(null);
        if (uuid != null) {
            ICacheService srv = WebAPI.getCacheService();
            ICachedPlayer owner = srv.getPlayer(uuid).orElse(null);
            writeField("owner", owner);
        }
        writeEndObject();
    }
}

Fix tameable data not working with new cached player object


package org.intermine.webservice.server.user;

import java.util.Arrays;
import java.util.Map;

import org.intermine.api.InterMineAPI;
import org.intermine.api.profile.Profile;
import org.intermine.api.profile.ProfileManager;
import org.intermine.webservice.server.core.JSONService;
import org.intermine.webservice.server.exceptions.ServiceForbiddenException;
import org.intermine.webservice.server.output.JSONFormatter;

public class TokenService extends JSONService {

    private static final String DENIAL_MSG = "All token requests must be authenticated.";

    public TokenService(InterMineAPI im) {
        super(im);
    }

    @Override
    protected void execute() throws Exception {
        final ProfileManager pm = im.getProfileManager();
        Profile profile = getPermission().getProfile();

        String token = pm.generate24hrKey(profile);
        output.addResultItem(Arrays.asList("\"" + token + "\""));
    }

    @Override
    protected void validateState() {
        if (!isAuthenticated()) {
            throw new ServiceForbiddenException(DENIAL_MSG);
        }
    }

    @Override
    protected Map<String, Object> getHeaderAttributes() {
        Map<String, Object> retval = super.getHeaderAttributes();
        retval.put(JSONFormatter.KEY_INTRO, "\"token\":");
        return retval;
    }

}

package org.intermine.webservice.server.user;

import java.util.Arrays;

import org.intermine.api.InterMineAPI;
import org.intermine.api.profile.Profile;
import org.intermine.api.profile.ProfileManager;
import org.intermine.webservice.server.core.JSONService;
import org.intermine.webservice.server.exceptions.BadRequestException;
import org.intermine.webservice.server.exceptions.ServiceForbiddenException;

public class TokenService extends JSONService {

    private static final String DENIAL_MSG = "All token requests must be authenticated.";

    public TokenService(InterMineAPI im) {
        super(im);
    }

    @Override
    protected void execute() throws Exception {
        final ProfileManager pm = im.getProfileManager();
        Profile profile = getPermission().getProfile();
        String tokenType = getOptionalParameter("type", "day").toLowerCase();
        String token = null;
        if ("day".equals(tokenType)) {
            token = pm.generate24hrKey(profile);
        } else if ("perma".equals(tokenType)) {
            token = pm.generateReadOnlyAccessToken(profile);
        } else {
            throw new BadRequestException("Unknown token type: " + tokenType);
        }
        addResultValue(token, false);
    }

    @Override
    protected void validateState() {
        if (!isAuthenticated()) {
            throw new ServiceForbiddenException(DENIAL_MSG);
        }
    }

    @Override
    protected String getResultsKey() {
        return "token";
    }
}

Support more than one type of token.


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

package com.google.template.soy.internal.exemptions;

import com.google.common.collect.ImmutableSet;

/** A list of all allowed duplicate namespaces and a simple predicate for querying it. */
public final class NamespaceExemptions {

  public static boolean isKnownDuplicateNamespace(String namespace) {
    return ALLOWED_DUPLICATE_NAMESPACES.contains(namespace);
  }

  // TODO(b/180904763): burn this down!
  private static final ImmutableSet<String> ALLOWED_DUPLICATE_NAMESPACES =
      ImmutableSet.of(
          );

  private NamespaceExemptions() {}
}

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

package com.google.template.soy.internal.exemptions;

import com.google.common.collect.ImmutableSet;

/** A list of all allowed duplicate namespaces and a simple predicate for querying it. */
public final class NamespaceExemptions {

  public static boolean isKnownDuplicateNamespace(String namespace) {
    return ALLOWED_DUPLICATE_NAMESPACES.contains(namespace);
  }

  private static final ImmutableSet<String> ALLOWED_DUPLICATE_NAMESPACES =
      ImmutableSet.of(
          );

  private NamespaceExemptions() {}
}

Delete testonly namespaces from the duplicate namespaces exemption list


package net.jloop.rejoice;

import java.util.ArrayList;
import java.util.Iterator;

public class Stack implements Iterable<Atom> {

    private final ArrayList<Atom> atoms;

    public Stack() {
        this.atoms = new ArrayList<>();
    }

    public Stack(ArrayList<Atom> atoms) {
        this.atoms = atoms;
    }

    private int lastIndex() {
        return atoms.size() - 1;
    }

    public <V extends Atom> V peek(Class<V> type) {
        Atom atom = atoms.get(lastIndex());
        if (!type.isInstance(atom)) {
            throw new RuntimeException("Expecting type " + type + " but found " + atom.getClass());
        } else {
            return type.cast(atom);
        }
    }

    public <V extends Atom> V consume(Class<V> type) {
        V atom = peek(type);
        this.pop();
        return atom;
    }

    public Stack push(Atom atom) {
        atoms.add(atom);
        return this;
    }

    public Stack pushAll(Stack stack) {
        for (Atom atom : stack) {
            atoms.add(atom);
        }
        return this;
    }

    public Stack pop() {
        atoms.remove(lastIndex());
        return this;
    }

    public void print() {
        for (Atom atom : atoms) {
            System.out.println(atom.print());
        }
    }

    public Stack copy() {
        // This is a shallow copy
        return new Stack(new ArrayList<>(atoms));
    }

    @Override
    public Iterator<Atom> iterator() {
        return atoms.iterator();
    }
}

package net.jloop.rejoice;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;

public class Stack implements Iterable<Atom> {

    private final ArrayList<Atom> atoms;

    public Stack() {
        this.atoms = new ArrayList<>();
    }

    public Stack(ArrayList<Atom> atoms) {
        this.atoms = atoms;
    }

    private int lastIndex() {
        return atoms.size() - 1;
    }

    public <V extends Atom> V peek(Class<V> type) {
        Atom atom = atoms.get(lastIndex());
        if (!type.isInstance(atom)) {
            throw new RuntimeException("Expecting type " + type + " but found " + atom.getClass());
        } else {
            return type.cast(atom);
        }
    }

    public <V extends Atom> V consume(Class<V> type) {
        V atom = peek(type);
        this.pop();
        return atom;
    }

    public Stack push(Atom atom) {
        atoms.add(atom);
        return this;
    }

    public Stack pushAll(Stack stack) {
        for (Atom atom : stack) {
            atoms.add(atom);
        }
        return this;
    }

    public Stack pop() {
        atoms.remove(lastIndex());
        return this;
    }

    public void print() {
        ArrayList<Atom> list = new ArrayList<>(atoms);
        Collections.reverse(list);
        for (Atom atom : list) {
            System.out.println(atom.print());
        }
    }

    public Stack copy() {
        // This is a shallow copy
        return new Stack(new ArrayList<>(atoms));
    }

    @Override
    public Iterator<Atom> iterator() {
        return atoms.iterator();
    }
}

Print the stack with the latest atom at the top


/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package com.codenvy.ide.editor.codemirror.client.jso;

import com.google.gwt.core.client.JavaScriptObject;

/** Description of a codemirror mode. */
public class CMModeOverlay extends JavaScriptObject {

    /** JSO mandated protected constructor. */
    protected CMModeOverlay() {
    }

}

/*******************************************************************************
 * Copyright (c) 2014 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package com.codenvy.ide.editor.codemirror.client.jso;

import com.google.gwt.core.client.JavaScriptObject;

/** Description of a codemirror mode. */
public class CMModeOverlay extends JavaScriptObject {

    /** JSO mandated protected constructor. */
    protected CMModeOverlay() {
    }

    /* function startState(), returns a state instance - optional */

    /* function token(stream, state, returns string=classname|null - must consume at lerast one char from stream */

    /* function copyState(state), return state - optional */

    /* function indent(state, textAfter), returns int (number of spaces) - optional */

    /* function lineComment, blockComment, blockCommentStart, blockCommentEnd, blockCommentLead, return strings - optional */

    /* string property electricChars - optional */

    /* regexp property electricInput - optional */
}

Document future methods addition on mode objects


package cgeo.geocaching.utils;

import cgeo.geocaching.BuildConfig;

public class BranchDetectionHelper {

    // should contain the version name of the last feature release
    public static final String FEATURE_VERSION_NAME = "2022.08.08-RC";

    // should contain version names of active bugfix releases since last feature release, oldest first
    // empty the part within curly brackets when creating a new release branch from master
    public static final String[] BUGFIX_VERSION_NAME = new String[]{ "" };

    private BranchDetectionHelper() {
        // utility class
    }

    /**
     * @return true, if BUILD_TYPE is not a nightly or debug build (e. g.: release, rc, legacy)
     */
    // BUILD_TYPE is detected as constant but can change depending on the build configuration
    @SuppressWarnings("ConstantConditions")
    public static boolean isProductionBuild() {
        return !(BuildConfig.BUILD_TYPE.equals("debug") || BuildConfig.BUILD_TYPE.equals("nightly"));
    }

    /**
     * @return true, if BUILD_TYPE is a debug build. Nightly builds are **not** considered as developer build!
     */
    // BUILD_TYPE is detected as constant but can change depending on the build configuration
    @SuppressWarnings("ConstantConditions")
    public static boolean isDeveloperBuild() {
        return BuildConfig.BUILD_TYPE.equals("debug");
    }

}

package cgeo.geocaching.utils;

import cgeo.geocaching.BuildConfig;

public class BranchDetectionHelper {

    // should contain the version name of the last feature release
    public static final String FEATURE_VERSION_NAME = "2022.08.21";

    // should contain version names of active bugfix releases since last feature release, oldest first
    // empty the part within curly brackets when creating a new release branch from master
    public static final String[] BUGFIX_VERSION_NAME = new String[]{ "" };

    private BranchDetectionHelper() {
        // utility class
    }

    /**
     * @return true, if BUILD_TYPE is not a nightly or debug build (e. g.: release, rc, legacy)
     */
    // BUILD_TYPE is detected as constant but can change depending on the build configuration
    @SuppressWarnings("ConstantConditions")
    public static boolean isProductionBuild() {
        return !(BuildConfig.BUILD_TYPE.equals("debug") || BuildConfig.BUILD_TYPE.equals("nightly"));
    }

    /**
     * @return true, if BUILD_TYPE is a debug build. Nightly builds are **not** considered as developer build!
     */
    // BUILD_TYPE is detected as constant but can change depending on the build configuration
    @SuppressWarnings("ConstantConditions")
    public static boolean isDeveloperBuild() {
        return BuildConfig.BUILD_TYPE.equals("debug");
    }

}

Prepare version number for upcoming release


package org.zalando.problem.spring.web.autoconfigure.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport;

/**
 * Registers exception handling in spring-security
 */
@Configuration
@ConditionalOnClass(WebSecurityConfigurerAdapter.class) //only when spring-security is in classpath
@Import(SecurityProblemSupport.class)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Autowired
    private SecurityProblemSupport problemSupport;

    @Override
    public void configure(final HttpSecurity http) throws Exception {
        http.exceptionHandling()
                .authenticationEntryPoint(problemSupport)
                .accessDeniedHandler(problemSupport);
    }
}

package org.zalando.problem.spring.web.autoconfigure.security;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.zalando.problem.spring.web.advice.security.SecurityProblemSupport;

/**
 * Registers exception handling in spring-security
 */
@Configuration
@ConditionalOnClass(WebSecurityConfigurerAdapter.class) //only when spring-security is in classpath
@Import(SecurityProblemSupport.class)
@Order(Ordered.LOWEST_PRECEDENCE - 21)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
    @Autowired
    private SecurityProblemSupport problemSupport;

    @Override
    public void configure(final HttpSecurity http) throws Exception {
        http.exceptionHandling()
                .authenticationEntryPoint(problemSupport)
                .accessDeniedHandler(problemSupport);
    }
}

Set order to a low-priority but uncommon value


/*
 * Copyright 2016 ThoughtWorks, Inc.
 *
 * 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 cd.go.contrib.elasticagents.docker;

public interface Constants {
    String PLUGIN_ID = "cd.go.contrib.elastic-agents.docker";

    String EXTENSION_NAME = "elastic-agent";

    // requests that the plugin makes to the server
    String REQUEST_SERVER_PREFIX = "go.processor";
    String REQUEST_SERVER_DISABLE_AGENT = REQUEST_SERVER_PREFIX + ".elasticagent.disable-agent";
    String REQUEST_SERVER_DELETE_AGENT = REQUEST_SERVER_PREFIX + ".elasticagent.delete-agent";
    String REQUEST_SERVER_GET_PLUGIN_SETTINGS = REQUEST_SERVER_PREFIX + ".plugin-settings.get";
    String REQUEST_SERVER_LIST_AGENTS = REQUEST_SERVER_PREFIX + ".elasticagent.list";

    // internal use only
    String CREATED_BY_LABEL_KEY = "Elastic-Agent-Created-By";

}

/*
 * Copyright 2016 ThoughtWorks, Inc.
 *
 * 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 cd.go.contrib.elasticagents.docker;

public interface Constants {
    String PLUGIN_ID = "cd.go.contrib.elastic-agents.docker";

    String EXTENSION_NAME = "elastic-agent";

    // requests that the plugin makes to the server
    String REQUEST_SERVER_PREFIX = "go.processor";
    String REQUEST_SERVER_DISABLE_AGENT = REQUEST_SERVER_PREFIX + ".elasticagent.disable-agents";
    String REQUEST_SERVER_DELETE_AGENT = REQUEST_SERVER_PREFIX + ".elasticagent.delete-agents";
    String REQUEST_SERVER_GET_PLUGIN_SETTINGS = REQUEST_SERVER_PREFIX + ".plugin-settings.get";
    String REQUEST_SERVER_LIST_AGENTS = REQUEST_SERVER_PREFIX + ".elasticagent.list-agents";

    // internal use only
    String CREATED_BY_LABEL_KEY = "Elastic-Agent-Created-By";

}

Rename some constants and strings


/*
Copyright 2007-2009 WebDriver committers
Copyright 2007-2009 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package org.openqa.selenium.lift;

import org.hamcrest.Matcher;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.lift.find.Finder;

/**
 * Interface for objects that provide a context (maintaining any state) for web tests.
 * @author rchatley (Robert Chatley)
 *
 */
public interface TestContext {

	public abstract void goTo(String url);

	public abstract void assertPresenceOf(Finder<WebElement, WebDriver> finder);

	public abstract void assertPresenceOf(
			Matcher<Integer> cardinalityConstraint,
			Finder<WebElement, WebDriver> finder);

	public abstract void type(String input, Finder<WebElement, WebDriver> finder);

	public abstract void clickOn(Finder<WebElement, WebDriver> finder);

	public abstract void waitFor(Finder<WebElement, WebDriver> finder, long timeout);

	public abstract void quit();

}

/*
Copyright 2007-2009 WebDriver committers
Copyright 2007-2009 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package org.openqa.selenium.lift;

import org.hamcrest.Matcher;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.lift.find.Finder;

/**
 * Interface for objects that provide a context (maintaining any state) for web tests.
 * @author rchatley (Robert Chatley)
 *
 */
public interface TestContext {

  void goTo(String url);

  void assertPresenceOf(Finder<WebElement, WebDriver> finder);

  void assertPresenceOf(Matcher<Integer> cardinalityConstraint,
      Finder<WebElement, WebDriver> finder);

  void type(String input, Finder<WebElement, WebDriver> finder);

  void clickOn(Finder<WebElement, WebDriver> finder);

  void waitFor(Finder<WebElement, WebDriver> finder, long timeout);

  void quit();

}

Remove unnecessary modifiers and cleanup whitespace.


package com.adobe.epubcheck.vocab;

public class StagingEdupubVocab
{
  public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
  public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI);

  public static enum EPUB_TYPES
  {
    ABSTRACT,
    ANSWER,
    ANSWERS,
    ASSESSMENTS,
    BIBLIOREF,
    CREDIT,
    CREDITS,
    FEEDBACK,
    FILL_IN_THE_BLANK_PROBLEM,
    GENERAL_PROBLEM,
    GLOSSREF,
    INDEX_EDITOR_NOTE,
    INDEX_ENTRY,
    INDEX_ENTRY_LIST,
    INDEX_GROUP,
    INDEX_HEADNOTES,
    INDEX_LEGEND,
    INDEX_LOCATOR,
    INDEX_LOCATOR_LIST,
    INDEX_LOCATOR_RANGE,
    INDEX_TERM,
    INDEX_TERM_CATEGORIES,
    INDEX_TERM_CATEGORY,
    INDEX_XREF_PREFERRED,
    INDEX_XREF_RELATED,
    KEYWORD,
    LABEL,
    LEARNING_OBJECTIVES,
    LEARNING_OUTCOME,
    LEARNING_OUTCOMES,
    LEARNING_RESOURCES,
    LEARNING_STANDARD,
    LEARNING_STANDARDS,
    MATCH_PROBLEM,
    MULTIPLE_CHOICE_PROBLEM,
    ORDINAL,
    PRACTICE,
    PRACTICES,
    PULLQUOTE,
    QUESTION,
    REFERRER,
    TOC_BRIEF,
    TRUE_FALSE_PROBLEM;
  }
}

package com.adobe.epubcheck.vocab;

public class StagingEdupubVocab
{
  public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
  public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI);

  public static enum EPUB_TYPES
  {
    ABSTRACT,
    ANSWER,
    ANSWERS,
    ASSESSMENTS,
    BIBLIOREF,
    CREDIT,
    CREDITS,
    FEEDBACK,
    FILL_IN_THE_BLANK_PROBLEM,
    GENERAL_PROBLEM,
    GLOSSREF,
    INDEX_EDITOR_NOTE,
    INDEX_ENTRY,
    INDEX_ENTRY_LIST,
    INDEX_GROUP,
    INDEX_HEADNOTES,
    INDEX_LEGEND,
    INDEX_LOCATOR,
    INDEX_LOCATOR_LIST,
    INDEX_LOCATOR_RANGE,
    INDEX_TERM,
    INDEX_TERM_CATEGORIES,
    INDEX_TERM_CATEGORY,
    INDEX_XREF_PREFERRED,
    INDEX_XREF_RELATED,
    KEYWORD,
    LABEL,
    LEARNING_OBJECTIVES,
    LEARNING_OUTCOME,
    LEARNING_OUTCOMES,
    LEARNING_RESOURCES,
    LEARNING_STANDARD,
    LEARNING_STANDARDS,
    MATCH_PROBLEM,
    MULTIPLE_CHOICE_PROBLEM,
    ORDINAL,
    PRACTICE,
    PRACTICES,
    PULLQUOTE,
    QUESTION,
    REFERRER,
    SERIESPAGE,
    TOC_BRIEF,
    TRUE_FALSE_PROBLEM;
  }
}

Add missing EDUPUB property "seriespage"


package io.collap.bryg.compiler.library;

import io.collap.bryg.compiler.library.html.HTMLFunctionCollection;

import java.util.HashMap;
import java.util.Map;

public class BasicLibrary implements Library {

    private Map<String, Function> functions = new HashMap<> ();

    public BasicLibrary () {
        new HTMLFunctionCollection (this).register ();
    }

    @Override
    public Function getFunction (String name) {
        return functions.get (name);
    }

    @Override
    public void setFunction (String name, Function function) {
        functions.put (name, function);
    }

}

package io.collap.bryg.compiler.library;

import io.collap.bryg.compiler.library.html.HTMLFunctionCollection;

import java.util.HashMap;
import java.util.Map;

public class BasicLibrary implements Library {

    private Map<String, Function> functions = new HashMap<> ();

    public BasicLibrary () {
        new HTMLFunctionCollection (this).register ();
    }

    @Override
    public Function getFunction (String name) {
        return functions.get (name);
    }

    public void setFunction (String name, Function function) {
        functions.put (name, function);
    }

}

Remove @Override (Should have been in the last commit).


package org.springframework.cloud.service.relational;

import javax.sql.DataSource;

import org.springframework.cloud.service.ServiceConnectorConfig;
import org.springframework.cloud.service.common.RelationalServiceInfo;

/**
 *
 * @author Ramnivas Laddad
 * @author Scott Frederick
 *
 * @param <SI> the {@link RelationalServiceInfo} type for the underlying database service
 */
public class BasicDbcpPooledDataSourceCreator<SI extends RelationalServiceInfo> extends DbcpLikePooledDataSourceCreator<SI> {
	static final String DBCP2_BASIC_DATASOURCE = "org.apache.commons.dbcp2.BasicDataSource";

	@Override
	public DataSource create(RelationalServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig,
							 String driverClassName, String validationQuery) {
		logger.info("Found DBCP2 on the classpath. Using it for DataSource connection pooling.");
		org.apache.commons.dbcp2.BasicDataSource ds = new org.apache.commons.dbcp2.BasicDataSource();
		setBasicDataSourceProperties(ds, serviceInfo, serviceConnectorConfig, driverClassName, validationQuery);
		return new UrlDecodingDataSource(ds, "url");
	}
}

package org.springframework.cloud.service.relational;

import javax.sql.DataSource;

import org.springframework.cloud.service.ServiceConnectorConfig;
import org.springframework.cloud.service.common.RelationalServiceInfo;

import static org.springframework.cloud.service.Util.hasClass;

/**
 *
 * @author Ramnivas Laddad
 * @author Scott Frederick
 *
 * @param <SI> the {@link RelationalServiceInfo} type for the underlying database service
 */
public class BasicDbcpPooledDataSourceCreator<SI extends RelationalServiceInfo> extends DbcpLikePooledDataSourceCreator<SI> {
	static final String DBCP2_BASIC_DATASOURCE = "org.apache.commons.dbcp2.BasicDataSource";

	@Override
	public DataSource create(RelationalServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfig,
							 String driverClassName, String validationQuery) {
		if (hasClass(DBCP2_BASIC_DATASOURCE)) {
			logger.info("Found DBCP2 on the classpath. Using it for DataSource connection pooling.");
			org.apache.commons.dbcp2.BasicDataSource ds = new org.apache.commons.dbcp2.BasicDataSource();
			setBasicDataSourceProperties(ds, serviceInfo, serviceConnectorConfig, driverClassName, validationQuery);
			return new UrlDecodingDataSource(ds, "url");
		}
		return null;
	}
}

Check that Apache Commons DBCP2 is on the classpath before trying to use it.


package org.apollo.game.event.impl;

import org.apollo.game.event.Event;
import org.apollo.game.model.Position;

/**
 * An {@link Event} sent by the client when an item is used on an object.
 *
 * @author Major
 */
public final class ItemOnObjectEvent extends InventoryItemEvent {

	/**
	 * The object id the item was used on.
	 */
	private final int objectId;

	/**
	 * The position of the object.
	 */
	private final Position position;

	/**
	 * Creates an item on object event.
	 *
	 * @param interfaceId The interface id.
	 * @param id The item id.
	 * @param slot The slot the item is in.
	 * @param objectId The object id.
	 * @param x The x coordinate.
	 * @param y The y coordinate.
	 */
	public ItemOnObjectEvent(int interfaceId, int id, int slot, int objectId, int x, int y) {
		super(0, interfaceId, id, slot);
		this.objectId = objectId;
		this.position = new Position(x, y);
	}

	/**
	 * Gets the object id.
	 *
	 * @return The object id.
	 */
	public int getObjectId() {
		return objectId;
	}

	/**
	 * Gets the position of the object.
	 *
	 * @return The position.
	 */
	public Position getPosition() {
		return position;
	}

}

package org.apollo.game.event.impl;

import org.apollo.game.event.Event;
import org.apollo.game.model.Position;

/**
 * An {@link Event} sent by the client when an item is used on an object.
 *
 * @author Major
 */
public final class ItemOnObjectEvent extends InventoryItemEvent {

	/**
	 * The object id the item was used on.
	 */
	private final int objectId;

	/**
	 * The position of the object.
	 */
	private final Position position;

	/**
	 * Creates an item on object event.
	 *
	 * @param interfaceId The interface id.
	 * @param itemId The item id.
	 * @param itemSlot The slot the item is in.
	 * @param objectId The object id.
	 * @param x The x coordinate.
	 * @param y The y coordinate.
	 */
	public ItemOnObjectEvent(int interfaceId, int itemId, int itemSlot, int objectId, int x, int y) {
		super(0, interfaceId, itemId, itemSlot);
		this.objectId = objectId;
		this.position = new Position(x, y);
	}

	/**
	 * Gets the object id.
	 *
	 * @return The object id.
	 */
	public int getObjectId() {
		return objectId;
	}

	/**
	 * Gets the position of the object.
	 *
	 * @return The position.
	 */
	public Position getPosition() {
		return position;
	}

}

Clarify parameter names in item on object event.


package me.itszooti.geojson;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;

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

public class GeoFeatureTest {

	private GeoFeature feature;

	@Before
	public void before() {
		feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0)));
		feature.setProperty("number", 2);
		feature.setProperty("letter", "B");
	}

	@Test
	public void getId() {
		assertThat(feature.getId(), equalTo("a_test_feature"));
	}

	@Test
	public void getGeometry() {
		GeoGeometry geometry = feature.getGeometry();
		assertThat(geometry, notNullValue());
		assertThat(geometry, instanceOf(GeoPoint.class));
	}

	@Test
	public void getProperty() {
		assertThat(feature.getProperty("number"), equalTo((Object)2));
		assertThat(feature.getProperty("letter"), equalTo((Object)"B"));
	}

	@Test
	public void isGeoObject() {
		assertThat(feature, instanceOf(GeoObject.class));
	}

}

package me.itszooti.geojson;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;

import java.util.Set;

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

public class GeoFeatureTest {

	private GeoFeature feature;

	@Before
	public void before() {
		feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0)));
		feature.setProperty("number", 2);
		feature.setProperty("letter", "B");
	}

	@Test
	public void getId() {
		assertThat(feature.getId(), equalTo("a_test_feature"));
	}

	@Test
	public void getGeometry() {
		GeoGeometry geometry = feature.getGeometry();
		assertThat(geometry, notNullValue());
		assertThat(geometry, instanceOf(GeoPoint.class));
	}

	@Test
	public void getProperty() {
		assertThat(feature.getProperty("number"), equalTo((Object)2));
		assertThat(feature.getProperty("letter"), equalTo((Object)"B"));
	}

	@Test
	public void getPropertyNames() {
		Set<String> names = feature.getPropertyNames();
		assertThat(names.size(), equalTo(2));
		assertThat(names.contains("number"), equalTo(true));
		assertThat(names.contains("letter"), equalTo(true));
	}

	@Test
	public void isGeoObject() {
		assertThat(feature, instanceOf(GeoObject.class));
	}

}

Test for property names in GeoFeature


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

package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;

public class EnrollmentCertificate {
    String serial;
    String pem;

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getPem() {
        return pem;
    }

    public void setPem(String pem) {
        this.pem = pem;
    }
}

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

package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans;

public class EnrollmentCertificate {
    String serial;
    String pem;
    int tenantId;

    public int getTenantId() {
        return tenantId;
    }

    public void setTenantId(int tenantId) {
        this.tenantId = tenantId;
    }

    public String getSerial() {
        return serial;
    }

    public void setSerial(String serial) {
        this.serial = serial;
    }

    public String getPem() {
        return pem;
    }

    public void setPem(String pem) {
        this.pem = pem;
    }
}

Add tenant id to Enrollment Certificate


package org.springframework.roo.classpath;

import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;

/**
 * Callback interface to process a {@link ClassOrInterfaceTypeDetails} type.
 *
 * @author Alan Stewart
 * @since 1.1
 */
public interface LocatedTypeCallback {

	 void process(ClassOrInterfaceTypeDetails located);
}

package org.springframework.roo.classpath;

import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;

/**
 * Callback interface to process a {@link ClassOrInterfaceTypeDetails} type.
 *
 * @author Alan Stewart
 * @since 1.1
 */
public interface LocatedTypeCallback {

	/**
	 * Callback method to process the located {@link ClassOrInterfaceTypeDetails} type.
	 *
	 * @param located the {@link ClassOrInterfaceTypeDetails} type.
	 */
	 void process(ClassOrInterfaceTypeDetails located);
}

Create new TypeLocationService and implementation to locate java types based on the annotations a type contains - add javadoc to method


package com.gh4a.model;

import io.reactivex.Single;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Path;

public interface GitHubFeedService {
    @GET("{url}")
    Single<Response<GitHubFeed>> getFeed(@Path(value = "url", encoded = true) String url);

    @GET("https://github.blog/all.atom")
    Single<Response<GitHubFeed>> getBlogFeed();
}

package com.gh4a.model;

import io.reactivex.Single;
import retrofit2.Response;
import retrofit2.http.GET;
import retrofit2.http.Path;

public interface GitHubFeedService {
    @GET("{url}")
    Single<Response<GitHubFeed>> getFeed(@Path(value = "url", encoded = true) String url);

    @GET("https://github.blog/feed/atom/")
    Single<Response<GitHubFeed>> getBlogFeed();
}

Update GitHub blog feed URL


package net.kencochrane.raven.servlet;

import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;

@WebListener
public class RavenServletRequestListener implements ServletRequestListener {
    private static final ThreadLocal<HttpServletRequest> THREAD_REQUEST = new ThreadLocal<HttpServletRequest>();

    public static HttpServletRequest getServletRequest() {
        return THREAD_REQUEST.get();
    }

    @Override
    public void requestDestroyed(ServletRequestEvent servletRequestEvent) {
        THREAD_REQUEST.remove();
    }

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        if (servletRequestEvent instanceof HttpServletRequest)
            THREAD_REQUEST.set((HttpServletRequest) servletRequestEvent.getServletRequest());
    }
}

package net.kencochrane.raven.servlet;

import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpServletRequest;

@WebListener
public class RavenServletRequestListener implements ServletRequestListener {
    private static final ThreadLocal<HttpServletRequest> THREAD_REQUEST = new ThreadLocal<HttpServletRequest>();

    public static HttpServletRequest getServletRequest() {
        return THREAD_REQUEST.get();
    }

    @Override
    public void requestDestroyed(ServletRequestEvent servletRequestEvent) {
        THREAD_REQUEST.remove();
    }

    @Override
    public void requestInitialized(ServletRequestEvent servletRequestEvent) {
        ServletRequest servletRequest = servletRequestEvent.getServletRequest();
        if (servletRequest instanceof HttpServletRequest)
            THREAD_REQUEST.set((HttpServletRequest) servletRequest);
    }
}

Fix the extraction of the HttpServletRequest


package jfdi.logic.commands;

import jfdi.logic.events.NoSurpriseEvent;
import jfdi.logic.events.SurpriseEvent;
import jfdi.logic.interfaces.Command;
import jfdi.storage.apis.TaskAttributes;
import jfdi.storage.apis.TaskDb;

import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.stream.Collectors;

/**
 * @author Xinan
 */
public class WildcardCommand extends Command {

    private WildcardCommand(Builder builder) {}

    public static class Builder {

        public WildcardCommand build() {
            return new WildcardCommand(this);
        }

    }

    @Override
    public void execute() {
        ArrayList<TaskAttributes> incompleteTasks = TaskDb.getInstance().getAll().stream()
                .filter(task -> !task.isCompleted()).collect(Collectors.toCollection(ArrayList::new));

        SecureRandom random = new SecureRandom();

        if (!incompleteTasks.isEmpty()) {
            TaskAttributes lucky = incompleteTasks.get(random.nextInt(incompleteTasks.size()));
            eventBus.post(new SurpriseEvent(lucky));
        } else {
            eventBus.post(new NoSurpriseEvent(NoSurpriseEvent.Error.NO_TASKS));
        }
    }

    @Override
    public void undo() {
        throw new UnsupportedOperationException();
    }
}

package jfdi.logic.commands;

import jfdi.logic.events.NoSurpriseEvent;
import jfdi.logic.events.SurpriseEvent;
import jfdi.logic.interfaces.Command;
import jfdi.storage.apis.TaskAttributes;
import jfdi.storage.apis.TaskDb;

import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.stream.Collectors;

/**
 * @author Xinan
 */
public class WildcardCommand extends Command {

    private WildcardCommand(Builder builder) {}

    public static class Builder {

        public WildcardCommand build() {
            return new WildcardCommand(this);
        }

    }

    @Override
    public void execute() {
        ArrayList<TaskAttributes> incompleteTasks = TaskDb.getInstance().getAll().stream()
                .filter(task -> !task.isCompleted() && task.getStartDateTime() == null)
                .collect(Collectors.toCollection(ArrayList::new));

        SecureRandom random = new SecureRandom();

        if (!incompleteTasks.isEmpty()) {
            TaskAttributes lucky = incompleteTasks.get(random.nextInt(incompleteTasks.size()));
            eventBus.post(new SurpriseEvent(lucky));
        } else {
            eventBus.post(new NoSurpriseEvent(NoSurpriseEvent.Error.NO_TASKS));
        }
    }

    @Override
    public void undo() {
        throw new UnsupportedOperationException();
    }
}

Return only tasks without start time for surprise