/**
 * Copyright (c) 2010 IBM Corporation
 * 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
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *
 * $Id$
 */
package org.openhealthtools.mdht.uml.hl7.datatypes.operations;

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

/**
 * This class represents a suite of Junit 4 test cases for HL7 Datatypes.
 */
@RunWith(Suite.class)
@Suite.SuiteClasses( { ADOperationsTest.class, BNOperationsTest.class,
	EDOperationsTest.class, ENOperationsTest.class, ONOperationsTest.class,
	PNOperationsTest.class, TNOperationsTest.class })
	public class ALLDatatypeOperationsTests {
	// Nothing
} // ALLDatatypeOperationsTests

/**
 * Copyright (c) 2010 IBM Corporation
 * 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
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *
 * $Id$
 */
package org.openhealthtools.mdht.uml.hl7.datatypes.operations;

import junit.framework.JUnit4TestAdapter;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
 * This class represents a suite of Junit 4 test cases for HL7 Datatypes.
 */
@RunWith(Suite.class)
@Suite.SuiteClasses( { ADOperationsTest.class, BNOperationsTest.class,
	EDOperationsTest.class, ENOperationsTest.class, ONOperationsTest.class,
	PNOperationsTest.class, TNOperationsTest.class })
	public class ALLDatatypeOperationsTests {

	public static junit.framework.Test suite() {
	    return new JUnit4TestAdapter(ALLDatatypeOperationsTests.class);
	}
	// Nothing
} // ALLDatatypeOperationsTests

Add junit ant task support


package com.google.sps.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class AuthInfoTest {
  @Test
  public void example() {
    Assert.assertEquals(1 + 1, 2);
  }
}

package com.google.sps.tests;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

@RunWith(JUnit4.class)
public final class AuthInfoTest {

  @Test
  public void example() {
    // placeholder test to show that tests are evaluated
    Assert.assertEquals(1 + 1, 2);
    Assert.assertEquals(2 * 2, 4);
    Assert.assertEquals(1337, 1500 - 163);
  }
}

Add example tests to show build success


package gov.nih.nci.calab.dto.workflow;

public class AssayBean {

	private String assayId;
	private String assayName;
	private String assayType;

	public AssayBean(String assayId, String assayName, String assayType) {
		super();
		// TODO Auto-generated constructor stub
		this.assayId = assayId;
		this.assayName = assayName;
		this.assayType = assayType;
	}
	public String getAssayId() {
		return assayId;
	}
	public void setAssayId(String assayId) {
		this.assayId = assayId;
	}
	public String getAssayName() {
		return assayName;
	}
	public void setAssayName(String assayName) {
		this.assayName = assayName;
	}
	public String getAssayType() {
		return assayType;
	}
	public void setAssayType(String assayType) {
		this.assayType = assayType;
	}

}

package gov.nih.nci.calab.dto.workflow;

public class AssayBean {

	private String assayId;
	private String assayName;
	private String assayType;
	private String assayStr;

	public AssayBean(String assayId, String assayName, String assayType) {
		super();
		// TODO Auto-generated constructor stub
		this.assayId = assayId;
		this.assayName = assayName;
		this.assayType = assayType;
	}
	public String getAssayId() {
		return assayId;
	}
	public void setAssayId(String assayId) {
		this.assayId = assayId;
	}
	public String getAssayName() {
		return assayName;
	}
	public void setAssayName(String assayName) {
		this.assayName = assayName;
	}
	public String getAssayType() {
		return assayType;
	}
	public void setAssayType(String assayType) {
		this.assayType = assayType;
	}
	public String getAssayStr() {
		return this.assayType + " : " + this.assayName;
	}
//	public void setAssayStr(String assayStr) {
//		this.assayStr = assayStr;
//	}

}

Add an additional property assayStr


package io.elssa.net;

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

public abstract class MessageRouterBase {

    private List<MessageListener> listeners
        = Collections.synchronizedList(new ArrayList<>());

    /**
     * Adds a message listener (consumer) to this MessageRouter.  Listeners
     * receive messages that are published by this MessageRouter.
     *
     * @param listener {@link MessageListener} that will consume messages
     * published by this MessageRouter.
     */
    public void addListener(MessageListener listener) {
        listeners.add(listener);
    }

    public void removeListener(MessageListener listener) {
        listeners.remove(listener);
    }

    public void onConnnect(NetworkEndpoint endpoint) {
        for (MessageListener listener : listeners) {
            listener.onConnect(endpoint);
        }
    }

    public void onDisconnect(NetworkEndpoint endpoint) {
        for (MessageListener listener : listeners) {
            listener.onDisconnect(endpoint);
        }
    }

    public void onMessage(ElssaMessage msg) {
        for (MessageListener listener : listeners) {
            listener.onMessage(msg);
        }
    }
}

package io.elssa.net;

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

public abstract class MessageRouterBase {

    private List<MessageListener> listeners
        = Collections.synchronizedList(new ArrayList<>());

    /**
     * Adds a message listener (consumer) to this MessageRouter.  Listeners
     * receive messages that are published by this MessageRouter.
     *
     * @param listener {@link MessageListener} that will consume messages
     * published by this MessageRouter.
     */
    public void addListener(MessageListener listener) {
        listeners.add(listener);
    }

    public void removeListener(MessageListener listener) {
        listeners.remove(listener);
    }

    protected void onConnnect(NetworkEndpoint endpoint) {
        for (MessageListener listener : listeners) {
            listener.onConnect(endpoint);
        }
    }

    protected void onDisconnect(NetworkEndpoint endpoint) {
        for (MessageListener listener : listeners) {
            listener.onDisconnect(endpoint);
        }
    }

    protected void onMessage(ElssaMessage msg) {
        for (MessageListener listener : listeners) {
            listener.onMessage(msg);
        }
    }
}

Update message passing method visibility


/*
 * 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.exceptions;

public class RateLimitExceededException extends ApiException {

    private long retryIn;

    public RateLimitExceededException() {
        super();
    }

    public RateLimitExceededException(String msg) {
        super(msg);
    }

    public RateLimitExceededException(long retryIn) {
        super("Retry in " + retryIn);
        this.retryIn = retryIn;
    }

    public RateLimitExceededException(String msg, long retryIn) {
        super("Retry in " + retryIn + ": " + msg);
        this.retryIn = retryIn;
    }

}

/*
 * 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.exceptions;

import lombok.Getter;

public class RateLimitExceededException extends ApiException {

    @Getter
    private long retryIn;

    public RateLimitExceededException() {
        super();
    }

    public RateLimitExceededException(String msg) {
        super(msg);
    }

    public RateLimitExceededException(long retryIn) {
        super("Retry in " + retryIn);
        this.retryIn = retryIn;
    }

    public RateLimitExceededException(String msg, long retryIn) {
        super("Retry in " + retryIn + ": " + msg);
        this.retryIn = retryIn;
    }
}

Add getter for retry in


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

import com.google.idea.common.experiments.FeatureRolloutExperiment;
import com.intellij.openapi.util.SystemInfo;

/**
 * A utility class that manages the experiment to use studio's built in deployer for deploying apks
 * instead of using the one present in mobile-install.
 */
public class StudioDeployerExperiment {
  /** Indicates if we should deploy via Studio or via MI. */
  private static final FeatureRolloutExperiment useStudioDeployer =
      new FeatureRolloutExperiment("aswb.use.studio.deployer");

  /** Returns whether mobile install deployments should happen via the studio deployer. */
  public static boolean isEnabled() {
    if (!SystemInfo.isLinux) {
      // TODO(b/197761450): Enable this for Macs after mdproxy related issues are sorted out.
      return false;
    }
    return useStudioDeployer.isEnabled();
  }

  private StudioDeployerExperiment() {}
}

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

import com.google.idea.common.experiments.FeatureRolloutExperiment;

/**
 * A utility class that manages the experiment to use studio's built in deployer for deploying apks
 * instead of using the one present in mobile-install.
 */
public class StudioDeployerExperiment {
  /** Indicates if we should deploy via Studio or via MI. */
  private static final FeatureRolloutExperiment useStudioDeployer =
      new FeatureRolloutExperiment("aswb.use.studio.deployer");

  /** Returns whether mobile install deployments should happen via the studio deployer. */
  public static boolean isEnabled() {
    return useStudioDeployer.isEnabled();
  }

  private StudioDeployerExperiment() {}
}

Build android_binary targets on rabbit


/*
 * Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
 *
 * $Id$
 */

package org.dellroad.stuff.pobj;

import java.util.Set;

import javax.validation.ConstraintViolation;

/**
 * Runtime exception thrown during {@link PersistentObject} operations.
 */
@SuppressWarnings("serial")
public class PersistentObjectValidationException extends PersistentObjectException {

    private final Set<ConstraintViolation<?>> violations;

    /**
     * Constructor.
     *
     * @param violations set of violations
     * @throws IllegalArgumentException if {@code violations} is null
     */
    public PersistentObjectValidationException(Set<ConstraintViolation<?>> violations) {
        super("object failed to validate: " + violations);
        if (violations == null)
            throw new IllegalArgumentException("null violations");
        this.violations = violations;
    }

    /**
     * Get the set of constraint violations.
     */
    public Set<ConstraintViolation<?>> getViolations() {
        return this.violations;
    }
}

/*
 * Copyright (C) 2012 Archie L. Cobbs. All rights reserved.
 *
 * $Id$
 */

package org.dellroad.stuff.pobj;

import java.util.Set;

import javax.validation.ConstraintViolation;

/**
 * Runtime exception thrown during {@link PersistentObject} operations.
 */
@SuppressWarnings("serial")
public class PersistentObjectValidationException extends PersistentObjectException {

    private final Set<ConstraintViolation<?>> violations;

    /**
     * Constructor.
     *
     * @param violations set of violations
     * @throws IllegalArgumentException if {@code violations} is null
     */
    public PersistentObjectValidationException(Set<ConstraintViolation<?>> violations) {
        this.violations = violations;
    }

    /**
     * Get the set of constraint violations.
     */
    public Set<ConstraintViolation<?>> getViolations() {
        return this.violations;
    }

    private static String generateMessage(Set<ConstraintViolation<?>> violations) {
        if (violations == null)
            throw new IllegalArgumentException("null violations");
        StringBuilder buf = new StringBuilder("object failed to validate with " + violations.size() + " violation(s): ");
        boolean first = true;
        for (ConstraintViolation<?> violation : violations) {
            if (first)
                first = false;
            else
                buf.append("; ");
            buf.append("[" + violation.getPropertyPath() + "]: " + violation.getMessage());
        }
        return buf.toString();
    }
}

Improve exception message from previous commit.


/*
 * Copyright (c) 2012 Evolveum
 *
 * The contents of this file are subject to the terms
 * of the Common Development and Distribution License
 * (the License). You may not use this file except in
 * compliance with the License.
 *
 * You can obtain a copy of the License at
 * http://www.opensource.org/licenses/cddl1 or
 * CDDLv1.0.txt file in the source code distribution.
 * See the License for the specific language governing
 * permission and limitations under the License.
 *
 * If applicable, add the following below the CDDL Header,
 * with the fields enclosed by brackets [] replaced by
 * your own identifying information:
 *
 * Portions Copyrighted 2012 [name of copyright owner]
 */

package com.evolveum.midpoint.web.page.admin.configuration.dto;

import java.io.Serializable;

/**
 * @author lazyman
 */
public class ObjectViewDto implements Serializable {

    private String oid;
    private String name;
    private String xml;

    public ObjectViewDto() {
    }

    public ObjectViewDto(String name, String oid, String xml) {
        this.name = name;
        this.oid = oid;
        this.xml = xml;
    }

    public String getName() {
        return name;
    }

    public String getOid() {
        return oid;
    }

    public String getXml() {
        return xml;
    }

    public void setXml(String xml) {
        this.xml = xml;
    }
}

/*
 * Copyright (c) 2012 Evolveum
 *
 * The contents of this file are subject to the terms
 * of the Common Development and Distribution License
 * (the License). You may not use this file except in
 * compliance with the License.
 *
 * You can obtain a copy of the License at
 * http://www.opensource.org/licenses/cddl1 or
 * CDDLv1.0.txt file in the source code distribution.
 * See the License for the specific language governing
 * permission and limitations under the License.
 *
 * If applicable, add the following below the CDDL Header,
 * with the fields enclosed by brackets [] replaced by
 * your own identifying information:
 *
 * Portions Copyrighted 2012 [name of copyright owner]
 */

package com.evolveum.midpoint.web.page.admin.configuration.dto;

import java.io.Serializable;

/**
 * @author lazyman
 */
public class ObjectViewDto implements Serializable {

    private String oid;
    private String name;
    private String xml;

    public ObjectViewDto() {
    }

    public ObjectViewDto(String oid, String name, String xml) {
        this.name = name;
        this.oid = oid;
        this.xml = xml;
    }

    public String getName() {
        return name;
    }

    public String getOid() {
        return oid;
    }

    public String getXml() {
        return xml;
    }

    public void setXml(String xml) {
        this.xml = xml;
    }
}

Change the position parameter in the constructor


/*
 IntentDConnectMessage.java
 Copyright (c) 2014 NTT DOCOMO,INC.
 Released under the MIT license
 http://opensource.org/licenses/mit-license.php
 */
package org.deviceconnect.message.intent.message;

import org.deviceconnect.message.DConnectMessage;

/**
 * メッセージ.
 * @author NTT DOCOMO, INC.
 */
public interface IntentDConnectMessage extends DConnectMessage {

    /**
     * アクション:GET.
     */
    String ACTION_GET = "org.deviceconnect.action.GET";

    /**
     * アクション:PUT.
     */
    String ACTION_PUT = "org.deviceconnect.action.PUT";

    /**
     * アクション:POST.
     */
    String ACTION_POST = "org.deviceconnect.action.POST";

    /**
     * アクション:DELETE.
     */
    String ACTION_DELETE = "org.deviceconnect.action.DELETE";

    /**
     * アクション:RESPONSE.
     */
    String ACTION_RESPONSE = "org.deviceconnect.action.RESPONSE";

    /**
     * アクション:EVENT.
     */
    String ACTION_EVENT = "org.deviceconnect.action.EVENT";

    /**
     * アクションを取得する.
     * @return アクション
     */
    String getAction();

}

/*
 IntentDConnectMessage.java
 Copyright (c) 2014 NTT DOCOMO,INC.
 Released under the MIT license
 http://opensource.org/licenses/mit-license.php
 */
package org.deviceconnect.message.intent.message;

import org.deviceconnect.message.DConnectMessage;

/**
 * メッセージ.
 * @author NTT DOCOMO, INC.
 */
public interface IntentDConnectMessage extends DConnectMessage {

    /**
     * アクション:GET.
     */
    String ACTION_GET = "org.deviceconnect.action.GET";

    /**
     * アクション:PUT.
     */
    String ACTION_PUT = "org.deviceconnect.action.PUT";

    /**
     * アクション:POST.
     */
    String ACTION_POST = "org.deviceconnect.action.POST";

    /**
     * アクション:DELETE.
     */
    String ACTION_DELETE = "org.deviceconnect.action.DELETE";

    /**
     * アクション:RESPONSE.
     */
    String ACTION_RESPONSE = "org.deviceconnect.action.RESPONSE";

    /**
     * アクション:EVENT.
     */
    String ACTION_EVENT = "org.deviceconnect.action.EVENT";

    /**
     * パラメータ: {@value} .
     */
    String EXTRA_ORIGIN = "origin";

    /**
     * パラメータ: {@value} .
     */
    String EXTRA_KEY = "key";

    /**
     * パラメータ: {@value} .
     */
    String EXTRA_NONCE = "nonce";

    /**
     * パラメータ: {@value} .
     */
    String EXTRA_HMAC = "hmac";

    /**
     * アクションを取得する.
     * @return アクション
     */
    String getAction();

}

Define new request parameters for server anti-spoofing.


package uk.gov.register.core;

import org.junit.Test;
import java.time.Instant;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

public class EntryTest {
    @Test
    public void getTimestampAsISOFormat_returnsTheFormattedTimestamp() {
        Entry entry = new Entry(123, "abc", Instant.ofEpochSecond(1470403440));
        assertThat(entry.getTimestampAsISOFormat(), equalTo("2016-08-05T13:24:00Z"));
    }

    @Test
    public void getItemHash_returnsSha256AsItemHash() {
        Entry entry = new Entry(123, "abc", Instant.ofEpochSecond(1470403440));
        assertThat(entry.getItemHash(), equalTo("sha-256:abc"));
    }
}

package uk.gov.register.core;

import org.junit.Test;
import java.time.Instant;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

public class EntryTest {
    @Test
    public void getTimestampAsISOFormat_returnsTheFormattedTimestamp() {
        Entry entry = new Entry(123, "abc", Instant.ofEpochSecond(1470403440));
        assertThat(entry.getTimestampAsISOFormat(), equalTo("2016-08-05T13:24:00Z"));
    }

    @Test
    public void getSha256hex_returnsTheSha256HexOfItem() {
        Entry entry = new Entry(123, "abc", Instant.ofEpochSecond(1470403440));
        assertThat(entry.getSha256hex(), equalTo("abc"));
    }

    @Test
    public void getItemHash_returnsSha256AsItemHash() {
        Entry entry = new Entry(123, "abc", Instant.ofEpochSecond(1470403440));
        assertThat(entry.getItemHash(), equalTo("sha-256:abc"));
    }
}

Add additional Entry test to show distinction between sha and itemhash


package de.fu_berlin.imp.apiua.groundedtheory.handlers;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;

import com.bkahlert.nebula.utils.selection.retriever.SelectionRetrieverFactory;

import de.fu_berlin.imp.apiua.groundedtheory.model.ICode;
import de.fu_berlin.imp.apiua.groundedtheory.ui.Utils;
import de.fu_berlin.imp.apiua.groundedtheory.ui.wizards.WizardUtils;

public class CreateCodeHandler extends AbstractHandler {

	@SuppressWarnings("unused")
	private static final Logger LOGGER = Logger
			.getLogger(CreateCodeHandler.class);

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {

		Collection<?> menus = HandlerUtil.getActiveMenus(event);

		List<ICode> codes = menus.size() > 0 ? SelectionRetrieverFactory
				.getSelectionRetriever(ICode.class).getSelection()
				: new LinkedList<ICode>();
		assert codes.size() < 2;

		WizardUtils.openNewCodeWizard(codes.size() == 1 ? codes.get(0) : null,
				Utils.getFancyCodeColor());

		return null;
	}

}

package de.fu_berlin.imp.apiua.groundedtheory.handlers;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import org.apache.log4j.Logger;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.handlers.HandlerUtil;

import com.bkahlert.nebula.utils.selection.retriever.SelectionRetrieverFactory;

import de.fu_berlin.imp.apiua.groundedtheory.model.ICode;
import de.fu_berlin.imp.apiua.groundedtheory.ui.Utils;
import de.fu_berlin.imp.apiua.groundedtheory.ui.wizards.WizardUtils;

public class CreateCodeHandler extends AbstractHandler {

	@SuppressWarnings("unused")
	private static final Logger LOGGER = Logger
			.getLogger(CreateCodeHandler.class);

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {

		Collection<?> menus = HandlerUtil.getActiveMenus(event);

		List<ICode> codes = menus != null && menus.size() > 0 ? SelectionRetrieverFactory
				.getSelectionRetriever(ICode.class).getSelection()
				: new LinkedList<ICode>();
		assert codes.size() < 2;

		WizardUtils.openNewCodeWizard(codes.size() == 1 ? codes.get(0) : null,
				Utils.getFancyCodeColor());

		return null;
	}

}

Create Code Toolbar Action repaired


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

package org.wso2.carbon.apimgt.api.model.policy;

import java.util.List;

public class Pipeline {

    private QuotaPolicy quotaPolicy;

    private List<Condition> conditions;

    public List<Condition> getConditions() {
        return conditions;
    }

    public void setConditions(List<Condition> condition) {
        this.conditions = condition;
    }

    public QuotaPolicy getQuotaPolicy() {
        return quotaPolicy;
    }

    public void setQuotaPolicy(QuotaPolicy quotaPolicy) {
        this.quotaPolicy = quotaPolicy;
    }

    @Override
    public String toString() {
        return "Pipeline [quotaPolicy=" + quotaPolicy + ", conditions=" + conditions + "]";
    }

}

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

package org.wso2.carbon.apimgt.api.model.policy;

import java.util.List;

public class Pipeline {

    private QuotaPolicy quotaPolicy;
    private List<Condition> conditions;
    private boolean enabled;

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public List<Condition> getConditions() {
        return conditions;
    }

    public void setConditions(List<Condition> condition) {
        this.conditions = condition;
    }

    public QuotaPolicy getQuotaPolicy() {
        return quotaPolicy;
    }

    public void setQuotaPolicy(QuotaPolicy quotaPolicy) {
        this.quotaPolicy = quotaPolicy;
    }

    @Override
    public String toString() {
        return "Pipeline [quotaPolicy=" + quotaPolicy + ", conditions=" + conditions + "]";
    }

}

Add enabled property to pipeline


package main;

import approximation.Lagrange;

/**
 * Main class
 * @author Pavel_Verkhovtsov
 */
public class Main {

	private static double[] y = {2.02, 1.98, 1.67, 1.65, 1.57, 1.42, 1.37, 1.07, 0.85, 0.48, 0.35, -0.30, -0.61, -1.2, -1.39, -1.76, -2.28, -2.81, -3.57, -4.06};
	private static double[] x = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};

	/**
	 * Main method.
	 * @param args console parameters
	 */
	public static void main(final String[] args){
		Lagrange lagrange = new Lagrange(x, y);
		System.out.println(lagrange.approximazeFunction(2));
	}
}

package main;

import java.util.Scanner;

import approximation.Lagrange;

/**
 * Main class
 * @author Pavel_Verkhovtsov
 */
public class Main {

	private static double[] y = {2.02, 1.98, 1.67, 1.65, 1.57, 1.42, 1.37, 1.07, 0.85, 0.48, 0.35, -0.30, -0.61, -1.2, -1.39, -1.76, -2.28, -2.81, -3.57, -4.06};
	private static double[] x = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20};

	/**
	 * Main method.
	 * @param args console parameters
	 */
	@SuppressWarnings("resource")
	public static void main(final String[] args){
		Lagrange lagrange = new Lagrange(x, y);
		System.out.print("Input approximation point: ");
		double point = new Scanner(System.in).nextDouble();
		System.out.println(lagrange.approximazeFunction(point));
	}
}

Add console input approximation point


package org.assertj.android.api.bluetooth;

import android.bluetooth.BluetoothGattCharacteristic;
import android.support.annotation.IntDef;
import java.lang.annotation.Retention;

import static java.lang.annotation.RetentionPolicy.SOURCE;

@IntDef(
    flag = true,
    value = {
        BluetoothGattCharacteristic.PERMISSION_READ,
        BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED,
        BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM,
        BluetoothGattCharacteristic.PERMISSION_WRITE,
        BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED,
        BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM,
        BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED,
        BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED_MITM
    }
)
@Retention(SOURCE)
@interface BluetoothGattCharacteristicPermissions {
}

package org.assertj.android.api.bluetooth;

import android.bluetooth.BluetoothGattCharacteristic;
import android.support.annotation.IntDef;
import java.lang.annotation.Retention;

import static java.lang.annotation.RetentionPolicy.SOURCE;

@IntDef(
    flag = true,
    value = {
        BluetoothGattCharacteristic.PERMISSION_READ,
        BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED,
        BluetoothGattCharacteristic.PERMISSION_READ_ENCRYPTED_MITM,
        BluetoothGattCharacteristic.PERMISSION_WRITE,
        BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED,
        BluetoothGattCharacteristic.PERMISSION_WRITE_ENCRYPTED_MITM,
        BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED,
        BluetoothGattCharacteristic.PERMISSION_WRITE_SIGNED_MITM
    }
)
@Retention(SOURCE)
@interface BluetoothGattCharacteristicPermissions {
}

Fix bluetooth characteristic intdef copy-paste typo.


/*
 * Copyright 2011 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.springframework.social.twitter.api.impl;

import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.social.twitter.api.Trend;

/**
 * Holder of a list of daily trends.
 * @author Craig Walls
 */
@JsonIgnoreProperties(ignoreUnknown=true)
class DailyTrendsList extends AbstractTrendsList {

	@JsonCreator
	public DailyTrendsList(@JsonProperty("trends") Map<String, List<Trend>> trends) {
		super(trends, new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
	}

}

/*
 * Copyright 2011 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.springframework.social.twitter.api.impl;

import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.springframework.social.twitter.api.Trend;

/**
 * Holder of a list of daily trends.
 * @author Craig Walls
 */
@JsonIgnoreProperties(ignoreUnknown=true)
class DailyTrendsList extends AbstractTrendsList {

	@JsonCreator
	public DailyTrendsList(@JsonProperty("trends") Map<String, List<Trend>> trends) {
		super(trends, new SimpleDateFormat("yyyy-MM-dd HH:mm"));
	}

}

Change the date format for daily trends (SOCIALTW-14).


package ${package}.server;

import java.io.IOException;
import java.net.URI;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;

/** Starts REST server based on Jersey.
 */
final class Main implements ContainerResponseFilter {
    public static void main(String... args) throws Exception {
        ResourceConfig rc = new ResourceConfig(
            ContactsResource.class, Main.class
        );
        URI u = new URI("http://localhost:8080/");
        HttpServer server = GrizzlyHttpServerFactory.createHttpServer(u, rc);
        System.err.println("Press Enter to shutdown the server");
        System.in.read();
        server.stop();
    }

    @Override
    public void filter(
        ContainerRequestContext requestContext,
        ContainerResponseContext r
    ) throws IOException {
        r.getHeaders().add("Access-Control-Allow-Origin", "*");
        r.getHeaders().add("Access-Control-Allow-Credentials", "true");
        r.getHeaders().add("Access-Control-Allow-Headers", "Content-Type");
        r.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
    }
}

package ${package}.server;

import java.io.IOException;
import java.net.URI;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import org.glassfish.grizzly.http.server.HttpServer;
import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;

/** Starts REST server based on Jersey.
 */
final class Main implements ContainerResponseFilter {
    public static void main(String... args) throws Exception {
        ResourceConfig rc = new ResourceConfig(
            ContactsResource.class, Main.class
        );
        URI u = new URI("http://0.0.0.0:8080/");
        HttpServer server = GrizzlyHttpServerFactory.createHttpServer(u, rc);
        System.err.println("Press Enter to shutdown the server");
        System.in.read();
        server.stop();
    }

    @Override
    public void filter(
        ContainerRequestContext requestContext,
        ContainerResponseContext r
    ) throws IOException {
        r.getHeaders().add("Access-Control-Allow-Origin", "*");
        r.getHeaders().add("Access-Control-Allow-Credentials", "true");
        r.getHeaders().add("Access-Control-Allow-Headers", "Content-Type");
        r.getHeaders().add("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
    }
}

Allow connection from any host


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

package org.apache.maven.shell.core.impl.command;

import org.apache.maven.shell.cli.Option;
import org.apache.maven.shell.i18n.MessageSource;
import org.apache.maven.shell.i18n.ResourceBundleMessageSource;

/**
 * Helper to inject <tt>--help<tt> support.
 *
 * @version $Rev$ $Date$
 */
public class CommandHelpSupport
{
    @Option(name="-h", aliases={"--help"}, requireOverride=true)
    public boolean displayHelp;

    private MessageSource messages;

    public MessageSource getMessages() {
        if (messages == null) {
            messages = new ResourceBundleMessageSource(getClass());
        }

        return messages;
    }
}

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

package org.apache.maven.shell.core.impl.command;

import org.apache.maven.shell.cli.Option;
import org.apache.maven.shell.i18n.MessageSource;
import org.apache.maven.shell.i18n.ResourceBundleMessageSource;

/**
 * Helper to inject <tt>--help<tt> support.
 *
 * @version $Rev$ $Date$
 */
public class CommandHelpSupport
{
    //CLOVER: OFF

    @Option(name="-h", aliases={"--help"}, requireOverride=true)
    public boolean displayHelp;

    private MessageSource messages;

    public MessageSource getMessages() {
        if (messages == null) {
            messages = new ResourceBundleMessageSource(getClass());
        }

        return messages;
    }
}

Disable clover for help support


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

package com.googlesource.gerrit.plugins.reviewersbyblame;

import com.google.gerrit.common.ChangeListener;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.server.config.FactoryModule;

public class ReviewersByBlameModule extends FactoryModule {
  @Override
  protected void configure() {
    DynamicSet.bind(binder(), ChangeListener.class).to(
        ChangeUpdatedListener.class);
    factory(ReviewersByBlame.Factory.class);
  }
}

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

package com.googlesource.gerrit.plugins.reviewersbyblame;

import com.google.gerrit.common.ChangeListener;
import com.google.gerrit.extensions.annotations.Exports;
import com.google.gerrit.extensions.registration.DynamicSet;
import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.ProjectConfigEntry;

public class ReviewersByBlameModule extends FactoryModule {
  @Override
  protected void configure() {
    DynamicSet.bind(binder(), ChangeListener.class).to(
        ChangeUpdatedListener.class);
    factory(ReviewersByBlame.Factory.class);
    bind(ProjectConfigEntry.class)
        .annotatedWith(Exports.named("maxReviewers"))
        .toInstance(new ProjectConfigEntry("Max Reviewers", 3, true,
            "The maximum number of reviewers that should be automatically added"
            + " to a change based on the git blame computation on the changed files."));
  }
}

Allow to set maxReviewers on a project from the WebUI


package org.biojava.nbio.structure.align.quaternary;

/**
 * The parameter bean for the {@link QsAlign} algorithm.
 *
 * @author Aleix Lafita
 * @since 5.0.0
 *
 */
public class QsAlignParameters {

	private double dCutoff = 10.0;

	/**
	 * The maximum allowed distance between the centroids of two equivalent
	 * Subunits, in A.
	 *
	 * @return dCutoff
	 */
	public double getdCutoff() {
		return dCutoff;
	}

	/**
	 * The maximum allowed distance between the centroids of two equivalent
	 * Subunits, in A.
	 *
	 * @param dCutoff
	 */
	public void setdCutoff(double dCutoff) {
		this.dCutoff = dCutoff;
	}

}

package org.biojava.nbio.structure.align.quaternary;

/**
 * The parameter bean for the {@link QsAlign} algorithm.
 *
 * @author Aleix Lafita
 * @since 5.0.0
 *
 */
public class QsAlignParameters {

	private double dCutoff = 10.0;
	private double maxRmsd = 7.0;
	private double minOrientationMetric = Math.PI / 8; // 45 degree

	/**
	 * The maximum allowed distance between the centroids of two equivalent
	 * Subunits, in A.
	 *
	 * @return dCutoff
	 */
	public double getdCutoff() {
		return dCutoff;
	}

	/**
	 * The maximum allowed distance between the centroids of two equivalent
	 * Subunits, in A.
	 *
	 * @param dCutoff
	 */
	public void setdCutoff(double dCutoff) {
		this.dCutoff = dCutoff;
	}

	public double getMaxRmsd() {
		return maxRmsd;
	}

	public void setMaxRmsd(double maxRmsd) {
		this.maxRmsd = maxRmsd;
	}

	public double getMinOrientationMetric() {
		return minOrientationMetric;
	}

	public void setMinOrientationMetric(double minOrientationMetric) {
		this.minOrientationMetric = minOrientationMetric;
	}

}

Add more parameters for QsAlign


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

package com.google.androidbrowserhelper.demos.playbilling;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.google.androidbrowserhelper.trusted.LauncherActivity;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void launch(View view) {
        Intent intent = new Intent(this, LauncherActivity.class);
        startActivity(intent);
    }
}

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

package com.google.androidbrowserhelper.demos.playbilling;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;

import com.google.androidbrowserhelper.trusted.LauncherActivity;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void launch(View view) {
        Intent intent = new Intent(this, LauncherActivity.class);

        intent.setData(
                Uri.parse("https://beer.conn.dev?client_version=" + BuildConfig.VERSION_CODE));

        startActivity(intent);
    }
}

Add demo app version code to launch URL.


package com.braintreepayments.api.exceptions;

public class AppSwitchNotAvailableException extends BraintreeException {
}

package com.braintreepayments.api.exceptions;

/**
 * Error class thrown when app switch to the corresponding wallet is not possible
 */
public class AppSwitchNotAvailableException extends BraintreeException {
}

Add comment to exception class


package org.tinylog.benchmarks.file;

import java.io.IOException;
import java.nio.file.Path;

import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.tinylog.impl.writers.file.LogFile;

/**
 * State for writing strings by using {@link LogFile}.
 */
@State(Scope.Thread)
public class LogFileState extends AbstractState<LogFile> {

	/**
	 * The buffer sizes to benchmark.
	 */
	@Param({ "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072" })
	private int bufferSize;

	/** */
	public LogFileState() {
	}

	/**
	 * @param bufferSize The buffer size in bytes
	 */
	public LogFileState(int bufferSize) {
		this.bufferSize = bufferSize;
	}

	@Override
	public void write(String content) throws IOException {
		instance.write(content);
	}

	@Override
	protected LogFile create(Path path) throws IOException {
		return new LogFile(path.toString(), bufferSize, CHARSET, false);
	}

}

package org.tinylog.benchmarks.file;

import java.io.IOException;
import java.nio.file.Path;

import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.tinylog.impl.writers.file.LogFile;

/**
 * State for writing strings by using {@link LogFile}.
 */
@State(Scope.Thread)
public class LogFileState extends AbstractState<LogFile> {

	/**
	 * The buffer sizes to benchmark.
	 */
	@Param({ "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072" })
	private int bufferSize;

	/** */
	public LogFileState() {
	}

	/**
	 * @param bufferSize The buffer size in bytes
	 */
	public LogFileState(int bufferSize) {
		this.bufferSize = bufferSize;
	}

	@Override
	public void write(String content) throws IOException {
		instance.write(content.getBytes(CHARSET));
	}

	@Override
	protected LogFile create(Path path) throws IOException {
		return new LogFile(path.toString(), bufferSize, CHARSET, false);
	}

}

Fix writing strings in FileOutputBenchmark via FileLogState


package de.fau.amos.virtualledger.android.views.savings;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class AddSavingsAccountPagerAdapter extends FragmentPagerAdapter {

    public AddSavingsAccountPagerAdapter(final FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(final int position) {
        return null;
    }

    @Override
    public int getCount() {
        return 0;
    }
}

package de.fau.amos.virtualledger.android.views.savings;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class AddSavingsAccountPagerAdapter extends FragmentPagerAdapter {

    public AddSavingsAccountPagerAdapter(final FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(final int position) {
        return new AddSavingsAccountNameFragment();
    }

    @Override
    public int getCount() {
        return 1;
    }
}

Use name fragment as only fragment in pager adapter for now


/*
 * Copyright 2012-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://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.springframework.boot.actuate.health;

import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/**
 * A collection of named health endpoint contributors (either {@link HealthContributor} or
 * {@link ReactiveHealthContributor}).
 *
 * @param <C> the contributor type
 * @author Phillip Webb
 * @since 2.0.0
 * @see NamedContributor
 */
public interface NamedContributors<C> extends Iterable<NamedContributor<C>> {

	/**
	 * Return the contributor with the given name.
	 * @param name the name of the contributor
	 * @return a contributor instance or {@code null}
	 */
	C getContributor(String name);

	/**
	 * Return a stream of the {@link NamedContributor named contributors}.
	 * @return the stream of named contributors
	 */
	default Stream<NamedContributor<C>> stream() {
		return StreamSupport.stream(spliterator(), false);
	}

}

/*
 * Copyright 2012-2021 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
 *
 *      https://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.springframework.boot.actuate.health;

import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/**
 * A collection of named health endpoint contributors (either {@link HealthContributor} or
 * {@link ReactiveHealthContributor}).
 *
 * @param <C> the contributor type
 * @author Phillip Webb
 * @since 2.0.0
 * @see NamedContributor
 */
public interface NamedContributors<C> extends Iterable<NamedContributor<C>> {

	/**
	 * Return the contributor with the given name.
	 * @param name the name of the contributor
	 * @return a contributor instance or {@code null}
	 */
	C getContributor(String name);

	/**
	 * Return a stream of the {@link NamedContributor named contributors}.
	 * @return the stream of named contributors
	 */
	default Stream<NamedContributor<C>> stream() {
		return StreamSupport.stream(spliterator(), false);
	}

}

Update copyright year of changed file


package com.hubspot.singularity.executor.config;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.hubspot.singularity.executor.SingularityExecutorLogrotateFrequency;

public class SingularityExecutorLogrotateAdditionalFile {
    private final String filename;
    private Optional<String> extension;
    private Optional<String> dateformat;
    private Optional<SingularityExecutorLogrotateFrequency> logrotateFrequencyOverride;

    @JsonCreator
    public static SingularityExecutorLogrotateAdditionalFile fromString(String value) {
        return new SingularityExecutorLogrotateAdditionalFile(value, Optional.absent(), Optional.absent(), null);
    }

    @JsonCreator
    public SingularityExecutorLogrotateAdditionalFile(@JsonProperty("filename") String filename,
                                                      @JsonProperty("extension") Optional<String> extension,
                                                      @JsonProperty("dateformat") Optional<String> dateformat,
        @JsonProperty("logrotateFrequencyOverride") SingularityExecutorLogrotateFrequency logrotateFrequencyOverride) {
        this.filename = filename;
        this.extension = extension;
        this.dateformat = dateformat;
        this.logrotateFrequencyOverride = Optional.fromNullable(logrotateFrequencyOverride);
    }

    public String getFilename() {
        return filename;
    }

    public Optional<String> getExtension() {
        return extension;
    }

    public Optional<String> getDateformat() {
        return dateformat;
    }

    public Optional<SingularityExecutorLogrotateFrequency> getLogrotateFrequencyOverride() {
        return logrotateFrequencyOverride;
    }

}

package com.hubspot.singularity.executor.config;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.hubspot.singularity.executor.SingularityExecutorLogrotateFrequency;

public class SingularityExecutorLogrotateAdditionalFile {
    private final String filename;
    private final Optional<String> extension;
    private final Optional<String> dateformat;
    private final Optional<SingularityExecutorLogrotateFrequency> logrotateFrequencyOverride;

    @JsonCreator
    public static SingularityExecutorLogrotateAdditionalFile fromString(String value) {
        return new SingularityExecutorLogrotateAdditionalFile(value, Optional.absent(), Optional.absent(), null);
    }

    @JsonCreator
    public SingularityExecutorLogrotateAdditionalFile(@JsonProperty("filename") String filename,
                                                      @JsonProperty("extension") Optional<String> extension,
                                                      @JsonProperty("dateformat") Optional<String> dateformat,
        @JsonProperty("logrotateFrequencyOverride") SingularityExecutorLogrotateFrequency logrotateFrequencyOverride) {
        this.filename = filename;
        this.extension = extension;
        this.dateformat = dateformat;
        this.logrotateFrequencyOverride = Optional.fromNullable(logrotateFrequencyOverride);
    }

    public String getFilename() {
        return filename;
    }

    public Optional<String> getExtension() {
        return extension;
    }

    public Optional<String> getDateformat() {
        return dateformat;
    }

    public Optional<SingularityExecutorLogrotateFrequency> getLogrotateFrequencyOverride() {
        return logrotateFrequencyOverride;
    }

}

Make parameters final that can be made final.


package org.grouplens.lenskit.util.tablewriter;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import org.grouplens.lenskit.eval.util.table.TableImpl;

public class MultiplexedTableWriter implements TableWriter {

	private TableLayout layout;
	private List<TableWriter> writers;

	public MultiplexedTableWriter(TableLayout layout, List<TableWriter> writers) {
		this.layout = layout;
		this.writers = writers;
	}

	public MultiplexedTableWriter(TableLayout layout, TableWriter... writers) {
		this(layout, Arrays.asList(writers));
	}

	@Override
	public TableLayout getLayout() {
		return layout;
	}

	@Override
	public void writeRow(Object[] row) throws IOException {
		for (TableWriter w: writers) {
			w.writeRow(row);
		}

	}

	@Override
	public void close() throws IOException {
		for (TableWriter w : writers) {
			w.close();
		}
	}
}

package org.grouplens.lenskit.util.tablewriter;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MultiplexedTableWriter implements TableWriter {

	private TableLayout layout;
	private List<TableWriter> writers;

	public MultiplexedTableWriter(TableLayout layout, List<TableWriter> writers) {
		this.layout = layout;
		this.writers = writers;
	}

	public MultiplexedTableWriter(TableLayout layout, TableWriter... writers) {
		this(layout, Arrays.asList(writers));
	}

	@Override
	public TableLayout getLayout() {
		return layout;
	}

	@Override
	public void writeRow(Object[] row) throws IOException {
		for (TableWriter w: writers) {
			w.writeRow(row);
		}

	}

	@Override
	public void close() throws IOException {
		ArrayList<IOException> closeExceptions = new ArrayList<IOException>(writers.size());
		for (TableWriter w : writers) {
			try {
				w.close();
			} catch (IOException e) {
				closeExceptions.add(e);
			}
		}
		if (!closeExceptions.isEmpty()) {
			throw closeExceptions.get(0);
		}
	}
}

Fix closing of multiplexed table writer to close all constituent table writers in presence of exceptions


// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.monitoring;

import com.google.common.collect.ImmutableList;

import static com.yahoo.vespa.model.admin.monitoring.NetworkMetrics.networkMetricSet;
import static com.yahoo.vespa.model.admin.monitoring.SystemMetrics.systemMetricSet;
import static com.yahoo.vespa.model.admin.monitoring.VespaMetricSet.vespaMetricSet;
import static java.util.Collections.emptyList;

/**
 * This class sets up the default 'Vespa' metrics consumer.
 *
 * @author trygve
 * @author gjoranv
 */
public class DefaultMetricsConsumer {

    public static final String VESPA_CONSUMER_ID = "Vespa";

    private static final MetricSet defaultConsumerMetrics = new MetricSet("default-consumer",
                                                                          emptyList(),
                                                                          ImmutableList.of(vespaMetricSet,
                                                                                systemMetricSet,
                                                                                networkMetricSet));

    @SuppressWarnings("UnusedDeclaration")
    public static MetricsConsumer getDefaultMetricsConsumer() {
        return new MetricsConsumer(VESPA_CONSUMER_ID, defaultConsumerMetrics);
    }

}

// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.admin.monitoring;

import ai.vespa.metricsproxy.core.VespaMetrics;
import com.google.common.collect.ImmutableList;

import static com.yahoo.vespa.model.admin.monitoring.NetworkMetrics.networkMetricSet;
import static com.yahoo.vespa.model.admin.monitoring.SystemMetrics.systemMetricSet;
import static com.yahoo.vespa.model.admin.monitoring.VespaMetricSet.vespaMetricSet;
import static java.util.Collections.emptyList;

/**
 * This class sets up the default 'Vespa' metrics consumer.
 *
 * @author trygve
 * @author gjoranv
 */
public class DefaultMetricsConsumer {

    public static final String VESPA_CONSUMER_ID = VespaMetrics.VESPA_CONSUMER_ID.id;

    private static final MetricSet defaultConsumerMetrics = new MetricSet("default-consumer",
                                                                          emptyList(),
                                                                          ImmutableList.of(vespaMetricSet,
                                                                                systemMetricSet,
                                                                                networkMetricSet));

    @SuppressWarnings("UnusedDeclaration")
    public static MetricsConsumer getDefaultMetricsConsumer() {
        return new MetricsConsumer(VESPA_CONSUMER_ID, defaultConsumerMetrics);
    }

}

Use string constant from metrics-proxy to avoid duplication.


package name.webdizz.fault.tolerance.inventory.client.command;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_PRODUCT;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_STORE;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.INVENTORY_SERVICE_URL;

import org.junit.Test;
import name.webdizz.fault.tolerance.inventory.client.InventoryRequester;
import name.webdizz.fault.tolerance.inventory.domain.Inventory;

public class TimeOutInventoryRequestCommandTest {

    private static final int TIMEOUT_IN_MILLIS = 10;
    private InventoryRequester inventoryRequester = new InventoryRequester(INVENTORY_SERVICE_URL);

    @Test
    public void shouldNotCompleteInventoryRequestDueToTimeout() {
        TimeOutInventoryRequestCommand timeOutInventoryRequestCommand;
        timeOutInventoryRequestCommand = new TimeOutInventoryRequestCommand(inventoryRequester, DEFAULT_STORE, DEFAULT_PRODUCT, TIMEOUT_IN_MILLIS);
        Inventory inventory = timeOutInventoryRequestCommand.execute();
        assertThat(timeOutInventoryRequestCommand.isResponseTimedOut(), is(true));
    }
}

package name.webdizz.fault.tolerance.inventory.client.command;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_PRODUCT;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.DEFAULT_STORE;
import static name.webdizz.fault.tolerance.inventory.client.InventoryApiTestConstants.INVENTORY_SERVICE_URL;

import org.junit.Test;
import name.webdizz.fault.tolerance.inventory.client.InventoryRequester;

public class TimeOutInventoryRequestCommandTest {

    private static final int TIMEOUT_IN_MILLIS = 10;
    private InventoryRequester inventoryRequester = new InventoryRequester(INVENTORY_SERVICE_URL);
    private final boolean timedOut = true;

    @Test
    public void shouldNotCompleteInventoryRequestDueToTimeout() {
        TimeOutInventoryRequestCommand timeOutInventoryRequestCommand;
        timeOutInventoryRequestCommand = new TimeOutInventoryRequestCommand(inventoryRequester, DEFAULT_STORE, DEFAULT_PRODUCT, TIMEOUT_IN_MILLIS);
        boolean request = timeOutInventoryRequestCommand.isResponseTimedOut();
        assertThat(request, is(timedOut));
    }
}

Enhance readability of time out command test


package org.apereo.cas.configuration.model.core.web.security;

import org.springframework.core.io.Resource;

/**
 * This is {@link AdminPagesSecurityProperties}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */

public class AdminPagesSecurityProperties {

    private String ip = "127\\.0\\.0\\.1";
    private String adminRoles = "ROLE_ADMIN";
    private String loginUrl;
    private String service;
    private Resource users;
    private boolean actuatorEndpointsEnabled;

    public boolean isActuatorEndpointsEnabled() {
        return actuatorEndpointsEnabled;
    }

    public void setActuatorEndpointsEnabled(final boolean actuatorEndpointsEnabled) {
        this.actuatorEndpointsEnabled = actuatorEndpointsEnabled;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(final String ip) {
        this.ip = ip;
    }

    public String getAdminRoles() {
        return adminRoles;
    }

    public void setAdminRoles(final String adminRoles) {
        this.adminRoles = adminRoles;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public void setLoginUrl(final String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public String getService() {
        return service;
    }

    public void setService(final String service) {
        this.service = service;
    }

    public Resource getUsers() {
        return users;
    }

    public void setUsers(final Resource users) {
        this.users = users;
    }
}

package org.apereo.cas.configuration.model.core.web.security;

import org.springframework.core.io.Resource;

/**
 * This is {@link AdminPagesSecurityProperties}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */

public class AdminPagesSecurityProperties {

    private String ip = "127\\.0\\.0\\.1|0:0:0:0:0:0:0:1";
    private String adminRoles = "ROLE_ADMIN";
    private String loginUrl;
    private String service;
    private Resource users;
    private boolean actuatorEndpointsEnabled;

    public boolean isActuatorEndpointsEnabled() {
        return actuatorEndpointsEnabled;
    }

    public void setActuatorEndpointsEnabled(final boolean actuatorEndpointsEnabled) {
        this.actuatorEndpointsEnabled = actuatorEndpointsEnabled;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(final String ip) {
        this.ip = ip;
    }

    public String getAdminRoles() {
        return adminRoles;
    }

    public void setAdminRoles(final String adminRoles) {
        this.adminRoles = adminRoles;
    }

    public String getLoginUrl() {
        return loginUrl;
    }

    public void setLoginUrl(final String loginUrl) {
        this.loginUrl = loginUrl;
    }

    public String getService() {
        return service;
    }

    public void setService(final String service) {
        this.service = service;
    }

    public Resource getUsers() {
        return users;
    }

    public void setUsers(final Resource users) {
        this.users = users;
    }
}

Support ipv6 for status endpoint security


package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}

	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";
	}

	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}
}

package net.sf.taverna.t2.activities.beanshell.servicedescriptions;

import java.net.URI;

import javax.swing.Icon;

import net.sf.taverna.t2.activities.beanshell.BeanshellActivity;
import net.sf.taverna.t2.activities.beanshell.BeanshellActivityConfigurationBean;
import net.sf.taverna.t2.servicedescriptions.AbstractTemplateService;
import net.sf.taverna.t2.servicedescriptions.ServiceDescription;

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	private static final URI providerId = URI
	.create("http://taverna.sf.net/2010/service-provider/beanshell");

	public String getName() {
		return BEANSHELL;
	}

	@Override
	public Class<BeanshellActivity> getActivityClass() {
		return BeanshellActivity.class;
	}

	@Override
	public BeanshellActivityConfigurationBean getActivityConfiguration() {
		return new BeanshellActivityConfigurationBean();
	}

	@Override
	public Icon getIcon() {
		return BeanshellActivityIcon.getBeanshellIcon();
	}

	@Override
	public String getDescription() {
		return "A service that allows Beanshell scripts, with dependencies on libraries";
	}

	@SuppressWarnings("unchecked")
	public static ServiceDescription getServiceDescription() {
		BeanshellTemplateService bts = new BeanshellTemplateService();
		return bts.templateService;
	}

	public String getId() {
		return providerId.toString();
	}
}

Fix for T2-674: Hardcoded default locations. System default configurable providers are now read from a file in Taverna startup/conf directory. Failing that - they are read from a hard coded list. User can now import and export services from such files as well.


package io.quarkus.hibernate.validator.test.config;

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

import javax.inject.Inject;
import javax.validation.constraints.Max;

import org.eclipse.microprofile.config.Config;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.ConfigValidationException;
import io.smallrye.config.SmallRyeConfig;

public class ConfigMappingValidatorTest {
    @RegisterExtension
    static final QuarkusUnitTest UNIT_TEST = new QuarkusUnitTest().setArchiveProducer(
            () -> ShrinkWrap.create(JavaArchive.class)
                    .addAsResource(new StringAsset("server.host=localhost\n"), "application.properties"));

    @Inject
    Config config;

    @Test
    void validator() {
        assertThrows(ConfigValidationException.class,
                () -> config.unwrap(SmallRyeConfig.class).getConfigMapping(Server.class),
                "server.host must be less than or equal to 3");
    }

    @ConfigMapping(prefix = "server")
    public interface Server {
        @Max(3)
        String host();
    }
}

package io.quarkus.hibernate.validator.test.config;

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

import javax.inject.Inject;
import javax.validation.constraints.Max;

import org.eclipse.microprofile.config.Config;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.ConfigValidationException;
import io.smallrye.config.SmallRyeConfig;

public class ConfigMappingValidatorTest {
    @RegisterExtension
    static final QuarkusUnitTest UNIT_TEST = new QuarkusUnitTest().setArchiveProducer(
            () -> ShrinkWrap.create(JavaArchive.class)
                    .addAsResource(new StringAsset("validator.server.host=localhost\n"), "application.properties"));

    @Inject
    Config config;

    @Test
    void validator() {
        assertThrows(ConfigValidationException.class,
                () -> config.unwrap(SmallRyeConfig.class).getConfigMapping(Server.class),
                "validator.server.host must be less than or equal to 3");
    }

    @ConfigMapping(prefix = "validator.server")
    public interface Server {
        @Max(3)
        String host();
    }
}

Rename test configuration property names clashing with maven deploy


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

import com.facebook.swift.codec.AbstractThriftCodecManagerTest;
import com.facebook.swift.codec.ThriftCodecManager;

public class TestCompilerThriftCodecFactory extends AbstractThriftCodecManagerTest
{
    private final ThriftCodecManager manager = new ThriftCodecManager(new CompilerThriftCodecFactory(true));

    @Override
    public ThriftCodecManager createReadCodecManager()
    {
        return manager;
    }

    @Override
    public ThriftCodecManager createWriteCodecManager()
    {
        return manager;
    }
}

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

import com.facebook.swift.codec.AbstractThriftCodecManagerTest;
import com.facebook.swift.codec.ThriftCodecManager;
import org.testng.annotations.Test;

@Test
public class TestCompilerThriftCodecFactory extends AbstractThriftCodecManagerTest
{
    private final ThriftCodecManager manager = new ThriftCodecManager(new CompilerThriftCodecFactory(true));

    @Override
    public ThriftCodecManager createReadCodecManager()
    {
        return manager;
    }

    @Override
    public ThriftCodecManager createWriteCodecManager()
    {
        return manager;
    }
}

Add missing @Test annotation to test class


package com.alexstyl.specialdates.events.namedays.calendar.resource;

import com.alexstyl.specialdates.events.namedays.NamedayLocale;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

class NamedayJSONResourceProvider {

    private final NamedayJSONResourceLoader loader;
    private final JSONArray jsonArray = new JSONArray();

    NamedayJSONResourceProvider(NamedayJSONResourceLoader loader) {
        this.loader = loader;
    }

    NamedayJSON getNamedayJSONFor(NamedayLocale locale) throws JSONException {
        JSONObject json = loader.loadJSON(locale);
        JSONArray data = json.getJSONArray("data");
        JSONArray special = getSpecialOf(json);
        return new NamedayJSON(data, special);
    }

    private JSONArray getSpecialOf(JSONObject json) throws JSONException {
        if (json.has("special")) {
            return json.getJSONArray("special");
        }
        return jsonArray;
    }

}

package com.alexstyl.specialdates.events.namedays.calendar.resource;

import com.alexstyl.specialdates.events.namedays.NamedayLocale;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

class NamedayJSONResourceProvider {

    private static final JSONArray EMPTY = new JSONArray();

    private final NamedayJSONResourceLoader loader;

    NamedayJSONResourceProvider(NamedayJSONResourceLoader loader) {
        this.loader = loader;
    }

    NamedayJSON getNamedayJSONFor(NamedayLocale locale) throws JSONException {
        JSONObject json = loader.loadJSON(locale);
        JSONArray data = json.getJSONArray("data");
        JSONArray special = getSpecialOf(json);
        return new NamedayJSON(data, special);
    }

    private JSONArray getSpecialOf(JSONObject json) throws JSONException {
        if (json.has("special")) {
            return json.getJSONArray("special");
        }
        return EMPTY;
    }

}

Mark empty object as static


package uk.ac.ox.ndm.grails.utils.databinding;

import java.util.Map;

/**
 * @since 19/01/2016
 */
public interface DataBindingSourceCreatorHelper {

    Object checkDataBindingSourceMap(Map<String, ?> dataBindingSourceMap, Class bindingTargetType);
}

package uk.ac.ox.ndm.grails.utils.databinding;

import java.util.List;
import java.util.Map;

/**
 * @since 19/01/2016
 */
public interface DataBindingSourceCreatorHelper {

    Map convertBindingTargetTypeListToMap(List<Object> dataList, Class bindingTargetType);

    Boolean convertsBindingTargetTypeListsToMap(Class bindingTargetType);

    Object handleDataBindingSourceMap(Map<String, ?> dataBindingSourceMap, Class bindingTargetType);

    Boolean handlesBindingTargetTypeMaps(Class bindingTargetType);
}

Add handling methds to the databinder helper interface


/**********************************************************************
Copyright (c) 2005 Erik Bengtson and others.
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.

Contributors:
    ...
**********************************************************************/
package org.jpox.samples.types.color;

/**
 * Object with a Color.
 *
 * @version $Revision: 1.1 $
 */
public class ColorHolder
{
    private java.awt.Color colorA;

    /**
     * @return Returns the colorA.
     */
    public java.awt.Color getColorA()
    {
        return colorA;
    }

    /**
     * @param colorA The colorA to set.
     */
    public void setColorA(java.awt.Color colorA)
    {
        this.colorA = colorA;
    }
}

/**********************************************************************
Copyright (c) 2005 Erik Bengtson and others.
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.

Contributors:
    ...
**********************************************************************/
package org.jpox.samples.types.color;

/**
 * Object with a Color.
 */
public class ColorHolder
{
    long id;
    private java.awt.Color colorA;

    public void setId(long id)
    {
        this.id = id;
    }
    public long getId()
    {
        return id;
    }

    public java.awt.Color getColorA()
    {
        return colorA;
    }
    public void setColorA(java.awt.Color colorA)
    {
        this.colorA = colorA;
    }
}

Add "id" so usable with JPA or JDO application-identity


/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.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.gravitee.gateway.reactor.handler.transaction;

import io.gravitee.gateway.api.Request;
import io.gravitee.gateway.api.handler.Handler;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author David BRASSELY (david.brassely at graviteesource.com)
 * @author GraviteeSource Team
 */
public class TransactionHandlerFactory {

    @Value("${handlers.request.transaction.header:" + TransactionHandler.DEFAULT_TRANSACTIONAL_ID_HEADER + "}")
    private String transactionHeader;

    public Handler<Request> create(Handler<Request> next) {
        return new TransactionHandler(transactionHeader, next);
    }
}

/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.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.gravitee.gateway.reactor.handler.transaction;

import io.gravitee.gateway.api.Request;
import io.gravitee.gateway.api.handler.Handler;
import org.springframework.beans.factory.annotation.Value;

/**
 * @author David BRASSELY (david.brassely at graviteesource.com)
 * @author GraviteeSource Team
 */
public class TransactionHandlerFactory {

    @Value("${handlers.request.transaction.header:" + TransactionHandler.DEFAULT_TRANSACTIONAL_ID_HEADER + "}")
    private String transactionHeader = TransactionHandler.DEFAULT_TRANSACTIONAL_ID_HEADER;

    public Handler<Request> create(Handler<Request> next) {
        return new TransactionHandler(transactionHeader, next);
    }
}

Set default header for transaction handler


//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2013, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.flump;

import tripleplay.anim.Animation;

/** Plays through an entire movie once. */
public class PlayMovie extends Animation
{
    public PlayMovie (Movie movie) {
        _movie = movie;
    }

    @Override protected void init (float time) {
        super.init(time);
        _movie.setPosition(0);
    }

    @Override protected float apply (float time) {
        float elapsed = _movie.speed() * (time - _start);
        _movie.setPosition(elapsed);
        return _movie.symbol().duration - elapsed;
    }

    protected Movie _movie;
}

//
// Triple Play - utilities for use in PlayN-based games
// Copyright (c) 2011-2013, Three Rings Design, Inc. - All rights reserved.
// http://github.com/threerings/tripleplay/blob/master/LICENSE

package tripleplay.flump;

import tripleplay.anim.Animation;

/** Plays a movie until it ends. */
public class PlayMovie extends Animation
{
    public PlayMovie (Movie movie) {
        _movie = movie;
    }

    @Override protected void init (float time) {
        super.init(time);
        _lastTime = time;
    }

    @Override protected float apply (float time) {
        float dt = time - _lastTime;
        _lastTime = time;

        float remaining = _movie.symbol().duration - _movie.position() - dt*_movie.speed();
        if (remaining < 0) {
            dt = (_movie.symbol().duration-_movie.position()) / _movie.speed();
        }
        _movie.paint(dt);
        return remaining;
    }

    protected Movie _movie;
    protected float _lastTime;
}

Use paint() instead of setPosition() here.


package assignment2;

import be.ac.ua.ansymo.adbc.annotations.invariant;

@invariant("$this.sameHeight() == true")
public class PerfectBinTree extends FullBinTree {

	public PerfectBinTree(long id) {
		super(id);
	}

	public boolean sameHeight() {
		int leftHeight = (this.getLeft() != null) ? this.getLeft().height() : 0;
		int rightHeight = (this.getRight() != null) ? this.getRight().height() : 0;

		return leftHeight == rightHeight;
	}

}

package assignment2;

import be.ac.ua.ansymo.adbc.annotations.invariant;

@invariant({"$super", "$this.sameHeight() == true"})
public class PerfectBinTree extends FullBinTree {

	public PerfectBinTree(long id) {
		super(id);
	}

	public boolean sameHeight() {
		int leftHeight = (this.getLeft() != null) ? this.getLeft().height() : 0;
		int rightHeight = (this.getRight() != null) ? this.getRight().height() : 0;

		return leftHeight == rightHeight;
	}

}

Enforce the invariant contraints of the parent.


package com.example.georgekaraolanis.project9_habittracker;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

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

package com.example.georgekaraolanis.project9_habittracker;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.example.georgekaraolanis.project9_habittracker.data.HabitContract;
import com.example.georgekaraolanis.project9_habittracker.data.HabitDbHelper;

public class MainActivity extends AppCompatActivity {

    /*Tag for logging*/
    private static final String LOG_TAG = MainActivity.class.getSimpleName();

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

    /*Insert a habit into the database*/
    private void insertHabit(String name,String time, int category){

        /*Create helper*/
        HabitDbHelper helper = new HabitDbHelper(this);

        /*Get database in write mode*/
        SQLiteDatabase db = helper.getWritableDatabase();

        /*Get ContentValues item*/
        ContentValues values = new ContentValues();

        /*Put in values*/
        values.put(HabitContract.HabitEntry.COLUMN_HABIT_NAME,name);
        values.put(HabitContract.HabitEntry.COLUMN_HABIT_TIME,time);
        values.put(HabitContract.HabitEntry.COLUMN_HABIT_CATEGORY,category);

        /*Insert into database*/
        long newRowId = db.insert(HabitContract.HabitEntry.TABLE_NAME,null,values);

        /*Check result*/
        if (newRowId == -1 ){
            Log.d(LOG_TAG,"Error inserting value into database");
        }
        else{
            Log.d(LOG_TAG,"Value inserted successfully");
        }

    }

}

Add method to insert data into database


public class Widget {
    private String prop;

    public Widget() {
    }

    public void setProp(String prop) throw Exception {
        this.prop = prop;
    }
}

public class Widget {
    private String prop;

    public Widget() {
    }

    public void setProp(String prop) throws Exception {
        this.prop = prop;
    }
}

Fix throws typo in test data class.


package devopsdistilled.operp.client.items.controllers;

import devopsdistilled.operp.client.abstracts.SubTaskPaneController;
import devopsdistilled.operp.server.data.entity.items.Item;

public interface CreateItemPaneController extends SubTaskPaneController {

	void validate(Item item);

}

package devopsdistilled.operp.client.items.controllers;

import devopsdistilled.operp.client.abstracts.SubTaskPaneController;
import devopsdistilled.operp.client.items.exceptions.ItemNameExistsException;
import devopsdistilled.operp.client.items.exceptions.ProductBrandPairExistsException;
import devopsdistilled.operp.server.data.entity.items.Item;

public interface CreateItemPaneController extends SubTaskPaneController {

	void validate(Item item) throws ProductBrandPairExistsException,
			ItemNameExistsException;

}

Append throws clause to validate() declaration


package de.plushnikov.intellij.plugin.inspection;

import com.intellij.codeInspection.InspectionProfileEntry;

public class BuilderInspectionTest extends LombokInspectionTest {

  @Override
  protected String getTestDataPath() {
    return TEST_DATA_INSPECTION_DIRECTORY + "/builder";
  }

  @Override
  protected InspectionProfileEntry getInspection() {
    return new LombokInspection();
  }

  public void testBuilderInvalidIdentifier() throws Exception {
    doTest();
  }

  public void testBuilderRightType() throws Exception {
    doTest();
  }

  public void testBuilderInvalidUse() throws Exception {
    doTest();
  }

  public void testBuilderObtainVia() throws Exception {
    doTest();
  }

  public void testBuilderDefaultsWarnings() throws Exception {
    //TODO implement test after adding support for Builder.Default
    doTest();
  }

  public void testBuilderDefaultValue() throws Exception {
    doTest();
  }
}

package de.plushnikov.intellij.plugin.inspection;

import com.intellij.codeInspection.InspectionProfileEntry;

public class BuilderInspectionTest extends LombokInspectionTest {

  @Override
  protected String getTestDataPath() {
    return TEST_DATA_INSPECTION_DIRECTORY + "/builder";
  }

  @Override
  protected InspectionProfileEntry getInspection() {
    return new LombokInspection();
  }

  public void testBuilderInvalidIdentifier() throws Exception {
    doTest();
  }

  public void testBuilderRightType() throws Exception {
    doTest();
  }

  public void testBuilderInvalidUse() throws Exception {
    doTest();
  }

  public void testBuilderObtainVia() throws Exception {
    doTest();
  }

  public void testBuilderDefaultsWarnings() throws Exception {
    doTest();
  }

  public void testBuilderDefaultValue() throws Exception {
    doTest();
  }
}

Remove todo because it is implemented now


/*
 * 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.teradata.tempto.internal.fulfillment.table.jdbc;

import com.teradata.tempto.query.QueryExecutor;
import org.slf4j.Logger;

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

import static org.slf4j.LoggerFactory.getLogger;

class LoaderFactory
{
    private static final Logger LOGGER = getLogger(LoaderFactory.class);

    Loader create(QueryExecutor queryExecutor, String tableName)
            throws SQLException
    {
        List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " LIMIT 1").getColumnTypes();

        try {
            return new BatchLoader(queryExecutor, tableName, columnTypes.size());
        }
        catch (SQLException sqlException) {
            LOGGER.warn("Unable to insert data with PreparedStatement", sqlException);
            return new InsertLoader(queryExecutor, tableName, columnTypes);
        }
    }
}

/*
 * 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.teradata.tempto.internal.fulfillment.table.jdbc;

import com.teradata.tempto.query.QueryExecutor;
import org.slf4j.Logger;

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

import static org.slf4j.LoggerFactory.getLogger;

class LoaderFactory
{
    private static final Logger LOGGER = getLogger(LoaderFactory.class);

    Loader create(QueryExecutor queryExecutor, String tableName)
            throws SQLException
    {
        List<JDBCType> columnTypes = queryExecutor.executeQuery("SELECT * FROM " + tableName + " WHERE 1=2").getColumnTypes();

        try {
            return new BatchLoader(queryExecutor, tableName, columnTypes.size());
        }
        catch (SQLException sqlException) {
            LOGGER.warn("Unable to insert data with PreparedStatement", sqlException);
            return new InsertLoader(queryExecutor, tableName, columnTypes);
        }
    }
}

Remove LIMIT for Batch Loader


package com.rntestproject;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import com.reactnativenavigation.NavigationApplication;

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

public class MainApplication extends NavigationApplication {

  // private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
  //   @Override
  //   public boolean getUseDeveloperSupport() {
  //     return BuildConfig.DEBUG;
  //   }

  //   @Override
  //   protected List<ReactPackage> getPackages() {
  //     return Arrays.<ReactPackage>asList(
  //         new MainReactPackage()
  //     );
  //   }

  //   @Override
  //   protected String getJSMainModuleName() {
  //     return "src/index.android";
  //   }

  // };

  // @Override
  // public ReactNativeHost getReactNativeHost() {
  //   return mReactNativeHost;
  // }

  // @Override
  // public void onCreate() {
  //   super.onCreate();
  //   SoLoader.init(this, /* native exopackage */ false);
  // }

  @Override
  public String getJSMainModuleName() {
    return "src/index.android";
  }

  @Override
  public boolean isDebug() {
    return BuildConfig.DEBUG;
  }

  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
    return Arrays.<ReactPackage>asList();
  }
}

package com.rntestproject;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import com.reactnativenavigation.NavigationApplication;

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

public class MainApplication extends NavigationApplication {

  @Override
  public String getJSMainModuleName() {
    return "src/index.android";
  }

  @Override
  public boolean isDebug() {
    return BuildConfig.DEBUG;
  }

  @Override
  public List<ReactPackage> createAdditionalReactPackages() {
    return Arrays.<ReactPackage>asList();
  }
}

Delete unused code after adding the react-native-nagivation


package br.com.alura.agenda.tasks;

import android.os.AsyncTask;

import br.com.alura.agenda.converter.AlunoConverter;
import br.com.alura.agenda.modelo.Aluno;
import br.com.alura.agenda.web.WebClient;

public class InsereAlunoTask extends AsyncTask {
    private final Aluno aluno;

    public InsereAlunoTask(Aluno aluno) {
        this.aluno = aluno;
    }

    @Override
    protected Object doInBackground(Object[] objects) {
        new AlunoConverter().converteParaJSONCompleto(aluno);
        //new WebClient().insere(json);
        return null;
    }
}

package br.com.alura.agenda.tasks;

import android.os.AsyncTask;

import br.com.alura.agenda.converter.AlunoConverter;
import br.com.alura.agenda.modelo.Aluno;
import br.com.alura.agenda.web.WebClient;

public class InsereAlunoTask extends AsyncTask {
    private final Aluno aluno;

    public InsereAlunoTask(Aluno aluno) {
        this.aluno = aluno;
    }

    @Override
    protected Object doInBackground(Object[] objects) {
        String json = new AlunoConverter().converteParaJSONCompleto(aluno);
        new WebClient().insere(json);
        return null;
    }
}

Add call to WebClient on insert student AsyncTask