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

package org.optaplanner.examples.taskassigning.app;

import org.optaplanner.examples.common.app.CommonBenchmarkApp;

public class TaskAssigningBenchmarkApp extends CommonBenchmarkApp {

    public static void main(String[] args) {
        new TaskAssigningBenchmarkApp().buildAndBenchmark(args);
    }

    public TaskAssigningBenchmarkApp() {
        super(
                new ArgOption("default",
                        "org/optaplanner/examples/taskassigning/benchmark/taskAssigningBenchmarkConfig.xml")
        );
    }

}

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

package org.optaplanner.examples.taskassigning.app;

import org.optaplanner.examples.common.app.CommonBenchmarkApp;

public class TaskAssigningBenchmarkApp extends CommonBenchmarkApp {

    public static void main(String[] args) {
        new TaskAssigningBenchmarkApp().buildAndBenchmark(args);
    }

    public TaskAssigningBenchmarkApp() {
        super(
                new ArgOption("default",
                        "org/optaplanner/examples/taskassigning/benchmark/taskAssigningBenchmarkConfig.xml"),
                new ArgOption("scoreDirector",
                        "org/optaplanner/examples/taskassigning/benchmark/taskAssigningScoreDirectorBenchmarkConfig.xml")
        );
    }

}

Add scoreDirector benchmark in the app too


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sakamichi46.api;

import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.stereotype.Component;

/**
 *
 * @author kikuta
 */
@Component
@ApplicationPath("api")
public class JerseyConfig extends ResourceConfig {

    public JerseyConfig() {
        register(HiraganaKeyakiResource.class);
        register(Keyakizaka46Resource.class);
        register(Nogizaka46Resource.class);
        register(Nogizaka46ThirdResource.class);
    }

}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sakamichi46.api;

import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;
import org.springframework.stereotype.Component;

/**
 *
 * @author kikuta
 */
@Component
@ApplicationPath("sakamichi46api/api")
public class JerseyConfig extends ResourceConfig {

    public JerseyConfig() {
        register(HiraganaKeyakiResource.class);
        register(Keyakizaka46Resource.class);
        register(Nogizaka46Resource.class);
        register(Nogizaka46ThirdResource.class);
    }

}

Change root path from api to sakamichi46api/api.


package weiboclient4j.oauth2;

/**
 * @author Hover Ruan
 */
public enum DisplayType {

    Default("default"),

    Mobile("mobile"),

    Popup("popup"),

    Wap12("wap1.2"),

    Wap20("wap2.0"),

    Js("js"),

    AppOnWeibo("apponweibo");

    private String display;

    DisplayType(String display) {
        this.display = display;
    }

    public String getDisplay() {
        return display;
    }
}

package weiboclient4j.oauth2;

/**
 * @author Hover Ruan
 */
public enum DisplayType {

    Default("default"),

    Mobile("mobile"),

    Popup("popup"),

    Wap12("wap1.2"),

    Wap20("wap2.0"),

    Js("js"),

    Wap("wap"),

    Client("client"),

    AppOnWeibo("apponweibo");

    private String display;

    DisplayType(String display) {
        this.display = display;
    }

    public String getDisplay() {
        return display;
    }
}

Add new display-type for API 2.0


package fi.reaktor.android.rssreader;

import android.app.Activity;

import fi.reaktor.android.rssreader.app.RssReaderApplication;

public abstract class RssReaderBaseActivity extends Activity {

    @Override
    protected void onPause() {
        ((RssReaderApplication)getApplicationContext()).persistDataIfModified();
        super.onPause();
    }
}

package fi.reaktor.android.rssreader;

import android.app.Activity;

import fi.reaktor.android.rssreader.app.RssReaderApplication;

public abstract class RssReaderBaseActivity extends Activity {

    @Override
    protected void onPause() {
        ((RssReaderApplication)getApplication()).persistDataIfModified();
        super.onPause();
    }
}

Use getApplication() to access the Application instance


package org.bouncycastle.asn1;

public class ASN1ObjectIdentifier
    extends DERObjectIdentifier
{
    public ASN1ObjectIdentifier(String identifier)
    {
        super(identifier);
    }

    ASN1ObjectIdentifier(byte[] bytes)
    {
        super(bytes);
    }

    /**
     * Return an OID that creates a branch under the current one.
     *
     * @param branchID node numbers for the new branch.
     * @return
     */
    public ASN1ObjectIdentifier branch(String branchID)
    {
        return new ASN1ObjectIdentifier(getId() + "." + branchID);
    }

    /**
     * Return  true if this oid is an extension of the passed in branch, stem.
     * @param stem the arc or branch that is a possible parent.
     * @return  true if the branch is on the passed in stem, false otherwise.
     */
    public boolean on(ASN1ObjectIdentifier stem)
    {
        return this.getId().startsWith(stem.getId());
    }
}

package org.bouncycastle.asn1;

public class ASN1ObjectIdentifier
    extends DERObjectIdentifier
{
    public ASN1ObjectIdentifier(String identifier)
    {
        super(identifier);
    }

    ASN1ObjectIdentifier(byte[] bytes)
    {
        super(bytes);
    }

    /**
     * Return an OID that creates a branch under the current one.
     *
     * @param branchID node numbers for the new branch.
     * @return
     */
    public ASN1ObjectIdentifier branch(String branchID)
    {
        return new ASN1ObjectIdentifier(getId() + "." + branchID);
    }

    /**
     * Return  true if this oid is an extension of the passed in branch, stem.
     * @param stem the arc or branch that is a possible parent.
     * @return  true if the branch is on the passed in stem, false otherwise.
     */
    public boolean on(ASN1ObjectIdentifier stem)
    {
        String id = getId(), stemId = stem.getId();
        return id.length() > stemId.length() && id.charAt(stemId.length()) == '.' && id.startsWith(stemId);
    }
}

Improve check in method "on"


package com.psidox.saddlewoof.web.rest;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.PreMatching;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
@PreMatching
public class Interceptor implements ContainerRequestFilter {

    @Override
    public void filter(ContainerRequestContext reqContext) throws IOException {

//    	String request = "";
//        request += String.format("uri: %s %s %s\n", reqContext.getMethod(), reqContext.getUriInfo().getPath(), reqContext.getUriInfo().getQueryParameters().toString());
//    	request += String.format("lang: %s\n", reqContext.getAcceptableLanguages());
//    	request += String.format("media: %s\n", reqContext.getAcceptableMediaTypes());
//    	request += "headers:\n";
//    	for (String key: reqContext.getHeaders().keySet()) {
//    	   	request += String.format("+ %s: %s\n", key, reqContext.getHeaders().get(key));
//    	}
//		//request += String.format("body: %s\n", IOUtils.toString(reqContext.getEntityStream()));
//
//    	System.out.println(request);

    }
}

package com.psidox.saddlewoof.web.rest;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.container.PreMatching;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
@PreMatching
public class Interceptor implements ContainerRequestFilter {

    @Override
    public void filter(ContainerRequestContext reqContext) throws IOException {

    	String request = "";
        request += String.format("uri: %s %s %s\n", reqContext.getMethod(), reqContext.getUriInfo().getPath(), reqContext.getUriInfo().getQueryParameters().toString());
    	request += String.format("lang: %s\n", reqContext.getAcceptableLanguages());
    	request += String.format("media: %s\n", reqContext.getAcceptableMediaTypes());
    	request += "headers:\n";
    	for (String key: reqContext.getHeaders().keySet()) {
    	   	request += String.format("+ %s: %s\n", key, reqContext.getHeaders().get(key));
    	}
		//request += String.format("body: %s\n", IOUtils.toString(reqContext.getEntityStream()));

    	System.out.println(request);

    }
}

Add back logging for production debug


/**
 * Created by Eduardo veras on 19-Jun-16.
 * Edited by Siclait on 19-Juu-16
 */

import Entity.*;
import Service.*;

import java.util.List;

public class DatabaseManager {

    // Singleton Constructor
    private DatabaseManager(){

    }

    public static void BootDataBase(){

        List<User> users = UserORMService.GetInstance().FindAll();

        if(users.size() == 0)
        {
            System.out.println("\n\nCreating Admins ...");

            UserORMService.GetInstance().Create(new User("admin", "Administrator", "The", "admin", true));
            UserORMService.GetInstance().Create(new User("Wardo", "Eduardo", "Veras", "1234", true));
            UserORMService.GetInstance().Create(new User("EmmJ", "Emmanuel", "Jaquez", "1234", true));
            UserORMService.GetInstance().Create(new User("Djsiclait", "Djidjelly", "Siclait", "1234", true));

            System.out.println("Admins created successfully!\n");
        }
        else
            System.out.println("\n\nDatabase already created!\n");

    }
}

/**
 * Created by Eduardo veras on 19-Jun-16.
 * Edited by Siclait on 19-Juu-16
 */

import Entity.*;
import Service.*;

import java.util.List;

public class DatabaseManager {

    // Singleton Constructor
    private DatabaseManager(){

    }

    public static void BootDataBase(){

        List<User> users = UserORMService.GetInstance().FindAll();

        if(users.size() == 0)
        {
            System.out.println("\n\nCreating Admins ...");

            UserORMService.GetInstance().Create(new User("admin", "Administrator", "The", "admin", true));
            UserORMService.GetInstance().Create(new User("Wardo", "Eduardo", "Veras", "1234", true));
            UserORMService.GetInstance().Create(new User("EmmJ", "Emmanuel", "Jaquez", "1234", true));
            UserORMService.GetInstance().Create(new User("Djsiclait", "Djidjelly", "Siclait", "1234", true));

            System.out.println("Admins created successfully!\n");
        }
        else
            System.out.println("\n\nDatabase already created!\n");

    }

    // Database Commands
    public static boolean CheckUserCredentials(String option){ return false; }

    public static void MakeAdmin(){ }

}

Add data base root commands


package info.u_team.u_team_test.init;

import info.u_team.u_team_core.util.registry.CommonDeferredRegister;
import info.u_team.u_team_test.TestMod;
import net.minecraft.util.*;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.ForgeRegistries;

public class TestSounds {

	public static final CommonDeferredRegister<SoundEvent> SOUND_EVENTS = CommonDeferredRegister.create(ForgeRegistries.SOUND_EVENTS, TestMod.MODID);

	public static final RegistryObject<SoundEvent> BETTER_ENDERPEARL_USE = SOUND_EVENTS.register("better_enderpearl_use", SoundEvent::new);

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

}

package info.u_team.u_team_test.init;

import info.u_team.u_team_core.util.registry.CommonDeferredRegister;
import info.u_team.u_team_test.TestMod;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.ForgeRegistries;

public class TestSounds {

	public static final CommonDeferredRegister<SoundEvent> SOUND_EVENTS = CommonDeferredRegister.create(ForgeRegistries.SOUND_EVENTS, TestMod.MODID);

	public static final RegistryObject<SoundEvent> BETTER_ENDERPEARL_USE = SOUND_EVENTS.register("better_enderpearl_use", SoundEvent::new);

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

}

Fix imports in test sounds


package edu.vse.configuration;

import edu.vse.filters.LoggingContextFilter;
import edu.vse.filters.RequestLoggingFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FiltersConfig {

    @Bean
    public FilterRegistrationBean loggingContextFilter() {
        LoggingContextFilter loggingContextFilter = new LoggingContextFilter();
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(loggingContextFilter);
        filterRegistrationBean.setOrder(1);
        return filterRegistrationBean;
    }

    @Bean
    public FilterRegistrationBean requestLoggingFilter() {
        RequestLoggingFilter requestLoggingFilter = new RequestLoggingFilter();
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(requestLoggingFilter);
        filterRegistrationBean.setOrder(2);
        return filterRegistrationBean;
    }
}

package edu.vse.configuration;

import edu.vse.filters.LoggingContextFilter;
import edu.vse.filters.RequestLoggingFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;

@Configuration
public class FiltersConfig {

    @Bean
    public FilterRegistrationBean loggingContextFilter() {
        LoggingContextFilter loggingContextFilter = new LoggingContextFilter();
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(loggingContextFilter);
        filterRegistrationBean.setOrder(1);
        return filterRegistrationBean;
    }

    @Bean
    public FilterRegistrationBean requestLoggingFilter() {
        RequestLoggingFilter requestLoggingFilter = new RequestLoggingFilter();
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(requestLoggingFilter);
        filterRegistrationBean.setOrder(2);
        return filterRegistrationBean;
    }

    @Bean
    public FilterRegistrationBean corsFilter() {
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        CorsConfiguration config = new CorsConfiguration();
        config.setAllowCredentials(true);
        config.addAllowedOrigin("*");
        config.addAllowedHeader("*");
        config.addAllowedMethod("*");
        source.registerCorsConfiguration("/**", config);
        FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
        bean.setOrder(0);
        return bean;
    }
}

Enable cross origin for development


/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 * 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.appium.java_client.pagefactory;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * This annotation is used when some element waits for time
 * that differs from defined by default
 */
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD})
public @interface WithTimeout {
    /**
     * Desired waiting duration.
     *
     * @return waiting duration
     */
    long time();

    /**
     * Desired time unit.
     *
     * @return time unit
     */
    TimeUnit unit();
}

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 * 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.appium.java_client.pagefactory;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * This annotation is used when some element waits for time
 * that differs from defined by default.
 */
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD})
public @interface WithTimeout {
    /**
     * Desired waiting duration.
     *
     * @return waiting duration
     */
    long time();

    /**
     * Desired time unit.
     *
     * @return time unit
     */
    TimeUnit unit();
}

Fix checkstyle violation: add missing period to javadoc


/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.unittesting.matchers;

import org.mutabilitydetector.IAnalysisSession.IsImmutable;

public class MutabilityMatchers {

    public static AnalysisResultMatcher noWarningsAllowed() {
        return new NoWarningsAllowedMatcher();
    }

    public static IsImmutableMatcher areImmutable() {
        return new IsImmutableMatcher(IsImmutable.IMMUTABLE);
    }

    public static IsImmutableMatcher areNotImmutable() {
        return new IsImmutableMatcher(IsImmutable.NOT_IMMUTABLE);
    }
}

/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.unittesting.matchers;

import org.mutabilitydetector.IAnalysisSession.IsImmutable;

public class MutabilityMatchers {

    public static AnalysisResultMatcher noWarningsAllowed() {
        return new NoWarningsAllowedMatcher();
    }

    public static IsImmutableMatcher areImmutable() {
        return new IsImmutableMatcher(IsImmutable.IMMUTABLE);
    }

    public static IsImmutableMatcher areEffectivelyImmutable() {
        return new IsImmutableMatcher(IsImmutable.EFFECTIVELY_IMMUTABLE);
    }

    public static IsImmutableMatcher areNotImmutable() {
        return new IsImmutableMatcher(IsImmutable.NOT_IMMUTABLE);
    }
}

Add method to match effectively immutable.


package org.ossmeter.metricprovider.rascal.trans.model;

import com.googlecode.pongo.runtime.*;
import com.mongodb.*;
// protected region custom-imports on begin
// protected region custom-imports end

public class RascalMetrics extends PongoDB {

	public RascalMetrics() {}

	public RascalMetrics(DB db) {
		setDb(db);
	}

	protected MeasurementCollection measurements = null;

	// protected region custom-fields-and-methods on begin
	// protected region custom-fields-and-methods end

	public MeasurementCollection getMeasurements() {
		return measurements;
	}

	@Override
	public void setDb(DB db) {
		super.setDb(db);
		measurements = new MeasurementCollection(db.getCollection("RascalMetrics.measurements"));
		pongoCollections.add(measurements);
	}
}

package org.ossmeter.metricprovider.rascal.trans.model;

import com.googlecode.pongo.runtime.*;
import com.mongodb.*;
// protected region custom-imports on begin
// protected region custom-imports end

public class RascalMetrics extends PongoDB {
	private final String collectionName;

	public RascalMetrics(DB db, String collectionName) {
		this.collectionName = collectionName;
		setDb(db);
	}

	protected MeasurementCollection measurements = null;

	// protected region custom-fields-and-methods on begin
	// protected region custom-fields-and-methods end

	public MeasurementCollection getMeasurements() {
		return measurements;
	}

	@Override
	public void setDb(DB db) {
		super.setDb(db);
		measurements = new MeasurementCollection(db.getCollection("RascalMetrics.measurements"));
		pongoCollections.add(measurements);
	}
}

Fix for naming collections in Rascal metrics


package net.blay09.mods.cookingforblockheads.registry.recipe;

import com.google.common.collect.Lists;
import net.blay09.mods.cookingforblockheads.registry.CookingRegistry;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraftforge.oredict.ShapedOreRecipe;

public class GeneralFoodRecipe extends FoodRecipe {

    public GeneralFoodRecipe(IRecipe recipe) {
        this.outputItem = recipe.getRecipeOutput();
        if (recipe instanceof ShapedRecipes) {
            this.recipeWidth = ((ShapedRecipes) recipe).getWidth();
        } else if (recipe instanceof ShapedOreRecipe) {
            this.recipeWidth = ((ShapedOreRecipe) recipe).getWidth();
        } else {
            this.recipeWidth = recipe.canFit(1, 1) ? 1 : recipe.canFit(2, 1) ? 2 : 3;
        }
        craftMatrix = Lists.newArrayList();
        for (Ingredient ingredient : recipe.getIngredients()) {
            if (ingredient != Ingredient.EMPTY) {
                boolean isToolItem = CookingRegistry.isToolItem(ingredient);
                craftMatrix.add(new FoodIngredient(ingredient, isToolItem));
            } else {
                craftMatrix.add(null);
            }
        }
    }

}

package net.blay09.mods.cookingforblockheads.registry.recipe;

import com.google.common.collect.Lists;
import net.blay09.mods.cookingforblockheads.registry.CookingRegistry;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraftforge.common.crafting.IShapedRecipe;
import net.minecraftforge.oredict.ShapedOreRecipe;

public class GeneralFoodRecipe extends FoodRecipe {

    public GeneralFoodRecipe(IRecipe recipe) {
        this.outputItem = recipe.getRecipeOutput();
        if (recipe instanceof IShapedRecipe) {
            this.recipeWidth = ((IShapedRecipe) recipe).getRecipeWidth();
        } else {
            this.recipeWidth = recipe.canFit(1, 1) ? 1 : recipe.canFit(2, 2) ? 2 : 3;
        }
        craftMatrix = Lists.newArrayList();
        for (Ingredient ingredient : recipe.getIngredients()) {
            if (ingredient != Ingredient.EMPTY) {
                boolean isToolItem = CookingRegistry.isToolItem(ingredient);
                craftMatrix.add(new FoodIngredient(ingredient, isToolItem));
            } else {
                craftMatrix.add(null);
            }
        }
    }

}

Use new IShapedRecipe for more compatible width detection (alongside the fallback)


package scheduler;

import os.OperatingSystem;
import readinstruction.ReadInstruction;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Created by Karol on 2017-04-20.
 */
public class FcfsScheduler implements Scheduler {
    private Queue<ReadInstruction> waitingQueue;
    private OperatingSystem parentOs;

    public FcfsScheduler(){
        this.waitingQueue = new LinkedList<>();
    }

    @Override
    public void setOs(OperatingSystem parentOs) {
        this.parentOs = parentOs;
    }

    @Override
    public void push(ReadInstruction instruction) {

    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public void update(int time) {

    }
}

package scheduler;

import os.OperatingSystem;
import readinstruction.ReadInstruction;

import java.util.LinkedList;
import java.util.Queue;

/**
 * Created by Karol on 2017-04-20.
 */
public class FcfsScheduler implements Scheduler {
    private Queue<ReadInstruction> waitingQueue;
    private OperatingSystem parentOs;

    public FcfsScheduler(){
        this.waitingQueue = new LinkedList<>();
    }

    @Override
    public void setOs(OperatingSystem parentOs) {
        this.parentOs = parentOs;
    }

    @Override
    public void push(ReadInstruction instruction) {
        this.waitingQueue.add(instruction);
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public void update(int time) {

    }
}

Implement build method of ReadInstructionBuilder


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

package com.googlesource.gerrit.plugins.download.command;

import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.config.DownloadCommand;
import com.google.inject.AbstractModule;

public class DownloadCommandsModule extends AbstractModule {
  @Override
  protected void configure() {
    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Checkout"))
      .to(CheckoutCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Cherry-Pick"))
      .to(CherryPickCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Format-Patch"))
      .to(FormatPatchCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Pull"))
      .to(PullCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Repo-Download"))
      .to(RepoCommand.class);
  }
}

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

package com.googlesource.gerrit.plugins.download.command;

import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.config.DownloadCommand;
import com.google.inject.AbstractModule;

public class DownloadCommandsModule extends AbstractModule {
  @Override
  protected void configure() {
    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Checkout"))
      .to(CheckoutCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Cherry Pick"))
      .to(CherryPickCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Format Patch"))
      .to(FormatPatchCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("Pull"))
      .to(PullCommand.class);

    bind(DownloadCommand.class)
      .annotatedWith(Exports.named("repo"))
      .to(RepoCommand.class);
  }
}

Clean up names of commands


package net.morimekta.providence.util;

import net.morimekta.providence.PServiceCall;

import javax.annotation.Nullable;
import java.util.concurrent.TimeUnit;

/**
 * Interface handling the instrumentation of service calls.
 */
@FunctionalInterface
public interface ServiceCallInstrumentation {
    /**
     * After each service call this method is called with the duration, call and
     * response objects. Exceptions from the call is ignored, and will not affect
     * the response in any way.
     *
     * @param duration The duration of handling the service call in milliseconds,
     *                 including receiving and sending it. It does not include the
     *                 time receiving the first HTTP packet with the headers, or
     *                 waiting for free worker threads.
     * @param call     The call triggered.
     * @param response The response returned.
     */
    void afterCall(double duration,
                   @Nullable PServiceCall call,
                   @Nullable PServiceCall response);

    /**
     * Handy constant for calculating MS duration.
     */
    long NS_IN_MILLIS = TimeUnit.MILLISECONDS.toNanos(1);
}

package net.morimekta.providence.util;

import net.morimekta.providence.PServiceCall;

import javax.annotation.Nullable;
import java.util.concurrent.TimeUnit;

/**
 * Interface handling the instrumentation of service calls.
 */
@FunctionalInterface
public interface ServiceCallInstrumentation {
    /**
     * After each service call this method is called with the duration, call and
     * response objects. Exceptions from the call is ignored, and will not affect
     * the response in any way.
     *

     * Note that the timing may not include the whole stack time since receiving
     * the first packet, that is dependent on the specific implementation and the
     * limitations there. E.g. it does not include the time receiving the first
     * HTTP packet with the headers, or waiting for free worker threads when using
     * ProvidenceServlet.
     *
     * @param duration The duration of handling the service call in milliseconds,
     *                 including receiving and sending it.
     * @param call     The call triggered.
     * @param reply    The reply returned.
     */
    void afterCall(double duration,
                   @Nullable PServiceCall call,
                   @Nullable PServiceCall reply);

    /**
     * Handy constant for calculating MS duration.
     */
    long NS_IN_MILLIS = TimeUnit.MILLISECONDS.toNanos(1);
}

Fix comment relating HTTP to be more generic.


package com.google.heartrate.wearos.app.gatt.attributes;

import java.util.UUID;

/**
 * {@link GattAttribute} is an interface for all GATT (ATT) protocol attributes.
 * According to GATT, all attributes should have Universally Unique Identifier (UUID),
 * which is a standardized 128-bit format for a string ID used to uniquely identify information.
 */
public interface GattAttribute {

    /**
     * Get attribute UUID.
     *
     * @return attribute UUID
     */
    UUID getUUid();
}

Fix code style. Add blank line.


package org.jvirtanen.parity.top;

public enum Side {
    BUY,
    SELL
}

package org.jvirtanen.parity.top;

/**
 * The order side.
 */
public enum Side {
    BUY,
    SELL
}

Add documentation for side in order book reconstruction


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

package org.wso2.carbon.identity.claim.metadata.mgt.dao;

import org.wso2.carbon.user.core.claim.inmemory.ClaimConfig;

/**
 * Initialize the claim configuration of tenant to the tables.
 */
public interface ClaimConfigInitDAO {

    /**
     * Initialize the claim configuration of tenant to the database.
     *
     * @param claimConfig   Claim Configuration.
     * @param tenantId      Tenant Id.
     */
    void initClaimConfig(ClaimConfig claimConfig, int tenantId);
}

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

package org.wso2.carbon.identity.claim.metadata.mgt.dao;

import org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException;
import org.wso2.carbon.user.core.claim.inmemory.ClaimConfig;

/**
 * Initialize the claim configuration of tenant to the tables.
 */
public interface ClaimConfigInitDAO {

    /**
     * Initialize the claim configuration of tenant to the database.
     *
     * @param claimConfig Claim Configuration.
     * @param tenantId    Tenant Id.
     * @throws ClaimMetadataException Claim Meta data Exception.
     */
    void initClaimConfig(ClaimConfig claimConfig, int tenantId) throws ClaimMetadataException;
}

Add Exception for new created interface.


package devopsdistilled.operp.client.context;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

import devopsdistilled.operp.server.data.service.items.ItemService;

@Configuration
public class RmiContext {

	@Bean
	public RmiProxyFactoryBean itemService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/ItemService");
		rmiProxy.setServiceInterface(ItemService.class);
		return rmiProxy;
	}
}

package devopsdistilled.operp.client.context;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.remoting.rmi.RmiProxyFactoryBean;

import devopsdistilled.operp.server.data.service.items.BrandService;
import devopsdistilled.operp.server.data.service.items.ItemService;
import devopsdistilled.operp.server.data.service.items.ProductService;

@Configuration
public class RmiContext {

	@Bean
	public RmiProxyFactoryBean itemService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/ItemService");
		rmiProxy.setServiceInterface(ItemService.class);
		return rmiProxy;
	}

	@Bean
	public RmiProxyFactoryBean productService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/ProductService");
		rmiProxy.setServiceInterface(ProductService.class);
		return rmiProxy;
	}

	@Bean
	public RmiProxyFactoryBean brandService() {
		RmiProxyFactoryBean rmiProxy = new RmiProxyFactoryBean();
		rmiProxy.setServiceUrl("rmi://127.0.1.1:1099/BrandService");
		rmiProxy.setServiceInterface(BrandService.class);
		return rmiProxy;
	}
}

Configure RmiProxy Bean for Product and Brand


package sssj;

import com.google.common.base.Preconditions;
import com.google.common.collect.ForwardingTable;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;

public class Utils {

  public static double computeTau(double theta, double lambda) {
    Preconditions.checkArgument(theta > 0 && theta < 1);
    Preconditions.checkArgument(lambda > 0);
    double tau = 1 / lambda * Math.log(1 / theta);
    return tau;
  }

  public static class BatchResult extends ForwardingTable<Long, Long, Double> {
    private final HashBasedTable<Long, Long, Double> delegate = HashBasedTable.create();

    @Override
    protected Table<Long, Long, Double> delegate() {
      return delegate;
    }
  }

  public static enum IndexType {
    INVERTED, ALL_PAIRS, L2AP;
  }
}

package sssj;

import com.google.common.base.Preconditions;
import com.google.common.collect.ForwardingTable;
import com.google.common.collect.Table;
import com.google.common.collect.TreeBasedTable;

public class Utils {

  public static double computeTau(double theta, double lambda) {
    Preconditions.checkArgument(theta > 0 && theta < 1);
    Preconditions.checkArgument(lambda > 0);
    double tau = 1 / lambda * Math.log(1 / theta);
    return tau;
  }

  public static class BatchResult extends ForwardingTable<Long, Long, Double> {
    private final Table<Long, Long, Double> delegate = TreeBasedTable.create();

    @Override
    protected Table<Long, Long, Double> delegate() {
      return delegate;
    }
  }

  public static enum IndexType {
    INVERTED, ALL_PAIRS, L2AP;
  }
}

Sort results in minibatch mode


package org.xbean.jmx;

import junit.framework.TestCase;
import org.xbean.spring.context.ClassPathXmlApplicationContext;

/**
 * $Rev$
 */
public class JMXTest extends TestCase {
    public void testSimple() throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("org/xbean/jmx/jmx-simple.xml");
        try {
            Object jmxService = context.getBean("jmxService");
            assertNotNull(jmxService);

            Object jmxExporter = context.getBean("jmxExporter");
            assertNotNull(jmxExporter);
        } finally {
            context.destroy();
        }
    }
}

package org.xbean.jmx;

import junit.framework.TestCase;
import org.xbean.spring.context.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * $Rev$
 */
public class JMXTest extends TestCase {
    public void testSimple() throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("org/xbean/jmx/jmx-simple.xml");
        try {
            Object jmxService = context.getBean("jmxService");
            assertNotNull(jmxService);

            Object jmxExporter = context.getBean("jmxExporter");
            assertNotNull(jmxExporter);
            assertTrue(jmxExporter instanceof MBeanExporter);
            List mbeans = ((MBeanExporter) jmxExporter).getMBeans();
            assertNotNull(mbeans);
            assertEquals(2, mbeans.size());
            assertSame(jmxService, mbeans.get(0));
            assertSame(jmxService, mbeans.get(1));
        } finally {
            context.destroy();
        }
    }
}

Add a few asserts to the test


// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.billing;

/**
 * A Plan knows about the billing calculations and the default quota for any tenant associated with the Plan.
 * The Plan can also enforce transitions from one plan to another.
 *
 * @author ogronnesby
 */
public interface Plan {

    /** Unique ID for the plan */
    PlanId id();

    /** A string to be used for display purposes */
    String displayName();

    /** The cost calculator for this plan */
    CostCalculator calculator();

    /** The quota for this plan */
    QuotaCalculator quota();

}

// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.billing;

/**
 * A Plan knows about the billing calculations and the default quota for any tenant associated with the Plan.
 * The Plan can also enforce transitions from one plan to another.
 *
 * @author ogronnesby
 */
public interface Plan {

    /** Unique ID for the plan */
    PlanId id();

    /** A string to be used for display purposes */
    String displayName();

    /** The cost calculator for this plan */
    CostCalculator calculator();

    /** The quota for this plan */
    QuotaCalculator quota();

    /** Is this a plan that is billed */
    boolean isBilled();
}

Update interface for check if plan is billed


package com.xamoom.android.xamoomsdk.Utils;

import java.util.List;

/**
 * ListUtil to join lists of string.
 * (Because TextUtil gets mocked in tests)
 */
public class ListUtil {
  /**
   * Will return joined list with seperator.
   *
   * @param list List of Strings.
   * @param seperator String to seperate them.
   * @return Joined list.
   */
  public static String joinStringList(List<String> list, String seperator) {
    if (list == null || seperator == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    int counter = 0;
    for (String item : list) {
      counter++;
      sb.append(item);
      if (counter != list.size()) {
        sb.append(seperator);
      }
    }
    return sb.toString();
  }
}

package com.xamoom.android.xamoomsdk.Utils;

import java.util.List;

/**
 * ListUtil to join lists of string.
 * (Because TextUtil gets mocked in tests)
 */
public class ListUtil {
  /**
   * Will return joined list with seperator.
   *
   * @param list List of Strings.
   * @param seperator String to seperate them.
   * @return Joined list.
   */
  public static String joinStringList(List<String> list, String seperator) {
    if (list == null || seperator == null) {
      return "";
    }

    StringBuilder sb = new StringBuilder();
    sb.append("[");
    int counter = 0;
    for (String item : list) {
      counter++;
      sb.append("'");
      sb.append(item);
      sb.append("'");
      if (counter != list.size()) {
        sb.append(seperator);
      }
    }
    sb.append("]");
    return sb.toString();
  }
}

Fix for problem with tags


package com.example.mwismer.mobproto_finalproject;

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

/**
 * Created by mwismer on 10/23/14.
 */
public class MyFragment extends Fragment{
    public MyFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_my, container, false);
        return rootView;
    }
}

package com.example.mwismer.mobproto_finalproject;

import android.app.Fragment;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
 * Created by mwismer on 10/23/14.
 */
public class MyFragment extends Fragment{
    private String TAG = "MyFragment";
    private BluetoothAdapter mBLEAdapter;

    public MyFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_my, container, false);
        final BluetoothManager bluetoothManager =
                (BluetoothManager) getActivity().getSystemService(Context.BLUETOOTH_SERVICE);
        mBLEAdapter = bluetoothManager.getAdapter();
        if (mBLEAdapter == null || !mBLEAdapter.isEnabled()) {
            Log.d(TAG, "Enabling Bluetooth");
            Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
            getActivity().startActivityForResult(enableBtIntent, 20);
        }

        return rootView;
    }
}

Enable Bluetooth if not already enabled


package info.u_team.u_team_test.init;

import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.potion.RadiationPotion;
import net.minecraft.potion.Potion;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.*;

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

	public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(ForgeRegistries.POTION_TYPES, TestMod.MODID);

	public static final RegistryObject<Potion> RADIATION = POTIONS.register("radiation", () -> new RadiationPotion(1200, 0));
	public static final RegistryObject<Potion> RADIATION_LONG = POTIONS.register("radiation_long", () -> new RadiationPotion(2400, 1));
	public static final RegistryObject<Potion> RADIATION_EXTREME = POTIONS.register("radiation_extrem", () -> new RadiationPotion(1200, 2));

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

}

package info.u_team.u_team_test.init;

import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.potion.RadiationPotion;
import net.minecraft.potion.Potion;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
import net.minecraftforge.registries.*;

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

	public static final DeferredRegister<Potion> POTIONS = DeferredRegister.create(ForgeRegistries.POTION_TYPES, TestMod.MODID);

	public static final RegistryObject<Potion> RADIATION = POTIONS.register("radiation", () -> new RadiationPotion(1200, 0));
	public static final RegistryObject<Potion> RADIATION_LONG = POTIONS.register("radiation_long", () -> new RadiationPotion(2400, 1));
	public static final RegistryObject<Potion> RADIATION_EXTREME = POTIONS.register("radiation_extreme", () -> new RadiationPotion(1200, 2));

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

}

Fix name not containing the e


/**
 * @author benjamin.hoffmeyer
 */
// package
package com.thedoctorslife.hello;

import com.thedoctorslife.hello.StuffUtils;

public class HelloWorld {

	public static void main(String[] args) {
		StuffUtils.hello();
		StuffUtils.cheese();
		StuffUtils.end();
	}
}

/**
 * @author benjamin.hoffmeyer
 */
// package
package com.thedoctorslife.hello;

public class HelloWorld {

	public static void main(String[] args) {
		StuffUtils.hello();
		StuffUtils.cheese();
		StuffUtils.end();
	}
}

Remove the import since they are in the same package.


package org.daisy.maven.xproc.pipeline;

import com.google.common.eventbus.Subscribe;

import org.daisy.common.messaging.Message;
import org.daisy.pipeline.event.EventBusProvider;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;

@Component
public class MessageEventListener {

	@Reference(
		name = "EventBusProvider",
		unbind = "-",
		service = EventBusProvider.class,
		cardinality = ReferenceCardinality.MANDATORY,
		policy = ReferencePolicy.STATIC
	)
	public void setEventBusProvider(EventBusProvider provider) {
		provider.get().register(this);
	}

	@Subscribe
	public synchronized void handleMessage(Message message) {
		System.out.printf("[%s] %s\n", message.getLevel(), message.getText());
	}
}

package org.daisy.maven.xproc.pipeline;

import com.google.common.eventbus.Subscribe;

import org.daisy.common.messaging.Message;
import org.daisy.pipeline.event.EventBusProvider;

import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.component.annotations.ReferencePolicy;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Component
public class MessageEventListener {

	@Reference(
		name = "EventBusProvider",
		unbind = "-",
		service = EventBusProvider.class,
		cardinality = ReferenceCardinality.MANDATORY,
		policy = ReferencePolicy.STATIC
	)
	public void setEventBusProvider(EventBusProvider provider) {
		provider.get().register(this);
	}

	@Subscribe
	public synchronized void handleMessage(Message message) {
		String m = message.getText();
		switch (message.getLevel()) {
		case TRACE:
			logger.trace(m);
			break;
		case DEBUG:
			logger.debug(m);
			break;
		case INFO:
			logger.info(m);
			break;
		case WARNING:
			logger.warn(m);
			break;
		case ERROR:
			logger.error(m);
			break; }
	}

	private static final Logger logger = LoggerFactory.getLogger(MessageEventListener.class);

}

Use logback to print job messages


package com.twitter.mesos.scheduler.log.testing;

import java.io.File;

import com.google.inject.PrivateModule;
import com.google.inject.Singleton;

import com.twitter.common.args.Arg;
import com.twitter.common.args.CmdLine;
import com.twitter.common.args.constraints.NotNull;
import com.twitter.mesos.scheduler.log.Log;

/**
 * Binding module that uses a local log file, intended for testing.
 */
public class FileLogStreamModule extends PrivateModule {

  @NotNull
  @CmdLine(name = "testing_log_file_path", help = "Path to a file to store local log file data in.")
  private static final Arg<File> LOG_PATH = Arg.create(null);

  @Override
  protected void configure() {
    bind(File.class).toInstance(LOG_PATH.get());
    bind(Log.class).to(FileLog.class);
    bind(FileLog.class).in(Singleton.class);
    expose(Log.class);
  }
}

package com.twitter.mesos.scheduler.log.testing;

import java.io.File;

import com.google.common.base.Preconditions;
import com.google.inject.PrivateModule;
import com.google.inject.Singleton;

import com.twitter.common.args.Arg;
import com.twitter.common.args.CmdLine;
import com.twitter.mesos.scheduler.log.Log;

/**
 * Binding module that uses a local log file, intended for testing.
 */
public class FileLogStreamModule extends PrivateModule {

  // TODO(William Farner): Make this a required argument and ensure it is not included in production
  //                       builds (MESOS-471).
  //@NotNull
  @CmdLine(name = "testing_log_file_path", help = "Path to a file to store local log file data in.")
  private static final Arg<File> LOG_PATH = Arg.create(null);

  @Override
  protected void configure() {
    Preconditions.checkNotNull(LOG_PATH.get());
    bind(File.class).toInstance(LOG_PATH.get());
    bind(Log.class).to(FileLog.class);
    bind(FileLog.class).in(Singleton.class);
    expose(Log.class);
  }
}

Make testing_log_file_path optional for now.


package enmasse.config.service.podsense;

import enmasse.config.service.openshift.MessageEncoder;
import io.fabric8.kubernetes.api.model.Pod;
import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
import org.apache.qpid.proton.amqp.messaging.AmqpValue;
import org.apache.qpid.proton.message.Message;

import java.io.IOException;
import java.util.*;

/**
 * Encodes podsense responses
 */
public class PodSenseMessageEncoder implements MessageEncoder<PodResource> {

    @Override
    public Message encode(Set<PodResource> set) throws IOException {
        Message message = Message.Factory.create();
        List<Map<String, Object>> root = new ArrayList<>();

        set.forEach(pod -> root.add(encodePod(pod)));

        message.setBody(new AmqpValue(root));
        return message;
    }

    private Map<String, Object> encodePod(PodResource pod) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("host", pod.getHost());
        map.put("phase", pod.getPhase());
        map.put("ready", pod.getReady());
        map.put("ports", pod.getPortMap());
        return map;
    }

}

package enmasse.config.service.podsense;

import enmasse.config.service.openshift.MessageEncoder;
import io.fabric8.kubernetes.api.model.Pod;
import org.apache.qpid.proton.amqp.messaging.AmqpSequence;
import org.apache.qpid.proton.amqp.messaging.AmqpValue;
import org.apache.qpid.proton.message.Message;

import java.io.IOException;
import java.util.*;

/**
 * Encodes podsense responses
 */
public class PodSenseMessageEncoder implements MessageEncoder<PodResource> {

    @Override
    public Message encode(Set<PodResource> set) throws IOException {
        Message message = Message.Factory.create();
        List<Map<String, Object>> root = new ArrayList<>();

        set.forEach(pod -> root.add(encodePod(pod)));

        message.setBody(new AmqpValue(root));
        return message;
    }

    private Map<String, Object> encodePod(PodResource pod) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("name", pod.getName());
        map.put("host", pod.getHost());
        map.put("phase", pod.getPhase());
        map.put("ready", pod.getReady());
        map.put("ports", pod.getPortMap());
        return map;
    }

}

Add pod name to payload


package co.phoenixlab.discord.api.entities;

import com.google.gson.annotations.SerializedName;

public class ReadyMessage {

    @SerializedName("v")
    private int version;

    private User user;
    private String sessionId;
    @SerializedName("read_state")
    private ReadState[] readState;
    @SerializedName("private_channels")
    private PrivateChannel[] privateChannels;
    @SerializedName("heartbeat_interval")
    private long heartbeatInterval;
    @SerializedName("guilds")
    private Server[] servers;

    public ReadyMessage() {
    }

    public int getVersion() {
        return version;
    }

    public User getUser() {
        return user;
    }

    public String getSessionId() {
        return sessionId;
    }

    public ReadState[] getReadState() {
        return readState;
    }

    public PrivateChannel[] getPrivateChannels() {
        return privateChannels;
    }

    public long getHeartbeatInterval() {
        return heartbeatInterval;
    }

    public Server[] getServers() {
        return servers;
    }

    class ReadState {
        @SerializedName("mention_count")
        private int mentionCount;
        @SerializedName("last_message_id")
        private String lastMessageId;

        private String id;

        public int getMentionCount() {
            return mentionCount;
        }

        public String getLastMessageId() {
            return lastMessageId;
        }

        public String getId() {
            return id;
        }
    }
}

package co.phoenixlab.discord.api.entities;

import com.google.gson.annotations.SerializedName;

public class ReadyMessage {

    @SerializedName("v")
    private int version;

    private User user;
    @SerializedName("session_id")
    private String sessionId;
    @SerializedName("read_state")
    private ReadState[] readState;
    @SerializedName("private_channels")
    private PrivateChannel[] privateChannels;
    @SerializedName("heartbeat_interval")
    private long heartbeatInterval;
    @SerializedName("guilds")
    private Server[] servers;

    public ReadyMessage() {
    }

    public int getVersion() {
        return version;
    }

    public User getUser() {
        return user;
    }

    public String getSessionId() {
        return sessionId;
    }

    public ReadState[] getReadState() {
        return readState;
    }

    public PrivateChannel[] getPrivateChannels() {
        return privateChannels;
    }

    public long getHeartbeatInterval() {
        return heartbeatInterval;
    }

    public Server[] getServers() {
        return servers;
    }

    class ReadState {
        @SerializedName("mention_count")
        private int mentionCount;
        @SerializedName("last_message_id")
        private String lastMessageId;

        private String id;

        public int getMentionCount() {
            return mentionCount;
        }

        public String getLastMessageId() {
            return lastMessageId;
        }

        public String getId() {
            return id;
        }
    }
}

Fix missing serialized name annotation


/*
 * Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 */

package com.yahoo.vespa.model.admin.metricsproxy;

import ai.vespa.metricsproxy.http.MetricsHandler;
import ai.vespa.metricsproxy.http.application.MetricsNodesConfig;

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

/**
 * @author gjoranv
 */
public class MetricsNodesConfigGenerator {

    public static List<MetricsNodesConfig.Node.Builder> generate(List<MetricsProxyContainer> containers) {
        return containers.stream()
                .map(MetricsNodesConfigGenerator::toNodeBuilder)
                .collect(Collectors.toList());
    }

    private static MetricsNodesConfig.Node.Builder toNodeBuilder(MetricsProxyContainer container) {
        return new MetricsNodesConfig.Node.Builder()
                .configId(container.getConfigId())
                .hostname(container.getHostName())
                .metricsPort(MetricsProxyContainer.BASEPORT)
                .metricsPath(MetricsHandler.VALUES_PATH);
    }

}

/*
 * Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
 */

package com.yahoo.vespa.model.admin.metricsproxy;

import ai.vespa.metricsproxy.http.MetricsHandler;
import ai.vespa.metricsproxy.http.application.MetricsNodesConfig;

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

/**
 * @author gjoranv
 */
public class MetricsNodesConfigGenerator {

    public static List<MetricsNodesConfig.Node.Builder> generate(List<MetricsProxyContainer> containers) {
        return containers.stream()
                .map(MetricsNodesConfigGenerator::toNodeBuilder)
                .collect(Collectors.toList());
    }

    private static MetricsNodesConfig.Node.Builder toNodeBuilder(MetricsProxyContainer container) {
        return new MetricsNodesConfig.Node.Builder()
                .configId(container.getHost().getConfigId())
                .hostname(container.getHostName())
                .metricsPort(MetricsProxyContainer.BASEPORT)
                .metricsPath(MetricsHandler.VALUES_PATH);
    }

}

Use configId for the host, not the container.


package org.ovirt.engine.core.bll;

public interface InitBackendServicesOnStartup {

    public void create();
}

package org.ovirt.engine.core.bll;

public interface InitBackendServicesOnStartup {

    void create();
}

Remove visibility modifier from interface


package com.brg.dao;

import com.brg.ServiceProvider;
import com.brg.domain.RuleValueBundle;

import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

public class RuleValueBundleDAO implements DAO{

    @Override
    public ArrayList<RuleValueBundle> executeRead(String sql) {
        ArrayList<RuleValueBundle> values = new ArrayList<RuleValueBundle>();

        try{
            Statement stmt = ServiceProvider.getInstance().getPersistanceService().getConnection().createStatement();
            ResultSet set = stmt.executeQuery(sql);

            while(set.next()) {
                RuleValueBundle bundle = new RuleValueBundle();

                Statement valueStmt = ServiceProvider.getInstance().getPersistanceService().getConnection().createStatement();
                ResultSet valueSet = valueStmt
                        .executeQuery("SELECT Key FROM BundleKeyEntry WHERE BundleID=" + set.getInt("BundleID"));

                bundle.setValue(valueSet.getString("Key"), null);
            }

        } catch(Exception e){
            e.printStackTrace();
        }

        return values;
    }

    public RuleValueBundle getRuleValueBundleById(int id){
        ArrayList<RuleValueBundle> values = new ArrayList<RuleValueBundle>(); //temp
        return values.size() >= 1 ? values.get(0) : null;
    }

    public ArrayList<RuleValueBundle> getAllRuleValueBundle(){
        return this.executeRead("SELECT * FROM Rule;");
    }
}

package com.brg.dao;

import com.brg.ServiceProvider;
import com.brg.domain.RuleValueBundle;

import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

public class RuleValueBundleDAO implements DAO{

    @Override
    public ArrayList<RuleValueBundle> executeRead(String sql) {
        ArrayList<RuleValueBundle> values = new ArrayList<RuleValueBundle>();

        try{
            Statement stmt = ServiceProvider.getInstance().getPersistanceService().getConnection().createStatement();
            ResultSet set = stmt.executeQuery(sql);

            while(set.next()) {
                RuleValueBundle bundle = new RuleValueBundle();

                Statement valueStmt = ServiceProvider.getInstance().getPersistanceService().getConnection().createStatement();
                ResultSet valueSet = valueStmt
                        .executeQuery("SELECT Key FROM BundleKeyEntry WHERE BundleID=" + set.getInt("BundleID"));

                while(valueSet.next()) {
                    bundle.setValue(valueSet.getString("Key"), null);
                }

            }

        } catch(Exception e){
            e.printStackTrace();
        }

        return values;
    }

    public RuleValueBundle getRuleValueBundleById(int id){
        ArrayList<RuleValueBundle> values = new ArrayList<RuleValueBundle>(); //temp
        return values.size() >= 1 ? values.get(0) : null;
    }

    public ArrayList<RuleValueBundle> getAllRuleValueBundle(){
        return this.executeRead("SELECT * FROM Rule;");
    }
}

Put the bundle set value in a new while loop.


package com.twilio.starter;

import com.twilio.Twilio;
import com.twilio.starter.controller.CallController;
import com.twilio.starter.controller.MessageController;
import com.twilio.starter.controller.TwimlController;

import static spark.Spark.*;

public class Application {

    private static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    private static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        staticFileLocation("/public");

        post("/call", CallController.handlePost);
        post("/message", MessageController.handlePost);
        get("/hello", TwimlController.handleGet);
    }
}

package com.twilio.starter;

import com.twilio.Twilio;
import com.twilio.starter.controller.CallController;
import com.twilio.starter.controller.MessageController;
import com.twilio.starter.controller.TwimlController;

import static spark.Spark.*;

public class Application {

    private static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    private static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

        staticFileLocation("/public");

        post("/call", CallController.handlePost);
        post("/message", MessageController.handlePost);
        post("/hello", TwimlController.handleGet);
    }
}

Change /hello to respond to POST requests


package edu.rutgers.css.Rutgers.fragments;

import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import edu.rutgers.css.Rutgers2.R;

public class MainScreen extends Fragment {

	public MainScreen() {
		// Required empty public constructor
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.fragment_main_screen, container, false);

		getActivity().setTitle(R.string.app_name);

        int bgResource;
        if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) bgResource = R.drawable.bgland;
        else bgResource = R.drawable.bgportrait;
        Bitmap bg = BitmapFactory.decodeResource(getResources(), bgResource, new BitmapFactory.Options());
        Drawable bgDraw = new BitmapDrawable(bg);
        v.setBackground(bgDraw);

		return v;
	}
}

package edu.rutgers.css.Rutgers.fragments;

import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import edu.rutgers.css.Rutgers2.R;

public class MainScreen extends Fragment {

	public MainScreen() {
		// Required empty public constructor
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View v = inflater.inflate(R.layout.fragment_main_screen, container, false);

		getActivity().setTitle(R.string.app_name);

        int bgResource;
        if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) bgResource = R.drawable.bgland;
        else bgResource = R.drawable.bgportrait;
        Bitmap bg = BitmapFactory.decodeResource(getResources(), bgResource, new BitmapFactory.Options());
        Drawable bgDraw = new BitmapDrawable(bg);

        if(android.os.Build.VERSION.SDK_INT >= 16) {
            v.setBackground(bgDraw);
        }
        else {
            v.setBackgroundDrawable(bgDraw);
        }

		return v;
	}
}

Choose set background method by API


package com.nilhcem.droidcontn.data.app.model;

import android.os.Build;
import android.os.Parcel;

import com.nilhcem.droidcontn.BuildConfig;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.threeten.bp.LocalDate;

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

import static com.google.common.truth.Truth.assertThat;

@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
public class ScheduleDayTest {

    @Test
    public void should_restore_from_parcelable() {
        // Given
        LocalDate day = LocalDate.of(1985, 05, 15);
        List<ScheduleSlot> slots = Arrays.asList(new ScheduleSlot(null, null));
        ScheduleDay scheduleDay = new ScheduleDay(day, slots);

        // When
        Parcel parcel = Parcel.obtain();
        scheduleDay.writeToParcel(parcel, 0);
        parcel.setDataPosition(0);
        ScheduleDay fromParcel = ScheduleDay.CREATOR.createFromParcel(parcel);

        // Then
        assertThat(fromParcel.getDay()).isEqualTo(day);
        assertThat(fromParcel.getSlots()).hasSize(1);
    }
}

package com.nilhcem.droidcontn.data.app.model;

import android.os.Build;
import android.os.Parcel;

import com.nilhcem.droidcontn.BuildConfig;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;
import org.threeten.bp.LocalDate;

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

import static com.google.common.truth.Truth.assertThat;

@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
public class ScheduleDayTest {

    @Test
    public void should_restore_from_parcelable() {
        // Given
        LocalDate day = LocalDate.of(1985, 5, 15);
        List<ScheduleSlot> slots = Arrays.asList(new ScheduleSlot(null, null));
        ScheduleDay scheduleDay = new ScheduleDay(day, slots);

        // When
        Parcel parcel = Parcel.obtain();
        scheduleDay.writeToParcel(parcel, 0);
        parcel.setDataPosition(0);
        ScheduleDay fromParcel = ScheduleDay.CREATOR.createFromParcel(parcel);

        // Then
        assertThat(fromParcel.getDay()).isEqualTo(day);
        assertThat(fromParcel.getSlots()).hasSize(1);
    }
}

Use decimal value instead of octal one


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

package com.google.gerrit.server.schema;

import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gwtorm.jdbc.JdbcSchema;
import com.google.gwtorm.schema.sql.DialectPostgreSQL;
import com.google.gwtorm.server.OrmException;
import com.google.inject.Inject;
import com.google.inject.Provider;

import java.sql.SQLException;
import java.sql.Statement;

public class Schema_70 extends SchemaVersion {
  @Inject
  protected Schema_70(Provider<Schema_69> prior) {
    super(prior);
  }

  @Override
  protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException,
      SQLException {
    Statement stmt = ((JdbcSchema) db).getConnection().createStatement();
    try {
      stmt.executeUpdate("UPDATE tracking_ids SET tracking_key = tracking_id");
      execute(stmt, "DROP INDEX tracking_ids_byTrkId");
      if (((JdbcSchema) db).getDialect() instanceof DialectPostgreSQL) {
        execute(stmt, "ALTER TABLE tracking_ids DROP CONSTRAINT tracking_ids_pkey");
      } else {
        execute(stmt, "ALTER TABLE tracking_ids DROP PRIMARY KEY");
      }
      stmt.execute("ALTER TABLE tracking_ids"
          + " ADD PRIMARY KEY (change_id, tracking_key, tracking_system)");
      stmt.execute("CREATE INDEX tracking_ids_byTrkKey"
          + " ON tracking_ids (tracking_key)");
    } finally {
      stmt.close();
    }
  }

  private static final void execute(Statement stmt, String command) {
    try {
      stmt.execute(command);
    } catch (SQLException e) {
      // ignore
    }
  }
}

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

package com.google.gerrit.server.schema;

import com.google.inject.Inject;
import com.google.inject.Provider;

public class Schema_70 extends SchemaVersion {
  @Inject
  protected Schema_70(Provider<Schema_69> prior) {
    super(prior);
  }
}

Clean left over data migration after removal of TrackingIds table


package org.sagebionetworks.repo.manager.oauth;

import java.util.Date;

import org.sagebionetworks.repo.model.oauth.OIDCClaimName;

import io.jsonwebtoken.impl.DefaultClaims;

public class ClaimsWithAuthTime extends DefaultClaims {

	public static ClaimsWithAuthTime newClaims() {return new ClaimsWithAuthTime();}

	private ClaimsWithAuthTime() {}

	public ClaimsWithAuthTime setAuthTime(Date authTime) {
		setDateAsSeconds(OIDCClaimName.auth_time.name(), authTime);
		return this;
	}

	public Date getAuthTime() {
		return get(OIDCClaimName.auth_time.name(), Date.class);
	}

}

package org.sagebionetworks.repo.manager.oauth;

import java.util.Date;

import org.sagebionetworks.repo.model.oauth.OIDCClaimName;

import io.jsonwebtoken.impl.DefaultClaims;

public class ClaimsWithAuthTime extends DefaultClaims {

	public static ClaimsWithAuthTime newClaims() {return new ClaimsWithAuthTime();}

	private ClaimsWithAuthTime() {}

	public ClaimsWithAuthTime setAuthTime(Date authTime) {
		setDateAsSeconds(OIDCClaimName.auth_time.name(), authTime);
		return this;
	}

	public Date getAuthTime() {
		Object value = get(OIDCClaimName.auth_time.name());
		if (value == null) {
			return null;
		}
		// The default implementation of get(name, Date) will not convert from seconds
		// for "non-standard" claims so we have to use the "toSpecDate" ourselves
		return toSpecDate(value, OIDCClaimName.auth_time.name());
	}

}

Fix failing test due changes in library


package name.abuchen.portfolio.util;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class IsinTest
{
    @Test
    public void testValidIsin()
    {
        String ubsIsin = "CH0244767585";
        assertTrue(Isin.isValid(ubsIsin));

        String adidasIsin = "DE000A1EWWW0";
        assertTrue(Isin.isValid(adidasIsin));

        String toyotaIsin = "JP3633400001";
        assertTrue(Isin.isValid(toyotaIsin));
    }

    @Test
    public void testInvalidIsin()
    {
        String invalidUbsIsin = "CH0244767586"; // Wrong Checksum
        assertFalse(Isin.isValid(invalidUbsIsin));
    }

    @Test
    public void testIsinTooLong()
    {
        String isinTooLong = "CH0244767585222222";
        assertFalse(Isin.isValid(isinTooLong));
    }

    @Test
    public void testIsinNull()
    {
        String nullIsin = null;
        assertFalse(Isin.isValid(nullIsin));
    }

    @Test
    public void testInvalidChar()
    {
        String invalidCharIsin = "ÜE0244767585";
        assertFalse(Isin.isValid(invalidCharIsin));
    }
}

package name.abuchen.portfolio.util;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class IsinTest
{
    @Test
    public void testValidIsin()
    {
        String ubsIsin = "CH0244767585";
        assertTrue(Isin.isValid(ubsIsin));

        String adidasIsin = "DE000A1EWWW0";
        assertTrue(Isin.isValid(adidasIsin));

        String toyotaIsin = "JP3633400001";
        assertTrue(Isin.isValid(toyotaIsin));
    }

    @Test
    public void testInvalidIsin()
    {
        String invalidUbsIsin = "CH0244767586"; // Wrong Checksum
        assertFalse(Isin.isValid(invalidUbsIsin));
    }

    @Test
    public void testIsinInvalidLength()
    {
        String isinTooLong = "CH0244767585222222";
        assertFalse(Isin.isValid(isinTooLong));

        String isinTooShort = "CH02381";
        assertFalse(Isin.isValid(isinTooShort));
    }

    @Test
    public void testIsinNull()
    {
        String nullIsin = null;
        assertFalse(Isin.isValid(nullIsin));
    }

    @Test
    public void testInvalidChar()
    {
        String invalidCharIsin = "ÜE0244767585";
        assertFalse(Isin.isValid(invalidCharIsin));
    }
}

Add test for too short isin


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.netbeans.modules.web.primefaces.crudgenerator.util;

/**
 *
 * @author kuw
 */
public class StringHelper {

    public static String firstLower(String string) {
        boolean makeFirstLower = string.length() < 2 || (!Character.isUpperCase(string.charAt(1)));
        return makeFirstLower ? string.substring(0, 1).toLowerCase() + string.substring(1) : string;
    }

    public static String firstUpper(String string) {
        boolean makeFirstUpper = string.length() < 2 || (!Character.isLowerCase(string.charAt(1)));
        return makeFirstUpper ? string.substring(0, 1).toUpperCase() + string.substring(1) : string;
    }

    public static String removeBeanMethodPrefix(String methodName) {
        if (methodName.startsWith("get")) {  //NOI18N
            methodName = methodName.replaceFirst("get", "");
        }
        if (methodName.startsWith("set")) {  //NOI18N
            methodName = methodName.replaceFirst("set", "");
        }
        if (methodName.startsWith("is")) {  //NOI18N
            methodName = methodName.replaceFirst("is", "");
        }
        return methodName;
    }

}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package org.netbeans.modules.web.primefaces.crudgenerator.util;

/**
 *
 * @author kuw
 */
public class StringHelper {

    public static String firstLower(String string) {
        boolean makeFirstLower = string.length() < 2 || (!Character.isUpperCase(string.charAt(1)));
        return makeFirstLower ? string.substring(0, 1).toLowerCase() + string.substring(1) : string;
    }

    public static String firstUpper(String string) {
        return string.length() > 1 ? string.substring(0, 1).toUpperCase() + string.substring(1) : string.toUpperCase();
    }

    public static String removeBeanMethodPrefix(String methodName) {
        if (methodName.startsWith("get")) {  //NOI18N
            methodName = methodName.replaceFirst("get", "");
        }
        if (methodName.startsWith("set")) {  //NOI18N
            methodName = methodName.replaceFirst("set", "");
        }
        if (methodName.startsWith("is")) {  //NOI18N
            methodName = methodName.replaceFirst("is", "");
        }
        return methodName;
    }

}

Fix first upper case problem.


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

import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.WindowState;

import org.springframework.web.portlet.handler.HandlerInterceptorAdapter;

/**
 * @author Jen Bourey, jennifer.bourey@gmail.com
 * @version $Revision$
 */
public class IFramePortletMinimizedStateHandlerInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandleRender(RenderRequest request, RenderResponse response, Object handler) throws Exception {
        if (WindowState.MINIMIZED.equals(request.getWindowState())) {

            String url = request.getPreferences().getValue("src", null);
            if (url == null) {
                url = request.getPreferences().getValue("url", null);
            }
            response.setProperty("externalPortletLink", url);

            return false;
        }

        return true;
    }

}

Fix license headers Fix notice file


package com.omega_r.libs.omegarecyclerview.item_decoration;

import android.graphics.Rect;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.omega_r.libs.omegarecyclerview.item_decoration.decoration_helpers.DividerDecorationHelper;

public class SpaceItemDecoration extends BaseItemDecoration {

    private final int space;

    public SpaceItemDecoration(int showDivider, int space) {
        super(showDivider);
        this.space = space;
    }

    @Override
    void getItemOffset(@NonNull Rect outRect, @NonNull RecyclerView parent,
                       @NonNull DividerDecorationHelper helper, int position, int itemCount) {
        if (isShowBeginDivider() && position < 1 || position >= 1) helper.setStart(outRect, space);
        if (isShowEndDivider() && position == itemCount - 1) helper.setEnd(outRect, space);
    }

}

package com.omega_r.libs.omegarecyclerview.item_decoration;

import android.graphics.Rect;

import com.omega_r.libs.omegarecyclerview.item_decoration.decoration_helpers.DividerDecorationHelper;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class SpaceItemDecoration extends BaseItemDecoration {

    private final int space;

    public SpaceItemDecoration(int showDivider, int space) {
        super(showDivider);
        this.space = space;
    }

    @Override
    void getItemOffset(@NonNull Rect outRect, @NonNull RecyclerView parent,
                       @NonNull DividerDecorationHelper helper, int position, int itemCount) {
        int countBeginEndPositions = getCountBeginEndPositions(parent);
        if (isShowBeginDivider() || countBeginEndPositions <= position) helper.setStart(outRect, space);
        if (isShowEndDivider() && position == itemCount - countBeginEndPositions) helper.setEnd(outRect, space);
    }

    private int getCountBeginEndPositions(RecyclerView recyclerView) {
        RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
        if (layoutManager instanceof GridLayoutManager) {
            return ((GridLayoutManager) layoutManager).getSpanCount();
        } else return 1;
    }

}

Add support GridLayoutManager for itemSpace


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

package com.example;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

@RunWith(Parameterized.class)
public class ParametrizedTest {

  private int number;

  public ParametrizedTest(int number) {
    this.number = number;
  }

  @Parameterized.Parameters
  public static Collection<Object[]> data() {
    Object[][] data = new Object[][] { { 0 }, { 1 }, { 2 }, { 3 } };
    return Arrays.asList(data);
  }

  @Test
  public void parametrizedTest() {
    System.out.println("Parameter: " + number);
  }

}

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

package com.example;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

@RunWith(Parameterized.class)
public class ParametrizedTest {

  private int number;

  public ParametrizedTest(int number) {
    this.number = number;
  }

  @Parameterized.Parameters
  public static Collection<Object[]> data() {
    Object[][] data = new Object[][] { { 0 }, { 1 }, { 2 }, { 3 } };
    return Arrays.asList(data);
  }

  @Test
  public void parametrizedTest() {
    System.out.print(String.format("Parameter: %d\n", number));
  }

}

Fix an inconsistency of line separator in RunWithAnnotationIntegrationTest.


package com.maxmind.geoip2.record;

import java.util.*;
import org.json.*;

public abstract class RecordWithNames {

    private HashMap<String, String> names;
    private Integer geoNameId;
    private Integer confidence;

    protected RecordWithNames(JSONObject json) throws JSONException {
        geoNameId = json.getInt("geoname_id");
        names = new HashMap<String, String>();
        if (json.has("names")) {
            JSONObject jnames = json.getJSONObject("names");
            for (Iterator<String> i = jnames.keys(); i.hasNext();) {
                String key = i.next();
                String value = jnames.getString(key);
                names.put(key, value);
            }
        }
        if (json.has("confidence")) {
            confidence = new Integer(json.getInt("confidence"));
        }
    }

    protected RecordWithNames() {
        names = new HashMap<String, String>();
    }

    public String getName(String l) {
        return names.get(l);
    }

    public int getGeoNameId() {
        return geoNameId;
    }

    public Integer getConfidence() {
        return confidence;
    }
}

package com.maxmind.geoip2.record;

import java.util.*;
import org.json.*;

public abstract class RecordWithNames {

    private HashMap<String, String> names;
    private Integer geoNameId;
    private Integer confidence;

    protected RecordWithNames(JSONObject json) throws JSONException {
        geoNameId = json.getInt("geoname_id");
        names = new HashMap<String, String>();
        if (json.has("names")) {
            JSONObject jnames = json.getJSONObject("names");
            Iterator<?> i = jnames.keys();
            while (i.hasNext()){
                String key = (String) i.next();
                String value = jnames.getString(key);
                names.put(key, value);
            }
        }
        if (json.has("confidence")) {
            confidence = new Integer(json.getInt("confidence"));
        }
    }

    protected RecordWithNames() {
        names = new HashMap<String, String>();
    }

    public String getName(String l) {
        return names.get(l);
    }

    public int getGeoNameId() {
        return geoNameId;
    }

    public Integer getConfidence() {
        return confidence;
    }
}

Use a while loop rather than a c-style for loop


/*
 * Copyright 2015 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.gradle.tooling.internal.protocol.events;

import org.gradle.tooling.internal.protocol.InternalFailure;

import java.util.List;

/**
 * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol.
 *
 * @since 2.5
 */
public interface InternalBuildFailureResult extends InternalBuildResult {
    List<? extends InternalFailure> getFailures();
}

/*
 * Copyright 2015 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.gradle.tooling.internal.protocol.events;

/**
 * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol.
 *
 * @since 2.5
 */
public interface InternalBuildFailureResult extends InternalBuildResult {
}

Remove redundant declaration of getFailures() that is already defined in the super interface


package edu.northwestern.bioinformatics.studycalendar.dao;

import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;

/**
 * @author Rhett Sutphin
 */
public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
}

package edu.northwestern.bioinformatics.studycalendar.dao;

import gov.nih.nci.cabig.ctms.dao.AbstractDomainObjectDao;
import gov.nih.nci.cabig.ctms.domain.DomainObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author Rhett Sutphin
 */
public abstract class StudyCalendarDao<T extends DomainObject> extends AbstractDomainObjectDao<T> {
    protected final Logger log = LoggerFactory.getLogger(getClass());
}

Mask ctms-common's commons-logging logger with an slf4j logger


package net.ssehub.kernel_haven.fe_analysis.pcs;

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

/**
 * Tests suite to load tests specific to the computation of feature effect constraints.
 * @author El-Sharkawy
 *
 */
@RunWith(Suite.class)
@SuiteClasses({
    PcFinderTests.class,
    PcFinderTestsWithSimplificationTests.class
    })
public class AllPresenceConditionTests {

}

package net.ssehub.kernel_haven.fe_analysis.pcs;

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

/**
 * Tests suite to load tests specific to the computation of feature effect constraints.
 * @author El-Sharkawy
 *
 */
@RunWith(Suite.class)
@SuiteClasses({
    PcFinderTests.class,
    PcReaderTest.class,
    PcFinderTestsWithSimplificationTests.class
    })
public class AllPresenceConditionTests {

}

Add new test case to AllTests


package umm3601.plant;

import com.google.gson.Gson;
import org.junit.Before;
import org.junit.Test;
import umm3601.digitalDisplayGarden.Plant;
import umm3601.digitalDisplayGarden.PlantController;
import umm3601.plant.PopulateMockDatabase;

import java.io.IOException;

import static junit.framework.TestCase.assertEquals;

public class FilterPlantsByGardenLocation {
    @Before
    public void setUpDB() throws IOException{
        PopulateMockDatabase mockDatabase = new PopulateMockDatabase();
        mockDatabase.clearAndPopulateDBAgain();
    }

    @Test
    public void findByGardenLocation() throws IOException {
        PlantController plantController = new PlantController();
        Plant[] filteredPlants;
        Gson gson = new Gson();

        String rawPlants = plantController.getGardenLocations();
        filteredPlants = gson.fromJson(rawPlants, Plant[].class);
        assertEquals("Incorrect", 1, filteredPlants.length);
    }
}

package umm3601.plant;

import com.google.gson.Gson;
import org.junit.Before;
import org.junit.Test;
import umm3601.digitalDisplayGarden.Plant;
import umm3601.digitalDisplayGarden.PlantController;
import umm3601.plant.PopulateMockDatabase;

import java.io.IOException;

import static junit.framework.TestCase.assertEquals;

public class FilterPlantsByGardenLocation {
    @Before
    public void setUpDB() throws IOException{
        PopulateMockDatabase mockDatabase = new PopulateMockDatabase();
        mockDatabase.clearAndPopulateDBAgain();
    }

    @Test
    public void findByGardenLocation() throws IOException {
        PlantController plantController = new PlantController();
        GardenLocation[] filteredPlants;
        Gson gson = new Gson();
        //System.out.println();
        String rawPlants = plantController.getGardenLocations();
        filteredPlants = gson.fromJson(rawPlants, GardenLocation[].class);
        assertEquals("Incorrect number of unique garden locations", 2, filteredPlants.length);
        assertEquals("Incorrect zero index", "10.0", filteredPlants[0]._id);
        assertEquals("Incorrect value for index 1", "7.0", filteredPlants[1]._id);
    }
}

Add and pass tests for gardenLocation


package uni.projects.javafxcrud;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("order.fxml"));
        primaryStage.setTitle("Hello World");
        primaryStage.setScene(new Scene(root, 800, 600));
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

package uni.projects.javafxcrud;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("order.fxml"));
        primaryStage.setTitle("Заказ");
        primaryStage.setScene(new Scene(root, 800, 600));
        primaryStage.setResizable(false);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

Change window title. Forbid resizing.


package org.gemoc.sample.tfsm.xdsml.api.impl;

import java.lang.reflect.Method;
import java.util.List;

import org.gemoc.execution.engine.trace.gemoc_execution_trace.MSEOccurrence;
import org.gemoc.gemoc_language_workbench.api.dsa.CodeExecutionException;
import org.gemoc.gemoc_language_workbench.api.dsa.ICodeExecutor;

public class TfsmCodeExecutor implements ICodeExecutor  {

	@Override
	public Object execute(Object className, String methodName, List<Object> parameters) throws CodeExecutionException {
		Class c;
		try {
			c = Class.forName((String)className);
			Method method = c.getMethod(methodName, parameters.get(0).getClass().getInterfaces()[0]);
			Object o = c.newInstance();
			method.invoke(o, parameters.get(0));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public Object execute(MSEOccurrence mseOccurrence)
			throws CodeExecutionException
	{
		return null;
	}

}

package org.gemoc.sample.tfsm.xdsml.api.impl;

import java.lang.reflect.Method;
import java.util.List;

import org.gemoc.execution.engine.trace.gemoc_execution_trace.MSEOccurrence;
import org.gemoc.gemoc_language_workbench.api.dsa.CodeExecutionException;
import org.gemoc.gemoc_language_workbench.api.dsa.ICodeExecutor;

public class TfsmCodeExecutor implements ICodeExecutor  {

	@Override
	public Object execute(Object className, String methodName, List<Object> parameters) throws CodeExecutionException {
		Class c;
		try {
			c = Class.forName((String)className);
			Method method = c.getMethod(methodName, parameters.get(0).getClass().getInterfaces()[0]);
			Object o = c.newInstance();
			method.invoke(o, parameters.get(0));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public Object execute(MSEOccurrence mseOccurrence)
			throws CodeExecutionException
	{
		return null;
	}

	@Override
	public String getExcutorID()
	{
		return getClass().getSimpleName();
	}

}

Update due to API change