package im.delight.android.ddp.db;

/*
 * Copyright (c) delight.im <info@delight.im>
 *
 * 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.
 */

import im.delight.android.ddp.Fields;

/** Storage for data that exposes write access */
public interface DataStore {

	public void onDataAdded(String collectionName, String documentID, Fields newValues);
	public void onDataChanged(String collectionName, String documentID, Fields updatedValues, Fields removedValues);
	public void onDataRemoved(String collectionName, String documentID);

}

package im.delight.android.ddp.db;

/*
 * Copyright (c) delight.im <info@delight.im>
 *
 * 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.
 */

import im.delight.android.ddp.Fields;

/** Storage for data that exposes write access */
public interface DataStore {

	void onDataAdded(String collectionName, String documentID, Fields newValues);
	void onDataChanged(String collectionName, String documentID, Fields updatedValues, Fields removedValues);
	void onDataRemoved(String collectionName, String documentID);

}

Remove unnecessary visibility modifiers in interface


// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.restapi;

import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;

/**
 * @author bjorncs
 */
public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>> extends LoggingRequestHandler {

    private final RestApi restApi;

    @FunctionalInterface public interface RestApiProvider<T> { RestApi createRestApi(T self); }

    /**
     * RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed.
     * This is hack to leak reference to subclass instance's "this" reference.
     * Caller must ensure that provider instance does not try to access any uninitialized fields.
     */
    @SuppressWarnings("unchecked")
    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApiProvider<T> provider) {
        super(context);
        this.restApi = provider.createRestApi((T)this);
    }

    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApi restApi) {
        super(context);
        this.restApi = restApi;
    }

    @Override public final HttpResponse handle(HttpRequest request) { return restApi.handleRequest(request); }
}

// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.restapi;

import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;

/**
 * @author bjorncs
 */
public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>> extends LoggingRequestHandler {

    private final RestApi restApi;

    @FunctionalInterface public interface RestApiProvider<T> { RestApi createRestApi(T self); }

    /**
     * RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed.
     * This is hack to leak reference to subclass instance's "this" reference.
     * Caller must ensure that provider instance does not try to access any uninitialized fields.
     */
    @SuppressWarnings("unchecked")
    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApiProvider<T> provider) {
        super(context);
        this.restApi = provider.createRestApi((T)this);
    }

    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApi restApi) {
        super(context);
        this.restApi = restApi;
    }

    @Override public final HttpResponse handle(HttpRequest request) { return restApi.handleRequest(request); }

    protected RestApi restApi() { return restApi; }
}

Add getter for restapi instance


package org.cru.godtools.domain;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.MigrationVersion;

/**
 * Created by ryancarlson on 4/1/14.
 */
public class UnittestDatabaseBuilder
{
	public static void main(String[] args)
	{
		new UnittestDatabaseBuilder().build();
	}

	public void build()
	{
		Flyway flyway = new Flyway();
		flyway.setDataSource("jdbc:postgresql://localhost/godtoolstest", "godtoolsuser", "godtoolsuser");
		flyway.setInitVersion("0");
		flyway.setTarget(MigrationVersion.fromVersion("0.3"));
		flyway.clean();
		flyway.init();
		flyway.migrate();
	}
}

package org.cru.godtools.domain;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.MigrationVersion;
import org.cru.godtools.domain.properties.GodToolsProperties;
import org.cru.godtools.domain.properties.GodToolsPropertiesFactory;

/**
 * Created by ryancarlson on 4/1/14.
 */
public class UnittestDatabaseBuilder
{
	static GodToolsProperties properties = new GodToolsPropertiesFactory().get();

	public static void main(String[] args)
	{
		new UnittestDatabaseBuilder().build();
	}

	public void build()
	{
		Flyway flyway = new Flyway();
		flyway.setDataSource(properties.getProperty("unittestDatabaseUrl"),
				properties.getProperty("unittestDatabaseUsername"),
				properties.getProperty("unittestDatabasePassword"));
		flyway.setInitVersion("0");
		flyway.setTarget(MigrationVersion.fromVersion("0.3"));
		flyway.clean();
		flyway.init();
		flyway.migrate();
	}
}

Remove hardcoded database info, use properties


package edu.stuy.starlorn.entities;

import java.awt.geom.Rectangle2D;

import edu.stuy.starlorn.upgrades.Upgrade;

public class Pickup extends Entity {

    protected Upgrade upgrade;
    protected double speed;

    public Pickup(Upgrade up, double x, double y) {
        super(x, y, up.getSpriteName());
        upgrade = up;
        speed = 5;
    }

    public Pickup(Upgrade up) {
        this(up, 0, 0);
    }

    public Upgrade getUpgrade() {
        return upgrade;
    }

    @Override
    public void step() {
        Rectangle2D.Double playerRect = world.getPlayer().getRect();
        double playerx = playerRect.x + playerRect.width / 2,
               playery = playerRect.y + playerRect.height / 2,
               thisx = getRect().x + getRect().width / 2,
               thisy = getRect().y + getRect().height / 2,
               theta = Math.atan2(playery - thisy, playerx - thisx),
               dist = Math.sqrt(Math.pow(playerx - thisx, 2) + Math.pow(playery - thisy, 2));

        setXvel(speed * Math.cos(theta));
        setYvel(speed * Math.sin(theta));
        super.step();
        if (dist < 50) {
            world.getPlayer().addUpgrade(getUpgrade());
            kill();
        }
    }
}

package edu.stuy.starlorn.entities;

import java.awt.geom.Rectangle2D;

import edu.stuy.starlorn.upgrades.Upgrade;

public class Pickup extends Entity {

    protected Upgrade upgrade;
    protected double speed;

    public Pickup(Upgrade up, double x, double y) {
        super(x, y, up.getSpriteName());
        upgrade = up;
        speed = 5;
    }

    public Pickup(Upgrade up) {
        this(up, 0, 0);
    }

    public Upgrade getUpgrade() {
        return upgrade;
    }

    @Override
    public void step() {
        Rectangle2D.Double playerRect = world.getPlayer().getRect();
        double playerx = playerRect.x + playerRect.width / 2,
               playery = playerRect.y + playerRect.height / 2,
               thisx = getRect().x + getRect().width / 2,
               thisy = getRect().y + getRect().height / 2,
               theta = Math.atan2(playery - thisy, playerx - thisx);

        setXvel(speed * Math.cos(theta));
        setYvel(speed * Math.sin(theta));
        super.step();
        if (playerRect.intersects(rect)) {
            world.getPlayer().addUpgrade(getUpgrade());
            kill();
        }
    }
}

Make pickup collisions more sensible.


package gov.nih.nci.evs.api.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import gov.nih.nci.evs.api.properties.ApplicationProperties;

@RestController
@RequestMapping("${nci.evs.application.contextPath}")
public class GeneratedFileController {

	@Autowired
	ApplicationProperties applicationProperties;

    @RequestMapping(value = "/getDataFromFile/{fileName}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
    public @ResponseBody byte[] getDataFromFile(@PathVariable(value = "fileName") String fileName,
                    HttpServletResponse response ) throws IOException {
        String baseDirectory = applicationProperties.getGeneratedFilePath();

        File inputFile = new File(baseDirectory + fileName);
        InputStream in = new FileInputStream(inputFile);
        response.setHeader("Content-Disposition", "attachment; filename=" + inputFile.getName());
        return IOUtils.toByteArray(in);
    }

}

package gov.nih.nci.evs.api.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import gov.nih.nci.evs.api.properties.ApplicationProperties;

@RestController
@RequestMapping("${nci.evs.application.contextPath}")
public class GeneratedFileController {

	@Autowired
	ApplicationProperties applicationProperties;

    @RequestMapping(value = "/getDataFromFile/{fileName}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
    public @ResponseBody byte[] getDataFromFile(@PathVariable(value = "fileName") String fileName,
                    HttpServletResponse response ) throws IOException {
        String baseDirectory = applicationProperties.getGeneratedFilePath();

        File inputFile = new File(baseDirectory + fileName);
        try (FileInputStream in = new FileInputStream(inputFile)) {
            response.setHeader("Content-Disposition", "attachment; filename=" + inputFile.getName());
            return IOUtils.toByteArray(in);
        }
    }
}

Change file code to use Try-With-Resource


package io.github.likcoras.asuka.handler.response;

import org.pircbotx.PircBotX;
import org.pircbotx.hooks.types.GenericMessageEvent;
import io.github.likcoras.asuka.AsukaBot;

public class QuitResponse implements BotResponse {

	private GenericMessageEvent<PircBotX> event;
	private String reply;
	private String message;

	public QuitResponse(GenericMessageEvent<PircBotX> event, String reply, String message) {
		this.event = event;
		this.reply = reply;
		this.message = message;
	}

	@Override
	public void send(AsukaBot bot) {
		event.respond(reply.replaceAll("%s", event.getUser().getNick()));
		bot.getIrcBot().stopBotReconnect();
		bot.getIrcBot().sendIRC().quitServer(message);
	}

}

package io.github.likcoras.asuka.handler.response;

import org.pircbotx.PircBotX;
import org.pircbotx.hooks.types.GenericMessageEvent;
import io.github.likcoras.asuka.AsukaBot;

public class QuitResponse implements BotResponse {

	private GenericMessageEvent<PircBotX> event;
	private String reply;
	private String message;

	public QuitResponse(GenericMessageEvent<PircBotX> event, String reply, String message) {
		this.event = event;
		this.reply = reply.replaceAll("%s", event.getUser().getNick());
		this.message = message.replaceAll("%s", event.getUser().getNick());
	}

	@Override
	public void send(AsukaBot bot) {
		event.respond(reply);
		bot.getIrcBot().stopBotReconnect();
		bot.getIrcBot().sendIRC().quitServer(message);
	}

}

Make sure to add the requester to both the reply and message


package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

Add dpid to Port JSON object.


package tw.davy.minecraft.treelogging.bukkit;

import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

import tw.davy.minecraft.treelogging.bukkit.listener.BlockListener;

/**
 * The main class for TreeLogging as a Bukkit plugin.
 *
 * @author Davy
 */
public final class TreeLoggingPlugin extends JavaPlugin
{
  public static final Logger logger = Logger.getLogger("Minecraft.LyTreeHelper");

  /**
   * Called on plugin enable.
   */
  public void onEnable()
  {
    (new BlockListener(this)).registerEvents();
    logger.info("[TreeLogging] Enabled.");
  }

  /**
   * Called on plugin disable.
   */
  public void onDisable()
  {
    logger.info("[TreeLogging] Disabled.");
  }

  /**
   * Called on command trigged.
   */
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    if (cmd.getName().equalsIgnoreCase("treelogging"))
    {
      //if (!(sender instanceof Player)) {
      //} else {
      //   Player player = (Player) sender;
      //}
      sender.sendMessage("TreeLogging, Makes logging trees truely.");
      sender.sendMessage("    Version: 0.1.0");
      return true;
    }
    return false;
  }
}

package tw.davy.minecraft.treelogging.bukkit;

import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

import tw.davy.minecraft.treelogging.bukkit.listener.BlockListener;

/**
 * The main class for TreeLogging as a Bukkit plugin.
 *
 * @author Davy
 */
public final class TreeLoggingPlugin extends JavaPlugin
{
  public static final Logger logger = Logger.getLogger("Minecraft.TreeLogging");

  /**
   * Called on plugin enable.
   */
  public void onEnable()
  {
    (new BlockListener(this)).registerEvents();
    logger.info("[TreeLogging] Enabled.");
  }

  /**
   * Called on plugin disable.
   */
  public void onDisable()
  {
    logger.info("[TreeLogging] Disabled.");
  }

  /**
   * Called on command trigged.
   */
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    if (cmd.getName().equalsIgnoreCase("treelogging"))
    {
      //if (!(sender instanceof Player)) {
      //} else {
      //   Player player = (Player) sender;
      //}
      sender.sendMessage("TreeLogging, Makes logging trees truely.");
      sender.sendMessage("    Version: 0.1.0");
      return true;
    }
    return false;
  }
}

Fix name of the logger


/*
 * Copyright Myrrix Ltd
 *
 * 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.myrrix.client.translating;

import org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator;

/**
 * Used when translation is needed only one-way, never back. The mappings do not need to be remembered.
 */
public final class OneWayMigrator extends AbstractIDMigrator {

  @Override
  public String toStringID(long longID) {
    throw new UnsupportedOperationException();
  }

}

/*
 * Copyright Myrrix Ltd
 *
 * 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.myrrix.client.translating;

import org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator;

/**
 * Used when translation is needed only one-way, never back. The mappings do not need to be remembered.
 */
public final class OneWayMigrator extends AbstractIDMigrator {

  @Override
  public String toStringID(long longID) {
    throw new UnsupportedOperationException();
  }

  /**
   * Prints the hashed long value of the given string argument.
   *
   * @param args first argument is string to hash
   */
  public static void main(String[] args) {
    System.out.println(new OneWayMigrator().toLongID(args[0]));
  }

}

Add handy main() method for hashing a given value


/**
 * JReversePro - Java Decompiler / Disassembler.
 * Copyright (C) 2008 Karthik Kumar.
 *
 * 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.jreversepro.jls.emitter.java14;

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

import org.jreversepro.jls.emitter.BlockEmitterConfig;

/**
 *
 * @author karthikeyanc
 *
 */
public class BlockEmitterConfigImpl_14 extends BlockEmitterConfig {

  public Map<String, String> getConfig() {
    Map<String, String> map = new HashMap<String, String>();
    map.put("net.sf.jrevpro.ast.block.MethodBlock",
        "net.sf.jrevpro.jls.emitter.java14.MethodEmitter");
    map.put("net.sf.jrevpro.ast.block.Statement",
        "net.sf.jrevpro.jls.emitter.java14.StatementEmitter");
    return map;
  }

}

/**
 * JReversePro - Java Decompiler / Disassembler.
 * Copyright (C) 2008 Karthik Kumar.
 *
 * 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.jreversepro.jls.emitter.java14;

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

import org.jreversepro.ast.block.MethodBlock;
import org.jreversepro.ast.block.Statement;
import org.jreversepro.jls.emitter.BlockEmitterConfig;

/**
 *
 * @author karthikeyanc
 *
 */
public class BlockEmitterConfigImpl_14 extends BlockEmitterConfig {

  @Override
  public Map<String, String> getConfig() {
    Map<String, String> map = new HashMap<String, String>();
    map.put(MethodBlock.class.getName(),
        MethodEmitter.class.getName());
    map.put(Statement.class.getName(),
        StatementEmitter.class.getName());
    return map;
  }

}

Fix nasty hardcoded class name.


package com.orbekk.same;

public interface ClientService {
    void notifyNetwork(String networkName, String masterUrl);

    void setState(String component, long revision, String data);
}

package com.orbekk.same;

public interface ClientService {
    void notifyNetwork(String networkName, String masterUrl);

    void setState(String component, String data, long revision);
}

Switch parameter order for consistency.


/*
 * Created by brightSPARK Labs
 * www.brightsparklabs.com
 */

package com.brightsparklabs.asanti.validator;

import com.brightsparklabs.asanti.model.data.DecodedAsnData;
import com.brightsparklabs.asanti.model.schema.typedefinition.AsnSchemaTypeDefinition;
import com.brightsparklabs.asanti.validator.rule.ValidationRule;
import com.google.common.collect.ImmutableSet;

/**
 * Default implementation of {@link Validator}.
 *
 * @author brightSPARK Labs
 */
public class ValidatorImpl implements Validator
{
    // -------------------------------------------------------------------------
    // INSTANCE VARIABLES
    // -------------------------------------------------------------------------

    /** visitor to determine which {@link ValidationRule} to apply to a tag */
    private final ValidationVisitor validationVisitor = new ValidationVisitor();

    // -------------------------------------------------------------------------
    // IMPLEMENTATION: Validator
    // -------------------------------------------------------------------------

    @Override
    public ValidationResult validate(DecodedAsnData decodedAsnData)
    {
        final ValidationResultImpl.Builder builder = ValidationResultImpl.builder();
        for (final String tag : decodedAsnData.getTags())
        {
            final AsnSchemaTypeDefinition type = decodedAsnData.getType(tag);
            final ValidationRule rule = (ValidationRule) type.visit(validationVisitor);
            final ImmutableSet<ValidationFailure> failures = rule.validate(tag, decodedAsnData);
            builder.addAll(failures);
        }

        // process unmapped tags
        decodedAsnData.getUnmappedTags();

        return builder.build();
    }
}

/*
 * Created by brightSPARK Labs
 * www.brightsparklabs.com
 */

package com.brightsparklabs.asanti.validator;

import com.brightsparklabs.asanti.model.data.DecodedAsnData;
import com.brightsparklabs.asanti.model.schema.typedefinition.AsnSchemaTypeDefinition;
import com.brightsparklabs.asanti.validator.rule.ValidationRule;
import com.google.common.collect.ImmutableSet;

/**
 * Default implementation of {@link Validator}.
 *
 * @author brightSPARK Labs
 */
public class ValidatorImpl implements Validator
{
    // -------------------------------------------------------------------------
    // INSTANCE VARIABLES
    // -------------------------------------------------------------------------

    /** visitor to determine which {@link ValidationRule} to apply to a tag */
    private final ValidationVisitor validationVisitor = new ValidationVisitor();

    // -------------------------------------------------------------------------
    // IMPLEMENTATION: Validator
    // -------------------------------------------------------------------------

    @Override
    public ValidationResult validate(DecodedAsnData decodedAsnData)
    {
        final ValidationResultImpl.Builder builder = ValidationResultImpl.builder();
        for (final String tag : decodedAsnData.getTags())
        {
            final AsnSchemaTypeDefinition type = decodedAsnData.getType(tag);
            final ValidationRule rule = (ValidationRule) type.visit(validationVisitor);
            final ImmutableSet<ValidationFailure> failures = rule.validate(tag, decodedAsnData);
            builder.addAll(failures);
        }

        // TODO: ASN-92 process unmapped tags
        decodedAsnData.getUnmappedTags();

        return builder.build();
    }
}

Add TODO note to unfinished validator method


package mobi.hsz.idea.gitignore.treeviewfilter.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.IgnoreManager;
import mobi.hsz.idea.gitignore.settings.IgnoreSettings;
import mobi.hsz.idea.gitignore.util.CommonDataKeys;

import java.util.Calendar;

/**
 * Created by maxi on 03/01/17.
 */
public class ShowHideIgnoredFilesAction extends AnAction {

    public ShowHideIgnoredFilesAction() {
        super(IgnoreBundle.message("action.toggleIgnoredVisibility"), IgnoreBundle.message("action.toggleIgnoredVisibility"), null);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        IgnoreSettings.getInstance().hideIgnoredFilesOnProjectView(!IgnoreSettings.getInstance().shouldHideIgnoredFilesOnProjectView());

        Presentation presentation = this.getTemplatePresentation();
        presentation.setText(Calendar.getInstance().getTime().toString());

//        presentation.setDescription(description);
//        presentation.setIcon(icon);
/*

//        IgnoreManager ignoreManager = IgnoreManager.getInstance(e.getProject());

        final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
        for (VirtualFile f : files) {
//            System.out.println(f.getName());
//            System.out.println("ignored: " + ignoreManager.isFileIgnored(f));
        }
*/
    }

}

package mobi.hsz.idea.gitignore.treeviewfilter;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.IgnoreManager;
import mobi.hsz.idea.gitignore.settings.IgnoreSettings;
import mobi.hsz.idea.gitignore.util.CommonDataKeys;

import java.util.Calendar;

/**
 * Created by maxi on 03/01/17.
 */
public class ShowHideIgnoredFilesAction extends AnAction {

    public ShowHideIgnoredFilesAction() {
        super(IgnoreBundle.message("action.toggleIgnoredVisibility"), IgnoreBundle.message("action.toggleIgnoredVisibility"), null);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        IgnoreSettings.getInstance().hideIgnoredFilesOnProjectView(!IgnoreSettings.getInstance().shouldHideIgnoredFilesOnProjectView());

        Presentation presentation = this.getTemplatePresentation();
        presentation.setText(Calendar.getInstance().getTime().toString());

//        presentation.setDescription(description);
//        presentation.setIcon(icon);

    }

}

Create action to toggle ignored files visibility


package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.OK)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

Add default 200 status to Home mapping


/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2013 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brltty.android;

public final class SystemServiceReference<T> extends SingletonReference<T> {
  private final String serviceName;

  protected T onNeedReference () {
    return (T)ApplicationUtilities.getContext().getSystemService(serviceName);
  }

  SystemServiceReference (String name) {
    super();
    serviceName = name;
  }
}

/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2013 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brltty.android;

public final class SystemServiceReference<T> extends SingletonReference<T> {
  private final String serviceName;

  @Override
  protected final T onNeedReference () {
    return (T)ApplicationUtilities.getContext().getSystemService(serviceName);
  }

  SystemServiceReference (String name) {
    super();
    serviceName = name;
  }
}

Add a missing @Override. (dm)


package org.rmatil.sync.core.messaging;

import org.rmatil.sync.core.messaging.fileexchange.offer.FileOfferRequest;

public enum StatusCode {

    NONE,

    ACCEPTED,

    /**
     * If the client sending the response
     * has denied the request
     */
    DENIED,

    /**
     * If the client has a conflict if
     * he would execute the requested action
     */
    CONFLICT,

    /**
     * If the client already has the state,
     * offered in an {@link FileOfferRequest}
     */
    REQUEST_OBSOLETE,

    /**
     * If the sending client is not authorized
     * to start a particular action on the receiving client
     */
    ACCESS_DENIED,

    /**
     * The status code of a file exchange message, if the
     * file has changed while transferring
     */
    FILE_CHANGED,

    FILE_CORRUPT,

    /**
     * The status code of a file exchange, if the
     * requested file has been lost
     */
    FILE_MISSING
}

package org.rmatil.sync.core.messaging;

import org.rmatil.sync.core.messaging.base.AMessage;
import org.rmatil.sync.core.messaging.base.ARequest;
import org.rmatil.sync.core.messaging.base.AResponse;
import org.rmatil.sync.core.messaging.fileexchange.offer.FileOfferRequest;
import org.rmatil.sync.core.messaging.fileexchange.push.FilePushExchangeHandler;

/**
 * Similar to HTTP responses, a {@link AMessage}, the base class
 * for an {@link ARequest} resp. {@link AResponse}, contains
 * a flag indicating the message's status.
 * <p>
 * However, not only responses may have a status but also
 * requests. The {@link FilePushExchangeHandler} uses this flag
 * to indicate whether a file has changed in the mean time of synchronising
 * to allow the receiving client to restart the exchange.
 */
public enum StatusCode {

    /**
     * Used for initial requests
     * which do not have any status yet
     */
    NONE,

    /**
     * If the request was accepted
     * and the corresponding operation executed
     */
    ACCEPTED,

    /**
     * If the client sending the response
     * has denied the request
     */
    DENIED,

    /**
     * If the client has a conflict if
     * he would execute the requested action
     */
    CONFLICT,

    /**
     * If the client already has the state,
     * offered in an {@link FileOfferRequest}
     */
    REQUEST_OBSOLETE,

    /**
     * If the sending client is not authorized
     * to start a particular action on the receiving client
     */
    ACCESS_DENIED,

    /**
     * The status code of a file exchange message, if the
     * file has changed while transmitting
     */
    FILE_CHANGED,

    /**
     * The status code of a file exchange, if the
     * requested file has been lost
     */
    FILE_MISSING
}

Add documentation and remove obsolete FILE_CORRUPT status


package annotator.find;

/**
 * This insertion adds two closing parentheses to close the unclosed parentheses
 * left by a {@link CastInsertion}. This should be inserted after the expression
 * that's being casted.
 */
public class CloseParenthesisInsertion extends Insertion {

    public CloseParenthesisInsertion(Criteria criteria,
            boolean separateLine) {
        super("))", criteria, separateLine);
    }

    /** {@inheritDoc} */
    @Override
    public String getText(boolean comments, boolean abbreviate) {
        return super.getText(false, false);
    }
}

package annotator.find;

/**
 * This insertion adds two closing parentheses to close the unclosed parentheses
 * left by a {@link CastInsertion}. This should be inserted after the expression
 * that's being casted.
 */
public class CloseParenthesisInsertion extends Insertion {

    public CloseParenthesisInsertion(Criteria criteria,
            boolean separateLine) {
        super("", criteria, separateLine);
    }

    /** {@inheritDoc} */
    @Override
    public String getText(boolean comments, boolean abbreviate) {
        return "))";
    }
}

Fix bug in close parenthesis insertion.


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

import org.callimachusproject.webdriver.helpers.WebBrowserDriver;
import org.openqa.selenium.By;

public class FolderEdit extends CalliPage {

	public FolderEdit(WebBrowserDriver driver) {
		super(driver);
	}

	public FolderEdit waitUntilTitle(String title) {
		super.waitUntilTitle(title);
		return this;
	}

	public CalliPage delete() {
		browser.click(By.id("delete"));
		browser.confirm("Are you sure you want to delete this folder and all the contents of this folder");
		return page();
	}

}

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

import org.callimachusproject.webdriver.helpers.WebBrowserDriver;
import org.openqa.selenium.By;

public class FolderEdit extends CalliPage {

	public FolderEdit(WebBrowserDriver driver) {
		super(driver);
	}

	public FolderEdit waitUntilTitle(String title) {
		super.waitUntilTitle(title);
		return this;
	}

	public CalliPage delete() {
		browser.click(By.id("delete-path"));
		browser.confirm("Are you sure you want to delete this folder and all the contents of this folder");
		return page();
	}

}

Update delete link in test


package com.kryptnostic.mail.v1.http;

import com.kryptnostic.kodex.v1.models.response.BasicResponse;
import com.kryptnostic.mail.v1.models.EmailRequest;

import retrofit.http.Body;
import retrofit.http.POST;

public interface MailServiceApi {

    String INVITE = "invite";

    @POST( INVITE )
    BasicResponse<String> sendInvitationEmail( @Body EmailRequest request );

}

package com.kryptnostic.mail.v1.http;

import retrofit.http.Body;
import retrofit.http.POST;

import com.kryptnostic.kodex.v1.models.response.BasicResponse;
import com.kryptnostic.mail.v1.models.EmailRequest;

public interface MailServiceApi {
    String CONTROLLER = "/mail";
    String INVITE     = "/invite";

    @POST( INVITE )
    BasicResponse<String> sendInvitationEmail( @Body EmailRequest request );

}

Add controller constant and "/" to invite constant


package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
//		float a = (color >> 24) & 0xFF;
//		float r = color >> 16 & 0xFF;  // Faster way of getting red(argb)
//		float g = color >> 8 & 0xFF;   // Faster way of getting green(argb)
//		float b = color & 0xFF;          // Faster way of getting blue(argb)

//		float r = color >> 16 & 0xFF;  // Faster way of getting red(argb)
//		float g = color >> 8 & 0xFF;   // Faster way of getting green(argb)
//		float b = color & 0xFF;          // Faster way of getting blue(argb)

//		float r = p.red(color);
//		float g = p.green(color);
//		float b = p.blue(color);

//		return p.color(r, g, b, alpha);

		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}
}

package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}

	public final static int alphaFromColorInt( int c ) { return (c >> 24) & 0xFF; }
	public final static int redFromColorInt( int c ) { return (c >> 16) & 0xFF;	}
	public final static int greenFromColorInt( int c ) { return (c >> 8)  & 0xFF; }
	public final static int blueFromColorInt( int c ) { return c & 0xFF; }

}

Add r,g,b-from-int color extractor methods


package fr.insee.pogues.transforms;

import org.junit.Test;

import java.util.Map;

import static org.junit.Assert.assertEquals;

public class TestPipeline {

    @Test
    public void passThroughTest() throws Exception {
        String input = "";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).transform();
        assertEquals(input, output);
    }

    @Test
    public void mappingTest() throws Exception {
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> i + "concat";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).map(t0, null).transform();
        assertEquals("concat", output);
    }
}

package fr.insee.pogues.transforms;

import fr.insee.pogues.webservice.rest.PoguesException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.Map;

import static org.junit.Assert.assertEquals;

public class TestPipeline {

    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Test
    public void passesThroughTest() throws Exception {
        String input = "";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).transform();
        assertEquals(input, output);
    }

    @Test
    public void mapsTest() throws Exception {
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> i + "concat";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).map(t0, null).transform();
        assertEquals("concat", output);
    }

    @Test
    public void throwsExceptionTest() throws Exception {
        exception.expect(RuntimeException.class);
        exception.expectMessage("Exception occured while executing mapping function: Expected error");
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> {
            throw new PoguesException(500, "Expected error", "Mapping function exception correctly propagates through pipeline");
        };
        PipeLine pipeline = new PipeLine();
        pipeline.from(input).map(t0, null).transform();
    }
}

Add Pipeline Unit Test: Exception should propagate through pipeline


package com.BV.LinearGradient;

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.Arrays;
import java.util.Collections;
import java.util.List;

public class LinearGradientPackage implements ReactPackage {

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

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

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Arrays.<ViewManager>asList(
            new LinearGradientManager());
    }
}

package com.BV.LinearGradient;

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.Arrays;
import java.util.Collections;
import java.util.List;

public class LinearGradientPackage implements ReactPackage {

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

    // Deprecated RN 0.47
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Arrays.<ViewManager>asList(
            new LinearGradientManager());
    }
}

Handle Android RN 0.47 breaking change


package com.mapzen.tangram.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import com.mapzen.tangram.MapController;
import com.mapzen.tangram.MapView;

public class MainActivity extends Activity {

    MapController mapController;
    MapView mapView;

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

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.main);

        mapView = (MapView)findViewById(R.id.map);
        mapController = new MapController(this, mapView);

    }

}

package com.mapzen.tangram.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import com.mapzen.tangram.MapController;
import com.mapzen.tangram.MapView;

public class MainActivity extends Activity {

    MapController mapController;
    MapView mapView;

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

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.main);

        mapView = (MapView)findViewById(R.id.map);
        mapController = new MapController(this, mapView);
        mapController.setMapZoom(16);
        mapController.setMapPosition(-74.00976419448854, 40.70532700869127);

    }

}

Add default position and zoom to android demo


/*
 * Created on 11-Jan-2006
 */
package uk.org.ponder.rsf.test.sitemap;

import java.util.HashMap;

import uk.org.ponder.rsf.bare.junit.PlainRSFTests;
import uk.org.ponder.rsf.viewstate.EntityCentredViewParameters;
import uk.org.ponder.rsf.viewstate.support.BasicViewParametersParser;

public class TestSiteMap extends PlainRSFTests {
  public void testParseECVP() {
    BasicViewParametersParser bvpp = (BasicViewParametersParser) applicationContext.getBean("viewParametersParser");
    HashMap attrmap = new HashMap();
    attrmap.put("flowtoken", "ec38f0");
    EntityCentredViewParameters ecvp = (EntityCentredViewParameters) bvpp.parse("/recipe/3652/", attrmap);
    System.out.println("ECVP for entity " + ecvp.entity.ID + " of type " + ecvp.entity.entityname);
  }

}

/*
 * Created on 11-Jan-2006
 */
package uk.org.ponder.rsf.test.sitemap;

import java.util.HashMap;

import uk.org.ponder.rsf.bare.junit.PlainRSFTests;
import uk.org.ponder.rsf.viewstate.EntityCentredViewParameters;
import uk.org.ponder.rsf.viewstate.support.BasicViewParametersParser;

public class TestSiteMap extends PlainRSFTests {
  public TestSiteMap() {
    contributeConfigLocation("classpath:uk/org/ponder/rsf/test/sitemap/sitemap-context.xml");
  }

  public void testParseECVP() {
    BasicViewParametersParser bvpp = (BasicViewParametersParser) applicationContext.getBean("viewParametersParser");
    HashMap attrmap = new HashMap();
    attrmap.put("flowtoken", "ec38f0");
    EntityCentredViewParameters ecvp = (EntityCentredViewParameters) bvpp.parse("/recipe/3652/", attrmap);
    System.out.println("ECVP for entity " + ecvp.entity.ID + " of type " + ecvp.entity.entityname);
  }

}

Fix for loading SiteMap entry on Spring 2.x


package io.openex.scheduler;

import com.google.common.collect.ImmutableMap;
import io.openex.management.Executor;
import io.openex.management.contract.Contract;
import org.apache.camel.Component;
import org.apache.camel.component.gson.GsonDataFormat;
import org.apache.camel.component.http4.HttpComponent;
import org.apache.camel.component.quartz2.QuartzComponent;

@SuppressWarnings("PackageAccessibility")
class SchedulerExecutor implements Executor {

	public String id() {
		return "openex_scheduler";
	}

	@Override
	public Contract contract() {
		return null;
	}

	@Override
	public ImmutableMap<String, Component> components() {
		QuartzComponent quartzComponent = new QuartzComponent();
		quartzComponent.setEnableJmx(false); //Standalone scheduler, no need to register it in mbean
		return ImmutableMap.of("http", new HttpComponent(), "quartz", quartzComponent);
	}

	@Override
	public ImmutableMap<String, Object> beans() {
		return ImmutableMap.of("json-gson", new GsonDataFormat());
	}
}

package io.openex.scheduler;

import com.google.common.collect.ImmutableMap;
import io.openex.management.Executor;
import io.openex.management.contract.Contract;
import org.apache.camel.Component;
import org.apache.camel.component.gson.GsonDataFormat;
import org.apache.camel.component.http4.HttpComponent;
import org.apache.camel.component.quartz2.QuartzComponent;

@SuppressWarnings("PackageAccessibility")
class SchedulerExecutor implements Executor {

	public String id() {
		return "openex_scheduler";
	}

	@Override
	public Contract contract() {
		return null;
	}

	@Override
	public ImmutableMap<String, Component> components() {
		QuartzComponent quartzComponent = new QuartzComponent();
		quartzComponent.setEnableJmx(false); //Standalone scheduler, no need to register it in mbean
		HttpComponent httpComponent = new HttpComponent();
		return ImmutableMap.of("http", httpComponent, "https", httpComponent, "quartz", quartzComponent);
	}

	@Override
	public ImmutableMap<String, Object> beans() {
		return ImmutableMap.of("json-gson", new GsonDataFormat());
	}
}

Add https support in the worker


package com.aviras.mrassistant.data.models;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Represent doctor
 * <p/>
 * Created by ashish on 8/6/16.
 */
public class Doctor extends RealmObject{

    @PrimaryKey
    private int id;

    private CharSequence name;

    private CharSequence address;

    private CharSequence notes;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public CharSequence getName() {
        return name;
    }

    public void setName(CharSequence name) {
        this.name = name;
    }

    public CharSequence getAddress() {
        return address;
    }

    public void setAddress(CharSequence address) {
        this.address = address;
    }

    public CharSequence getNotes() {
        return notes;
    }

    public void setNotes(CharSequence notes) {
        this.notes = notes;
    }
}

package com.aviras.mrassistant.data.models;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Represent doctor
 * <p/>
 * Created by ashish on 8/6/16.
 */
public class Doctor extends RealmObject {

    @PrimaryKey
    private int id;

    private CharSequence name;

    private CharSequence contactNumber;

    private CharSequence address;

    private CharSequence notes;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public CharSequence getName() {
        return name;
    }

    public void setName(CharSequence name) {
        this.name = name;
    }

    public CharSequence getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(CharSequence contactNumber) {
        this.contactNumber = contactNumber;
    }

    public CharSequence getAddress() {
        return address;
    }

    public void setAddress(CharSequence address) {
        this.address = address;
    }

    public CharSequence getNotes() {
        return notes;
    }

    public void setNotes(CharSequence notes) {
        this.notes = notes;
    }
}

Add contactNumber field to doctor


package net.teamio.taam.content;

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

public class MaterialMachinesTransparent extends Material {
	public static final MaterialMachinesTransparent INSTANCE = new MaterialMachinesTransparent(MapColor.ironColor);

	public MaterialMachinesTransparent(MapColor color) {
		super(color);
		this.setRequiresTool();
	}

    @Override
    public boolean isSolid()
    {
        return false;
    }

	@Override
	public boolean blocksLight() {
		return false;
	}

    @Override
    public boolean blocksMovement()
    {
        return false;
    }

    @Override
    public boolean isOpaque() {
    	return false;
    }
}

package net.teamio.taam.content;

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

public class MaterialMachinesTransparent extends Material {
	public static final MaterialMachinesTransparent INSTANCE = new MaterialMachinesTransparent(MapColor.ironColor);

	public MaterialMachinesTransparent(MapColor color) {
		super(color);
		this.setRequiresTool();
	}

    @Override
    public boolean isSolid()
    {
        return false;
    }

	@Override
	public boolean blocksLight() {
		return false;
	}

    @Override
    public boolean blocksMovement()
    {
        return true;
    }

    @Override
    public boolean isOpaque() {
    	return false;
    }
}

Fix machines getting destroyed by fluids


package com.chaquo.python.demo;

import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

package com.chaquo.python.demo;

import android.content.pm.*;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
            setTitle(getTitle() + " " + version);
        } catch (PackageManager.NameNotFoundException ignored) {}

        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

Add version number to menu screen


package org.pdxfinder.dao;

import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;

/**
 * Created by jmason on 17/03/2017.
 */
@NodeEntity
public class QualityAssurance {

    @GraphId
    Long id;

    private String technology;
    private String description;
    private String passages;

    public QualityAssurance() {
    }

    public QualityAssurance(String technology, String description, String passages) {
        this.technology = technology;
        this.description = description;

        this.passages = passages;
    }

    public String getTechnology() {
        return technology;
    }

    public void setTechnology(String technology) {
        this.technology = technology;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPassages() {
        return passages;
    }

    public void setPassages(String passages) {
        this.passages = passages;
    }
}

package org.pdxfinder.dao;

import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;

/**
 * Created by jmason on 17/03/2017.
 */
@NodeEntity
public class QualityAssurance {

    @GraphId
    Long id;

    private String technology;
    private String description;
    private String passages;
    private String validationHostStrain;

    public QualityAssurance() {
    }

    public QualityAssurance(String technology, String description, String passages) {
        this.technology = technology;
        this.description = description;

        this.passages = passages;
    }

    public QualityAssurance(String technology, String description, String passages, String validationHostStrain) {
        this.technology = technology;
        this.description = description;
        this.passages = passages;
        this.validationHostStrain = validationHostStrain;
    }

    public String getTechnology() {
        return technology;
    }

    public void setTechnology(String technology) {
        this.technology = technology;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getPassages() {
        return passages;
    }

    public void setPassages(String passages) {
        this.passages = passages;
    }

    public String getValidationHostStrain() {
        return validationHostStrain;
    }

    public void setValidationHostStrain(String validationHostStrain) {
        this.validationHostStrain = validationHostStrain;
    }
}

Add host strain to validation


/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.core.change;

import javax.time.Instant;

import com.opengamma.id.UniqueId;

/**
 * Implementation of {@link ChangeManager} to use when change notifications are not supported or never needed.
 */
public final class DummyChangeManager implements ChangeManager {

  /**
   * Singleton instance
   */
  public static final DummyChangeManager INSTANCE = new DummyChangeManager();

  /**
   * Hidden constructor.
   */
  private DummyChangeManager() {
  }

  @Override
  public void addChangeListener(ChangeListener listener) {
  }

  @Override
  public void removeChangeListener(ChangeListener listener) {
  }

  @Override
  public void entityChanged(ChangeType type, UniqueId beforeId, UniqueId afterId, Instant versionInstant) {
    throw new UnsupportedOperationException(DummyChangeManager.class.getSimpleName() + " does not support change notifications");
  }

}

/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.core.change;

import javax.time.Instant;

import com.opengamma.id.UniqueId;

/**
 * Implementation of {@link ChangeManager} to use when change notifications are not supported or never needed.
 */
public final class DummyChangeManager implements ChangeManager {

  /**
   * Singleton instance
   */
  public static final DummyChangeManager INSTANCE = new DummyChangeManager();

  /**
   * Hidden constructor.
   */
  private DummyChangeManager() {
  }

  @Override
  public void addChangeListener(ChangeListener listener) {
    // dummy manager does nothing
  }

  @Override
  public void removeChangeListener(ChangeListener listener) {
    // dummy manager does nothing
  }

  @Override
  public void entityChanged(ChangeType type, UniqueId beforeId, UniqueId afterId, Instant versionInstant) {
    // dummy manager does nothing
  }

}

Make dummy change manager do nothing


/*
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015, 2016
*/
package quarks.execution;

import java.util.concurrent.Future;

import com.google.gson.JsonObject;

/**
 * An interface for submission of an executable.
 * <p>
 * The class implementing this interface is responsible
 * for the semantics of this operation.  e.g., an direct topology
 * provider would run the topology as threads in the current jvm.
 *
 * @param <E> the executable type
 * @param <J> the submitted executable's future
 */
public interface Submitter<E, J extends Job> {

    /**
     * Submit an executable.
     * No configuration options are specified,
     * this is equivalent to {@code submit(executable, new JsonObject())}.
     *
     * @param executable executable to submit
     * @return a future for the submitted executable
     */
    Future<J> submit(E executable);

    /**
     * Submit an executable.
     *
     * @param executable executable to submit
     * @param config context information for the submission.
     * @return a future for the submitted executable
     */
    Future<J> submit(E executable, JsonObject config);
}

/*
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015, 2016
*/
package quarks.execution;

import java.util.concurrent.Future;

import com.google.gson.JsonObject;

/**
 * An interface for submission of an executable.
 * <p>
 * The class implementing this interface is responsible
 * for the semantics of this operation.  e.g., an direct topology
 * provider would run the topology as threads in the current jvm.
 *
 * @param <E> the executable type
 * @param <J> the submitted executable's future
 */
public interface Submitter<E, J extends Job> {

    /**
     * Submit an executable.
     * No configuration options are specified,
     * this is equivalent to {@code submit(executable, new JsonObject())}.
     *
     * @param executable executable to submit
     * @return a future for the submitted executable
     */
    Future<J> submit(E executable);

    /**
     * Submit an executable.
     *
     * @param executable executable to submit
     * @param config reserved for future use: context information for the submission.
     * @return a future for the submitted executable
     */
    Future<J> submit(E executable, JsonObject config);
}

Clarify that Submit config is not currently used


package org.broadinstitute.sting.gatk.walkers.fasta;

import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
import org.broadinstitute.sting.gatk.walkers.RodWalker;
import org.broadinstitute.sting.utils.genotype.Variation;

import java.util.Iterator;

public class CreateSequenomMask extends RodWalker<Integer, Integer> {

    public void initialize() {}

	public Integer map(RefMetaDataTracker rodData, ReferenceContext ref, AlignmentContext context) {
        int result = 0;

        Iterator<ReferenceOrderedDatum> rods = rodData.getAllRods().iterator();
        while (rods.hasNext()) {
            ReferenceOrderedDatum rod = rods.next();
            if ( rod instanceof Variation && ((Variation)rod).isSNP() ) {
                out.println(context.getLocation());
                result = 1;
                break;
            }
        }

        return result;
    }

    public Integer reduceInit() {
        return 0;
    }

	public Integer reduce(Integer value, Integer sum) {
		return value + sum;
	}

    public void onTraversalDone(Integer sum) {
        logger.info("Found " + sum + " masking sites.");
    }
}

package org.broadinstitute.sting.gatk.walkers.fasta;

import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.ReferenceOrderedDatum;
import org.broadinstitute.sting.gatk.walkers.RodWalker;
import org.broadinstitute.sting.utils.genotype.Variation;

import java.util.Iterator;

public class CreateSequenomMask extends RodWalker<Integer, Integer> {

    public void initialize() {}

	public Integer map(RefMetaDataTracker rodData, ReferenceContext ref, AlignmentContext context) {
        int result = 0;
        if ( rodData == null ) // apparently, RodWalkers make funky map calls
            return 0;

        Iterator<ReferenceOrderedDatum> rods = rodData.getAllRods().iterator();
        while (rods.hasNext()) {
            ReferenceOrderedDatum rod = rods.next();
            if ( rod instanceof Variation && ((Variation)rod).isSNP() ) {
                out.println(context.getLocation());
                result = 1;
                break;
            }
        }

        return result;
    }

    public Integer reduceInit() {
        return 0;
    }

	public Integer reduce(Integer value, Integer sum) {
		return value + sum;
	}

    public void onTraversalDone(Integer sum) {
        logger.info("Found " + sum + " masking sites.");
    }
}

Check that map isn't being called passing in null arguments. (This seems wrong; see JIRA entry GSA-211)


package main.doge.service;

import main.doge.service.domain.Todo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

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

@Service
public class TodoService {

    private final RestTemplate restTemplate;
    private final String uri;

    @Autowired
    public TodoService(RestTemplate restTemplate, @Value("${doge.service.uri}") String uri) {
        this.restTemplate = restTemplate;
        this.uri = uri;
    }

    public List<Todo> getTodos() {
        return Arrays.asList(callService(uri + "/todos", Todo[].class));
    }

    public Todo getSingleTodo(int todoId) {
        return callService(uri + "/todo/" + Integer.toString(todoId), Todo.class);
    }

    private <T> T callService(String uri, Class<T> type) {
        return restTemplate.getForObject(uri, type);
    }
}

package main.doge.service;

import main.doge.service.domain.Todo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class TodoService {

    private final RestTemplate restTemplate;
    private final String uri;

    @Autowired
    public TodoService(RestTemplate restTemplate, @Value("${doge.service.uri}") String uri) {
        this.restTemplate = restTemplate;
        this.uri = uri;
    }

    public List<Todo> getTodos() {
        return Arrays.stream(callService(uri + "/todos", Todo[].class)).collect(Collectors.toList());
    }

    public Todo getSingleTodo(int todoId) {
        return callService(uri + "/todo/" + Integer.toString(todoId), Todo.class);
    }

    private <T> T callService(String uri, Class<T> type) {
        return restTemplate.getForObject(uri, type);
    }
}

Refactor to use Java 8 stream


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

package com.googlesource.gerrit.plugins.webhooks;

import java.util.concurrent.ScheduledThreadPoolExecutor;

import com.google.gerrit.extensions.annotations.PluginName;
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.server.git.WorkQueue;
import com.google.inject.Inject;
import com.google.inject.Provider;

class ExecutorProvider
    implements Provider<ScheduledThreadPoolExecutor>, LifecycleListener {
  private WorkQueue.Executor executor;

  @Inject
  ExecutorProvider(WorkQueue workQueue,
      Configuration cfg,
      @PluginName String name) {
    executor = workQueue.createQueue(cfg.getThreadPoolSize(), name);
  }

  @Override
  public void start() {
    // do nothing
  }

  @Override
  public void stop() {
    executor.shutdown();
    executor.unregisterWorkQueue();
    executor = null;
  }

  @Override
  public ScheduledThreadPoolExecutor get() {
    return executor;
  }
}

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

package com.googlesource.gerrit.plugins.webhooks;

import java.util.concurrent.ScheduledThreadPoolExecutor;

import com.google.gerrit.extensions.annotations.PluginName;
import com.google.gerrit.extensions.events.LifecycleListener;
import com.google.gerrit.server.git.WorkQueue;
import com.google.inject.Inject;
import com.google.inject.Provider;

class ExecutorProvider
    implements Provider<ScheduledThreadPoolExecutor>, LifecycleListener {
  private WorkQueue.Executor executor;

  @Inject
  ExecutorProvider(WorkQueue workQueue,
      Configuration cfg,
      @PluginName String name) {
    executor = workQueue.createQueue(cfg.getThreadPoolSize(), name);
  }

  @Override
  public void start() {
    // do nothing
  }

  @Override
  public void stop() {
    executor.shutdown();
    executor = null;
  }

  @Override
  public ScheduledThreadPoolExecutor get() {
    return executor;
  }
}

Stop calling unregisterWorkqueue which was removed in gerrit


package seedu.emeraldo.logic.commands;

public class EditCommand extends Command{

    public static final String COMMAND_WORD = "edit";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Edits the task identified by the index number used in the last tasks listing.\n"
            + "Parameters: INDEX (must be a positive integer) and \"TASK_DESCRIPTION\"\n"
            + "Example: " + COMMAND_WORD + " 1" + "CS2103T Week 8 Tutorial";

    public static final String MESSAGE_EDIT_TASK_SUCCESS = "Edited task: %1$s";

    public final int targetIndex;

    public final String field;

    public EditCommand(int targetIndex, String field) {
        this.targetIndex = targetIndex;
        this.field = field;
    }

    @Override
    public CommandResult execute() {
        // TODO Auto-generated method stub
        return null;
    }

}

package seedu.emeraldo.logic.commands;

import seedu.emeraldo.commons.exceptions.IllegalValueException;

public class EditCommand extends Command{

    public static final String COMMAND_WORD = "edit";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Edits the task identified by the index number used in the last tasks listing.\n"
            + "Parameters: INDEX (must be a positive integer) and \"TASK_DESCRIPTION\"\n"
            + "Example: " + COMMAND_WORD + " 1" + "CS2103T Week 8 Tutorial";

    public static final String MESSAGE_EDIT_TASK_SUCCESS = "Edited task: %1$s";

    public final int targetIndex;

    public final String field;

    public EditCommand(String targetIndex, String field) throws IllegalValueException {
        this.targetIndex = Integer.parseInt(targetIndex);
        this.field = field;
    }

    @Override
    public CommandResult execute() {
        // TODO Auto-generated method stub
        return null;
    }

}

Add IllegalValueException and convert String to int


package es.ucm.fdi.tp.control;

import java.util.List;

import es.ucm.fdi.tp.basecode.bgame.control.Player;
import es.ucm.fdi.tp.basecode.bgame.model.Board;
import es.ucm.fdi.tp.basecode.bgame.model.GameMove;
import es.ucm.fdi.tp.basecode.bgame.model.GameRules;
import es.ucm.fdi.tp.basecode.bgame.model.Piece;

public class SwingPlayer extends Player{

	/**
	 *
	 */
	private static final long serialVersionUID = -257722318128195740L;

	@Override
	public GameMove requestMove(Piece p, Board board, List<Piece> pieces, GameRules rules) {
		// TODO Auto-generated method stub
		return null;
	}

	private void setMove(){

	}

}

package es.ucm.fdi.tp.control;

import java.util.List;

import es.ucm.fdi.tp.basecode.bgame.control.Player;
import es.ucm.fdi.tp.basecode.bgame.model.Board;
import es.ucm.fdi.tp.basecode.bgame.model.GameMove;
import es.ucm.fdi.tp.basecode.bgame.model.GameRules;
import es.ucm.fdi.tp.basecode.bgame.model.Piece;

public class SwingPlayer extends Player {

	private static final long serialVersionUID = -257722318128195740L;

	private GameMove move;

	public SwingPlayer() {}

	@Override
	public GameMove requestMove(Piece p, Board board, List<Piece> pieces, GameRules rules) {
		if(p.equals(move.getPiece()) {
			return this.move;
		}
		return null;
	}

	public void setMove(GameMove newMove) {
		this.move = move;
	}

	public GameMove getMove() {
		return this.move;
	}

}

Add one swing player to rule them all


package org.scalaxb.maven.it;

import org.junit.Test;

public class ITP03WSDL extends AbstractIT {

    private String[] expected = new String[] {
            "generated/stockquote.scala",
            "generated/xmlprotocol.scala",
            "scalaxb/httpclients_dispatch.scala",
            "scalaxb/scalaxb.scala",
            "scalaxb/soap.scala",
            "soapenvelope12/soapenvelope12.scala",
            "soapenvelope12/soapenvelope12_xmlprotocol.scala"
    };

    @Test
    public void filesAreGeneratedInCorrectLocation() {
        assertFilesGenerated("itp03-wsdl", expected);
    }

}

package org.scalaxb.maven.it;

import org.junit.Test;

public class ITP03WSDL extends AbstractIT {

    private String[] expected = new String[] {
            "generated/stockquote.scala",
            "generated/xmlprotocol.scala",
            "scalaxb/httpclients_dispatch.scala",
            "scalaxb/scalaxb.scala",
            "scalaxb/soap12.scala",
            "soapenvelope12/soapenvelope12.scala",
            "soapenvelope12/soapenvelope12_xmlprotocol.scala"
    };

    @Test
    public void filesAreGeneratedInCorrectLocation() {
        assertFilesGenerated("itp03-wsdl", expected);
    }

}

Update WSDL integration test for 0.6.7


/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * 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.litho;

import androidx.annotation.Nullable;

public class ArrayBatchAllocator {

  private static int batchSize = 200;

  @Nullable private static int[][] arrays = null;
  private static int index = 0;

  /** same as calling new int[2]; */
  public static int[] newArrayOfSize2() {
    if (arrays == null || arrays.length == index) {
      arrays = new int[batchSize][2];
      index = 0;
    }
    int[] toReturn = arrays[index];
    arrays[index++] = null;
    return toReturn;
  }
}

/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * 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.litho;

import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;

@Nullsafe(Nullsafe.Mode.LOCAL)
public class ArrayBatchAllocator {

  private static int batchSize = 200;

  @Nullable private static int[][] arrays = null;
  private static int index = 0;

  /** same as calling new int[2]; */
  public static int[] newArrayOfSize2() {
    if (arrays == null || arrays.length == index) {
      arrays = new int[batchSize][2];
      index = 0;
    }
    int[] toReturn = arrays[index];
    arrays[index++] = null;
    return toReturn;
  }
}

Annotate clean classes as @Nullsafe:: (4/14) libraries/components/litho-core/src/main/java/com/facebook/litho/


package sample;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SampleController {

	private SessionFactory sessionFactory;

	public SampleController(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@RequestMapping("/")
	@Transactional
	public List<SampleEntity> home() {
		return this.sessionFactory.getCurrentSession()
				.createQuery("from SampleEntity se")
				.list();
	}

}

package sample;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SampleController {

	private SessionFactory sessionFactory;

	public SampleController(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@RequestMapping("/")
	@Transactional(readOnly = true)
	public List<SampleEntity> home() {
		return this.sessionFactory.getCurrentSession()
				.createQuery("from SampleEntity se")
				.list();
	}

}

Use readonly transactions where possible


package org.computelab.config;

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

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

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

public class PropertiesConfigReaderTest {

    private Properties properties;

    @Before
    public void before() throws IOException {
        try (InputStream inStream =
                getClass().getResourceAsStream("/test.properties")) {
            properties = new Properties();
            properties.load(inStream);
        }
    }

    @Test(expected=NullPointerException.class)
    public void constructorPropertiesCannotBeNull() {
        new PropertiesConfigReader(null);
    }

    @Test
    public void test() {
        PropertiesConfigReader reader = new PropertiesConfigReader(properties);
        assertEquals("567", reader.getVal("sp.researcher.id"));
        assertEquals("abc", reader.getVal("sp.provider.secret"));
        assertEquals("http://provider.test.com/, http://provider.test2.com/",
                reader.getVal("sp.provider.urls"));
    }

    @Test
    public void testMissingKey() {
        PropertiesConfigReader reader = new PropertiesConfigReader(properties);
        assertNull(reader.getVal("sp.researcher.key"));
    }
}

package org.computelab.config;

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

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

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

public class PropertiesConfigReaderTest {

    private Properties properties;

    @Before
    public void before() throws IOException {
        try (InputStream inStream =
                getClass().getResourceAsStream("/test.properties")) {
            properties = new Properties();
            properties.load(inStream);
        }
    }

    @Test(expected=NullPointerException.class)
    public void constructorPropertiesCannotBeNull() {
        new PropertiesConfigReader(null);
    }

    @Test
    public void test() {
        PropertiesConfigReader reader = new PropertiesConfigReader(properties);
        assertEquals("567", reader.getVal("sp.researcher.id"));
        assertEquals("abc", reader.getVal("sp.provider.secret"));
        assertEquals("http://provider.test.com/, http://provider.test2.com/",
                reader.getVal("sp.provider.urls"));
    }

    @Test
    public void testMissingKey() {
        PropertiesConfigReader reader = new PropertiesConfigReader(properties);
        assertNull(reader.getVal("sp.researcher.key"));
    }

    @Test
    public void emptyPropertiesAreAllowed() {
        PropertiesConfigReader reader = new PropertiesConfigReader(
                new Properties());
        assertNull(reader.getVal("sp.researcher.id"));
    }
}

Add test on empty properties


package mtsar.api.validation;

import io.dropwizard.validation.ValidationMethod;
import mtsar.api.Answer;
import mtsar.api.Task;
import org.apache.commons.lang3.ArrayUtils;

public class TaskAnswerValidation {
    private final Task task;
    private final Answer answer;

    public TaskAnswerValidation(Task task, Answer answer) {
        this.task = task;
        this.answer = answer;
    }

    @ValidationMethod(message="task type 'single' requires one answer")
    public boolean isAnswerPresentForTypeSingle() {
        return !task.getType().equalsIgnoreCase("single") || ArrayUtils.getLength(answer.getAnswers()) == 1;
    }
}

package mtsar.api.validation;

import io.dropwizard.validation.ValidationMethod;
import mtsar.api.Answer;
import mtsar.api.Task;
import org.apache.commons.lang3.ArrayUtils;

public class TaskAnswerValidation {
    private final Task task;
    private final Answer answer;

    public TaskAnswerValidation(Task task, Answer answer) {
        this.task = task;
        this.answer = answer;
    }

    @ValidationMethod(message = "#task-single-no-answer: task type 'single' requires one answer")
    public boolean isAnswerPresentForTypeSingle() {
        return !task.getType().equalsIgnoreCase("single") || ArrayUtils.getLength(answer.getAnswers()) == 1;
    }

}

Add parsable IDs to validation errors


package org.hyperledger.fabricjavasdk.util;

import java.util.logging.Level;

public class Logger {
	private java.util.logging.Logger logger = null;

	private Logger(@SuppressWarnings("rawtypes") Class clazz) {
		this.logger = java.util.logging.Logger.getLogger(clazz.getName());
	}

	public static Logger getLogger(@SuppressWarnings("rawtypes") Class clazz) {
		return new Logger(clazz);
	}

	public void info(String message) {
		logger.info(message);
	}

	public void info(String message, Object... args) {
		logger.log(Level.INFO, message, args);
	}

	public void warn(String message) {
		logger.warning(message);
	}

	public void warn(String message, Object... args) {
		logger.log(Level.WARNING, message, args);
	}

	public void debug(String message) {
		logger.fine(message);
	}

	public void debug(String message, Object... args) {
		logger.log(Level.FINE, message, args);
	}
}

package org.hyperledger.fabricjavasdk.util;

import java.util.logging.Level;

public class Logger {
	private java.util.logging.Logger logger = null;

	private Logger(@SuppressWarnings("rawtypes") Class clazz) {
		this.logger = java.util.logging.Logger.getLogger(clazz.getName());
	}

	public static Logger getLogger(@SuppressWarnings("rawtypes") Class clazz) {
		return new Logger(clazz);
	}

	public void info(String message) {
		logger.info(message);
	}

	public void info(String message, Object... args) {
		logger.log(Level.INFO, String.format(message, args));
	}

	public void warn(String message) {
		logger.warning(message);
	}

	public void warn(String message, Object... args) {
		logger.log(Level.WARNING, String.format(message, args));
	}

	public void debug(String message) {
		logger.fine(message);
	}

	public void debug(String message, Object... args) {
		logger.log(Level.FINE, String.format(message, args));
	}
}

Use String.format for variable substitution in a log message


/*-
 * Copyright 2015, 2016 Diamond Light Source Ltd.
 *
 * 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
 */

package org.eclipse.january.dataset;

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

/**
 * Class used by DynamicDataset to delegate
 */
public class DataListenerDelegate {

	private List<IDataListener> listeners;

	public DataListenerDelegate() {
		listeners = Collections.synchronizedList(new ArrayList<IDataListener>());
	}

	public void addDataListener(IDataListener l) {
		synchronized (listeners) {
			if (!listeners.contains(l)) {
				listeners.add(l);
			}
		}
	}

	public void removeDataListener(IDataListener l) {
		listeners.remove(l);
	}

	public void fire(DataEvent evt) {
		synchronized (listeners) {
			for (Iterator<IDataListener> iterator = listeners.iterator(); iterator.hasNext();) {
				iterator.next().dataChangePerformed(evt);
			}
		}
	}

	public boolean hasDataListeners() {
		return listeners.size() > 0;
	}

	public void clear() {
		listeners.clear();
 	}

}

/*-
 * Copyright 2015, 2016 Diamond Light Source Ltd.
 *
 * 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
 */

package org.eclipse.january.dataset;

import java.util.Collections;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Class used by DynamicDataset to delegate
 */
public class DataListenerDelegate {

	private Set<IDataListener> listeners;

	public DataListenerDelegate() {
		listeners = Collections.newSetFromMap(new ConcurrentHashMap<IDataListener, Boolean>());
	}

	public void addDataListener(IDataListener l) {
		listeners.add(l);
	}

	public void removeDataListener(IDataListener l) {
		listeners.remove(l);
	}

	public void fire(DataEvent evt) {
		for (IDataListener listener : listeners) {
			listener.dataChangePerformed(evt);
		}
	}

	public boolean hasDataListeners() {
		return listeners.size() > 0;
	}

	public void clear() {
		listeners.clear();
	}

}

Improve thread safety around adding and removing IDataListener's


package io.github.vyo.hellojersey.application;

import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.listing.SwaggerSerializers;
import io.swagger.jersey.listing.ApiListingResourceJSON;
import org.glassfish.jersey.server.ResourceConfig;

import javax.ws.rs.ApplicationPath;

/**
 * Created by Manuel Weidmann on 01.03.2015.
 */
@ApplicationPath("api")
public class Application extends ResourceConfig {

    public Application() {
        packages(true, "io.github.vyo.hellojersey");

        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setTitle("Hello Jersey");
        beanConfig.setVersion("3.1.0");
        beanConfig.setHost("hellojersey.herokuapp.com");
        beanConfig.setBasePath("/api");
        beanConfig.setResourcePackage("io.github.vyo.hellojersey");
        beanConfig.setScan(true);
        register(new ApiListingResourceJSON());
        register(new SwaggerSerializers());
    }
}

package io.github.vyo.hellojersey.application;

import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.jaxrs.listing.SwaggerSerializers;
import io.swagger.jersey.listing.ApiListingResourceJSON;
import org.glassfish.jersey.server.ResourceConfig;

import javax.ws.rs.ApplicationPath;

/**
 * Created by Manuel Weidmann on 01.03.2015.
 */
@ApplicationPath("api")
public class Application extends ResourceConfig {

    public Application() {
        packages(true, "io.github.vyo.hellojersey");

        BeanConfig beanConfig = new BeanConfig();
        beanConfig.setTitle("Hello Jersey");
        beanConfig.setVersion("3.2.0");
        beanConfig.setHost("hellojersey.herokuapp.com");
        beanConfig.setBasePath("/api");
        beanConfig.setResourcePackage("io.github.vyo.hellojersey");
        beanConfig.setScan(true);
        register(new ApiListingResourceJSON());
        register(new SwaggerSerializers());
    }
}

Fix version in swagger spec to be 3.2.0


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

import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.Map;

import org.apache.commons.lang3.builder.ToStringStyle;
import org.junit.jupiter.api.AfterEach;

public class AbstractLangTest {

    /**
     * All tests should leave the {@link ToStringStyle} registry empty.
     */
    @AfterEach
    public void after() {
        validateNullToStringStyleRegistry();
    }

    void validateNullToStringStyleRegistry() {
        final Map<Object, Object> registry = ToStringStyle.getRegistry();
        assertNull(registry, "Expected null, actual: " + registry);
    }

}

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

import static org.junit.jupiter.api.Assertions.assertNull;

import java.util.Map;

import org.apache.commons.lang3.builder.ToStringStyle;
import org.junit.jupiter.api.AfterEach;

public class AbstractLangTest {

    /**
     * All tests should leave the {@link ToStringStyle} registry empty.
     */
    @AfterEach
    public void after() {
        validateNullToStringStyleRegistry();
    }

    void validateNullToStringStyleRegistry() {
        assertNull(ToStringStyle.getRegistry(), "Expected null, actual: " + ToStringStyle.getRegistry());
    }

}

Remove single use locval variable


package reactor.kafka;

import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;

public class KafkaPublisher<T> implements Publisher<T> {

  @Override
  public void subscribe(Subscriber<? super T> subscriber) {

  }
}

package reactor.kafka;

import kafka.consumer.Consumer;
import kafka.consumer.ConsumerConfig;
import kafka.consumer.ConsumerIterator;
import kafka.consumer.KafkaStream;
import kafka.javaapi.consumer.ConsumerConnector;
import kafka.message.MessageAndMetadata;
import kafka.serializer.Decoder;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class KafkaPublisher<K, V> implements Publisher<KeyValuePair<K, V>> {

  private final static int concurrencyLevel = 1;

  private final ExecutorService                                           executor;
  private final Map<Subscription, Subscriber<? super KeyValuePair<K, V>>> subscribers;

  public KafkaPublisher(Properties consumerProperties,
                        String topic,
                        Decoder<K> keyDecoder,
                        Decoder<V> valueDecoder) {
    this.subscribers = new ConcurrentHashMap<>();
    this.executor = Executors.newFixedThreadPool(concurrencyLevel);
    ConsumerConnector consumer = Consumer.createJavaConsumerConnector(
      new ConsumerConfig(consumerProperties));

    Map<String, Integer> topicCountMap = new HashMap<String, Integer>();
    topicCountMap.put(topic, concurrencyLevel);
    Map<String, List<KafkaStream<K, V>>> consumerMap =
      consumer.createMessageStreams(topicCountMap,
                                    keyDecoder,
                                    valueDecoder);
    List<KafkaStream<K, V>> streams = consumerMap.get(topic);

    for (final KafkaStream stream : streams) {
      executor.execute(() -> {
        ConsumerIterator<K, V> it = stream.iterator();
        while (it.hasNext() && !Thread.currentThread().isInterrupted()) {
          MessageAndMetadata<K, V> msg = it.next();
          KeyValuePair<K, V> kvp = new KeyValuePair<K, V>(msg.key(), msg.message());

          for(Map.Entry<Subscription, Subscriber<? super KeyValuePair<K, V>>> entry: subscribers.entrySet()) {
            entry.getValue().onNext(kvp);
          }

        }
      });
    }

  }

  @Override
  public void subscribe(Subscriber<? super KeyValuePair<K, V>> subscriber) {
    this.subscribers.put(new KafkaSubscription<>(subscriber,
                                                 subscribers::remove),
                         subscriber);

  }

}

Implement kafka publisher on top of reactive streams


package org.themoviedb.movieinfo.testcase;

import org.robolectric.annotation.Config;
import org.themoviedb.movieinfo.BuildConfig;
import org.themoviedb.movieinfo.TestApplication;

@Config(application = TestApplication.class,
        constants = BuildConfig.class,
        sdk = 18)
public class BaseTest {
}

package org.themoviedb.movieinfo.testcase;

import org.robolectric.annotation.Config;
import org.themoviedb.movieinfo.BuildConfig;
import org.themoviedb.movieinfo.TestApplication;

@Config(application = TestApplication.class,
        constants = BuildConfig.class,
        sdk = 21)
public class BaseTest {
}

Use sdk 21 to run robolectric


public class HelloWorldAppl {

	public static void main(String[] args) {
		System.out.println("Hello, world!");
	}

}

public class HelloWorldAppl {

	public static void main(String[] args) {
		System.out.println("Hello, world!");
		System.out.println("Good buy, world!");
	}

}

Add "Good buy" to main appl


package me.coley.recaf.command.completion;

import me.coley.recaf.Recaf;
import me.coley.recaf.workspace.Workspace;

import java.util.*;

/**
 * Picocli completion for names loaded in the current workspace.
 *
 * @author Matt
 */
public abstract class WorkspaceNameCompletions implements Iterable<String> {
	@Override
	public Iterator<String> iterator() {
		Workspace workspace = Recaf.getCurrentWorkspace();
		if (workspace == null)
			return Collections.emptyIterator();
		return workspace.getClassNames().stream().sorted().iterator();
	}
}

package me.coley.recaf.command.completion;

import me.coley.recaf.Recaf;
import me.coley.recaf.workspace.Workspace;

import java.util.*;

/**
 * Picocli completion for names loaded in the current workspace.
 *
 * @author Matt
 */
public class WorkspaceNameCompletions implements Iterable<String> {
	@Override
	public Iterator<String> iterator() {
		Workspace workspace = Recaf.getCurrentWorkspace();
		if (workspace == null)
			return Collections.emptyIterator();
		return workspace.getClassNames().stream().sorted().iterator();
	}
}

Fix initialization error for autocompletion