package me.deftware.mixin.mixins;

import me.deftware.client.framework.event.events.EventWeather;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(WorldRenderer.class)
public class MixinWorldRenderer {

    @Inject(method = "method_22713", at = @At("HEAD"), cancellable = true)
    private void renderRain(Camera camera, CallbackInfo ci) {
        EventWeather event = new EventWeather(EventWeather.WeatherType.Rain);
        event.broadcast();
        if (event.isCanceled()) {
            ci.cancel();
        }
    }

}

package me.deftware.mixin.mixins;

import me.deftware.client.framework.event.events.EventWeather;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.WorldRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(WorldRenderer.class)
public class MixinWorldRenderer {

    @Inject(method = "method_22713", at = @At("HEAD"), cancellable = true)
    private void renderRain(Camera camera, CallbackInfo ci) {
        EventWeather event = new EventWeather(EventWeather.WeatherType.Rain);
        event.broadcast();
        if (event.isCanceled()) {
            ci.cancel();
        }
    }

    @Inject(method = "renderWeather", at = @At("HEAD"), cancellable = true)
    private void renderWeather(LightmapTextureManager manager, float f, double d, double e, double g, CallbackInfo ci) {
        EventWeather event = new EventWeather(EventWeather.WeatherType.Rain);
        event.broadcast();
        if (event.isCanceled()) {
            ci.cancel();
        }
    }

}

Fix EventWeather not triggering properly


/*
 * MailMessage.java - This class holds an abstract base class for implementing a mailinglist-specific
 *                    message with required identifiers and content.
 *
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 *
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator.backend;

/**
 *
 * @author Magnus Hagander <magnus@hagander.net>
 *
 *         This base class is simply a container for some common properties.
 */
public abstract class MailMessage {
	private String sender;
	private String subject;
	private String content;
	private statuslevel status = statuslevel.Defer;

	public enum statuslevel {
		Accept, Reject, Defer
	};

	public MailMessage(String sender, String subject, String content) {
		this.sender = sender;
		this.subject = subject;
		this.content = content;
	}

	public String getSender() {
		return sender;
	}

	public String getSubject() {
		return subject;
	}

	public String getContent() {
		return content;
	}

	public void setStatus(statuslevel status) {
		this.status = status;
	}

	public statuslevel getStatus() {
		return status;
	}
}

/*
 * MailMessage.java - This class holds an abstract base class for implementing a mailinglist-specific
 *                    message with required identifiers and content.
 *
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 *
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator.backend;

/**
 *
 * @author Magnus Hagander <magnus@hagander.net>
 *
 *         This base class is simply a container for some common properties.
 */
public abstract class MailMessage {
	private String sender;
	private String subject;
	private String content;
	private statuslevel status = statuslevel.Defer;

	public enum statuslevel {
		Accept, Reject, Defer
	};

	public MailMessage(String sender, String subject, String content) {
		/*
		 * Create new strings to de-couple from large strings being returned
		 * in regex matches. We do this here to get it in a centralized location,
		 * even if it means we might duplicate once or twice too many.
		 * Also, limit the length of the content to 255 bytes.
		 */
		this.sender = new String(sender);
		this.subject = new String(subject);
		if (content.length() > 255)
			this.content = new String(content.substring(0,255));
		else
			this.content = new String(content);
	}

	public String getSender() {
		return sender;
	}

	public String getSubject() {
		return subject;
	}

	public String getContent() {
		return content;
	}

	public void setStatus(statuslevel status) {
		this.status = status;
	}

	public statuslevel getStatus() {
		return status;
	}
}

Create new instances of strings, and truncate length of message contents


package uk.ac.ebi.fgpt.lode.utils;

/**
 * @author Simon Jupp
 * @date 21/02/2013
 * Functional Genomics Group EMBL-EBI
 */
public enum GraphQueryFormats {

    RDFXML ("RDF/XML", "application/rdf+xml"),
    N3 ("N3", "application/rdf+n3"),
    JSON ("JSON-LD", "application/rdf+json"),
    TURTLE ("TURTLE", "text/turtle");

    private final String format;
    private final String mimetype;

    private GraphQueryFormats(final String format, final String mimetype) {
	this.format = format;
	this.mimetype = mimetype;
    }

    @Override
    public String toString() {
        return format;
    }

    public String toMimeType() {
        return mimetype;
    }
}

package uk.ac.ebi.fgpt.lode.utils;

/**
 * @author Simon Jupp
 * @date 21/02/2013
 * Functional Genomics Group EMBL-EBI
 */
public enum GraphQueryFormats {

    RDFXML ("RDF/XML", "application/rdf+xml"),
    N3 ("N3", "application/rdf+n3"),
    JSON ("JSON-LD", "application/ld+json"),
    TURTLE ("TURTLE", "text/turtle");

    private final String format;
    private final String mimetype;

    private GraphQueryFormats(final String format, final String mimetype) {
	this.format = format;
	this.mimetype = mimetype;
    }

    @Override
    public String toString() {
        return format;
    }

    public String toMimeType() {
        return mimetype;
    }
}

Change MIME-type for JSON-LD graph query responses


package ${packageName};

import org.springframework.bootstrap.SpringApplication;
import org.springframework.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
@EnableAutoConfiguration
public class Application {

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

package ${packageName};

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan
@EnableAutoConfiguration
public class Application {

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

Fix packages in sample app


package com.swandiggy.poe4j.data.readers.value;

import com.swandiggy.poe4j.data.DatFileReader;
import org.springframework.stereotype.Service;

/**
 * Read a string value. Reads an int pointer into the variable width portion of the file. Strings are null terminated
 * and encoded as UTF-16LE.
 *
 * @author Jacob Swanson
 * @since 12/15/2015
 */
public class StringReader extends BaseValueReader<String> {

    public StringReader() {
    }

    @Override
    public boolean supports(Class clazz) {
        return clazz == String.class;
    }

    @Override
    protected String readInternal(DatFileReader reader, Class clazz) {
        int ref = reader.getBr().readInt();

        long oldPos = reader.getBr().getPosition();
        reader.getBr().setPosition(reader.getDataOffset() + ref);
        String s = reader.getBr().readString("UTF-16LE");
        reader.getBr().setPosition(oldPos);

        return s;
    }

    @Override
    public int size(Class clazz) {
        return 4;
    }
}

package com.swandiggy.poe4j.data.readers.value;

import com.swandiggy.poe4j.data.DatFileReader;
import lombok.extern.slf4j.Slf4j;

/**
 * Read a string value. Reads an int pointer into the variable width portion of the file. Strings are null terminated
 * and encoded as UTF-16LE.
 *
 * @author Jacob Swanson
 * @since 12/15/2015
 */
@Slf4j
public class StringReader extends BaseValueReader<String> {

    public StringReader() {
    }

    @Override
    public boolean supports(Class clazz) {
        return clazz == String.class;
    }

    @Override
    protected String readInternal(DatFileReader reader, Class clazz) {
        int ref = reader.getBr().readInt();

        long oldPos = reader.getBr().getPosition();
        long stringPos = reader.getDataOffset() + ref;
        if (stringPos >= reader.getFile().length()) {
            log.warn("String was at end of file eof: '{}', string ref: '{}'", reader.getFile().length(), stringPos);
            return null;
        }
        reader.getBr().setPosition(reader.getDataOffset() + ref);
        String s = reader.getBr().readString("UTF-16LE");
        reader.getBr().setPosition(oldPos);

        return s;
    }

    @Override
    public int size(Class clazz) {
        return 4;
    }
}

Add check if string is at EOF


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

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

public final class Types
{
    private Types() {}

    public static <A, B extends A> B checkType(A value, Class<B> target, String name)
    {
        checkNotNull(value, "%s is null", name);
        checkArgument(target.isInstance(value),
                "%s must be of type %s, not %s",
                name,
                target.getName(),
                value.getClass().getName());
        return target.cast(value);
    }
}

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

import com.facebook.presto.spi.ErrorCode;
import com.facebook.presto.spi.PrestoException;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;

public final class Types
{
    private Types() {}

    public static <A, B extends A> B checkType(A value, Class<B> target, String name)
    {
        checkNotNull(value, "%s is null", name);
        checkArgument(target.isInstance(value),
                "%s must be of type %s, not %s",
                name,
                target.getName(),
                value.getClass().getName());
        return target.cast(value);
    }

    public static <A, B extends A> B checkType(A value, Class<B> target, ErrorCode errorCode, String name)
    {
        checkNotNull(value, "%s is null", name);
        if (!target.isInstance(value)) {
            throw new PrestoException(errorCode, String.format(
                    "%s must be of type %s, not %s",
                    name,
                    target.getName(),
                    value.getClass().getName()));
        }
        return target.cast(value);
    }
}

Add checkType that takes an error code


package com.nincraft.ninbot.components.twitch;

import com.github.twitch4j.helix.TwitchHelix;
import lombok.extern.log4j.Log4j2;
import lombok.val;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Component
@Log4j2
public class TwitchAPI {

    private TwitchHelix twitchHelix;

    public TwitchAPI(TwitchHelix twitchHelix) {
        this.twitchHelix = twitchHelix;
    }

    String getBoxArtUrl(String gameName) {
        try {
            val gameResults = twitchHelix.getGames(null, Arrays.asList(gameName), null).execute();
            if (gameResults.getGames().isEmpty()) {
                return null;
            } else {
                String boxartUrl = gameResults.getGames().get(0).getBoxArtUrl();
                return boxartUrl.replace("-{width}x{height}", "");
            }
        } catch (Exception e) {
            log.error("Failed to get boxart from Twitch API", e);
            return null;
        }
    }
}

package com.nincraft.ninbot.components.twitch;

import com.github.twitch4j.helix.TwitchHelix;
import lombok.extern.log4j.Log4j2;
import lombok.val;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Component
@Log4j2
public class TwitchAPI {

    private TwitchHelix twitchHelix;

    public TwitchAPI(TwitchHelix twitchHelix) {
        this.twitchHelix = twitchHelix;
    }

    String getBoxArtUrl(String gameName) {
        try {
            val gameResults = twitchHelix.getGames(null, null, Arrays.asList(gameName)).execute();
            if (gameResults.getGames().isEmpty()) {
                return null;
            } else {
                String boxartUrl = gameResults.getGames().get(0).getBoxArtUrl();
                return boxartUrl.replace("-{width}x{height}", "");
            }
        } catch (Exception e) {
            log.error("Failed to get boxart from Twitch API", e);
            return null;
        }
    }
}

Fix twitch api call for boxart


/*
 * Copyright 2010-2013 Ning, Inc.
 * Copyright 2014 Groupon, Inc
 * Copyright 2014 The Billing Project, LLC
 *
 * The Billing Project 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.killbill.billing.retry.plugin.api;

import org.joda.time.DateTime;

public interface RetryPluginApi {

    /**
     *
     * @return true if retry logic should be aborted
     */
    public boolean isRetryAborted();

    /**
     *
     * @return the next date where retry should occur; null if there is no more retry
     */
    public DateTime getNextRetryDate();
}

/*
 * Copyright 2010-2013 Ning, Inc.
 * Copyright 2014 Groupon, Inc
 * Copyright 2014 The Billing Project, LLC
 *
 * The Billing Project 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.killbill.billing.retry.plugin.api;

import org.joda.time.DateTime;

public interface RetryPluginApi {

    /**
     *
     * @return true if retry logic should be aborted
     */
    public boolean isRetryAborted(final String externalKey);

    /**
     *
     * @return the next date where retry should occur; null if there is no more retry
     */
    public DateTime getNextRetryDate(final String externalKey);
}

Add missing key to retryPlugin apis


public class InsertionSort {
    public static int[] sort(int[] array) {
        for (int i = 1; i < array.length; i++) {
            int item = array[i];
            int indexHole = i;
            while (indexHole > 0 && array[indexHole - 1] > item) {
                array[indexHole] = array[--indexHole];
            }
            array[indexHole] = item;
        }
        return array;
    }
}

public class InsertionSort {
    public static void sort(int[] array) {
        for (int i = 1; i < array.length; i++) {
            int item = array[i];
            int indexHole = i;
            while (indexHole > 0 && array[indexHole - 1] > item) {
                array[indexHole] = array[--indexHole];
            }
            array[indexHole] = item;
        }
    }
}

Fix return type of insertion sort


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

import com.cloud.agent.api.Answer;
import com.cloud.agent.api.to.DiskTO;

public class AttachAnswer extends Answer {
    private DiskTO disk;
    public AttachAnswer() {
        super(null);
    }

    public AttachAnswer(DiskTO disk) {
        this.setDisk(disk);
    }
    public AttachAnswer(String errMsg) {
        super(null, false, errMsg);
    }

    public DiskTO getDisk() {
        return disk;
    }

    public void setDisk(DiskTO disk) {
        this.disk = disk;
    }
}

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

import com.cloud.agent.api.Answer;
import com.cloud.agent.api.to.DiskTO;

public class AttachAnswer extends Answer {
    private DiskTO disk;
    public AttachAnswer() {
        super(null);
    }

    public AttachAnswer(DiskTO disk) {
        super(null);
        this.setDisk(disk);
    }
    public AttachAnswer(String errMsg) {
        super(null, false, errMsg);
    }

    public DiskTO getDisk() {
        return disk;
    }

    public void setDisk(DiskTO disk) {
        this.disk = disk;
    }
}

Fix CLOUDSTACK-2520: Invoke parent constructor to set result state to default true to avoid attachVolume error.


package org.museautomation.core.task.input;

import org.museautomation.core.task.state.*;

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
public abstract class ResolvedInputSource
    {
    public abstract String getDescription();

    public static class TaskStateSource extends ResolvedInputSource
        {
        public TaskStateSource(InterTaskState state)
            {
            _state = state;
            }

        @Override
        public String getDescription()
            {
            return "from task state " + _state.getStateDefinitionId();
            }

        public InterTaskState getState()
            {
            return _state;
            }

        private final InterTaskState _state;
        }

    public static class InputProviderSource extends ResolvedInputSource
        {
        public InputProviderSource(TaskInputProvider provider)
            {
            _provider = provider;
            }

        @Override
        public String getDescription()
            {
            return "from task input provider " + _provider.getDescription();
            }

        public TaskInputProvider getProvider()
            {
            return _provider;
            }

        private final TaskInputProvider _provider;
        }

    public static class DefaultValueSource extends ResolvedInputSource
        {
        @Override
        public String getDescription()
            {
            return "from default value ";
            }
        }
    }

package org.museautomation.core.task.input;

import org.museautomation.core.task.state.*;

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
public abstract class ResolvedInputSource
    {
    public abstract String getDescription();

    public static class TaskStateSource extends ResolvedInputSource
        {
        public TaskStateSource(InterTaskState state)
            {
            _state = state;
            }

        @Override
        public String getDescription()
            {
            return "from task state " + _state.getStateDefinitionId();
            }

        public InterTaskState getState()
            {
            return _state;
            }

        private final InterTaskState _state;
        }

    public static class InputProviderSource extends ResolvedInputSource
        {
        public InputProviderSource(TaskInputProvider provider)
            {
            _provider = provider;
            }

        @Override
        public String getDescription()
            {
            return "from task input provider " + _provider.getDescription();
            }

        public TaskInputProvider getProvider()
            {
            return _provider;
            }

        private final TaskInputProvider _provider;
        }

    @SuppressWarnings("unused")  // used in UI
    public static class UserInputSource extends ResolvedInputSource
        {
        @Override
        public String getDescription()
            {
            return "from user";
            }
        }

    public static class DefaultValueSource extends ResolvedInputSource
        {
        @Override
        public String getDescription()
            {
            return "from default value ";
            }
        }
    }

Add UserInputSource as a InputProviderSource


package com.rockwellcollins.atc.resolute.analysis.execution;

import java.util.Comparator;

import org.osate.aadl2.NamedElement;

public class NamedElementComparator implements Comparator<NamedElement> {
    @Override
    public int compare(NamedElement arg0, NamedElement arg1) {
        if (arg0 == arg1) {
            return 0;
        }

        int r = arg0.getName().compareToIgnoreCase(arg1.getName());
        if (r != 0) {
            return r;
        }

        r = Integer.compare(arg0.hashCode(), arg1.hashCode());
        if (r == 0) {
            throw new IllegalArgumentException("Unable to order distinct objects via hashcode");
        }
        return r;
    }
}

package com.rockwellcollins.atc.resolute.analysis.execution;

import java.util.Comparator;

import org.osate.aadl2.NamedElement;

import com.rockwellcollins.atc.resolute.analysis.values.NamedElementValue;

public class NamedElementComparator implements Comparator<NamedElement> {
    @Override
    public int compare(NamedElement arg0, NamedElement arg1) {
        if (arg0 == arg1) {
            return 0;
        }

        String text0 = new NamedElementValue(arg0).toString();
        String text1 = new NamedElementValue(arg1).toString();
        int r = text0.compareToIgnoreCase(text1);
        if (r != 0) {
            return r;
        }

        r = Integer.compare(arg0.hashCode(), arg1.hashCode());
        if (r == 0) {
            throw new IllegalArgumentException("Unable to order distinct objects via hashcode");
        }
        return r;
    }
}

Order based on name used in assurance case


package openperipheral.integration.thermalexpansion;

import java.util.Locale;

import openperipheral.api.*;
import cofh.api.tileentity.ISecureTile;
import cofh.api.tileentity.ISecureTile.AccessMode;

public class AdapterSecureTile implements IPeripheralAdapter {

	@Override
	public Class<?> getTargetClass() {
		return ISecureTile.class;
	}

	@LuaMethod(description = "Gets the owner of the machine.", returnType = LuaType.STRING)
	public String getOwnerName(ISecureTile tile) {
		return tile.getOwnerName();
	}

	@LuaMethod(description = "Is this username allowed to access the machine.", returnType = LuaType.BOOLEAN, args = {
			@Arg(name = "username", description = "The username to check for", type = LuaType.STRING)
	})
	public boolean canPlayerAccess(ISecureTile tile, String name) {
		return tile.canPlayerAccess(name);
	}

	@LuaMethod(description = "Gets the AccessMode of this machine.", returnType = LuaType.STRING)
	public String getAccess(ISecureTile tile) {
		return tile.getAccess().name();
	}

	@LuaMethod(description = "Sets the AccessMode of this machine.", returnType = LuaType.BOOLEAN, args = {
			@Arg(name = "accessMode", description = "The access mode you wish to set (can be PUBLIC,RESTRICTED or PRIVATE)", type = LuaType.STRING)
	})
	public boolean setAccess(ISecureTile tile, String access) {
		try {
			AccessMode mode = AccessMode.valueOf(access.toUpperCase(Locale.ENGLISH));
			return tile.setAccess(mode);
		} catch (IllegalArgumentException e) {}
		return false;
	}
}

package openperipheral.integration.thermalexpansion;

import java.util.Locale;

import openperipheral.api.*;
import cofh.api.tileentity.ISecureTile;
import cofh.api.tileentity.ISecureTile.AccessMode;

public class AdapterSecureTile implements IPeripheralAdapter {

	@Override
	public Class<?> getTargetClass() {
		return ISecureTile.class;
	}

	@LuaMethod(description = "Gets the owner of the machine.", returnType = LuaType.STRING)
	public String getOwnerName(ISecureTile tile) {
		return tile.getOwnerName();
	}

	@LuaMethod(description = "Is this username allowed to access the machine.", returnType = LuaType.BOOLEAN, args = {
			@Arg(name = "username", description = "The username to check for", type = LuaType.STRING)
	})
	public boolean canPlayerAccess(ISecureTile tile, String name) {
		return tile.canPlayerAccess(name);
	}

	@LuaMethod(description = "Gets the AccessMode of this machine.", returnType = LuaType.STRING)
	public String getAccess(ISecureTile tile) {
		return tile.getAccess().name();
	}

}

Remove setAccess from TE Strongboxes


package com.twu.biblioteca;

public class BibliotecaApp {

    public BibliotecaApp() {
        System.out.println(welcomeMessage());
    }

    public static void main(String[] args) {
        BibliotecaApp bibliotecaApp = new BibliotecaApp();
    }

    public String welcomeMessage() {
        StringBuilder sb = new StringBuilder();
        sb.append("Welcome to Biblioteca - A Library Management System\n");
        int length = sb.length();
        for (int i = 0; i < length; i++) {
            sb.append("-");
        }
        return sb.toString();
    }
}

package com.twu.biblioteca;

public class BibliotecaApp {

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

    public String welcomeMessage() {
        return "";
    }
}

Revert "Added a proper welcome message"


package synapticloop.b2;

/*
 * Copyright (c) 2016 synapticloop.
 *
 * All rights reserved.
 *
 * This code may contain contributions from other parties which, where
 * applicable, will be listed in the default build file for the project
 * ~and/or~ in a file named CONTRIBUTORS.txt in the root of the project.
 *
 * This source code and any derived binaries are covered by the terms and
 * conditions of the Licence agreement ("the Licence").  You may not use this
 * source code or any derived binaries except in compliance with the Licence.
 * A copy of the Licence is available in the file named LICENSE.txt shipped with
 * this source code or binaries.
 */

/**
 * The action for an associated file, either 'hide' or 'upload', "upload" means
 * a file that was uploaded to B2 Cloud Storage. "hide" means a file version
 * marking the file as hidden, so that it will not show up in b2_list_file_names.
 *
 * The result of b2_list_file_names will contain only "upload". The result of
 * b2_list_file_versions may have both.
 *
 * @author synapticloop
 */
public enum Action {
	hide,
	upload
}

package synapticloop.b2;

/*
 * Copyright (c) 2016 synapticloop.
 *
 * All rights reserved.
 *
 * This code may contain contributions from other parties which, where
 * applicable, will be listed in the default build file for the project
 * ~and/or~ in a file named CONTRIBUTORS.txt in the root of the project.
 *
 * This source code and any derived binaries are covered by the terms and
 * conditions of the Licence agreement ("the Licence").  You may not use this
 * source code or any derived binaries except in compliance with the Licence.
 * A copy of the Licence is available in the file named LICENSE.txt shipped with
 * this source code or binaries.
 */

/**
 * The action for an associated file, either 'hide' or 'upload', "upload" means
 * a file that was uploaded to B2 Cloud Storage. "hide" means a file version
 * marking the file as hidden, so that it will not show up in b2_list_file_names.
 *
 * The result of b2_list_file_names will contain only "upload". The result of
 * b2_list_file_versions may have both.
 *
 * @author synapticloop
 */
public enum Action {
	hide,
	upload,
	start
}

Add enum value `start` used for files with pending multipart upload.


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

package com.example.flutter;

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

import org.chromium.base.PathUtils;
import org.domokit.sky.shell.SkyApplication;
import org.domokit.sky.shell.SkyMain;
import org.domokit.sky.shell.PlatformViewAndroid;

import java.io.File;

public class FlutterActivity extends Activity {
    private PlatformViewAndroid flutterView;

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

        SkyMain.ensureInitialized(getApplicationContext(), null);
        setContentView(R.layout.flutter_layout);

        flutterView = (PlatformViewAndroid) findViewById(R.id.flutter_view);
        File appBundle = new File(PathUtils.getDataDirectory(this), SkyApplication.APP_BUNDLE);
        flutterView.runFromBundle(appBundle.getPath(), null);
    }

    @Override
    protected void onDestroy() {
        if (flutterView != null) {
            flutterView.destroy();
        }
        super.onDestroy();
    }
}

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

package com.example.flutter;

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

import org.chromium.base.PathUtils;
import org.domokit.sky.shell.SkyMain;
import org.domokit.sky.shell.PlatformViewAndroid;

import java.io.File;

public class FlutterActivity extends Activity {
    private PlatformViewAndroid flutterView;

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

        SkyMain.ensureInitialized(getApplicationContext(), null);
        setContentView(R.layout.flutter_layout);

        flutterView = (PlatformViewAndroid) findViewById(R.id.flutter_view);
        File appBundle = new File(PathUtils.getDataDirectory(this), SkyMain.APP_BUNDLE);
        flutterView.runFromBundle(appBundle.getPath(), null);
    }

    @Override
    protected void onDestroy() {
        if (flutterView != null) {
            flutterView.destroy();
        }
        super.onDestroy();
    }
}

Update SkyApplication to SkyMain in the hello_android example


package uk.gov.dvla.domain;

import com.google.code.morphia.annotations.Embedded;

import java.lang.String;
import java.util.Date;

@Embedded
public class EntitlementRestriction {

    private String code;
    private String text;
    private Date validFrom;
    private Date validTo;
    private String categoryCode;

    public EntitlementRestriction() {
    }

    public EntitlementRestriction(String code, String categoryCode) {
        if (code == null) {
            throw new RuntimeException("code must be specified");
        }

        this.code = code;
        this.categoryCode = categoryCode;

    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Date getValidFrom() {
        return validFrom;
    }

    public void setValidFrom(Date validFrom) {
        this.validFrom = validFrom;
    }

    public Date getValidTo() {
        return validTo;
    }

    public void setValidTo(Date validTo) {
        this.validTo = validTo;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }
}

package uk.gov.dvla.domain;

import com.google.code.morphia.annotations.Embedded;

import java.lang.String;
import java.util.Date;

@Embedded
public class EntitlementRestriction {

    private String code;
    private String text;
    private String categoryCode;
    private Date validTo;

    public EntitlementRestriction() {
    }

    public EntitlementRestriction(String code, String categoryCode) {
        if (code == null) {
            throw new RuntimeException("code must be specified");
        }

        this.code = code;
        this.categoryCode = categoryCode;

    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public Date getValidTo() {
        return validTo;
    }

    public void setValidTo(Date validTo) {
        this.validTo = validTo;
    }
}

Set validTo on Entitlement Restriction and calculated new directivestatus


package com.stanfy.images.decorator;

import android.graphics.Bitmap;
import android.graphics.Canvas;

/**
 * Chain of decorators.
 * @author Roman Mazur (Stanfy - http://www.stanfy.com)
 */
public class ChainDecorator extends ImageDecoratorAdapter {

  /** Internal decorators. */
  private final ImageDecorator[] chain;

  public ChainDecorator(final ImageDecorator... decorators) {
    this.chain = decorators;
  }

  @Override
  public Bitmap processBitmap(final Bitmap bitmap, final Canvas bitmapVanvas) {
    Bitmap result = bitmap;
    final ImageDecorator[] chain = this.chain;
    for (int i = 0; i < chain.length; i++) {
      final Bitmap next = chain[i].decorateBitmap(result, bitmapVanvas);
      if (next != result) { result.recycle(); }
      result = next;
    }
    return result;
  }

  @Override
  public void setup(final int width, final int height, final int[] state, final int level) {
    final ImageDecorator[] chain = this.chain;
    for (int i = 0; i < chain.length; i++) {
      chain[i].setup(width, height, state, level);
    }
  }

  public ImageDecorator[] getChain() {
    return chain;
  }

}

package com.stanfy.images.decorator;

import android.graphics.Bitmap;
import android.graphics.Canvas;

/**
 * Chain of decorators.
 * @author Roman Mazur (Stanfy - http://www.stanfy.com)
 */
public class ChainDecorator extends ImageDecoratorAdapter {

  /** Internal decorators. */
  private final ImageDecorator[] chain;

  /** Stateful flag. */
  private final boolean stateful;

  public ChainDecorator(final ImageDecorator... decorators) {
    this.chain = decorators;
    for (final ImageDecorator d : decorators) {
      if (d.dependsOnDrawableState()) {
        this.stateful = true;
        return;
      }
    }
    this.stateful = false;
  }

  @Override
  public Bitmap processBitmap(final Bitmap bitmap, final Canvas bitmapVanvas) {
    Bitmap result = bitmap;
    final ImageDecorator[] chain = this.chain;
    for (int i = 0; i < chain.length; i++) {
      final Bitmap next = chain[i].decorateBitmap(result, bitmapVanvas);
      if (next != result) { result.recycle(); }
      result = next;
    }
    return result;
  }

  @Override
  public boolean dependsOnDrawableState() { return stateful; }

  @Override
  public void setup(final int width, final int height, final int[] state, final int level) {
    final ImageDecorator[] chain = this.chain;
    for (int i = 0; i < chain.length; i++) {
      chain[i].setup(width, height, state, level);
    }
  }

  public ImageDecorator[] getChain() {
    return chain;
  }

}

Fix state in chain decorator


package io.scalecube.gateway.websocket;

import io.scalecube.gateway.clientsdk.ClientMessage;
import io.scalecube.gateway.clientsdk.ClientSettings;
import io.scalecube.gateway.clientsdk.codec.WebsocketGatewayMessageCodec;
import io.scalecube.gateway.clientsdk.websocket.WebsocketClientTransport;
import io.scalecube.services.codec.DataCodec;
import java.time.Duration;
import reactor.core.publisher.Mono;
import reactor.ipc.netty.resources.LoopResources;

public class WebsocketClientTransportTest {

  public static void main(String[] args) {
    String contentType = "application/json";
    ClientSettings settings =
        ClientSettings.builder().contentType(contentType).host("localhost").port(7070).build();
    LoopResources loopResources = LoopResources.create("worker");

    WebsocketClientTransport transport =
        new WebsocketClientTransport(
            settings,
            new WebsocketGatewayMessageCodec(DataCodec.getInstance(contentType)),
            loopResources);

    ClientMessage request = ClientMessage.builder().qualifier("/greeting/one").build();

    Mono.delay(Duration.ofSeconds(10))
        .doOnTerminate(
            () -> {
              System.err.println("closing ...");
              transport.close().subscribe();
            })
        .subscribe();

    ClientMessage block = transport.requestResponse(request).block();

    System.out.println(block);
  }
}

package io.scalecube.gateway.websocket;

import io.scalecube.gateway.clientsdk.ClientMessage;
import io.scalecube.gateway.clientsdk.ClientSettings;
import io.scalecube.gateway.clientsdk.codec.WebsocketGatewayMessageCodec;
import io.scalecube.gateway.clientsdk.websocket.WebsocketClientTransport;
import io.scalecube.services.codec.DataCodec;
import java.time.Duration;
import reactor.core.publisher.Mono;
import reactor.ipc.netty.resources.LoopResources;

public class WebsocketClientTransportTest {

  public static void main(String[] args) throws InterruptedException {
    String contentType = "application/json";
    ClientSettings settings =
        ClientSettings.builder().contentType(contentType).host("localhost").port(7070).build();
    LoopResources loopResources = LoopResources.create("worker");

    WebsocketClientTransport transport =
        new WebsocketClientTransport(
            settings,
            new WebsocketGatewayMessageCodec(DataCodec.getInstance(contentType)),
            loopResources);

    ClientMessage request =
        ClientMessage.builder().qualifier("/greeting/one").header("sid", "1").build();

    Mono.delay(Duration.ofSeconds(3))
        .doOnTerminate(
            () -> {
              System.err.println("closing ...");
              transport.close().subscribe();
            })
        .subscribe();

    transport.requestResponse(request).subscribe(System.out::println, System.err::println);

    Thread.currentThread().join();
  }
}

Update WebsocketHandler and WebsocketSession behavior


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

import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;

public abstract class SimpleGenericFutureListener<V> implements GenericFutureListener<Future<V>> {

    @Override
    public final void operationComplete(Future<V> future) throws Exception {
        if (future.isSuccess()) {
            onSuccess(future.get());
        } else {
            onFailure(future.cause());
        }
    }

    protected abstract void onSuccess(V value) throws Exception;

    protected abstract void onFailure(Throwable t) throws Exception;
}

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

import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;

public abstract class SimpleGenericFutureListener<V> implements GenericFutureListener<Future<V>> {

    @Override
    public final void operationComplete(Future<V> future) throws Exception {
        if (future.isSuccess()) {
            onSuccess(future.getNow());
        } else {
            onFailure(future.cause());
        }
    }

    protected abstract void onSuccess(V value) throws Exception;

    protected abstract void onFailure(Throwable t) throws Exception;
}

Use getNow() in GenericFutureListener. operationComplete instead of get()


/*
 * Copyright (c) 2002-2018 "Neo4j,"
 * Neo4j Sweden AB [http://neo4j.com]
 *
 * This file is part of Neo4j.
 *
 * 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.neo4j.driver.v1.tck.tck.util;

import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

import org.neo4j.driver.v1.util.DatabaseExtension;

public class DatabaseRule extends DatabaseExtension implements TestRule
{
    @Override
    public Statement apply( Statement base, Description description )
    {
        return new Statement()
        {
            @Override
            public void evaluate() throws Throwable
            {
                DatabaseRule.this.beforeEach( null );
                base.evaluate();
            }
        };
    }
}

/*
 * Copyright (c) 2002-2018 "Neo4j,"
 * Neo4j Sweden AB [http://neo4j.com]
 *
 * This file is part of Neo4j.
 *
 * 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.neo4j.driver.v1.tck.tck.util;

import org.junit.AssumptionViolatedException;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
import org.opentest4j.TestAbortedException;

import org.neo4j.driver.v1.util.DatabaseExtension;

public class DatabaseRule extends DatabaseExtension implements TestRule
{
    @Override
    public Statement apply( Statement base, Description description )
    {
        return new Statement()
        {
            @Override
            public void evaluate() throws Throwable
            {
                try
                {
                    DatabaseRule.this.beforeEach( null );
                }
                catch ( TestAbortedException e )
                {
                    throw new AssumptionViolatedException( "Unable to prepare database", e );
                }
                base.evaluate();
            }
        };
    }
}

Fix skipping of TCK tests when boltkit unavailable


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

package org.apache.logging.log4j.core.net;

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

import org.junit.jupiter.api.Test;

/**
 * Unit tests for {@link SmtpManager}.
 */
class SmtpManagerTest {

    @Test
    void testCreateManagerName() {
        String managerName = SmtpManager.createManagerName("to", "cc", null, "from", null, "LOG4J2-3107",
                "proto", "smtp.log4j.com", 4711, "username", false, "filter");
        assertEquals("SMTP:to:cc::from::LOG4J2-3107:proto:smtp.log4j.com:4711:username::filter", managerName);
    }

}

Add missing Apache license header.


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.technobots.commands;

import edu.wpi.first.wpilibj.command.CommandGroup;

/**
 *
 * @author miguel
 */
public class NormalAutonomous extends CommandGroup {

    public NormalAutonomous() {

        //addSequential(new StopBall());
        addParallel(new ShooterOn(-.8));
        addSequential(new ReleaseBall());
        addSequential(new StopBall());

    }
}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.technobots.commands;

import edu.wpi.first.wpilibj.command.CommandGroup;

/**
 *
 * @author miguel
 */
public class NormalAutonomous extends CommandGroup {

    public NormalAutonomous() {

        //addSequential(new StopBall());
        addParallel(new ShooterOn(-.4));
        addSequential(new ReleaseBall());
        addSequential(new StopBall());

    }
}

Decrease Shooter Speed For Autonomous


package com.nulabinc.backlog4j.api.option;

import com.nulabinc.backlog4j.http.NameValuePair;

/**
 * Parameters for update status API.
 *
 * @author nulab-inc
 */
public class UpdateStatusParams extends PatchParams {

    private Object projectIdOrKey;
    private Object statusId;

    public UpdateStatusParams(Object projectIdOrKey, Object statusId, String name, String color) {
        this.projectIdOrKey = projectIdOrKey;
        this.statusId = statusId;
        parameters.add(new NameValuePair("name", name));
        parameters.add(new NameValuePair("color", color));
    }

    public String getProjectIdOrKeyString() {
        return projectIdOrKey.toString();
    }

    public String getStatusId() {
        return statusId.toString();
    }
}

package com.nulabinc.backlog4j.api.option;

import com.nulabinc.backlog4j.Project;
import com.nulabinc.backlog4j.http.NameValuePair;

/**
 * Parameters for update status API.
 *
 * @author nulab-inc
 */
public class UpdateStatusParams extends PatchParams {

    private Object projectIdOrKey;
    private Object statusId;

    public UpdateStatusParams(Object projectIdOrKey, Object statusId, String name, Project.CustomStatusColor color) {
        this.projectIdOrKey = projectIdOrKey;
        this.statusId = statusId;
        parameters.add(new NameValuePair("name", name));
        parameters.add(new NameValuePair("color", color.getStrValue()));
    }

    public String getProjectIdOrKeyString() {
        return projectIdOrKey.toString();
    }

    public String getStatusId() {
        return statusId.toString();
    }
}

Fix type at color variable


package alien4cloud.it;

import org.junit.Ignore;
import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features = {
        //
        // "classpath:alien/rest/application-deployment/"
        // "classpath:alien/rest/application-deployment/service_matching.feature"
        // "classpath:alien/rest/application-deployment/deploy_application.feature"
        // "classpath:alien/rest/application-deployment/deploy_application_with_events.feature"
        // "classpath:alien/rest/application-deployment/deployments.feature"
        "classpath:alien/rest/application-deployment/inputs_orchestrators_properties_settings.feature"
        // "classpath:alien/rest/application-deployment/location_matching.feature"
        // "classpath:alien/rest/application-deployment/location_policies_setting.feature"
        // "classpath:alien/rest/application-deployment/node_substitution.feature"
        // "classpath:alien/rest/application-deployment/undeploy_application.feature"
        //
}, format = { "pretty", "html:target/cucumber/application_deployment", "json:target/cucumber/cucumber-application-deployment.json" })
// @Ignore
public class RunApplicationDeploymentIT {
}

package alien4cloud.it;

import org.junit.Ignore;
import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features = {
        //
        "classpath:alien/rest/application-deployment/"
        // "classpath:alien/rest/application-deployment/service_matching.feature"
        // "classpath:alien/rest/application-deployment/deploy_application.feature"
        // "classpath:alien/rest/application-deployment/deploy_application_with_events.feature"
        // "classpath:alien/rest/application-deployment/deployments.feature"
        // "classpath:alien/rest/application-deployment/inputs_orchestrators_properties_settings.feature"
        // "classpath:alien/rest/application-deployment/location_matching.feature"
        // "classpath:alien/rest/application-deployment/location_policies_setting.feature"
        // "classpath:alien/rest/application-deployment/node_substitution.feature"
        // "classpath:alien/rest/application-deployment/undeploy_application.feature"
        //
}, format = { "pretty", "html:target/cucumber/application_deployment", "json:target/cucumber/cucumber-application-deployment.json" })
// @Ignore
public class RunApplicationDeploymentIT {
}

Fix previous commit (disabled some tests)


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

public enum LegalPersonType {
  BUSINESS, ORGANIZATION;
}

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

public enum LegalPersonType {
  BUSINESS, ORGANIZATION, SOLETRADER;
}

Add new legal person types.


package com.smartbear.ready.jenkins.sample;

import org.junit.Test;

import java.io.IOException;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class SpotifyLookupTest {
    @Test
    public void testNyttGolv() throws IOException {
        SpotifyLookup spotifyLookup = new SpotifyLookup();

        // Use our Virt instead of the real API
        spotifyLookup.setEndpoint("http://localhost:8080/lookup/1/");

        String title = spotifyLookup.getTitle("7JIuSd9aMu0bDd57820sFV");
        assertThat(title, is("Nytt golv"));
    }
}

package com.smartbear.ready.jenkins.sample;

import org.junit.Test;

import java.io.IOException;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

public class SpotifyLookupTest {
    @Test
    public void testNyttGolv() throws IOException {
        SpotifyLookup spotifyLookup = new SpotifyLookup();

        // Use our Virt instead of the real API
        spotifyLookup.setEndpoint("http://localhost:53487/lookup/1/");

        String title = spotifyLookup.getTitle("7JIuSd9aMu0bDd57820sFV");
        assertThat(title, is("Nytt golv"));
    }
}

Use a less common port


// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
//  This source code is licensed under both the GPLv2 (found in the
//  COPYING file in the root directory) and Apache 2.0 License
//  (found in the LICENSE.Apache file in the root directory).

package org.rocksdb;

/**
 * RocksDB {@link ReadOptions} read tiers.
 */
public enum ReadTier {
  READ_ALL_TIER((byte)0),
  BLOCK_CACHE_TIER((byte)1),
  PERSISTED_TIER((byte)2);

  private final byte value;

  ReadTier(final byte value) {
    this.value = value;
  }

  /**
   * Returns the byte value of the enumerations value
   *
   * @return byte representation
   */
  public byte getValue() {
    return value;
  }

  /**
   * Get ReadTier by byte value.
   *
   * @param value byte representation of ReadTier.
   *
   * @return {@link org.rocksdb.ReadTier} instance or null.
   * @throws java.lang.IllegalArgumentException if an invalid
   *     value is provided.
   */
  public static ReadTier getReadTier(final byte value) {
    for (final ReadTier readTier : ReadTier.values()) {
      if (readTier.getValue() == value){
        return readTier;
      }
    }
    throw new IllegalArgumentException("Illegal value provided for ReadTier.");
  }
}

// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
//  This source code is licensed under both the GPLv2 (found in the
//  COPYING file in the root directory) and Apache 2.0 License
//  (found in the LICENSE.Apache file in the root directory).

package org.rocksdb;

/**
 * RocksDB {@link ReadOptions} read tiers.
 */
public enum ReadTier {
  READ_ALL_TIER((byte)0),
  BLOCK_CACHE_TIER((byte)1),
  PERSISTED_TIER((byte)2),
  MEMTABLE_TIER((byte)3);

  private final byte value;

  ReadTier(final byte value) {
    this.value = value;
  }

  /**
   * Returns the byte value of the enumerations value
   *
   * @return byte representation
   */
  public byte getValue() {
    return value;
  }

  /**
   * Get ReadTier by byte value.
   *
   * @param value byte representation of ReadTier.
   *
   * @return {@link org.rocksdb.ReadTier} instance or null.
   * @throws java.lang.IllegalArgumentException if an invalid
   *     value is provided.
   */
  public static ReadTier getReadTier(final byte value) {
    for (final ReadTier readTier : ReadTier.values()) {
      if (readTier.getValue() == value){
        return readTier;
      }
    }
    throw new IllegalArgumentException("Illegal value provided for ReadTier.");
  }
}

Add Memtable Read Tier to RocksJava


package org.cyclops.integrateddynamics.network;

import org.cyclops.cyclopscore.datastructure.DimPos;
import org.cyclops.integrateddynamics.api.network.IPartNetwork;
import org.cyclops.integrateddynamics.core.network.TileNetworkElement;
import org.cyclops.integrateddynamics.tileentity.TileVariablestore;

/**
 * Network element for variable stores.
 * @author rubensworks
 */
public class VariablestoreNetworkElement extends TileNetworkElement<TileVariablestore> {

    public VariablestoreNetworkElement(DimPos pos) {
        super(pos);
    }

    @Override
    public boolean onNetworkAddition(IPartNetwork network) {
        return network.addVariableContainer(getPos());
    }

    @Override
    public void onNetworkRemoval(IPartNetwork network) {
        network.removeVariableContainer(getPos());
    }

    @Override
    public int getConsumptionRate() {
        return 4;
    }

    @Override
    protected Class<TileVariablestore> getTileClass() {
        return null;
    }
}

package org.cyclops.integrateddynamics.network;

import org.cyclops.cyclopscore.datastructure.DimPos;
import org.cyclops.integrateddynamics.api.network.IPartNetwork;
import org.cyclops.integrateddynamics.core.network.TileNetworkElement;
import org.cyclops.integrateddynamics.tileentity.TileVariablestore;

/**
 * Network element for variable stores.
 * @author rubensworks
 */
public class VariablestoreNetworkElement extends TileNetworkElement<TileVariablestore> {

    public VariablestoreNetworkElement(DimPos pos) {
        super(pos);
    }

    @Override
    public boolean onNetworkAddition(IPartNetwork network) {
        return network.addVariableContainer(getPos());
    }

    @Override
    public void onNetworkRemoval(IPartNetwork network) {
        network.removeVariableContainer(getPos());
    }

    @Override
    public int getConsumptionRate() {
        return 4;
    }

    @Override
    protected Class<TileVariablestore> getTileClass() {
        return TileVariablestore.class;
    }
}

Fix variable store breaking crash


package at.ac.tuwien.inso.integration_tests;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;

@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
@Transactional
public class StudentRecommendedCoursesTests {

    @Test
    public void studentRecommendedCoursesTest() {
        //TODO
    }

    @Test
    public void dismissCourseTest() {
        //TODO
    }
}

package at.ac.tuwien.inso.integration_tests;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.transaction.annotation.Transactional;

import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.redirectedUrl;

@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
@ActiveProfiles("test")
@Transactional
public class StudentRecommendedCoursesTests extends AbstractCoursesTests{

    @Test
    public void studentRecommendedCoursesTest() throws Exception {
        mockMvc.perform(
                get("/student/recommended").with(user(studentUserAccount))
        ).andExpect(
                model().attributeExists("recommendedCourses")
        );
    }

    @Test
    @Rollback
    public void dismissCourseTest() throws Exception {
        mockMvc.perform(
                post("/student/recommended")
                        .with(user(studentUserAccount))
                        .with(csrf())
                        .contentType(MediaType.APPLICATION_FORM_URLENCODED_VALUE)
                        .content("dismissedId="+calculusWS2016.getId())
        ).andExpect(
                result -> {
                    if (studentRepository.findByAccount(studentUserAccount).getDismissedCourses().size() <= 0) {
                        throw new Exception("Size of dismissed courses for student " + student + " is zero");
                    }
                    if (!studentRepository.findByAccount(studentUserAccount).getDismissedCourses().contains(calculusWS2016)) {
                        throw new Exception("Wrong dismissed course!");
                    }
                }
        ).andExpect(
                redirectedUrl("/student/recommended")
        );
    }
}

Add tests for RecommendedCourses and Dismiss course


package com.braintreepayments.testutils;

import android.app.Activity;
import android.app.KeyguardManager;
import android.content.Context;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;

import static android.support.test.InstrumentationRegistry.getTargetContext;
import static com.braintreepayments.testutils.SharedPreferencesHelper.getSharedPreferences;

public class BraintreeActivityTestRule<T extends Activity> extends ActivityTestRule<T> {

    public BraintreeActivityTestRule(Class<T> activityClass) {
        super(activityClass);
    }

    public BraintreeActivityTestRule(Class<T> activityClass, boolean initialTouchMode,
            boolean launchActivity) {
        super(activityClass, initialTouchMode, launchActivity);
    }

    @Override
    protected void beforeActivityLaunched() {
        super.beforeActivityLaunched();
        getSharedPreferences().edit().clear().commit();

        ((KeyguardManager) getTargetContext().getSystemService(Context.KEYGUARD_SERVICE))
                .newKeyguardLock("BraintreeActivityTestRule")
                .disableKeyguard();
    }

    @Override
    protected void afterActivityLaunched() {
        Intents.init();
        super.afterActivityLaunched();
    }

    @Override
    protected void afterActivityFinished() {
        super.afterActivityFinished();

        Intents.release();

        getSharedPreferences().edit().clear().commit();
    }
}

package com.braintreepayments.testutils;

import android.app.Activity;
import android.app.KeyguardManager;
import android.app.KeyguardManager.KeyguardLock;
import android.content.Context;
import android.support.test.espresso.intent.Intents;
import android.support.test.rule.ActivityTestRule;

import static android.support.test.InstrumentationRegistry.getTargetContext;
import static com.braintreepayments.testutils.SharedPreferencesHelper.getSharedPreferences;

public class BraintreeActivityTestRule<T extends Activity> extends ActivityTestRule<T> {

    private KeyguardLock mKeyguardLock;

    public BraintreeActivityTestRule(Class<T> activityClass) {
        super(activityClass);
        init();
    }

    public BraintreeActivityTestRule(Class<T> activityClass, boolean initialTouchMode,
            boolean launchActivity) {
        super(activityClass, initialTouchMode, launchActivity);
        init();
    }

    private void init() {
        getSharedPreferences().edit().clear().commit();

        mKeyguardLock = ((KeyguardManager) getTargetContext().getSystemService(Context.KEYGUARD_SERVICE))
                .newKeyguardLock("BraintreeActivityTestRule");
        mKeyguardLock.disableKeyguard();
    }

    @Override
    protected void afterActivityLaunched() {
        Intents.init();
        super.afterActivityLaunched();
    }

    @Override
    protected void afterActivityFinished() {
        super.afterActivityFinished();

        try {
            Intents.release();
        } catch (IllegalStateException ignored) {}

        getSharedPreferences().edit().clear().commit();

        mKeyguardLock.reenableKeyguard();
    }
}

Fix incorrect test failures and Keyguard leaks


package com.chaos.databinding.presenters;

import com.chaos.databinding.models.User;
import com.chaos.databinding.views.UserView;

public class ActivityMainPresenter {
    private final UserView view;

    public ActivityMainPresenter(final UserView view) {
        this.view = view;
    }

    public static ActivityMainPresenter create(final UserView view) {
        return new ActivityMainPresenter(view);
    }

    public void updateUser() {
        this.view.setUser(this.getUser());
    }

    private User getUser() {
        return new User("Ash Davies", "Berlin");
    }
}

package com.chaos.databinding.presenters;

import com.chaos.databinding.models.User;
import com.chaos.databinding.services.GitHub;
import com.chaos.databinding.views.UserView;

import retrofit.RestAdapter;

public class ActivityMainPresenter {
    private static final String GITHUB_API = "https://api.github.com";

    private final GitHub service;
    private final UserView view;

    public ActivityMainPresenter(final GitHub service, final UserView view) {
        this.service = service;
        this.view = view;
    }

    public static ActivityMainPresenter create(final UserView view) {
        final GitHub service = ActivityMainPresenter.getRestAdapter().create(GitHub.class);
        return new ActivityMainPresenter(service, view);
    }

    private static RestAdapter getRestAdapter() {
        return new RestAdapter.Builder()
                .setEndpoint(GITHUB_API)
                .build();
    }

    public void updateUser() {
        this.view.setUser(this.getUser());
    }

    private User getUser() {
        return new User("Ash Davies", "Berlin");
    }
}

Create presenter with GitHub service


/*
 * 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.gbif.common.messaging.api.messages;

import java.util.Set;

/**
 * Pipelines message that allows specifying the execution runner for a pipeline process.
 */
public interface PipelinesInterpretationMessage extends PipelineBasedMessage {

  Set<String> getInterpretTypes();

  String getOnlyForStep();

  Long getNumberOfInterpretationRecords();

  void setInterpretTypes(Set<String> interpretTypes);
}

/*
 * 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.gbif.common.messaging.api.messages;

import java.util.Set;

/**
 * Pipelines message that allows specifying the execution runner for a pipeline process.
 */
public interface PipelinesInterpretationMessage extends PipelineBasedMessage, PipelinesRunnerMessage {

  Set<String> getInterpretTypes();

  String getOnlyForStep();

  Long getNumberOfInterpretationRecords();

  void setInterpretTypes(Set<String> interpretTypes);
}

Create runner interface for yarn/java messages


package net.mostlyoriginal.game.system.drag;

import com.artemis.Aspect;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.World;
import com.artemis.annotations.Wire;
import com.artemis.utils.IntBag;
import net.mostlyoriginal.api.system.physics.CollisionSystem;
import net.mostlyoriginal.game.component.Draggable;

/**
 * @author Daan van Yperen
 */
@Wire
public class GridOverlapHelperSystem extends EntitySystem {

	CollisionSystem collisionSystem;
	private Entity flyweightEntity;

	public GridOverlapHelperSystem() {
		super(Aspect.all(Draggable.class));
	}

	@Override
	protected void setWorld(World world) {
		super.setWorld(world);
		flyweightEntity = createFlyweightEntity();
	}

	/**
	 * Does passed entity overlap any grid entity? (except self)
	 */
	public boolean overlaps(Entity e) {
		IntBag actives = subscription.getEntities();
		int[] array = actives.getData();
		for (int i = 0, s = actives.size(); s > i; i++) {
			flyweightEntity.id = array[i];
			if (flyweightEntity.getId() != e.getId() && collisionSystem.overlaps(flyweightEntity, e)) {
				return true;
			}
		}
		return false;
	}

	@Override
	protected void processSystem() {
	}
}

package net.mostlyoriginal.game.system.drag;

import com.artemis.Aspect;
import com.artemis.Entity;
import com.artemis.EntitySystem;
import com.artemis.World;
import com.artemis.annotations.Wire;
import com.artemis.utils.IntBag;
import net.mostlyoriginal.api.system.physics.CollisionSystem;
import net.mostlyoriginal.game.component.Conveyer;
import net.mostlyoriginal.game.component.Draggable;

/**
 * @author Daan van Yperen
 */
@Wire
public class GridOverlapHelperSystem extends EntitySystem {

	CollisionSystem collisionSystem;
	private Entity flyweightEntity;

	public GridOverlapHelperSystem() {
		super(Aspect.one(Draggable.class, Conveyer.class));
	}

	@Override
	protected void setWorld(World world) {
		super.setWorld(world);
		flyweightEntity = createFlyweightEntity();
	}

	/**
	 * Does passed entity overlap any grid entity? (except self)
	 */
	public boolean overlaps(Entity e) {
		IntBag actives = subscription.getEntities();
		int[] array = actives.getData();
		for (int i = 0, s = actives.size(); s > i; i++) {
			flyweightEntity.id = array[i];
			if (flyweightEntity.getId() != e.getId() && collisionSystem.overlaps(flyweightEntity, e)) {
				return true;
			}
		}
		return false;
	}

	@Override
	protected void processSystem() {
	}
}

Fix draggability on top of other conveyers.


package org.realityforge.replicant.client;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static org.realityforge.braincheck.Guards.*;

/**
 * A basic EntityLocator implementation that allows explicit per-type registration
 */
public class AggregateEntityLocator
  implements EntityLocator
{
  private final ArrayList<EntityLocator> _entityLocators = new ArrayList<>();

  protected final <T> void registerEntityLocator( @Nonnull final EntityLocator entityLocator )
  {
    apiInvariant( () -> !_entityLocators.contains( entityLocator ),
                  () -> "Attempting to register entityLocator " + entityLocator + " when already present." );
    _entityLocators.add( entityLocator );
  }

  /**
   * {@inheritDoc}
   */
  @Nullable
  @Override
  public final <T> T findByID( @Nonnull final Class<T> type, @Nonnull final Object id )
  {
    for ( final EntityLocator entityLocator : _entityLocators )
    {
      final T entity = entityLocator.findByID( type, id );
      if ( null != entity )
      {
        return entity;
      }
    }
    return null;
  }

  /**
   * {@inheritDoc}
   */
  @Nonnull
  @Override
  public <T> List<T> findAll( @Nonnull final Class<T> type )
  {
    final ArrayList<T> results = new ArrayList<>();
    for ( final EntityLocator entityLocator : _entityLocators )
    {
      results.addAll( entityLocator.findAll( type ) );
    }
    return results;
  }
}

package org.realityforge.replicant.client;

import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static org.realityforge.braincheck.Guards.*;

/**
 * A basic EntityLocator implementation that allows explicit per-type registration
 */
public class AggregateEntityLocator
  implements EntityLocator
{
  private final ArrayList<EntityLocator> _entityLocators = new ArrayList<>();

  public AggregateEntityLocator( @Nonnull final EntityLocator... entityLocator )
  {
    for ( final EntityLocator locator : entityLocator )
    {
      registerEntityLocator( locator );
    }
  }

  protected final <T> void registerEntityLocator( @Nonnull final EntityLocator entityLocator )
  {
    apiInvariant( () -> !_entityLocators.contains( entityLocator ),
                  () -> "Attempting to register entityLocator " + entityLocator + " when already present." );
    _entityLocators.add( entityLocator );
  }

  /**
   * {@inheritDoc}
   */
  @Nullable
  @Override
  public final <T> T findByID( @Nonnull final Class<T> type, @Nonnull final Object id )
  {
    for ( final EntityLocator entityLocator : _entityLocators )
    {
      final T entity = entityLocator.findByID( type, id );
      if ( null != entity )
      {
        return entity;
      }
    }
    return null;
  }

  /**
   * {@inheritDoc}
   */
  @Nonnull
  @Override
  public <T> List<T> findAll( @Nonnull final Class<T> type )
  {
    final ArrayList<T> results = new ArrayList<>();
    for ( final EntityLocator entityLocator : _entityLocators )
    {
      results.addAll( entityLocator.findAll( type ) );
    }
    return results;
  }
}

Make it possible to register the locators via the constructor


// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.druid.model.metadata;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

import io.druid.timeline.partition.NoneShardSpec;

/**
 * Defines a mix-in that is used to deserialize shard spec from json.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
        @JsonSubTypes.Type(value = NumberedShardSpec.class, name = "hashed"),
        @JsonSubTypes.Type(value = NoneShardSpec.class, name = "none")
})
public abstract class ShardSpecMixIn { }

// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.druid.model.metadata;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

import io.druid.timeline.partition.NoneShardSpec;

/**
 * Defines a mix-in that is used to deserialize shard spec from json.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonSubTypes({
        @JsonSubTypes.Type(value = NumberedShardSpec.class, name = "hashed"),
        @JsonSubTypes.Type(value = NumberedShardSpec.class, name = "linear"),
        @JsonSubTypes.Type(value = NoneShardSpec.class, name = "none")
})
public abstract class ShardSpecMixIn { }

Add support for linear ShardSpecs


package org.verapdf.model.impl.pb.external;

import org.apache.pdfbox.pdmodel.common.PDStream;
import org.verapdf.model.external.FontProgram;

/**
 * @author Timur Kamalov
 */
public class PBoxFontProgram extends PBoxExternal implements FontProgram {

	public static final String FONT_PROGRAM_TYPE = "FontProgram";

	private PDStream fontProgram;

	//for validating widths array in simple fonts
	private Long firstChar;
	private Long lastChar;
	private Long widthSize;

	public PBoxFontProgram(PDStream fontProgram) {
		super();
		setType(FONT_PROGRAM_TYPE);
		this.fontProgram = fontProgram;
	}

	public PBoxFontProgram(PDStream fontProgram, Long firstChar, Long lastChar, Long widthSize) {
		this(fontProgram);
		this.firstChar = firstChar;
		this.lastChar = lastChar;
		this.widthSize = widthSize;
	}

	@Override
	public Boolean getareReferencedGlyphsPresent() {
		return null;
	}

	@Override
	public Boolean getareWidthsConsistent() {
		return null;
	}

}

package org.verapdf.model.impl.pb.external;

import org.apache.pdfbox.pdmodel.common.PDStream;
import org.verapdf.model.external.FontProgram;

/**
 * @author Timur Kamalov
 */
public class PBoxFontProgram extends PBoxExternal implements FontProgram {

	public static final String FONT_PROGRAM_TYPE = "FontProgram";

	private PDStream fontProgram;

	//for validating widths array in simple fonts
	private Long firstChar;
	private Long lastChar;
	private Long widthSize;

	public PBoxFontProgram(PDStream fontProgram) {
		super();
		setType(FONT_PROGRAM_TYPE);
		this.fontProgram = fontProgram;
	}

	public PBoxFontProgram(PDStream fontProgram, Long firstChar, Long lastChar, Long widthSize) {
		this(fontProgram);
		this.firstChar = firstChar;
		this.lastChar = lastChar;
		this.widthSize = widthSize;
	}

}

Fix for recent changes in the model (just removed two methods).


/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package org.jsimpledb.parse.expr;

import com.google.common.base.Preconditions;

import org.jsimpledb.parse.ParseSession;

/**
 * {@link Value} that represents a {@link ParseSession} variable.
 *
 * @see ParseSession#getVars
 */
public class VarValue extends AbstractLValue {

    private final String name;

    /**
     * Constructor.
     *
     * @param name variable name
     * @throws IllegalArgumentException if name is null
     * @throws IllegalArgumentException if name is not a valid Java identifier
     */
    public VarValue(String name) {
        new AbstractNamed(name) { };                                // validates the name
        this.name = name;
    }

    /**
     * Get the variable name.
     *
     * @return variable name
     */
    public String getName() {
        return this.name;
    }

    @Override
    public Object get(ParseSession session) {
        final Value value = session.getVars().get(this.name);
        if (value == null)
            throw new EvalException("variable `" + name + "' is not defined");
        return value.get(session);
    }

    @Override
    public Class<?> getType(ParseSession session) {
        final Value value = session.getVars().get(this.name);
        return value != null ? value.getType(session) : Object.class;
    }

    @Override
    public void set(ParseSession session, Value value) {
        Preconditions.checkArgument(value != null, "null value");
        session.getVars().put(this.name, value);
    }
}

/*
 * Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
 */

package org.jsimpledb.parse.expr;

import com.google.common.base.Preconditions;

import org.jsimpledb.parse.ParseSession;

/**
 * {@link Value} that represents a {@link ParseSession} variable.
 *
 * @see ParseSession#getVars
 */
public class VarValue extends AbstractLValue {

    private final String name;

    /**
     * Constructor.
     *
     * @param name variable name
     * @throws IllegalArgumentException if name is null
     * @throws IllegalArgumentException if name is not a valid Java identifier
     */
    public VarValue(String name) {
        new AbstractNamed(name) { };                                // validates the name
        this.name = name;
    }

    /**
     * Get the variable name.
     *
     * @return variable name
     */
    public String getName() {
        return this.name;
    }

    @Override
    public Object get(ParseSession session) {
        final Value value = session.getVars().get(this.name);
        if (value == null)
            throw new EvalException("variable `" + name + "' is not defined");
        return MethodUtil.refresh(value.get(session));
    }

    @Override
    public Class<?> getType(ParseSession session) {
        final Value value = session.getVars().get(this.name);
        return value != null ? value.getType(session) : Object.class;
    }

    @Override
    public void set(ParseSession session, Value value) {
        Preconditions.checkArgument(value != null, "null value");
        session.getVars().put(this.name, value);
    }
}

Refresh retrieved CLI session variables.


// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
@PublicApi // TODO: Revoke this on Vespa 8.
package com.yahoo.vespa.curator;
import com.yahoo.api.annotations.PublicApi;
import com.yahoo.osgi.annotation.ExportPackage;

// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
@ExportPackage
package com.yahoo.vespa.curator;
import com.yahoo.osgi.annotation.ExportPackage;

Revoke package c.y.vespa.curator from PublicApi


/*
 * Copyright 2015 Marek Kaput
 *
 * 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.rustidea.psi.types;

import org.rustidea.stubs.types.*;

public interface RsStubElementTypes {
    RsLifetimeElementType LIFETIME = RsLifetimeElementType.INSTANCE;
    RsTypeParameterElementType TYPE_PARAMETER = RsTypeParameterElementType.INSTANCE;
    RsLifetimeTypeParameterElementType LIFETIME_TYPE_PARAMETER = RsLifetimeTypeParameterElementType.INSTANCE;
    RsTypeParameterListElementType TYPE_PARAMETER_LIST = RsTypeParameterListElementType.INSTANCE;
    RsWhereClauseElementType WHERE_CLAUSE = RsWhereClauseElementType.INSTANCE;
    RsPathElementType PATH = RsPathElementType.INSTANCE;
    RsPathComponentElementType PATH_COMPONENT = RsPathComponentElementType.INSTANCE;
    RsDocElementType DOC = RsDocElementType.INSTANCE;
    RsAttributeElementType ATTRIBUTE = RsAttributeElementType.INSTANCE;
    RsAttributeItemElementType ATTRIBUTE_ITEM = RsAttributeItemElementType.INSTANCE;
    RsAttributeItemListElementType ATTRIBUTE_ITEM_LIST = RsAttributeItemListElementType.INSTANCE;
}

/*
 * Copyright 2015 Marek Kaput
 *
 * 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.rustidea.psi.types;

import org.rustidea.stubs.types.*;

public interface RsStubElementTypes {
    RsAttributeElementType ATTRIBUTE = RsAttributeElementType.INSTANCE;
    RsAttributeItemElementType ATTRIBUTE_ITEM = RsAttributeItemElementType.INSTANCE;
    RsAttributeItemListElementType ATTRIBUTE_ITEM_LIST = RsAttributeItemListElementType.INSTANCE;
    RsDocElementType DOC = RsDocElementType.INSTANCE;
    RsLifetimeElementType LIFETIME = RsLifetimeElementType.INSTANCE;
    RsLifetimeTypeParameterElementType LIFETIME_TYPE_PARAMETER = RsLifetimeTypeParameterElementType.INSTANCE;
    RsPathComponentElementType PATH_COMPONENT = RsPathComponentElementType.INSTANCE;
    RsPathElementType PATH = RsPathElementType.INSTANCE;
    RsTypeParameterElementType TYPE_PARAMETER = RsTypeParameterElementType.INSTANCE;
    RsTypeParameterListElementType TYPE_PARAMETER_LIST = RsTypeParameterListElementType.INSTANCE;
    RsWhereClauseElementType WHERE_CLAUSE = RsWhereClauseElementType.INSTANCE;
}

Sort stub element type definitions


package com.example.inverse;

import arez.annotations.ArezComponent;
import arez.annotations.Inverse;
import arez.annotations.Observable;
import arez.annotations.Reference;
import arez.annotations.ReferenceId;
import java.util.Collection;

public class MissingInverseOnReferenceModel
{
  @ArezComponent
  static abstract class Wheel
  {
    @Reference
    abstract Car getCar();

    @ReferenceId
    @Observable
    abstract int getCarId();

    abstract void setCarId( int carId );
  }

  @ArezComponent
  static abstract class Car
  {
    @Inverse
    abstract Collection<Wheel> getWheels();
  }
}

package com.example.inverse;

import arez.annotations.ArezComponent;
import arez.annotations.Inverse;
import arez.annotations.Observable;
import arez.annotations.Reference;
import arez.annotations.ReferenceId;
import java.util.Collection;

public class MissingInverseOnReferenceModel
{
  @ArezComponent
  static abstract class Car
  {
    @Inverse
    abstract Collection<Wheel> getWheels();
  }

  @ArezComponent
  static abstract class Wheel
  {
    @Reference
    abstract Car getCar();

    @ReferenceId
    @Observable
    abstract int getCarId();

    abstract void setCarId( int carId );
  }
}

Reorder classes to ensure compiler operates in correct order


package org.develnext.jphp.core.tokenizer.token.expr.operator;

import php.runtime.common.Association;
import org.develnext.jphp.core.tokenizer.TokenType;
import org.develnext.jphp.core.tokenizer.TokenMeta;
import org.develnext.jphp.core.tokenizer.token.Token;
import org.develnext.jphp.core.tokenizer.token.expr.ExprToken;
import org.develnext.jphp.core.tokenizer.token.expr.OperatorExprToken;
import org.develnext.jphp.core.tokenizer.token.stmt.ExprStmtToken;

public class LogicOperatorExprToken extends OperatorExprToken {

    private ExprStmtToken rightValue;

    @Override
    public Association getAssociation() {
        return Association.LEFT;
    }

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

    public LogicOperatorExprToken(TokenMeta meta, TokenType type) {
        super(meta, type);
    }

    public ExprStmtToken getRightValue() {
        return rightValue;
    }

    public void setRightValue(ExprStmtToken rightValue) {
        this.rightValue = rightValue;
    }

    @Override
    public Token getLast() {
        Token token = rightValue.getLast();
        if (token instanceof ExprToken)
            return ((ExprToken) token).getLast();

        return token;
    }
}

package org.develnext.jphp.core.tokenizer.token.expr.operator;

import php.runtime.common.Association;
import org.develnext.jphp.core.tokenizer.TokenType;
import org.develnext.jphp.core.tokenizer.TokenMeta;
import org.develnext.jphp.core.tokenizer.token.Token;
import org.develnext.jphp.core.tokenizer.token.expr.ExprToken;
import org.develnext.jphp.core.tokenizer.token.expr.OperatorExprToken;
import org.develnext.jphp.core.tokenizer.token.stmt.ExprStmtToken;

public class LogicOperatorExprToken extends OperatorExprToken {

    private ExprStmtToken rightValue;

    @Override
    public Association getAssociation() {
        return Association.LEFT;
    }

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

    public LogicOperatorExprToken(TokenMeta meta, TokenType type) {
        super(meta, type);
    }

    public ExprStmtToken getRightValue() {
        return rightValue;
    }

    public void setRightValue(ExprStmtToken rightValue) {
        this.rightValue = rightValue;
    }

    @Override
    public Token getLast() {
        if (rightValue == null) {
            return null;
        }

        Token token = rightValue.getLast();

        if (token instanceof ExprToken)
            return ((ExprToken) token).getLast();

        return token;
    }
}

Fix npe in syntax analyzer in logic operators.


package beaform.gui.search.tree;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 * A listener that activates on double clicks.
 *
 * @author Steven Post
 *
 */
public class DoubleClickListener extends MouseAdapter {

	private final FormulaTree formulaTree;

	/**
	 * @param formulaTree
	 */
	DoubleClickListener(FormulaTree formulaTree) {
		this.formulaTree = formulaTree;
	}

	/** The number of clicks to register a double click on the mouse */
	private static final int DOUBLE_CLICK = 2;

	/**
	 * This method fires when the mouse is clicked,
	 * but only does something on double click events.
	 *
	 * @param event The event passed to this method when clicks are seen.
	 */
	@Override
	public void mousePressed(final MouseEvent event) {
		if(event.getClickCount() == DOUBLE_CLICK) {
			this.formulaTree.editSelectedFormula();
		}
	}
}

Add newline at the end of a file


package org.jboss.webbeans.tck;

import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.List;

import javax.inject.manager.Manager;

import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.spi.StandaloneContainers;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.mock.MockBootstrap;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;

public class StandaloneContainersImpl implements StandaloneContainers
{

   public Manager deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Class<?>... classes) throws DeploymentException
   {
      try
      {
         MockBootstrap bootstrap = new MockBootstrap();
         ManagerImpl manager = bootstrap.getManager();
         if (enabledDeploymentTypes != null)
         {
            manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
         }
         MockWebBeanDiscovery discovery = new MockWebBeanDiscovery();
         discovery.setWebBeanClasses(Arrays.asList(classes));
         bootstrap.setWebBeanDiscovery(discovery);
         bootstrap.boot();
         return manager;
      }
      catch (Exception e)
      {
         throw new DeploymentException("Error deploying beans", e);
      }
   }

   public Manager deploy(java.lang.Class<?>... classes) throws DeploymentException
   {
      return deploy(null, classes);
   }

}

package org.jboss.webbeans.tck;

import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.List;

import org.jboss.jsr299.tck.api.DeploymentException;
import org.jboss.jsr299.tck.spi.StandaloneContainers;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.mock.MockBootstrap;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;

public class StandaloneContainersImpl implements StandaloneContainers
{

   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes) throws DeploymentException
   {
      deploy(enabledDeploymentTypes, classes, null);
   }

   public void deploy(List<Class<? extends Annotation>> enabledDeploymentTypes, Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
   {
      try
      {
         MockBootstrap bootstrap = new MockBootstrap();
         ManagerImpl manager = bootstrap.getManager();
         if (enabledDeploymentTypes != null)
         {
            manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
         }
         MockWebBeanDiscovery discovery = new MockWebBeanDiscovery();
         discovery.setWebBeanClasses(classes);
         if (beansXml != null)
         {
            discovery.setWebBeansXmlFiles(beansXml);
         }
         bootstrap.setWebBeanDiscovery(discovery);
         bootstrap.boot();
      }
      catch (Exception e)
      {
         throw new DeploymentException("Error deploying beans", e);
      }
   }

   public void deploy(Iterable<Class<?>> classes) throws DeploymentException
   {
      deploy(null, classes, null);
   }

   public void deploy(Iterable<Class<?>> classes, Iterable<URL> beansXml) throws DeploymentException
   {
      deploy(null, classes, beansXml);
   }

}

Support for reading deployment types from beans.xml


/*
 * (C) YANDEX LLC, 2014-2015
 *
 * The Source Code called "YoctoDB" available at
 * https://bitbucket.org/yandex/yoctodb is subject to the terms of the
 * Mozilla Public License, v. 2.0 (hereinafter referred to as the "License").
 *
 * A copy of the License is also available at http://mozilla.org/MPL/2.0/.
 */

package com.yandex.yoctodb.query.simple;

import com.yandex.yoctodb.query.Condition;
import com.yandex.yoctodb.query.QueryContext;
import com.yandex.yoctodb.query.TermCondition;
import com.yandex.yoctodb.util.mutable.BitSet;
import net.jcip.annotations.Immutable;
import org.jetbrains.annotations.NotNull;

/**
 * Condition negation
 *
 * @author incubos
 */
@Immutable
public final class SimpleNotCondition implements Condition {
    @NotNull
    private final TermCondition delegate;

    public SimpleNotCondition(
            @NotNull
            final TermCondition delegate) {
        this.delegate = delegate;
    }

    @Override
    public boolean set(
            @NotNull
            final QueryContext ctx,
            @NotNull
            final BitSet to) {
        delegate.set(ctx, to);
        return to.inverse();
    }
}

/*
 * (C) YANDEX LLC, 2014-2015
 *
 * The Source Code called "YoctoDB" available at
 * https://bitbucket.org/yandex/yoctodb is subject to the terms of the
 * Mozilla Public License, v. 2.0 (hereinafter referred to as the "License").
 *
 * A copy of the License is also available at http://mozilla.org/MPL/2.0/.
 */

package com.yandex.yoctodb.query.simple;

import com.yandex.yoctodb.query.Condition;
import com.yandex.yoctodb.query.QueryContext;
import com.yandex.yoctodb.util.mutable.BitSet;
import net.jcip.annotations.Immutable;
import org.jetbrains.annotations.NotNull;

/**
 * Condition negation
 *
 * @author incubos
 */
@Immutable
public final class SimpleNotCondition implements Condition {
    @NotNull
    private final Condition delegate;

    public SimpleNotCondition(
            @NotNull
            final Condition delegate) {
        this.delegate = delegate;
    }

    @Override
    public boolean set(
            @NotNull
            final QueryContext ctx,
            @NotNull
            final BitSet to) {
        delegate.set(ctx, to);
        return to.inverse();
    }
}

Allow to use not with general conditions


import java.util.Random;

public class LockContention {
    static Random randomGen = new Random();
    static int NTHREAD = 100;

    static public void main(String args[]) {
        Runnable task = () -> {
            for (int i = 0; i < 10000000; i++)
                randomGen.nextInt(1000);
        };

        Thread threads[] = new Thread[NTHREAD];
        for (int i = 0; i < NTHREAD; i++) {
            threads[i] = new Thread(task);
            threads[i].start();
        }
        try {
            for (Thread t : threads)
                t.join();
        } catch (InterruptedException e) {
            System.err.println("Interrupted: " + e);
        }
    }
}

import java.util.Random;

public class LockContention {
    static Random randomGen = new Random();
    static int NTHREAD = 7;
    static Object lock = new Object();
    static int counter = 0;

    static public void main(String args[]) {
        Runnable task = () -> {
            for (int i = 0; i < 100000; i++)
                synchronized (lock) {
                    try {
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                        System.err.println("Interrupted sleep: " + e);
                    }
                    counter++;
                }
        };

        Thread threads[] = new Thread[NTHREAD];
        for (int i = 0; i < NTHREAD; i++) {
            threads[i] = new Thread(task);
            threads[i].start();
        }
        try {
            for (Thread t : threads)
                t.join();
        } catch (InterruptedException e) {
            System.err.println("Interrupted join: " + e);
        }
    }
}

Use sleep rather than Random