package com.intellij.sh.codeStyle;

import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CustomCodeStyleSettings;

public class ShCodeStyleSettings extends CustomCodeStyleSettings {
  public boolean BINARY_OPS_START_LINE = false;
  public boolean SWITCH_CASES_INDENTED = false;
  public boolean REDIRECT_FOLLOWED_BY_SPACE = false;
  public boolean KEEP_COLUMN_ALIGNMENT_PADDING = false;
  public boolean MINIFY_PROGRAM = false;
  public String SHFMT_PATH = "";

  public ShCodeStyleSettings(CodeStyleSettings container) {
    super("Shell Script", container);
  }
}

package com.intellij.sh.codeStyle;

import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CustomCodeStyleSettings;

public class ShCodeStyleSettings extends CustomCodeStyleSettings {
  public boolean BINARY_OPS_START_LINE = false;
  public boolean SWITCH_CASES_INDENTED = false;
  public boolean REDIRECT_FOLLOWED_BY_SPACE = false;
  public boolean KEEP_COLUMN_ALIGNMENT_PADDING = false;
  public boolean MINIFY_PROGRAM = false;
  public String SHFMT_PATH = "";

  public ShCodeStyleSettings(CodeStyleSettings container) {
    super("Shell_Script", container);
  }
}

Fix problem with saving code style settings in XML


package com.atlassian.pageobjects.binder;

/**
 * Parent exception for all binding exceptions
 */
public class PageBindingException extends RuntimeException
{
    private final Object pageObject;

    public PageBindingException(String message, Object pageObject)
    {
        this(message, pageObject, null);
    }

    public PageBindingException(String message, Object pageObject, Throwable cause)
    {
        super(message, cause);
        this.pageObject = pageObject;
    }

    public PageBindingException(Object pageObject, Throwable cause)
    {
        super(cause);
        this.pageObject = pageObject;
    }

    public Object getPageObject()
    {
        return pageObject;
    }
}

package com.atlassian.pageobjects.binder;

/**
 * Parent exception for all binding exceptions
 */
public class PageBindingException extends RuntimeException
{
    private final Object pageObject;

    public PageBindingException(String message, Object pageObject)
    {
        this(message, pageObject, null);
    }

    public PageBindingException(String message, Object pageObject, Throwable cause)
    {
        super(message, cause);
        this.pageObject = pageObject;
    }

    public PageBindingException(Object pageObject, Throwable cause)
    {
        super(String.format("[PageObject:%s]", pageObject), cause);
        this.pageObject = pageObject;
    }

    public Object getPageObject()
    {
        return pageObject;
    }
}

Include PageObject type in PageBinder exception message


package com.tisawesomeness.minecord.command.utility;

import com.tisawesomeness.minecord.command.Command;

import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

public class CodesCommand extends Command {

	public CommandInfo getInfo() {
		return new CommandInfo(
			"codes",
			"Lists the available chat codes.",
			null,
			new String[]{
				"code",
				"chat",
				"color",
				"colors"},
			10000,
			false,
			false,
			true
		);
	}

	public Result run(String[] args, MessageReceivedEvent e) {

		String m = "**Chat Codes:**" +
				"\n" + "Copy-Paste symbol: " +
				"\n" + "MOTD code: \\u00A7" +
				"\n" + "Most servers with plugins let you use & instead of  in chat and config files." +
				"\n" + "http://i.imgur.com/MWCFs5S.png" +
				"\n" + "http://i.imgur.com/cWYjhkN.png";
		return new Result(Outcome.SUCCESS, m);

	}

}

package com.tisawesomeness.minecord.command.utility;

import com.tisawesomeness.minecord.command.Command;

import net.dv8tion.jda.core.events.message.MessageReceivedEvent;

public class CodesCommand extends Command {

	public CommandInfo getInfo() {
		return new CommandInfo(
			"codes",
			"Lists the available chat codes.",
			null,
			new String[]{
				"code",
				"chat",
				"color",
				"colors"},
			10000,
			false,
			false,
			true
		);
	}

	public Result run(String[] args, MessageReceivedEvent e) {

		String m = "**Chat Codes:**" +
				"\n" + "Copy-Paste symbol: ``" +
				"\n" + "MOTD code: `\\u00A7`" +
				"\n" + "Most servers with plugins let you use `&` instead of `` in chat and config files." +
				"\n" + "http://i.imgur.com/MWCFs5S.png" +
				"\n" + "http://i.imgur.com/cWYjhkN.png";
		return new Result(Outcome.SUCCESS, m);

	}

}

Put symbols for &codes in code bocks


package com.jvm_bloggers.core.rss.fetchers;

import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.SyndFeedInput;

import javaslang.control.Option;

import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

import java.io.File;
import java.util.UUID;

@Component
@Slf4j
public class WgetFetcher implements Fetcher {

    @Override
    public Option<SyndFeed> fetch(String rssUrl) {
        String uid = UUID.randomUUID().toString();
        try {
            Process process = new ProcessBuilder("wget", rssUrl, "-O", "/tmp/" + uid).start();
            process.waitFor();
            File file = new File("/tmp/" + uid);
            Option<SyndFeed> feed = Option.of(new SyndFeedInput().build(file));
            file.delete();
            return feed;
        } catch (Exception exc) {
            log.warn("Exception during wget execution for url {}: {}", rssUrl, exc.getMessage());
            return Option.none();
        }
    }
}

package com.jvm_bloggers.core.rss.fetchers;

import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.SyndFeedInput;

import javaslang.control.Option;

import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;

import java.io.File;

@Component
@Slf4j
public class WgetFetcher implements Fetcher {

    @Override
    public Option<SyndFeed> fetch(String rssUrl) {
        File tempFile = null;
        try {
            tempFile = File.createTempFile("jvm-bloggers", null);
            String tmpPath = tempFile.getAbsolutePath();
            Process process = new ProcessBuilder("wget", rssUrl, "-O", tmpPath).start();
            process.waitFor();
            return Option.of(new SyndFeedInput().build(tempFile));
        } catch (Exception exc) {
            log.warn("Exception during wget execution for url {}: {}", rssUrl, exc.getMessage());
            return Option.none();
        } finally {
            if (tempFile != null) {
                tempFile.delete();
            }
        }
    }
}

Make wget use system dependent temp folder location


package com.xeiam.xchange.vircurex.service.polling;

import java.io.IOException;

import si.mazi.rescu.RestProxyFactory;

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.vircurex.Vircurex;
import com.xeiam.xchange.vircurex.dto.marketdata.VircurexDepth;

/**
 *

 * Implementation of the market data service for Vircurex
 *

 *

 *
Provides access to various market data values

 *

 */
public class VircurexMarketDataServiceRaw extends VircurexBasePollingService {

  private final Vircurex vircurex;

  /**
   * Constructor
   *
   * @param exchangeSpecification
   */
  public VircurexMarketDataServiceRaw(ExchangeSpecification exchangeSpecification) {

    super(exchangeSpecification);
    vircurex = RestProxyFactory.createProxy(Vircurex.class, exchangeSpecification.getSslUri());
  }

  public VircurexDepth getVircurexOrderBook(CurrencyPair currencyPair) throws IOException {

    VircurexDepth vircurexDepth = vircurex.getFullDepth(currencyPair.counterSymbol.toLowerCase(), currencyPair.counterSymbol.toLowerCase());

    return vircurexDepth;
  }

}

package com.xeiam.xchange.vircurex.service.polling;

import java.io.IOException;

import si.mazi.rescu.RestProxyFactory;

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.currency.CurrencyPair;
import com.xeiam.xchange.vircurex.Vircurex;
import com.xeiam.xchange.vircurex.dto.marketdata.VircurexDepth;

/**
 *

 * Implementation of the market data service for Vircurex
 *

 *

 *
Provides access to various market data values

 *

 */
public class VircurexMarketDataServiceRaw extends VircurexBasePollingService {

  private final Vircurex vircurex;

  /**
   * Constructor
   *
   * @param exchangeSpecification
   */
  public VircurexMarketDataServiceRaw(ExchangeSpecification exchangeSpecification) {

    super(exchangeSpecification);
    vircurex = RestProxyFactory.createProxy(Vircurex.class, exchangeSpecification.getSslUri());
  }

  //TODO: implement Ticker by combining get_last_trade, get_volume, get_highest_bid and get_lowest_ask APIs: https://vircurex.com/welcome/api?locale=en

  //TODO: implement Trades using trades API: https://vircurex.com/welcome/api?locale=en

  public VircurexDepth getVircurexOrderBook(CurrencyPair currencyPair) throws IOException {

    VircurexDepth vircurexDepth = vircurex.getFullDepth(currencyPair.baseSymbol.toLowerCase(), currencyPair.counterSymbol.toLowerCase());

    return vircurexDepth;
  }

}

Fix a bug in getFullDepth()


package net.mueller_martin.turirun.network;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

public class TurirunNetwork {
	public static final int tcpPort = 1337;
	public static final int udpPort = 7331;

	// This registers objects that are going to be sent over the network
	public static void register(EndPoint endPoint) {
		Kryo kryo = endPoint.getKryo();

		kryo.register(Register.class);
		kryo.register(Character.class);
		kryo.register(AddCharacter.class);
		kryo.register(RemoveCharacter.class);
		kryo.register(UpdateCharacter.class);
		kryo.register(MoveCharacter.class);
	}

	public static class Register {
		public String nick;
		public int type;
	}

	public static class Character {
		public String nick;
		public int type, id;
		public float x, y;
	};

	public static class AddCharacter {
		public Character character;
	}

	public static class RemoveCharacter {
		public int id;
	}

	public static class UpdateCharacter {
		public int id;
		public float x, y;
	}

	public static class MoveCharacter {
		public float x, y;
	}
}

package net.mueller_martin.turirun.network;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryonet.EndPoint;

public class TurirunNetwork {
	public static final int tcpPort = 1337;
	public static final int udpPort = 7331;

	// This registers objects that are going to be sent over the network
	public static void register(EndPoint endPoint) {
		Kryo kryo = endPoint.getKryo();

		kryo.register(Register.class);
		kryo.register(Character.class);
		kryo.register(AddCharacter.class);
		kryo.register(RemoveCharacter.class);
		kryo.register(UpdateCharacter.class);
		kryo.register(MoveCharacter.class);
	}

	public static class Register {
		public String nick;
		public int type;
	}

	public static class Character {
		public String nick;
		public int type, id, direction;
		public float x, y;
	};

	public static class AddCharacter {
		public Character character;
	}

	public static class RemoveCharacter {
		public int id;
	}

	public static class UpdateCharacter {
		public int id, direction;
		public float x, y;
	}

	public static class MoveCharacter {
		public float x, y, direction;
	}
}

Add direction to network objects


package com.spotify.logging.logback;

import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.fieldnames.LogstashFieldNames;

public class CustomLogstashEncoder extends LogstashEncoder {
  private final LogstashFieldNames logstashFieldNames = new LogstashFieldNames();

  {
    // These are fields we want ignored for all LogstashEncoders
    logstashFieldNames.setLevelValue("[ignore]");
    logstashFieldNames.setVersion("[ignore]");
  }

  public CustomLogstashEncoder() {
    super();
  }

  public CustomLogstashEncoder setupStackdriver() {
    // Setup fields according to https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
    logstashFieldNames.setTimestamp("timestamp");
    logstashFieldNames.setLevel("severity");
    this.setFieldNames(logstashFieldNames);
    return this;
  }

}

package com.spotify.logging.logback;

import net.logstash.logback.encoder.LogstashEncoder;
import net.logstash.logback.fieldnames.LogstashFieldNames;

public class CustomLogstashEncoder extends LogstashEncoder {
  private final LogstashFieldNames logstashFieldNames = new LogstashFieldNames();

  {
    // These are fields we want ignored for all LogstashEncoders
    logstashFieldNames.setLevelValue("[ignore]");
    logstashFieldNames.setVersion("[ignore]");
  }

  public CustomLogstashEncoder() {
    super();
  }

  public CustomLogstashEncoder setupStackdriver() {
    // Setup fields according to https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
    logstashFieldNames.setTimestamp("time");
    logstashFieldNames.setLevel("severity");
    this.setFieldNames(logstashFieldNames);
    return this;
  }

}

Change timestamp key to time to resolve issues with fluentd


package com.creatubbles.api.model.gallery;

import android.support.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Type;
import com.github.jasminb.jsonapi.models.EmptyRelationship;

@Type("gallery_howto_sections")
public class HowToSection extends EmptyRelationship {
    @Id
    private String id;

    @JsonProperty("title")
    private String title;

    @JsonProperty("content")
    private String content;

    @JsonProperty("image")
    private ChallengeImage image;

    @JsonCreator
    public HowToSection() {
    }

    public String getId() {
        return id;
    }

    @Nullable
    public String getTitle() {
        return title;
    }

    @Nullable
    public String getContent() {
        return content;
    }

    @Nullable
    public ChallengeImage getImage() {
        return image;
    }

    @Override
    public String toString() {
        return "HowToSection{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", image=" + image +
                '}';
    }
}

package com.creatubbles.api.model.gallery;

import android.support.annotation.Nullable;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.jasminb.jsonapi.annotations.Id;
import com.github.jasminb.jsonapi.annotations.Type;
import com.github.jasminb.jsonapi.models.EmptyRelationship;

@Type("gallery_howto_sections")
public class HowToSection extends EmptyRelationship {
    @Id
    private String id;

    @JsonProperty("title")
    private String title;

    @JsonProperty("content")
    private String content;

    @JsonProperty("image")
    private ChallengeImage image;

    @JsonProperty("video_480_url")
    private String video480Url;

    @JsonProperty("video_720_url")
    private String video720Url;

    @JsonCreator
    public HowToSection() {
    }

    public String getId() {
        return id;
    }

    @Nullable
    public String getTitle() {
        return title;
    }

    @Nullable
    public String getContent() {
        return content;
    }

    @Nullable
    public ChallengeImage getImage() {
        return image;
    }

    public String getVideo480Url() {
        return video480Url;
    }

    public String getVideo720Url() {
        return video720Url;
    }

    @Override
    public String toString() {
        return "HowToSection{" +
                "id='" + id + '\'' +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", image=" + image +
                ", video480Url='" + video480Url + '\'' +
                ", video720Url='" + video720Url + '\'' +
                '}';
    }
}

Add video url fields to challenge section


// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. 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.google.dart.compiler.parser;

import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;

public class ParserTests extends TestSetup {

  public ParserTests(TestSuite test) {
    super(test);
  }

  public static Test suite() {
    TestSuite suite = new TestSuite("Dart parser test suite.");

    suite.addTestSuite(SyntaxTest.class);
    suite.addTestSuite(DietParserTest.class);
    suite.addTestSuite(CPParserTest.class);
    suite.addTestSuite(ParserRoundTripTest.class);
    suite.addTestSuite(LibraryParserTest.class);
    suite.addTestSuite(NegativeParserTest.class);
    suite.addTestSuite(ValidatingSyntaxTest.class);
    suite.addTestSuite(CommentTest.class);
    suite.addTestSuite(ErrorMessageLocationTest.class);
    suite.addTestSuite(ParserEventsTest.class);
    suite.addTestSuite(TruncatedSourceParserTest.class);
    suite.addTestSuite(ParserRecoveryTest.class);
    return new ParserTests(suite);
  }
}

// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
// for details. 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.google.dart.compiler.parser;

import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestSuite;

public class ParserTests extends TestSetup {

  public ParserTests(TestSuite test) {
    super(test);
  }

  public static Test suite() {
    TestSuite suite = new TestSuite("Dart parser test suite.");

    suite.addTestSuite(SyntaxTest.class);
    //diet-parsing is used only for incremental compilation which is turned off
    //(and this test causes intermittent timeouts)
    //suite.addTestSuite(DietParserTest.class);
    suite.addTestSuite(CPParserTest.class);
    suite.addTestSuite(ParserRoundTripTest.class);
    suite.addTestSuite(LibraryParserTest.class);
    suite.addTestSuite(NegativeParserTest.class);
    suite.addTestSuite(ValidatingSyntaxTest.class);
    suite.addTestSuite(CommentTest.class);
    suite.addTestSuite(ErrorMessageLocationTest.class);
    suite.addTestSuite(ParserEventsTest.class);
    suite.addTestSuite(TruncatedSourceParserTest.class);
    suite.addTestSuite(ParserRecoveryTest.class);
    return new ParserTests(suite);
  }
}

Disable dartc diet parser test


package com.collective.celos;

import java.util.List;

/**
 * A scheduling strategy determines the order in which slots of a workflow are executed.
 *
 * Scheduling strategies are configured on a per-workflow basis.
 *
 * On each scheduler cycle, a workflow's scheduling strategy is asked
 * which workflow instances (slots) should be executed.
 *
 * As input for making this decision, the scheduling strategy receives
 * all slot states of the given workflow within the sliding window.
 */
public interface SchedulingStrategy {

    /**
     * Returns the slots that this strategy wishes to execute.
     *
     * Only slots in READY state should be returned.  Others will be ignored.
     *
     * @param states The states of all slots within sliding window for this workflow, with oldest ones first.
     * @return List of slots this strategy wishes to execute - the first in the list will be executed first.
     */
    public List<SlotID> getSchedulingCandidates(List<SlotState> states);

}

package com.collective.celos;

import java.util.List;

/**
 * A scheduling strategy determines the order in which slots of a workflow are executed.
 *
 * Scheduling strategies are configured on a per-workflow basis.
 *
 * On each scheduler cycle, a workflow's scheduling strategy is asked
 * which workflow instances (slots) should be executed.
 *
 * As input for making this decision, the scheduling strategy receives
 * all slot states of the given workflow within the sliding window.
 *
 * There's no guarantee that all slots returned by a strategy will be executed.
 */
public interface SchedulingStrategy {

    /**
     * Returns the slots that this strategy wishes to execute.
     *
     * Only slots in READY state should be returned.  Others will be ignored.
     *
     * @param states The states of all slots within sliding window for this workflow, with oldest ones first.
     * @return List of slots this strategy wishes to execute - the first in the list will be executed first.
     */
    public List<SlotID> getSchedulingCandidates(List<SlotState> states);

}

Document that not all slots a scheduling strategy returns are necessarily executed.


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// This file is a part of the 'esoco-business' project.
// Copyright 2017 Elmar Sonnenschein, esoco GmbH, Flensburg, Germany
//
// 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 de.esoco.process.ui.container;

import de.esoco.lib.property.Layout;

import de.esoco.process.ui.Container;
import de.esoco.process.ui.LayoutContainer;

/********************************************************************
 * A panel that layouts components on the four edges around it's center area.
 *
 * @author eso
 */
public class DockPanel extends LayoutContainer<DockPanel>
{
	//~ Constructors -----------------------------------------------------------

	/***************************************
	 * Creates a new instance.
	 *
	 * @param rParent The parent container
	 */
	public DockPanel(Container<?> rParent)
	{
		super(rParent, Layout.DOCK);
	}
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// This file is a part of the 'esoco-business' project.
// Copyright 2017 Elmar Sonnenschein, esoco GmbH, Flensburg, Germany
//
// 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 de.esoco.process.ui.container;

import de.esoco.lib.property.Layout;
import de.esoco.lib.property.Orientation;

import de.esoco.process.ui.Container;
import de.esoco.process.ui.LayoutContainer;

import static de.esoco.lib.property.StyleProperties.VERTICAL;

/********************************************************************
 * A panel that layouts components on the edges of it's center area.
 *
 * @author eso
 */
public class DockPanel extends LayoutContainer<DockPanel>
{
	//~ Constructors -----------------------------------------------------------

	/***************************************
	 * Creates a new instance.
	 *
	 * @param rParent      The parent container
	 * @param eOrientation bVertical TRUE for vertical orientation
	 */
	public DockPanel(Container<?> rParent, Orientation eOrientation)
	{
		super(rParent, Layout.DOCK);

		if (eOrientation == Orientation.VERTICAL)
		{
			set(VERTICAL);
		}
	}
}

Add classes for simplified building of process UIs


package org.cryptonit;

import javacard.framework.JCSystem;

public class IOBuffer {
    private FileIndex index = null;
    private byte [] buffer = null;

    private short [] shorts = null;
    final private byte SIZE = 0x0;
    final private byte PATH = 0x1;
    final private byte OFFSET = 0x2;

    private boolean [] bools = null;
    final private byte isLOADED = 0x0;
    final private byte isFILE   = 0x1;

    public IOBuffer(FileIndex index) {
        this.index = index;
        this.bools = JCSystem.makeTransientBooleanArray((short) 2, JCSystem.CLEAR_ON_DESELECT);
        this.buffer = JCSystem.makeTransientByteArray((short)256, JCSystem.CLEAR_ON_DESELECT);
        this.shorts = JCSystem.makeTransientShortArray((short)3, JCSystem.CLEAR_ON_DESELECT);
    }

    public void sendBuffer(byte[] buf, short length, APDU apdu) {
        short le = apdu.setOutgoing();

        if(le == 0) {
            le = apdu.getOutBlockSize();
        }

        apdu.setOutgoingLength(le);
        apdu.sendBytesLong(buf, (short) 0, le);
    }
}

package org.cryptonit;

import javacard.framework.JCSystem;

public class IOBuffer {
    private FileIndex index = null;
    private byte [] buffer = null;

    private short [] shorts = null;
    final private byte SIZE = 0x0;
    final private byte PATH = 0x1;
    final private byte OFFSET = 0x2;

    private boolean [] bools = null;
    final private byte isLOADED = 0x0;
    final private byte isFILE   = 0x1;

    public IOBuffer(FileIndex index) {
        this.index = index;
        this.bools = JCSystem.makeTransientBooleanArray((short) 2, JCSystem.CLEAR_ON_DESELECT);
        this.buffer = JCSystem.makeTransientByteArray((short)256, JCSystem.CLEAR_ON_DESELECT);
        this.shorts = JCSystem.makeTransientShortArray((short)3, JCSystem.CLEAR_ON_DESELECT);
    }

    public void sendBuffer(byte[] buf, short length, APDU apdu) {
        short le = apdu.setOutgoing();

        if(le == 0) {
            le = apdu.getOutBlockSize();
        }

        if(le < length) {
            short l = (short) (length - le);
            Util.arrayCopy(buf, (short) le, this.buffer, (short) 0, l);
            this.bools[isLOADED] = true;
            this.bools[isFILE] = false;
        }

        apdu.setOutgoingLength(le);
        apdu.sendBytesLong(buf, (short) 0, le);
    }
}

Load data that doesn’t fit in outgoing APDU into buffer


package org.jdcoffre.mlc.desktop.cellar;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.layout.GridPane;
import org.jdcoffre.mlc.desktop.Controller;
import org.jdcoffre.mlc.lib.MLCExecption;

public class CellarPane extends GridPane implements EventHandler<ActionEvent> {

    private final Controller controller;

    public CellarPane(final Controller controller){
        super();

        this.controller = controller;

        setAlignment(Pos.CENTER);
        setHgap(10);
        setVgap(10);
        setPadding(new Insets(25, 25, 25, 25));

        add(new ErrorMessageArea(), 0,0, 2, 1);

        add(new CellarLabel(), 0,1);
        add(new CellarField(), 1, 1);
        add(new AddCellarButton(this), 2, 1);
    }

    @Override
    public void handle(ActionEvent event) {
        try {
            CellarField cellarField = (CellarField) lookup("#" + CellarField.ID);
            controller.addCellar(cellarField.getText());
        } catch (MLCExecption mlcExecption) {
            ErrorMessageArea errorMessage = (ErrorMessageArea) lookup("#" + ErrorMessageArea.ID);
            errorMessage.setText(mlcExecption.getMessage());
        }
    }
}

package org.jdcoffre.mlc.desktop.cellar;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.layout.GridPane;
import org.jdcoffre.mlc.desktop.Controller;
import org.jdcoffre.mlc.lib.MLCExecption;

public class CellarPane extends GridPane implements EventHandler<ActionEvent> {

    private final Controller controller;

    public CellarPane(final Controller controller){
        super();

        this.controller = controller;

        setPadding(new Insets(10, 10, 10, 10));
        add(new ErrorMessageArea(), 0, 0);

        GridPane fieldsArea  = new GridPane();
        fieldsArea.setHgap(10);
        fieldsArea.setVgap(10);
        fieldsArea.setPadding(new Insets(10, 10, 10, 10));
        fieldsArea.add(new CellarLabel(), 0,0);
        fieldsArea.add(new CellarField(), 1, 0);
        fieldsArea. add(new AddCellarButton(this), 2, 0);
        add(fieldsArea, 0, 1);
    }

    @Override
    public void handle(ActionEvent event) {
        ErrorMessageArea errorMessage = (ErrorMessageArea) lookup("#" + ErrorMessageArea.ID);
        errorMessage.setText("");
        try {
            CellarField cellarField = (CellarField) lookup("#" + CellarField.ID);
            controller.addCellar(cellarField.getText());
        } catch (MLCExecption mlcExecption) {
            errorMessage.setText(mlcExecption.getMessage());
        }
    }
}

Make sure error message disappear on button click


package com.nulabinc.backlog4j.api.option;

import com.nulabinc.backlog4j.http.NameValuePair;

/**
 * Parameters for get watch API.
 *
 * @author nulab-inc
 */
public class GetWatchesParams extends GetParams {

    public GetWatchesParams alreadyRead(boolean alreadyRead) {
        parameters.add(new NameValuePair("alreadyRead", String.valueOf(alreadyRead)));
        return this;
    }

}

package com.nulabinc.backlog4j.api.option;

import com.nulabinc.backlog4j.http.NameValuePair;

/**
 * Parameters for get watch API.
 *
 * @author nulab-inc
 */
public class GetWatchesParams extends GetParams {

    public GetWatchesParams alreadyRead(boolean alreadyRead) {
        parameters.add(new NameValuePair("alreadyRead", String.valueOf(alreadyRead)));
        return this;
    }

    public GetWatchesParams resourceAlreadyRead(boolean resourceAlreadyRead) {
        parameters.add(new NameValuePair("resourceAlreadyRead", String.valueOf(resourceAlreadyRead)));
        return this;
    }

}

Fix watch count api client.


/*
 * Copyright (c) 2015-2016, Index Data
 * All rights reserved.
 * See the file LICENSE for details.
 */
package okapi;

import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;

public class MainCluster {
  public static void main(String[] args) {
    VertxOptions vopt = new VertxOptions();

    Vertx.clusteredVertx(vopt, res->{
      if ( res.succeeded() ) {
        DeploymentOptions opt = new DeploymentOptions();
        res.result().deployVerticle(MainVerticle.class.getName(), opt);
      } else {
        System.out.println("Failed to create a clustered vert.x");
      }
    });

  }
}

/*
 * Copyright (c) 2015-2016, Index Data
 * All rights reserved.
 * See the file LICENSE for details.
 */
package okapi;

import com.hazelcast.config.Config;
import io.vertx.core.DeploymentOptions;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.spi.cluster.ClusterManager;
import io.vertx.spi.cluster.hazelcast.HazelcastClusterManager;

public class MainCluster {
  public static void main(String[] args) {
    System.setProperty("vertx.logger-delegate-factory-class-name", "io.vertx.core.logging.SLF4JLogDelegateFactory");
    Config hazelcastConfig = new Config();
    hazelcastConfig.setProperty("hazelcast.logging.type", "slf4j");
    ClusterManager mgr = new HazelcastClusterManager(hazelcastConfig);
    VertxOptions vopt = new VertxOptions().setClusterManager(mgr);
    Vertx.clusteredVertx(vopt, res->{
      if ( res.succeeded() ) {
        DeploymentOptions opt = new DeploymentOptions();
        res.result().deployVerticle(MainVerticle.class.getName(), opt);
      } else {
        System.out.println("Failed to create a clustered vert.x");
      }
    });

  }
}

Configure vertx/hazelcast to use SLF4J


package com.tterrag.blurbg;

import java.util.Map;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

public class BlurBGPlugin implements IFMLLoadingPlugin {

    @Override
    public String[] getASMTransformerClass() {
        return new String[] { "com.tterrag.blurbg.BlurBGTransformer" };
    }

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

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

    @Override
    public void injectData(Map<String, Object> data) {
    }

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

package com.tterrag.blurbg;

import java.util.Map;

import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

@IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE)
public class BlurBGPlugin implements IFMLLoadingPlugin {

    @Override
    public String[] getASMTransformerClass() {
        return new String[] { "com.tterrag.blurbg.BlurBGTransformer" };
    }

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

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

    @Override
    public void injectData(Map<String, Object> data) {
    }

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

Fix transformer getting pre-deobf names


/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Mohammed Sazid-Al-Rashid
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mohammedsazid.android.launsz;

import android.widget.ImageView;
import android.widget.TextView;

/**
 * Created by sazid on 7/14/2015.
 */
public class AppsViewHolder {

    ImageView appIcon;
    TextView appLabel;
//    TextView appName;

}

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Mohammed Sazid-Al-Rashid
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mohammedsazid.android.launsz;

import android.widget.ImageView;
import android.widget.TextView;

/**
 * Created by sazid on 7/14/2015.
 */
public static class AppsViewHolder {

    ImageView appIcon;
    TextView appLabel;
//    TextView appName;

}

Make the ViewHolder a static class


package org.fxmisc.richtext;

import javafx.css.CssMetaData;
import javafx.css.StyleConverter;
import javafx.css.Styleable;
import javafx.css.StyleableObjectProperty;
import javafx.css.StyleableProperty;

import java.util.function.Function;

public class CustomCssMetaData<S extends Styleable, V> extends CssMetaData<S, V> {

    private final Function<S, StyleableObjectProperty<V>> property;

    CustomCssMetaData(String property, StyleConverter<?, V> converter, V initialValue,
                      Function<S, StyleableObjectProperty<V>> getStyleableProperty) {
        super(property, converter, initialValue);
        this.property = getStyleableProperty;
    }

    @Override
    public boolean isSettable(S styleable) {
        return property.apply(styleable).isBound();
    }

    @Override
    public StyleableProperty<V> getStyleableProperty(S styleable) {
        return property.apply(styleable);
    }

}

package org.fxmisc.richtext;

import javafx.css.CssMetaData;
import javafx.css.StyleConverter;
import javafx.css.Styleable;
import javafx.css.StyleableObjectProperty;
import javafx.css.StyleableProperty;

import java.util.function.Function;

public class CustomCssMetaData<S extends Styleable, V> extends CssMetaData<S, V> {

    private final Function<S, StyleableObjectProperty<V>> property;

    CustomCssMetaData(String property, StyleConverter<?, V> converter, V initialValue,
                      Function<S, StyleableObjectProperty<V>> getStyleableProperty) {
        super(property, converter, initialValue);
        this.property = getStyleableProperty;
    }

    @Override
    public boolean isSettable(S styleable) {
        return !property.apply(styleable).isBound();
    }

    @Override
    public StyleableProperty<V> getStyleableProperty(S styleable) {
        return property.apply(styleable);
    }

}

Fix regression due to typo


package com.example.nasaproject;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MainActivity extends Activity {

	private TextView title;
	private TextView date;
	private ImageView image;
	private TextView description;
	private Button buttonRefresh;
	private Button buttonSetWallpaper;

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

    }

    private void initializeUI(){

    	title = (TextView) findViewById(R.id.imageTitle);
    	date = (TextView) findViewById(R.id.imageDate);
    	image = (ImageView) findViewById(R.id.imageDisplay);
    	description = (TextView) findViewById(R.id.imageDesc);
    	buttonRefresh = (Button) findViewById(R.id.button_refresh);
    	buttonSetWallpaper = (Button) findViewById(R.id.button_setAsWallpaper);
    }

}

package com.example.nasaproject;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity {

	private TextView title;
	private TextView date;
	private ImageView image;
	private TextView description;
	private Button buttonRefresh;
	private Button buttonSetWallpaper;

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

        initializeUI();

        initilizeOnClickListener();

    }

    private void initilizeOnClickListener() {
    	buttonRefresh.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Toast.makeText(MainActivity.this, "Refresh Button Is Pressed ", Toast.LENGTH_LONG).show();
			}
		});
    	buttonSetWallpaper.setOnClickListener(new  OnClickListener() {

			@Override
			public void onClick(View v) {
				Toast.makeText(MainActivity.this, "SetAsWallpaper Button Is Pressed ", Toast.LENGTH_LONG).show();
			}
		});

	}

	private void initializeUI(){

    	title = (TextView) findViewById(R.id.imageTitle);
    	date = (TextView) findViewById(R.id.imageDate);
    	image = (ImageView) findViewById(R.id.imageDisplay);
    	description = (TextView) findViewById(R.id.imageDesc);
    	buttonRefresh = (Button) findViewById(R.id.button_refresh);
    	buttonSetWallpaper = (Button) findViewById(R.id.button_setAsWallpaper);
    }

}

Set onClickListener on both buttons


package org.jctools.queues;

import static org.jctools.util.UnsafeRefArrayAccess.REF_ARRAY_BASE;
import static org.jctools.util.UnsafeRefArrayAccess.REF_ELEMENT_SHIFT;

/**
 * This is used for method substitution in the LinkedArray classes code generation.
 */
final class LinkedArrayQueueUtil
{
    static int length(Object[] buf)
    {
        return buf.length;
    }

    /**
     * This method assumes index is actually (index << 1) because lower bit is
     * used for resize. This is compensated for by reducing the element shift.
     * The computation is constant folded, so there's no cost.
     */
    static long modifiedCalcCircularRefElementOffset(long index, long mask)
    {
        return REF_ARRAY_BASE + ((index & mask) << (REF_ELEMENT_SHIFT - 1));
    }

    static long nextArrayOffset(Object[] curr)
    {
        return REF_ARRAY_BASE + ((long) (length(curr) - 1) << REF_ELEMENT_SHIFT);
    }
}

package org.jctools.queues;

import org.jctools.util.InternalAPI;

import static org.jctools.util.UnsafeRefArrayAccess.REF_ARRAY_BASE;
import static org.jctools.util.UnsafeRefArrayAccess.REF_ELEMENT_SHIFT;

/**
 * This is used for method substitution in the LinkedArray classes code generation.
 */
@InternalAPI
final class LinkedArrayQueueUtil
{
    static int length(Object[] buf)
    {
        return buf.length;
    }

    /**
     * This method assumes index is actually (index << 1) because lower bit is
     * used for resize. This is compensated for by reducing the element shift.
     * The computation is constant folded, so there's no cost.
     */
    static long modifiedCalcCircularRefElementOffset(long index, long mask)
    {
        return REF_ARRAY_BASE + ((index & mask) << (REF_ELEMENT_SHIFT - 1));
    }

    static long nextArrayOffset(Object[] curr)
    {
        return REF_ARRAY_BASE + ((long) (length(curr) - 1) << REF_ELEMENT_SHIFT);
    }
}

Mark util class as internal API


package org.perl6.nqp.sixmodel.reprs;

import com.sun.jna.Function;

import org.perl6.nqp.sixmodel.SixModelObject;

public class NativeCallInstance extends SixModelObject {
    /* Constants. Might be more idiomatic Java to move these to an enum. */
    public static final byte ARG_VOID      = 0;
    public static final byte ARG_CHAR      = 2;
    public static final byte ARG_SHORT     = 4;
    public static final byte ARG_INT       = 6;
    public static final byte ARG_LONG      = 8;
    public static final byte ARG_LONGLONG  = 10;
    public static final byte ARG_FLOAT     = 12;
    public static final byte ARG_DOUBLE    = 14;
    public static final byte ARG_ASCIISTR  = 16;
    public static final byte ARG_UTF8STR   = 18;
    public static final byte ARG_UTF16STR  = 20;
    public static final byte ARG_CSTRUCT   = 22;
    public static final byte ARG_CARRAY    = 24;
    public static final byte ARG_CALLBACK  = 26;
    public static final byte ARG_CPOINTER  = 28;
    public static final byte ARG_TYPE_MASK = 30;

    /* Flag for whether we should free a string after passing it or not. These
     * are going away once the array handling is refactored.*/
    public static final byte ARG_NO_FREE_STR   = 0;
    public static final byte ARG_FREE_STR      = 1;
    public static final byte ARG_FREE_STR_MASK = 1;

    public Function entry_point;
}

package org.perl6.nqp.sixmodel.reprs;

import com.sun.jna.Function;

import org.perl6.nqp.sixmodel.SixModelObject;

public class NativeCallInstance extends SixModelObject {
    /* Flag for whether we should free a string after passing it or not. These
     * are going away once the array handling is refactored.*/
    public static final byte ARG_NO_FREE_STR   = 0;
    public static final byte ARG_FREE_STR      = 1;
    public static final byte ARG_FREE_STR_MASK = 1;

    public Function entry_point;
    public ArgType[]   arg_types;
    public ArgType     ret_type;

    public enum ArgType {
        VOID,
        CHAR,
        SHORT,
        INT,
        LONG,
        LONGLONG,
        FLOAT,
        DOUBLE,
        ASCIISTR,
        UTF8STR,
        UTF16STR,
        CSTRUCT,
        CARRAY,
        CALLBACK,
        CPOINTER;
    }
}

Move constants to enum from static final byte FOO.


package com.liferay.lms.upgrade;

import java.io.IOException;
import java.sql.SQLException;
import com.liferay.portal.kernel.dao.db.DB;
import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.upgrade.UpgradeProcess;

public class UpgradeVersion_4_2_0 extends UpgradeProcess {
	private static Log log = LogFactoryUtil.getLog(UpgradeVersion_4_2_0.class);

	public int getThreshold() {
		return 420;
	}

	protected void doUpgrade() throws Exception {
		log.info("Actualizando version a 4.1.0");

		String updateCourseResult = "ALTER TABLE `lms_courseresult` ADD COLUMN `registrationDate` DATETIME NULL AFTER `passed`;";

		DB db = DBFactoryUtil.getDB();
		log.info("Alter table lms_courseresult -->> Add registrationDate");
		try {
			db.runSQL(updateCourseResult);
		} catch (IOException | SQLException e) {
			e.printStackTrace();
		}
	}

}

package com.liferay.lms.upgrade;

import java.io.IOException;
import java.sql.SQLException;
import com.liferay.portal.kernel.dao.db.DB;
import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.upgrade.UpgradeProcess;

public class UpgradeVersion_4_2_0 extends UpgradeProcess {
	private static Log log = LogFactoryUtil.getLog(UpgradeVersion_4_2_0.class);

	public int getThreshold() {
		return 420;
	}

	protected void doUpgrade() throws Exception {
		log.info("Actualizando version a 4.2.0");

		DB db = DBFactoryUtil.getDB();

		String updateCourseResult = "ALTER TABLE `lms_courseresult` ADD COLUMN `registrationDate` DATETIME NULL AFTER `passed`, "
				+ "ADD COLUMN `companyId` BIGINT(20) NULL AFTER `extraData`, "
				+ "ADD COLUMN `userModifiedId` BIGINT(20) NULL AFTER `companyId`;";

		log.info("Alter table lms_courseresult -->> Add companyId, userModifiedId");
		try {
			db.runSQL(updateCourseResult);
		} catch (IOException | SQLException e) {
			e.printStackTrace();
		}
	}

}

Upgrade para columnas en tabla courseresult


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

public enum WandAction {
    NONE, CAST, TOGGLE, CYCLE, CYCLE_REVERSE, CYCLE_HOTBAR, CYCLE_HOTBAR_REVERSE, REPLACE,

    CYCLE_ACTIVE_HOTBAR, CYCLE_ACTIVE_HOTBAR_REVERSE,

    ALT_CAST, ALT_CAST2, ALT_CAST3, ALT_CAST4, ALT_CAST5, ALT_CAST6, ALT_CAST7,

    CANCEL
}

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

public enum WandAction {
    NONE, CAST, TOGGLE, CYCLE, CYCLE_REVERSE, CYCLE_HOTBAR, CYCLE_HOTBAR_REVERSE, REPLACE,

    CYCLE_BRUSH, CYCLE_BRUSH_REVERSE,

    CYCLE_ACTIVE_HOTBAR, CYCLE_ACTIVE_HOTBAR_REVERSE,

    ALT_CAST, ALT_CAST2, ALT_CAST3, ALT_CAST4, ALT_CAST5, ALT_CAST6, ALT_CAST7,

    CANCEL
}

Add separate wand actions for cycling brushes


package org.realityforge.ssf;

import java.io.Serializable;
import javax.annotation.Nonnull;

public final class SimpleSessionInfo
  implements SessionInfo, Serializable
{
  private final String _sessionID;
  private final String _username;
  private long _createdAt;
  private long _lastAccessedAt;

  public SimpleSessionInfo( @Nonnull final String sessionID, @Nonnull final String username )
  {
    _sessionID = sessionID;
    _username = username;
    _createdAt = _lastAccessedAt = System.currentTimeMillis();
  }

  @Nonnull
  public String getSessionID()
  {
    return _sessionID;
  }

  @Nonnull
  public String getUsername()
  {
    return _username;
  }

  public long getCreatedAt()
  {
    return _createdAt;
  }

  public long getLastAccessedAt()
  {
    return _lastAccessedAt;
  }

  public void updateAccessTime()
  {
    _lastAccessedAt = System.currentTimeMillis();
  }
}

package org.realityforge.ssf;

import java.io.Serializable;
import javax.annotation.Nonnull;

public class SimpleSessionInfo
  implements SessionInfo, Serializable
{
  private final String _sessionID;
  private final String _username;
  private long _createdAt;
  private long _lastAccessedAt;

  public SimpleSessionInfo( @Nonnull final String sessionID, @Nonnull final String username )
  {
    _sessionID = sessionID;
    _username = username;
    _createdAt = _lastAccessedAt = System.currentTimeMillis();
  }

  @Nonnull
  public String getSessionID()
  {
    return _sessionID;
  }

  @Nonnull
  public String getUsername()
  {
    return _username;
  }

  public long getCreatedAt()
  {
    return _createdAt;
  }

  public long getLastAccessedAt()
  {
    return _lastAccessedAt;
  }

  public void updateAccessTime()
  {
    _lastAccessedAt = System.currentTimeMillis();
  }
}

Make sure class is not finalized


package org.jboss.as.console.client.util;

import com.gwtplatform.mvp.client.proxy.PlaceRequest;

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

/**
 * @author Heiko Braun
 * @date 2/17/11
 */
public class Places {

    public static List<PlaceRequest> fromString(String urlString)
    {
        List<PlaceRequest> places = new ArrayList<PlaceRequest>();

        // TODO: Tis is currently limited to a a parent/child hierarchy with depth 1
        if(urlString.contains("/"))
        {
            String[] parentChild = urlString.split("/");

            String parent = parentChild[0];
            places.add(new PlaceRequest(parent));

            String child = parentChild[1];
            if(child.contains(";"))
            {
                String[] split = child.split(";");
                String childPlace = split[0];
                String params[] = split[1].split("=");

                places.add(new PlaceRequest(childPlace).with(params[0], params[1]));
            }
            else
            {
                places.add(new PlaceRequest(child));
            }
        }

        return places;
    }
}

package org.jboss.as.console.client.util;

import com.allen_sauer.gwt.log.client.Log;
import com.gwtplatform.mvp.client.proxy.PlaceRequest;

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

/**
 * @author Heiko Braun
 * @date 2/17/11
 */
public class Places {

    public static List<PlaceRequest> fromString(String urlString)
    {
        List<PlaceRequest> places = null;
        try {
            places = new ArrayList<PlaceRequest>();

            StringTokenizer tokenizer = new StringTokenizer(urlString, "/");
            while(tokenizer.hasMoreTokens())
            {
                parseSingleToken(places, tokenizer.nextToken());
            }

        } catch (Throwable e) {
            Log.error("Error parsing token: " + urlString);
        }

        return places;
    }

    private static void parseSingleToken(List<PlaceRequest> places, String token) {

        if(token.contains(";")) // parametrized?
        {
            StringTokenizer params = new StringTokenizer(token, ";");
            PlaceRequest request = null;
            while(params.hasMoreTokens())
            {
                String tok = params.nextToken();
                if(tok.contains("="))
                {
                    if(null==request) break;

                    // parameter
                    String[] parameter = tok.split("=");
                    request = request.with(parameter[0], parameter[1]);
                }
                else
                {
                    // address
                    request = new PlaceRequest(tok);

                }
            }

            // exit, either wrong token or different formatter
            if(null==request)
                throw new IllegalArgumentException("Illegal token: "+token);

            places.add(request);
        }
        else
        {
            places.add(new PlaceRequest(token));
        }
    }
}

Fix token to place request parsing: allow hierarchy depths > 2


package com.vtence.molecule;

import org.junit.Test;

import java.io.IOException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

public class BodyPartTest {

    @Test
    public void decodesTextContentAccordingToContentTypeCharset() throws IOException {
        String originalText = "Les naïfs ægithales hâtifs pondant à Noël où il gèle...";

        BodyPart part = new BodyPart().contentType("text/plain; charset=utf-16").content(originalText);

        assertThat("decoded text", part.content(), equalTo(originalText));
    }

    @Test
    public void defaultsToUTF8DecodingWhenNoContentTypeIsSpecified() throws IOException {
        String originalText = "sont sûrs d'être déçus...";

        BodyPart part = new BodyPart().content(originalText);

        assertThat("decoded text", part.content(), equalTo(originalText));
    }

    @Test
    public void defaultsToUTF8DecodingWhenNoCharsetIsSpecified() throws IOException {
        String originalText = "en voyant leurs drôles d'oeufs abîmés.";

        BodyPart part = new BodyPart().contentType("text/plain").content(originalText);

        assertThat("decoded text", part.content(), equalTo(originalText));
    }
}

package com.vtence.molecule;

import org.junit.Test;

import java.io.IOException;

import static com.vtence.molecule.helpers.Charsets.UTF_16;
import static com.vtence.molecule.helpers.Charsets.UTF_8;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

public class BodyPartTest {

    @Test
    public void decodesTextContentAccordingToContentTypeCharset() throws IOException {
        String originalText = "Les naïfs ægithales hâtifs pondant à Noël où il gèle...";

        BodyPart part = new BodyPart().contentType("text/plain; charset=utf-16").content(originalText.getBytes(UTF_16));

        assertThat("decoded text", part.content(), equalTo(originalText));
    }

    @Test
    public void defaultsToUTF8DecodingWhenNoContentTypeIsSpecified() throws IOException {
        String originalText = "sont sûrs d'être déçus...";

        BodyPart part = new BodyPart().content(originalText.getBytes(UTF_8));

        assertThat("decoded text", part.content(), equalTo(originalText));
    }

    @Test
    public void defaultsToUTF8DecodingWhenNoCharsetIsSpecified() throws IOException {
        String originalText = "en voyant leurs drôles d'oeufs abîmés.";

        BodyPart part = new BodyPart().contentType("text/plain").content(originalText.getBytes(UTF_8));

        assertThat("decoded text", part.content(), equalTo(originalText));
    }
}

Make sure our body part test actually proves we're using the right encoding


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

import java.util.function.Supplier;

import org.mybatis.dynamic.sql.SqlColumn;

public class ValueMapping<T> extends AbstractColumnMapping implements UpdateMapping {

    private Supplier<T> valueSupplier;

    private ValueMapping(SqlColumn<T> column) {
        super(column);
    }

    public T value() {
        return valueSupplier.get();
    }

    @Override
    public <R> R accept(UpdateMappingVisitor<R> visitor) {
        return visitor.visit(this);
    }

    public static <T> ValueMapping<T> of(SqlColumn<T> column, Supplier<T> valueSupplier) {
        ValueMapping<T> mapping = new ValueMapping<>(column);
        mapping.valueSupplier = valueSupplier;
        return mapping;
    }
}

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

import java.util.function.Supplier;

import org.mybatis.dynamic.sql.SqlColumn;

public class ValueMapping<T> extends AbstractColumnMapping implements UpdateMapping {

    private Supplier<T> valueSupplier;

    private ValueMapping(SqlColumn<T> column, Supplier<T> valueSupplier) {
        super(column);
        this.valueSupplier = valueSupplier;
    }

    public T value() {
        return valueSupplier.get();
    }

    @Override
    public <R> R accept(UpdateMappingVisitor<R> visitor) {
        return visitor.visit(this);
    }

    public static <T> ValueMapping<T> of(SqlColumn<T> column, Supplier<T> valueSupplier) {
        ValueMapping<T> mapping = new ValueMapping<>(column, valueSupplier);
        return mapping;
    }
}

Fix a little spot bugs problem


package util.logging;

import java.io.File;
import java.io.FilenameFilter;

public abstract class LogSummaryGenerator {
    public String getLogSummary(String matchId) {
        final String thePrefix = matchId;
        File logsDirectory = new File("logs");
        FilenameFilter logsFilter = new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.startsWith(thePrefix);
            }
        };
        String[] theMatchingMatches = logsDirectory.list(logsFilter);
        if (theMatchingMatches.length > 1) {
            System.err.println("Log summary retrieval for " + matchId + " matched multiple matches.");
        } else if (theMatchingMatches.length == 0) {
            System.err.println("Log summary retrieval for " + matchId + " matched zero matches.");
        } else {
            return getSummaryFromLogsDirectory(theMatchingMatches[0]);
        }
        return null;
    }

    public abstract String getSummaryFromLogsDirectory(String theLogsDirectory);
}

package util.logging;

import java.io.File;
import java.io.FilenameFilter;

public abstract class LogSummaryGenerator {
    public String getLogSummary(String matchId) {
        final String thePrefix = matchId;
        File logsDirectory = new File("logs");
        FilenameFilter logsFilter = new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.startsWith(thePrefix);
            }
        };
        String[] theMatchingMatches = logsDirectory.list(logsFilter);
        if (theMatchingMatches.length > 1) {
            System.err.println("Log summary retrieval for " + matchId + " matched multiple matches.");
        } else if (theMatchingMatches.length == 0) {
            System.err.println("Log summary retrieval for " + matchId + " matched zero matches.");
        } else {
            return getSummaryFromLogsDirectory(logsDirectory + "/" + theMatchingMatches[0]);
        }
        return null;
    }

    public abstract String getSummaryFromLogsDirectory(String theLogsDirectory);
}

Fix a bug in the way the log summary generator fits together paths.


package main;

class BitManipulator {
    static int insertBitsToPosition(int n, int m, int i, int j) {
        int left = ~0 << j;
        int right = (1 << i-1) - 1;
        int mask = left | right;
        int nCleared = n & mask;
        int mShifted = m << i-1;
        return nCleared | mShifted;
    }
}

package main;

class BitManipulator {
    static int insertBitsToPosition(int n, int m, int i, int j) {
        return (n & ((~0 << j) | ((1 << i-1) - 1))) | (m << i-1);
    }
}

Refactor solution for 5.1 to 1-line transofrmation function. Note: it takes less space but almost unreadable for human.


package net.wayward_realms.waywardchat;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class ReplyCommand implements CommandExecutor {

    private WaywardChat plugin;

    public ReplyCommand(WaywardChat plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            if (plugin.getLastPrivateMessage((Player) sender) != null) {
                if (args.length >= 1) {
                    StringBuilder message = new StringBuilder();
                    for (int i = 1; i < args.length; i++) {
                        message.append(args[i]).append(" ");
                    }
                    plugin.sendPrivateMessage((Player) sender, plugin.getLastPrivateMessage((Player) sender), message.toString());
                } else {
                    sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must specify a message to reply with");
                }
            } else {
                sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You have not recieved a private message recently (or the last group you recieved a message from was disbanded)");
            }
        } else {
            sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must be a player to perform this command.");
        }
        return true;
    }

}

package net.wayward_realms.waywardchat;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class ReplyCommand implements CommandExecutor {

    private WaywardChat plugin;

    public ReplyCommand(WaywardChat plugin) {
        this.plugin = plugin;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (sender instanceof Player) {
            if (plugin.getLastPrivateMessage((Player) sender) != null) {
                if (args.length >= 1) {
                    StringBuilder message = new StringBuilder();
                    for (String arg : args) {
                        message.append(arg).append(" ");
                    }
                    plugin.sendPrivateMessage((Player) sender, plugin.getLastPrivateMessage((Player) sender), message.toString());
                } else {
                    sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must specify a message to reply with");
                }
            } else {
                sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You have not recieved a private message recently (or the last group you recieved a message from was disbanded)");
            }
        } else {
            sender.sendMessage(plugin.getPrefix() + ChatColor.RED + "You must be a player to perform this command.");
        }
        return true;
    }

}

Add missing first word to replied messages


package org.clafer.choco.constraint;

import org.chocosolver.solver.constraints.Constraint;
import org.chocosolver.solver.variables.IntVar;
import org.clafer.choco.constraint.ConstraintQuickTest.Check;
import org.clafer.choco.constraint.propagator.PropElementArraySupport;
import org.clafer.test.NonEmpty;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 *
 * @author jimmy
 */
@RunWith(ConstraintQuickTest.class)
public class ElementArraySupportTest {

    @Check
    public void check(int value, int[] array, int index, int offset, int support) {
        assertTrue(index + offset >= 0);
        assertTrue(index + offset < array.length);
        assertTrue(array[index + offset] == value || array[index + offset] == support);
    }

    @ArcConsistent
    @Test(timeout = 60000)
    public Constraint setup(IntVar value, @NonEmpty IntVar[] array, IntVar index, int offset, int support) {
        return new Constraint("ElementArraySupport", new PropElementArraySupport(value, array, index, offset, support));
    }
}

package org.clafer.choco.constraint;

import org.chocosolver.solver.Model;
import org.chocosolver.solver.constraints.Constraint;
import org.chocosolver.solver.variables.IntVar;
import static org.clafer.choco.constraint.ConstraintQuickTest.$;
import org.clafer.choco.constraint.ConstraintQuickTest.Check;
import org.clafer.choco.constraint.ConstraintQuickTest.Input;
import org.clafer.choco.constraint.propagator.PropElementArraySupport;
import org.clafer.test.NonEmpty;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 *
 * @author jimmy
 */
@RunWith(ConstraintQuickTest.class)
public class ElementArraySupportTest {

    @Input(solutions = 224)
    public Object testElementArraySupport(Model model) {
        return $(model.intVar("value", 0, 3), model.intVarArray("array", 3, 0, 3),
                model.intVar("index", -1, 0), 1, 0);
    }

    @Check
    public void check(int value, int[] array, int index, int offset, int support) {
        assertTrue(index + offset >= 0);
        assertTrue(index + offset < array.length);
        assertTrue(array[index + offset] == value || array[index + offset] == support);
    }

    @ArcConsistent
    @Test(timeout = 60000)
    public Constraint setup(IntVar value, @NonEmpty IntVar[] array, IntVar index, int offset, int support) {
        return new Constraint("ElementArraySupport", new PropElementArraySupport(value, array, index, offset, support));
    }
}

Add a test case for test element array support constraint.


package seedu.address.logic.commands;

import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.Messages;
import seedu.address.commons.events.ui.JumpToListRequestEvent;
import seedu.address.model.activity.ReadOnlyActivity;
import seedu.address.commons.core.UnmodifiableObservableList;

/**
 * Selects a person identified using it's last displayed index from the address book.
 */
public class SelectCommand extends Command {

    public final int targetIndex;

    public static final String COMMAND_WORD = "select";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Selects the person identified by the index number used in the last person listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_SELECT_PERSON_SUCCESS = "Selected Person: %1$s";

    public SelectCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }

    @Override
    public CommandResult execute() {

        UnmodifiableObservableList<ReadOnlyActivity> lastShownList = model.getFilteredTaskList();

        if (lastShownList.size() < targetIndex) {
            indicateAttemptToExecuteIncorrectCommand();
            return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);
        }

        EventsCenter.getInstance().post(new JumpToListRequestEvent(targetIndex - 1));
        return new CommandResult(String.format(MESSAGE_SELECT_PERSON_SUCCESS, targetIndex));

    }

}

package seedu.address.logic.commands;

import seedu.address.commons.core.EventsCenter;
import seedu.address.commons.core.Messages;
import seedu.address.commons.events.ui.JumpToListRequestEvent;
import seedu.address.model.activity.ReadOnlyActivity;
import seedu.address.commons.core.UnmodifiableObservableList;

/**
 * Selects a person identified using it's last displayed index from the address book.
 */
public class SelectCommand extends Command {

    public final int targetIndex;

    public static final String COMMAND_WORD = "select";

    public static final String MESSAGE_USAGE = COMMAND_WORD
            + ": Selects the person identified by the index number used in the last person listing.\n"
            + "Parameters: INDEX (must be a positive integer)\n"
            + "Example: " + COMMAND_WORD + " 1";

    public static final String MESSAGE_SELECT_PERSON_SUCCESS = "Selected Task: %1$s";

    public SelectCommand(int targetIndex) {
        this.targetIndex = targetIndex;
    }

    @Override
    public CommandResult execute() {

        UnmodifiableObservableList<ReadOnlyActivity> lastShownList = model.getFilteredTaskList();

        if (lastShownList.size() < targetIndex) {
            indicateAttemptToExecuteIncorrectCommand();
            return new CommandResult(Messages.MESSAGE_INVALID_TASK_DISPLAYED_INDEX);
        }

        EventsCenter.getInstance().post(new JumpToListRequestEvent(targetIndex - 1));
        return new CommandResult(String.format(MESSAGE_SELECT_PERSON_SUCCESS, targetIndex));

    }

}

Fix failing test for select


package io.fourfinanceit.featuros.deployment;

import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.time.Instant;

@Entity
class Deployment implements Identifiable<Long> {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String product;

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

    private String version;

    private Instant date;

    /**
     * @deprecated persistence only
     */
    @Deprecated
    private Deployment() {
    }

    public Deployment(String name, String product, String group, String version, Instant date) {
        this.name = name;
        this.product = product;
        this.group = group;
        this.version = version;
        this.date = date;
    }

    @Override
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getProduct() {
        return product;
    }

    public String getGroup() {
        return group;
    }

    public String getVersion() {
        return version;
    }

    public Instant getDate() {
        return date;
    }
}

package io.fourfinanceit.featuros.deployment;

import com.fasterxml.jackson.annotation.JsonRootName;
import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import java.time.Instant;

@JsonRootName("deployment")
@Entity
class Deployment implements Identifiable<Long> {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String product;

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

    private String version;

    private Instant date;

    /**
     * @deprecated persistence only
     */
    @Deprecated
    private Deployment() {
    }

    public Deployment(String name, String product, String group, String version, Instant date) {
        this.name = name;
        this.product = product;
        this.group = group;
        this.version = version;
        this.date = date;
    }

    @Override
    public Long getId() {
        return id;
    }

    public String getName() {
        return name;
    }

    public String getProduct() {
        return product;
    }

    public String getGroup() {
        return group;
    }

    public String getVersion() {
        return version;
    }

    public Instant getDate() {
        return date;
    }
}

Add 'deployment' name for json root


package io.fabric8.app.gerrit;

import io.fabric8.kubernetes.generator.annotation.KubernetesModelProcessor;
import io.fabric8.openshift.api.model.template.TemplateBuilder;

@KubernetesModelProcessor
public class GerritModelProcessor {

    public void onList(TemplateBuilder builder) {
        builder.addNewServiceObject()
                .withNewMetadata()
                  .withName("gerrit-http-service")
                  .addToLabels("component", "gerrit")
                  .addToLabels("provider", "fabric8")
                .endMetadata()
                .withNewSpec()
                  .addNewPort()
                    .withProtocol("http")
                    .withPort(80)
                      .withNewTargetPort(8080)
                    .endPort()
                    .addToSelector("component", "gerrit")
                    .addToSelector("provider", "fabric8")
                .endSpec()
                .endServiceObject()
                // Second service
                .addNewServiceObject()
                .withNewMetadata()
                  .withName("gerrit-ssh-service")
                  .addToLabels("component", "gerrit")
                  .addToLabels("provider", "fabric8")
                .endMetadata()
                .withNewSpec()
                  .addNewPort()
                    .withProtocol("ssh")
                    .withPort(29418)
                      .withNewTargetPort(29418)
                    .endPort()
                    .addToSelector("component", "gerrit")
                    .addToSelector("provider", "fabric8")
                .endSpec()
                .endServiceObject()
                .build();
    }
}

package io.fabric8.app.gerrit;

import io.fabric8.kubernetes.generator.annotation.KubernetesModelProcessor;
import io.fabric8.openshift.api.model.template.TemplateBuilder;

@KubernetesModelProcessor
public class GerritModelProcessor {

    public void onList(TemplateBuilder builder) {
        builder.addNewServiceObject()
                .withNewMetadata()
                  .withName("gerrit-http-service")
                  .addToLabels("component", "gerrit")
                  .addToLabels("provider", "fabric8")
                .endMetadata()
                .withNewSpec()
                  .addNewPort()
/*                    .withProtocol("HTTP")*/
                    .withPort(80)
                      .withNewTargetPort(8080)
                    .endPort()
                    .addToSelector("component", "gerrit")
                    .addToSelector("provider", "fabric8")
                .endSpec()
                .endServiceObject()
                // Second service
                .addNewServiceObject()
                .withNewMetadata()
                  .withName("gerrit-ssh-service")
                  .addToLabels("component", "gerrit")
                  .addToLabels("provider", "fabric8")
                .endMetadata()
                .withNewSpec()
                  .addNewPort()
/*                    .withProtocol("SSH")*/
                    .withPort(29418)
                      .withNewTargetPort(29418)
                    .endPort()
                    .addToSelector("component", "gerrit")
                    .addToSelector("provider", "fabric8")
                .endSpec()
                .endServiceObject()
                .build();
    }
}

Comment line with protocol to avoid this error javax.ws.rs.WebApplicationException: HTTP 422 Service 'gerrit-http-service' is invalid: spec.ports[0].protocol: unsupported value 'HTTP'


/*
 * Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
 */
package org.cakesolutions.hello.impl;

import org.cakesolutions.hello.api.HelloService;
import org.cakesolutions.hello.api.KGreetingMessage;
import org.junit.Test;

import static com.lightbend.lagom.javadsl.testkit.ServiceTest.defaultSetup;
import static com.lightbend.lagom.javadsl.testkit.ServiceTest.withServer;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;

public class HelloServiceTest {

  @Test
  public void shouldStorePersonalizedGreeting() throws Exception {
    withServer(defaultSetup().withCassandra(true), server -> {
      HelloService service = server.client(HelloService.class);

      String msg1 = service.hello("Alice").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hello, Alice!", msg1); // default greeting

      service.useGreeting("Alice").invoke(new KGreetingMessage("Hi")).toCompletableFuture().get(5, SECONDS);
      String msg2 = service.hello("Alice").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hi, Alice!", msg2);

      String msg3 = service.hello("Bob").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hello, Bob!", msg3); // default greeting
    });
  }

}

/*
 * Copyright (C) 2016-2017 Lightbend Inc. <https://www.lightbend.com>
 */
package org.cakesolutions.hello.impl;

import org.cakesolutions.hello.api.HelloService;
import org.cakesolutions.hello.api.KGreetingMessage;
import org.junit.Test;

import static com.lightbend.lagom.javadsl.testkit.ServiceTest.defaultSetup;
import static com.lightbend.lagom.javadsl.testkit.ServiceTest.withServer;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.Assert.assertEquals;

public class HelloServiceTest {

  @Test
  public void shouldStorePersonalizedGreeting() throws Exception {
    withServer(defaultSetup().withCassandra(true), server -> {
      HelloService service = server.client(HelloService.class);

      String msg1 = service.hello("Alice").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hello, Alice", msg1); // default greeting

      service.useGreeting("Alice").invoke(new KGreetingMessage("Hi")).toCompletableFuture().get(5, SECONDS);
      String msg2 = service.hello("Alice").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hi, Alice", msg2);

      String msg3 = service.hello("Bob").invoke().toCompletableFuture().get(5, SECONDS);
      assertEquals("Hello, Bob", msg3); // default greeting
    });
  }

}

Remove "!" from test since it is not sent by a service


package org.usfirst.frc.team1360.robot;

/**
 * The RobotMap is a mapping from the ports sensors and actuators are wired into
 * to a variable name. This provides flexibility changing wiring, makes checking
 * the wiring easier and significantly reduces the number of magic numbers
 * floating around.
 */
public class RobotMap
{
    /**
     * LeftMotor Front on the Drive Subsystem
     * CAN: No
     */
    public static final int DRIVESUBSYSTEM_LEFT_1 =             0;
    /**
     * LeftMotor Back on the Drive Subsystem
     * CAN: No
     */
    public static final int DRIVESUBSYSTEM_LEFT_2 =             1;
    /**
    * RightMotor Front on the Drive Subsystem
    * CAN: No
     */
    public static final int DRIVESUBSYSTEM_RIGHT_1 =            2;
    /**
    * RightMotor Back on the Drive Subsystem
    * CAN: No
    */
    public static final int DRIVESUBSYSTEM_RIGHT_2 =            3;

    /**
     * Driver Controller
     */
    public static final int JOYSTICK_DRIVER =                   0;
    /**
     * Operator Controller
     */
    public static final int JOYSTICK_OPERATOR =                 1;

}

package org.usfirst.frc.team1360.robot;

/**
 * The RobotMap is a mapping from the ports sensors and actuators are wired into
 * to a variable name. This provides flexibility changing wiring, makes checking
 * the wiring easier and significantly reduces the number of magic numbers
 * floating around.
 */
public class RobotMap
{
    /**
     * LeftMotor Front on the Drive Subsystem
     * CAN: No
     */
    public static final int DRIVESUBSYSTEM_LEFT_1 =             0;
    /**
     * LeftMotor Back on the Drive Subsystem
     * CAN: No
     */
    public static final int DRIVESUBSYSTEM_LEFT_2 =             1;
    /**
    * RightMotor Front on the Drive Subsystem
    * CAN: No
     */
    public static final int DRIVESUBSYSTEM_RIGHT_1 =            2;
    /**
    * RightMotor Back on the Drive Subsystem
    * CAN: No
    */
    public static final int DRIVESUBSYSTEM_RIGHT_2 =            3;

    /**
     * Driver Controller
     */
    public static final int JOYSTICK_DRIVER =                   0;
    /**
     * Operator Controller
     */
    public static final int JOYSTICK_OPERATOR =                 1;

    /**
     * Intake motor
     */
    public static final int INTAKE_MOTOR =                      5;

}

Revert "Revert "Added new port""


package com.crossbowffs.quotelock.modules.hitokoto;

import android.content.ComponentName;
import android.content.Context;
import com.crossbowffs.quotelock.R;
import com.crossbowffs.quotelock.api.QuoteData;
import com.crossbowffs.quotelock.api.QuoteModule;
import com.crossbowffs.quotelock.utils.IOUtils;
import org.json.JSONException;

import java.io.IOException;

public class HitokotoQuoteModule implements QuoteModule {
    private static final String TAG = HitokotoQuoteModule.class.getSimpleName();

    @Override
    public String getDisplayName(Context context) {
        return context.getString(R.string.module_hitokoto_name);
    }

    @Override
    public ComponentName getConfigActivity(Context context) {
        return null;
    }

    @Override
    public int getMinimumRefreshInterval(Context context) {
        return 0;
    }

    @Override
    public boolean requiresInternetConnectivity(Context context) {
        return true;
    }

    @Override
    public QuoteData getQuote(Context context) throws IOException, JSONException {
        String quote = IOUtils.downloadString("https://api.lwl12.com/hitokoto/main/get");
        return new QuoteData(quote, "");
    }
}

package com.crossbowffs.quotelock.modules.hitokoto;

import android.content.ComponentName;
import android.content.Context;
import com.crossbowffs.quotelock.R;
import com.crossbowffs.quotelock.api.QuoteData;
import com.crossbowffs.quotelock.api.QuoteModule;
import com.crossbowffs.quotelock.utils.IOUtils;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.IOException;

public class HitokotoQuoteModule implements QuoteModule {
    private static final String TAG = HitokotoQuoteModule.class.getSimpleName();

    @Override
    public String getDisplayName(Context context) {
        return context.getString(R.string.module_hitokoto_name);
    }

    @Override
    public ComponentName getConfigActivity(Context context) {
        return null;
    }

    @Override
    public int getMinimumRefreshInterval(Context context) {
        return 0;
    }

    @Override
    public boolean requiresInternetConnectivity(Context context) {
        return true;
    }

    @Override
    public QuoteData getQuote(Context context) throws IOException, JSONException {
        String quoteJson = IOUtils.downloadString("https://sslapi.hitokoto.cn/");

        JSONObject quoteJsonObject = new JSONObject(quoteJson);
        String quoteText = quoteJsonObject.getString("hitokoto");
        String quoteSource = "―" + quoteJsonObject.getString("from");

        return new QuoteData(quoteText, quoteSource);
    }
}

Change the source of Hitokoto to Hitokoto.cn.


/*******************************************************************************
 * Copyright 2015 France Labs
 *
 * 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.francelabs.datafari.utils;

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

/**
 * Language Utility class
 *
 * @author France Labs
 *
 */
public class LanguageUtils {

	public static final List<String> availableLanguages = Arrays.asList("en", "fr", "it", "pt_br");

}

/*******************************************************************************
 * Copyright 2015 France Labs
 *
 * 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.francelabs.datafari.utils;

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

/**
 * Language Utility class
 *
 * @author France Labs
 *
 */
public class LanguageUtils {

	public static final List<String> availableLanguages = Arrays.asList("en", "fr", "it", "pt_br", "de");

}

Add support for German language


package uk.ac.ox.oucs.oauth.dao;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import uk.ac.ox.oucs.oauth.domain.Accessor;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public class HibernateAccessorDao extends HibernateDaoSupport implements AccessorDao {
    public void create(final Accessor accessor) {
        getHibernateTemplate().save(accessor);
    }

    public Accessor get(String accessorId) {
        return (Accessor) getHibernateTemplate().get(Accessor.class, accessorId);
    }

    public List<Accessor> getByUser(String userId) {
        return (List<Accessor>) getHibernateTemplate().find(
                "FROM Accessor a WHERE a.user = ?",
                new Object[]{userId});
    }

    public void markExpiredAccessors() {
        getHibernateTemplate().execute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException, SQLException {
                session.createQuery(
                        "UPDATE Accessor a SET a.status=? WHERE a.expirationDate < ?")
                        .setParameter(0, Accessor.Status.EXPIRED)
                        .setDate(1, new Date())
                        .executeUpdate();
                return null;
            }
        });
    }

    public Accessor update(Accessor accessor) {
        getHibernateTemplate().update(accessor);
        return accessor;
    }

    public void remove(Accessor accessor) {
        getHibernateTemplate().delete(accessor);
    }
}

package uk.ac.ox.oucs.oauth.dao;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import uk.ac.ox.oucs.oauth.domain.Accessor;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

public class HibernateAccessorDao extends HibernateDaoSupport implements AccessorDao {
    public void create(final Accessor accessor) {
        getHibernateTemplate().save(accessor);
    }

    public Accessor get(String accessorId) {
        return (Accessor) getHibernateTemplate().get(Accessor.class, accessorId);
    }

    public List<Accessor> getByUser(String userId) {
        return (List<Accessor>) getHibernateTemplate().find(
                "FROM Accessor a WHERE a.userId = ?",
                new Object[]{userId});
    }

    public void markExpiredAccessors() {
        getHibernateTemplate().execute(new HibernateCallback() {
            public Object doInHibernate(Session session) throws HibernateException, SQLException {
                session.createQuery(
                        "UPDATE Accessor a SET a.status=? WHERE a.expirationDate < ?")
                        .setParameter(0, Accessor.Status.EXPIRED)
                        .setDate(1, new Date())
                        .executeUpdate();
                return null;
            }
        });
    }

    public Accessor update(Accessor accessor) {
        getHibernateTemplate().update(accessor);
        return accessor;
    }

    public void remove(Accessor accessor) {
        getHibernateTemplate().delete(accessor);
    }
}

Fix the getByUser request, the field name is userId, not user


package net.hamnaberg.jsonstat;

/**
 * Created by hadrien on 07/06/16.
 *
 * @see json-stat.org/format/#version
 */
public class JsonStat {

    private final Version version;

    private final Class clazz;

    public JsonStat(Version version, Class clazz) {
        this.version = version;
        this.clazz = clazz;
    }

    public enum Version {

        ONE("1.0"), TWO("2.0");

        private final String tag;

        Version(final String tag) {
            this.tag = tag;
        }

        String getTag() {
            return this.tag;
        }
    }

    public enum Class {
        DATASET,
        DIMENSION,
        COLLECTION
    }

}

package net.hamnaberg.jsonstat;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Created by hadrien on 07/06/16.
 *
 * @see json-stat.org/format/#version
 */
public class JsonStat {

    private final Version version;

    private final Class clazz;

    public JsonStat(Version version, Class clazz) {
        this.version = version;
        this.clazz = clazz;
    }

    public String getVersion() {
        return version.getTag();
    }

    @JsonProperty("class")
    public String getClazz() {
        return clazz.toString().toLowerCase();
    }

    public enum Version {

        ONE("1.0"), TWO("2.0");

        private final String tag;

        Version(final String tag) {
            this.tag = tag;
        }

        String getTag() {
            return this.tag;
        }
    }

    public enum Class {
        DATASET,
        DIMENSION,
        COLLECTION
    }

}

Add the class and version property


package no.deichman.ls.parasite;

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

/** Example resource class hosted at the URI path "/myresource"
 */
@Path("/myresource")
public class MyResource {

    /** Method processing HTTP GET requests, producing "text/plain" MIME media
     * type.
     * @return String that will be send back as a response of type "text/plain".
     */
    @GET
    @Produces("text/plain")
    public String getIt() {
        return "Hi there!";
    }
}

package no.deichman.ls.parasite;

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

/** Example resource class hosted at the URI path "/myresource"
 */
@Path("/service")
public class Service {

    /** Method processing HTTP GET requests, producing "text/turtle" MIME media
     * type.
     * @return String that will be send back as a response of type "text/turtle".
     */
	@Path("work/{id}")
    @GET
    @Produces("text/turtle;qs=0.1")
    public String getTurtle(@PathParam("id") String id) {
        return "Turtle: " + id;
    }
    /** Method processing HTTP GET requests, producing "text/html" MIME media
     * type.
     * @return String that will be send back as a response of type "text/html".
     */
	@Path("work/{id}")
    @GET
    @Produces("text/html;qs=2")
    public String getHTML(@PathParam("id") String id) {
        return "Requested work was: " + id + "";
    }
    /** Method processing HTTP GET requests, producing "application/json" MIME media
     * type.
     * @return String that will be send back as a response of type "application/json".
     */
	@Path("work/{id}")
    @GET
    @Produces("application/json;qs=0.2")
    public String getJSON(@PathParam("id") String id) {
        return "JSON: " + id;
    }
    /** Method processing HTTP GET requests, producing "application/rdf+xml" MIME media
     * type.
     * @return String that will be send back as a response of type "application/rdf+xml".
     */
	@Path("work/{id}")
    @GET
    @Produces("application/rdf+xml;qs=0.3")
    public String getRDFXML(@PathParam("id") String id) {
        return "RDF/XML: " + id;
    }

}

Change classname, add basic framework


// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.buildout.config;

import com.intellij.openapi.fileTypes.LanguageFileType;
import icons.PythonIcons;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public final class BuildoutCfgFileType extends LanguageFileType {
  public static final BuildoutCfgFileType INSTANCE = new BuildoutCfgFileType();
  @NonNls public static final String DEFAULT_EXTENSION = "cfg";
  @NonNls private static final String NAME = "BuildoutCfg";
  @NonNls private static final String DESCRIPTION = "Buildout config";

  private BuildoutCfgFileType() {
    super(BuildoutCfgLanguage.INSTANCE);
  }

  @Override
  @NotNull
  public String getName() {
    return NAME;
  }

  @Override
  @NotNull
  public String getDescription() {
    return DESCRIPTION;
  }

  @Override
  @NotNull
  public String getDefaultExtension() {
    return DEFAULT_EXTENSION;
  }

  @Override
  @Nullable
  public Icon getIcon() {
    return PythonIcons.Python.Buildout.Buildout;
  }
}

// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.jetbrains.python.buildout.config;

import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.util.NlsSafe;
import icons.PythonIcons;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public final class BuildoutCfgFileType extends LanguageFileType {
  public static final BuildoutCfgFileType INSTANCE = new BuildoutCfgFileType();
  public static final @NlsSafe String DEFAULT_EXTENSION = "cfg";
  private static final @NlsSafe String NAME = "BuildoutCfg";
  private static final @NlsSafe String DESCRIPTION = "Buildout config";

  private BuildoutCfgFileType() {
    super(BuildoutCfgLanguage.INSTANCE);
  }

  @Override
  @NotNull
  public String getName() {
    return NAME;
  }

  @Override
  @NotNull
  public String getDescription() {
    return DESCRIPTION;
  }

  @Override
  @NotNull
  public String getDefaultExtension() {
    return DEFAULT_EXTENSION;
  }

  @Override
  @Nullable
  public Icon getIcon() {
    return PythonIcons.Python.Buildout.Buildout;
  }
}

Replace `@NonNls` with more appropriate `@NlsSafe` annotation


package org.zeromq.czmq;

public class ZFrame implements AutoCloseable {

    long pointer;

    public ZFrame() {
        pointer = __init();
    }

    public ZFrame(long address) {
        pointer = address;
    }

    native static long __init();

    native static long __init(byte[] buf, long size);

    native static void __destroy(long pointer);

    @Override
    public void close() {
        __destroy(pointer);
        pointer = 0;
    }
}

package org.zeromq.czmq;

public class ZFrame implements AutoCloseable {

    long pointer;

    public ZFrame() {
        pointer = __init();
    }

    public ZFrame(long address) {
        pointer = address;
    }

    public ZFrame(byte[] buf, long size) {
        pointer = __init(buf, size);
    }
    native static long __init();

    native static long __init(byte[] buf, long size);

    native static void __destroy(long pointer);

    @Override
    public void close() {
        __destroy(pointer);
        pointer = 0;
    }
}

Add byte constructor to zframe


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

package net.floodlightcontroller.devicemanager.web;

import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;

import net.floodlightcontroller.restserver.RestletRoutable;

/**
 * Routable for device rest api
 */
public class DeviceRoutable implements RestletRoutable {

    @Override
    public String basePath() {
        return "/wm/device";
    }

    @Override
    public Restlet getRestlet(Context context) {
        Router router = new Router(context);
        router.attach("/", DeviceResource.class);
        router.attach("/debug", DeviceEntityResource.class);
        return router;
    }

}

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

package net.floodlightcontroller.devicemanager.web;

import org.restlet.Context;
import org.restlet.Restlet;
import org.restlet.routing.Router;

import net.floodlightcontroller.restserver.RestletRoutable;

/**
 * Routable for device rest api
 */
public class DeviceRoutable implements RestletRoutable {

    @Override
    public String basePath() {
        return "/wm/device";
    }

    @Override
    public Restlet getRestlet(Context context) {
        Router router = new Router(context);
        router.attach("/json", DeviceResource.class);
        router.attach("/debug", DeviceEntityResource.class);
        return router;
    }

}

Add 'json' to the DeviceManager's REST API to be consistent with the rest. Ending the path in a / is bad REST practice.