package de.prob2.ui.verifications.cbc;

import java.util.Objects;

import de.prob.statespace.Trace;

public class CBCFormulaFindStateItem extends CBCFormulaItem {

	private Trace example;

	public CBCFormulaFindStateItem(String name, String code, CBCType type) {
		super(name, code, type);
		this.example = null;
	}

	public void setExample(Trace example) {
		this.example = example;
	}

	public Trace getExample() {
		return example;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (!(obj instanceof CBCFormulaFindStateItem)) {
			return false;
		}
		CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj;
		return otherItem.getName().equals(this.getName()) &&
				otherItem.getCode().equals(this.getCode()) &&
				otherItem.getType().equals(this.getType());
	}

	@Override
	public int hashCode() {
		return Objects.hash(name, code, type);
	}

}

package de.prob2.ui.verifications.cbc;

import java.util.Objects;

import de.prob.statespace.Trace;

public class CBCFormulaFindStateItem extends CBCFormulaItem {

	private transient Trace example;

	public CBCFormulaFindStateItem(String name, String code, CBCType type) {
		super(name, code, type);
		this.example = null;
	}

	public void setExample(Trace example) {
		this.example = example;
	}

	public Trace getExample() {
		return example;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) {
			return true;
		}
		if (!(obj instanceof CBCFormulaFindStateItem)) {
			return false;
		}
		CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj;
		return otherItem.getName().equals(this.getName()) &&
				otherItem.getCode().equals(this.getCode()) &&
				otherItem.getType().equals(this.getType());
	}

	@Override
	public int hashCode() {
		return Objects.hash(name, code, type);
	}

}

Fix an exception when loading project


package org.pdxfinder.repositories;

import org.pdxfinder.dao.PdxPassage;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface PdxPassageRepository extends Neo4jRepository<PdxPassage, Long> {

    @Query("MATCH (p:PdxPassage),(s:ModelCreation) WHERE (p)-[:PASSAGED_FROM]-(s) and p.passage={passage} and s.sourcePdxId = {modelId} RETURN p")
    PdxPassage findByPassageAndModelId(@Param("passage") String passage, @Param("modelId")String modelId);

}

package org.pdxfinder.repositories;

import org.pdxfinder.dao.PdxPassage;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface PdxPassageRepository extends Neo4jRepository<PdxPassage, Long> {

    @Query("MATCH (s:Sample)--(mod:ModelCreation)--(p:PdxPassage) " +
            "WHERE s.dataSource = {dataSource} " +
            "AND p.passage = {passage} " +
            "AND mod.sourcePdxId = {modelId} RETURN p")
    PdxPassage findByPassageAndModelIdAndDataSource(@Param("passage") int passage, @Param("modelId")String modelId, @Param("dataSource") String dataSource);

}

Add find method by passage, datasource and model Id


package de.danoeh.antennapod.util;

import java.util.Arrays;

/** Generates valid filenames for a given string. */
public class FileNameGenerator {

	private static final char[] ILLEGAL_CHARACTERS = { '/', '\\', '?', '%',
			'*', ':', '|', '"', '<', '>' };
	static {
		Arrays.sort(ILLEGAL_CHARACTERS);
	}

	private FileNameGenerator() {

	}

	/**
	 * This method will return a new string that doesn't contain any illegal
	 * characters of the given string.
	 */
	public static String generateFileName(String string) {
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < string.length(); i++) {
			char c = string.charAt(i);
			if (Arrays.binarySearch(ILLEGAL_CHARACTERS, c) < 0) {
				builder.append(c);
			}
		}
		return builder.toString();
	}

	public static long generateLong(final String str) {
		return str.hashCode();
	}
}

package de.danoeh.antennapod.util;

import java.util.Arrays;

/** Generates valid filenames for a given string. */
public class FileNameGenerator {

	private static final char[] ILLEGAL_CHARACTERS = { '/', '\\', '?', '%',
			'*', ':', '|', '"', '<', '>' };
	static {
		Arrays.sort(ILLEGAL_CHARACTERS);
	}

	private FileNameGenerator() {

	}

	/**
	 * This method will return a new string that doesn't contain any illegal
	 * characters of the given string.
	 */
	public static String generateFileName(String string) {
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < string.length(); i++) {
			char c = string.charAt(i);
			if (Arrays.binarySearch(ILLEGAL_CHARACTERS, c) < 0) {
				builder.append(c).replaceFirst("  *$","");
			}
		}
		return builder.toString();
	}

	public static long generateLong(final String str) {
		return str.hashCode();
	}
}

Remove trailing spaces in filenames


//
// $Id$
//
// BUI - a user interface library for the JME 3D engine
// Copyright (C) 2005, Michael Bayne, All Rights Reserved
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package com.jme.bui.background;

import com.jme.renderer.Renderer;

/**
 * A blank background.
 */
public class BlankBackground extends BBackground
{
    public BlankBackground ()
    {
        super(0, 0, 0, 0);
    }
}

//
// $Id$
//
// BUI - a user interface library for the JME 3D engine
// Copyright (C) 2005, Michael Bayne, All Rights Reserved
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package com.jme.bui.background;

import com.jme.renderer.Renderer;

/**
 * A blank background.
 */
public class BlankBackground extends BBackground
{
    public BlankBackground ()
    {
        this(0, 0, 0, 0);
    }

    public BlankBackground (int left, int top, int right, int bottom)
    {
        super(left, top, right, bottom);
    }
}

Allow blank backgrounds to be created with insets.


package bio.terra.cli.command.config;

import bio.terra.cli.context.GlobalContext;
import java.util.concurrent.Callable;
import picocli.CommandLine;

/** This class corresponds to the third-level "terra config list" command. */
@CommandLine.Command(
    name = "list",
    description = "List all configuration properties and their values.")
public class List implements Callable<Integer> {

  @Override
  public Integer call() {
    GlobalContext globalContext = GlobalContext.readFromFile();

    System.out.println("browser launch for login = " + globalContext.browserLaunchOption);
    System.out.println("docker image id = " + globalContext.dockerImageId);

    return 0;
  }
}

package bio.terra.cli.command.config;

import bio.terra.cli.context.GlobalContext;
import java.util.concurrent.Callable;
import picocli.CommandLine;

/** This class corresponds to the third-level "terra config list" command. */
@CommandLine.Command(
    name = "list",
    description = "List all configuration properties and their values.")
public class List implements Callable<Integer> {

  @Override
  public Integer call() {
    GlobalContext globalContext = GlobalContext.readFromFile();

    System.out.println("[browser] browser launch for login = " + globalContext.browserLaunchOption);
    System.out.println("[image] docker image id = " + globalContext.dockerImageId);

    return 0;
  }
}

Include config parameter name in list output.


package com.sleekbyte.tailor.common;

import com.sleekbyte.tailor.listeners.BlankLineListener;
import com.sleekbyte.tailor.listeners.MultipleImportListener;
import com.sleekbyte.tailor.listeners.RedundantParenthesisListener;
import com.sleekbyte.tailor.listeners.SemicolonTerminatedListener;
import com.sleekbyte.tailor.listeners.UpperCamelCaseListener;
import com.sleekbyte.tailor.listeners.WhitespaceListener;

/**
 * Enum for all rules implemented in Tailor.
 */
public enum Rules {
    UPPER_CAMEL_CASE ("upperCamelCase", UpperCamelCaseListener.class.getName()),
    SEMICOLON_TERMINATED ("semicolonTerminated", SemicolonTerminatedListener.class.getName()),
    REDUNDANT_PARENTHESIS ("redundantParentheses", RedundantParenthesisListener.class.getName()),
    MULTIPLE_IMPORT ("multipleImports", MultipleImportListener.class.getName()),
    BLANK_LINE_FUNCTION ("blankLinesAroundFunction", BlankLineListener.class.getName()),
    WHITESPACE ("whitespace", WhitespaceListener.class.getName());

    private String name;
    private String className;

    Rules(String name, String className) {
        this.name = name;
        this.className = className;
    }

    public String getName() {
        return this.name;
    }

    public String getClassName() {
        return this.className;
    }

}

package com.sleekbyte.tailor.common;

import com.sleekbyte.tailor.listeners.BlankLineListener;
import com.sleekbyte.tailor.listeners.MultipleImportListener;
import com.sleekbyte.tailor.listeners.RedundantParenthesisListener;
import com.sleekbyte.tailor.listeners.SemicolonTerminatedListener;
import com.sleekbyte.tailor.listeners.UpperCamelCaseListener;
import com.sleekbyte.tailor.listeners.WhitespaceListener;

/**
 * Enum for all rules implemented in Tailor.
 */
public enum Rules {
    UPPER_CAMEL_CASE ("upperCamelCase", UpperCamelCaseListener.class.getName()),
    SEMICOLON_TERMINATED ("semicolonTerminated", SemicolonTerminatedListener.class.getName()),
    REDUNDANT_PARENTHESES ("redundantParentheses", RedundantParenthesisListener.class.getName()),
    MULTIPLE_IMPORT ("multipleImports", MultipleImportListener.class.getName()),
    BLANK_LINE_FUNCTION ("blankLinesAroundFunction", BlankLineListener.class.getName()),
    WHITESPACE ("whitespace", WhitespaceListener.class.getName());

    private String name;
    private String className;

    Rules(String name, String className) {
        this.name = name;
        this.className = className;
    }

    public String getName() {
        return this.name;
    }

    public String getClassName() {
        return this.className;
    }

}

Rename REDUNDANT_PARENTHESIS rule to REDUNDANT_PARENTHESES


package markehme.FactionsPerms.listeners;

import markehme.FactionsPerms.FactionsPerms;

import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerLoginEvent.Result;

public class ReadyCheck implements Listener {

	/**
	 * Checks if FactionsPerms is ready
	 * @param event
	 */
	@EventHandler(priority = EventPriority.HIGH)
	public void onLogin(PlayerLoginEvent event) {
		if(!FactionsPerms.isReady) {
			event.disallow(Result.KICK_OTHER, "Server is still starting up.. please try again.");
			return;
		}

		if(!FactionsPerms.userSet.containsKey(event.getPlayer().getName().toLowerCase())) {

		}
	}
}

package markehme.FactionsPerms.listeners;

import java.io.IOException;
import java.util.Arrays;
import java.util.logging.Level;

import markehme.FactionsPerms.FactionsPerms;

import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerLoginEvent.Result;

public class ReadyCheck implements Listener {

	/**
	 * Checks if FactionsPerms is ready
	 * @param event
	 */
	@EventHandler(priority = EventPriority.HIGH)
	public void onLogin(PlayerLoginEvent event) {
		if(!FactionsPerms.isReady) {
			event.disallow(Result.KICK_OTHER, "Server is still starting up.. please try again.");
			return;
		}

		if(!FactionsPerms.userSet.containsKey(event.getPlayer().getName().toLowerCase())) {
			FactionsPerms.get().getLogger().log(Level.INFO, "Adding " + event.getPlayer().getName() + " to default group");
			FactionsPerms.usersConfig.set("Users." + event.getPlayer().getName() + ".groups", Arrays.asList("default"));
			FactionsPerms.usersConfig.set("Users." + event.getPlayer().getName() + ".permissions", Arrays.asList(""));

			FactionsPerms.loadUser(event.getPlayer().getName());

			try {
				FactionsPerms.usersConfig.save(FactionsPerms.usersConfigFile);
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}

Add no-defined users to the 'default' group


package com.leevilehtonen.cookagram.config;

import org.hibernate.dialect.PostgreSQL94Dialect;
import org.hibernate.type.descriptor.sql.BinaryTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;

import java.sql.Types;

public class PostgreSQLDialectCustom extends PostgreSQL94Dialect {

    @Override
    public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) {
        if (sqlTypeDescriptor.getSqlType() == Types.BLOB) {
            return BinaryTypeDescriptor.INSTANCE;
        }
        return super.remapSqlTypeDescriptor(sqlTypeDescriptor);
    }
}

package com.leevilehtonen.cookagram.config;

import org.hibernate.dialect.PostgreSQL94Dialect;

import java.sql.Types;

public class PostgreSQLDialectCustom extends PostgreSQL94Dialect {

    public PostgreSQLDialectCustom() {
        registerColumnType(Types.BLOB, "bytea");
        registerColumnType(Types.LONGVARBINARY, "bytea");
    }

}

Update image content type for Postgres


package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeEndObject();
    }

}

Remove devices array from the Port JSON representation.


package seedu.jimi.commons.events.ui;

import seedu.jimi.commons.events.BaseEvent;

/**
 * Indicates user request to show a section of the taskList panel.
 * @author zexuan
 *
 */
public class ShowTaskPanelSectionEvent extends BaseEvent{

    String sectionToDisplay;

    public ShowTaskPanelSectionEvent(String sectionToDisplay) {
        this.sectionToDisplay = sectionToDisplay;
    }

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

}

package seedu.jimi.commons.events.ui;

import seedu.jimi.commons.events.BaseEvent;

/**
 * Indicates user request to show a section of the taskList panel.
 * @author zexuan
 *
 */
public class ShowTaskPanelSectionEvent extends BaseEvent{

    public final String sectionToDisplay;

    public ShowTaskPanelSectionEvent(String sectionToDisplay) {
        this.sectionToDisplay = sectionToDisplay;
    }

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

}

Modify access level of member var


package net.aeten.core;

import net.aeten.core.event.EventData;
import net.aeten.core.event.Handler;

public interface Model<M, F extends Enum<F>> {
	void addObserver(Handler<EventData<M, F>> observer);
	void removeObserver(Handler<EventData<M, F>> observer);
}

package net.aeten.core;

import net.aeten.core.event.EventData;
import net.aeten.core.event.Handler;

public interface Model <M extends Model<M, F>, F extends Enum <F>> {
	void addObserver (Handler <EventData <M, F>> observer);

	void removeObserver (Handler <EventData <M, F>> observer);

	<T> void set (	F field,
						T value);

	<T> T get (F field);
}

Add getter and setter methods.


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

package androidx.webkit.internal;

/**
 * Class containing all the startup features the AndroidX library can support.
 * The constants defined in this file should not be modified as their value is used in the
 * WebView manifest.
 */
public class StartupFeatures {
    private StartupFeatures() {
        // This class shouldn't be instantiated.
    }

    // ProcessGlobalConfig#setDataDirectorySuffix(String)
    public static final String STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX =
            "SET_DATA_DIRECTORY_SUFFIX:DEV";
}

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

package androidx.webkit.internal;

/**
 * Class containing all the startup features the AndroidX library can support.
 * The constants defined in this file should not be modified as their value is used in the
 * WebView manifest.
 */
public class StartupFeatures {
    private StartupFeatures() {
        // This class shouldn't be instantiated.
    }

    // ProcessGlobalConfig#setDataDirectorySuffix(String)
    public static final String STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX =
            "STARTUP_FEATURE_SET_DATA_DIRECTORY_SUFFIX";
}

Rename the WebView manifest key name


//
// Copyright 2016, Yahoo Inc.
// Copyrights licensed under the New BSD License.
// See the accompanying LICENSE file for terms.
//

// [![Build Status](https://travis-ci.org/jminusminus/jmmexample.svg?branch=master)](https://travis-ci.org/jminusminus/jmmexample)
// ## Stability: 1 - Stable
// This is an example project for [Jmm](https://github.com/ricallinson/jmm).
package github.com.jminusminus.jmmexample;

public class Helloworld {

    // The following jmm commands will setup up a Jmm workspace, pull down the code for this project, test it, install it and then run it.
    //     mkdir ./jmmtest
    //     cd ./jmmtest
    //     jmm here .
    //     jmm get github.com/jminusminus/simplebdd
    //     jmm get github.com/jminusminus/jmmexample
    //     jmm test ./src/github/com/jminusminus/jmmexample
    //     jmm install ./src/github/com/jminusminus/jmmexample
    //     jmmexample
    public static void main(String args[]) {
        System.out.println(Helloworld.msg());
    }

    // Return a congratulations message.
    public static String msg() {
        return "Congratulations on your first Jmm application.";
    }
}

//
// Copyright 2016, Yahoo Inc.
// Copyrights licensed under the New BSD License.
// See the accompanying LICENSE file for terms.
//

// [![Build Status](https://travis-ci.org/jminusminus/jmmexample.svg?branch=master)](https://travis-ci.org/jminusminus/jmmexample)
// ## Stability: 1 - Stable
// This is an example project for [Jmm](https://github.com/ricallinson/jmm).
package github.com.jminusminus.jmmexample;

public class Helloworld {

    // The following jmm commands will setup up a Jmm workspace, pull down the code for this project, test it, install it and then run it.
    //
    //     mkdir ./jmmtest
    //     cd ./jmmtest
    //     jmm here .
    //     jmm get github.com/jminusminus/simplebdd
    //     jmm get github.com/jminusminus/jmmexample
    //     jmm test ./src/github/com/jminusminus/jmmexample
    //     jmm install ./src/github/com/jminusminus/jmmexample
    //     jmmexample
    public static void main(String args[]) {
        System.out.println(Helloworld.msg());
    }

    // Return a congratulations message.
    public static String msg() {
        return "Congratulations on your first Jmm application.";
    }
}

Change README to be Jmm documentation


package com.satsumasoftware.timetable.db;

import android.provider.BaseColumns;

import com.satsumasoftware.timetable.db.util.SchemaUtilsKt;

public final class ClassDetailsSchema implements BaseColumns {

    public static final String TABLE_NAME = "class_details";
    public static final String COL_CLASS_ID = "class_id";
    public static final String COL_ROOM = "room";
    public static final String COL_BUILDING = "building";
    public static final String COL_TEACHER = "teacher";

    protected static final String SQL_CREATE = "CREATE TABLE " + TABLE_NAME + "( " +
            _ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.PRIMARY_KEY_AUTOINCREMENT + SchemaUtilsKt.COMMA_SEP +
            COL_CLASS_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_ROOM + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_BUILDING + SchemaUtilsKt.TEXT_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_TEACHER + SchemaUtilsKt.INTEGER_TYPE +
            " )";

    protected static final String SQL_DELETE =
            "DROP TABLE IF EXISTS " + TABLE_NAME;

}

package com.satsumasoftware.timetable.db;

import android.provider.BaseColumns;

import com.satsumasoftware.timetable.db.util.SchemaUtilsKt;

public final class ClassDetailsSchema implements BaseColumns {

    public static final String TABLE_NAME = "class_details";
    public static final String COL_CLASS_ID = "class_id";
    public static final String COL_ROOM = "room";
    public static final String COL_BUILDING = "building";
    public static final String COL_TEACHER = "teacher";

    protected static final String SQL_CREATE = "CREATE TABLE " + TABLE_NAME + "( " +
            _ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.PRIMARY_KEY_AUTOINCREMENT + SchemaUtilsKt.COMMA_SEP +
            COL_CLASS_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_ROOM + SchemaUtilsKt.TEXT_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_BUILDING + SchemaUtilsKt.TEXT_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_TEACHER + SchemaUtilsKt.TEXT_TYPE +
            " )";

    protected static final String SQL_DELETE =
            "DROP TABLE IF EXISTS " + TABLE_NAME;

}

Make the room and teacher columns of TEXT type


package org.dotwebstack.framework.example;

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

@SpringBootApplication
@ComponentScan("org.dotwebstack.framework")
class ExampleApplication {

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

}

package org.dotwebstack.framework.example;

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

@SpringBootApplication
@ComponentScan("org.dotwebstack.framework")
public class ExampleApplication {

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

}

Fix visilibity issue for example app


package com.dianping.cat;

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

import com.dianping.cat.message.spi.core.HtmlMessageCodecTest;
import com.dianping.cat.message.spi.core.WaterfallMessageCodecTest;
import com.dianping.cat.storage.dump.LocalMessageBucketManagerTest;
import com.dianping.cat.storage.dump.LocalMessageBucketTest;
import com.dianping.cat.storage.report.LocalReportBucketTest;
import com.dianping.cat.task.TaskManagerTest;

@RunWith(Suite.class)
@SuiteClasses({

HtmlMessageCodecTest.class,

WaterfallMessageCodecTest.class,

/* .storage.dump */
LocalMessageBucketTest.class,

LocalMessageBucketManagerTest.class,

/* .storage.report */
LocalReportBucketTest.class,

/* .task */
TaskManagerTest.class

})
public class AllTests {

}

package com.dianping.cat;

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

import com.dianping.cat.message.spi.core.HtmlMessageCodecTest;
import com.dianping.cat.message.spi.core.TcpSocketReceiverTest;
import com.dianping.cat.message.spi.core.WaterfallMessageCodecTest;
import com.dianping.cat.storage.dump.LocalMessageBucketManagerTest;
import com.dianping.cat.storage.dump.LocalMessageBucketTest;
import com.dianping.cat.storage.report.LocalReportBucketTest;
import com.dianping.cat.task.TaskManagerTest;

@RunWith(Suite.class)
@SuiteClasses({

HtmlMessageCodecTest.class,

WaterfallMessageCodecTest.class,

/* .storage.dump */
LocalMessageBucketTest.class,

LocalMessageBucketManagerTest.class,

/* .storage.report */
LocalReportBucketTest.class,

/* .task */
TaskManagerTest.class,

TcpSocketReceiverTest.class

})
public class AllTests {

}

Add TcpSocketReceiverTest into Test Suite


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

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

public class Main implements Runnable {
    public static void main(String[] args) throws Exception {
        Thread[] threads = new Thread[16];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(new Main(i));
        }
        for (Thread thread : threads) {
            thread.start();
        }
        for (Thread thread : threads) {
            thread.join();
        }
    }

    private final int id;

    private Main(int id) {
        this.id = id;
    }

    public void run() {
        List l = new ArrayList();
        for (int i = 0; i < 400; i++) {
            l.add(new ArrayList(i));
        }
    }
}

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

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

public class Main implements Runnable {
    public static void main(String[] args) throws Exception {
        Thread[] threads = new Thread[16];
        for (int i = 0; i < threads.length; i++) {
            threads[i] = new Thread(new Main(i));
        }
        for (Thread thread : threads) {
            thread.start();
        }
        for (Thread thread : threads) {
            thread.join();
        }
    }

    private final int id;

    private Main(int id) {
        this.id = id;
        // Allocate this early so it's independent of how the threads are scheduled on startup.
        this.l = new ArrayList<Object>();
    }

    public void run() {
        for (int i = 0; i < 1000; i++) {
            try {
                l.add(new ArrayList<Object>(i));
            } catch (OutOfMemoryError oom) {
                // Ignore.
            }
        }
    }

    private List<Object> l;
}

Fix run-test 114 ParallelGC to account for OOM


package uk.ac.ic.wlgitbridge.snapshot.base;

import com.google.gson.JsonElement;
import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException;

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

public class MissingRepositoryException extends SnapshotAPIException {

    public static final String GENERIC_REASON =
        "This Overleaf project currently has no git access.\n" +
        "\n" +
        "If you think this is an error, contact support at support@overleaf.com.";

    public static final String EXPORTED_TO_V2 =
        "This Overleaf project has been moved to Overleaf v2, and git access is temporarily unsupported.\n" +
        "\n" +
        "See https://www.overleaf.com/help/342 for more information.";

    private String message = "";

    public MissingRepositoryException() {
    }

    public MissingRepositoryException(String message) {
        this.message = message;
    }

    @Override
    public void fromJSON(JsonElement json) {}

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public List<String> getDescriptionLines() {
        return Arrays.asList(getMessage());
    }

}

package uk.ac.ic.wlgitbridge.snapshot.base;

import com.google.gson.JsonElement;
import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException;

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

public class MissingRepositoryException extends SnapshotAPIException {

    public static final String GENERIC_REASON =
        "This Overleaf project currently has no git access.\n" +
        "\n" +
        "If this problem persists, please contact us.";

    public static final String EXPORTED_TO_V2 =
        "This Overleaf project has been moved to Overleaf v2, and git access is temporarily unsupported.\n" +
        "\n" +
        "See https://www.overleaf.com/help/342 for more information.";

    private String message = "";

    public MissingRepositoryException() {
    }

    public MissingRepositoryException(String message) {
        this.message = message;
    }

    @Override
    public void fromJSON(JsonElement json) {}

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public List<String> getDescriptionLines() {
        return Arrays.asList(getMessage());
    }

}

Make GENERIC_REASON consistent with web messages.


package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.FileInputStream;
import java.util.Properties;

/**
 * @author Kohsuke Kawaguchi
 */
public abstract class AbstractGitHubApiTestBase extends Assert {

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        Properties props = new Properties();
        java.io.File f = new java.io.File(System.getProperty("user.home"), ".github");
        if (f.exists()) {
            FileInputStream in = new FileInputStream(f);
            try {
                props.load(in);
                gitHub = GitHub.connect(props.getProperty("login"),props.getProperty("oauth"));
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            gitHub = GitHub.connect();
        }
    }

    protected static final RandomNameGenerator rnd = new RandomNameGenerator();
}

package org.kohsuke.github;

import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.FileInputStream;
import java.util.Properties;

/**
 * @author Kohsuke Kawaguchi
 */
public abstract class AbstractGitHubApiTestBase extends Assert {

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        Properties props = new Properties();
        java.io.File f = new java.io.File(System.getProperty("user.home"), ".github.kohsuke2");
        if (f.exists()) {
            FileInputStream in = new FileInputStream(f);
            try {
                props.load(in);
                gitHub = GitHub.connect(props.getProperty("login"),props.getProperty("oauth"));
            } finally {
                IOUtils.closeQuietly(in);
            }
        } else {
            gitHub = GitHub.connect();
        }
    }

    protected static final RandomNameGenerator rnd = new RandomNameGenerator();
}

Revert "Set credentials file according to documentation"


package zero.down.time.soa.api;

import org.apache.camel.builder.RouteBuilder;

/**
 * @author magonzal
 * @version 1.0.0
 */
public class HelloServiceApi extends RouteBuilder {

	@Override
	public void configure() throws Exception {
		//@formatter:off
		restConfiguration().component("jetty")
			.host("localhost")
			.port(8080)
			.contextPath("hello-service-api/rest");

		rest("/{user}").description("Say hello to User")
			.get().route().to("direct-vm:hello");
		//@formatter:on
	}
}

package zero.down.time.soa.api;

import org.apache.camel.builder.RouteBuilder;
import org.eclipse.jetty.server.Server;

/**
 * @author magonzal
 * @version 1.0.0
 */
public class HelloServiceApi extends RouteBuilder {

	@Override
	public void configure() throws Exception {

		//@formatter:off
		restConfiguration().component("jetty")
			.host("localhost")
			.port(getRandomServerPort())
			.contextPath("hello-service-api/rest");

		rest("/{user}").description("Say hello to User")
			.get().route().to("direct-vm:hello");
		//@formatter:on
	}

	private int getRandomServerPort() throws Exception {
		Server server = new Server(0);
		server.start();
		return server.getConnectors()[0].getLocalPort();
	}
}

Use random port to start Jetty


/*
 * #%L
 * mosaic-cloudlets
 * %%
 * Copyright (C) 2010 - 2012 Institute e-Austria Timisoara (Romania)
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package eu.mosaic_cloud.cloudlets.connectors.core;

import eu.mosaic_cloud.tools.callbacks.core.CallbackCompletion;
import eu.mosaic_cloud.tools.callbacks.core.Callbacks;

/**
 * Interface for all resource accessors used by cloudlets.
 *
 * @author Georgiana Macariu
 *
 * @param <C>
 *            the type of the cloudlet context
 */
public interface IConnector<C> extends eu.mosaic_cloud.connectors.core.IConnector {

	/**
	 * Destroys the accessor.
	 */
	CallbackCompletion<Void> destroy();

	/**
	 * Returns the current status of the accessor.
	 *
	 * @return the current status of the accessor
	 */
	// !!!!
	// ConnectorStatus getStatus();
}

/*
 * #%L
 * mosaic-cloudlets
 * %%
 * Copyright (C) 2010 - 2012 Institute e-Austria Timisoara (Romania)
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
package eu.mosaic_cloud.cloudlets.connectors.core;

import eu.mosaic_cloud.tools.callbacks.core.CallbackCompletion;
import eu.mosaic_cloud.tools.callbacks.core.Callbacks;

/**
 * Interface for all resource accessors used by cloudlets.
 *
 * @author Georgiana Macariu
 *
 * @param <C>
 *            the type of the cloudlet context
 */
public interface IConnector<C> extends eu.mosaic_cloud.connectors.core.IConnector {
	/**
	 * Returns the current status of the accessor.
	 *
	 * @return the current status of the accessor
	 */
	// !!!!
	// ConnectorStatus getStatus();
}

Remove `destroy` method which is already inherited from extended interface


package edu.yalestc.yalepublic;

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

/**
 * Created by Jason Liu on 10/18/14.
 */
public class MapView extends Activity {

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

}

package edu.yalestc.yalepublic;

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

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

/**
 * Created by Jason Liu on 10/18/14.
 */
public class MapView extends Activity {

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

        // Get a handle to the Map Fragment
        GoogleMap map = ((MapFragment) getFragmentManager()
                .findFragmentById(R.id.map)).getMap();

        LatLng yale = new LatLng(41.3111, -72.9267);   // The - signifies the Western Hemisphere

        map.setMyLocationEnabled(true);
        map.moveCamera(CameraUpdateFactory.newLatLngZoom(yale, 13));

        map.addMarker(new MarkerOptions()
                .title("Yale")
                .snippet("The best university ever.")
                .position(yale));
    }

}

Add centered map on our location


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

import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.TransitiveInfoProvider;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;

import java.util.Map;

/**
 * This provider can be implemented by rules which need special environments to run in (especially
 * tests).
 */
@Immutable
public final class ExecutionInfoProvider implements TransitiveInfoProvider {

  private final ImmutableMap<String, String> executionInfo;

  public ExecutionInfoProvider(Map<String, String> requirements) {
    this.executionInfo = ImmutableMap.copyOf(requirements);
  }

  /**
   * Returns a map to indicate special execution requirements, such as hardware
   * platforms, web browsers, etc. Rule tags, such as "requires-XXX", may also be added
   * as keys to the map.
   */
  public ImmutableMap<String, String> getExecutionInfo() {
    return executionInfo;
  }
}

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

import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.analysis.TransitiveInfoProvider;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;

import java.util.Map;

/**
 * This provider can be implemented by rules which need special environments to run in (especially
 * tests).
 */
@Immutable
public final class ExecutionInfoProvider implements TransitiveInfoProvider {

  private final ImmutableMap<String, String> executionInfo;

  public ExecutionInfoProvider(Map<String, String> requirements) {
    this.executionInfo = ImmutableMap.copyOf(requirements);
  }

  /**
   * Returns a map to indicate special execution requirements, such as hardware
   * platforms, etc. Rule tags, such as "requires-XXX", may also be added
   * as keys to the map.
   */
  public ImmutableMap<String, String> getExecutionInfo() {
    return executionInfo;
  }
}

Remove reference to web browsers in bazel documentation.


package com.puppycrawl.tools.checkstyle.checks.coding;

import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;

import java.io.File;
public class ReturnCountCheckTest extends BaseCheckTestCase
{
    public void testDefault() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(ReturnCountCheck.class);
        final String[] expected = {
            "18:5: Return count is 7 (max allowed is 2).",
            "35:17: Return count is 6 (max allowed is 2).",
        };
        verify(checkConfig, getPath("coding" + File.separator + "InputReturnCount.java"), expected);
    }
}

package com.puppycrawl.tools.checkstyle.checks.coding;

import com.puppycrawl.tools.checkstyle.BaseCheckTestCase;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;

import java.io.File;
public class ReturnCountCheckTest extends BaseCheckTestCase
{
    public void testDefault() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(ReturnCountCheck.class);
        final String[] expected = {
            "18:5: Return count is 7 (max allowed is 2).",
            "35:17: Return count is 6 (max allowed is 2).",
        };
        verify(checkConfig, getPath("coding" + File.separator + "InputReturnCount.java"), expected);
    }

    public void testFormat() throws Exception
    {
        final DefaultConfiguration checkConfig =
            createCheckConfig(ReturnCountCheck.class);
        checkConfig.addAttribute("format", "^$");
        final String[] expected = {
            "5:5: Return count is 7 (max allowed is 2).",
            "18:5: Return count is 7 (max allowed is 2).",
            "35:17: Return count is 6 (max allowed is 2).",
        };
        verify(checkConfig, getPath("coding" + File.separator + "InputReturnCount.java"), expected);
    }
}

Test for format property of ReturnCount check


package com.google.testing.pogen;

import com.google.common.base.Preconditions;

public class Seed {
	public static void main(String[] args) {
		int a = 0;
		int b, c;
		class A {
		}

		checkArgument(args == null);
		checkArgument(args == null, "test");
		Preconditions.checkArgument(args != null);
		Preconditions.checkArgument(args != null, "test");
		com.google.common.base.Preconditions.checkArgument(args.length == 0);
		com.google.common.base.Preconditions.checkArgument(args.length == 0, "test");

		TEST:
		for (i = 0; i < args.length; i++) {
			for (; true; ) {
				System.out.println();
			}
		}
		TEST2:
		while (args.length == 0) {
			while (true) {
				System.out.println();
			}
		}
		TEST3:
		do {
			do {
			} while (args.length == 0);
		} while (args.length == 0);
		{}
		if (args.length < 0) {
			if (true) {
			}
			TEST4:
			System.out.println();
			;
			{ System.out.println(); }
		}
		;
	}
}

package com.google.testing.pogen;

import com.google.common.base.Preconditions;

public class Seed {
	public static void main(String[] args) {
		int a = 0;
		int b, c;
		class A {
		}

		checkArgument(args == null);
		checkArgument(args == null, "test");
		Preconditions.checkArgument(args != null);
		Preconditions.checkArgument(args != null, "test");
		com.google.common.base.Preconditions.checkArgument(args.length == 0);
		com.google.common.base.Preconditions.checkArgument(args.length == 0, "test");

		TEST:
		for (i = 0; i < args.length; i++) {
		}
		TEST2:
		while (args.length == 0) {
		}
		TEST3:
		do {
		} while (args.length == 0);
		if (args.length < 0) {
			TEST4:
			System.out.println();
			;
			{ System.out.println(); }
		}
	}
}

Improve Java seed source code.


// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription.impl;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Checksums of config definition payload or config payload,
 * md5 and xxhash64 are the supported types at the moment.
 *
 * @author hmusum
 */
public class PayloadChecksum {

    private static final Pattern hexChecksumPattern = Pattern.compile("[0-9a-zA-Z]+");

    private final String checksum;
    private final Type type;

    public PayloadChecksum(String checksum) {
        this.checksum = checksum;
        this.type = Type.MD5;
    }

    public static PayloadChecksum empty() {
        return new PayloadChecksum("");
    }

    public String asString() { return checksum; }

    public Type type() { return type; }

    public enum Type {MD5, XXHASH64}

    public boolean valid() {
        if (checksum.equals("")) return true;  // Empty checksum is ok (e.g. when running 'vespa-get-config')

        if (type == Type.MD5 && checksum.length() != 32) {
            return false;
        } else if (type == Type.XXHASH64 && checksum.length() != 16) {
            return false;
        }

        Matcher m = hexChecksumPattern.matcher(checksum);
        return m.matches();
    }

}

// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription.impl;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Checksums of config definition payload or config payload,
 * md5 and xxhash64 are the supported types at the moment.
 *
 * @author hmusum
 */
public class PayloadChecksum {

    private static final Pattern hexChecksumPattern = Pattern.compile("[0-9a-fA-F]+");

    private final String checksum;
    private final Type type;

    public PayloadChecksum(String checksum) {
        this.checksum = checksum;
        this.type = Type.MD5;
    }

    public static PayloadChecksum empty() {
        return new PayloadChecksum("");
    }

    public String asString() { return checksum; }

    public Type type() { return type; }

    public enum Type {MD5, XXHASH64}

    public boolean valid() {
        if (checksum.equals("")) return true;  // Empty checksum is ok (e.g. when running 'vespa-get-config')

        if (type == Type.MD5 && checksum.length() != 32) {
            return false;
        } else if (type == Type.XXHASH64 && checksum.length() != 16) {
            return false;
        }

        Matcher m = hexChecksumPattern.matcher(checksum);
        return m.matches();
    }

}

Update hex pattern to only contain hex characters


package seedu.emeraldo.model.task;

import seedu.emeraldo.commons.exceptions.IllegalValueException;

/**
 * Represents a Person's address in the address book.
 * Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)}
 */
public class DateTime {

    public static final String MESSAGE_ADDRESS_CONSTRAINTS = "Person addresses can be in any format";
    public static final String ADDRESS_VALIDATION_REGEX = ".+";

    public final String value;

    /**
     * Validates given address.
     *
     * @throws IllegalValueException if given address string is invalid.
     */
    public DateTime(String address) throws IllegalValueException {
        assert address != null;
        if (!isValidAddress(address)) {
            throw new IllegalValueException(MESSAGE_ADDRESS_CONSTRAINTS);
        }
        this.value = address;
    }

    private static boolean isValidAddress(String test) {
        return test.matches(ADDRESS_VALIDATION_REGEX);
    }

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

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof DateTime // instanceof handles nulls
                && this.value.equals(((DateTime) other).value)); // state check
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

}

package seedu.emeraldo.model.task;

import seedu.emeraldo.commons.exceptions.IllegalValueException;

/**
 * Represents a Person's address in the address book.
 * Guarantees: immutable; is valid as declared in {@link #isValidAddress(String)}
 */
public class DateTime {

    public static final String MESSAGE_ADDRESS_CONSTRAINTS = "Person addresses can be in any format";
    public static final String ADDRESS_VALIDATION_REGEX = "(.+)?";

    public final String value;

    /**
     * Validates given address.
     *
     * @throws IllegalValueException if given address string is invalid.
     */
    public DateTime(String address) throws IllegalValueException {
        assert address != null;
        if (!isValidAddress(address)) {
            throw new IllegalValueException(MESSAGE_ADDRESS_CONSTRAINTS);
        }
        this.value = address;
    }

    private static boolean isValidAddress(String test) {
        return test.matches(ADDRESS_VALIDATION_REGEX);
    }

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

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof DateTime // instanceof handles nulls
                && this.value.equals(((DateTime) other).value)); // state check
    }

    @Override
    public int hashCode() {
        return value.hashCode();
    }

}

Change dateTime validation regex - it is now optional


/*
 * Copyright (C) 2014 Rafał Krupiński
 *
 * 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.xeiam.xchange.utils.nonce;

import si.mazi.rescu.SynchronizedValueFactory;

/**
 * Default implementation of {@link SynchronizedValueFactory} that returns @{link System#currentTimeMillis}.
 *
 * Note that createValue is normally called in a synchronized block.
 *
 * @author Rafał Krupiński
 */
public class LongTimeNonceFactory implements SynchronizedValueFactory<Long> {
    public Long createValue() {
        return System.currentTimeMillis();
    }
}

package com.xeiam.xchange.utils.nonce;

import si.mazi.rescu.SynchronizedValueFactory;

/**
 * Default implementation of {@link SynchronizedValueFactory} that returns @{link System#currentTimeMillis}.
 *
 * Note that createValue is normally called in a synchronized block.
 */
public class LongTimeNonceFactory implements SynchronizedValueFactory<Long> {
    public Long createValue() {
        return System.currentTimeMillis();
    }
}

Remove (c) and @author from a class


import java.io.IOException;

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

import com.twilio.twiml.messaging.Body;
import com.twilio.twiml.messaging.Message;
import com.twilio.twiml.MessagingResponse;
import com.twilio.twiml.TwiMLException;

public class TwilioServlet extends HttpServlet {
  public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
    String body = request.getParameter("Body");
    String message = "Message";
    if (body == "hello") {
      // Use a generic message
      message = "Hi there!";
    } else if (body == "bye") {
      // Use the caller's name
      message = "Goodbye!";
    }

    // Create a TwiML response and add our friendly message.
    Body messageBody = new Body.Builder(message).build();
    Message sms = new Message.Builder().body(messageBody).build();
    MessagingResponse twiml = new MessagingResponse.Builder().message(sms).build();

    response.setContentType("application/xml");

    try {
      response.getWriter().print(twiml.toXml());
    } catch (TwiMLException e) {
      e.printStackTrace();
    }
  }
}

import java.io.IOException;

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

import com.twilio.twiml.messaging.Body;
import com.twilio.twiml.messaging.Message;
import com.twilio.twiml.MessagingResponse;
import com.twilio.twiml.TwiMLException;

public class TwilioServlet extends HttpServlet {
  public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
    String body = request.getParameter("Body");
    String message = "Message";
    if (body.equals("hello")) {
      // Say hi
      message = "Hi there!";
    } else if (body.equals("bye")) {
      // Say goodbye
      message = "Goodbye!";
    }

    // Create a TwiML response and add our friendly message.
    Body messageBody = new Body.Builder(message).build();
    Message sms = new Message.Builder().body(messageBody).build();
    MessagingResponse twiml = new MessagingResponse.Builder().message(sms).build();

    response.setContentType("application/xml");

    try {
      response.getWriter().print(twiml.toXml());
    } catch (TwiMLException e) {
      e.printStackTrace();
    }
  }
}

Use .equals instead of == to check message body


package carpentersblocks.util;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import carpentersblocks.util.registry.ItemRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class CarpentersBlocksTab extends CreativeTabs {

    public CarpentersBlocksTab(String label)
    {
        super(label);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public Item getTabIconItem()
    {
        return ItemRegistry.itemCarpentersHammer;
    }

    @Override
    public String getTranslatedTabLabel()
    {
        return LanguageRegistry.instance().getStringLocalization("itemGroup.carpentersBlocks.name");
    }

}

package carpentersblocks.util;

import net.minecraft.client.resources.I18n;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import carpentersblocks.util.registry.ItemRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class CarpentersBlocksTab extends CreativeTabs {

    public CarpentersBlocksTab(String label)
    {
        super(label);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public Item getTabIconItem()
    {
        return ItemRegistry.itemCarpentersHammer;
    }

    @Override
    public String getTranslatedTabLabel()
    {
    	return I18n.format("itemGroup.carpentersBlocks.name", new Object[0]);
    }

}

Change tab translation to new I18n format.


package com.mhackner.bamboo;

import com.atlassian.bamboo.chains.Chain;
import com.atlassian.bamboo.chains.ChainExecution;
import com.atlassian.bamboo.chains.ChainResultsSummary;
import com.atlassian.bamboo.chains.plugins.PostChainAction;
import com.atlassian.bamboo.configuration.AdministrationConfigurationAccessor;
import com.atlassian.bamboo.security.EncryptionService;

import org.jetbrains.annotations.NotNull;
import org.kohsuke.github.GHCommitState;

public class GitHubStatusPostChain extends AbstractGitHubStatusAction implements PostChainAction {

    public GitHubStatusPostChain(AdministrationConfigurationAccessor adminConfigAccessor,
                                 EncryptionService encryptionService) {
        super(adminConfigAccessor, encryptionService);
    }

    @Override
    public void execute(@NotNull Chain chain, @NotNull ChainResultsSummary chainResultsSummary,
                        @NotNull ChainExecution chainExecution) {
        switch (chainResultsSummary.getBuildState()) {
        case FAILED:
            updateStatus(GHCommitState.FAILURE, chain, chainExecution);
            break;
        case SUCCESS:
            updateStatus(GHCommitState.SUCCESS, chain, chainExecution);
            break;
        case UNKNOWN:
            updateStatus(GHCommitState.ERROR, chain, chainExecution);
            break;
        }
    }

}

package com.mhackner.bamboo;

import com.atlassian.bamboo.builder.BuildState;
import com.atlassian.bamboo.chains.Chain;
import com.atlassian.bamboo.chains.ChainExecution;
import com.atlassian.bamboo.chains.ChainResultsSummary;
import com.atlassian.bamboo.chains.plugins.PostChainAction;
import com.atlassian.bamboo.configuration.AdministrationConfigurationAccessor;
import com.atlassian.bamboo.security.EncryptionService;
import com.google.common.collect.ImmutableMap;

import org.jetbrains.annotations.NotNull;
import org.kohsuke.github.GHCommitState;

public class GitHubStatusPostChain extends AbstractGitHubStatusAction implements PostChainAction {

    private static final ImmutableMap<BuildState, GHCommitState> states = ImmutableMap.of(
            BuildState.FAILED, GHCommitState.FAILURE,
            BuildState.SUCCESS, GHCommitState.SUCCESS,
            BuildState.UNKNOWN, GHCommitState.ERROR
    );

    public GitHubStatusPostChain(AdministrationConfigurationAccessor adminConfigAccessor,
                                 EncryptionService encryptionService) {
        super(adminConfigAccessor, encryptionService);
    }

    @Override
    public void execute(@NotNull Chain chain, @NotNull ChainResultsSummary chainResultsSummary,
                        @NotNull ChainExecution chainExecution) {
        updateStatus(states.get(chainResultsSummary.getBuildState()), chain, chainExecution);
    }

}

Refactor build state mapping to an actual map


package ca.corefacility.bioinformatics.irida.repositories;

import org.springframework.data.repository.PagingAndSortingRepository;

import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
import ca.corefacility.bioinformatics.irida.model.Project;
import ca.corefacility.bioinformatics.irida.model.Sample;

/**
 * A repository for storing Sample objects
 *
 * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
 */
public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

	/**
	 * Get a {@link Sample} with the given string sample identifier from a
	 * specific project.
	 *
	 * @param project
	 *            The {@link Project} that the {@link Sample} belongs to.
	 * @param externalSampleId
	 *            The string sample identifier for a sample
	 * @return The {@link Sample} for this identifier
	 * @throws EntityNotFoundException
	 *             if a sample with this identifier doesn't exist
	 */
	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
}

package ca.corefacility.bioinformatics.irida.repositories;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import ca.corefacility.bioinformatics.irida.exceptions.EntityNotFoundException;
import ca.corefacility.bioinformatics.irida.model.Project;
import ca.corefacility.bioinformatics.irida.model.Sample;

/**
 * A repository for storing Sample objects
 *
 * @author Thomas Matthews <thomas.matthews@phac-aspc.gc.ca>
 * @author Franklin Bristow <franklin.bristow@phac-aspc.gc.ca>
 */
public interface SampleRepository extends PagingAndSortingRepository<Sample, Long> {

	/**
	 * Get a {@link Sample} with the given string sample identifier from a
	 * specific project.
	 *
	 * @param project
	 *            The {@link Project} that the {@link Sample} belongs to.
	 * @param externalSampleId
	 *            The string sample identifier for a sample
	 * @return The {@link Sample} for this identifier
	 * @throws EntityNotFoundException
	 *             if a sample with this identifier doesn't exist
	 */
	@Query("select j.sample from ProjectSampleJoin j where j.project = ?1 and j.sample.externalSampleId = ?2")
	public Sample getSampleByExternalSampleId(Project p, String externalSampleId) throws EntityNotFoundException;
}

Add query for getting sample by external identifier.


package org.drools.builder;

public enum ResourceType {
    /** Drools Rule Language */
    DRL,

    /** Drools XML Rule Language */
    XDRL,

    /** Drools DSL */
    DSL,

    /** Drools DSL Rule */
    DSLR,

    /** Drools Rule Flow Language */
    DRF,

    /** Decision Table */
    DTABLE,

    /** Binary Package */
    PKG,

    /** ChangeSet */
    ChangeSet;
}

package org.drools.builder;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class ResourceType {

	private String name;

    private static final Map<String, ResourceType> CACHE = Collections.synchronizedMap( new HashMap<String, ResourceType>() );

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

    public static ResourceType addResourceTypeToRegistry(final String resourceType) {
		ResourceType resource = new ResourceType(resourceType);
		CACHE.put(resourceType, resource);
		return resource;
	}

    /** Drools Rule Language */
    public static final ResourceType DRL = addResourceTypeToRegistry("DRL");

    /** Drools XML Rule Language */
    public static final ResourceType XDRL = addResourceTypeToRegistry("XDRL");

    /** Drools DSL */
    public static final ResourceType DSL = addResourceTypeToRegistry("DSL");

    /** Drools DSL Rule */
    public static final ResourceType DSLR = addResourceTypeToRegistry("DSLR");

    /** Drools Rule Flow Language */
    public static final ResourceType DRF = addResourceTypeToRegistry("DRF");

    /** Decision Table */
    public static final ResourceType DTABLE = addResourceTypeToRegistry("DTABLE");

    /** Binary Package */
    public static final ResourceType PKG = addResourceTypeToRegistry("PKG");

    /** ChangeSet */
    public static final ResourceType ChangeSet = addResourceTypeToRegistry("ChangeSet");

    public static ResourceType getResourceType(final String resourceType) {
    	ResourceType resource = CACHE.get(resourceType);
        if ( resource == null ) {
            throw new RuntimeException( "Unable to determine resource type " + resourceType );
        }
        return resource;
    }

    @Override
    public int hashCode() {
        return name.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if ( this == obj ) return true;
        if ( obj == null ) return false;
        if ( getClass() != obj.getClass() ) return false;
        final ResourceType other = (ResourceType) obj;
        if ( !name.equals( other.name ) ) return false;
        return true;
    }

}

Improve process persistence usability - improved command-based implementation of StatefulKnowledgeSession


package com.infinityraider.infinitylib.capability;

import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;

import javax.annotation.Nullable;

public interface ICapabilityImplementation<C extends ICapabilityProvider, V> {
    Capability<V> getCapability();

    boolean shouldApplyCapability(C carrier);

    V createNewValue(C carrier);

    ResourceLocation getCapabilityKey();

    Class<C> getCarrierClass();

    default LazyOptional<V> getCapability(C carrier) {
        return carrier.getCapability(this.getCapability());
    }

    default LazyOptional<V> getCapability(C carrier, @Nullable Direction dir) {
        return carrier.getCapability(this.getCapability(), dir);
    }
}

package com.infinityraider.infinitylib.capability;

import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.common.util.LazyOptional;

import javax.annotation.Nullable;

public interface ICapabilityImplementation<C extends ICapabilityProvider, V> {
    Capability<V> getCapability();

    boolean shouldApplyCapability(C carrier);

    V createNewValue(C carrier);

    ResourceLocation getCapabilityKey();

    Class<C> getCarrierClass();

    default LazyOptional<V> getCapability(C carrier) {
        return carrier == null ? LazyOptional.empty() : carrier.getCapability(this.getCapability());
    }

    default LazyOptional<V> getCapability(C carrier, @Nullable Direction dir) {
        return carrier.getCapability(this.getCapability(), dir);
    }
}

Fix potential NPE in the Capabilities


package uk.ac.ebi.quickgo.ontology.common.coterm;

/**
 * @author Tony Wardell
 * Date: 29/09/2016
 * Time: 16:08
 * Created with IntelliJ IDEA.
 */
public class CoTermLimit {

    int defaultLimit;

    public CoTermLimit(int defaultLimit) {
        this.defaultLimit = defaultLimit;
    }

    public int workoutLimit(String limit) {
        int limitNumeric = 0;
        if (limit == null) {
            limitNumeric = defaultLimit;
        } else {
            if (LimitValue.FULL.toString().equals(limitNumeric)) {
                limitNumeric = Integer.MAX_VALUE;
            } else {
                try {
                    limitNumeric = Integer.parseInt(limit);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The value for limit co-occurring terms is not ALL, or 0-100");
                }
            }
        }
        return limitNumeric;
    }

    enum LimitValue{
        FULL
    }
}

package uk.ac.ebi.quickgo.ontology.common.coterm;

/**
 * @author Tony Wardell
 * Date: 29/09/2016
 * Time: 16:08
 * Created with IntelliJ IDEA.
 */
public class CoTermLimit {

    int defaultLimit;

    public CoTermLimit(int defaultLimit) {
        this.defaultLimit = defaultLimit;
    }

    public int workoutLimit(String limit) {
        int limitNumeric = 0;
        if (limit == null) {
            limitNumeric = defaultLimit;
        } else {
            if (LimitValue.ALL.toString().equalsIgnoreCase(limit)) {
                limitNumeric = Integer.MAX_VALUE;
            } else {
                if (limit.trim().length() == 0) {
                    limitNumeric = defaultLimit;
                } else {
                    try {
                        limitNumeric = Integer.parseInt(limit);

                        if (limitNumeric == 0) {
                            limitNumeric = defaultLimit;
                        }
                    } catch (NumberFormatException e) {
                        throw new IllegalArgumentException("The value for co-occurring terms limit is not ALL, or a " +
                                "number");
                    }
                }
            }
        }
        return limitNumeric;
    }

    enum LimitValue {
        ALL
    }
}

Add some logic for spaces and zeros.


package net.soundvibe.reacto.metric;

import com.codahale.metrics.*;

/**
 * @author linas on 17.2.9.
 */
public interface Metrics {

    MetricRegistry REGISTRY = new MetricRegistry();

    Initializer INITIALIZER = new Initializer();

    class Initializer {

        static {
            REGISTRY.register("jvmAttributes", new JvmAttributeGaugeSet());
            REGISTRY.register("jvmThreads", new JvmThreadGaugeSet());
            REGISTRY.register("jvmMemory", new JvmMemoryGaugeSet());
        }

    }

}

package net.soundvibe.reacto.metric;

import com.codahale.metrics.*;

/**
 * @author linas on 17.2.9.
 */
public interface Metrics {

    MetricRegistry REGISTRY = SharedMetricRegistries.getOrCreate("default");;

    Initializer INITIALIZER = new Initializer();

    class Initializer {

        static {
            REGISTRY.register("jvmAttributes", new JvmAttributeGaugeSet());
            REGISTRY.register("jvmThreads", new JvmThreadGaugeSet());
            REGISTRY.register("jvmMemory", new JvmMemoryGaugeSet());
        }

    }

}

Use default shared metric registry


package nl.homesensors.sensortag;

import java.util.Objects;

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;

@RequiredArgsConstructor
public final class SensorCode {

    @Getter
    private final String value;

    public static SensorCode of(final String value) {
        return new SensorCode(value);
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        final SensorCode that = (SensorCode) o;
        return Objects.equals(value, that.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this).append("value", value)
                                        .toString();
    }
}

package nl.homesensors.sensortag;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@RequiredArgsConstructor
@ToString
@EqualsAndHashCode
public final class SensorCode {

    @Getter
    private final String value;

    public static SensorCode of(final String value) {
        return new SensorCode(value);
    }
}

Replace custom ToString, Equals And HashCode with Lombok annotations


package org.dstadler.commoncrawl;

/**
 * Which extensions we are interested in.
 *
 * @author dominik.stadler
 */
public class Extensions {

    private static final String[] EXTENSIONS = new String[] {
        // Excel
        ".xls",
        ".xlsx",
        ".xlsm",
        ".xltx",
        ".xlsb",

        // Word
        ".doc",
        ".docx",
        ".dotx",
        ".docm",
        ".ooxml",

        // Powerpoint
        ".ppt",
        ".pot",
        ".pptx",
        ".pptm",
        ".ppsm",
        ".ppsx",
        ".thmx",
        ".potx",

        // Outlook
        ".msg",

        // Publisher
        ".pub",

        // Visio - binary
        ".vsd",
        ".vss",
        ".vst",
        ".vsw",

        // Visio - ooxml (currently unsupported)
        ".vsdm",
        ".vsdx",
        ".vssm",
        ".vssx",
        ".vstm",
        ".vstx",

        // POIFS
        ".ole2",

        // Microsoft Admin Template?
        ".adm",

        // Microsoft TNEF
        // ".dat", new HMEFFileHandler());
    };

    public static boolean matches(String url) {
        for(String ext : EXTENSIONS) {
            if(url.endsWith(ext)) {
                return true;
            }
        }

        return false;
    }
}

package org.dstadler.commoncrawl;

/**
 * Which extensions we are interested in.
 *
 * If you want to change which files are downloaded, just can
 * set a different list of file-extensions here, e.g.
 *
 * <pre>
           ".pdf"
 </pre>
 *
 * would find and download PDF documents.
 */
public class Extensions {

    private static final String[] EXTENSIONS = new String[] {
        // Excel
        ".xls",
        ".xlsx",
        ".xlsm",
        ".xltx",
        ".xlsb",

        // Word
        ".doc",
        ".docx",
        ".dotx",
        ".docm",
        ".ooxml",

        // Powerpoint
        ".ppt",
        ".pot",
        ".pptx",
        ".pptm",
        ".ppsm",
        ".ppsx",
        ".thmx",
        ".potx",

        // Outlook
        ".msg",

        // Publisher
        ".pub",

        // Visio - binary
        ".vsd",
        ".vss",
        ".vst",
        ".vsw",

        // Visio - ooxml (currently unsupported)
        ".vsdm",
        ".vsdx",
        ".vssm",
        ".vssx",
        ".vstm",
        ".vstx",

        // POIFS
        ".ole2",

        // Microsoft Admin Template?
        ".adm",

        // Microsoft TNEF
        // ".dat", new HMEFFileHandler());
    };

    public static boolean matches(String url) {
        for(String ext : EXTENSIONS) {
            if(url.endsWith(ext)) {
                return true;
            }
        }

        return false;
    }
}

Add a bit more JavaDoc


/**
 * This file is part of Frames, licensed under the MIT License (MIT).
 *
 * Copyright (c) 2014 ObsidianBox <http://obsidianbox.org/>
 *
 * 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 org.obsidianbox.frames;

public interface IMaskedField extends ITextField {
    /**
     * Gets the current character used to mask text input. Defaults to an asterisk (*).
     *
     * @return the mask character.
     */
    char getMaskCharacter();

    /**
     * Sets the character to use to mask text that is put into this field.
     *
     * @param character the mask character.
     * @return the masked field.
     */
    IMaskedField setMaskCharacter(char character);
}

Add license header to IMaskedTextField


package org.clubrockisen.dao;

import java.sql.Connection;

import org.clubrockisen.connection.MySQLConnection;
import org.clubrockisen.entities.Member;

/**
 * The factory for the MySQL DAO classes.
 * @author Alex
 */
public class MySQLDAOFactory extends AbstractDAOFactory {
	protected static final Connection connection = MySQLConnection.getInstance();

	/* (non-Javadoc)
	 * @see org.clubrockisen.dao.AbstractDAOFactory#getMemberDAO()
	 */
	@Override
	public DAO<Member> getMemberDAO () {
		return new MySQLMemberDAO();
	}
}

package org.clubrockisen.dao;

import java.sql.Connection;

import org.clubrockisen.connection.MySQLConnection;
import org.clubrockisen.entities.Member;

/**
 * The factory for the MySQL DAO classes.
 * @author Alex
 */
public class MySQLDAOFactory extends AbstractDAOFactory {
	protected static final Connection CONNECTION = MySQLConnection.getInstance();

	/* (non-Javadoc)
	 * @see org.clubrockisen.dao.AbstractDAOFactory#getMemberDAO()
	 */
	@Override
	public DAO<Member> getMemberDAO () {
		return new MySQLMemberDAO();
	}
}

Change the name of the constant use the correct casing.


package co.phoenixlab.discord.commands;

import co.phoenixlab.discord.MessageContext;
import co.phoenixlab.discord.api.DiscordApiClient;
import co.phoenixlab.discord.api.entities.Channel;
import co.phoenixlab.discord.api.entities.Message;
import co.phoenixlab.discord.api.entities.User;

public class CommandUtil {

    static User findUser(MessageContext context, String username) {
        Message message = context.getMessage();
        User user;
        Channel channel = context.getApiClient().getChannelById(message.getChannelId());
        //  Attempt to find the given user
        //  If the user is @mentioned, try that first
        if (message.getMentions() != null && message.getMentions().length > 0) {
            user = message.getMentions()[0];
        } else {
            user = context.getApiClient().findUser(username, channel.getParent());
        }
        //  Try matching by ID
        if (user == DiscordApiClient.NO_USER) {
            user = context.getApiClient().getUserById(username, channel.getParent());
        }
        return user;
    }
}

package co.phoenixlab.discord.commands;

import co.phoenixlab.discord.MessageContext;
import co.phoenixlab.discord.api.entities.Channel;
import co.phoenixlab.discord.api.entities.Message;
import co.phoenixlab.discord.api.entities.User;

public class CommandUtil {

    static User findUser(MessageContext context, String username) {
        Message message = context.getMessage();
        User user;
        Channel channel = context.getApiClient().getChannelById(message.getChannelId());
        //  Attempt to find the given user
        //  If the user is @mentioned, try that first
        if (message.getMentions() != null && message.getMentions().length > 0) {
            user = message.getMentions()[0];
        } else {
            //  Try exact match, frontal match, ID match, and fuzzy match
            user = context.getApiClient().findUser(username, channel.getParent());
        }
        return user;
    }
}

Remove duplicate funct in CmdUtil.findUser()


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

package org.mskcc.cbio.oncokb.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 *
 * @author jgao
 */
public final class PropertiesUtils {
    private static Properties PROPERTIES;
    private PropertiesUtils() {
        throw new AssertionError();
    }

    public static String getProperties(String name) throws IOException {
        if(name == null) {
            return null;
        }

        if(PROPERTIES == null) {
            String propFileName = "properties/config.properties";
            PROPERTIES = new Properties();
            InputStream inputStream = PropertiesUtils.class.getClassLoader().getResourceAsStream(propFileName);

            if (inputStream != null) {
                PROPERTIES.load(inputStream);
            } else {
                throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath");
            }
            inputStream.close();
        }

        return PROPERTIES.get(name) == null ? null : (String)PROPERTIES.get(name);
    }
}

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

package org.mskcc.cbio.oncokb.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 *
 * @author jgao
 */
public final class PropertiesUtils {
    private static Properties PROPERTIES;
    private PropertiesUtils() {
        throw new AssertionError();
    }

    public static String getProperties(String name) throws IOException {
        if(name == null) {
            return null;
        }

        if(PROPERTIES == null) {
            String propFileName = "properties/config.properties";
            PROPERTIES = new Properties();
            InputStream inputStream = PropertiesUtils.class.getClassLoader().getResourceAsStream(propFileName);

            if (inputStream != null) {
                PROPERTIES.load(inputStream);
            } else {
                throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath");
            }
            inputStream.close();
        }

        // use system property if available, otherwise get from file
        return System.getProperty(name, PROPERTIES.get(name) == null ? null : (String)PROPERTIES.get(name));
    }
}

Allow setting properties with java system props


package es.sandbox.spikes.java8.interfaces;

import es.sandbox.spikes.java8.InvocationSpy;
import org.junit.Before;
import org.junit.Test;

import static es.sandbox.spikes.java8.InvocationSpy.spy;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * Created by jeslopalo on 30/12/15.
 */
public class FunctionalInterfaceSpecs {

    private InvocationSpy spy;

    private static final void callFunctionalInterface(SimpleFunctionalInterface functionalInterface) {
        functionalInterface.doWork();
    }

    @Before
    public void setup() {
        this.spy = spy();
    }

    @Test
    public void has_one_callable_method() {
        callFunctionalInterface(() -> this.spy.invocation());

        assertThat(this.spy.invoked()).isTrue();
    }
}

package es.sandbox.spikes.java8.interfaces;

import es.sandbox.spikes.java8.InvocationSpy;
import org.junit.Before;
import org.junit.Test;

import static es.sandbox.spikes.java8.FunctionalInterfaceCaller.call;
import static es.sandbox.spikes.java8.InvocationSpy.spy;
import static org.assertj.core.api.Assertions.assertThat;

/**
 * Created by jeslopalo on 30/12/15.
 */
public class FunctionalInterfaceSpecs {

    private InvocationSpy spy;

    @Before
    public void setup() {
        this.spy = spy();
    }

    @Test
    public void has_one_callable_method() {
        call(() -> this.spy.invocation());

        assertThat(this.spy.invoked()).isTrue();
    }
}

Refactor utility method to FunctionalInterfaceCaller


/**
 *
 */
package org.opennms.dashboard.client;

import com.google.gwt.user.client.ui.FlexTable;

class NotificationView extends PageableTableView {

    private Notification[] m_notifications;

    NotificationView() {
        super(new String[] { "Node", "Service", "Sent Time", "Responder", "Response Time" });
    }

    public void setNotifications(Notification[] notifications) {
        m_notifications = notifications;
        refresh();

    }

	protected void setRow(FlexTable table, int row, int elementIndex) {
		Notification notif = m_notifications[elementIndex];
        table.setText(row, 0, notif.getNodeLabel());
        table.setText(row, 1, notif.getServiceName());
        table.setText(row, 2, ""+notif.getSentTime());
        table.setText(row, 3, notif.getResponder());
        table.setText(row, 4, ""+notif.getRespondTime());
        table.getRowFormatter().setStyleName(row, notif.getSeverity());
    }

    public int getElementCount() {
        return (m_notifications == null ? 0 : m_notifications.length);
    }

}

/**
 *
 */
package org.opennms.dashboard.client;

import com.google.gwt.user.client.ui.FlexTable;

class NotificationView extends PageableTableView {

    private Notification[] m_notifications;

    NotificationView() {
        super(new String[] { "Node", "Service", "Sent Time", "Responder", "Response Time" });
    }

    public void setNotifications(Notification[] notifications) {
        m_notifications = notifications;
        refresh();

    }

	protected void setRow(FlexTable table, int row, int elementIndex) {
		Notification notif = m_notifications[elementIndex];
        table.setText(row, 0, notif.getNodeLabel());
        table.setText(row, 1, notif.getServiceName());
        table.setText(row, 2, ""+notif.getSentTime());
        table.setText(row, 3, notif.getResponder());
        table.setText(row, 4, (notif.getRespondTime() != null) ? notif.getRespondTime().toString() : "");
        table.getRowFormatter().setStyleName(row, notif.getSeverity());
    }

    public int getElementCount() {
        return (m_notifications == null ? 0 : m_notifications.length);
    }

}

Fix the case where respond time is null


/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * 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.intellij.xdebugger.frame;

/**
 * @author traff
 */
public interface XReferrersProvider<T extends XValue> {
  T getReferringObjectsValue();
}

/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * 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.intellij.xdebugger.frame;

/**
 * @author traff
 */
public abstract class XReferrersProvider<T extends XValue> {
  public abstract T getReferringObjectsValue();
}

Make abstract class instead of interface.


package de.retest.recheck.printer.leaf;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import de.retest.ui.diff.DurationDifference;

class DurationDifferencePrinterTest {

	DurationDifferencePrinter cut;

	@BeforeEach
	void setUp() {
		cut = new DurationDifferencePrinter();
	}

	@Test
	void toString_should_print_difference() {
		final DurationDifference difference = mock( DurationDifference.class );
		when( difference.getExpected() ).thenReturn( 0L );
		when( difference.getActual() ).thenReturn( 1L );

		final String string = cut.toString( difference );

		assertThat( string ).isEqualTo( "0.001 s" );
	}

	@Test
	void toString_should_respect_indent() {
		final DurationDifference difference = mock( DurationDifference.class );
		when( difference.getExpected() ).thenReturn( 0L );
		when( difference.getActual() ).thenReturn( 1L );

		final String string = cut.toString( difference, "____" );

		assertThat( string ).startsWith( "____" );
	}
}

package de.retest.recheck.printer.leaf;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import de.retest.ui.diff.DurationDifference;

class DurationDifferencePrinterTest {

	DurationDifferencePrinter cut;

	@BeforeEach
	void setUp() {
		cut = new DurationDifferencePrinter();
	}

	@Test
	void toString_should_handle_positive_difference() {
		final DurationDifference difference = mock( DurationDifference.class );
		when( difference.getExpected() ).thenReturn( 0L );
		when( difference.getActual() ).thenReturn( 1L );

		final String string = cut.toString( difference );

		assertThat( string ).isEqualTo( "0.001 s" );
	}

	@Test
	void toString_should_handle_negative_difference() {
		final DurationDifference difference = mock( DurationDifference.class );
		when( difference.getExpected() ).thenReturn( 1L );
		when( difference.getActual() ).thenReturn( 0L );

		final String string = cut.toString( difference );

		assertThat( string ).isEqualTo( "-0.001 s" );
	}

	@Test
	void toString_should_respect_indent() {
		final DurationDifference difference = mock( DurationDifference.class );
		when( difference.getExpected() ).thenReturn( 0L );
		when( difference.getActual() ).thenReturn( 1L );

		final String string = cut.toString( difference, "____" );

		assertThat( string ).startsWith( "____" );
	}
}

Add tests for positive and negative duration differences


package com.github.tnerevival.core;

import com.github.tnerevival.core.version.ReleaseType;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class UpdateChecker {
  private String url;
  private String build;
  private String currentBuild;

  public UpdateChecker(String url, String currentBuild) {
    this.url = url;
    this.currentBuild = currentBuild;
    getLatestBuild();
  }

  public void getLatestBuild() {
    build = currentBuild;
    try {
        URL url = new URL(this.url);
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
        build = in.readLine();
        in.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public ReleaseType getRelease() {
    Integer latest = Integer.valueOf(build.replace(".", ""));
    Integer current = Integer.valueOf(currentBuild.replace(".", ""));

    if(latest < current) return ReleaseType.PRERELEASE;
    if(latest.equals(current)) return ReleaseType.LATEST;
    return ReleaseType.OUTDATED;
  }
}

package com.github.tnerevival.core;

import com.github.tnerevival.core.version.ReleaseType;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;

public class UpdateChecker {
  private String url;
  private String build;
  private String currentBuild;

  public UpdateChecker(String url, String currentBuild) {
    this.url = url;
    this.currentBuild = currentBuild;
    getLatestBuild();
  }

  public void getLatestBuild() {
    build = currentBuild;
    try {
        URL url = new URL(this.url);
        BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
        this.build = in.readLine();
        in.close();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  public ReleaseType getRelease() {
    Integer latest = Integer.valueOf(build.replace(".", ""));
    Integer current = Integer.valueOf(currentBuild.replace(".", ""));

    if(latest < current) return ReleaseType.PRERELEASE;
    if(latest.equals(current)) return ReleaseType.LATEST;
    return ReleaseType.OUTDATED;
  }

  public String getBuild() {
    return build;
  }

  public String getCurrentBuild() {
    return currentBuild;
  }
}

Add get methods for updater variables.


package lego;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.logging.Log;
import org.neo4j.procedure.*;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Degree {
    @Context
    public GraphDatabaseService db;

    @Context
    public Log log;

    /**
     * Calculate degree of vertex
     *
     * @param label label name
     */
    @Procedure(value = "lego.degree", mode = Mode.READ)
    @Description("Calculate degree of vertex")
    public Stream<DegreeResults> degree(@Name("label") String label) {
        final Label ind = Label.label(label);
        ResourceIterator<Node> nodes = db.findNodes(ind);

        List<DegreeResults> a = new ArrayList<>();

        while (nodes.hasNext()) {
            final Node recordNode = nodes.next();
            DegreeResults t = new DegreeResults(recordNode.getId(), recordNode.getDegree());
            a.add(t);
        }

        if (a.isEmpty()) {
            log.debug("Skipping since index does not exist: `%s`", label);
            return Stream.empty();
        }

        return a.stream();
    }

    public class DegreeResults {
        public final long nodes;
        public final long degree;

        /**
         * @param nodes  node id
         * @param degree node degree
         */
        public DegreeResults(long nodes, long degree) {
            this.degree = degree;
            this.nodes = nodes;
        }

    }
}

package lego;

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.ResourceIterator;
import org.neo4j.logging.Log;
import org.neo4j.procedure.*;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class Degree {
    @Context
    public GraphDatabaseService db;

    @Context
    public Log log;

    /**
     * Calculate degree of vertex
     *
     * @param label label name
     */
    @Procedure(value = "lego.degree", mode = Mode.READ)
    @Description("Calculate degree of vertex")
    public Stream<DegreeResults> degree(@Name("label") String label) {
        final Label ind = Label.label(label);
        ResourceIterator<Node> nodes = db.findNodes(ind);

        return nodes.stream().map((n) -> new DegreeResults(n.getId(), n.getDegree()));
    }

    public class DegreeResults {
        public final long nodes;
        public final long degree;

        /**
         * @param nodes  node id
         * @param degree node degree
         */
        public DegreeResults(long nodes, long degree) {
            this.degree = degree;
            this.nodes = nodes;
        }

    }
}

Replace List with Stream API


package org.camsrobotics.frc2016;

import org.camsrobotics.lib.NerdyJoystick;

/**
 * Driver Station Interface
 *
 * @author Wesley
 *
 */
public class DriverInput {

	public static NerdyJoystick m_driveLeftJoy = new NerdyJoystick(0);
	public static NerdyJoystick m_driveRightJoy = new NerdyJoystick(1);
	public static NerdyJoystick m_buttonBox = new NerdyJoystick(2);

	// Prevents initialization
	private DriverInput()	{}

}

package org.camsrobotics.frc2016;

import org.camsrobotics.lib.NerdyButton;
import org.camsrobotics.lib.NerdyJoystick;

/**
 * Driver Interface
 *
 * @author Wesley
 *
 */
public class DriverInput {

	// Driver Functions
	public static final NerdyJoystick kDriverLeftStick	= new NerdyJoystick(0);
	public static final NerdyJoystick kDriverRightStick	= new NerdyJoystick(1);

	public static final NerdyButton kSnapToVisionTarget	= kDriverRightStick.getButton(99);

	// Operator Functions
	public static final NerdyJoystick kButtonBox		= new NerdyJoystick(2);

	public static final NerdyButton kShooterShortRange	= kButtonBox.getButton(99);
	public static final NerdyButton kShooterMediumRange	= kButtonBox.getButton(99);
	public static final NerdyButton kShooterLongRange	= kButtonBox.getButton(99);
	public static final NerdyButton kShooterVision		= kButtonBox.getButton(99);
	public static final NerdyButton kShoot				= kButtonBox.getButton(99);

}

Add some of the buttons