package wtf.password;

import retrofit.RestAdapter;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;

/**
 * @author Erik Beeson
 */
public class ZxcvbnRemote {
	private final ZxcvbnRemoteService service;

	public ZxcvbnRemote() {
		this("https://password.wtf");
	}

	public ZxcvbnRemote(String endpoint) {
		this.service = new RestAdapter.Builder()
							   .setEndpoint(endpoint)
							   .build()
							   .create(ZxcvbnRemoteService.class);
	}

	public PasswordStrength zxcvbn(String password) throws IllegalArgumentException {
		if(password != null && password.length() > 0) {
			return service.zxcvbn(password);
		} else {
			throw new IllegalArgumentException("Invalid password: " + password);
		}
	}

	interface ZxcvbnRemoteService {
		@POST("/zxcvbn")
		@FormUrlEncoded
		PasswordStrength zxcvbn(@Field("password") String password);
	}
}

package wtf.password;

import retrofit.RestAdapter;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.POST;

/**
 * @author Erik Beeson
 */
public class ZxcvbnRemote {
	private final ZxcvbnRemoteService service;

	public ZxcvbnRemote(String endpoint) {
		this.service = new RestAdapter.Builder()
							   .setEndpoint(endpoint)
							   .build()
							   .create(ZxcvbnRemoteService.class);
	}

	public PasswordStrength zxcvbn(String password) throws IllegalArgumentException {
		if(password != null && password.length() > 0) {
			return service.zxcvbn(password);
		} else {
			throw new IllegalArgumentException("Invalid password: " + password);
		}
	}

	interface ZxcvbnRemoteService {
		@POST("/zxcvbn")
		@FormUrlEncoded
		PasswordStrength zxcvbn(@Field("password") String password);
	}
}

Remove default constructor to ensure that consumers understand this is a remote service


package uk.ac.ebi.quickgo.client.service.loader.presets.evidence;

import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.validator.ValidationException;

import static uk.ac.ebi.quickgo.client.service.loader.presets.PresetsValidationHelper.checkIsNullOrEmpty;

/**
 * Validates the {@link RawEvidenceNamedPreset} instances being read from flat-files and mapped via
 * {@link StringToRawEvidenceNamedPresetMapper}.
 *
 * Created 05/03/18
 * @author Tony Wardell
 */
public class RawEvidenceNamedPresetValidator implements ItemProcessor<RawEvidenceNamedPreset, RawEvidenceNamedPreset> {
    @Override public RawEvidenceNamedPreset process(RawEvidenceNamedPreset rawNamedPreset) {
        if (rawNamedPreset == null) {
            throw new ValidationException("RawDBPreset cannot be null or empty");
        }

        checkIsNullOrEmpty(rawNamedPreset.name);

        return rawNamedPreset;
    }

}

package uk.ac.ebi.quickgo.client.service.loader.presets.evidence;

import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.validator.ValidationException;

import static uk.ac.ebi.quickgo.client.service.loader.presets.PresetsValidationHelper.checkIsNullOrEmpty;

/**
 * Validates the {@link RawEvidenceNamedPreset} instances being read from flat-files and mapped via
 * {@link StringToRawEvidenceNamedPresetMapper}.
 *
 * Created 05/03/18
 * @author Tony Wardell
 */
public class RawEvidenceNamedPresetValidator implements ItemProcessor<RawEvidenceNamedPreset, RawEvidenceNamedPreset> {
    @Override public RawEvidenceNamedPreset process(RawEvidenceNamedPreset rawEvidenceNamedPreset) {
        if (rawEvidenceNamedPreset == null) {
            throw new ValidationException("RawEvidenceNamedPreset cannot be null or empty");
        }

        checkIsNullOrEmpty(rawEvidenceNamedPreset.name);

        return rawEvidenceNamedPreset;
    }

}

Fix cut 'n' paster error RawDBPreset -> RawEvidenceNamedPreset. Code tidy.


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

package org.wso2.msf4j.example;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;

/**
 * Hello service resource class.
 */
@Path("/hello")
public class HelloService {

    @GET
    @Path("/{name}")
    public String hello(@PathParam("name") String name) {
        System.out.println("Hello");
        return "Hello " + name;
    }
}

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

package org.wso2.msf4j.example;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

/**
 * Hello service resource class.
 */
@Path("/hello")
public class HelloService {

    @GET
    @Path("/{name}")
    public String hello(@PathParam("name") String name) {
        System.out.println("Hello");
        return "Hello " + name;
    }
}

Remove unused imports from helloworld sample


package org.cyclops.integrateddynamics.capability.cable;

import org.cyclops.integrateddynamics.api.block.cable.ICableFakeable;

/**
 * Default implementation of {@link ICableFakeable}.
 * @author rubensworks
 */
public abstract class CableFakeableDefault implements ICableFakeable {

    private boolean real = true;

    @Override
    public boolean isRealCable() {
        return real;
    }

    @Override
    public void setRealCable(boolean real) {
        this.real = real;
        sendUpdate();
    }

    protected abstract void sendUpdate();
}

package org.cyclops.integrateddynamics.capability.cable;

import org.cyclops.integrateddynamics.api.block.cable.ICableFakeable;

/**
 * Default implementation of {@link ICableFakeable}.
 * @author rubensworks
 */
public abstract class CableFakeableDefault implements ICableFakeable {

    private boolean real = true;

    @Override
    public boolean isRealCable() {
        return real;
    }

    @Override
    public void setRealCable(boolean real) {
        boolean oldReal = this.real;
        this.real = real;
        if (oldReal != this.real) {
            sendUpdate();
        }
    }

    protected abstract void sendUpdate();
}

Fix display panels causing unnecessary chunk rerenders


package com.nilhcem.droidcontn.utils;

/**
 * Preconditions inspired by
 * https://github.com/google/guava/blob/master/guava/src/com/google/common/base/Preconditions.java
 */
public final class Preconditions {

    private Preconditions() {
        throw new UnsupportedOperationException();
    }

    /**
     * Ensures the truth of an expression involving one or more parameters to the calling method.
     *
     * @param expression a boolean expression
     * @throws IllegalArgumentException if {@code expression} is false
     */
    public static void checkArgument(boolean expression) {
        if (!expression) {
            throw new IllegalArgumentException();
        }
    }
}

package com.nilhcem.droidcontn.utils;

import android.os.Looper;

import com.nilhcem.droidcontn.BuildConfig;

/**
 * Preconditions inspired by
 * https://github.com/google/guava/blob/master/guava/src/com/google/common/base/Preconditions.java
 */
public final class Preconditions {

    private Preconditions() {
        throw new UnsupportedOperationException();
    }

    /**
     * Ensures the truth of an expression involving one or more parameters to the calling method.
     *
     * @param expression a boolean expression
     * @throws IllegalArgumentException if {@code expression} is false
     */
    public static void checkArgument(boolean expression) {
        if (!expression) {
            throw new IllegalArgumentException();
        }
    }

    public static void checkOnMainThread() {
        if (BuildConfig.DEBUG) {
            if (!isOnMainThread()) {
                throw new IllegalStateException("This method should be called from the main thread");
            }
        }
    }

    public static void checkNotOnMainThread() {
        if (BuildConfig.DEBUG) {
            if (isOnMainThread()) {
                throw new IllegalStateException("This method must not be called on the main thread");
            }
        }
    }

    private static boolean isOnMainThread() {
        return Thread.currentThread() == Looper.getMainLooper().getThread();
    }
}

Add thread preconditions to ensure call is/is not on the main thread


package com.farm.processes;

import com.farm.database.accounts.AccountBalance;
import com.farm.database.accounts.AccountBalanceRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;

/**
 * Farm project. 2017
 * Description:
 */
@Service
@Transactional
public class AccountBalanceProcess
{
  @Resource
  private AccountBalanceRepository accountBalanceRepository;

  public AccountBalance findOrCreateByAccountNumber(){

  }
}

package com.farm.processes;

import com.farm.database.accounts.Account;
import com.farm.database.accounts.AccountBalance;
import com.farm.database.accounts.AccountBalanceRepository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import static java.util.Objects.isNull;

/**
 * Farm project. 2017
 * Description:
 */
@Service
@Transactional
public class AccountBalanceProcess
{
  @Resource
  private AccountBalanceRepository accountBalanceRepository;

  public AccountBalance findOrCreateByAccount(Account account){
    AccountBalance accountBalance = accountBalanceRepository.findByAccount(account);
    if (isNull(accountBalance)){

    }
  }
}

Work with account balance process


package seedu.taskmanager.logic.parser;

import java.util.regex.Pattern;

import seedu.taskmanager.logic.parser.ArgumentTokenizer.Prefix;

/**
 * Contains Command Line Interface (CLI) syntax definitions common to multiple commands
 */
public class CliSyntax {

    /* Prefix definitions */
    public static final Prefix PREFIX_STARTDATE = new Prefix("s/");
    public static final Prefix PREFIX_ENDDATE = new Prefix("e/");
    public static final Prefix PREFIX_DESCRIPTION = new Prefix("d/");
    public static final Prefix PREFIX_TAG = new Prefix("#");

    /* Alternative prefix definitions for natural variations of user input*/
//    public static final Prefix ALTERNATIVE_PREFIX_STARTDATE = new Prefix("start on ");
//    public static final Prefix ALTERNATIVE_PREFIX_ENDDATE = new Prefix("end on ");
//    public static final Prefix ALTERNATIVE_PREFIX_DESCRIPTION = new Prefix("with description ");

    /* Patterns definitions */
    public static final Pattern KEYWORDS_ARGS_FORMAT =
            Pattern.compile("(?<keywords>\\S+(?:\\s+\\S+)*)"); // one or more keywords separated by whitespace

    // File Path allows numbers, "/.-", space, lowercase and uppercase letters
    public static final Pattern FILEPATH_ARGS_FORMAT = Pattern.compile("([ 0-9a-zA-Z/.-])+");
}

package seedu.taskmanager.logic.parser;

import java.util.regex.Pattern;

import seedu.taskmanager.logic.parser.ArgumentTokenizer.Prefix;

/**
 * Contains Command Line Interface (CLI) syntax definitions common to multiple commands
 */
public class CliSyntax {

    /* Prefix definitions */
    public static final Prefix PREFIX_STARTDATE = new Prefix("s/");
    public static final Prefix PREFIX_ENDDATE = new Prefix("e/");
    public static final Prefix PREFIX_DESCRIPTION = new Prefix("d/");
    public static final Prefix PREFIX_TAG = new Prefix("#");

    /* Alternative prefix definitions for natural variations of user input*/
//    public static final Prefix ALTERNATIVE_PREFIX_STARTDATE = new Prefix("start on ");
//    public static final Prefix ALTERNATIVE_PREFIX_ENDDATE = new Prefix("end on ");
//    public static final Prefix ALTERNATIVE_PREFIX_DESCRIPTION = new Prefix("with description ");

    /* Patterns definitions */
    public static final Pattern KEYWORDS_ARGS_FORMAT =
            Pattern.compile("(?<keywords>\\S+(?:\\s+\\S+)*)"); // one or more keywords separated by whitespace

    // File Path allows numbers, "/.-", space, lowercase and uppercase letters
    public static final Pattern FILEPATH_ARGS_FORMAT = Pattern.compile("([ 0-9a-zA-Z/_.-])+");
}

Fix to allow “_” (underline) in file path name


package info.u_team.u_team_test.block;

import info.u_team.u_team_core.block.UBlock;
import info.u_team.u_team_test.init.TestItemGroups;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.*;

public class BasicBlock extends UBlock {

	public BasicBlock(String name) {
		super(name, TestItemGroups.GROUP, Properties.create(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.GROUND).slipperiness(0.8F).lightValue(1), new Item.Properties().rarity(Rarity.UNCOMMON));
	}

}

package info.u_team.u_team_test.block;

import info.u_team.u_team_core.block.UBlock;
import info.u_team.u_team_test.init.TestItemGroups;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.item.*;

public class BasicBlock extends UBlock {

	public BasicBlock() {
		super(TestItemGroups.GROUP, Properties.create(Material.ROCK).hardnessAndResistance(2F).sound(SoundType.GROUND).slipperiness(0.8F).lightValue(1), new Item.Properties().rarity(Rarity.UNCOMMON));
	}

}

Remove String name from basic block


package info.u_team.u_team_test.integration;

import org.apache.logging.log4j.*;

import info.u_team.u_team_core.api.integration.*;

@Integration("xyz")
public class TestIntegrationNotCall implements IModIntegration {

	public static final Logger LOGGER = LogManager.getLogger("IntegrationNotCall");

	static {
		LOGGER.fatal("Integration not call is cinit!");
	}

	@Override
	public void construct() {
		LOGGER.fatal("Integration not call is constructed! THIS SHOULD NEVER HAPPEN!!");
		throw new RuntimeException("Integration should not be constructed");
	}

}

package info.u_team.u_team_test.integration;

import org.apache.logging.log4j.*;

import info.u_team.u_team_core.api.integration.*;
import info.u_team.u_team_test.TestMod;

@Integration(modid = TestMod.MODID, integration = "xyz")
public class TestIntegrationNotCall implements IModIntegration {

	public static final Logger LOGGER = LogManager.getLogger("IntegrationNotCall");

	static {
		LOGGER.fatal("Integration not call is cinit!");
	}

	@Override
	public void construct() {
		LOGGER.fatal("Integration not call is constructed! THIS SHOULD NEVER HAPPEN!!");
		throw new RuntimeException("Integration should not be constructed");
	}

}

Add the new modid field in the integration not call


package com.rehivetech.beeeon.threading.task;

import android.content.Context;

import com.rehivetech.beeeon.controller.Controller;

import java.util.EnumSet;

/**
 * Created by martin on 29.3.16.
 */
public class ReloadDashboardDataTask extends ReloadGateDataTask{

	public ReloadDashboardDataTask(Context context, boolean forceReload, ReloadWhat what) {
		super(context, forceReload, what);
	}

	public ReloadDashboardDataTask(Context context, boolean forceReload, EnumSet<ReloadWhat> what) {
		super(context, forceReload, what);
	}

	@Override
	public Boolean doInBackground(String... params) {
		if (!super.doInBackground(params[0])) {
			return false;
		}

		if (params.length ==  1) {
			return true;
		}

		return Controller.getInstance(mContext).getWeatherModel().reloadWeather(mContext, params[0], params[1], params[2]);
	}
}

package com.rehivetech.beeeon.threading.task;

import android.content.Context;

import com.rehivetech.beeeon.controller.Controller;
import com.rehivetech.beeeon.exception.AppException;

import java.util.EnumSet;

/**
 * Created by martin on 29.3.16.
 */
public class ReloadDashboardDataTask extends ReloadGateDataTask{

	public ReloadDashboardDataTask(Context context, boolean forceReload, ReloadWhat what) {
		super(context, forceReload, what);
	}

	public ReloadDashboardDataTask(Context context, boolean forceReload, EnumSet<ReloadWhat> what) {
		super(context, forceReload, what);
	}

	@Override
	public Boolean doInBackground(String... params) {
		try {
			if (!super.doInBackground(params[0])) {
				return false;
			}
		} catch (AppException e) {
			return false;
		}

		if (params.length == 1) {
			return true;
		}

		return Controller.getInstance(mContext).getWeatherModel().reloadWeather(mContext, params[0], params[1], params[2]);
	}
}

Fix crash in reload task in dashboard


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

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author David Turanski
 *
 */
@Configuration
@EnableScheduling
public class MvcConfig  extends WebMvcConfigurerAdapter {
	@Override
	public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
		configurer.setDefaultTimeout(30*1000L);
	}
}

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

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.config.annotation.AsyncSupportConfigurer;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

/**
 * @author David Turanski
 *
 */
@Configuration
@EnableScheduling
public class MvcConfig extends WebMvcConfigurerAdapter {
	@Override
	public void configureAsyncSupport(AsyncSupportConfigurer configurer) {
		configurer.setDefaultTimeout(30*1000L);
	}

	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new HandlerInterceptorAdapter() {
			@Override
			public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
				response.setHeader("Access-Control-Allow-Origin", "http://localhost:9889");
        return true;
			}
		});
	}
}

Add cross-domain origin header to responses.


/*******************************************************************************
 * Copyright (c) 2016 IBM Corp.
 *
 * 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.ibm.liberty.starter.filter;

import java.io.IOException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(urlPatterns={"/*"})
public class FilterServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
        resp.setHeader("Location", "/start/");
    }

}

/*******************************************************************************
 * Copyright (c) 2016 IBM Corp.
 *
 * 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.ibm.liberty.starter.filter;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet(urlPatterns={"/"})
public class FilterServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
        System.out.println("FilterServlet caught request " + req.getRequestURI());
        if ("/".equals(req.getRequestURI())) {
            System.out.println("Forwarding request");
            resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
            resp.setHeader("Location", "/start/");
        } else {
            resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
            PrintWriter writer = resp.getWriter();
            StringBuffer urlBuffer = req.getRequestURL();
            String appLocation = urlBuffer.toString();
            String appUrl = appLocation.substring(0, appLocation.indexOf(req.getRequestURI())) + "/start/";
            writer.println("Resource not found, the Liberty app accelerator can be found here.");
        }
    }

}

Update filter to only redirect if accessed at root, otherwise produce 404 with link to actual page.


package org.talend.dataprep.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CORSConfiguration {

    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {

            @Override
            public void addCorsMappings(CorsRegistry registry) {
                // Add CORS header for all path in application
                registry.addMapping("/**") //
                        .allowedOrigins("*") //
                        .allowedMethods("POST", "GET", "OPTIONS", "DELETE", "PUT") //
                        .maxAge(3600) //
                        .allowedHeaders("x-requested-with", "Content-Type")
                        .allowCredentials(true);
            }
        };
    }

}

package org.talend.dataprep.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class CORSConfiguration {

    @Bean
    public WebMvcConfigurer corsConfigurer() {
        return new WebMvcConfigurerAdapter() {

            @Override
            public void addCorsMappings(CorsRegistry registry) {
                // Add CORS header for all path in application
                registry.addMapping("/**") //
                        .allowedOrigins("*") //
                        .allowedMethods("POST", "GET", "OPTIONS", "DELETE", "PUT") //
                        .maxAge(3600) //
                        .allowedHeaders("x-requested-with", "Content-Type", "accept")
                        .allowCredentials(true);
            }
        };
    }

}

Fix support for preflight HTTP requests


package org.elasticsoftware.elasticactors.kubernetes.cluster.statemachine.impl;

import io.fabric8.kubernetes.api.model.apps.StatefulSet;
import org.elasticsoftware.elasticactors.kubernetes.cluster.TaskScheduler;
import org.elasticsoftware.elasticactors.kubernetes.cluster.statemachine.AbstractKubernetesStateMachine;

import java.util.concurrent.ExecutorService;

import static java.util.concurrent.Executors.newSingleThreadExecutor;

public class SingleThreadKubernetesStateMachine extends AbstractKubernetesStateMachine {

    private final ExecutorService executorService = newSingleThreadExecutor(r -> new Thread(r, "KUBERNETES_CLUSTERSERVICE_STATE_MACHINE"));

    public SingleThreadKubernetesStateMachine(TaskScheduler taskScheduler) {
        super(taskScheduler);
    }

    @Override
    public void handleStateUpdate(StatefulSet resource) {
        logger.info("Received state update. Submitting processing task to the Single Thread Executor Service");
        executorService.submit(() -> processStateUpdate(resource));
    }
}

package org.elasticsoftware.elasticactors.kubernetes.cluster.statemachine.impl;

import io.fabric8.kubernetes.api.model.apps.StatefulSet;
import org.elasticsoftware.elasticactors.kubernetes.cluster.DaemonThreadFactory;
import org.elasticsoftware.elasticactors.kubernetes.cluster.TaskScheduler;
import org.elasticsoftware.elasticactors.kubernetes.cluster.statemachine.AbstractKubernetesStateMachine;

import java.util.concurrent.ExecutorService;

import static java.util.concurrent.Executors.newSingleThreadExecutor;

public class SingleThreadKubernetesStateMachine extends AbstractKubernetesStateMachine {

    private final ExecutorService executorService = newSingleThreadExecutor(new DaemonThreadFactory("KUBERNETES_CLUSTERSERVICE_STATE_MACHINE"));

    public SingleThreadKubernetesStateMachine(TaskScheduler taskScheduler) {
        super(taskScheduler);
    }

    @Override
    public void handleStateUpdate(StatefulSet resource) {
        logger.info("Received state update. Submitting processing task to the Single Thread Executor Service");
        executorService.submit(() -> processStateUpdate(resource));
    }
}

Make the State Machine thread a daemon thread


/*
 * Copyright 2016-2019 Adrian Cotfas
 *
 * 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.apps.adrcotfas.goodtime.Statistics.AllSessions;

import org.joda.time.DateTime;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class AddEditEntryDialogViewModel extends ViewModel {

    public static int INVALID_SESSION_TO_EDIT_ID = -1;
    public MutableLiveData<Integer> duration = new MutableLiveData<>();
    public MutableLiveData<DateTime> date = new MutableLiveData<>();
    public MutableLiveData<String> label = new MutableLiveData<>();
    public long sessionToEditId;

    public AddEditEntryDialogViewModel() {
        date.setValue(new DateTime().withHourOfDay(9).withMinuteOfHour(0));
        label.setValue(null);
        sessionToEditId = INVALID_SESSION_TO_EDIT_ID;
    }
}

/*
 * Copyright 2016-2019 Adrian Cotfas
 *
 * 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.apps.adrcotfas.goodtime.Statistics.AllSessions;

import org.joda.time.DateTime;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

public class AddEditEntryDialogViewModel extends ViewModel {

    public static int INVALID_SESSION_TO_EDIT_ID = -1;
    public MutableLiveData<Integer> duration = new MutableLiveData<>();
    public MutableLiveData<DateTime> date = new MutableLiveData<>();
    public MutableLiveData<String> label = new MutableLiveData<>();
    public long sessionToEditId;

    public AddEditEntryDialogViewModel() {
        date.setValue(new DateTime());
        label.setValue(null);
        sessionToEditId = INVALID_SESSION_TO_EDIT_ID;
    }
}

Set 'Add Session' time to current time (& date).


package com.yahoo.vespa.hosted.controller.restapi.user;

import com.yahoo.vespa.hosted.controller.restapi.ContainerControllerTester;
import com.yahoo.vespa.hosted.controller.restapi.ControllerContainerTest;
import org.junit.Test;

/**
 * @author jonmv
 */
public class UserApiTest extends ControllerContainerTest {

    private static final String responseFiles = "src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/responses/";

    @Test
    public void testUserApi() {
        ContainerControllerTester tester = new ContainerControllerTester(container, responseFiles);

        tester.assertResponse(authenticatedRequest("http://localhost:8080/user/v1/"),
                              "{\n  \"code\" : 403,\n  \"message\" : \"Access denied\"\n" + "}", 403);
    }

}

package com.yahoo.vespa.hosted.controller.restapi.user;

import com.yahoo.vespa.hosted.controller.restapi.ContainerControllerTester;
import com.yahoo.vespa.hosted.controller.restapi.ControllerContainerTest;
import org.junit.Test;

/**
 * @author jonmv
 */
public class UserApiTest extends ControllerContainerTest {

    private static final String responseFiles = "src/test/java/com/yahoo/vespa/hosted/controller/restapi/user/responses/";

    @Test
    public void testUserApi() {
        ContainerControllerTester tester = new ContainerControllerTester(container, responseFiles);

        tester.assertResponse(authenticatedRequest("http://localhost:8080/user/v1/"),
                              "{\"error-code\":\"NOT_FOUND\",\"message\":\"No 'GET' handler at '/user/v1/'\"}", 404);
    }

}

Update test for user API


public class Wift {

  /**
   *  Wift - The BASIC Programming Language
   */

}

public class Wift {

  /**
   *  Wift - The BASIC Programming Language
   *
   *        BASIC FUNCTIONALITY:
   *            - STRINGS []
   *            - INTEGERS []
   *            - ARITHMETIC []
   *            - VARIABLES []
   *
   */

}

Add "BASIC functionality" comments :star:


package com.centurylink.cloud.sdk.servers.services.domain.ip;

import com.centurylink.cloud.sdk.servers.client.domain.ip.PortConfig;

/**
 * @author Ilya Drabenia
 */
public class PublicIpConfig {

    public PublicIpConfig ports(Integer... ports) {
        return this;
    }

    public PublicIpConfig ports(PortConfig... ports) {
        return this;
    }

    public PublicIpConfig sourceRestrictions(String... restrictions) {
        return this;
    }

}

package com.centurylink.cloud.sdk.servers.services.domain.ip;

import com.centurylink.cloud.sdk.servers.client.domain.ip.PortConfig;

/**
 * @author Ilya Drabenia
 */
public class PublicIpConfig {

    public PublicIpConfig openPorts(Integer... ports) {
        return this;
    }

    public PublicIpConfig openPorts(PortConfig... ports) {
        return this;
    }

    public PublicIpConfig sourceRestrictions(String... restrictions) {
        return this;
    }

    public PublicIpConfig sourceRestrictions(Subnet... restrictions) {
        return this;
    }

}

Implement domain model for add public IP


package com.ajj.robodtn.test;

import junit.framework.TestCase;
import java.io.ByteArrayInputStream;
import java.io.IOException;

import com.ajj.robodtn.SdnvDataInputStream;
import com.ajj.robodtn.test.SdnvTest;

public class SdnvDataInputStreamTest extends TestCase {
	public void testSdnvs() throws IOException {
		SdnvTest st = new SdnvTest();

		for(int i = 0; i < st.testpairs.length; i++) {
			SdnvDataInputStream is = new SdnvDataInputStream(
							new ByteArrayInputStream(st.testpairs[i].bytes));
			assert(is.readSdnv() == st.testpairs[i].value);
		}
	}
}

package com.ajj.robodtn.test;

import junit.framework.TestCase;
import java.io.ByteArrayInputStream;
import java.io.IOException;

import com.ajj.robodtn.SdnvDataInputStream;
import com.ajj.robodtn.test.SdnvTest;

public class SdnvDataInputStreamTest extends TestCase {
	public void testSdnvs() throws IOException {
		SdnvTest st = new SdnvTest();

		for(int i = 0; i < st.testpairs.length; i++) {
			SdnvDataInputStream is = new SdnvDataInputStream(
							new ByteArrayInputStream(st.testpairs[i].bytes));
			assertEquals(st.testpairs[i].value, is.readSdnv());
		}
	}
}

Use "assertEquals" because "assert" isn't run in Android JUnit Tests.


// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.sdk.internal.wip.protocol.input;

import java.util.List;

import org.chromium.sdk.internal.protocolparser.JsonOptionalField;
import org.chromium.sdk.internal.protocolparser.JsonProtocolParseException;
import org.chromium.sdk.internal.protocolparser.JsonSubtypeCasting;
import org.chromium.sdk.internal.protocolparser.JsonType;

@JsonType(subtypesChosenManually=true)
public interface WipTabList {
  @JsonSubtypeCasting List<TabDescription> asTabList() throws JsonProtocolParseException;

  @JsonType interface TabDescription {
    String faviconUrl();
    String title();
    String url();

    String thumbnailUrl();

    @JsonOptionalField
    String devtoolsFrontendUrl();

    @JsonOptionalField
    String webSocketDebuggerUrl();
  }
}

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.sdk.internal.wip.protocol.input;

import java.util.List;

import org.chromium.sdk.internal.protocolparser.JsonOptionalField;
import org.chromium.sdk.internal.protocolparser.JsonProtocolParseException;
import org.chromium.sdk.internal.protocolparser.JsonSubtypeCasting;
import org.chromium.sdk.internal.protocolparser.JsonType;

@JsonType(subtypesChosenManually=true)
public interface WipTabList {
  @JsonSubtypeCasting List<TabDescription> asTabList() throws JsonProtocolParseException;

  @JsonType interface TabDescription {
    String faviconUrl();
    String title();
    String url();

    String thumbnailUrl();

    // TODO: consider adding enum here
    String type();

    @JsonOptionalField
    String devtoolsFrontendUrl();

    @JsonOptionalField
    String webSocketDebuggerUrl();
  }
}

Add 'type' field to tab enumeration JSON protocol


package net.onrc.onos.core.matchaction.match;

import net.onrc.onos.core.util.IPv4Net;

public class Ipv4Match implements Match {

    IPv4Net dstIp;

    public Ipv4Match(String ipAddressSlash) {
        this.dstIp = new IPv4Net(ipAddressSlash);
    }

    public IPv4Net getDestination() {
        return dstIp;
    }

}

package net.onrc.onos.core.matchaction.match;

import net.onrc.onos.core.util.IPv4;
import net.onrc.onos.core.util.IPv4Net;

public class Ipv4Match implements Match {

    IPv4Net dstIp;

    public Ipv4Match(String ipAddressSlash) {
        this.dstIp = new IPv4Net(ipAddressSlash);

        IPv4 ip = dstIp.address();
        short prefLen = dstIp.prefixLen();
        int mask = ~((1 << (32 - prefLen)) - 1);;
        int newIpInt = ip.value() & mask;
        IPv4 newIp = new IPv4(newIpInt);

        this.dstIp = new IPv4Net(newIp, prefLen);
    }

    public IPv4Net getDestination() {
        return dstIp;
    }

}

Change IP address mask according to the prefix when setting the IP forwarding rule.


package de.itemis.mosig.racecar.textconv;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class TextFileReader {

    private final Path filePath;

    public TextFileReader(Path filePath) {
        this.filePath = filePath;
    }

    public String contents() {
        String result = null;
            try {
                result = new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8);
            } catch (IOException e) {
                throw new RuntimeException("Error while reading file '" + filePath + "'.", e);
            }
        return result;
    }

    public Path getFilePath() {
        return null;
    }
}

package de.itemis.mosig.racecar.textconv;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

public class TextFileReader {

    private final Path filePath;

    public TextFileReader(Path filePath) {
        this.filePath = filePath;
    }

    public String contents() {
        String result = null;
            try {
                result = new String(Files.readAllBytes(filePath), StandardCharsets.UTF_8);
            } catch (IOException e) {
                throw new RuntimeException("Error while reading file '" + filePath + "'.", e);
            }
        return result;
    }

    public Path getFilePath() {
        return filePath;
    }
}

Correct file path is now returned.


package org.jvirtanen.parity.top;

/**
 * Order represents an order in an order book.
 */
public class Order {

    private Level parent;

    private long remainingQuantity;

    Order(Level parent, long size) {
        this.parent = parent;

        this.remainingQuantity = size;
    }

    OrderBook getOrderBook() {
        return parent.getParent().getParent();
    }

    /**
     * Get the instrument.
     *
     * @return the instrument
     */
    public long getInstrument() {
        return getOrderBook().getInstrument();
    }

    /**
     * Get the price.
     *
     * @return the price
     */
    public long getPrice() {
        return parent.getPrice();
    }

    /**
     * Get the side.
     *
     * @return the side
     */
    public Side getSide() {
        return parent.getParent().getSide();
    }

    /**
     * Get the remaining quantity.
     *
     * @return the remaining quantity
     */
    public long getRemainingQuantity() {
        return remainingQuantity;
    }

    boolean isOnBestLevel() {
        return parent.isBestLevel();
    }

    void reduce(long quantity) {
        remainingQuantity -= quantity;
    }

    void delete() {
        parent.delete(this);
    }

}

package org.jvirtanen.parity.top;

/**
 * An order in an order book.
 */
public class Order {

    private Level parent;

    private long remainingQuantity;

    Order(Level parent, long size) {
        this.parent = parent;

        this.remainingQuantity = size;
    }

    OrderBook getOrderBook() {
        return parent.getParent().getParent();
    }

    /**
     * Get the instrument.
     *
     * @return the instrument
     */
    public long getInstrument() {
        return getOrderBook().getInstrument();
    }

    /**
     * Get the price.
     *
     * @return the price
     */
    public long getPrice() {
        return parent.getPrice();
    }

    /**
     * Get the side.
     *
     * @return the side
     */
    public Side getSide() {
        return parent.getParent().getSide();
    }

    /**
     * Get the remaining quantity.
     *
     * @return the remaining quantity
     */
    public long getRemainingQuantity() {
        return remainingQuantity;
    }

    boolean isOnBestLevel() {
        return parent.isBestLevel();
    }

    void reduce(long quantity) {
        remainingQuantity -= quantity;
    }

    void delete() {
        parent.delete(this);
    }

}

Tweak documentation for order in order book reconstruction


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

import org.pac4j.http.client.indirect.IndirectBasicAuthClient;

/**
 * Will be removed. Use {@link IndirectBasicAuthClient} instead.
 *
 * @author Jerome Leleu
 * @since 1.4.0
 */
@Deprecated
public class BasicAuthClient extends IndirectBasicAuthClient {
}

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

import org.pac4j.http.client.indirect.IndirectBasicAuthClient;

/**
 * Will be removed. Use {@link IndirectBasicAuthClient} instead.
 *
 * @author Jerome Leleu
 * @since 1.4.0
 * @deprecated
 */
@Deprecated
public class BasicAuthClient extends IndirectBasicAuthClient {
}

Add deprecated at Javadoc level


package com.gitrekt.resort.model.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "resort.packages")
public class Package {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "name")
    private String name;

    @Column(name = "price_per_person")
    private double pricePerPerson;

    public Package(String name, double pricePerPerson){
        this.name = name;
        this.pricePerPerson = pricePerPerson;
    }

    public String getName(){
        return name;
    }

    //Returns the price rate per person for the package
    public double getPricePerPerson(){
        return pricePerPerson;
    }
}

package com.gitrekt.resort.model.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "resort.packages")
public class Package {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "name")
    private String name;

    @Column(name = "price_per_person")
    private double pricePerPerson;

    public Package(String name, double pricePerPerson){
        this.name = name;
        this.pricePerPerson = pricePerPerson;
    }

    public String getName(){
        return name;
    }

    public double getPricePerPerson(){
        return pricePerPerson;
    }
}

Fix extra line in package class


package com.yammer.dropwizard.bundles;

import com.fasterxml.jackson.module.scala.DefaultScalaModule;
import com.yammer.dropwizard.Bundle;
import com.yammer.dropwizard.config.Bootstrap;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.scala.inject.ScalaCollectionsQueryParamInjectableProvider;

public class ScalaBundle implements Bundle {
    @Override
    public void initialize(Bootstrap<?> bootstrap) {
        bootstrap.getObjectMapperFactory().registerModule(new DefaultScalaModule());
    }

    @Override
    public void run(Environment environment) {
        environment.addProvider(new ScalaCollectionsQueryParamInjectableProvider());
    }
}

package com.yammer.dropwizard.bundles;

import com.fasterxml.jackson.module.scala.DefaultScalaModule;
import com.yammer.dropwizard.Bundle;
import com.yammer.dropwizard.config.Bootstrap;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.scala.inject.ScalaCollectionsQueryParamInjectableProvider;

public class ScalaBundle implements Bundle {
    @Override
    public void initialize(Bootstrap<?> bootstrap) {
        bootstrap.getObjectMapperFactory().registerModule(new DefaultScalaModule());
    }

    @Override
    public void run(Environment environment) {
	environment.getJerseyEnvironment().addProvider(new ScalaCollectionsQueryParamInjectableProvider());
    }
}

Update to be compatible with latest upstream


package edu.kit.ipd.crowdcontrol.objectservice.config;

public class Deployment {
    /**
     * Deployment origin of the control ui.
     */
    public String origin;
}

package edu.kit.ipd.crowdcontrol.objectservice.config;

/**
 * Deployment variables specific to the control ui.
 */
public class Deployment {
    /**
     * Deployment origin of the control ui.
     */
    public String origin;
}

Add more docs to deployment


/*
 * (C) Copyright 2017 Boni Garcia (https://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.seljup.test.docker;

import static io.github.bonigarcia.seljup.BrowserType.SAFARI;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.WebDriver;

import io.github.bonigarcia.seljup.DockerBrowser;
import io.github.bonigarcia.seljup.SeleniumJupiter;

@ExtendWith(SeleniumJupiter.class)
class DockerSafariTest {

    @Test
    void testSafari(@DockerBrowser(type = SAFARI) WebDriver driver) {
        driver.get("https://github.com/bonigarcia/selenium-webdriver-java");
        assertThat(driver.getTitle()).contains("Selenium WebDriver");
    }

}

/*
 * (C) Copyright 2017 Boni Garcia (https://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.seljup.test.docker;

import static io.github.bonigarcia.seljup.BrowserType.SAFARI;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.openqa.selenium.WebDriver;

import io.github.bonigarcia.seljup.DockerBrowser;
import io.github.bonigarcia.seljup.SeleniumJupiter;

@ExtendWith(SeleniumJupiter.class)
class DockerSafariTest {

    @Test
    void testSafari(@DockerBrowser(type = SAFARI) WebDriver driver) {
        driver.get("https://bonigarcia.dev/selenium-webdriver-java/");
        assertThat(driver.getTitle()).contains("Selenium WebDriver");
    }

}

Change website URL in Docker Safari test


package org.cyclops.integratedtunnels.part.aspect;

import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.PartPos;

/**
 * A tunnel connection over a network at a certain position.
 * @author rubensworks
 */
public class TunnelConnectionPositionedNetwork implements ITunnelConnection {

    private final INetwork network;
    private final int channel;
    private final PartPos pos;
    private final ITunnelTransfer transfer;

    public TunnelConnectionPositionedNetwork(INetwork network, int channel, PartPos pos, ITunnelTransfer transfer) {
        this.network = network;
        this.channel = channel;
        this.pos = pos;
        this.transfer = transfer;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof TunnelConnectionPositionedNetwork)) {
            return false;
        }
        TunnelConnectionPositionedNetwork that = (TunnelConnectionPositionedNetwork) obj;
        return this.network.equals(that.network) && this.channel == that.channel
                && this.pos.equals(that.pos) && this.transfer.equals(that.transfer);
    }

    @Override
    public int hashCode() {
        return this.network.hashCode() ^ this.channel ^ this.pos.hashCode() ^ this.transfer.hashCode();
    }
}

package org.cyclops.integratedtunnels.part.aspect;

import org.cyclops.integrateddynamics.api.network.INetwork;
import org.cyclops.integrateddynamics.api.part.PartPos;

/**
 * A tunnel connection over a network at a certain position.
 * @author rubensworks
 */
public class TunnelConnectionPositionedNetwork implements ITunnelConnection {

    private final INetwork network;
    private final int channel;
    private final PartPos pos;
    private final ITunnelTransfer transfer;

    public TunnelConnectionPositionedNetwork(INetwork network, int channel, PartPos pos, ITunnelTransfer transfer) {
        this.network = network;
        this.channel = channel;
        this.pos = pos;
        this.transfer = transfer;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof TunnelConnectionPositionedNetwork)) {
            return false;
        }
        TunnelConnectionPositionedNetwork that = (TunnelConnectionPositionedNetwork) obj;
        return this.network == that.network && this.channel == that.channel
                && this.pos.equals(that.pos) && this.transfer.equals(that.transfer);
    }

    @Override
    public int hashCode() {
        return this.network.hashCode() ^ this.channel ^ this.pos.hashCode() ^ this.transfer.hashCode();
    }
}

Fix performance issue when handling tunnel cache


package com.les4elefantastiq.les4elefantcowork.models;

public class LiveFeedMessage {

    // -------------- Objects, Variables -------------- //

    public String text;
    public int type;
    public String dateTime; // Date ?
    public String tweetLink;
    public String sender;
    public String coworkerLinkedInId;
    public Boolean isBirthday;

    // ----------------- Constructor ------------------ //

    public LiveFeedMessage(String text, int type, String dateTime, String tweetLink, String sender, String coworkerLinkedInId, Boolean isBirthday) {
        this.text = text;
        this.type = type;
        this.dateTime = dateTime;
        this.tweetLink = tweetLink;
        this.sender = sender;
        this.coworkerLinkedInId = coworkerLinkedInId;
        this.isBirthday = isBirthday;
    }

    // ---------------- Public Methods ---------------- //

    // ---------------- Private Methods --------------- //

    // ----------------- Miscellaneous ---------------- //

}

package com.les4elefantastiq.les4elefantcowork.models;

public class LiveFeedMessage {

    // -------------- Objects, Variables -------------- //

    public String text;
    public int type;
    public String dateTime; // Date ?
    public String tweetLink;
    public String sender;
    public String coworkerLinkedInId;
    public Boolean isBirthday;
    public String pictureUrl;

    // ----------------- Constructor ------------------ //

    public LiveFeedMessage(String text, int type, String dateTime, String tweetLink, String sender, String coworkerLinkedInId, Boolean isBirthday, String pictureUrl) {
        this.text = text;
        this.type = type;
        this.dateTime = dateTime;
        this.tweetLink = tweetLink;
        this.sender = sender;
        this.coworkerLinkedInId = coworkerLinkedInId;
        this.isBirthday = isBirthday;
        this.pictureUrl = pictureUrl;
    }

    // ---------------- Public Methods ---------------- //

    // ---------------- Private Methods --------------- //

    // ----------------- Miscellaneous ---------------- //

}

Add pictureUrl to LivefeedMessage model


package dyvil.tools.gensrc.ast.expression;

import dyvil.tools.gensrc.ast.scope.Scope;
import dyvil.tools.parsing.ASTNode;

public interface Expression extends ASTNode
{
	default boolean evaluateBoolean(Scope scope)
	{
		return Boolean.parseBoolean(this.evaluateString(scope));
	}

	default long evaluateInteger(Scope scope)
	{
		try
		{
			return Long.parseLong(this.evaluateString(scope));
		}
		catch (NumberFormatException ex)
		{
			return 0L;
		}
	}

	default double evaluateDouble(Scope scope)
	{
		try
		{
			return Double.parseDouble(this.evaluateString(scope));
		}
		catch (NumberFormatException ex)
		{
			return 0;
		}
	}

	String evaluateString(Scope scope);

	default Iterable<Expression> evaluateIterable(Scope scope)
	{
		return new ExpressionList(this);
	}

	@Override
	void toString(String indent, StringBuilder builder);
}

package dyvil.tools.gensrc.ast.expression;

import dyvil.collection.iterator.ArrayIterator;
import dyvil.collection.iterator.SingletonIterator;
import dyvil.source.position.SourcePosition;
import dyvil.tools.gensrc.ast.scope.Scope;
import dyvil.tools.parsing.ASTNode;

public interface Expression extends ASTNode
{
	default boolean evaluateBoolean(Scope scope)
	{
		return Boolean.parseBoolean(this.evaluateString(scope));
	}

	default long evaluateInteger(Scope scope)
	{
		try
		{
			return Long.parseLong(this.evaluateString(scope));
		}
		catch (NumberFormatException ex)
		{
			return 0L;
		}
	}

	default double evaluateDouble(Scope scope)
	{
		try
		{
			return Double.parseDouble(this.evaluateString(scope));
		}
		catch (NumberFormatException ex)
		{
			return 0;
		}
	}

	String evaluateString(Scope scope);

	default Iterable<Expression> evaluateIterable(Scope scope)
	{
		final SourcePosition position = this.getPosition();
		final String string = this.evaluateString(scope);

		if (string.indexOf(',') < 0)
		{
			final StringValue value = new StringValue(position, string);
			return () -> new SingletonIterator<>(value);
		}

		final String[] split = string.split("\\s*,\\s*");
		final Expression[] array = new Expression[split.length];
		for (int i = 0; i < split.length; i++)
		{
			array[i] = new StringValue(position, split[i]);
		}
		return () -> new ArrayIterator<>(array);
	}

	@Override
	void toString(String indent, StringBuilder builder);
}

Improve Iterable Conversion in For Directives


package org.realityforge.tarrabah;

import javax.inject.Inject;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;

public class SyslogTCPServer
  extends AbstractTCPServer
{
  private boolean _nullTerminate;
  @Inject
  private SyslogHandler _handler;

  protected ChannelPipelineFactory newPipelineFactory()
  {
    return new ChannelPipelineFactory()
    {
      public ChannelPipeline getPipeline()
        throws Exception
      {
        final ChannelBuffer[] delimiter = _nullTerminate ? Delimiters.nulDelimiter() : Delimiters.lineDelimiter();
        _syslogHandler = new SyslogHandler();
        return Channels.pipeline( new DelimiterBasedFrameDecoder( 2 * 1024 * 1024, delimiter ), _handler );
      }
    };
  }
}

package org.realityforge.tarrabah;

import javax.inject.Inject;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;

public class SyslogTCPServer
  extends AbstractTCPServer
{
  private boolean _nullTerminate;
  @Inject
  private SyslogHandler _handler;

  protected ChannelPipelineFactory newPipelineFactory()
  {
    return new ChannelPipelineFactory()
    {
      public ChannelPipeline getPipeline()
        throws Exception
      {
        final ChannelBuffer[] delimiter = _nullTerminate ? Delimiters.nulDelimiter() : Delimiters.lineDelimiter();
        return Channels.pipeline( new DelimiterBasedFrameDecoder( 2 * 1024 * 1024, delimiter ), _handler );
      }
    };
  }
}

Remove incorrect explicity setting of CDI managed bean


package devopsdistilled.operp.client.items.controllers.impl;

import javax.inject.Inject;

import devopsdistilled.operp.client.items.controllers.EditItemPaneController;
import devopsdistilled.operp.client.items.models.BrandModel;
import devopsdistilled.operp.client.items.models.EditItemPaneModel;
import devopsdistilled.operp.client.items.models.ItemModel;
import devopsdistilled.operp.client.items.models.ProductModel;
import devopsdistilled.operp.client.items.views.EditItemPane;
import devopsdistilled.operp.server.data.entity.items.Item;

public class EditItemPaneControllerImpl implements EditItemPaneController {

	@Inject
	private EditItemPane view;

	@Inject
	private EditItemPaneModel model;

	@Inject
	private ItemModel itemModel;

	@Inject
	private ProductModel productModel;

	@Inject
	private BrandModel brandModel;

	@Override
	public void init() {

	}

	@Override
	public void init(Item item) {
		view.init();
		model.setItem(item);
		model.registerObserver(view);
		productModel.registerObserver(view);
		brandModel.registerObserver(view);
	}

}

package devopsdistilled.operp.client.items.controllers.impl;

import javax.inject.Inject;

import devopsdistilled.operp.client.items.controllers.EditItemPaneController;
import devopsdistilled.operp.client.items.models.BrandModel;
import devopsdistilled.operp.client.items.models.EditItemPaneModel;
import devopsdistilled.operp.client.items.models.ItemModel;
import devopsdistilled.operp.client.items.models.ProductModel;
import devopsdistilled.operp.client.items.views.EditItemPane;
import devopsdistilled.operp.server.data.entity.items.Item;

public class EditItemPaneControllerImpl implements EditItemPaneController {

	@Inject
	private EditItemPane view;

	@Inject
	private EditItemPaneModel model;

	@Inject
	private ItemModel itemModel;

	@Inject
	private ProductModel productModel;

	@Inject
	private BrandModel brandModel;

	@Override
	public void init() {

	}

	@Override
	public void init(Item item) {
		view.init();
		model.setItem(item);
		model.registerObserver(view);
		productModel.registerObserver(view);
		brandModel.registerObserver(view);
	}

	@Override
	public Item save(Item item) {
		return itemModel.saveAndUpdateModel(item);
	}

	@Override
	public void validate(Item item) {
		// TODO Auto-generated method stub

	}

}

Define save() and define bare validate()


package com.github.sparkcaller.preprocessing;

import org.apache.spark.api.java.function.Function;
import picard.sam.SortSam;

import java.io.File;
import java.util.ArrayList;

public class SamToSortedBam implements Function<File, File> {
    public File call(File file) throws Exception {
        final String ext = "sam";
        String newFileName = file.getPath().substring(0, file.getPath().length() - ext.length()) + "bam";
        File outputSamFile = new File(newFileName);

        ArrayList<String> sorterArgs = new ArrayList<String>();
        sorterArgs.add("INPUT=");
        sorterArgs.add(file.getPath());

        sorterArgs.add("OUTPUT=");
        sorterArgs.add(outputSamFile.getPath());

        sorterArgs.add("SORT_ORDER=coordinate");
        SortSam samSorter = new SortSam();
        samSorter.instanceMain(sorterArgs.toArray(new String[0]));

        return outputSamFile;
    }
}

package com.github.sparkcaller.preprocessing;

import com.github.sparkcaller.Utils;
import org.apache.spark.api.java.function.Function;
import picard.sam.SortSam;

import java.io.File;
import java.util.ArrayList;

public class SamToSortedBam implements Function<File, File> {
    public File call(File file) throws Exception {
        String newFileName = Utils.removeExtenstion(file.getPath(), "sam") + ".bam";
        File outputSamFile = new File(newFileName);

        ArrayList<String> sorterArgs = new ArrayList<String>();
        sorterArgs.add("INPUT=");
        sorterArgs.add(file.getPath());

        sorterArgs.add("OUTPUT=");
        sorterArgs.add(outputSamFile.getPath());

        sorterArgs.add("SORT_ORDER=coordinate");
        SortSam samSorter = new SortSam();
        samSorter.instanceMain(sorterArgs.toArray(new String[0]));

        return outputSamFile;
    }
}

Use the utility for removing file extensions instead of doing this manually.


package com.elmakers.mine.bukkit.utility.platform.modern;

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

import org.bukkit.block.Block;
import org.bukkit.util.Vector;
import org.bukkit.util.VoxelShape;

import com.elmakers.mine.bukkit.utility.BoundingBox;
import com.elmakers.mine.bukkit.utility.platform.Platform;

public class ModernCompatibilityUtils extends com.elmakers.mine.bukkit.utility.platform.v1_16.CompatibilityUtils {

    public ModernCompatibilityUtils(Platform platform) {
        super(platform);
    }

    @Override
    public Collection<BoundingBox> getBoundingBoxes(Block block) {
        VoxelShape voxelShape = block.getCollisionShape();
        Collection<org.bukkit.util.BoundingBox> boxes = voxelShape.getBoundingBoxes();
        List<BoundingBox> converted = new ArrayList<>(boxes.size());
        Vector center = block.getLocation().toVector();

        for (org.bukkit.util.BoundingBox bukkitBB : boxes) {
            converted.add(new BoundingBox(center,
                    bukkitBB.getMinX(), bukkitBB.getMaxX(),
                    bukkitBB.getMinY(), bukkitBB.getMaxY(),
                    bukkitBB.getMinZ(), bukkitBB.getMaxZ())
            );
        }
        return converted;
    }
}

package com.elmakers.mine.bukkit.utility.platform.modern;

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

import org.bukkit.block.Block;
import org.bukkit.util.Vector;
import org.bukkit.util.VoxelShape;

import com.elmakers.mine.bukkit.utility.BoundingBox;
import com.elmakers.mine.bukkit.utility.platform.Platform;

public class ModernCompatibilityUtils extends com.elmakers.mine.bukkit.utility.platform.v1_16.CompatibilityUtils {

    public ModernCompatibilityUtils(Platform platform) {
        super(platform);
    }

    @Override
    public Collection<BoundingBox> getBoundingBoxes(Block block) {
        VoxelShape voxelShape = block.getCollisionShape();
        Collection<org.bukkit.util.BoundingBox> boxes = voxelShape.getBoundingBoxes();
        if (boxes.isEmpty()) {
            return super.getBoundingBoxes(block);
        }
        List<BoundingBox> converted = new ArrayList<>(boxes.size());
        Vector center = block.getLocation().toVector();

        for (org.bukkit.util.BoundingBox bukkitBB : boxes) {
            converted.add(new BoundingBox(center,
                    bukkitBB.getMinX(), bukkitBB.getMaxX(),
                    bukkitBB.getMinY(), bukkitBB.getMaxY(),
                    bukkitBB.getMinZ(), bukkitBB.getMaxZ())
            );
        }
        return converted;
    }
}

Return default full block bounding box for blocks that don't have one


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

import com.clicktravel.cheddar.domain.event.DomainEvent;

public class ConstraintViolationException extends IllegalStateException {

    private static final long serialVersionUID = 3662580310625716490L;

    private DomainEvent domainEvent;

    public ConstraintViolationException(final String message) {
        super(message);
    }

    public ConstraintViolationException(final String message, final Throwable cause) {
        super(message, cause);
    }

    public ConstraintViolationException(final DomainEvent domainEvent) {
        super(domainEvent.type());
        this.domainEvent = domainEvent;
    }

    public DomainEvent getDomainEvent() {
        return domainEvent;
    }

}

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

public class ConstraintViolationException extends IllegalStateException {

    private static final long serialVersionUID = 3662580310625716490L;

    public ConstraintViolationException(final String message) {
        super(message);
    }

    public ConstraintViolationException(final String message, final Throwable cause) {
        super(message, cause);
    }

}

Remove constructor for ContraintViolationException that used DomainEvent to reduce coupling on application layer


package com.athena.meerkat.controller.web.user;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;

@Entity
@Table(name = "user_role")
public class UserRole implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Column(name = "Id")
	@Id
	private int Id;
	@Column(name = "name")
	private String name;
	@OneToMany(mappedBy = "userRole", fetch = FetchType.LAZY)
	@JsonBackReference
	private List<User> users;

	public int getId() {
		return Id;
	}

	public void setId(int id) {
		Id = id;
	}

	public String getName() {
		return name;
	}

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

	public Collection<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

}

package com.athena.meerkat.controller.web.user;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;

@Entity
@Table(name = "user_role")
public class UserRole implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	@Column(name = "Id")
	@Id
	private int Id;
	@Column(name = "name")
	private String name;
	@OneToMany(mappedBy = "userRole", fetch = FetchType.LAZY)
	@JsonBackReference
	private List<User> users;

	public int getId() {
		return Id;
	}

	public void setId(int id) {
		Id = id;
	}

	public String getName() {
		return name;
	}

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

	public Collection<User> getUsers() {
		return users;
	}

	public void setUsers(List<User> users) {
		this.users = users;
	}

	public int getUserCount() {
		return this.users.size();
	}

}

Add more property to display on UI


package stream.flarebot.flarebot.commands.secret;

import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.objects.GuildWrapper;

import java.io.File;

public class LogsCommand implements Command {
    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        if (getPermissions(channel).isCreator(sender)) {
            channel.sendFile(new File("latest.log"), new MessageBuilder().append('\u200B').build()).queue();
        }
    }

    @Override
    public String getCommand() {
        return "logs";
    }

    @Override
    public String getDescription() {
        return "Gets the logs";
    }

    @Override
    public String getUsage() {
        return "{%}logs";
    }

    @Override
    public CommandType getType() {
        return CommandType.SECRET;
    }

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

package stream.flarebot.flarebot.commands.secret;

import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.Member;
import net.dv8tion.jda.core.entities.Message;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.commands.Command;
import stream.flarebot.flarebot.commands.CommandType;
import stream.flarebot.flarebot.objects.GuildWrapper;

import java.io.File;

public class LogsCommand implements Command  {

    @Override
    public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) {
        channel.sendFile(new File("latest.log"), new MessageBuilder().append('\u200B').build()).queue();
    }

    @Override
    public String getCommand() {
        return "logs";
    }

    @Override
    public String getDescription() {
        return "Gets the logs";
    }

    @Override
    public String getUsage() {
        return "{%}logs";
    }

    @Override
    public CommandType getType() {
        return CommandType.SECRET;
    }

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

Remove unnessacary check and format


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

import java.nio.Buffer;

/**
 * Efficiently modifies the internal limits and offsets of a {@link Buffer}.
 */
interface BufferMutator {

  /**
   * Modifies the passed direct Buffer to point at the indicated
   * memory address and size.
   *

   * The passed buffer can be of any address or capacity.
   *

   * {@link Buffer#clear() } will be invoked automatically (this does not clear
   * the buffer, but simply resets its limits, position and mark).
   *
   * @param buffer   a direct (off-heap) buffer
   * @param address  the new memory address of the buffer
   * @param capacity the new capacity of the buffer
   */
  void modify(Buffer buffer, long address, int capacity);
}

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

import java.nio.Buffer;

/**
 * Efficiently modifies the internal limits and offsets of a {@link Buffer}.
 */
interface BufferMutator {

  /**
   * Modifies the passed direct Buffer to point at the indicated
   * memory address and size.
   *

   * The passed buffer can be of any address or capacity, but the buffer must be
   * direct. The result of presenting a non-direct buffer is undefined.
   *

   * {@link Buffer#clear() } will be invoked automatically (this does not clear
   * the buffer, but simply resets its limits, position and mark).
   *
   * @param buffer   a direct (off-heap) buffer
   * @param address  the new memory address of the buffer
   * @param capacity the new capacity of the buffer
   */
  void modify(Buffer buffer, long address, int capacity);
}

Clarify direct buffers are not necessarily checked


package us.myles.ViaVersion;

import net.md_5.bungee.api.plugin.Plugin;

import static net.md_5.bungee.api.ChatColor.RED;

public class Bungee extends Plugin {

    @Override
    public void onEnable() {
        getLogger().info(RED + "===============================================");
        getLogger().info(RED + "ViaVersion is NOT a Bungeecord plugin");
        getLogger().info(RED + "Install this plugin on all your spigot/bukkit");
        getLogger().info(RED + "servers and use the latest Bungeecord version");
        getLogger().info(RED + "to make ViaVersion work with BungeeCord.");
        getLogger().info(RED + "===============================================");
    }
}

package us.myles.ViaVersion;

import net.md_5.bungee.api.plugin.Plugin;

import static net.md_5.bungee.api.ChatColor.RED;

public class Bungee extends Plugin {

    @Override
    public void onEnable() {
        getLogger().severe(RED + "===============================================");
        getLogger().severe(RED + "ViaVersion is NOT a Bungeecord plugin");
        getLogger().severe(RED + "Install this plugin on all your spigot/bukkit");
        getLogger().severe(RED + "servers and use the latest Bungeecord version");
        getLogger().severe(RED + "to make ViaVersion work with BungeeCord.");
        getLogger().severe(RED + "===============================================");
    }
}

Change from info to severe


package org.codehaus.xfire.soap.handler;

import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.addressing.AddressingOperationInfo;
import org.codehaus.xfire.handler.AbstractHandler;
import org.codehaus.xfire.handler.Phase;
import org.codehaus.xfire.service.OperationInfo;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.SoapConstants;

/**
 * Sets the SOAP action on an outgoing invocation.
 *
 * @author Dan Diephouse
 */
public class SoapActionOutHandler
    extends AbstractHandler
{
    public SoapActionOutHandler()
    {
        super();
        setPhase(Phase.TRANSPORT);
    }

    public void invoke(MessageContext context)
        throws Exception
    {
        Service service = context.getService();
        if (service == null) return;

        OperationInfo op = context.getExchange().getOperation();
        AddressingOperationInfo info = (AddressingOperationInfo) op.getProperty(AddressingOperationInfo.ADDRESSING_OPERATION_KEY);
        String action = null;
        if( info != null ){
            action = info.getOutAction();
        }

        /*AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();

        String action = binding.getSoapAction(op);*/
        if (action != null)
            context.getOutMessage().setProperty(SoapConstants.SOAP_ACTION, action);
    }
}

package org.codehaus.xfire.soap.handler;

import org.codehaus.xfire.MessageContext;
import org.codehaus.xfire.handler.AbstractHandler;
import org.codehaus.xfire.handler.Phase;
import org.codehaus.xfire.service.OperationInfo;
import org.codehaus.xfire.service.Service;
import org.codehaus.xfire.soap.AbstractSoapBinding;
import org.codehaus.xfire.soap.SoapConstants;

/**
 * Sets the SOAP action on an outgoing invocation.
 *
 * @author Dan Diephouse
 */
public class SoapActionOutHandler
    extends AbstractHandler
{
    public SoapActionOutHandler()
    {
        super();
        setPhase(Phase.TRANSPORT);
    }

    public void invoke(MessageContext context)
        throws Exception
    {
        Service service = context.getService();
        if (service == null) return;

        OperationInfo op = context.getExchange().getOperation();
        AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding();

        String action = binding.getSoapAction(op);
        if (action != null)
            context.getOutMessage().setProperty(SoapConstants.SOAP_ACTION, action);
    }
}

Revert change. The soap action comes from the SOAP binding, not the ws-addressing information.


package com.smartlogic;

/**
 * Options to send with SPARQL update calls.
 */
public class SparqlUpdateOptions {

  /**
   * Set to true to accept constraint warnings and proceed with changes.
   * Normally this is set to true when runCheckConstraints is set to false;
   */
  public boolean acceptWarnings = false;

  /**
   * Set to false to not run check constraints when running SPARQL update.
   */
  public boolean runCheckConstraints = true;

  /**
   * Set to false to not run edit rules when SPARQL Update is sent.
   */
  public boolean runEditRules = true;
}

package com.smartlogic;

/**
 * Options to send with SPARQL update calls.
 */
public class SparqlUpdateOptions {

  /**
   * Set to true to accept constraint warnings and proceed with changes.
   * Normally this is set to true when runCheckConstraints is set to false;
   */
  public boolean acceptWarnings = false;

  /**
   * Set to false to not run check constraints when running SPARQL update.
   */
  public boolean runCheckConstraints = true;

  /**
   * Set to false to not run edit rules when SPARQL Update is sent.
   */
  public boolean runEditRules = true;

  public boolean isAcceptWarnings() {
    return acceptWarnings;
  }

  public void setAcceptWarnings(boolean acceptWarnings) {
    this.acceptWarnings = acceptWarnings;
  }

  public boolean isRunCheckConstraints() {
    return runCheckConstraints;
  }

  public void setRunCheckConstraints(boolean runCheckConstraints) {
    this.runCheckConstraints = runCheckConstraints;
  }

  public boolean isRunEditRules() {
    return runEditRules;
  }

  public void setRunEditRules(boolean runEditRules) {
    this.runEditRules = runEditRules;
  }
}

Add getters/setters, because Java is a very verbose language and Spring is inflexible. Leaving class variables public as they can also be used by clients that don't require bean accessors, or those that are already using them.


/**
 *
 */
package com.perforce.p4java.exception;

import com.perforce.p4java.server.IServerMessage;

/**
 * Exception thrown by P4Java methods when access to data or services has
 * been denied by the Perforce server. This is usually a login or
 * permissions issue.
 *
 *
 */

public class AccessException extends P4JavaException {

	private static final long serialVersionUID = 1L;

	private IServerMessage err;

	public AccessException(final IServerMessage err) {
		super(err.toString());
		this.err = err;
	}

	public IServerMessage getServerMessage() {
		return err;
	}
}

/**
 *
 */
package com.perforce.p4java.exception;

import com.perforce.p4java.server.IServerMessage;

/**
 * Exception thrown by P4Java methods when access to data or services has
 * been denied by the Perforce server. This is usually a login or
 * permissions issue.
 *
 *
 */

public class AccessException extends P4JavaException {

	private static final long serialVersionUID = 1L;

	private IServerMessage err;

	public AccessException(final IServerMessage err) {
		super(err.getLocalizedMessage());
		this.err = err;
	}

	public IServerMessage getServerMessage() {
		return err;
	}
}

Fix the display text for authentication errors


package io.takari.maven.plugins.resources;

import java.io.File;
import java.util.List;

import org.apache.maven.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

@Mojo(name = "process-resources", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, configurator = "takari-mojo")
public class ProcessResources extends AbstractProcessResourcesMojo {

  @Parameter(defaultValue = "${project.build.outputDirectory}", property = "resources.outputDirectory")
  private File outputDirectory;

  @Parameter
  private List<Resource> resources;

  @Override
  protected void executeMojo() throws MojoExecutionException {
    process(resources != null ? resources : project.getBuild().getResources(), outputDirectory);
  }

}

package io.takari.maven.plugins.resources;

import java.io.File;
import java.util.List;

import org.apache.maven.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

@Mojo(name = "processResources", defaultPhase = LifecyclePhase.PROCESS_RESOURCES, configurator = "takari-mojo")
public class ProcessResources extends AbstractProcessResourcesMojo {

  @Parameter(defaultValue = "${project.build.outputDirectory}", property = "resources.outputDirectory")
  private File outputDirectory;

  @Parameter
  private List<Resource> resources;

  @Override
  protected void executeMojo() throws MojoExecutionException {
    process(resources != null ? resources : project.getBuild().getResources(), outputDirectory);
  }

}

Use camel case for names of mojos and avoid hypens


/*
 * #%L
 * BroadleafCommerce Common Libraries
 * %%
 * Copyright (C) 2009 - 2013 Broadleaf Commerce
 * %%
 * 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.
 * #L%
 */
package org.broadleafcommerce.common.extensibility.jpa.clone;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marker annotation for fields that should not undergo enterprise sandbox config validation (if applicable)
 *
 * @author jfischer
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD})
public @interface IgnoreEnterpriseConfigValidation {

}

/*
 * #%L
 * BroadleafCommerce Common Libraries
 * %%
 * Copyright (C) 2009 - 2013 Broadleaf Commerce
 * %%
 * 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.
 * #L%
 */
package org.broadleafcommerce.common.extensibility.jpa.clone;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marker annotation for fields that should not undergo enterprise sandbox config validation (if applicable)
 *
 * @author jfischer
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.TYPE})
public @interface IgnoreEnterpriseConfigValidation {

}

Allow ignore to be called at class and field level


package amai.org.conventions.events.adapters;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import amai.org.conventions.R;
import amai.org.conventions.events.activities.EventsTimeSlot;
import amai.org.conventions.utils.Dates;

public class FreeTimeSlotViewHolder extends RecyclerView.ViewHolder {
	private TextView textView;

	public FreeTimeSlotViewHolder(View view) {
		super(view);
		textView = (TextView) view.findViewById(R.id.small_text);
	}

	public void setModel(EventsTimeSlot slot) {
		textView.setText(textView.getContext().getString(R.string.free_time,
				Dates.toHumanReadableTimeDuration(slot.getEndTime().getTime() - slot.getStartTime().getTime())));
	}
}

package amai.org.conventions.events.adapters;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import java.util.Date;

import amai.org.conventions.R;
import amai.org.conventions.ThemeAttributes;
import amai.org.conventions.events.activities.EventsTimeSlot;
import amai.org.conventions.utils.Dates;

public class FreeTimeSlotViewHolder extends RecyclerView.ViewHolder {
	private TextView textView;

	public FreeTimeSlotViewHolder(View view) {
		super(view);
		textView = (TextView) view.findViewById(R.id.small_text);
	}

	public void setModel(EventsTimeSlot slot) {
		Date startTime = slot.getStartTime();
		Date endTime = slot.getEndTime();
		textView.setText(textView.getContext().getString(R.string.free_time,
				Dates.toHumanReadableTimeDuration(endTime.getTime() - startTime.getTime())));

		// Set color according to started/during/passed
		int color;
		if (!startTime.before(Dates.now())) {
			color = ThemeAttributes.getColor(itemView.getContext(), R.attr.eventTypeNotStartedColor);
		} else if (endTime.before(Dates.now())) {
			color = ThemeAttributes.getColor(itemView.getContext(), R.attr.eventTypeEndedColor);
		} else {
			color = ThemeAttributes.getColor(itemView.getContext(), R.attr.eventTypeCurrentColor);
		}
		textView.setTextColor(color);
	}
}

Set free time slot text color according to before/during/after


package com.ezardlabs.lostsector.missions;

import com.ezardlabs.lostsector.missions.objectives.Cryopod;

public class DefenseMission extends Mission {
	Cryopod cryopod = new Cryopod();

	@Override
	public void load() {

	}

	public void onCryopodDestroyed() {
	}
}

package com.ezardlabs.lostsector.missions;

import com.ezardlabs.dethsquare.Camera;
import com.ezardlabs.dethsquare.GameObject;
import com.ezardlabs.dethsquare.Vector2;
import com.ezardlabs.dethsquare.prefabs.PrefabManager;
import com.ezardlabs.lostsector.camera.SmartCamera;
import com.ezardlabs.lostsector.map.MapManager;
import com.ezardlabs.lostsector.missions.objectives.Cryopod;

public class DefenseMission extends Mission {
	Cryopod cryopod = new Cryopod();

	@Override
	public void load() {
		MapManager.loadMap("defense0");
		GameObject player = GameObject.instantiate(PrefabManager.loadPrefab("player"), MapManager.playerSpawn);
		GameObject.instantiate(new GameObject("Camera", new Camera(true),
				new SmartCamera(player.transform, 1000, new Vector2(100, 100))), new Vector2());
	}

	public void onCryopodDestroyed() {
	}
}

Load defense map and spawn player and camera


package pl.tomaszdziurko.jvm_bloggers.blog_posts;

import com.google.common.base.Preconditions;
import lombok.NonNull;
import org.apache.commons.lang3.StringUtils;
import pl.tomaszdziurko.jvm_bloggers.blogs.domain.Blog;

public class RssLink {

    private final Blog blog;

    public RssLink(@NonNull Blog blog) {
        Preconditions.checkArgument(StringUtils.isNotBlank(blog.getRss()),
                "Rss link can not be NULL nor empty.");
        this.blog = blog;
    }

    public String getUrl() {
        return blog.getRss();
    }

    public Blog getOwner() {
        return blog;
    }
}

package pl.tomaszdziurko.jvm_bloggers.blog_posts;

import com.google.common.base.Preconditions;
import lombok.NonNull;
import pl.tomaszdziurko.jvm_bloggers.blogs.domain.Blog;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

public class RssLink {

    private final Blog blog;

    public RssLink(@NonNull Blog blog) {
        Preconditions.checkArgument(isNotBlank(blog.getRss()),
                "Rss link can not be NULL nor empty.");
        this.blog = blog;
    }

    public String getUrl() {
        return blog.getRss();
    }

    public Blog getOwner() {
        return blog;
    }
}

Improve readability - StringUtils static import.


package org.lamport.tla.toolbox.jcloud;

public class EC2CloudTLCInstanceParameters extends CloudTLCInstanceParameters {

	@Override
	public String getOwnerId() {
		// ubuntu official
		return "owner-id=owner-id=099720109477;state=available;image-type=machine";
	}

	@Override
	public String getCloudProvier() {
		return "aws-ec2";
	}

	@Override
	public String getImageId() {
		// ubuntu 64bit 14.04 precise paravirtual
		return "us-east-1/ami-7fe7fe16";
	}

	@Override
	public String getHardwareId() {
		return "m2.4xlarge";
	}

	@Override
	public String getJavaSystemProperties() {
		return "-Dtlc2.tool.fp.FPSet.impl=tlc2.tool.fp.OffHeapDiskFPSet";
	}

	@Override
	public String getJavaVMArgs() {
		return "-Xmx24G -Xms24G -XX:MaxDirectMemorySize=32g";
	}

	@Override
	public String getTLCParameters() {
		return "-workers 12";
	}
}

package org.lamport.tla.toolbox.jcloud;

public class EC2CloudTLCInstanceParameters extends CloudTLCInstanceParameters {

	@Override
	public String getOwnerId() {
		// ubuntu official
		return "owner-id=owner-id=099720109477;state=available;image-type=machine";
	}

	@Override
	public String getCloudProvier() {
		return "aws-ec2";
	}

	@Override
	public String getImageId() {
		// ubuntu 64bit 14.04 precise paravirtual release
		// https://cloud-images.ubuntu.com/releases/14.04/release/
		return "us-east-1/ami-30837058";
	}

	@Override
	public String getHardwareId() {
		return "m2.4xlarge";
	}

	@Override
	public String getJavaSystemProperties() {
		return "-Dtlc2.tool.fp.FPSet.impl=tlc2.tool.fp.OffHeapDiskFPSet";
	}

	@Override
	public String getJavaVMArgs() {
		return "-Xmx24G -Xms24G -XX:MaxDirectMemorySize=32g";
	}

	@Override
	public String getTLCParameters() {
		return "-workers 12";
	}
}

Use most recent Ubuntu AMI to minimize the cloud instance spin-up time (=> less system updates to apply at startup)


package org.jmeterplugins.protocol.http.control;

import org.junit.Test;

import java.io.File;

public class STSInstallerTest {
    @Test
    public void name() throws Exception {
        File self = new File(STSInstaller.class.getProtectionDomain().getCodeSource().getLocation().getFile());
        String home = self.getParentFile().getParentFile().getParent();
        File dest = new File(home + File.separator + "bin");
        dest.mkdirs();

        STSInstaller.main(new String[0]);
    }
}

package org.jmeterplugins.protocol.http.control;

import org.apache.commons.io.FileUtils;
import org.junit.Test;

import java.io.File;

public class STSInstallerTest {
    @Test
    public void name() throws Exception {
        File self = new File(STSInstaller.class.getProtectionDomain().getCodeSource().getLocation().getFile());
        String home = self.getParentFile().getParentFile().getParent();
        File dest = new File(home + File.separator + "bin");
        dest.mkdirs();

        STSInstaller.main(new String[0]);

        FileUtils.deleteDirectory(dest);
    }
}

Make test cleanup after itself


package org.hummingbirdlang.nodes;

import com.oracle.truffle.api.frame.VirtualFrame;

import org.hummingbirdlang.types.realize.InferenceVisitor;

public class HBAssignmentNode extends HBExpressionNode {
  @Child private HBExpressionNode targetNode;
  @Child private HBExpressionNode valueNode;

  public HBAssignmentNode(HBExpressionNode targetNode, HBExpressionNode valueNode) {
    this.targetNode = targetNode;
    this.valueNode = valueNode;
  }

  public void accept(InferenceVisitor visitor) {
    return;
  }

  @Override
  public Object executeGeneric(VirtualFrame frame) {
    return null;
  }

  @Override
  public String toString() {
    StringBuilder result = new StringBuilder("HBAssignmentNode");
    result.append("(");
    result.append(this.targetNode.toString());
    result.append(" = ");
    result.append(this.valueNode.toString());
    result.append(")");
    return result.toString();
  }
}

package org.hummingbirdlang.nodes;

import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.VirtualFrame;

import org.hummingbirdlang.types.realize.InferenceVisitor;

public class HBAssignmentNode extends HBExpressionNode {
  @Child private HBExpressionNode targetNode;
  @Child private HBExpressionNode valueNode;

  public HBAssignmentNode(HBExpressionNode targetNode, HBExpressionNode valueNode) {
    this.targetNode = targetNode;
    this.valueNode = valueNode;
  }

  public void accept(InferenceVisitor visitor) {
    return;
  }

  @Override
  public Object executeGeneric(VirtualFrame frame) {
    if (!(this.targetNode instanceof HBIdentifierNode)) {
      throw new RuntimeException("Cannot yet handle assignment of non-identifier node: " + this.targetNode.toString());
    }
    HBIdentifierNode identifierNode = (HBIdentifierNode)this.targetNode;

    Object value = this.valueNode.executeGeneric(frame);
    FrameSlot frameSlot = frame.getFrameDescriptor().findFrameSlot(identifierNode.getName());
    frame.setObject(frameSlot, value);
    return value;
  }

  @Override
  public String toString() {
    StringBuilder result = new StringBuilder("HBAssignmentNode");
    result.append("(");
    result.append(this.targetNode.toString());
    result.append(" = ");
    result.append(this.valueNode.toString());
    result.append(")");
    return result.toString();
  }
}

Add rudimentary implementation of assignment node