package collabode;

/**
 * Debugging support.
 */
public class Debug {

    /**
     * Announce the current method on {@link System#out}.
     */
    public static void here(Object... args) {
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        System.out.println(clean(stack[2]) + (stack.length > 3 ? " <-- " + clean(stack[3]): ""));
        if (args.length == 0) return;
        System.out.print("    " + args[0]);
        for (int ii = 1; ii < args.length; ii++) {
            System.out.print(", " + args[ii]);
        }
        System.out.println();
    }

    private static String clean(StackTraceElement point) {
        return point.toString().replace(Debug.class.getPackage().getName() + ".", "");
    }
}

package collabode;

/**
 * Debugging support.
 */
public class Debug {

    /**
     * Announce the current method on {@link System#out}.
     */
    public static void here(Object... args) {
        StackTraceElement[] stack = Thread.currentThread().getStackTrace();
        System.out.println(clean(stack[2]) + (stack.length > 3 ? " <-- " + clean(stack[3]): ""));
        if (args.length == 0) return;
        System.out.print("    " + args[0]);
        for (int ii = 1; ii < args.length; ii++) {
            System.out.print(", " + args[ii]);
        }
        System.out.println();
    }

    private static String clean(StackTraceElement point) {
        return point.toString().replaceAll(Debug.class.getPackage().getName() + "(\\.[a-z]+)*\\.", "");
    }
}

Remove entire package name, otherwise Eclipse cannot link console output to source


package com.pm.server.player;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import com.pm.server.datatype.Coordinate;
import com.pm.server.utils.JsonUtils;

@Component
public abstract class PlayerImpl implements Player {

	private Integer id = 0;
	private Coordinate location;

	private final static Logger log =
			LogManager.getLogger(PlayerImpl.class.getName());

	public void setId(Integer id) {

		log.debug("Setting id to {}", id);

		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setLocation(Coordinate location) {

		String locationString = JsonUtils.objectToJson(location);
		if(locationString != null) {
			log.debug("Setting location to {}", locationString);
		}

		this.location = location;
	}

	public Coordinate getLocation() {
		return location;
	}

}

package com.pm.server.player;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;

import com.pm.server.datatype.Coordinate;
import com.pm.server.utils.JsonUtils;

@Component
public abstract class PlayerImpl implements Player {

	protected Integer id = 0;
	protected Coordinate location;

	private final static Logger log =
			LogManager.getLogger(PlayerImpl.class.getName());

	public void setId(Integer id) {

		log.debug("Setting id to {}", id);

		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setLocation(Coordinate location) {

		String locationString = JsonUtils.objectToJson(location);
		if(locationString != null) {
			log.debug("Setting location to {}", locationString);
		}

		this.location = location;
	}

	public Coordinate getLocation() {
		return location;
	}

}

Change Player data members to protected


package fr.minepod.launcher;

import java.awt.HeadlessException;
import java.io.IOException;

public class CrashReport {
	public static String DebugFilePath = Config.DebugFilePath;

	public static void SendReport(String exception, String when) {
		try {
			if(Config.Logger != null)
				Config.Logger.severe(exception);
			javax.swing.JOptionPane.showMessageDialog(null, exception + "\n" +  Langage.WHEN.toString() + when + "\n\n\n" + Langage.DEBUGINFORMATIONS.toString() + ":\n\n" + fr.minepod.Utils.Files.ReadFile(DebugFilePath), Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		} catch (HeadlessException e) {
			if(Config.Logger != null)
				Config.Logger.severe(e.toString());
			javax.swing.JOptionPane.showMessageDialog(null, e.toString(),  Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		} catch (IOException e) {
			if(Config.Logger != null)
				Config.Logger.severe(e.toString());
			javax.swing.JOptionPane.showMessageDialog(null, e.toString(),  Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		}
        System.exit(0);
	}
}

package fr.minepod.launcher;

import java.awt.HeadlessException;
import java.io.File;
import java.io.IOException;

import fr.minepod.launcher.Config;
import fr.minepod.launcher.Langage;

public class CrashReport {
	public static void SendReport(String exception, String when) {
		try {
			if(Config.Logger != null)
				Config.Logger.severe(exception);

			String debugMsg = "";

			if(new File(Config.DebugFilePath).exists())
				debugMsg = fr.minepod.Utils.Files.ReadFile(Config.DebugFilePath);

			javax.swing.JOptionPane.showMessageDialog(null, exception + "\n" +  Langage.WHEN.toString() + when + "\n\n\n" + Langage.DEBUGINFORMATIONS.toString() + ":\n\n" + debugMsg, Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		} catch (HeadlessException e) {
			if(Config.Logger != null)
				Config.Logger.severe(e.toString());
			javax.swing.JOptionPane.showMessageDialog(null, e.toString(),  Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		} catch (IOException e) {
			if(Config.Logger != null)
				Config.Logger.severe(e.toString());
			javax.swing.JOptionPane.showMessageDialog(null, e.toString(),  Langage.ERROR.toString(), javax.swing.JOptionPane.ERROR_MESSAGE);
		}
        System.exit(0);
	}
}

Check if debug file exists


package de.dhbw.wi13c.jguicreator.data.util;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

public abstract class GUIKomponente extends JPanel
{
	GUIKomponente()
	{
		setPreferredSize(new Dimension(200, 200));
		setOpaque(true);
		setBackground(Color.RED);
		setVisible(true);
	}
}

package de.dhbw.wi13c.jguicreator.data.util;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JPanel;

public abstract class GUIKomponente extends JPanel
{
	protected GUIKomponente()
	{
		this(350, 40);
	}

	protected GUIKomponente(int pWidth, int pHeigth)
	{
		this.setPreferredSize(new Dimension(pWidth, pHeigth));
		this.setBackground(Color.WHITE);
		this.setOpaque(true);
		this.setVisible(true);
	}
}

Change New Constructor for GuiKomponente


package ceylon.language;

/**
 * Class to facilitate method calls using named arguments. This will be
 * removed/replace after M1.
 *
 * @param <R> The type of result
 * @param <X> The type of the thing being called
 */
public abstract class NamedArgumentCall<R,X> {
    protected final X instance;
    protected final java.lang.Object[] args;
    public NamedArgumentCall(final X instance, java.lang.Object... args) {
        this.instance = instance;
        this.args = args;
    }
    public abstract R call();
}

package ceylon.language;

/**
 * Class to facilitate method calls using named arguments. This will be
 * removed/replace after M1.
 *
 * @param <R> The type of result
 * @param <X> The type of the thing being called
 */
public abstract class NamedArgumentCall<R,X> {
    protected final X instance;
    protected final java.lang.Object[] args;
    public NamedArgumentCall(final X instance, java.lang.Object... args) {
        this.instance = instance;
        this.args = args;
    }
}

Fix named arg calls, adding support for qualified/base type expressions


package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}

	public final static int alphaFromColorInt( int c ) { return (c >> 24) & 0xFF; }
	public final static int redFromColorInt( int c ) { return (c >> 16) & 0xFF;	}
	public final static int greenFromColorInt( int c ) { return (c >> 8)  & 0xFF; }
	public final static int blueFromColorInt( int c ) { return c & 0xFF; }

}

package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}

	public static float componentByPercent( float percent ) {
		return percent * 255f;
	}

	public final static int alphaFromColorInt( int c ) { return (c >> 24) & 0xFF; }
	public final static int redFromColorInt( int c ) { return (c >> 16) & 0xFF;	}
	public final static int greenFromColorInt( int c ) { return (c >> 8)  & 0xFF; }
	public final static int blueFromColorInt( int c ) { return c & 0xFF; }

}

Add 255 color value mapper helper


package hello;

import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.UnknownHostException;

import static java.net.InetAddress.getLocalHost;
import static java.time.OffsetDateTime.now;
import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * {@code Heartbeat} needs documentation.
 *
 * @author Brian Oxley
 * @todo Needs documentation
 */
@RestController
public class HeartbeatController {
    @RequestMapping(value = "/heartbeat", method = GET)
    public Heartbeat beat()
            throws UnknownHostException {
        return new Heartbeat();
    }

    @Data
    public static class Heartbeat {
        private final String hostname;
        private final String timestamp = now().toString();

        public Heartbeat()
                throws UnknownHostException {
            hostname = getLocalHost().getCanonicalHostName();
        }
    }
}

package hello;

import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.UnknownHostException;

import static java.lang.management.ManagementFactory.getRuntimeMXBean;
import static java.net.InetAddress.getLocalHost;
import static java.time.Instant.ofEpochMilli;
import static java.time.OffsetDateTime.now;
import static java.time.OffsetDateTime.ofInstant;
import static java.time.ZoneId.systemDefault;
import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * {@code Heartbeat} needs documentation.
 *
 * @author Brian Oxley
 * @todo Needs documentation
 */
@RestController
public class HeartbeatController {
    @RequestMapping(value = "/heartbeat", method = GET)
    public Heartbeat beat()
            throws UnknownHostException {
        return new Heartbeat();
    }

    @Data
    public static class Heartbeat {
        private final String hostname;
        private final String timestamp = now().toString();
        private final String startTime = ofInstant(
                ofEpochMilli(getRuntimeMXBean().getStartTime()),
                systemDefault()).toString();

        public Heartbeat()
                throws UnknownHostException {
            hostname = getLocalHost().getHostName();
        }
    }
}

Add start time to heartbeat.


package com.querins.StockMarket.services;

import com.querins.StockMarket.model.Quote;
import com.querins.StockMarket.model.Stock;
import com.querins.StockMarket.repositories.StockRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessageSendingOperations;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Random;

/**
 * Created by roman on 26.08.17.
 */
@Service
public class StockService {

    private SimpMessageSendingOperations template;
    private StockRepository repository;
    private static final Random r = new Random();

    @Autowired
    public StockService(StockRepository repository, SimpMessageSendingOperations template) {

        this.repository = repository;
        this.template = template;

    }

    @Scheduled(fixedDelay = 1000)
    public void generateQuote() {

        for( Stock stock: repository.findAll() ) {

            BigDecimal price = new BigDecimal(r.nextDouble() * 100).setScale(2, RoundingMode.FLOOR);
            Quote quote = new Quote(stock, price );
            template.convertAndSend("/topic.quotes", quote);

        }

    }

}

package com.querins.StockMarket.services;

import com.querins.StockMarket.model.Quote;
import com.querins.StockMarket.model.Stock;
import com.querins.StockMarket.repositories.StockRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessageSendingOperations;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Random;

/**
 * Created by roman on 26.08.17.
 */
@Service
public class StockService {

    private SimpMessageSendingOperations template;
    private StockRepository repository;
    private static final Random r = new Random();

    @Autowired
    public StockService(StockRepository repository, SimpMessageSendingOperations template) {

        this.repository = repository;
        this.template = template;

        if( this.repository.count() == 0 ) {

            this.repository.save(new Stock("Google", 2));

        }

    }

    @Scheduled(fixedDelay = 1000)
    public void generateQuote() {

        for( Stock stock: repository.findAll() ) {

            BigDecimal price = new BigDecimal(r.nextDouble() * 100).setScale(2, RoundingMode.FLOOR);
            Quote quote = new Quote(stock, price );
            template.convertAndSend("/topic.quotes", quote);

        }

    }

}

Add some stock to repository if it's empty


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

import io.airlift.configuration.Config;
import io.airlift.units.DataSize;

import javax.validation.constraints.NotNull;

public class MemoryConfig
{
    private int splitsPerNode = Runtime.getRuntime().availableProcessors();
    private DataSize maxDataPerNode = new DataSize(128, DataSize.Unit.MEGABYTE);

    @NotNull
    public int getSplitsPerNode()
    {
        return splitsPerNode;
    }

    @Config("splits-per-node")
    public MemoryConfig setSplitsPerNode(int splitsPerNode)
    {
        this.splitsPerNode = splitsPerNode;
        return this;
    }

    @NotNull
    public DataSize getMaxDataPerNode()
    {
        return maxDataPerNode;
    }

    @Config("max-data-per-node")
    public MemoryConfig setMaxDataPerNode(DataSize maxDataPerNode)
    {
        this.maxDataPerNode = maxDataPerNode;
        return this;
    }
}

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

import io.airlift.configuration.Config;
import io.airlift.units.DataSize;

import javax.validation.constraints.NotNull;

public class MemoryConfig
{
    private int splitsPerNode = Runtime.getRuntime().availableProcessors();
    private DataSize maxDataPerNode = new DataSize(128, DataSize.Unit.MEGABYTE);

    @NotNull
    public int getSplitsPerNode()
    {
        return splitsPerNode;
    }

    @Config("memory.splits-per-node")
    public MemoryConfig setSplitsPerNode(int splitsPerNode)
    {
        this.splitsPerNode = splitsPerNode;
        return this;
    }

    @NotNull
    public DataSize getMaxDataPerNode()
    {
        return maxDataPerNode;
    }

    @Config("memory.max-data-per-node")
    public MemoryConfig setMaxDataPerNode(DataSize maxDataPerNode)
    {
        this.maxDataPerNode = maxDataPerNode;
        return this;
    }
}

Fix read max-data-per-node correctly in memory connector config


package org.ops4j.pax.web.service.internal.model;

import javax.servlet.Filter;

public class FilterModel extends BasicModel
{

    private final Filter m_filter;
    private final String[] m_urlPatterns;
    private final String[] m_servletNames;

    public FilterModel( final Filter filter,
                               final String[] urlPatterns,
                               final String[] servletNames,
                               final ContextModel contextModel )
    {
        super( contextModel );

        if( urlPatterns == null && servletNames == null )
        {
            throw new IllegalArgumentException(
                "Registered filter must have at least one url pattern or servlet mapping"
            );
        }

        m_filter = filter;
        m_urlPatterns = urlPatterns;
        m_servletNames = servletNames;
    }

    public Filter getFilter()
    {
        return m_filter;
    }

    public String[] getUrlPatterns()
    {
        return m_urlPatterns;
    }

    public String[] getServletNames()
    {
        return m_servletNames;
    }

}

Reformat code and optimize imports.


package org.araymond.joal.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * Created by raymo on 25/07/2017.
 */
@Configuration
public class EndpointObfuscatorConfiguration {

    private final String pathPrefix;

    public EndpointObfuscatorConfiguration(@Value("${joal.ui.path.prefix}")final String pathPrefix) {
        this.pathPrefix = pathPrefix;
    }

    @Bean
    public DispatcherServlet dispatcherServlet() {
        return new DispatcherServlet();
    }

    @Bean
    public ServletRegistrationBean dispatcherServletRegistration() {
        final ServletRegistrationBean registration = new ServletRegistrationBean(
                dispatcherServlet(),
                "/" + this.pathPrefix + "/*"
        );
        registration.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
        return registration;
    }
}

package org.araymond.joal.web.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.DispatcherServlet;

/**
 * Created by raymo on 25/07/2017.
 */
@ConditionalOnProperty(name = "spring.main.web-environment", havingValue = "true")
@Configuration
public class EndpointObfuscatorConfiguration {

    private final String pathPrefix;

    public EndpointObfuscatorConfiguration(@Value("${joal.ui.path.prefix}")final String pathPrefix) {
        this.pathPrefix = pathPrefix;
    }

    @Bean
    public DispatcherServlet dispatcherServlet() {
        return new DispatcherServlet();
    }

    @Bean
    public ServletRegistrationBean dispatcherServletRegistration() {
        final ServletRegistrationBean registration = new ServletRegistrationBean(
                dispatcherServlet(),
                "/" + this.pathPrefix + "/*"
        );
        registration.setName(DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_REGISTRATION_BEAN_NAME);
        return registration;
    }
}

Add conditionnalOn to EndpointObfuscator ensure it won't be avaiable in non-web context


/*
 *  Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
 *
 *  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 es.bsc.compss.types.execution;

import java.util.List;

public interface InvocationParamCollection<T extends InvocationParam> extends InvocationParam {

    public List<T> getCollectionParameters();

    public void addParameter(T param);

    public int getSize();

}

Add headers and format code


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

package io.requery.sql;

import io.requery.PersistenceException;

/**
 * Exception thrown when the affected row count of a executed statement doesn't match the value
 * expected.
 */
public class RowCountException extends PersistenceException {

    private final long expected;
    private final long actual;

    RowCountException(long expected, long actual) {
        super("Expected " + expected + " row affected actual " + actual);
        this.expected = expected;
        this.actual = expected;
    }

    /**
     * @return the expected affected value count
     */
    public long getExpected() {
        return expected;
    }

    /**
     * @return the actual affected value count
     */
    public long getActual() {
        return actual;
    }
}

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

package io.requery.sql;

import io.requery.PersistenceException;

/**
 * Exception thrown when the affected row count of a executed statement doesn't match the value
 * expected.
 */
public class RowCountException extends PersistenceException {

    private final long expected;
    private final long actual;

    RowCountException(long expected, long actual) {
        super("Expected " + expected + " row affected actual " + actual);
        this.expected = expected;
        this.actual = actual;
    }

    /**
     * @return the expected affected value count
     */
    public long getExpected() {
        return expected;
    }

    /**
     * @return the actual affected value count
     */
    public long getActual() {
        return actual;
    }
}

Fix incorrect expected value assigned


/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Vincent Zhang/PhoenixLAB
 *
 * 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 co.phoenixlab.discord.api.request;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class LogoutRequest {

    private String token;

}

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Vincent Zhang/PhoenixLAB
 *
 * 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 co.phoenixlab.discord.api.request;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotEmpty;

@Getter
@NoArgsConstructor
@AllArgsConstructor
public class LogoutRequest {

    @NotEmpty
    private String token;

}

Add validation to logout request


/**
 * Copyright (c) 2010-2015, openHAB.org and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.openhab.core.types;

/**
 * There are situations when item states do not have any defined value.
 * This might be because they have not been initialized yet (never
 * received an state update so far) or because their state is ambiguous
 * (e.g. a dimmed light that is treated as a switch (ON/OFF) will have
 * an undefined state if it is dimmed to 50%).
 *
 * @author Kai Kreuzer
 * @since 0.1.0
 *
 */
public enum UnDefType implements PrimitiveType, State {
	UNDEF, NULL;

	public String format(String pattern) {
		return String.format(pattern, this.toString());
	}

}

/**
 * Copyright (c) 2010-2015, openHAB.org and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.openhab.core.types;

/**
 * There are situations when item states do not have any defined value.
 * This might be because they have not been initialized yet (never
 * received an state update so far) or because their state is ambiguous
 * (e.g. a dimmed light that is treated as a switch (ON/OFF) will have
 * an undefined state if it is dimmed to 50%).
 *
 * @author Kai Kreuzer
 * @since 0.1.0
 *
 */
public enum UnDefType implements PrimitiveType, State {
	UNDEF, NULL;

	public String toString() {
		switch(this) {
			case UNDEF: return "Undefined";
			case NULL:  return "Uninitialized";
		}
		return "";
	}

	public String format(String pattern) {
		return String.format(pattern, this.toString());
	}

}

Revert "remove the special toString() in order to sync with ESH"


package com.facetedworlds.honeydolist.collaboration;

import android.app.Activity;

import com.facetedworlds.honeydolist.ActivityTaskDispatcher;
import com.updatecontrols.correspondence.Community;
import com.updatecontrols.correspondence.CorrespondenceException;
import com.updatecontrols.correspondence.binary.BinaryHTTPAsynchronousCommunicationStrategy;
import com.updatecontrols.correspondence.memory.MemoryStorageStrategy;

import facetedworlds.honeydo.model.CorrespondenceModel;
import facetedworlds.honeydo.model.Identity;

public class SynchronizationService {

	private static SynchronizationService synchronizationService = new SynchronizationService();

	public static SynchronizationService getInstance() {
		return synchronizationService;
	}

    private Identity identity;

	public void start(Activity context) throws CorrespondenceException {
		Community community = new Community(new MemoryStorageStrategy(), new ActivityTaskDispatcher(context))
			.addAsynchronousCommunicationStrategy(new BinaryHTTPAsynchronousCommunicationStrategy(
				new HoneyDoHTTPConfigurationProvider()
			))
			.addModule(new CorrespondenceModel());

		identity = community.addFact(new Identity("c48b1883978543b5baa0eb89cb2516f9"));
		community.subscribe(new HoneyDoSubscriptionStrategy(identity));

		community.beginReceiving();
	}

	public Identity getIdentity() {
		return identity;
	}
}

package com.facetedworlds.honeydolist.collaboration;

import android.app.Activity;

import com.facetedworlds.honeydolist.ActivityTaskDispatcher;
import com.updatecontrols.correspondence.Community;
import com.updatecontrols.correspondence.CorrespondenceException;
import com.updatecontrols.correspondence.binary.BinaryHTTPAsynchronousCommunicationStrategy;
import com.updatecontrols.correspondence.memory.MemoryStorageStrategy;

import facetedworlds.honeydo.model.CorrespondenceModel;
import facetedworlds.honeydo.model.Identity;

public class SynchronizationService {

	private static SynchronizationService synchronizationService = new SynchronizationService();

	public static SynchronizationService getInstance() {
		return synchronizationService;
	}

    private Identity identity;

	public void start(Activity context) throws CorrespondenceException {
		Community community = new Community(new MemoryStorageStrategy(), new ActivityTaskDispatcher(context))
			.addAsynchronousCommunicationStrategy(new BinaryHTTPAsynchronousCommunicationStrategy(
				new HoneyDoHTTPConfigurationProvider()
			))
			.addModule(new CorrespondenceModel());

		identity = community.addFact(new Identity("547260202db74f018050e01a6e384112"));
		community.subscribe(new HoneyDoSubscriptionStrategy(identity));

		community.beginReceiving();
	}

	public Identity getIdentity() {
		return identity;
	}
}

Use an identity with test data.


package org.objectweb.proactive.ic2d;

import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
		return new ApplicationWorkbenchWindowAdvisor(configurer);
	}

	public void initialize(IWorkbenchConfigurer configurer) {
		/*// To restore window preferences
		super.initialize(configurer);
        configurer.setSaveAndRestore(true);
        */
		// Sets the look of the tabs like Eclipse 3.x
		PlatformUI.getPreferenceStore().setValue(
				IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
				false);
	}

	public String getInitialWindowPerspectiveId() {
		return "org.objectweb.proactive.ic2d.monitoring.perspectives.MonitoringPerspective";//MonitoringPerspective.ID /*DefaultPerspective.ID*/;
	}
}

package org.objectweb.proactive.ic2d;

import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
		return new ApplicationWorkbenchWindowAdvisor(configurer);
	}

	public void initialize(IWorkbenchConfigurer configurer) {
		// To restore window preferences
		//super.initialize(configurer);
        configurer.setSaveAndRestore(true);

		// Sets the look of the tabs like Eclipse 3.x
		PlatformUI.getPreferenceStore().setValue(
				IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS,
				false);
	}

	public String getInitialWindowPerspectiveId() {
		return "org.objectweb.proactive.ic2d.monitoring.perspectives.MonitoringPerspective";//MonitoringPerspective.ID /*DefaultPerspective.ID*/;
	}
}

Save and restore workbench state.


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

package org.gradle.api.internal.changedetection.state;

import org.gradle.api.internal.changedetection.state.mirror.PhysicalSnapshot;
import org.gradle.internal.file.FileType;
import org.gradle.internal.hash.HashCode;

public class DefaultNormalizedFileSnapshot extends AbstractNormalizedFileSnapshot {
    private final String normalizedPath;

    public DefaultNormalizedFileSnapshot(String normalizedPath, FileType type, HashCode contentHash) {
        super(type, contentHash);
        this.normalizedPath = normalizedPath;
    }

    public DefaultNormalizedFileSnapshot(String normalizedPath, PhysicalSnapshot snapshot) {
        this(normalizedPath, snapshot.getType(), snapshot.getType() == FileType.Directory ? DIR_SIGNATURE : snapshot.getHash());
    }

    @Override
    public String getNormalizedPath() {
        return normalizedPath;
    }
}

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

package org.gradle.api.internal.changedetection.state;

import org.gradle.api.internal.changedetection.state.mirror.PhysicalSnapshot;
import org.gradle.internal.file.FileType;
import org.gradle.internal.hash.HashCode;

public class DefaultNormalizedFileSnapshot extends AbstractNormalizedFileSnapshot {
    private final String normalizedPath;

    public DefaultNormalizedFileSnapshot(String normalizedPath, FileType type, HashCode contentHash) {
        super(type, hashForType(type, contentHash));
        this.normalizedPath = normalizedPath;
    }

    public DefaultNormalizedFileSnapshot(String normalizedPath, PhysicalSnapshot snapshot) {
        this(normalizedPath, snapshot.getType(), snapshot.getHash());
    }

    private static HashCode hashForType(FileType fileType, HashCode hash) {
        switch (fileType) {
            case Directory:
                return DIR_SIGNATURE;
            case Missing:
                return MISSING_FILE_SIGNATURE;
            case RegularFile:
                return hash;
            default:
                throw new IllegalStateException("Unknown file type: " + fileType);
        }
    }

    @Override
    public String getNormalizedPath() {
        return normalizedPath;
    }
}

Use correct hash for missing files


package com.amee.domain;

import java.util.Date;

public class ProfileItemsFilter extends LimitFilter {

    private Date startDate = new Date();
    private Date endDate = null;

    @Override
    public int getResultLimitDefault() {
        return 50;
    }

    @Override
    public int getResultLimitMax() {
        return 100;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        if (startDate != null) {
            this.startDate = startDate;
        }
    }
}

package com.amee.domain;

import java.util.Date;

public class ProfileItemsFilter extends LimitFilter {

    private Date startDate = new Date();
    private Date endDate = null;

    /**
     * Setting this to 'start' will only include items which start during the query window.
     * Setting 'end' will include only items which end during the window.
     * The default behaviour is to include any item that intersects the query window.
     */
    private String selectBy;

    // TODO: Handle mode (prorata)

    @Override
    public int getResultLimitDefault() {
        return 50;
    }

    @Override
    public int getResultLimitMax() {
        return 100;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        if (startDate != null) {
            this.startDate = startDate;
        }
    }

    public String getSelectBy() {
        return selectBy;
    }

    public void setSelectBy(String selectBy) {
        this.selectBy = selectBy;
    }
}

Handle selectBy for profile items. PL-11101.


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

import playn.core.PlayN;
import playn.java.JavaPlatform;
import playn.showcase.core.Showcase;

public class ShowcaseJava {

  public static void main(String[] args) {
    JavaPlatform platform = JavaPlatform.register();
    platform.assets().setPathPrefix("playn/showcase/resources");
    platform.graphics().registerFont("Museo-300", "text/Museo.otf");
    PlayN.run(new Showcase());
  }
}

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

import playn.core.PlayN;
import playn.java.JavaPlatform;
import playn.showcase.core.Showcase;

public class ShowcaseJava {

  public static void main(String[] args) {
    JavaPlatform platform = JavaPlatform.register();
    platform.assets().setPathPrefix("playn/showcase/resources");
    platform.graphics().registerFont("Museo-300", "text/Museo.ttf");
    PlayN.run(new Showcase());
  }
}

Use the TTF version of the font in Java.


/*
 * History
 * Created on Nov 23, 2004 by kofke
 */
package etomica.nbr.cell;

import etomica.atom.Atom;
import etomica.atom.AtomArrayList;
import etomica.atom.AtomList;
import etomica.lattice.AbstractLattice;
import etomica.lattice.RectangularLattice;
import etomica.lattice.SiteFactory;

/**
 * Site used to form array of cells for cell-based neighbor listing.  Each
 * cell is capable of holding lists of atoms that are in them.
 */

public class Cell implements java.io.Serializable {

    public Cell(int latticeArrayIndex) {
        this.latticeArrayIndex = latticeArrayIndex;
    }

    public AtomArrayList occupants() {return occupants;}

    public void addAtom(Atom atom) {
        occupants.add(atom);
    }

    public void removeAtom(Atom atom) {
        occupants.removeAndReplace(occupants.indexOf(atom));
    }

    public int getLatticeArrayIndex() {
        return latticeArrayIndex;
    }

    private final AtomArrayList occupants = new AtomArrayList();
    final int latticeArrayIndex;//identifies site in lattice

    public static final SiteFactory FACTORY = new CellFactory();

    public static class CellFactory implements SiteFactory, java.io.Serializable {
        public Object makeSite(AbstractLattice lattice, int[] coord) {
            return new Cell(((RectangularLattice)lattice).arrayIndex(coord));
        }
    };
}

/*
 * History
 * Created on Nov 23, 2004 by kofke
 */
package etomica.nbr.cell;

import etomica.atom.Atom;
import etomica.atom.AtomArrayList;
import etomica.atom.AtomList;
import etomica.lattice.AbstractLattice;
import etomica.lattice.RectangularLattice;
import etomica.lattice.SiteFactory;

/**
 * Site used to form array of cells for cell-based neighbor listing.  Each
 * cell is capable of holding lists of atoms that are in them.
 */

public class Cell implements java.io.Serializable {

    public Cell(int latticeArrayIndex) {
        this.latticeArrayIndex = latticeArrayIndex;
    }

    public AtomArrayList occupants() {return occupants;}

    public void addAtom(Atom atom) {
        occupants.add(atom);
    }

    public void removeAtom(Atom atom) {
        occupants.removeAndReplace(occupants.indexOf(atom));
    }

    public int getLatticeArrayIndex() {
        return latticeArrayIndex;
    }

    private final AtomArrayList occupants = new AtomArrayList(1);
    final int latticeArrayIndex;//identifies site in lattice

    public static final SiteFactory FACTORY = new CellFactory();

    public static class CellFactory implements SiteFactory, java.io.Serializable {
        public Object makeSite(AbstractLattice lattice, int[] coord) {
            return new Cell(((RectangularLattice)lattice).arrayIndex(coord));
        }
    };
}

Use initial capacity of 1. Max is often just 1 or maybe 2. LJMC might get slower, but everyone should use less RAM and some might get faster. Any slowdown should only affect startup, not long-term performance of a simulation.


package de.otto.edison.metricsconfiguration;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter;
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcTagsProvider;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

import javax.servlet.DispatcherType;

@Component
public class WebMvcMetricsFilterWorkaroundForBugInSpringBoot2_7_0 {

    @Bean
    public FilterRegistrationBean<WebMvcMetricsFilter> webMvcMetricsFilter(MetricsProperties properties,
                                                                           MeterRegistry registry, WebMvcTagsProvider tagsProvider) {
        MetricsProperties.Web.Server.ServerRequest request = properties.getWeb().getServer().getRequest();
        WebMvcMetricsFilter filter = new WebMvcMetricsFilter(registry, tagsProvider, request.getMetricName(),
                request.getAutotime());
        FilterRegistrationBean<WebMvcMetricsFilter> registration = new FilterRegistrationBean<>(filter);
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
        registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC);
        return registration;
    }

}

package de.otto.edison.metricsconfiguration;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties;
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter;
import org.springframework.boot.actuate.metrics.web.servlet.WebMvcTagsProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

import javax.servlet.DispatcherType;

/* TODO: Remove this when Spring Boot 2.7.1 is there */
@Component
public class WebMvcMetricsFilterWorkaroundForBugInSpringBoot2_7_0 {

    @Bean
    @ConditionalOnMissingBean
    public FilterRegistrationBean<WebMvcMetricsFilter> webMvcMetricsFilter(MetricsProperties properties,
                                                                           MeterRegistry registry, WebMvcTagsProvider tagsProvider) {
        MetricsProperties.Web.Server.ServerRequest request = properties.getWeb().getServer().getRequest();
        WebMvcMetricsFilter filter = new WebMvcMetricsFilter(registry, tagsProvider, request.getMetricName(),
                request.getAutotime());
        FilterRegistrationBean<WebMvcMetricsFilter> registration = new FilterRegistrationBean<>(filter);
        registration.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
        registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC);
        return registration;
    }

}

Add condition to webMvcMetricsFilter bean


package signature;

import java.util.Arrays;

public class CanonicalLabellingVisitor implements DAGVisitor {

    private int[] labelling;

    private int currentLabel;

    public CanonicalLabellingVisitor(int vertexCount) {
        this.labelling = new int[vertexCount];
        Arrays.fill(this.labelling, -1);
        this.currentLabel = 0;
    }

    public void visit(DAG.Node node) {
        // only label if this vertex has not yet been labeled
        if (this.labelling[node.vertexIndex] == -1) {
            this.labelling[node.vertexIndex] = this.currentLabel;
            this.currentLabel++;
        }
        for (DAG.Node child : node.children) {
            child.accept(this);
        }
    }

    public int[] getLabelling() {
        return this.labelling;
    }

}

package signature;

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class CanonicalLabellingVisitor implements DAGVisitor {

    private int[] labelling;

    private int currentLabel;

    private Comparator<DAG.Node> comparator;

    public CanonicalLabellingVisitor(
            int vertexCount, Comparator<DAG.Node> comparator) {
        labelling = new int[vertexCount];
        Arrays.fill(labelling, -1);
        currentLabel = 0;
    }

    public void visit(DAG.Node node) {
        // only label if this vertex has not yet been labeled
        if (this.labelling[node.vertexIndex] == -1) {
            this.labelling[node.vertexIndex] = this.currentLabel;
            this.currentLabel++;
        }
        Collections.sort(node.children, comparator);
        for (DAG.Node child : node.children) {
            child.accept(this);
        }
    }

    public int[] getLabelling() {
        return this.labelling;
    }

}

Sort the child nodes in the labelling visitor, to make sure that they are sorted


package com.young.simpledict.dict;

import com.young.simpledict.dict.model.DictDetail;

/**
 * Author: taylorcyang
 * Date:   2014-10-21
 * Time:   19:00
 * Life with passion. Code with creativity!
 */
public interface DictAdapter {
    public static final int DICT_YOUDAO_BRIEF = 0;
    public static final int DICT_YOUDAO_DETAIL = 1;

    public String getSearchUri(String mWordToSearch);

    public DictDetail parseDict(String response);
}

package com.young.simpledict.dict;

import com.young.simpledict.dict.model.DictDetail;

/**
 * Author: taylorcyang
 * Date:   2014-10-21
 * Time:   19:00
 * Life with passion. Code with creativity!
 */
public interface DictAdapter {
    int DICT_YOUDAO_BRIEF = 0;
    int DICT_YOUDAO_DETAIL = 1;

    String getSearchUri(String mWordToSearch);

    DictDetail parseDict(String response);
}

Remove redundant modifier from interface fields and method


package org.kohsuke.github;

import java.io.IOException;
import org.junit.Test;

/**
 * @author Martin van Zijl
 */
public class GHIssueEventTest extends AbstractGitHubApiTestBase {

    @Test
    public void testEventsForSingleIssue() throws Exception {
        GHRepository repo = getRepository();
        GHIssue issue = repo.getIssue(1);

        for (GHIssueEvent event : issue.listEvents()) {
            System.out.println(event);
        }

        //TODO: Use the following...
        //GHIssueBuilder builder = repo.createIssue("test from the api");
        //GHIssue issue = builder.create();
    }

    @Test
    public void testRepositoryEvents() throws Exception {
        GHRepository repo = getRepository();
        PagedIterable<GHIssueEvent> list = repo.listIssueEvents();

        for (GHIssueEvent event : list) {
            System.out.println(event);
        }
    }

    @Test
    public void testRepositorySingleEvent() throws Exception {
        GHRepository repo = getRepository();
        GHIssueEvent event = repo.getIssueEvent(2615868520L);

        System.out.println(event);
    }

    protected GHRepository getRepository() throws IOException {
        return getRepository(gitHub);
    }

    private GHRepository getRepository(GitHub gitHub) throws IOException {
        return gitHub.getOrganization("github-api-test-org").getRepository("github-api");
    }
}

package org.kohsuke.github;

import java.io.IOException;
import org.junit.Test;

/**
 * @author Martin van Zijl
 */
public class GHIssueEventTest extends AbstractGitHubApiTestBase {

    @Test
    public void testEventsForSingleIssue() throws Exception {
        GHRepository repo = getRepository();
        GHIssue issue = repo.getIssue(1);

        System.out.println("Single issue:");
        for (GHIssueEvent event : issue.listEvents()) {
            System.out.println(event);
        }

        //TODO: Use the following...
        //GHIssueBuilder builder = repo.createIssue("test from the api");
        //GHIssue issue = builder.create();
    }

    @Test
    public void testRepositoryEvents() throws Exception {
        GHRepository repo = getRepository();
        PagedIterable<GHIssueEvent> list = repo.listIssueEvents();

        System.out.println("Repository (all):");
        int i = 0;
        for (GHIssueEvent event : list.asList()) {
            System.out.println(event);
            if (i++ > 10) break;
        }
    }

    @Test
    public void testRepositorySingleEvent() throws Exception {
        GHRepository repo = getRepository();
        GHIssueEvent event = repo.getIssueEvent(2615868520L);

        System.out.println("Repository (single event):");
        System.out.println(event);
    }

    protected GHRepository getRepository() throws IOException {
        return getRepository(gitHub);
    }

    private GHRepository getRepository(GitHub gitHub) throws IOException {
        return gitHub.getOrganization("github-api-test-org").getRepository("github-api");
    }
}

Make unit test output neater.


/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq 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 Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.asset.coins;

import bisq.asset.Base58BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.NetworkParametersAdapter;

public class KnowYourDeveloper extends Coin {
    public KnowYourDeveloper() {
        super("Know Your Developer", "KYD", new Base58BitcoinAddressValidator(new KydMainNetParams()));
    }

    public static class KydMainNetParams extends NetworkParametersAdapter {
        public KydMainNetParams() {
            this.addressHeader = 78;
            this.p2shHeader = 85;
            this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
        }
    }
}

/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq 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 Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.asset.coins;

import bisq.asset.Base58BitcoinAddressValidator;
import bisq.asset.Coin;
import bisq.asset.NetworkParametersAdapter;

public class KnowYourDeveloper extends Coin {
    public KnowYourDeveloper() {
        super("Know Your Developer", "KYDC", new Base58BitcoinAddressValidator(new KydMainNetParams()));
    }

    public static class KydMainNetParams extends NetworkParametersAdapter {
        public KydMainNetParams() {
            this.addressHeader = 78;
            this.p2shHeader = 85;
            this.acceptableAddressCodes = new int[]{this.addressHeader, this.p2shHeader};
        }
    }
}

Update KYD to KYDC listing to be conform ISO_4217


package com.bendoerr.saltedmocha;

import static com.bendoerr.saltedmocha.CryptoException.exceptionOf;

public class Util {

    public static final int MAX_ARRAY_SIZE;

    static {
        int max = Integer.MAX_VALUE - 2;
        try {
            byte[] bytes = new byte[max];
        } catch (java.lang.OutOfMemoryError oom) {
            // Probably OK. Need to test on 32bit JVM.
            // Reports say it's somewhere around 1.1 billion.
            max = Integer.MAX_VALUE / 2;
        }
        MAX_ARRAY_SIZE = max;
    }

    public static void checkedArrayCopy(Object src, int srcPos, Object dst, int dstPos, int len) throws CryptoException {
        try {
            System.arraycopy(src, srcPos, dst, dstPos, len);
        } catch (RuntimeException re) {
            throw exceptionOf(re);
        }
    }

    public static void validateLength(byte[] a, int expected, String what, String expectedWhat) throws CryptoException {
        if (a.length != expected)
            throw exceptionOf(new IllegalArgumentException(
                    what + " length(" + a.length + ") is not " + expectedWhat + "(" + expected + ")"));
    }

}

package com.bendoerr.saltedmocha;

import static com.bendoerr.saltedmocha.CryptoException.exceptionOf;

public class Util {

    public static final int MAX_ARRAY_SIZE;

    static {
        int max = Integer.MAX_VALUE - 2;
        try {
            byte[] bytes = new byte[max];
        } catch (java.lang.OutOfMemoryError oom) {
            // Probably OK. Need to test on 32bit JVM.
            // Reports say it's somewhere around 1.1 billion.
            max = Integer.MAX_VALUE / 2;
        }
        MAX_ARRAY_SIZE = max;
    }

    public static void checkedArrayCopy(Object src, int srcPos, Object dst, int dstPos, int len) throws CryptoException {
        try {
            System.arraycopy(src, srcPos, dst, dstPos, len);
        } catch (RuntimeException re) {
            throw exceptionOf(re);
        }
    }

    public static void validateLength(byte[] a, int expected, String what, String expectedWhat) throws CryptoException {
        if (a.length != expected)
            throw exceptionOf(new IllegalArgumentException(
                    what + " length(" + a.length + ") is not " + expectedWhat + "(" + expected + ")"));
    }

    /**
     * Approximation of libsodium's sodium_memzero. For us in
     * Javaland it looks like fill(array, (byte) 0)
     *
     * @param array to zero out.
     *
     * @see Libsodium Zeroing Memory
     */
    public static void java_memzero(byte[] array) {
        fill(array, (byte) 0);
    }

}

Add approximation of libsodium's sodium_memzero.


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

package org.tomighty.sound.timer;

import org.tomighty.config.Options.SoundConfig;
import org.tomighty.sound.SoundSupport;

public class Ding extends SoundSupport {

	@Override
	protected SoundConfig configuration() {
		return options().sound().ding();
	}

	@Override
	protected String defaultSoundResource() {
		return "/ding.wav";
	}

}

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

package org.tomighty.sound.timer;

import org.tomighty.config.Options.SoundConfig;
import org.tomighty.sound.SoundSupport;

public class Ding extends SoundSupport {

	@Override
	protected SoundConfig configuration() {
		return options().sound().ding();
	}

	@Override
	protected String defaultSoundResource() {
		return "/deskbell.wav";
	}

}

Fix ding sound's resource name


package invtweaks.forge.asm;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

import java.util.Map;

@IFMLLoadingPlugin.MCVersion("1.5.2")
@IFMLLoadingPlugin.TransformerExclusions({"invtweaks.forge.asm.ITAccessTransformer"})
public class FMLPlugin implements IFMLLoadingPlugin {
    @Override
    public String[] getLibraryRequestClass() {
        return new String[0];
    }

    @Override
    public String[] getASMTransformerClass() {
        return new String[] { "invtweaks.forge.asm.ITAccessTransformer" };
    }

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

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

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

package invtweaks.forge.asm;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

import java.util.Map;

@IFMLLoadingPlugin.MCVersion("@MCVERSION@")
@IFMLLoadingPlugin.TransformerExclusions({"invtweaks.forge.asm.ITAccessTransformer"})
public class FMLPlugin implements IFMLLoadingPlugin {
    @Override
    public String[] getLibraryRequestClass() {
        return new String[0];
    }

    @Override
    public String[] getASMTransformerClass() {
        return new String[] { "invtweaks.forge.asm.ITAccessTransformer" };
    }

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

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

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

Use ant filtering for MC version number.


package nl.github.martijn9612.fishy;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;

public class Main extends BasicGame
{
	public Main(String gamename)
	{
		super(gamename);
	}

	@Override
	public void init(GameContainer gc) throws SlickException {}

	@Override
	public void update(GameContainer gc, int i) throws SlickException {}

	@Override
	public void render(GameContainer gc, Graphics g) throws SlickException
	{
		g.drawString("Hello World!", 100, 100);
	}

	public static void main(String[] args)
	{
		try
		{
			AppGameContainer appgc;
			appgc = new AppGameContainer(new Main("Simple Slick Game"));
			appgc.setDisplayMode(640, 480, false);
			appgc.start();
		}
		catch (SlickException ex)
		{
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
}

package nl.github.martijn9612.fishy;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;

public class Main extends BasicGame
{
	public Main(String gamename)
	{
		super(gamename);
	}

	@Override
	public void init(GameContainer gc) throws SlickException {}

	@Override
	public void update(GameContainer gc, int i) throws SlickException {}

	@Override
	public void render(GameContainer gc, Graphics g) throws SlickException
	{
		g.drawString("Hello World!", 100, 100);
	}

	public static void main(String[] args)
	{
		try
		{
			AppGameContainer appgc;
			appgc = new AppGameContainer(new Main("Fishy"));
			appgc.setDisplayMode(640, 480, false);
			appgc.start();
		}
		catch (SlickException ex)
		{
			Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
		}
	}
}

Change game name to Fishy


package com.varunvats.practice.sorting;

public class MergeTopDown extends MergeBase {

    public static <T extends Comparable<T>> void sort(T[] a) {
        final int N = a.length;
        aux = new Comparable[N];
        sort(a, 0, N - 1);
    }

    private static <T extends Comparable<T>> void sort(T[] a, int low, int high) {
        if (low >= high)
            return;
        final int mid = (low + high) / 2;
        sort(a, low, mid);
        sort(a, mid + 1, high);
        merge(a, low, mid, high);
    }

}

package com.varunvats.practice.sorting;

public class MergeTopDown extends MergeBase {

    public static <T extends Comparable<T>> void sort(T[] a) {
        final int N = a.length;
        aux = new Comparable[N];
        sort(a, 0, N - 1);
    }

    private static <T extends Comparable<T>> void sort(T[] a, int low, int high) {
        if (low >= high)
            return;
        final int mid = (low + high) / 2;
        sort(a, low, mid);
        sort(a, mid + 1, high);
        if (!less(a[mid], a[mid + 1]))
            merge(a, low, mid, high);
    }

}

Optimize merge step of Merge sort.


package x1125io.initdlight;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootReceiver extends BroadcastReceiver {

    final String TAG = "initdlight";

    @Override
    public void onReceive(Context context, Intent intent) {

        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {

            for (String file: context.getFilesDir().list()) {

                ProcessRunner pr = new ProcessRunner();
                String fullFilePath = context.getFilesDir().toString() + "/" + file;
                int exitCode = pr.Run(new String[] { "su", "-c", "sh " + fullFilePath });

                if (exitCode == 0) {
                    Log.d(TAG, "started " + file);
                } else {
                    Log.d(TAG, String.format(
                            "error starting %s; exit code: %d; stdout: %s; stderr: %s",
                            file,
                            exitCode,
                            pr.getStdout(),
                            pr.getStderr()
                    ));
                }
            }

        }
    }
}

package x1125io.initdlight;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootReceiver extends BroadcastReceiver {

    final String TAG = "initdlight";

    @Override
    public void onReceive(Context context, Intent intent) {

        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {

            for (String file: context.getFilesDir().list()) {

                ProcessRunner pr = new ProcessRunner();
                String fullFilePath = context.getFilesDir().toString() + "/" + file;
                int exitCode = pr.Run(new String[] { "su", "-c", fullFilePath });

                if (exitCode == 0) {
                    Log.d(TAG, "started " + file);
                } else {
                    Log.d(TAG, String.format(
                            "error starting %s; exit code: %d; stdout: %s; stderr: %s",
                            file,
                            exitCode,
                            pr.getStdout(),
                            pr.getStderr()
                    ));
                }
            }

        }
    }
}

Remove "sh" command from script execution


package dk.statsbiblioteket.demo;

public class Main {

    public static void main(String[] args) {
        System.out.println("This is the Demo of the Git");
        System.out.println("This is now real");
    }
}

package dk.statsbiblioteket.demo;

public class Main {

    public static void main(String[] args) {
        System.out.println("This is the Demo of the Git");
        System.out.println("This is now real");
        System.out.println("Print all the lines!!!");
    }
}

Print the most AMAZING text ever!!!!1!


/*
 * Copyright (C) 2008 XStream Committers.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 *
 * Created on 13. October 2008 by Joerg Schaible
 */
package com.thoughtworks.xstream.core.util;

public final class FastField {
    private final String name;
    private final Class declaringClass;

    public FastField(Class definedIn, String name) {
        this.name = name;
        this.declaringClass = definedIn;
    }

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

    public Class getDeclaringClass() {
        return this.declaringClass;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (this == null) {
            return false;
        }
        if (obj.getClass() == FastField.class) {
            final FastField field = (FastField)obj;
            return name.equals(field.getName())
                && declaringClass.equals(field.getDeclaringClass());
        }
        return false;
    }

    public int hashCode() {
        return name.hashCode() ^ declaringClass.hashCode();
    }

    public String toString() {
        return declaringClass.getName() + "[" + name + "]";
    }
}

/*
 * Copyright (C) 2008, 2010 XStream Committers.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 *
 * Created on 13. October 2008 by Joerg Schaible
 */
package com.thoughtworks.xstream.core.util;

public final class FastField {
    private final String name;
    private final Class declaringClass;

    public FastField(Class definedIn, String name) {
        this.name = name;
        this.declaringClass = definedIn;
    }

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

    public Class getDeclaringClass() {
        return this.declaringClass;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (this == null) {
            return false;
        }
        if (obj.getClass() == FastField.class) {
            final FastField field = (FastField)obj;
            if ((declaringClass == null && field.declaringClass != null)
                || (declaringClass != null && field.declaringClass == null)) {
                return false;
            }
            return name.equals(field.getName())
                && (declaringClass == null || declaringClass.equals(field.getDeclaringClass()));
        }
        return false;
    }

    public int hashCode() {
        return name.hashCode() ^ (declaringClass == null ? 0 : declaringClass.hashCode());
    }

    public String toString() {
        return (declaringClass == null ? "" : declaringClass.getName() + ".") + name;
    }
}

Allow null as defining class.


package com.mssngvwls;

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

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class PhaseRespacerTests {

    @Mock
    private RandomNumberGenerator randomNumberGenerator;

    @InjectMocks
    private PhraseRespacer phraseRespacer;

    @Test
    public void phrase_is_respaced() {
        final String input = "Manchester United";
        when(randomNumberGenerator.between(1, 4)).thenReturn(1);
        final String expectedOutput = "M a n c h e s t e r U n i t e d";
        final String actualOutput = phraseRespacer.respace(input);
        assertThat(actualOutput).isEqualTo(expectedOutput);
    }
}

package com.mssngvwls;

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

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class PhaseRespacerTests {

    @Mock
    private RandomNumberGenerator randomNumberGenerator;

    @InjectMocks
    private PhraseRespacer phraseRespacer;

    @Test
    public void phrase_is_respaced_with_equal_spacings() {
        final String input = "Manchester United";
        when(randomNumberGenerator.between(1, 4)).thenReturn(1);
        final String expectedOutput = "M a n c h e s t e r U n i t e d";
        final String actualOutput = phraseRespacer.respace(input);
        assertThat(actualOutput).isEqualTo(expectedOutput);
    }

    @Test
    public void phrase_is_respaced_with_different_spacings() {
        final String input = "Manchester United";
        when(randomNumberGenerator.between(1, 4)).thenReturn(3, 2, 4, 3, 1, 3);
        final String expectedOutput = "Man ch este rUn i ted";
        final String actualOutput = phraseRespacer.respace(input);
        assertThat(actualOutput).isEqualTo(expectedOutput);
    }
}

Add respacing test with varying group sizes


package de.fau.cs.mad.fablab.android.model;

import de.fau.cs.mad.fablab.rest.core.MailAddresses;
import de.fau.cs.mad.fablab.rest.myapi.DataApi;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class MailModel {
    private String mFeedbackMailAddress;
    private String mFablabMailAddress;

    public MailModel(DataApi dataApi) {
        dataApi.getMailAddresses(new Callback<MailAddresses>() {
            @Override
            public void success(MailAddresses mailAddresses, Response response) {
                mFeedbackMailAddress = mailAddresses.getFeedbackMail();
                mFablabMailAddress = mailAddresses.getFabLabMail();
            }

            @Override
            public void failure(RetrofitError error) {
                mFeedbackMailAddress = "";
                mFablabMailAddress = "";
            }
        });
    }

    public String getFeedbackMailAddress() {
        return mFeedbackMailAddress;
    }

    public String getFablabMailAddress() {
        return mFablabMailAddress;
    }
}

package de.fau.cs.mad.fablab.android.model;

import de.fau.cs.mad.fablab.rest.core.MailAddresses;
import de.fau.cs.mad.fablab.rest.myapi.DataApi;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class MailModel {
    private String mFeedbackMailAddress = "";
    private String mFablabMailAddress = "";

    public MailModel(DataApi dataApi) {
        dataApi.getMailAddresses(new Callback<MailAddresses>() {
            @Override
            public void success(MailAddresses mailAddresses, Response response) {
                mFeedbackMailAddress = mailAddresses.getFeedbackMail();
                mFablabMailAddress = mailAddresses.getFabLabMail();
            }

            @Override
            public void failure(RetrofitError error) {

            }
        });
    }

    public String getFeedbackMailAddress() {
        return mFeedbackMailAddress;
    }

    public String getFablabMailAddress() {
        return mFablabMailAddress;
    }
}

Initialize mail addresses to prevent crashes


package com.epam.ta.reportportal.ws.model.integration;

import com.epam.ta.reportportal.ws.annotations.NotEmpty;
import com.fasterxml.jackson.annotation.JsonInclude;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Ivan Budayeu
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UpdatePluginStateRQ implements Serializable {

	@NotNull
	@NotEmpty
	private String name;

	@NotNull
	private Boolean isEnabled;

	public UpdatePluginStateRQ() {
	}

	public String getName() {
		return name;
	}

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

	public Boolean getEnabled() {
		return isEnabled;
	}

	public void setEnabled(Boolean enabled) {
		isEnabled = enabled;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}

		UpdatePluginStateRQ that = (UpdatePluginStateRQ) o;

		if (name != null ? !name.equals(that.name) : that.name != null) {
			return false;
		}
		return isEnabled != null ? isEnabled.equals(that.isEnabled) : that.isEnabled == null;
	}

	@Override
	public int hashCode() {
		int result = name != null ? name.hashCode() : 0;
		result = 31 * result + (isEnabled != null ? isEnabled.hashCode() : 0);
		return result;
	}
}

package com.epam.ta.reportportal.ws.model.integration;

import com.fasterxml.jackson.annotation.JsonInclude;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author Ivan Budayeu
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UpdatePluginStateRQ implements Serializable {

	@NotNull
	private Boolean isEnabled;

	public UpdatePluginStateRQ() {
	}

	public Boolean getEnabled() {
		return isEnabled;
	}

	public void setEnabled(Boolean enabled) {
		isEnabled = enabled;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}

		UpdatePluginStateRQ that = (UpdatePluginStateRQ) o;

		return isEnabled != null ? isEnabled.equals(that.isEnabled) : that.isEnabled == null;
	}

	@Override
	public int hashCode() {
		return isEnabled != null ? isEnabled.hashCode() : 0;
	}
}

Update Plugin state entity refactoring


package com.github.aureliano.achmed.resources.types;

public enum OperatingSystemFamily {

	DEBIAN,
	UBUNTU,
	RPM,
	APP
}

package com.github.aureliano.achmed.resources.types;

public enum OperatingSystemFamily {

	DEBIAN(null),
	UBUNTU(DEBIAN),
	RPM(null),
	APP(null);

	private OperatingSystemFamily ancestor;

	private OperatingSystemFamily(OperatingSystemFamily ancestor) {
		this.ancestor = ancestor;
	}

	public OperatingSystemFamily getAncestor() {
		return ancestor;
	}
}

Add attribute ancestor to operating system type.


package com.cube.storm.ui.lib.factory;

import com.cube.storm.ui.view.View;
import com.cube.storm.ui.view.holder.Holder;

/**
 * This is the factory class which is used by Storm to help with getting the correct view holder/controller
 * for a specific view class name.
 *
 * @author Callum Taylor
 * @project StormUI
 */
public abstract class ViewFactory
{
	/**
	 * Gets the view holder class for a specific view name
	 *
	 * @param viewName The name of the view to lookup
	 *
	 * @return The view holder class or null if one was not found.
	 */
	public Class<? extends Holder> getHolderForView(String viewName)
	{
		return View.valueOf(viewName).getHolderClass();
	}
}

package com.cube.storm.ui.lib.factory;

import com.cube.storm.ui.view.View;
import com.cube.storm.ui.view.holder.Holder;

/**
 * This is the factory class which is used by Storm to help with getting the correct view holder/controller
 * for a specific view class name.
 *
 * @author Callum Taylor
 * @project StormUI
 */
public abstract class ViewFactory
{
	/**
	 * Gets the view holder class for a specific view name
	 *
	 * @param viewName The name of the view to lookup
	 *
	 * @return The view holder class or null if one was not found.
	 */
	public Class<? extends Holder> getHolderForView(String viewName)
	{
		try
		{
			return View.valueOf(viewName).getHolderClass();
		}
		catch (IllegalArgumentException e)
		{
			e.printStackTrace();
		}

		return null;
	}
}

Return null in view factory if the view enum was not found


package nanomsg;

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.ptr.IntByReference;

public class NativeLibrary {
  public static native int nn_socket (int domain, int protocol);
  public static native int nn_close (int s);
  public static native int nn_bind (int s, String addr);
  public static native int nn_connect (int s, String addr);
  public static native int nn_send (int s, byte[] buff, int len, int flags);
  public static native int nn_recv (int s, PointerByReference buff, int len, int flags);
  public static native int nn_setsockopt (int s, int level, int option, Pointer optval, int optvallen);
  public static native int nn_getsockopt (int s, int level, int option, Pointer optval, Pointer optvallen);
  public static native int nn_freemsg (Pointer msg);
  public static native int nn_errno ();
  public static native int nn_device (int s1, int s2);
  public static native void nn_term();

  public static native String nn_strerror (int errnum);
  public static native Pointer nn_symbol (int i, IntByReference value);

  static {
    Native.register("nanomsg");
  }
}

package nanomsg;

import java.nio.ByteBuffer;

import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import com.sun.jna.ptr.IntByReference;

public class NativeLibrary {
  public static native int nn_socket (int domain, int protocol);
  public static native int nn_close (int s);
  public static native int nn_bind (int s, String addr);
  public static native int nn_connect (int s, String addr);
  public static native int nn_send (int s, byte[] buff, int len, int flags);
  public static native int nn_send (int s, ByteBuffer buff, int len, int flags);
  public static native int nn_recv (int s, PointerByReference buff, int len, int flags);
  public static native int nn_setsockopt (int s, int level, int option, Pointer optval, int optvallen);
  public static native int nn_getsockopt (int s, int level, int option, Pointer optval, Pointer optvallen);
  public static native int nn_freemsg (Pointer msg);
  public static native int nn_errno ();
  public static native int nn_device (int s1, int s2);
  public static native void nn_term();

  public static native String nn_strerror (int errnum);
  public static native Pointer nn_symbol (int i, IntByReference value);

  static {
    Native.register("nanomsg");
  }
}

Add bytebuffer overload to native library.


package stexfires.io;

import stexfires.core.Record;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.util.Objects;

/**
 * @author Mathias Kalb
 * @since 0.1
 */
public class BaseRecordFile<W extends Record, R extends W> implements ReadableRecordFile<R>, WritableRecordFile<W> {

    protected final Path path;

    public BaseRecordFile(final Path path) {
        Objects.requireNonNull(path);
        this.path = path;
    }

    @Override
    public final Path getPath() {
        return path;
    }

    @Override
    public ReadableRecordProducer<R> openProducer() throws IOException {
        throw new UnsupportedOperationException();
    }

    @Override
    public WritableRecordConsumer<W> openConsumer() throws IOException {
        throw new UnsupportedOperationException();
    }

    protected BufferedWriter newBufferedWriter(Charset charset, OpenOption... options) throws IOException {
        return Files.newBufferedWriter(path, charset, options);
    }

    protected BufferedReader newBufferedReader(Charset charset) throws IOException {
        return Files.newBufferedReader(path, charset);
    }

}

package stexfires.io;

import stexfires.core.Record;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.util.Objects;

/**
 * @author Mathias Kalb
 * @since 0.1
 */
public class BaseRecordFile<W extends Record, R extends W> implements ReadableRecordFile<R>, WritableRecordFile<W> {

    protected final Path path;

    public BaseRecordFile(final Path path) {
        Objects.requireNonNull(path);
        this.path = path;
    }

    @Override
    public final Path getPath() {
        return path;
    }

    @Override
    public ReadableRecordProducer<R> openProducer() throws IOException {
        throw new UnsupportedOperationException();
    }

    @Override
    public WritableRecordConsumer<W> openConsumer() throws IOException {
        throw new UnsupportedOperationException();
    }

    protected BufferedWriter newBufferedWriter(Charset charset, OpenOption... options) throws IOException {
        return Files.newBufferedWriter(path, charset, options);
    }

    protected BufferedWriter newBufferedWriter(CharsetEncoder charsetEncoder, OpenOption... options) throws IOException {
        return new BufferedWriter(new OutputStreamWriter(Files.newOutputStream(path, options), charsetEncoder));
    }

    protected BufferedReader newBufferedReader(Charset charset) throws IOException {
        return Files.newBufferedReader(path, charset);
    }

}

Add new method newBufferedWriter with a CharsetEncoder


package edu.asu.scrapbook.digital.util;

import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

import edu.asu.scrapbook.digital.dao.UserDAO;
import edu.asu.scrapbook.digital.dao.UserDAOFactory;

public class UserUtil {
	public static String getRequestUsername() {
		UserService userService = UserServiceFactory.getUserService();
		return userService.getCurrentUser().getEmail();
	}

	public static boolean userExists(String username) throws Exception {
		UserDAO dao = UserDAOFactory.getInstance();
		return dao.findById(username) != null;
	}
}

package edu.asu.scrapbook.digital.util;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

import edu.asu.scrapbook.digital.dao.UserDAO;
import edu.asu.scrapbook.digital.dao.UserDAOFactory;

public class UserUtil {
	public static String getRequestUsername() {
		UserService userService = UserServiceFactory.getUserService();
		User authUser = userService.getCurrentUser();
		return (authUser != null) ? authUser.getEmail() : null;
	}

	public static boolean userExists(String username) throws Exception {
		UserDAO dao = UserDAOFactory.getInstance();
		return dao.findById(username) != null;
	}
}

Add null check in case user isn't logged in


package brooklyn.cli;

import brooklyn.rest.BrooklynService;
import org.junit.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class ClientTest {

    BrooklynService brooklynServer;
    Client brooklynClient;

    @BeforeClass
    public void testSetUp() throws Exception {
        // Start the REST server
        brooklynServer = BrooklynService.newBrooklynService();
        String[] args = {"server","config.sample.yml"};
        brooklynServer.runAsync(args);
    }

    @AfterClass
    public void testTearDown() {
        // Kill the REST server
        brooklynServer = null;
    }

    @Test(enabled = true)
    public void testCatalogEntitiesCommand() {
        System.out.println("testCatalogEntitiesCommand");
        String[] args = {"catalog-entities"};
        Client.main(args);
        //TODO: check that client output matches what we expect (need to make the client more testable)
    }

}

package brooklyn.cli;

import brooklyn.rest.BrooklynService;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

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

public class ClientTest {

    BrooklynService brooklynServer;
    Client brooklynClient;

    private ByteArrayOutputStream outBytes;
    private PrintStream out;
    private ByteArrayOutputStream errBytes;
    private PrintStream err;

    protected String standardOut() {
        return outBytes.toString();
    }

    protected String standardErr() {
        return errBytes.toString();
    }

    @BeforeClass
    public void testSetUp() throws Exception {
        // Start the REST server
        brooklynServer = BrooklynService.newBrooklynService();
        String[] args = {"server","config.sample.yml"};
        brooklynServer.runAsync(args);
        // Rewire the output/error stream of the client
        outBytes = new ByteArrayOutputStream();
        out = new PrintStream(outBytes);
        errBytes = new ByteArrayOutputStream();
        err = new PrintStream(errBytes);
        brooklynClient = new Client(out,err);
    }

    @AfterClass
    public void testTearDown() {
        // Kill the REST server and client instance
        brooklynServer = null;
        brooklynClient = null;
        // Reset i/o streams
        outBytes = null;
        out = null;
        errBytes = null;
        err = null;
    }

    @Test(enabled = true)
    public void testCatalogEntitiesCommand() throws Exception {
        // Run the catalog-entities command
        String[] args = {"catalog-entities"};
        brooklynClient.run(args);
        // Check that output matches what we expect
        assertThat(standardOut(), containsString("brooklyn.entity.webapp.jboss.JBoss6Server"));

    }

}

Implement assert statement for catalog-entities command


package com.github.couchmove.pojo;

import com.couchbase.client.java.Bucket;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jetbrains.annotations.NotNull;

import java.util.Date;

/**
 * a {@link CouchbaseEntity} representing a change in Couchbase {@link Bucket}
 *
 * @author ctayeb
 * Created on 27/05/2017
 */
@EqualsAndHashCode(callSuper = false)
@Builder(toBuilder = true)
@Data
public class ChangeLog extends CouchbaseEntity implements Comparable<ChangeLog> {

    /**
     * The version of the change
     */
    private String version;

    /**
     * The execution order of the change
     */
    private Integer order;

    /**
     * The description of the change
     */
    private String description;

    /**
     * The {@link Type} of the change
     */
    private Type type;

    /**
     * The script file or folder that was executed in the change
     */
    private String script;

    /**
     * A unique identifier of the file or folder of the change
     */
    private String checksum;

    /**
     * The OS username of the process that executed the change
     */
    private String runner;

    /**
     * Date of execution of the change
     */
    private Date timestamp;

    /**
     * The duration of the execution of the change in milliseconds
     */
    private Long duration;

    /**
     * The {@link Status} of the change
     */
    private Status status;

    @Override
    public int compareTo(@NotNull ChangeLog o) {
        return version == null ? 0 : version.compareTo(o.version);
    }
}

package com.github.couchmove.pojo;

import com.couchbase.client.java.Bucket;
import lombok.*;
import org.jetbrains.annotations.NotNull;

import java.util.Date;

import static lombok.AccessLevel.PRIVATE;

/**
 * a {@link CouchbaseEntity} representing a change in Couchbase {@link Bucket}
 *
 * @author ctayeb
 *         Created on 27/05/2017
 */
@AllArgsConstructor
@NoArgsConstructor(access = PRIVATE)
@EqualsAndHashCode(callSuper = false)
@Builder(toBuilder = true)
@Data
public class ChangeLog extends CouchbaseEntity implements Comparable<ChangeLog> {

    /**
     * The version of the change
     */
    private String version;

    /**
     * The execution order of the change
     */
    private Integer order;

    /**
     * The description of the change
     */
    private String description;

    /**
     * The {@link Type} of the change
     */
    private Type type;

    /**
     * The script file or folder that was executed in the change
     */
    private String script;

    /**
     * A unique identifier of the file or folder of the change
     */
    private String checksum;

    /**
     * The OS username of the process that executed the change
     */
    private String runner;

    /**
     * Date of execution of the change
     */
    private Date timestamp;

    /**
     * The duration of the execution of the change in milliseconds
     */
    private Long duration;

    /**
     * The {@link Status} of the change
     */
    private Status status;

    @Override
    public int compareTo(@NotNull ChangeLog o) {
        return version == null ? 0 : version.compareTo(o.version);
    }
}

Fix Jackson no suitable constructor found


package kawa.standard;
import gnu.expr.*;
import gnu.lists.*;
import kawa.lang.*;

public class thisRef extends Syntax
{
  public Expression rewriteForm (Pair form, Translator tr)
  {
    if (form.cdr == LList.Empty)
      {
	ScopeExp sc = tr.currentScope();
	while (sc != null && ! (sc instanceof ClassExp))
	  sc = sc.outer;
	if (sc == null)
	  tr.error('w', "use fo this not inside a class");
	return new ThisExp(sc);
      }
    else
      return tr.syntaxError("this with paramater not implemented");
  }
}

package kawa.standard;
import gnu.expr.*;
import gnu.lists.*;
import kawa.lang.*;

public class thisRef extends Syntax
{
  public Expression rewriteForm (Pair form, Translator tr)
  {
    if (form.cdr == LList.Empty)
      {
	ScopeExp sc = tr.currentScope();
	while (sc != null && ! (sc instanceof ClassExp))
	  sc = sc.outer;
	if (sc == null)
	  tr.error('w', "use of 'this' not inside a class");
	return new ThisExp(sc);
      }
    else
      return tr.syntaxError("this with paramater not implemented");
  }
}

Fix typo in error message.


package net.kencochrane.raven.marshaller.json;

import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;

import java.io.IOException;

public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
    private static final String MESSAGE_PARAMETER = "message";
    private static final String PARAMS_PARAMETER = "params";

    @Override
    public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
        generator.writeStartObject();
        generator.writeStringField(MESSAGE_PARAMETER, messageInterface.getMessage());
        generator.writeArrayFieldStart(PARAMS_PARAMETER);
        for (String parameter : messageInterface.getParams()) {
            generator.writeString(parameter);
        }
        generator.writeEndArray();
        generator.writeEndObject();
    }
}

package net.kencochrane.raven.marshaller.json;

import com.fasterxml.jackson.core.JsonGenerator;
import net.kencochrane.raven.event.interfaces.MessageInterface;

import java.io.IOException;

public class MessageInterfaceBinding implements InterfaceBinding<MessageInterface> {
    /**
     * Maximum length for a message.
     */
    public static final int MAX_MESSAGE_LENGTH = 1000;
    private static final String MESSAGE_PARAMETER = "message";
    private static final String PARAMS_PARAMETER = "params";

    /**
     * Formats a message, ensuring that the maximum length {@link #MAX_MESSAGE_LENGTH} isn't reached.
     *
     * @param message message to format.
     * @return formatted message (shortened if necessary).
     */
    private String formatMessage(String message) {
        if (message == null)
            return null;
        else if (message.length() > MAX_MESSAGE_LENGTH)
            return message.substring(0, MAX_MESSAGE_LENGTH);
        else return message;
    }

    @Override
    public void writeInterface(JsonGenerator generator, MessageInterface messageInterface) throws IOException {
        generator.writeStartObject();
        generator.writeStringField(MESSAGE_PARAMETER, formatMessage(messageInterface.getMessage()));
        generator.writeArrayFieldStart(PARAMS_PARAMETER);
        for (String parameter : messageInterface.getParams()) {
            generator.writeString(parameter);
        }
        generator.writeEndArray();
        generator.writeEndObject();
    }
}

Set a maximum size for the Message interface