package mariculture.fishery.fish.dna;

import mariculture.api.fishery.fish.FishDNA;
import mariculture.api.fishery.fish.FishSpecies;
import mariculture.core.config.FishMechanics.FussyFish;
import net.minecraft.item.ItemStack;

public class FishDNALifespan extends FishDNA {
    @Override
    public Integer getDNAFromSpecies(FishSpecies species) {
        return species.getLifeSpan() * 20 * 60;
    }

    @Override
    public ItemStack addDNA(ItemStack stack, Integer data) {
        super.addDNA(stack, data);
        stack.stackTagCompound.setInteger("CurrentLife", data);
        return stack;
    }

    @Override
    public int getCopyChance() {
        return 12;
    }

    public Integer sanitize(Integer i) {
        return Math.min(300, Math.max(1, i));
    }

    @Override
    public Integer getDNA(ItemStack stack) {
        return sanitize(super.getDNA(stack) + FussyFish.LIFESPAN_BOOSTER);
    }

    @Override
    public Integer getLowerDNA(ItemStack stack) {
        return sanitize(super.getLowerDNA(stack) + FussyFish.LIFESPAN_BOOSTER);
    }
}

package mariculture.fishery.fish.dna;

import mariculture.api.fishery.fish.FishDNA;
import mariculture.api.fishery.fish.FishSpecies;
import mariculture.core.config.FishMechanics.FussyFish;
import net.minecraft.item.ItemStack;

public class FishDNALifespan extends FishDNA {
    @Override
    public Integer getDNAFromSpecies(FishSpecies species) {
        return species.getLifeSpan() * 20 * 60;
    }

    @Override
    public ItemStack addDNA(ItemStack stack, Integer data) {
        super.addDNA(stack, data);
        stack.stackTagCompound.setInteger("CurrentLife", data);
        return stack;
    }

    @Override
    public int getCopyChance() {
        return 12;
    }

    public Integer sanitize(Integer i) {
        return Math.min(360000, Math.max(1, i));
    }

    @Override
    public Integer getDNA(ItemStack stack) {
        return sanitize(super.getDNA(stack) + FussyFish.LIFESPAN_BOOSTER);
    }

    @Override
    public Integer getLowerDNA(ItemStack stack) {
        return sanitize(super.getLowerDNA(stack) + FussyFish.LIFESPAN_BOOSTER);
    }
}

Fix fish max lifespan being 300 ticks instead of 300 minutes.


package mods.smbarbour.strangetoolkit;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import mods.smbarbour.strangetoolkit.commands.OMTChangeOwnerCommand;

@Mod(modid = "strangetoolkit", name="StrangeToolkit", version = "1.0")
public class StrangeToolkit
{
	@Mod.EventHandler
	public void serverStarting(FMLServerStartingEvent e) {
		if (Loader.isModLoaded("openmodularturrets")) {
			e.registerServerCommand(new OMTChangeOwnerCommand());
		}
	}
}

package mods.smbarbour.strangetoolkit;

import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkCheckHandler;
import cpw.mods.fml.relauncher.Side;
import mods.smbarbour.strangetoolkit.commands.OMTChangeOwnerCommand;

import java.util.Map;

@Mod(modid = "strangetoolkit", name="StrangeToolkit", version = "1.0")
public class StrangeToolkit
{
	@Mod.EventHandler
	public void serverStarting(FMLServerStartingEvent e) {
		if (Loader.isModLoaded("openmodularturrets")) {
			e.registerServerCommand(new OMTChangeOwnerCommand());
		}
	}

	@NetworkCheckHandler
	public boolean isAcceptable(Map<String,String> modList, Side side) {
		return true;
	}
}

Make sure that this works as a server-side only mod (no client needed)


/*
 *     Copyright (C) 2015  higherfrequencytrading.com
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.openhft.chronicle.network.api;

import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.network.api.session.SessionDetailsProvider;

/**
 * Created by peter.lawrey on 22/01/15.
 */
@FunctionalInterface
public interface TcpHandler {
    void process(Bytes in, Bytes out, SessionDetailsProvider sessionDetails);

    default void sendHeartBeat(Bytes outBBB, SessionDetailsProvider sessionDetails) {
    }

    default void onEndOfConnection(boolean heartbeatTimeOut) {
    }
}

/*
 *     Copyright (C) 2015  higherfrequencytrading.com
 *
 *     This program is free software: you can redistribute it and/or modify
 *     it under the terms of the GNU Lesser General Public License as published by
 *     the Free Software Foundation, either version 3 of the License.
 *
 *     This program is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU Lesser General Public License for more details.
 *
 *     You should have received a copy of the GNU Lesser General Public License
 *     along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.openhft.chronicle.network.api;

import net.openhft.chronicle.bytes.Bytes;
import net.openhft.chronicle.network.api.session.SessionDetailsProvider;

/**
 * Created by peter.lawrey on 22/01/15.
 */
@FunctionalInterface
public interface TcpHandler {
    void process(Bytes in, Bytes out, SessionDetailsProvider sessionDetails);

    default void sendHeartBeat(Bytes out, SessionDetailsProvider sessionDetails) {
    }

    default void onEndOfConnection(boolean heartbeatTimeOut) {
    }
}

Add a high range, precision histogram for tests


package uk.ac.ebi.quickgo.solr.query.model.annotation.enums;

/**
 * Enum for Solr Annotation fields
 * @author cbonill
 *
 */
public enum AnnotationField {

	ID("id"),
	DBOBJECTID("dbObjectID"),
	TARGETSET("targetSet"),
	DOCTYPE("docType"),
	GOASPECT("goAspect"),
	ASSIGNEDBY("assignedBy"),
	GOEVIDENCE("goEvidence"),
	WITH("with"),
	GOID("goID"),
	ECOID("ecoID"),
	QUALIFIER("qualifier"),
	TAXONOMYID("taxonomyId"),
	TAXONOMYCLOSURE("taxonomyClosure"),
	DBXREF("dbXref"),
	ANCESTORSI("ancestorsI"),
	ANCESTORSIPO("ancestorsIPO"),
	ANCESTORSIPOR("ancestorsIPOR"),
	ECOANCESTORSI("ecoAncestorsI"),
	GP2PROTEIN("gp2protein"),
	SUBSET("subSet");

	String value;

	private AnnotationField(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}

package uk.ac.ebi.quickgo.solr.query.model.annotation.enums;

/**
 * Enum for Solr Annotation fields
 * @author cbonill
 *
 */
public enum AnnotationField {

	ID("id"),
	DBOBJECTID("dbObjectID"),
	TARGETSET("targetSet"),
	DOCTYPE("docType"),
	GOASPECT("goAspect"),
	ASSIGNEDBY("assignedBy"),
	GOEVIDENCE("goEvidence"),
	WITH("with"),
	GOID("goID"),
	ECOID("ecoID"),
	QUALIFIER("qualifier"),
	TAXONOMYID("taxonomyId"),
	TAXONOMYCLOSURE("taxonomyClosure"),
	DBXREF("dbXref"),
	ANCESTORSI("ancestorsI"),
	ANCESTORSIPO("ancestorsIPO"),
	ANCESTORSIPOR("ancestorsIPOR"),
	ECOANCESTORSI("ecoAncestorsI"),
	GP2PROTEIN("gp2protein"),
	SUBSET("subSet"),
	REFERENCE("dbXref");

	String value;

	private AnnotationField(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}

Add the annotation enum so we can filter by reference values.


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

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Server configuration for Spring.
 */
@Configuration
public class ServerConfig {

    /*
     This will override "SpringMicroservicesRunner" bean configured in default MSF4JSpringConfiguration class, this
     enables to start Netty transport on 9090 port.
     NOTE - Due to Spring framework limitations this feature only work with Spring versions starting from 4.2.0
     */
    @Bean
    public SpringMicroservicesRunner springMicroservicesRunner() {
        return new SpringMicroservicesRunner(9291);
    }
}

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

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Server configuration for Spring.
 */
@Configuration
public class ServerConfig {

    /*
     This will override "SpringMicroservicesRunner" bean configured in default MSF4JSpringConfiguration class, this
     enables to start Netty transport on 9291 port.
     NOTE - Due to Spring framework limitations this feature only work with Spring versions starting from 4.2.0
     */
    @Bean
    public SpringMicroservicesRunner springMicroservicesRunner() {
        return new SpringMicroservicesRunner(9291);
    }
}

Use a non standard port for Spring tests to avoid clashes


package com.hypirion.beckon;

class SignalHandlerNotFoundException extends Exception {

}

package com.hypirion.beckon;

class SignalHandlerNotFoundException extends Exception {
    public SignalHandlerNotFoundException() {
        super("SignalHandler was not found on this JVM -- please report an" +
              "issue at beckon's github page with which JVM and what version" +
              "you're using.");
    }
}

Add in useful error msg on linkage errors.


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

package com.facebook.buck.config;

import com.facebook.buck.util.randomizedtrial.WithProbability;

/**
 * Incremental action graph mode with A/B experiment support.
 *
 * <p>Note that only a stable experiment makes sense here, as incrementality requires at least two
 * runs in a row with the feature enabled to show any effect.
 */
public enum IncrementalActionGraphMode implements WithProbability {
  ENABLED(0.1),
  DISABLED(0.9),
  EXPERIMENT(0.0),
  ;

  public static final IncrementalActionGraphMode DEFAULT = DISABLED;

  private final double probability;

  IncrementalActionGraphMode(double probability) {
    this.probability = probability;
  }

  @Override
  public double getProbability() {
    return probability;
  }
}

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

package com.facebook.buck.config;

import com.facebook.buck.util.randomizedtrial.WithProbability;

/**
 * Incremental action graph mode with A/B experiment support.
 *
 * <p>Note that only a stable experiment makes sense here, as incrementality requires at least two
 * runs in a row with the feature enabled to show any effect.
 */
public enum IncrementalActionGraphMode implements WithProbability {
  ENABLED(0.5),
  DISABLED(0.5),
  EXPERIMENT(0.0),
  ;

  public static final IncrementalActionGraphMode DEFAULT = DISABLED;

  private final double probability;

  IncrementalActionGraphMode(double probability) {
    this.probability = probability;
  }

  @Override
  public double getProbability() {
    return probability;
  }
}

Change incremental action graph experiment to 50/50


package com.modesteam.urutau.builder;

import com.modesteam.urutau.model.Artifact;
import com.modesteam.urutau.model.Epic;
import com.modesteam.urutau.model.Feature;
import com.modesteam.urutau.model.User;

public class ArtifactBuilder {
	private String title;
	private String description;
	private Long id;

	public ArtifactBuilder title(String title){
		this.title = title;
		return this;
	}

	public ArtifactBuilder description(String description){
		this.description = description;
		return this;
	}

	public ArtifactBuilder id(Long id) {
		this.id = id;
		return this;
	}

	public Epic buildEpic(){
		Epic epic = new Epic();
		epic.setId(id);
		epic.setTitle(title);
		epic.setDescription(description);
		return epic;
	}

	public Feature buildFeature(){
		Feature feature = new Feature();
		feature.setId(id);
		feature.setTitle(title);
		feature.setDescription(description);
		return feature;
	}

}

package com.modesteam.urutau.builder;

import com.modesteam.urutau.model.Artifact;
import com.modesteam.urutau.model.Epic;
import com.modesteam.urutau.model.Feature;
import com.modesteam.urutau.model.Storie;
import com.modesteam.urutau.model.UseCase;
import com.modesteam.urutau.model.User;

public class ArtifactBuilder {
	private String title;
	private String description;
	private Long id;

	public ArtifactBuilder title(String title){
		this.title = title;
		return this;
	}

	public ArtifactBuilder description(String description){
		this.description = description;
		return this;
	}

	public ArtifactBuilder id(Long id) {
		this.id = id;
		return this;
	}

	public Epic buildEpic(){
		Epic epic = new Epic();
		epic.setId(id);
		epic.setTitle(title);
		epic.setDescription(description);
		return epic;
	}

	public Feature buildFeature(){
		Feature feature = new Feature();
		feature.setId(id);
		feature.setTitle(title);
		feature.setDescription(description);
		return feature;
	}

	public Storie buildStorie(){
		Storie storie = new Storie();
		storie.setId(id);
		storie.setTitle(title);
		storie.setDescription(description);
		return storie;
	}

	public UseCase buildUseCase(){
		UseCase useCase = new UseCase();
		useCase.setId(id);
		useCase.setTitle(title);
		useCase.setDescription(description);
		return useCase;
	}

}

Increase ArtifactBuild for Mock Test


package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers;

import uk.ac.ic.wlgitbridge.util.Util;

/**
 * Created by Winston on 06/11/14.
 */
public class SnapshotInfo implements Comparable<SnapshotInfo> {

    private int versionId;
    private String comment;
    private WLUser user;
    private String createdAt;

    public SnapshotInfo(int versionID, String createdAt, String name, String email) {
        this(versionID, "Update on " + Util.getServiceName() + ".", name, email, createdAt);
    }

    public SnapshotInfo(int versionID, String comment, String email, String name, String createdAt) {
        versionId = versionID;
        this.comment = comment;
        user = new WLUser(name, email);
        this.createdAt = createdAt;
    }

    public int getVersionId() {
        return versionId;
    }

    public String getComment() {
        return comment;
    }

    public WLUser getUser() {
        return user;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof SnapshotInfo)) {
            return false;
        }
        SnapshotInfo that = (SnapshotInfo) obj;
        return versionId == that.versionId;
    }

    @Override
    public int compareTo(SnapshotInfo o) {
        return Integer.compare(versionId, o.versionId);
    }
}

package uk.ac.ic.wlgitbridge.writelatex.api.request.getsavedvers;

import uk.ac.ic.wlgitbridge.util.Util;

/**
 * Created by Winston on 06/11/14.
 */
public class SnapshotInfo implements Comparable<SnapshotInfo> {

    private int versionId;
    private String comment;
    private WLUser user;
    private String createdAt;

    public SnapshotInfo(int versionID, String createdAt, String name, String email) {
        this(versionID, "Update on " + Util.getServiceName() + ".", email, name, createdAt);
    }

    public SnapshotInfo(int versionID, String comment, String email, String name, String createdAt) {
        versionId = versionID;
        this.comment = comment;
        user = new WLUser(name, email);
        this.createdAt = createdAt;
    }

    public int getVersionId() {
        return versionId;
    }

    public String getComment() {
        return comment;
    }

    public WLUser getUser() {
        return user;
    }

    public String getCreatedAt() {
        return createdAt;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof SnapshotInfo)) {
            return false;
        }
        SnapshotInfo that = (SnapshotInfo) obj;
        return versionId == that.versionId;
    }

    @Override
    public int compareTo(SnapshotInfo o) {
        return Integer.compare(versionId, o.versionId);
    }
}

Fix bug with Overleaf commits swapping name and email.


package pingis.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pingis.entities.TaskImplementation;
import pingis.repositories.TaskImplementationRepository;
import pingis.repositories.TaskRepository;
import pingis.repositories.UserRepository;

@Service
public class TaskImplementationService {

    @Autowired
    private TaskRepository taskRepository;
    @Autowired
    private TaskImplementationRepository taskImplementationRepository;
    @Autowired
    private UserRepository userRepository;

    public TaskImplementation getCorrespondingTestTaskImplementation(
            TaskImplementation implTaskImplementation) {
        return taskImplementationRepository.
                findByTaskAndUser(
                        taskRepository.
                                findByIndexAndChallenge(implTaskImplementation.getTask().getIndex()-1,
                                        implTaskImplementation.getTask().getChallenge()),
                        userRepository.findOne(0l));
    }

    public TaskImplementation getCorrespondingImplTaskImplementation(TaskImplementation testTaskImplementation) {
        return taskImplementationRepository.
                findByTaskAndUser(
                        taskRepository.findByIndexAndChallenge(testTaskImplementation.getTask().getIndex()+1,
                                testTaskImplementation.getTask().getChallenge()),
                        userRepository.findOne(0l));
    }

    public TaskImplementation findOne(long taskImplementationId) {
        return taskImplementationRepository.findOne(taskImplementationId);

    }
}

package pingis.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import pingis.entities.TaskImplementation;
import pingis.repositories.TaskImplementationRepository;
import pingis.repositories.TaskRepository;
import pingis.repositories.UserRepository;

@Service
public class TaskImplementationService {

    @Autowired
    private TaskRepository taskRepository;
    @Autowired
    private TaskImplementationRepository taskImplementationRepository;
    @Autowired
    private UserRepository userRepository;

    public TaskImplementation getCorrespondingTestTaskImplementation(
            TaskImplementation implTaskImplementation) {
        return taskImplementationRepository.
                findByTaskAndUser(
                        taskRepository.
                                findByIndexAndChallenge(implTaskImplementation.getTask().getIndex()-1,
                                        implTaskImplementation.getTask().getChallenge()),
                        userRepository.findOne(0l));
    }

    public TaskImplementation getCorrespondingImplTaskImplementation(TaskImplementation testTaskImplementation) {
        return taskImplementationRepository.
                findByTaskAndUser(
                        taskRepository.findByIndexAndChallenge(testTaskImplementation.getTask().getIndex()+1,
                                testTaskImplementation.getTask().getChallenge()),
                        userRepository.findOne(0l));
    }

    public TaskImplementation findOne(long taskImplementationId) {
        return taskImplementationRepository.findOne(taskImplementationId);

    }

    @Transactional
    public TaskImplementation updateTaskImplementationCode(Long taskImplementationId, String taskImplementationCode) {
        TaskImplementation taskImplementationToUpdate = taskImplementationRepository.findOne(taskImplementationId);
        taskImplementationToUpdate.setCode(taskImplementationCode);
        return taskImplementationToUpdate;
    }
}

Add updateTaskImplementationCode() method to TaskImplService


/*
 * (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/)
 *
 * 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 io.github.bonigarcia.test.basic;

// tag::snippet-in-doc[]
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.edge.EdgeDriver;

import io.github.bonigarcia.SeleniumExtension;

@Disabled
@ExtendWith(SeleniumExtension.class)
public class EdgeJupiterTest {

    @Test
    void webrtcTest(EdgeDriver edge) {
        edge.get("https://bonigarcia.github.io/selenium-jupiter/");

        assertTrue(edge.getCurrentUrl().contains("selenium-jupiter"));
    }

}
// end::snippet-in-doc[]

/*
 * (C) Copyright 2017 Boni Garcia (http://bonigarcia.github.io/)
 *
 * 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 io.github.bonigarcia.test.basic;

// tag::snippet-in-doc[]
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.edge.EdgeDriver;

import io.github.bonigarcia.SeleniumExtension;

@Disabled("Edge is not available on Travis CI")
@ExtendWith(SeleniumExtension.class)
public class EdgeJupiterTest {

    @Test
    void webrtcTest(EdgeDriver edge) {
        edge.get("https://bonigarcia.github.io/selenium-jupiter/");

        assertTrue(edge.getCurrentUrl().contains("selenium-jupiter"));
    }

}
// end::snippet-in-doc[]

Include message to disabled tests (not available on Travis)


package es.tid.ps.dynamicprofile.dictionary;

/**
 * Class that defines the native methods to access the comScore dictionary API
 * via JNI.
 *
 * @author dmicol
 */
public class CSDictionaryJNIInterface {
    /**
     * Initializes the dictionary wrapper using the terms in domain file.
     *
     * @param iMode
     *            the operation mode (value should be 1)
     * @param szTermsInDomainFlatFileName
     *            the terms in domain file name
     * @return whether the initialization succeeded
     */
    public native boolean InitFromTermsInDomainFlatFile(int iMode,
            String szTermsInDomainFlatFileName);

    /**
     * Loads the comScore dictionary in memory.
     *
     * @param iMode
     *            the operation mode (value should be 1)
     * @param szTermsInDomainFlatFileName
     *            the terms in domain file name
     * @param szDictionaryName
     *            the file name of the dictionary
     * @return whether the load of the dictionary succeeded
     */
    public native boolean LoadCSDictionary(int iMode,
            String szTermsInDomainFlatFileName, String szDictionaryName);

    /**
     * Applies the dictionary to the given URL, and returns the pattern ID for
     * such URL.
     *
     * @param szURL
     *            the url to apply the dictionary to
     * @return the pattern ID of the URL
     */
    public native long ApplyDictionaryUsingUrl(String szURL);

    static {
        System.load("/usr/lib64/libCategories.so");
    }
}

package es.tid.ps.dynamicprofile.dictionary;

/**
 * Class that defines the native methods to access the comScore dictionary API
 * via JNI.
 *
 * @author dmicol
 */
public class CSDictionaryJNIInterface {
    /**
     * Initializes the dictionary wrapper using the terms in domain file.
     *
     * @param iMode
     *            the operation mode (value should be 1)
     * @param szTermsInDomainFlatFileName
     *            the terms in domain file name
     * @return whether the initialization succeeded
     */
    public native boolean InitFromTermsInDomainFlatFile(int iMode,
            String szTermsInDomainFlatFileName);

    /**
     * Loads the comScore dictionary in memory.
     *
     * @param iMode
     *            the operation mode (value should be 1)
     * @param szTermsInDomainFlatFileName
     *            the terms in domain file name
     * @param szDictionaryName
     *            the file name of the dictionary
     * @return whether the load of the dictionary succeeded
     */
    public native boolean LoadCSDictionary(int iMode,
            String szTermsInDomainFlatFileName, String szDictionaryName);

    /**
     * Applies the dictionary to the given URL, and returns the pattern ID for
     * such URL.
     *
     * @param szURL
     *            the url to apply the dictionary to
     * @return the pattern ID of the URL
     */
    public native long ApplyDictionaryUsingUrl(String szURL);

    static {
        System.load("/user/hdfs/libCategories.so");
    }
}

Modify libCategories.so path to use hdfs.


package org.helioviewer.plugins.eveplugin.view.linedataselector.cellrenderer;

import java.awt.Component;

import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import org.helioviewer.plugins.eveplugin.view.linedataselector.LineDataSelectorElement;

public class LoadingCellRenderer extends DefaultTableCellRenderer {

    private static final long serialVersionUID = 2173458369966852891L;

    private final JProgressBar downloadProgressBar = new JProgressBar();

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        LineDataSelectorElement element = (LineDataSelectorElement) value;
        downloadProgressBar.setIndeterminate(true);
        downloadProgressBar.setVisible(element.isDownloading());
        return downloadProgressBar;
    }
}

package org.helioviewer.plugins.eveplugin.view.linedataselector.cellrenderer;

import java.awt.Component;

import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import org.helioviewer.base.logging.Log;
import org.helioviewer.plugins.eveplugin.view.linedataselector.LineDataSelectorElement;

public class LoadingCellRenderer extends DefaultTableCellRenderer {

    private static final long serialVersionUID = 2173458369966852891L;

    private final JProgressBar downloadProgressBar = new JProgressBar();

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        LineDataSelectorElement element = (LineDataSelectorElement) value;
        Log.debug("element is downloading : " + element.isDownloading());
        if (element.isDownloading()) {
            downloadProgressBar.setIndeterminate(true);
            downloadProgressBar.setVisible(element.isDownloading());
            return downloadProgressBar;
        } else {
            return null;
        }
    }
}

Remove progress bar if element if not loading anymore


package org.sample;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

import java.util.LinkedHashMap;

public class GreetingPlugin implements Plugin<Project> {

    public void apply(Project project) {
        GreetingExtension extension = project.getExtensions().create("greeting", GreetingExtension.class);
        Provider<GreetingTask> task = project.getTasks().register("greeting", GreetingTask.class);
        project.afterEvaluate(p -> {
            task.configure {
                setWho(extension.getWho());
            }
        });
    }
}

package org.sample;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

import java.util.LinkedHashMap;

public class GreetingPlugin implements Plugin<Project> {

    public void apply(Project project) {
        GreetingExtension extension = project.getExtensions().create("greeting", GreetingExtension.class);
        Provider<GreetingTask> task = project.getTasks().register("greeting", GreetingTask.class);
        project.afterEvaluate(p -> {
            task.configure({
                setWho(extension.getWho());
            })
        });
    }
}

Fix broken composite build sample


package com.codingchili.core.storage;

import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.*;
import org.junit.runner.RunWith;

import com.codingchili.core.testing.MapTestCases;

/**
 * @author Robin Duda
 *         <p>
 *         Tests for the storage providers in core. Reuse these tests when new
 *         storage subsystems are implemented using the StorageLoader.
 */
@Ignore("Requires running mongodb server.")
@RunWith(VertxUnitRunner.class)
public class MongoDBMapIT extends MapTestCases {

    @Before
    public void setUp(TestContext test) {
        super.setUp(test, MongoDBMap.class);
    }

    @After
    public void tearDown(TestContext test) {
        super.tearDown(test);
    }
}

package com.codingchili.core.storage;

import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.*;
import org.junit.runner.RunWith;

import com.codingchili.core.testing.MapTestCases;

/**
 * @author Robin Duda
 *         <p>
 *         Tests for the storage providers in core. Reuse these tests when new
 *         storage subsystems are implemented using the StorageLoader.
 */
@RunWith(VertxUnitRunner.class)
public class MongoDBMapIT extends MapTestCases {

    @Before
    public void setUp(TestContext test) {
        super.setUp(test, MongoDBMap.class);
    }

    @After
    public void tearDown(TestContext test) {
        super.tearDown(test);
    }
}

Enable mongoDB test cases to run on CI


package io.khe.kenthackenough;

/**
 * Simple class to hold config options for the rest of the application
 */
public class Config{
    // the url of the api
    public static final String API_URL = "http://api.khe.pdilyard.com";
    // client id, only used in authentication
    public static final String API_CLIENT= "isaacpark";
}

package io.khe.kenthackenough;

/**
 * Simple class to hold config options for the rest of the application
 */
public class Config{
    // the url of the api
    public static final String API_URL = "http://api.khe.pdilyard.com/v1.0";
    // client id, only used in authentication
    public static final String API_CLIENT= "isaacpark";
}

Update api url to new address


package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;

import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;

public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {

	protected final int lit;

	public IntLiteralTermMatchPattern(int lit, SourceSection source) {
		super(source);
		this.lit = lit;
	}

	@Specialization(guards = "i == lit")
	public void doSuccess(int i) {

	}

	@Specialization
	public void doFailure(int i) {
		throw PatternMatchFailure.INSTANCE;
	}

}

package org.metaborg.meta.lang.dynsem.interpreter.nodes.matching;

import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.profiles.ConditionProfile;
import com.oracle.truffle.api.source.SourceSection;

public abstract class IntLiteralTermMatchPattern extends LiteralMatchPattern {

	protected final int lit;

	public IntLiteralTermMatchPattern(int lit, SourceSection source) {
		super(source);
		this.lit = lit;
	}

	private final ConditionProfile profile = ConditionProfile.createCountingProfile();

	@Specialization
	public void doSuccess(int i) {
		if (profile.profile(i != lit)) {
			throw PatternMatchFailure.INSTANCE;
		}
	}

}

Fix competely invalid value specialization in integer literal matching


package io.openex.email.attachment;

import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultAttachment;

import javax.mail.util.ByteArrayDataSource;
import java.util.ArrayList;
import java.util.List;

import static io.openex.email.attachment.EmailDownloader.ATTACHMENTS_CONTENT;

/**
 * Created by Julien on 19/12/2016.
 */
@SuppressWarnings({"PackageAccessibility", "WeakerAccess"})
public class EmailAttacher {

	@SuppressWarnings({"unused", "unchecked"})
	public void process(Exchange exchange) {
		List<EmailAttachment> filesContent = (List) exchange.getProperty(ATTACHMENTS_CONTENT, new ArrayList<>());exchange.setProperty(Exchange.CHARSET_NAME, "UTF-8");

		for (EmailAttachment attachment : filesContent) {
			ByteArrayDataSource bds = new ByteArrayDataSource(attachment.getData(), attachment.getContentType());
			exchange.getIn().addAttachmentObject(attachment.getName(), new DefaultAttachment(bds));
		}
	}
}

package io.openex.email.attachment;

import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultAttachment;

import javax.mail.util.ByteArrayDataSource;
import java.util.ArrayList;
import java.util.List;

import static io.openex.email.attachment.EmailDownloader.ATTACHMENTS_CONTENT;

/**
 * Created by Julien on 19/12/2016.
 */
@SuppressWarnings({"PackageAccessibility", "WeakerAccess"})
public class EmailAttacher {

	@SuppressWarnings({"unused", "unchecked"})
	public void process(Exchange exchange) {
		List<EmailAttachment> filesContent = (List) exchange.getProperty(ATTACHMENTS_CONTENT, new ArrayList<>());
		for (EmailAttachment attachment : filesContent) {
			ByteArrayDataSource bds = new ByteArrayDataSource(attachment.getData(), attachment.getContentType());
			exchange.getIn().addAttachmentObject(attachment.getName(), new DefaultAttachment(bds));
		}
	}
}

Remove extra line already handle by the route xml


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

import org.springframework.context.annotation.ComponentScan;

/**
 * No-op marker interface. Helps to configure extdirectspring in a type-safe way with
 * {@link ComponentScan#basePackageClasses()}
 *

 *
 *

 *   {@literal @}Configuration
 *   {@literal @}ComponentScan(basePackageClasses=ExtDirectSpring.class)
 *   public class Application { ... }
 *

 */
public interface ExtDirectSpring {

}

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

import org.springframework.context.annotation.ComponentScan;

/**
 * No-op marker interface. Helps to configure extdirectspring in a type-safe way with
 * {@link ComponentScan#basePackageClasses()}
 *

 *
 *

 *   {@literal @}Configuration
 *   {@literal @}ComponentScan(basePackageClasses=ExtDirectSpring.class)
 *   public class Application { ... }
 *

 */
public interface ExtDirectSpring {
	// nothing here. just a marker interface
}

Resolve a warning in eclipse


// 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
// 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.cloud.utils;

import org.junit.Assert;
import org.junit.Test;

public class TernaryTest {
    @Test
    public void testEquals() {
        Assert.assertEquals(new Ternary<String, String, String>("a", "b", "c"), new Ternary<String, String, String>(
                "a", "b", "c"));
        Assert.assertFalse(new Ternary<String, String, String>("a", "b", "c")
                .equals(new Ternary<String, String, String>("a", "b", "d")));
        Assert.assertFalse(new Ternary<String, String, String>("a", "b", "c").equals(""));
        Assert.assertFalse(new Ternary<String, String, String>("a", "b", "c").equals(null));
        Assert.assertFalse(new Ternary<String, String, String>("a", "b", "c")
                .equals(new Pair<String, String>("a", "b")));
    }
}

Fix RAT check broken by a1a68ed0c4b722


/**
 * Copyright © 2013 Commerce Technologies, LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   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.commercehub.gradle.plugin.avro;

import org.gradle.api.file.FileCollection;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.SourceTask;

import java.io.File;

class OutputDirTask extends SourceTask {
    private File outputDir;

    public void setOutputDir(File outputDir) {
        this.outputDir = outputDir;
        getOutputs().dir(outputDir);
    }

    protected File getOutputDir() {
        return outputDir;
    }

    protected FileCollection filterSources(Spec<? super File> spec) {
        return getInputs().getSourceFiles().filter(spec);
    }
}

/**
 * Copyright © 2013 Commerce Technologies, LLC.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   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.commercehub.gradle.plugin.avro;

import org.gradle.api.file.FileCollection;
import org.gradle.api.specs.Spec;
import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.SourceTask;

import java.io.File;

class OutputDirTask extends SourceTask {
    private File outputDir;

    public void setOutputDir(File outputDir) {
        this.outputDir = outputDir;
        getOutputs().dir(outputDir);
    }

    @OutputDirectory
    protected File getOutputDir() {
        return outputDir;
    }

    protected FileCollection filterSources(Spec<? super File> spec) {
        return getInputs().getSourceFiles().filter(spec);
    }
}

Tag output directory for better input/output handling


package com.jamierf.dropwizard.config;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.vafer.jdeb.utils.Utils;

public class DebConfiguration {

    private MavenProject project;
    private MavenSession session;

    public void setProject(MavenProject project) {
        this.project = project;
    }

    public void setSession(MavenSession session) {
        this.session = session;
    }

    @Parameter
    private String maintainer = "Unspecified";

    @SuppressWarnings("unused")
    public String getName() {
        return project.getArtifactId();
    }

    @SuppressWarnings("unused")
    public String getVersion() {
        return Utils.convertToDebianVersion(project.getVersion(), false, null, session.getStartTime());
    }

    @SuppressWarnings("unused")
    public String getMaintainer() {
        return maintainer;
    }
}

package com.jamierf.dropwizard.config;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.vafer.jdeb.utils.Utils;

public class DebConfiguration {

    private MavenProject project;
    private MavenSession session;

    public void setProject(MavenProject project) {
        this.project = project;
    }

    public void setSession(MavenSession session) {
        this.session = session;
    }

    @Parameter
    private String maintainer = "Unspecified";

    @SuppressWarnings("unused")
    public String getName() {
        return project.getArtifactId();
    }

    @SuppressWarnings("unused")
    public String getVersion() {
        return Utils.convertToDebianVersion(project.getVersion(), true, null, session.getStartTime());
    }

    @SuppressWarnings("unused")
    public String getMaintainer() {
        return maintainer;
    }
}

Include timestamp in version when building SNAPSHOTS


package com.datasift.client.pylon;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

public class PylonParametersData {
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    protected String interval;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected float span;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected int threshold;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected String target;

    public PylonParametersData() { }

    public PylonParametersData(String interval, Float span, Integer threshold, String target) {
        this.interval = interval;
        this.span = span;
        this.threshold = threshold;
        this.target = target;
    }

    public Float getSpan() {
        return this.span;
    }

    public Integer getThreshold() {
        return this.threshold;
    }

    public String getTarget() {
        return this.target;
    }

    public void setInterval(String interval) {
        this.interval = interval;
    }

    public void setSpan(Float span) {
        this.span = span;
    }

    public void setThreshold(Integer threshold) {
        this.threshold = threshold;
    }

    public void setTarget(String target) {
        this.target = target;
    }
}

package com.datasift.client.pylon;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

public class PylonParametersData {
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    protected String interval;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected float span;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected int threshold;
    @JsonProperty
    @JsonInclude(JsonInclude.Include.NON_DEFAULT)
    protected String target;

    public PylonParametersData() { }

    public PylonParametersData(String interval, Float span, Integer threshold, String target) {
        this.interval = interval;
        this.target = target;
        if (span != null) this.span = span;
        if (threshold != null) this.threshold = threshold;
    }

    public Float getSpan() {
        return this.span;
    }

    public Integer getThreshold() {
        return this.threshold;
    }

    public String getTarget() {
        return this.target;
    }

    public void setInterval(String interval) {
        this.interval = interval;
    }

    public void setSpan(Float span) {
        this.span = span;
    }

    public void setThreshold(Integer threshold) {
        this.threshold = threshold;
    }

    public void setTarget(String target) {
        this.target = target;
    }
}

Check for null values when setting primitives.


/*
 * #%L
 * Course Signup API
 * %%
 * Copyright (C) 2010 - 2013 University of Oxford
 * %%
 * Licensed under the Educational Community 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://opensource.org/licenses/ecl2
 *
 * 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.
 * #L%
 */
package uk.ac.ox.oucs.vle;

/**
 * Base exception class for course signup.
 * This class is abstract as you should always get a more specific instance but may
 * want to have generic handling of all of those errors.
 * @author buckett
 *
 */
public abstract class CourseSignupException extends RuntimeException {

	private static final long serialVersionUID = 3523664446891089880L;

}

/*
 * #%L
 * Course Signup API
 * %%
 * Copyright (C) 2010 - 2013 University of Oxford
 * %%
 * Licensed under the Educational Community 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://opensource.org/licenses/ecl2
 *
 * 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.
 * #L%
 */
package uk.ac.ox.oucs.vle;

/**
 * Base exception class for course signup.
 * This class is abstract as you should always get a more specific instance but may
 * want to have generic handling of all of those errors.
 * @author buckett
 *
 */
public abstract class CourseSignupException extends RuntimeException {

	private static final long serialVersionUID = 3523664446891089880L;

	/**
	 * @link RuntimeException#RuntimeException(String, Throwable)
	 */
	public CourseSignupException(String message, Throwable t) {
		super(message, t);
	}

	protected CourseSignupException() {
		super();
	}

}

Add the super constructor for the PermissionException.


package org.willemsens.player;

import android.app.Application;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.core.CrashlyticsCore;
import io.fabric.sdk.android.Fabric;

public class PlayerApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        if (BuildConfig.USE_CRASHLYTICS) {
            Crashlytics crashlyticsKit = new Crashlytics.Builder()
                    .core(new CrashlyticsCore.Builder().disabled(false).build())
                    .build();

            Fabric.with(this, crashlyticsKit);
        }

        if (BuildConfig.USE_ANSWERS) {
            Fabric.with(this, new Answers());
        }

        // It looks like Fabric / Crashlytics sockets aren't being tagged as they should so strict mode can't be enabled.
        //   https://github.com/square/okhttp/issues/3537
        // StrictMode.enableDefaults();
    }
}

package org.willemsens.player;

import android.app.Application;
import android.os.StrictMode;
import com.crashlytics.android.Crashlytics;
import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.core.CrashlyticsCore;
import io.fabric.sdk.android.Fabric;

public class PlayerApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        if (BuildConfig.USE_CRASHLYTICS) {
            Crashlytics crashlyticsKit = new Crashlytics.Builder()
                    .core(new CrashlyticsCore.Builder().disabled(false).build())
                    .build();

            Fabric.with(this, crashlyticsKit);
        }

        if (BuildConfig.USE_ANSWERS) {
            Fabric.with(this, new Answers());
        }

        if (BuildConfig.DEBUG) {
            StrictMode.enableDefaults();
        }
    }
}

Enable strict mode in debug.


package br.odb.angstronme;

/**
 * Created by monty on 6/6/15.
 */
public class SimpleGestureDetector {

    public Vec2 acc = new Vec2(0, 0);
    public Vec2 touch = new Vec2(0, 0);

    public boolean isHorizontal() {
        float ax = Math.abs(acc.x);
        float ay = Math.abs(acc.y);

        return (ax > ay);
    }

    public void reset() {
        acc.x = 0;
        acc.y = 0;
    }
}

package br.odb.angstronme;

/**
 * Created by monty on 6/6/15.
 */
public class SimpleGestureDetector {

    public static final float TRIVIALITY_THRESHOLD = 50;

    public Vec2 acc = new Vec2(0, 0);
    public Vec2 touch = new Vec2(0, 0);

    public boolean isHorizontal() {
        float ax = Math.abs(acc.x);
        float ay = Math.abs(acc.y);

        return (ax > ay);
    }

    public void reset() {
        acc.x = 0;
        acc.y = 0;
    }

    public boolean movementIsNegligible() {
        float ax = Math.abs(acc.x);
        float ay = Math.abs(acc.y);

        return ( TRIVIALITY_THRESHOLD > ay ) && ( TRIVIALITY_THRESHOLD > ax );
    }
}

Add a threshold to avoid gratuitous movements from small touches


package water.api;

import water.util.TwoDimTable;

public class TwoDimTableV1 extends Schema<TwoDimTable, TwoDimTableV1> {
  @API(help="description", direction=API.Direction.OUTPUT)
  String description;
  @API(help="column names", direction=API.Direction.OUTPUT)
  String[] colNames;
  @API(help="column printf format strings", direction=API.Direction.OUTPUT)
  String[] colFormatStrings; //optional
  @API(help="row headers", direction=API.Direction.OUTPUT)
  String[] rowHeaders;
  @API(help="row-major matrix of string values", direction=API.Direction.OUTPUT)
  String[][] strCellValues;
  @API(help="row-major matrix of numeric (double-precision) values", direction=API.Direction.OUTPUT)
  double[][] dblCellValues;
}

package water.api;

import water.util.TwoDimTable;

public class TwoDimTableV1 extends Schema<TwoDimTable, TwoDimTableV1> {
  @API(help="Table Header", direction=API.Direction.OUTPUT)
  public String tableHeader;
  @API(help="Row Headers", direction=API.Direction.OUTPUT)
  public String[] rowHeaders;
  @API(help="Column Headers", direction=API.Direction.OUTPUT)
  public String[] colHeaders;
  @API(help="Column Types", direction=API.Direction.OUTPUT)
  public String[] colTypes;
  @API(help="Column sprintf Format Strings", direction=API.Direction.OUTPUT)
  public String[] colFormats;
  @API(help="Row-Major Matrix", direction=API.Direction.OUTPUT)
  public String[][] cellValues;
}

Fix TwoDimTable property names in schema.


package com.rmrobotics.library;

import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.util.Range;

/**
 * Created by RM Robotics on 11/23/2015.
 */

public class rServo extends Servo {

    private double minPower;
    private double maxPower;
    private double desiredPower;
    private double currentPower;
    private boolean isContinuous;

    public rServo(boolean x) {
        isContinuous = x;
        if (!isContinuous) {
            maxPower = 0.9;
            minPower = 0.1;
        } else {
            maxPower = 1;
            minPower = 0.1;
        }
    }

    public void set(double x) {
        desiredPower = x;
        currentPower = Range.clip(desiredPower, minPower, maxPower);
        setPosition(currentPower);
    }
}

package com.rmrobotics.library;

import com.qualcomm.robotcore.hardware.Servo;
import com.qualcomm.robotcore.util.Range;

/**
 * Created by RM Robotics on 11/23/2015.
 */

public class rServo{

    private static final double MAX_POWER = 1.0;
    private static final double MIN_POWER = 0.1;

    private Servo parent;
    private Servo.Direction defaultDirection;
    private double minPower;
    private double maxPower;
    private double desiredPower;
    private double currentPower;
    private boolean isContinuous;

    public rServo(Servo s, boolean x){
        parent = s;
        isContinuous = x;
        if(!isContinuous){
            maxPower = 0.9;
            minPower = 0.1;
        } else {
            maxPower = 1;
            minPower = 0;
        }
    }

    public void set(double x) {
        desiredPower = x;
        currentPower = speedCheck(desiredPower);
        //TODO feed power to servo
    }

    private double speedCheck(double p){
        p = Range.clip(minPower, maxPower);
    }

}

Revert back to custom class servo


package edu.erau.hackriddle.cryptapic;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private EditText userField;
    private EditText passField;

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

    public void attemptLogin(View view) {
        //Going to auth later...
        Intent gallery = new Intent(this, GalleryView.class);
        startActivity(gallery);
    }

    public void recoverAccount(View view) {
        Intent accountExists = new Intent(this, AccountExists.class);
        startActivity(accountExists);
    }
}

package edu.erau.hackriddle.cryptapic;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    private EditText userField;
    private EditText passField;
    private Button accountButton;

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

        userField = (EditText) findViewById(R.id.editUsername);
        passField = (EditText) findViewById(R.id.editPassword);
        accountButton = (Button) findViewById(R.id.accountButton);

        if (keysExist()) {
            userField.setVisibility(View.GONE);
            accountButton.setVisibility(View.GONE);
        }
    }

    private boolean keysExist() {
        return true; //true; TODO real condition-- do keys exist
    }

    public void attemptLogin(View view) {
        //Going to auth later...
        Intent gallery = new Intent(this, GalleryView.class);
        startActivity(gallery);
    }

    public void recoverAccount(View view) {
        Intent accountExists = new Intent(this, AccountExists.class);
        startActivity(accountExists);
    }
}

Hide unnecessary elements in main when account "exists"


package poussecafe.test;

import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.IOException;
import poussecafe.domain.EntityAttributes;
import poussecafe.exception.PousseCafeException;

public class JsonDataReader {

    public JsonDataReader() {
        objectMapper = new ObjectMapper();
        objectMapper.enableDefaultTypingAsProperty(DefaultTyping.JAVA_LANG_OBJECT, "@class");
        objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
        objectMapper.registerModule(new JavaTimeModule());
    }

    public <K, D extends EntityAttributes<K>> void readJson(D dataImplementation,
            JsonNode dataJson) {
        try {
            objectMapper.readerForUpdating(dataImplementation).readValue(dataJson);
        } catch (IOException e) {
            throw new PousseCafeException("Unable to load data implementation", e);
        }
    }

    private ObjectMapper objectMapper;
}

package poussecafe.test;

import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.IOException;
import poussecafe.domain.EntityAttributes;
import poussecafe.exception.PousseCafeException;

public class JsonDataReader {

    public JsonDataReader() {
        objectMapper = new ObjectMapper();
        objectMapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE, "@class");
        objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
        objectMapper.registerModule(new JavaTimeModule());
    }

    public <K, D extends EntityAttributes<K>> void readJson(D dataImplementation,
            JsonNode dataJson) {
        try {
            objectMapper.readerForUpdating(dataImplementation).readValue(dataJson);
        } catch (IOException e) {
            throw new PousseCafeException("Unable to load data implementation", e);
        }
    }

    private ObjectMapper objectMapper;
}

Fix polymorphic type handling when loading test data.


package com.elmakers.mine.bukkit.api.action;

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

import java.util.Collection;

public interface SpellAction extends Cloneable
{
    public SpellResult perform(CastContext context);
    public void initialize(ConfigurationSection baseParameters);
    public void prepare(CastContext context, ConfigurationSection parameters);
    public void finish(CastContext context);
    public void reset(CastContext context);
    public void getParameterNames(Spell spell, Collection<String> parameters);
    public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples);
    public boolean usesBrush();
    public boolean isUndoable();
    public boolean requiresBuildPermission();
    public boolean requiresTarget();
    public boolean requiresTargetEntity();
    public String transformMessage(String message);
    public void load(Mage mage, ConfigurationSection data);
    public void save(Mage mage, ConfigurationSection data);
    public int getActionCount();
    public Object clone();
}

package com.elmakers.mine.bukkit.api.action;

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

import java.util.Collection;

public interface SpellAction extends Cloneable
{
    public SpellResult perform(CastContext context);
    public void initialize(Spell spell, ConfigurationSection baseParameters);
    public void prepare(CastContext context, ConfigurationSection parameters);
    public void finish(CastContext context);
    public void reset(CastContext context);
    public void getParameterNames(Spell spell, Collection<String> parameters);
    public void getParameterOptions(Spell spell, String parameterKey, Collection<String> examples);
    public boolean usesBrush();
    public boolean isUndoable();
    public boolean requiresBuildPermission();
    public boolean requiresTarget();
    public boolean requiresTargetEntity();
    public String transformMessage(String message);
    public void load(Mage mage, ConfigurationSection data);
    public void save(Mage mage, ConfigurationSection data);
    public int getActionCount();
    public Object clone();
}

Add Spell context to initialize call


package jpower.core.test;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
        AlphabetTest.class,
        ConditionTest.class,
        ConfigurationTest.class,
        FactoryTest.class,
        InternalTest.class,
        IOUtilsTest.class,
        LoadTest.class,
        MultiMapTest.class,
        PowerLoaderTest.class,
        RandomTest.class,
        ThreadUtilsTest.class,
        ByteUtilsTest.class,
        WorkerTest.class,
        GenericSnifferTest.class,
        OperatingSystemTest.class,
        CallUtilsTest.class,
        ServiceTest.class,
        WrapperTest.class
})
public class CoreTestSuite
{
}

package jpower.core.test;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@RunWith(Suite.class)
@Suite.SuiteClasses({
        AlphabetTest.class,
        ConditionTest.class,
        ConfigurationTest.class,
        FactoryTest.class,
        InternalTest.class,
        IOUtilsTest.class,
        LoadTest.class,
        MultiMapTest.class,
        PowerLoaderTest.class,
        RandomTest.class,
        ThreadUtilsTest.class,
        ByteUtilsTest.class,
        WorkerTest.class,
        GenericSnifferTest.class,
        OperatingSystemTest.class,
        CallUtilsTest.class,
        ServiceTest.class,
        WrapperTest.class,
        RepeaterTest.class
})
public class CoreTestSuite
{
}

Add Repeater Test to Core Suite


package com.naba.url.shortner;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UrlShortnerController {

    @RequestMapping(method = RequestMethod.GET)
    public String defaultPage(Model model) {
        model.addAttribute("urlShortner", new UrlShortner());
        return "index";
    }

    @RequestMapping(value = "/url-shortner", method = RequestMethod.POST)
    public String urlShortner(@ModelAttribute UrlShortner url, Model model) {
        url.setShortnedUrl(url.getOriginalUrl() + "/shortned");
        model.addAttribute("urlShortner", url);
        return "index";
    }
}

package com.naba.url.shortner;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class UrlShortnerController {

    @RequestMapping(method = RequestMethod.GET)
    public String defaultPage(Model model) {
        model.addAttribute("urlShortner", new UrlShortner());
        return "index";
    }

    @RequestMapping(value = "/url-shortner", method = RequestMethod.POST)
    public String urlShortner(@ModelAttribute UrlShortner url, Model model) {
        url.setShortnedUrl(shortenUrl(url.getOriginalUrl()));
        model.addAttribute("urlShortner", url);
        return "index";
    }

    private String shortenUrl(String originalUrl) {
        String shortenedUrl = String.valueOf(originalUrl.hashCode());
        return shortenedUrl;
    }
}

Add logic to shorten url


package com.omralcorut.guardiannews;

import android.content.SharedPreferences;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class SettingsActivity extends AppCompatActivity {

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

    public static class NewsPreferenceFragment extends PreferenceFragment
        implements Preference.OnPreferenceChangeListener {

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.settings_main);

            Preference section = findPreference(getString(R.string.settings_section_key));
            bindPreferenceSummaryToValue(section);
        }

        @Override
        public boolean onPreferenceChange(Preference preference, Object newValue) {
            String stringValue = newValue.toString();
            preference.setSummary(stringValue);
            return true;
        }

        private void bindPreferenceSummaryToValue(Preference preference) {
            preference.setOnPreferenceChangeListener(this);
            SharedPreferences preferences =
                    PreferenceManager.getDefaultSharedPreferences(preference.getContext());
            String preferenceString = preferences.getString(preference.getKey(), "");
            onPreferenceChange(preference, preferenceString);
        }
    }
}

package com.omralcorut.guardiannews;

import android.content.SharedPreferences;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class SettingsActivity extends AppCompatActivity {

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

    public static class NewsPreferenceFragment extends PreferenceFragment
        implements Preference.OnPreferenceChangeListener {

        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            addPreferencesFromResource(R.xml.settings_main);

            Preference section = findPreference(getString(R.string.settings_section_key));
            bindPreferenceSummaryToValue(section);
        }

        @Override
        public boolean onPreferenceChange(Preference preference, Object newValue) {
            String stringValue = newValue.toString();
            preference.setSummary(getLabelGivenValue(stringValue));
            return true;
        }

        private void bindPreferenceSummaryToValue(Preference preference) {
            preference.setOnPreferenceChangeListener(this);
            SharedPreferences preferences =
                    PreferenceManager.getDefaultSharedPreferences(preference.getContext());
            String preferenceString = preferences.getString(preference.getKey(), "");
            onPreferenceChange(preference, preferenceString);
        }

        private String getLabelGivenValue(String value) {
            String result = "All Sections";
            String values[] = getResources().getStringArray(R.array.settings_section_values);
            for (int i = 0; i < values.length; i++) {
                if (value.equals(values[i])) {
                    result = getResources().getStringArray(R.array.settings_section_labels)[i];
                }
            }
            return result;
        }
    }
}

Fix section label issue in settings


package forager.client;

import java.io.IOException;
import java.util.logging.Logger;

/**
 * Monitors currently running tasks and decides when new tasks should be
 * requested based on current processing directives.
 *
 * @author malensek
 */
public class StatusMonitor implements Runnable {

    private static final Logger logger = Logger.getLogger("forager");

    /** Maximum number of concurrent tasks */
    int maxActive = 4;

    boolean online;

    private Forager forager;

    public StatusMonitor(Forager forager) {
        this.forager = forager;
        this.maxActive = forager.getMaxTasks();
    }

    public void run() {
        online = true;

        while (online) {
            int active = forager.getNumActive() + forager.getNumPending();
            if (active < maxActive) {
                int numTasks = maxActive - active;
                try {
                    forager.submitTaskRequest(numTasks);
                } catch (IOException e) {
                    System.out.println("Failed to submit task request!");
                    e.printStackTrace();
                }
            }
            try {
                Thread.sleep(30000);
            } catch (InterruptedException e) {
                logger.fine("Waking up StatusMonitor thread");
            }
        }
    }
}

package forager.client;

import java.io.IOException;
import java.util.logging.Logger;

/**
 * Monitors currently running tasks and decides when new tasks should be
 * requested based on current processing directives.
 *
 * @author malensek
 */
public class StatusMonitor implements Runnable {

    private static final Logger logger = Logger.getLogger("forager");

    /** Maximum number of concurrent tasks */
    int maxActive = 4;

    boolean online;
    private Forager clientInstance;

    public StatusMonitor(Forager clientInstance) {
        this.clientInstance = clientInstance;
        this.maxActive = clientInstance.getMaxTasks();
    }

    public void run() {
        online = true;

        while (online) {
            int active = clientInstance.getNumActive()
                + clientInstance.getNumPending();
            if (active < maxActive) {
                int numTasks = maxActive - active;
                try {
                    clientInstance.submitTaskRequest(numTasks);
                } catch (IOException e) {
                    System.out.println("Failed to submit task request!");
                    e.printStackTrace();
                }
            }
            try {
                Thread.sleep(30000);
            } catch (InterruptedException e) {
                logger.fine("Waking up StatusMonitor thread");
            }
        }
    }
}

Use "clientInstance" instead of just "forager"


package totemic_commons.pokefenn.ceremony;

import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import totemic_commons.pokefenn.api.ceremony.Ceremony;
import totemic_commons.pokefenn.api.music.MusicInstrument;

/**
 * Created by Pokefenn.
 * Licensed under MIT (If this is one of my Mods)
 */
public class CeremonyRain extends Ceremony
{
    public final boolean doRain;

    public CeremonyRain(boolean doRain, String name, int musicNeeded, int maxStartupTime, MusicInstrument... instruments)
    {
        super(name, musicNeeded, maxStartupTime, instruments);
        this.doRain = doRain;
    }

    @Override
    public void effect(World world, BlockPos pos)
    {
        if(!world.isRemote && world.isRaining() != doRain)
        {
            world.getWorldInfo().setRaining(doRain);
        }
    }
}

package totemic_commons.pokefenn.ceremony;

import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import totemic_commons.pokefenn.api.ceremony.Ceremony;
import totemic_commons.pokefenn.api.music.MusicInstrument;

/**
 * Created by Pokefenn.
 * Licensed under MIT (If this is one of my Mods)
 */
public class CeremonyRain extends Ceremony
{
    public final boolean doRain;

    public CeremonyRain(boolean doRain, String name, int musicNeeded, int maxStartupTime, MusicInstrument... instruments)
    {
        super(name, musicNeeded, maxStartupTime, instruments);
        this.doRain = doRain;
    }

    @Override
    public void effect(World world, BlockPos pos)
    {
        if(!world.isRemote && world.isRaining() != doRain)
        {
            world.getWorldInfo().setRaining(doRain);
            world.getWorldInfo().setRainTime(0);
        }
    }
}

Fix weather changing to soon after Rain/Drought ceremony


package org.bouncycastle.crypto.tls;

import java.io.IOException;

/**
 * A generic class for ciphersuites in TLS 1.0.
 */
public abstract class TlsCipherSuite
{

    protected static final short KE_RSA = 1;
    protected static final short KE_RSA_EXPORT = 2;
    protected static final short KE_DHE_DSS = 3;
    protected static final short KE_DHE_DSS_EXPORT = 4;
    protected static final short KE_DHE_RSA = 5;
    protected static final short KE_DHE_RSA_EXPORT = 6;
    protected static final short KE_DH_DSS = 7;
    protected static final short KE_DH_RSA = 8;
    protected static final short KE_DH_anon = 9;

    protected abstract void init(byte[] ms, byte[] cr, byte[] sr);

    protected abstract byte[] encodePlaintext(short type, byte[] plaintext, int offset, int len);

    protected abstract byte[] decodeCiphertext(short type, byte[] plaintext, int offset, int len, TlsProtocolHandler handler) throws IOException;

    protected abstract short getKeyExchangeAlgorithm();

}

package org.bouncycastle.crypto.tls;

import java.io.IOException;

/**
 * A generic class for ciphersuites in TLS 1.0.
 */
public abstract class TlsCipherSuite
{

    protected static final short KE_RSA = 1;
    protected static final short KE_RSA_EXPORT = 2;
    protected static final short KE_DHE_DSS = 3;
    protected static final short KE_DHE_DSS_EXPORT = 4;
    protected static final short KE_DHE_RSA = 5;
    protected static final short KE_DHE_RSA_EXPORT = 6;
    protected static final short KE_DH_DSS = 7;
    protected static final short KE_DH_RSA = 8;
    protected static final short KE_DH_anon = 9;
    protected static final short KE_SRP = 10;
    protected static final short KE_SRP_RSA = 11;
    protected static final short KE_SRP_DSS = 12;

    protected abstract void init(byte[] ms, byte[] cr, byte[] sr);

    protected abstract byte[] encodePlaintext(short type, byte[] plaintext, int offset, int len);

    protected abstract byte[] decodeCiphertext(short type, byte[] plaintext, int offset, int len, TlsProtocolHandler handler) throws IOException;

    protected abstract short getKeyExchangeAlgorithm();

}

Add entries for SRP key exchange algorithms


package to.etc.testutil;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * @author Frits Jalvingh
 * Created on 15-04-22.
 */
final public class TestUtil {
	private TestUtil() {
	}

	public static void nonTestPrintln(String text) {
		if(!inTest())
			System.out.println(text);
	}

	static public boolean inTest() {
		return System.getProperty("surefire.real.class.path") != null || System.getProperty("surefire.test.class.path") != null;
	}

	static public String getGitBranch() {
		try {
			Process process = Runtime.getRuntime().exec("git rev-parse --abbrev-ref HEAD");
			process.waitFor();
			BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
			return reader.readLine();
		} catch(Exception x) {
			return null;
		}
	}

	static public void main(String[] args) {
		System.out.println("branch: " + getGitBranch());
	}

}

package to.etc.testutil;

import java.io.BufferedReader;
import java.io.InputStreamReader;

/**
 * @author Frits Jalvingh
 * Created on 15-04-22.
 */
final public class TestUtil {
	private static boolean m_mavenTest;

	private TestUtil() {
	}

	public static void nonTestPrintln(String text) {
		if(!inTest())
			System.out.println(text);
	}

	static public boolean inTest() {
		return System.getProperty("surefire.real.class.path") != null || System.getProperty("surefire.test.class.path") != null;
	}

	static public String getGitBranch() {
		try {
			Process process = Runtime.getRuntime().exec("git rev-parse --abbrev-ref HEAD");
			process.waitFor();
			BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
			return reader.readLine();
		} catch(Exception x) {
			return null;
		}
	}

	static public void main(String[] args) {
		System.out.println("branch: " + getGitBranch());
	}

	public static synchronized boolean isMavenTest() {
		Boolean mavenTest = m_mavenTest;
		if(null == mavenTest) {
			mavenTest = m_mavenTest = System.getProperty("surefire.real.class.path") != null
				|| System.getProperty("surefire.test.class.path") != null;

		}
		return mavenTest;
	}

}

Add check whether test runs under maven


package com.vaguehope.mikuru;

import android.widget.ScrollView;
import android.widget.TextView;

public class ConsoleAppender {
//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	private final TextView tv;
	private final ScrollView sv;

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	public ConsoleAppender (TextView tv, ScrollView sv) {
		this.tv = tv;
		this.sv = sv;
	}

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	public void append (String... msgs) {
		for (String msg : msgs) {
			this.tv.append(msg);
		}
		this.sv.smoothScrollTo(0, this.tv.getHeight());
	}

	public void clear () {
		this.tv.setText("");
	}

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}

package com.vaguehope.mikuru;

import android.view.View;
import android.widget.ScrollView;
import android.widget.TextView;

public class ConsoleAppender {
//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	private final TextView tv;
	protected final ScrollView sv;

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	public ConsoleAppender (TextView tv, ScrollView sv) {
		this.tv = tv;
		this.sv = sv;
	}

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	public void append (String... msgs) {
		for (String msg : msgs) this.tv.append(msg);
		this.sv.post(this.scrollDown);
	}

	private final Runnable scrollDown = new Runnable() {
		@Override
		public void run() {
			ConsoleAppender.this.sv.fullScroll(View.FOCUS_DOWN);
		}
	};

	public void clear () {
		this.tv.setText("");
	}

//	- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
}

Fix console appended to work correctly.


package com.femalehewmon.nagem.ui;

import android.support.v4.app.FragmentActivity;

public class MainFragment extends FragmentActivity {

}

package com.femalehewmon.nagem.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public class MainFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.article_view, container, false);
    }

}

Correct from activity to Fragment.


package com.athaydes.jgrab.log;

/**
 * Internal logger.
 */
public class Logger {

    private static final String XXX = "--------------";

    public static void log( String message ) {
        System.err.println( message );
    }

    public static void logPhase( String phase ) {
        System.err.println( XXX + " " + phase + " " + XXX );
    }

}

package com.athaydes.jgrab.log;

/**
 * Internal logger.
 */
public class Logger {

    private static final String XXX = "--------------";

    private static boolean enabled = System.getProperty( "jgrab.debug" ) != null;

    public static void log( String message ) {
        if ( enabled ) System.err.println( message );
    }

    public static void logPhase( String phase ) {
        if ( enabled ) System.err.println( XXX + " " + phase + " " + XXX );
    }

}

Enable logger only if system property is activated.


package com.venmo.cursor;

import java.util.Iterator;

/**
 * Default iterator for all {@link IterableCursor}s.
 */
public class CursorIterator<T> implements Iterator<T> {

    private IterableCursor<T> mCursor;

    public CursorIterator(IterableCursor<T> cursor) {
        mCursor = cursor;
    }

    @Override
    public boolean hasNext() {
        return !mCursor.isBeforeFirst() && !mCursor.isAfterLast();
    }

    @Override
    public T next() {
        return mCursor.nextDocument();
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Cannot remove an object in a cursor");
    }
}

package com.venmo.cursor;

import java.util.Iterator;

/**
 * Default iterator for all {@link IterableCursor}s.
 */
public class CursorIterator<T> implements Iterator<T> {

    private final IterableCursor<T> mCursor;

    public CursorIterator(IterableCursor<T> cursor) {
        mCursor = cursor;
    }

    @Override
    public boolean hasNext() {
        return !mCursor.isBeforeFirst() && !mCursor.isAfterLast();
    }

    @Override
    public T next() {
        return mCursor.nextDocument();
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Cannot remove an object in a cursor");
    }
}

Change assigned cursor to be final.


package se.kodsnack;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;

import org.json.JSONException;
import org.json.JSONObject;

public class ListenActivity extends Activity {
    /* Logger tag. */
    private static final String TAG = ListenActivity.class.getSimpleName();

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

}

package se.kodsnack;

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

public class ListenActivity extends Activity {
    /* Logger tag. */
    private static final String TAG = ListenActivity.class.getSimpleName();

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

}

Clean up left over imports.


package in.co.nebulax.magpie;

public class Constants {

	// url to get data JSON
	public static String url = "";

	//JSON Node Names
	public static String TAG_DATA = "data";
	public static String TAG_DEVICE = "device";
	public static String TAG_STATUS = "status";
	public static String TAG_NAME = "name";
}

package in.co.nebulax.magpie;

public class Constants {

	// url to get data JSON
	public static String url = "http://10.0.2.2:1111/all";

	//JSON Node Names
	public static String TAG_DATA = "data";
	public static String TAG_DEVICE = "device";
	public static String TAG_STATUS = "status";
	public static String TAG_NAME = "name";
}

Change url of localhost to 10.0.2.2


/**
 * $Revision: $
 * $Date: $
 *
 * Copyright (C) 2007 Jive Software. All rights reserved.
 *
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
 */

package org.jivesoftware.wildfire.nio;

import org.apache.mina.common.IoSession;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.net.ClientStanzaHandler;
import org.jivesoftware.wildfire.net.StanzaHandler;

/**
 * ConnectionHandler that knows which subclass of {@link StanzaHandler} should
 * be created and how to build and configure a {@link NIOConnection}.
 *
 * @author Gaston Dombiak
 */
public class ClientConnectionHandler extends ConnectionHandler {

    public ClientConnectionHandler(String serverName) {
        super(serverName);
    }

    NIOConnection createNIOConnection(IoSession session) {
        return new NIOConnection(session, XMPPServer.getInstance().getPacketDeliverer());
    }

    StanzaHandler createStanzaHandler(NIOConnection connection) {
        return new ClientStanzaHandler(XMPPServer.getInstance().getPacketRouter(), serverName, connection);
    }

    int getMaxIdleTime() {
        return JiveGlobals.getIntProperty("xmpp.client.idle", 30 * 60 * 1000) / 1000;
    }
}

/**
 * $Revision: $
 * $Date: $
 *
 * Copyright (C) 2007 Jive Software. All rights reserved.
 *
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution.
 */

package org.jivesoftware.wildfire.nio;

import org.apache.mina.common.IoSession;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.wildfire.XMPPServer;
import org.jivesoftware.wildfire.net.ClientStanzaHandler;
import org.jivesoftware.wildfire.net.StanzaHandler;

/**
 * ConnectionHandler that knows which subclass of {@link StanzaHandler} should
 * be created and how to build and configure a {@link NIOConnection}.
 *
 * @author Gaston Dombiak
 */
public class ClientConnectionHandler extends ConnectionHandler {

    public ClientConnectionHandler(String serverName) {
        super(serverName);
    }

    NIOConnection createNIOConnection(IoSession session) {
        return new NIOConnection(session, XMPPServer.getInstance().getPacketDeliverer());
    }

    StanzaHandler createStanzaHandler(NIOConnection connection) {
        return new ClientStanzaHandler(XMPPServer.getInstance().getPacketRouter(), serverName, connection);
    }

    int getMaxIdleTime() {
        return JiveGlobals.getIntProperty("xmpp.client.idle", 2 * 60 * 1000) / 1000;
    }
}

Change default timeout value to 2 minutes. JM-1002


package com.blackberry.kafka.lowoverhead.meta;

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

public class Topic {
  String name;
  List<Partition> partitions = new ArrayList<Partition>();

  public Topic() {
  }

  public Topic(String name) {
    this.name = name;
  }

  public int getNumPartitions() {
    return partitions.size();
  }

  public Partition getPartition(int i) {
    return partitions.get(i);
  }

  public String getName() {
    return name;
  }

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

  public List<Partition> getPartitions() {
    return partitions;
  }

  @Override
  public String toString() {
    return "Topic [name=" + name + ", partitions=" + partitions + "]";
  }
}

package com.blackberry.kafka.lowoverhead.meta;

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

public class Topic {
  String name;
  List<Partition> partitions = new ArrayList<Partition>();

  public Topic() {
  }

  public Topic(String name) {
    this.name = name;
  }

  public int getNumPartitions() {
    return partitions.size();
  }

  public Partition getPartition(int i) {
    for (Partition p : partitions) {
      if (p.getPartId() == i) {
        return p;
      }
    }
    return null;
  }

  public String getName() {
    return name;
  }

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

  public List<Partition> getPartitions() {
    return partitions;
  }

  @Override
  public String toString() {
    return "Topic [name=" + name + ", partitions=" + partitions + "]";
  }
}

Fix major bug which returned the wrong partition metadata


package com.github.ferstl;

import java.util.Arrays;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ParallelStreamSupportTest {

  private ForkJoinPool workerPool;

  @Before
  public void before() {
    this.workerPool = new ForkJoinPool(1);
  }

  @After
  public void after() throws InterruptedException {
    this.workerPool.shutdown();
    this.workerPool.awaitTermination(1, TimeUnit.SECONDS);
  }

  @Test
  public void test() {
    ParallelStreamSupport.parallelStream(Arrays.asList("a"), this.workerPool)
        .forEach(e -> System.out.println(Thread.currentThread().getName()));
  }

}

package com.github.ferstl;

import java.util.List;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import static java.util.Collections.singletonList;
import static java.util.stream.Collectors.toList;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.matchesPattern;
import static org.junit.Assert.assertThat;

public class ParallelStreamSupportTest {

  private static final Pattern FORK_JOIN_THREAD_NAME_PATTERN = Pattern.compile("ForkJoinPool-\\d+-worker-\\d+");

  private ForkJoinPool workerPool;

  @Before
  public void before() {
    this.workerPool = new ForkJoinPool(1);
  }

  @After
  public void after() throws InterruptedException {
    this.workerPool.shutdown();
    this.workerPool.awaitTermination(1, TimeUnit.SECONDS);
  }

  /**
   * Verify that we use the correct thread name pattern.
   */
  @Test
  public void testForkJoinPoolThreadNamePattern() {
    ForkJoinTask<String> task = ForkJoinTask.adapt(() -> Thread.currentThread().getName());
    String threadName = this.workerPool.invoke(task);

    assertThat(threadName, matchesPattern(FORK_JOIN_THREAD_NAME_PATTERN));
  }

  @Test
  @Ignore("Not yet implemented")
  public void collect() {
    List<String> result = ParallelStreamSupport.parallelStream(singletonList("a"), this.workerPool)
        .map(e -> Thread.currentThread().getName())
        .collect(toList());

    assertThat(result, contains(matchesPattern(FORK_JOIN_THREAD_NAME_PATTERN)));
  }

}

Add tets for thread name


package org.apache.taverna.mobile.activities;

import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.fragments.workflowdetails.RunFragment;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;

public class RunResult extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_run_result);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, RunFragment.newInstance())
                    .commit();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        return false;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        this.finish();

        return super.onOptionsItemSelected(item);
    }

}

package org.apache.taverna.mobile.activities;

import org.apache.taverna.mobile.R;
import org.apache.taverna.mobile.fragments.workflowdetails.RunFragment;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;

public class RunResult extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_run_result);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, RunFragment.newInstance())
                    .commit();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        return false;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        this.finish();

        return super.onOptionsItemSelected(item);
    }

}

Use AppCompat instead of ActionBar


package com.gh4a.resolver;

import android.content.Intent;
import android.support.v4.app.FragmentActivity;

import com.gh4a.BackgroundTask;
import com.gh4a.utils.IntentUtils;

public abstract class UrlLoadTask extends BackgroundTask<Intent> {
    protected FragmentActivity mActivity;
    private final boolean mFinishCurrentActivity;
    private ProgressDialogFragment mProgressDialog;

    public UrlLoadTask(FragmentActivity activity) {
        this(activity, true);
    }

    public UrlLoadTask(FragmentActivity activity, boolean finishCurrentActivity) {
        super(activity);
        mActivity = activity;
        mFinishCurrentActivity = finishCurrentActivity;
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        mProgressDialog = ProgressDialogFragment.newInstance(mFinishCurrentActivity);
        mProgressDialog.show(mActivity.getSupportFragmentManager(), "progress");
    }

    @Override
    protected void onSuccess(Intent result) {
        if (mActivity.isFinishing()) {
            return;
        }

        if (result != null) {
            mActivity.startActivity(result);
        } else {
            IntentUtils.launchBrowser(mActivity, mActivity.getIntent().getData());
        }

        dismiss();
    }

    @Override
    protected void onError(Exception e) {
        IntentUtils.launchBrowser(mActivity, mActivity.getIntent().getData());
        dismiss();
    }

    private void dismiss() {
        if (mProgressDialog != null) {
            mProgressDialog.dismiss();
        }
        if (mFinishCurrentActivity) {
            mActivity.finish();
        }
    }
}

package com.gh4a.resolver;

import android.content.Intent;
import android.support.v4.app.FragmentActivity;

import com.gh4a.BackgroundTask;
import com.gh4a.utils.IntentUtils;

public abstract class UrlLoadTask extends BackgroundTask<Intent> {
    protected FragmentActivity mActivity;
    private final boolean mFinishCurrentActivity;
    private ProgressDialogFragment mProgressDialog;

    public UrlLoadTask(FragmentActivity activity) {
        this(activity, true);
    }

    public UrlLoadTask(FragmentActivity activity, boolean finishCurrentActivity) {
        super(activity);
        mActivity = activity;
        mFinishCurrentActivity = finishCurrentActivity;
    }

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        mProgressDialog = ProgressDialogFragment.newInstance(mFinishCurrentActivity);
        mProgressDialog.show(mActivity.getSupportFragmentManager(), "progress");
    }

    @Override
    protected void onSuccess(Intent result) {
        if (mActivity.isFinishing()) {
            return;
        }

        if (result != null) {
            mActivity.startActivity(result);
        } else {
            IntentUtils.launchBrowser(mActivity, mActivity.getIntent().getData());
        }

        dismiss();
    }

    @Override
    protected void onError(Exception e) {
        IntentUtils.launchBrowser(mActivity, mActivity.getIntent().getData());
        dismiss();
    }

    private void dismiss() {
        if (mProgressDialog != null) {
            mProgressDialog.dismissAllowingStateLoss();
        }
        if (mFinishCurrentActivity) {
            mActivity.finish();
        }
    }
}

Fix occasional crash when dismissing BrowseFilter progress dialog