package com.topsy.jmxproxy.jmx.tests;

import com.topsy.jmxproxy.jmx.ConnectionCredentials;
import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

public class ConnectionCredentialsTest {
    @Test
    public void compareEquals() throws Exception {
        final ConnectionCredentials auth1 = new ConnectionCredentials("user", "pass");
        final ConnectionCredentials auth2 = new ConnectionCredentials("user", "pass");

        assertTrue(auth1.equals(auth2));
    }

    @Test
    public void compareNotEquals() throws Exception {
        final ConnectionCredentials auth1 = new ConnectionCredentials("user", "pass");
        final ConnectionCredentials auth2 = new ConnectionCredentials("pass", "user");

        assertFalse(auth1.equals(auth2));
    }

    @Test
    public void compareNotEqualsNull() throws Exception {
        final ConnectionCredentials auth1 = new ConnectionCredentials("user", "pass");

        assertFalse(auth1.equals(null));
    }
}

package com.topsy.jmxproxy.jmx.tests;

import com.topsy.jmxproxy.jmx.ConnectionCredentials;
import org.junit.Test;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;

public class ConnectionCredentialsTest {
    @Test
    public void compareEquals() throws Exception {
        final ConnectionCredentials auth1 = new ConnectionCredentials(new String("user"), new String("pass"));
        final ConnectionCredentials auth2 = new ConnectionCredentials(new String("user"), new String("pass"));

        assertTrue(auth1.equals(auth2));
    }

    @Test
    public void compareNotEquals() throws Exception {
        final ConnectionCredentials auth1 = new ConnectionCredentials(new String("user"), new String("pass"));
        final ConnectionCredentials auth2 = new ConnectionCredentials(new String("pass"), new String("user"));

        assertFalse(auth1.equals(auth2));
    }

    @Test
    public void compareNotEqualsNull() throws Exception {
        final ConnectionCredentials auth = new ConnectionCredentials(new String("user"), new String("pass"));

        assertFalse(auth.equals(null));
    }
}

Make the test a bit less idiotic.

Make the test a bit less idiotic.


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

import io.gravitee.repository.model.Api;

import java.util.Optional;
import java.util.Set;

/**
 * @author David BRASSELY (brasseld at gmail.com)
 */
public interface ApiRepository {

    Optional<Api> findByName(String apiName);

    Set<Api> findAll();

    Set<Api> findByTeam(String teamName);

    Api create(Api api);

    Api update(Api api);

    void delete(String apiName);

    int countByUser(String username);

    int countByTeam(String teamName);
}

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

import io.gravitee.repository.model.Api;

import java.util.Optional;
import java.util.Set;

/**
 * @author David BRASSELY (brasseld at gmail.com)
 */
public interface ApiRepository {

    Optional<Api> findByName(String apiName);

    Set<Api> findAll();

    Set<Api> findByTeam(String teamName);

    Set<Api> findByUser(String username);

    Api create(Api api);

    Api update(Api api);

    void delete(String apiName);

    int countByUser(String username);

    int countByTeam(String teamName);
}

Add service to retrieve list of APIs by user


package sizebay.catalog.client.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserProfile implements Serializable {

    String id;
    String email;
    String facebook;
    String password;

    List<UserProfileIdentification> profiles;

    public static UserProfile empty() {

        UserProfile user = new UserProfile();
        List<UserProfileIdentification> profile = new ArrayList<>();

        profile.add(UserProfileIdentification.empty());

        user.setProfiles(profile);

        return user;

    }

}

package sizebay.catalog.client.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Accessors(chain = true)
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserProfile implements Serializable {

    String id;
    String email;
    String facebook;
    String password;

    List<UserProfileIdentification> profiles;

    public static UserProfile empty(String id) {

        List<UserProfileIdentification> profile = new ArrayList<>();
        profile.add(UserProfileIdentification.empty());

        UserProfile user = new UserProfile().setId(id).setProfiles(profile);

        return user;

    }

}

Refactor and change signature of the method that returns an empty profile


package com.adleritech.flexibee.core.api;

import com.adleritech.flexibee.core.api.domain.WinstromRequest;
import com.adleritech.flexibee.core.api.domain.WinstromResponse;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.PUT;
import retrofit2.http.Path;

import java.io.IOException;

public class FlexibeeClient {

    private static final String API_BASE_URL = "https://demo.flexibee.eu:5434";
    private final String company;
    private final Api client;

    public FlexibeeClient(String username, String password, String company) {
        this.company = company;
        client = RetrofitClientFactory.createService(Api.class, API_BASE_URL, username, password);
    }

    public WinstromResponse createInvoice(WinstromRequest winstromRequest) throws IOException {
        Response<WinstromResponse> response = client.issueInvoice(company, winstromRequest).execute();
        return response.body();
    }

    interface Api {
        @PUT("/c/{company}/faktura-vydana.xml")
        Call<WinstromResponse> issueInvoice(@Path("company") String company, @Body WinstromRequest request);
    }

}

package com.adleritech.flexibee.core.api;

import com.adleritech.flexibee.core.api.domain.WinstromRequest;
import com.adleritech.flexibee.core.api.domain.WinstromResponse;
import retrofit2.Call;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.PUT;
import retrofit2.http.Path;

import java.io.IOException;

public class FlexibeeClient {

    private static final String API_BASE_URL = "https://demo.flexibee.eu:5434";
    private final String company;
    private final Api client;

    public FlexibeeClient(String username, String password, String company) {
        this.company = company;
        client = RetrofitClientFactory.createService(Api.class, API_BASE_URL, username, password);
    }

    public FlexibeeClient(String username, String password, String company, String apiBaseUrl) {
        this.company = company;
        client = RetrofitClientFactory.createService(Api.class, apiBaseUrl, username, password);
    }

    public WinstromResponse createInvoice(WinstromRequest winstromRequest) throws IOException {
        Response<WinstromResponse> response = client.issueInvoice(company, winstromRequest).execute();
        return response.body();
    }

    interface Api {
        @PUT("/c/{company}/faktura-vydana.xml")
        Call<WinstromResponse> issueInvoice(@Path("company") String company, @Body WinstromRequest request);
    }

}

Allow to change flexibee url

Allow to change flexibee url


package org.apache.jackrabbit.oak.jcr.state;

import org.apache.jackrabbit.oak.jcr.json.JsonValue;
import org.apache.jackrabbit.oak.model.AbstractPropertyState;

public class PropertyStateImpl extends AbstractPropertyState {
private final String name;
private final JsonValue value;

public PropertyStateImpl(String name, JsonValue value) {
    this.name = name;
    this.value = value;
}

    public JsonValue getValue() {
        return value;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getEncodedValue() {
        return value.toJson();
    }

    @Override
    public String toString() {
        return name + ':' + getEncodedValue();
    }
}

Clean up oak-jcr - formatting

 OAK-15: Clean up oak-jcr
 - formatting

git-svn-id: 67138be12999c61558c3dd34328380c8e4523e73@1301494 13f79535-47bb-0310-9956-ffa450edef68


/*
 * Copyright 2011-2013 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.hibernate.cache.redis.serializer;

import java.nio.charset.Charset;

/**
 * Serializer for Redis Key or Value
 *
 * @author sunghyouk.bae@gmail.com
 * @since 13. 4. 9 오후 10:20
 */
public interface RedisSerializer<T> {

    public byte[] EMPTY_BYTES = new byte[0];

    public Charset UTF_8 = Charset.forName("UTF-8");

    /**
     * Serialize Object
     */
    byte[] serialize(final T graph);

    /**
     * Deserialize to object
     */
    T deserialize(final byte[] bytes);
}

/*
 * Copyright 2011-2013 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.hibernate.cache.redis.serializer;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * Serializer for Redis Key or Value
 *
 * @author sunghyouk.bae@gmail.com
 * @since 13. 4. 9 오후 10:20
 */
public interface RedisSerializer<T> {

    public byte[] EMPTY_BYTES = new byte[0];

    public Charset UTF_8 = StandardCharsets.UTF_8;

    /**
     * Serialize Object
     */
    byte[] serialize(final T graph);

    /**
     * Deserialize to object
     */
    T deserialize(final byte[] bytes);
}

Revert "StandardCharsets을 jdk6에서 지원하지 않아 Charset.forName으로 변경"

This reverts commit 71e974059d5e60fddd2dd412cabc3790242fb50e.


package com.googlecode.jslint4java.maven;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import java.io.File;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.googlecode.jslint4java.formatter.JSLintResultFormatter;
import com.googlecode.jslint4java.formatter.JSLintXmlFormatter;

public class ReportWriterTest {

    @Rule
    public TemporaryFolder tmpf = new TemporaryFolder();

    private final JSLintResultFormatter formatter = new JSLintXmlFormatter();

    private ReportWriter createReportWriter(String filename) {
        return new ReportWriter(new File(tmpf.getRoot(), filename), formatter);
    }

    @Test
    public void createsNonEmptyFile() {
        ReportWriter rw = createReportWriter("report.xml");
        rw.open();
        rw.close();
        assertThat(rw.getReportFile().exists(), is(true));
        assertThat(rw.getReportFile().length(), is(not(0L)));
    }
}

package com.googlecode.jslint4java.maven;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import java.io.File;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

import com.googlecode.jslint4java.formatter.JSLintResultFormatter;
import com.googlecode.jslint4java.formatter.JSLintXmlFormatter;

public class ReportWriterTest {

    @Rule
    public TemporaryFolder tmpf = new TemporaryFolder();

    private final JSLintResultFormatter formatter = new JSLintXmlFormatter();

    private ReportWriter createReportWriter(String filename) {
        return new ReportWriter(new File(tmpf.getRoot(), filename), formatter);
    }

    @Test
    public void createsNonEmptyFile() {
        ReportWriter rw = createReportWriter("report.xml");
        rw.open();
        rw.close();
        assertThat(rw.getReportFile().exists(), is(true));
        assertThat(rw.getReportFile().length(), is(not(0L)));
    }

    @Test
    public void makesParentDirectory() {
        File parent = new File(tmpf.getRoot(), "somedir");
        ReportWriter rw = new ReportWriter(new File(parent, "report.xml"), formatter);
        rw.open();
        rw.close();
        assertThat(parent.exists(), is(true));
    }
}

Check ReportWriter makes parent directories.


package mib.microservice.commons.persistence;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * Created by matthias.popp on 18.07.2014.
 * <p/>
 * Class containing needed perisistence helper methods. This class also creates and manages the entity manager instance.
 */
public class PersistenceUtils {

    private static EntityManagerFactory emf;
    /**
     * No instances should be created.
     */
    private PersistenceUtils(){}

    /**
     * Initialization of the entity manager. This is an EXPENSIVE operation. Only call that once on application level
     * when starting up the application.
     */
    public static void initialize(String persistenceUnitName) {
        emf = Persistence.createEntityManagerFactory(persistenceUnitName);
    }

    public static EntityManager openEm() {
        return emf.createEntityManager();
    }

    public static void closeEm(EntityManager em) {em.close();}

    public static void startTransaction(EntityManager em){
        em.getTransaction().begin();
    }

    public static void commitTransaction(EntityManager em){
        em.getTransaction().commit();
    }

    public static boolean isTransactionActive(EntityManager em){
        return em.getTransaction().isActive();
    }
}

package mib.microservice.commons.persistence;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * Created by matthias.popp on 18.07.2014.
 * <p/>
 * Class containing needed perisistence helper methods. This class also creates and manages the entity manager instance.
 */
public class PersistenceUtils {

    private static EntityManagerFactory emf;
    /**
     * No instances should be created.
     */
    private PersistenceUtils(){}

    /**
     * Initialization of the entity manager. This is an EXPENSIVE operation. Only call that once on application level
     * when starting up the application.
     */
    public static void initialize(String persistenceUnitName) {
        emf = Persistence.createEntityManagerFactory(persistenceUnitName);
    }

    public static EntityManager openEm() {
        return emf.createEntityManager();
    }

    public static void closeEm(EntityManager em) {em.close();}

    public static void startTransaction(EntityManager em){
        em.getTransaction().begin();
    }

    public static void commitTransaction(EntityManager em){
        em.getTransaction().commit();
    }

    public static boolean isTransactionActive(EntityManager em){
        return em.getTransaction().isActive();
    }

	public static void rollbackTransaction(EntityManager em) {
		em.getTransaction().rollback();
	}
}

Allow transactions to be rollbacked

Allow transactions to be rollbacked


// 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.devtools.build.lib.profiler;

import static com.google.common.truth.Truth.assertThat;

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

/** Tests for {@link SingleStatRecorder}. */
@RunWith(JUnit4.class)
public class SingleStatRecorderTest {

  @Test
  public void meanAndstandardDeviation() {
    SingleStatRecorder recorder = new SingleStatRecorder(null, 2);
    recorder.addStat(43, null);
    recorder.addStat(49, null);
    recorder.addStat(51, null);
    recorder.addStat(57, null);
    MetricData metrics = recorder.snapshot();
    assertThat(metrics.getAvg()).isWithin(.01).of(50);
    assertThat(metrics.getStdDev()).isWithin(.01).of(5);
  }
}

// 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.devtools.build.lib.profiler;

import static com.google.common.truth.Truth.assertThat;

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

/** Tests for {@link SingleStatRecorder}. */
@RunWith(JUnit4.class)
public class SingleStatRecorderTest {

  @Test
  public void meanAndStandardDeviation() {
    SingleStatRecorder recorder = new SingleStatRecorder(null, 2);
    recorder.addStat(43, null);
    recorder.addStat(49, null);
    recorder.addStat(51, null);
    recorder.addStat(57, null);
    MetricData metrics = recorder.snapshot();
    assertThat(metrics.getAvg()).isWithin(.01).of(50);
    assertThat(metrics.getStdDev()).isWithin(.01).of(5);
  }
}

Fix camelCasing the method name.

Fix camelCasing the method name.

RELNOTES: None
PiperOrigin-RevId: 310508754


package miwax.java_conf.gr.jp.frugalitycalc.model;

import java.math.BigDecimal;

public enum Operation {
    PLUS     { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.add(y);} },
    MINUS    { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.subtract(y);} },
    MULTIPLE { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.multiply(y);} },
    DIVIDE   { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.divide(y, 8, BigDecimal.ROUND_HALF_UP);} };

    abstract BigDecimal apply(BigDecimal x, BigDecimal y);
}

package miwax.java_conf.gr.jp.frugalitycalc.model;

import java.math.BigDecimal;
import java.math.MathContext;

public enum Operation {
    PLUS     { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.add(y);} },
    MINUS    { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.subtract(y);} },
    MULTIPLE { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.multiply(y);} },
    DIVIDE   { BigDecimal apply(BigDecimal x, BigDecimal y) {return x.divide(y, MathContext.DECIMAL128);} };

    abstract BigDecimal apply(BigDecimal x, BigDecimal y);
}

Change the accuracy of the division to the IEEE 754R Decimal28


package org.zaproxy.zap.extension.websocket.ui.httppanel.views.large;

import org.zaproxy.zap.extension.httppanel.Message;
import org.zaproxy.zap.extension.httppanel.view.largeresponse.LargeResponseUtil;
import org.zaproxy.zap.extension.websocket.WebSocketMessageDTO;

public class WebSocketLargePayloadUtil extends LargeResponseUtil {

	public static boolean isLargePayload(Message aMessage) {
		if (aMessage instanceof WebSocketMessageDTO) {
			WebSocketMessageDTO message = (WebSocketMessageDTO) aMessage;
			if (message.payloadLength == null) {
				return false;
			}
			return message.payloadLength > minContentLength;
		}

		return false;
	}
}

package org.zaproxy.zap.extension.websocket.ui.httppanel.views.large;

import org.zaproxy.zap.extension.httppanel.Message;
import org.zaproxy.zap.extension.httppanel.view.largeresponse.LargeResponseUtil;
import org.zaproxy.zap.extension.websocket.WebSocketMessageDTO;

public class WebSocketLargePayloadUtil extends LargeResponseUtil {

	public static boolean isLargePayload(Message aMessage) {
		if (aMessage instanceof WebSocketMessageDTO) {
			WebSocketMessageDTO message = (WebSocketMessageDTO) aMessage;
			if (message.payloadLength == null || minContentLength == -1) {
				return false;
			}
			return message.payloadLength > minContentLength;
		}

		return false;
	}
}

Handle 'unlimited' large payload size

Handle 'unlimited' large payload size


package sizebay.catalog.client.model;

import lombok.*;

@Getter
@Setter
@EqualsAndHashCode
@ToString
public class ModelingSizeMeasures   {

  String sizeName = null;
  ModelingMeasureRange chest = null;
  ModelingMeasureRange hip = null;
  ModelingMeasureRange waist = null;
  ModelingMeasureRange sleeve = null;
  ModelingMeasureRange length = null;
  ModelingMeasureRange insideLeg = null;
  ModelingMeasureRange biceps = null;
  ModelingMeasureRange height = null;
  ModelingMeasureRange fist = null;
  ModelingMeasureRange neck = null;
  ModelingMeasureRange thigh = null;
  ModelingMeasureRange centralSeam = null;
  ModelingMeasureRange underBust = null;
  ModelingMeasureRange shoulderWidth = null;
  ModelingMeasureRange insoleLength = null;
  ModelingMeasureRange insoleWidth = null;
  ModelingMeasureRange waistUpper = null;
  ModelingMeasureRange waistLower = null;

  ModelingMeasureRange label1 = null;
  ModelingMeasureRange label2 = null;
  ModelingMeasureRange label3 = null;

  ModelingMeasureRange ageChart = null;
  ModelingMeasureRange weightChart = null;

}

package sizebay.catalog.client.model;

import lombok.*;

@Getter
@Setter
@EqualsAndHashCode
@ToString
public class ModelingSizeMeasures   {

  String sizeName = null;
  ModelingMeasureRange chest = null;
  ModelingMeasureRange hip = null;
  ModelingMeasureRange waist = null;
  ModelingMeasureRange sleeve = null;
  ModelingMeasureRange length = null;
  ModelingMeasureRange insideLeg = null;
  ModelingMeasureRange biceps = null;
  ModelingMeasureRange height = null;
  ModelingMeasureRange fist = null;
  ModelingMeasureRange neck = null;
  ModelingMeasureRange thigh = null;
  ModelingMeasureRange centralSeam = null;
  ModelingMeasureRange underBust = null;
  ModelingMeasureRange shoulderWidth = null;
  ModelingMeasureRange insoleLength = null;
  ModelingMeasureRange insoleWidth = null;
  ModelingMeasureRange waistUpper = null;
  ModelingMeasureRange waistLower = null;

  ModelingMeasureRange label1 = null;
  ModelingMeasureRange label2 = null;
  ModelingMeasureRange label3 = null;

  ModelingMeasureRange ageChart = null;
  ModelingMeasureRange weightChart = null;
  ModelingMeasureRange equivalence = null;

}

Fix: Add new measures for shoe -> equivalence


package com.creatubbles.api.model.partner_application;

import android.support.annotation.NonNull;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author Pawel Szymanski
 */
public enum VideoProvider {
    NONE(""),
    YOUTUBE("youtube"),
    VIMEO("vimeo");

    private String name;

    @JsonCreator
    VideoProvider(String name) {
        this.name = name;
    }

    @JsonValue
    @NonNull
    public String getName() {
        return name;
    }
}

package com.creatubbles.api.model.partner_application;

import android.support.annotation.NonNull;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @author Pawel Szymanski
 */
public enum VideoProvider {
    NONE(""),
    YOUTUBE("youtube"),
    VIMEO("vimeo"),
    DIRECT("ctbs3");

    private String name;

    VideoProvider(String name) {
        this.name = name;
    }

    @JsonCreator
    public static VideoProvider fromName(String name) {
        for (VideoProvider videoProvider : values()) {
            if (videoProvider.name.equals(name)) {
                return videoProvider;
            }
        }
        return NONE;
    }

    @JsonValue
    @NonNull
    public String getName() {
        return name;
    }
}

Add new partner video provider type

[165] Add new partner video provider type


package io.appium.android.bootstrap.handler;

import io.appium.android.bootstrap.AndroidCommand;
import io.appium.android.bootstrap.AndroidCommandResult;
import io.appium.android.bootstrap.CommandHandler;

import java.util.Hashtable;

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

import com.android.uiautomator.core.UiDevice;

/**
 * This handler is used to PressKeyCode.
 *
 */
public class PressKeyCode extends CommandHandler {
  public Integer keyCode;
  public Integer metaState;

  /*
   * @param command The {@link AndroidCommand} used for this handler.
   *
   * @return {@link AndroidCommandResult}
   *
   * @throws JSONException
   *
   * @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android.
   * bootstrap.AndroidCommand)
   */
  @Override
  public AndroidCommandResult execute(final AndroidCommand command)
      throws JSONException {
    try {
      final Hashtable<String, Object> params = command.params();
      keyCode = (Integer) params.get("keycode");

      if (params.get("metastate") != JSONObject.NULL) {
        metaState = (Integer) params.get("metastate");
      }

      UiDevice.getInstance().pressKeyCode(keyCode, metaState);

      return getSuccessResult(true);
    } catch (final Exception e) {
      return getErrorResult(e.getMessage());
    }
  }
}

package io.appium.android.bootstrap.handler;

import io.appium.android.bootstrap.AndroidCommand;
import io.appium.android.bootstrap.AndroidCommandResult;
import io.appium.android.bootstrap.CommandHandler;

import java.util.Hashtable;

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

import com.android.uiautomator.core.UiDevice;

/**
 * This handler is used to PressKeyCode.
 *
 */
public class PressKeyCode extends CommandHandler {
  public Integer keyCode;
  public Integer metaState;

  /*
   * @param command The {@link AndroidCommand} used for this handler.
   *
   * @return {@link AndroidCommandResult}
   *
   * @throws JSONException
   *
   * @see io.appium.android.bootstrap.CommandHandler#execute(io.appium.android.
   * bootstrap.AndroidCommand)
   */
  @Override
  public AndroidCommandResult execute(final AndroidCommand command)
      throws JSONException {
    try {
      final Hashtable<String, Object> params = command.params();
      keyCode = (Integer) params.get("keycode");

      if (params.get("metastate") != JSONObject.NULL) {
        metaState = (Integer) params.get("metastate");
        UiDevice.getInstance().pressKeyCode(keyCode, metaState);
      } else {
        UiDevice.getInstance().pressKeyCode(keyCode);
      }

      return getSuccessResult(true);
    } catch (final Exception e) {
      return getErrorResult(e.getMessage());
    }
  }
}

Make sure 'keyevent' works if metastate is null.


package org.cyclops.integrateddynamics.core.logicprogrammer;

import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement;
import org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElementTypeRegistry;

/**
 * All types of logic programmer element types.
 * @author rubensworks
 */
public class LogicProgrammerElementTypes {

    public static final ILogicProgrammerElementTypeRegistry REGISTRY = IntegratedDynamics._instance.getRegistryManager().getRegistry(ILogicProgrammerElementTypeRegistry.class);

    public static void load() {}

    public static final OperatorLPElementType OPERATOR  = REGISTRY.addType(new OperatorLPElementType());
    public static final ValueTypeLPElementType VALUETYPE = REGISTRY.addType(new ValueTypeLPElementType());

    public static boolean areEqual(ILogicProgrammerElement e1, ILogicProgrammerElement e2) {
        if(e1 == null) {
            return e2 == null;
        }
        if(e2 == null) {
            return false;
        }
        return e1.getType().getName().equals(e2.getType().getName()) && e1.getType().getName(e1).equals(e2.getType().getName(e2));
    }

}

package org.cyclops.integrateddynamics.core.logicprogrammer;

import org.cyclops.integrateddynamics.IntegratedDynamics;
import org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElement;
import org.cyclops.integrateddynamics.api.logicprogrammer.ILogicProgrammerElementTypeRegistry;

/**
 * All types of logic programmer element types.
 * @author rubensworks
 */
public class LogicProgrammerElementTypes {

    public static final ILogicProgrammerElementTypeRegistry REGISTRY = IntegratedDynamics._instance.getRegistryManager().getRegistry(ILogicProgrammerElementTypeRegistry.class);

    public static void load() {}

    public static final ValueTypeLPElementType VALUETYPE = REGISTRY.addType(new ValueTypeLPElementType());
    public static final OperatorLPElementType OPERATOR  = REGISTRY.addType(new OperatorLPElementType());

    public static boolean areEqual(ILogicProgrammerElement e1, ILogicProgrammerElement e2) {
        if(e1 == null) {
            return e2 == null;
        }
        if(e2 == null) {
            return false;
        }
        return e1.getType().getName().equals(e2.getType().getName()) && e1.getType().getName(e1).equals(e2.getType().getName(e2));
    }

}

Move value types before operators in logic programmer


/**
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.livedata.resolver;

import java.util.Collection;
import java.util.Map;

import com.opengamma.livedata.LiveDataSpecification;
import com.opengamma.livedata.server.DistributionSpecification;

/**
 * Determines how market data should be distributed to clients.
 */
public interface DistributionSpecificationResolver extends Resolver<LiveDataSpecification, DistributionSpecification> {

  /**
   * Determines how market data should be distributed to clients.
   *
   * @param liveDataSpecificationFromClient what the client wants. Different specs from the client can map to the same distribution spec.
   * @return a valid distribution specification. Null if the distribution spec cannot be built.
   */
  DistributionSpecification resolve(LiveDataSpecification liveDataSpecificationFromClient);

  /**
   * Same as calling {@link #resolve(LiveDataSpecification)}
   * individually, but since it works in bulk, may be more efficient.
   *
   * @param liveDataSpecifications what the client wants. Different specs from the client can map to the same distribution spec.
   * @return map from request to result.
   * For each input spec, there must be an entry in the map.
   * @throws IllegalArgumentException if the distribution spec cannot be built.
   */
  Map<LiveDataSpecification, DistributionSpecification> resolve(Collection<LiveDataSpecification> liveDataSpecifications);

}

/**
 * Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.livedata.resolver;

import java.util.Collection;
import java.util.Map;

import com.opengamma.livedata.LiveDataSpecification;
import com.opengamma.livedata.server.DistributionSpecification;

/**
 * Determines how market data should be distributed to clients.
 */
public interface DistributionSpecificationResolver extends Resolver<LiveDataSpecification, DistributionSpecification> {

  /**
   * Determines how market data should be distributed to clients.
   *
   * @param liveDataSpecificationFromClient what the client wants. Different specs from the client can map to the same distribution spec.
   * @return a valid distribution specification. Null if the distribution spec cannot be built.
   */
  DistributionSpecification resolve(LiveDataSpecification liveDataSpecificationFromClient);

  /**
   * Same as calling {@link #resolve(LiveDataSpecification)}
   * individually, but since it works in bulk, may be more efficient.
   *
   * @param liveDataSpecifications what the client wants. Different specs from the client can map to the same distribution spec.
   * @return map from request to result.
   * For each input spec, there must be an entry in the map.
   * The value will be null if the distribution spec cannot be build for that spec
   */
  Map<LiveDataSpecification, DistributionSpecification> resolve(Collection<LiveDataSpecification> liveDataSpecifications);

}

Comment the semantics of the spec resolver to match the (more useful) semantics of the implementations


package es.tid.bdp.platform.cluster.server;

/**
 *
 * @author dmicol
 */
public class ClusterServerMain {
    public static void main(String[] args) {
        try {
            ClusterServer server = new ClusterServer();
            server.start();
        } catch (Exception ex) {
            System.exit(1);
        }
    }

    private ClusterServerMain() {
    }
}

package es.tid.bdp.platform.cluster.server;

import org.apache.log4j.Logger;

/**
 *
 * @author dmicol
 */
public class ClusterServerMain {
    private static final Logger LOG = Logger.getLogger(ClusterServer.class);

    public static void main(String[] args) {
        try {
            ClusterServer server = new ClusterServer();
            server.start();
        } catch (Exception ex) {
            LOG.fatal(ex.getMessage());
            System.exit(1);
        }
    }

    private ClusterServerMain() {
    }
}

Add logging to the main file.

Add logging to the main file.


package com.uwetrottmann.getglue.services;

import com.uwetrottmann.getglue.BaseTestCase;
import com.uwetrottmann.getglue.entities.GetGlueInteraction;
import com.uwetrottmann.getglue.entities.GetGlueInteractionResource;

import java.util.List;

import static org.fest.assertions.api.Assertions.assertThat;

public class InteractionServiceTest extends BaseTestCase {

    public static final String SAMPLE_INTERACTION = "getgluejava/2013-10-24T18:30:38Z";

    public void test_get() {
        InteractionService service = getManager().interactionService();
        GetGlueInteractionResource resource = service.get(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
        assertThat(resource.interaction).isNotNull();
        assertThat(resource.interaction._object).isNotNull();
        assertThat(resource.interaction._object.id).isEqualTo("tv_shows/how_i_met_your_mother");
        assertThat(resource.interaction._object.title).isEqualTo("How I Met Your Mother");
        assertThat(resource.interaction.comment).isEqualTo("Testing getglue-java.");
    }

    public void test_votes() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.votes(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

    public void test_replies() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.replies(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

}

package com.uwetrottmann.getglue.services;

import com.uwetrottmann.getglue.BaseTestCase;
import com.uwetrottmann.getglue.entities.GetGlueInteraction;
import com.uwetrottmann.getglue.entities.GetGlueInteractionResource;

import java.util.List;

import static org.fest.assertions.api.Assertions.assertThat;

public class InteractionServiceTest extends BaseTestCase {

    public static final String SAMPLE_INTERACTION = "getgluejava/2014-04-22T17:08:08Z";

    public void test_get() {
        InteractionService service = getManager().interactionService();
        GetGlueInteractionResource resource = service.get(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
        assertThat(resource.interaction).isNotNull();
        assertThat(resource.interaction._object).isNotNull();
        assertThat(resource.interaction._object.id).isEqualTo("tv_shows/how_i_met_your_mother");
        assertThat(resource.interaction._object.title).isEqualTo("How I Met Your Mother");
        assertThat(resource.interaction.comment).isEqualTo("Testing getglue-java.");
    }

    public void test_votes() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.votes(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

    public void test_replies() {
        InteractionService service = getManager().interactionService();
        List<GetGlueInteraction> resource = service.replies(SAMPLE_INTERACTION);
        assertThat(resource).isNotNull();
    }

}

Fix interaction test: use newer interaction.

- Does tvtag remove older interactions?


package totemic_commons.pokefenn.misc;

import java.util.List;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import totemic_commons.pokefenn.ModBlocks;
import totemic_commons.pokefenn.lib.Strings;

public class CreativeTabTotemic extends CreativeTabs
{
    public CreativeTabTotemic(int id, String name)
    {
        super(id, name);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public Item getTabIconItem()
    {
        return Item.getItemFromBlock(ModBlocks.tipi);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void displayAllReleventItems(List<ItemStack> list)
    {
        super.displayAllReleventItems(list);

        ItemStack stack = new ItemStack(Items.spawn_egg);
        NBTTagCompound eggTag = new NBTTagCompound();
        eggTag.setString("entity_name", "totemic." + Strings.BUFFALO_NAME);
        stack.setTagCompound(eggTag);
        list.add(stack);
    }
}

package totemic_commons.pokefenn.misc;

import java.util.List;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import totemic_commons.pokefenn.ModBlocks;
import totemic_commons.pokefenn.lib.Strings;

public class CreativeTabTotemic extends CreativeTabs
{
    public CreativeTabTotemic(int id, String name)
    {
        super(id, name);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public Item getTabIconItem()
    {
        return Item.getItemFromBlock(ModBlocks.tipi);
    }

    @SideOnly(Side.CLIENT)
    @Override
    public void displayAllReleventItems(List<ItemStack> list)
    {
        super.displayAllReleventItems(list);

        list.add(getEgg("totemic." + Strings.BUFFALO_NAME));
        list.add(getEgg("totemic." + Strings.BAYKOK_NAME));
    }

    public static ItemStack getEgg(String entityName)
    {
        ItemStack stack = new ItemStack(Items.spawn_egg);
        NBTTagCompound eggTag = new NBTTagCompound();
        eggTag.setString("entity_name", entityName);
        stack.setTagCompound(eggTag);
        return stack;
    }
}

Add Baykok spawn egg to creative tab

Add Baykok spawn egg to creative tab


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

/**
 */
public class IllegalUserActionException extends Exception {
    private static final long serialVersionUID = 240L;

    /**
     * @deprecated - use IllegalUserActionException(String)
     */
    @Deprecated // Needed for serialisation testing
    public IllegalUserActionException() {
        super();
    }

    public IllegalUserActionException(String name) {
        super(name);
    }
}

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

/**
 */
public class IllegalUserActionException extends Exception {
    private static final long serialVersionUID = 240L;

    /**
     * @deprecated - use IllegalUserActionException(String)
     */
    @Deprecated // Needed for serialisation testing
    public IllegalUserActionException() {
        super();
    }

    public IllegalUserActionException(String name) {
        super(name);
    }

    public IllegalUserActionException(String name, Throwable t) {
        super(name, t);
    }

}

Allow original exception to be provided if necessary

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1329661 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 91e8c0fd7a04cfa172a34abfb5d0296d040843c0


package de.unibonn.iai.eis.diachron.qualitymetrics.utilities;

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

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.sparql.core.Quad;

public class TestLoader {

	protected List<Quad> streamingQuads = new ArrayList<Quad>();
	protected Model m;

	/**
	 * Loads a sample dataset which can be used to test metrics
	 */
	public void loadDataSet() {

		String filename = this.getClass().getClassLoader().getResource("testdumps/160114.ttl").toExternalForm();
		//String filename = this.getClass().getClassLoader().getResource("testdumps/chembl-rdf-void.ttl").toExternalForm();

		m = ModelFactory.createDefaultModel();
		m.read(filename, "TTL");

		StmtIterator si = m.listStatements();
		while(si.hasNext()){
			this.streamingQuads.add(new Quad(null, si.next().asTriple()));
		}
	}

	public Model getM() {
		return m;
	}

	/**
	 * Returns a list of triples from the loaded dataset. This can be used
	 * to simulate the streaming of triples
	 * @return list of Triples
	 */
	public List<Quad> getStreamingQuads(){
		return this.streamingQuads;
	}
}

package de.unibonn.iai.eis.diachron.qualitymetrics.utilities;

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

import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.rdf.model.StmtIterator;
import com.hp.hpl.jena.sparql.core.Quad;

public class TestLoader {

	protected List<Quad> streamingQuads = new ArrayList<Quad>();

	/**
	 * Loads a sample dataset which can be used to test metrics
	 */
	public void loadDataSet() {

		String filename = this.getClass().getClassLoader().getResource("testdumps/160114.ttl").toExternalForm();
		//String filename = this.getClass().getClassLoader().getResource("testdumps/chembl-rdf-void.ttl").toExternalForm();

		Model m = ModelFactory.createDefaultModel();
		m.read(filename, "TTL");

		StmtIterator si = m.listStatements();
		while(si.hasNext()){
			this.streamingQuads.add(new Quad(null, si.next().asTriple()));
		}
	}

	/**
	 * Returns a list of triples from the loaded dataset. This can be used
	 * to simulate the streaming of triples
	 * @return list of Triples
	 */
	public List<Quad> getStreamingQuads(){
		return this.streamingQuads;
	}
}

Revert "Changed Model Variable m to protected. Used corresponding getters. changes made because dataset needed for calculating amount of triples."

This reverts commit f474d987593f1088e3571b18339682a8ff8c7d79.


package uk.ac.ebi.quickgo.annotation.validation.loader;

/**
 * @author Tony Wardell
 * Date: 07/11/2016
 * Time: 18:16
 * Created with IntelliJ IDEA.
 *
 * Specify the layout of the DB_XREFS_ENTITIES.dat.gz file.
 * DATABASE        ENTITY_TYPE_ID  ENTITY_TYPE_NAME        LOCAL_ID_SYNTAX URL_SYNTAX
 *
 */
public enum DBXrefEntityColumns {

    COLUMN_DB(0),
    COLUMN_ENTITY_TYPE_ID(1),
    COLUMN_ENTITY_TYPE_NAME(2),
    COLUMN_LOCAL_ID_SYNTAX(3),
    COLUMN_URL_SYNTAX(4);

    private int position;

    DBXrefEntityColumns(int position) {
        this.position = position;
    }

    public int getPosition() {
        return position;
    }

    public static int numColumns() {
        return DBXrefEntityColumns.values().length;
    }

}

package uk.ac.ebi.quickgo.annotation.validation.loader;

/**
 * Specify the columns for Database Cross Reference file.
 *
 * @author Tony Wardell
 * Date: 07/11/2016
 * Time: 18:16
 * Created with IntelliJ IDEA.
 *
 * Specify the layout of the DB_XREFS_ENTITIES.dat.gz file.
 * DATABASE        ENTITY_TYPE_ID  ENTITY_TYPE_NAME        LOCAL_ID_SYNTAX URL_SYNTAX
 *
 */
public enum DBXrefEntityColumns {

    COLUMN_DB(0),
    COLUMN_ENTITY_TYPE_ID(1),
    COLUMN_ENTITY_TYPE_NAME(2),
    COLUMN_LOCAL_ID_SYNTAX(3),
    COLUMN_URL_SYNTAX(4);

    private final int position;

    DBXrefEntityColumns(int position) {
        this.position = position;
    }

    public int getPosition() {
        return position;
    }

    public static int numColumns() {
        return DBXrefEntityColumns.values().length;
    }

}

Add javadoc, make position final.

Add javadoc, make position final.


/*
 * Copyright 2006-2022 The MZmine Development Team
 *
 * This file is part of MZmine.
 *
 * MZmine is free software; you can redistribute it and/or modify it under the terms of the GNU
 * General Public License as published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * MZmine is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
 * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with MZmine; if not,
 * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 */

package io.github.mzmine.modules.io.spectraldbsubmit.batch;

public enum SpectralLibraryExportFormats {
  json, msp;

  @Override
  public String toString() {
    return switch (this) {
      case json -> "GNPS json (recommended)";
      case msp -> "NIST msp";
    };
  }

  public String getExtension() {
    return switch (this) {
      case json -> "json";
      case msp -> "msp";
    };
  }
}

/*
 * Copyright (c) 2004-2022 The MZmine Development Team
 *
 * 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 io.github.mzmine.modules.io.spectraldbsubmit.batch;

public enum SpectralLibraryExportFormats {
  json, msp;

  @Override
  public String toString() {
    return switch (this) {
      case json -> "MZmine json (recommended)";
      case msp -> "NIST msp";
    };
  }

  public String getExtension() {
    return switch (this) {
      case json -> "json";
      case msp -> "msp";
    };
  }
}

Change export format name to mzmine

Change export format name to mzmine


package in.twizmwaz.cardinal.module.modules.regions.parsers;

import in.twizmwaz.cardinal.module.modules.regions.RegionParser;
import org.bukkit.util.Vector;
import org.jdom2.Element;

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

public class CuboidParser extends RegionParser {

    private final Vector min, max;

    public CuboidParser(Element element) {
        super(element.getAttributeValue("name"));
        List<String> values = new ArrayList<>();
        values.addAll(Arrays.asList(element.getAttributeValue("min").contains(",") ?
                element.getAttributeValue("min").trim().split(",") : element.getAttributeValue("min").trim().split(" ")));
        values.addAll(Arrays.asList(element.getAttributeValue("max").trim().replaceAll(" ", ",").split(",")));
        for (String string : values) {
            values.set(values.indexOf(string), string.trim());
            if (string.equalsIgnoreCase("oo")) values.set(values.indexOf(string), "256");
            if (string.equalsIgnoreCase("-oo")) values.set(values.indexOf(string), "0");
        }
        this.min = new Vector(Double.parseDouble(values.get(0)), Double.parseDouble(values.get(1)), Double.parseDouble(values.get(2)));
        this.max = new Vector(Double.parseDouble(values.get(3)), Double.parseDouble(values.get(4)), Double.parseDouble(values.get(5)));
    }

    public Vector getMin() {
        return min;
    }

    public Vector getMax() {
        return max;
    }
}

package in.twizmwaz.cardinal.module.modules.regions.parsers;

import in.twizmwaz.cardinal.module.modules.regions.RegionParser;
import in.twizmwaz.cardinal.util.NumUtils;
import org.bukkit.util.Vector;
import org.jdom2.Element;

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

public class CuboidParser extends RegionParser {

    private final Vector min, max;

    public CuboidParser(Element element) {
        super(element.getAttributeValue("name"));
        List<String> values = new ArrayList<>();
        values.addAll(Arrays.asList(element.getAttributeValue("min").contains(",") ?
                element.getAttributeValue("min").trim().split(",") : element.getAttributeValue("min").trim().split(" ")));
        values.addAll(Arrays.asList(element.getAttributeValue("max").trim().replaceAll(" ", ",").split(",")));
        for (String string : values) {
            values.set(values.indexOf(string), string.trim());
        }
        this.min = new Vector(NumUtils.parseDouble(values.get(0)), NumUtils.parseDouble(values.get(1)), NumUtils.parseDouble(values.get(2)));
        this.max = new Vector(NumUtils.parseDouble(values.get(3)), NumUtils.parseDouble(values.get(4)), NumUtils.parseDouble(values.get(5)));
    }

    public Vector getMin() {
        return min;
    }

    public Vector getMax() {
        return max;
    }
}

Fix cuboid regions not extending all the way to negative infinity


/*
 * 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.commons.lang3.test;

/**
 * Allows for testing an exception that is not visible to
 * {@link org.apache.commons.lang3.exception.ExceptionUtils}
 */
public class NotVisibleExceptionFactory {

  private NotVisibleExceptionFactory() {}

  /**
   * Create a new Exception whose getCause method returns the
   * provided cause.
   * @param cause the cause of the exception
   * @return a new {@link Exception}
   */
  public static Exception createException(final Throwable cause) {
    return new NotVisibleException(cause);
  }

  private static class NotVisibleException extends Exception {

    private static final long serialVersionUID = 1L; // avoid warning

    private final Throwable cause;

    private NotVisibleException(final Throwable cause) {
      this.cause = cause;
    }

    @Override
    public Throwable getCause() {
      return cause;
    }
  }
}

/*
 * 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.commons.lang3.test;

/**
 * Allows for testing an exception that is not visible to
 * {@link org.apache.commons.lang3.exception.ExceptionUtils}
 */
public class NotVisibleExceptionFactory {

  private NotVisibleExceptionFactory() {}

  /**
   * Create a new Exception whose getCause method returns the
   * provided cause.
   * @param cause the cause of the exception
   * @return a new {@link Exception}
   */
  public static Exception createException(final Throwable cause) {
    return new NotVisibleException(cause);
  }

  private static class NotVisibleException extends Exception {

    private static final long serialVersionUID = 1L; // avoid warning

    private final Throwable cause;

    private NotVisibleException(final Throwable cause) {
      this.cause = cause;
    }

    @Override
    public synchronized Throwable getCause() {
      return cause;
    }
  }
}

Document unused type parameter for tests


package com.thaiopensource.resolver;

import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.io.IOException;

/**
 *
 */
public class BasicResolver implements Resolver {
  static private final BasicResolver theInstance = new BasicResolver();

  protected BasicResolver() {
  }

  public static BasicResolver getInstance() {
    return theInstance;
  }

  public void resolve(Identifier id, Input input) throws IOException, ResolverException {
    if (!input.isResolved())
      input.setUri(resolveUri(id));
  }

  public void open(Input input) throws IOException, ResolverException {
    if (!input.isUriDefinitive())
      return;
    URI uri;
    try {
      uri = new URI(input.getUri());
    }
    catch (URISyntaxException e) {
      throw new ResolverException(e);
    }
    if (!uri.isAbsolute())
      throw new ResolverException("cannot open relative URI: " + uri);
    URL url = new URL(uri.toASCIIString());
    // XXX should set the encoding properly
    input.setByteStream(url.openStream());
  }

  public static String resolveUri(Identifier id) throws ResolverException {
    try {
      URI uri = new URI(id.getUriReference());
      String base = id.getBase();
      if (base != null)
        uri = new URI(base).resolve(uri);
      return uri.toString();
    }
    catch (URISyntaxException e) {
      throw new ResolverException(e);
    }
  }
}

package com.thaiopensource.resolver;

import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.io.IOException;

/**
 *
 */
public class BasicResolver implements Resolver {
  static private final BasicResolver theInstance = new BasicResolver();

  protected BasicResolver() {
  }

  public static BasicResolver getInstance() {
    return theInstance;
  }

  public void resolve(Identifier id, Input input) throws IOException, ResolverException {
    if (!input.isResolved())
      input.setUri(resolveUri(id));
  }

  public void open(Input input) throws IOException, ResolverException {
    if (!input.isUriDefinitive())
      return;
    URI uri;
    try {
      uri = new URI(input.getUri());
    }
    catch (URISyntaxException e) {
      throw new ResolverException(e);
    }
    if (!uri.isAbsolute())
      throw new ResolverException("cannot open relative URI: " + uri);
    URL url = new URL(uri.toASCIIString());
    // XXX should set the encoding properly
    // XXX if this is HTTP and we've been redirected, should do input.setURI with the new URI
    input.setByteStream(url.openStream());
  }

  public static String resolveUri(Identifier id) throws ResolverException {
    try {
      URI uri = new URI(id.getUriReference());
      String base = id.getBase();
      if (base != null)
        uri = new URI(base).resolve(uri);
      return uri.toString();
    }
    catch (URISyntaxException e) {
      throw new ResolverException(e);
    }
  }
}

Add note that we need to handle HTTP redirection

git-svn-id: ca8e9bb6f3f9b50a093b443c23951d3c25ca0913@2241 369101cc-9a96-11dd-8e58-870c635edf7a


package org.verapdf.model.impl.pb.operator.textposition;

import org.apache.pdfbox.cos.COSBase;
import org.verapdf.model.operator.Op_TD_Big;

import java.util.List;

/**
 * @author Evgeniy Muravitskiy
 */
public class PBOp_TD_Big extends PBOp_General_Td implements Op_TD_Big {

	public static final String OP_TD_BIG_TYPE = "Op_Td_Big";

	public PBOp_TD_Big(List<COSBase> arguments) {
		super(arguments);
		setType(OP_TD_BIG_TYPE);
	}
}

package org.verapdf.model.impl.pb.operator.textposition;

import org.apache.pdfbox.cos.COSBase;
import org.verapdf.model.operator.Op_TD_Big;

import java.util.List;

/**
 * @author Evgeniy Muravitskiy
 */
public class PBOp_TD_Big extends PBOp_General_Td implements Op_TD_Big {

	public static final String OP_TD_BIG_TYPE = "Op_TD_Big";

	public PBOp_TD_Big(List<COSBase> arguments) {
		super(arguments);
		setType(OP_TD_BIG_TYPE);
	}
}

Change type Name for TD operator

Change type Name for TD operator


package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_14r1_14r2;

import protocolsupport.protocol.ConnectionImpl;
import protocolsupport.protocol.packet.PacketType;
import protocolsupport.protocol.packet.middle.clientbound.play.MiddleInventoryHorseOpen;
import protocolsupport.protocol.packet.middleimpl.ClientBoundPacketData;
import protocolsupport.protocol.packet.middleimpl.IPacketData;
import protocolsupport.protocol.serializer.VarNumberSerializer;
import protocolsupport.utils.recyclable.RecyclableCollection;
import protocolsupport.utils.recyclable.RecyclableSingletonList;

public class InventoryHorseOpen extends MiddleInventoryHorseOpen {

	public InventoryHorseOpen(ConnectionImpl connection) {
		super(connection);
	}

	@Override
	public RecyclableCollection<? extends IPacketData> toData() {
		ClientBoundPacketData horseopen = ClientBoundPacketData.create(PacketType.CLIENTBOUND_PLAY_WINDOW_HORSE_OPEN);
		horseopen.writeByte(windowId);
		VarNumberSerializer.writeVarInt(horseopen, windowId);
		horseopen.writeInt(entityId);
		return RecyclableSingletonList.create(horseopen);
	}

}

package protocolsupport.protocol.packet.middleimpl.clientbound.play.v_14r1_14r2;

import protocolsupport.protocol.ConnectionImpl;
import protocolsupport.protocol.packet.PacketType;
import protocolsupport.protocol.packet.middle.clientbound.play.MiddleInventoryHorseOpen;
import protocolsupport.protocol.packet.middleimpl.ClientBoundPacketData;
import protocolsupport.protocol.packet.middleimpl.IPacketData;
import protocolsupport.protocol.serializer.VarNumberSerializer;
import protocolsupport.utils.recyclable.RecyclableCollection;
import protocolsupport.utils.recyclable.RecyclableSingletonList;

public class InventoryHorseOpen extends MiddleInventoryHorseOpen {

	public InventoryHorseOpen(ConnectionImpl connection) {
		super(connection);
	}

	@Override
	public RecyclableCollection<? extends IPacketData> toData() {
		ClientBoundPacketData horseopen = ClientBoundPacketData.create(PacketType.CLIENTBOUND_PLAY_WINDOW_HORSE_OPEN);
		horseopen.writeByte(windowId);
		VarNumberSerializer.writeVarInt(horseopen, slots);
		horseopen.writeInt(entityId);
		return RecyclableSingletonList.create(horseopen);
	}

}

Fix hrose inventory open for 1.14+

Fix hrose inventory open for 1.14+


// Copyright (C) 2008 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.google.gerrit.reviewdb;

import com.google.gwtorm.client.Access;
import com.google.gwtorm.client.OrmException;
import com.google.gwtorm.client.PrimaryKey;
import com.google.gwtorm.client.Query;
import com.google.gwtorm.client.ResultSet;
import com.google.gwtorm.client.SecondaryKey;

public interface ApprovalCategoryAccess extends
    Access<ApprovalCategory, ApprovalCategory.Id> {
  @PrimaryKey("categoryId")
  ApprovalCategory get(ApprovalCategory.Id id) throws OrmException;

  @SecondaryKey("name")
  ApprovalCategory byName(String name) throws OrmException;

  @Query("ORDER BY position, name")
  ResultSet<ApprovalCategory> all() throws OrmException;
}

// Copyright (C) 2008 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.google.gerrit.reviewdb;

import com.google.gwtorm.client.Access;
import com.google.gwtorm.client.OrmException;
import com.google.gwtorm.client.PrimaryKey;
import com.google.gwtorm.client.Query;
import com.google.gwtorm.client.ResultSet;

public interface ApprovalCategoryAccess extends
    Access<ApprovalCategory, ApprovalCategory.Id> {
  @PrimaryKey("categoryId")
  ApprovalCategory get(ApprovalCategory.Id id) throws OrmException;

  @Query("ORDER BY position, name")
  ResultSet<ApprovalCategory> all() throws OrmException;
}

Remove unused byName @SecondaryKey from ApprovalCategory

Change-Id: Ic00e7fcd48f206f16d49b96dc4890c5ae3dc7252
Signed-off-by: Shawn O. Pearce <f3ea74d906fa9fe97c1fef6bad9cb871485c7045@google.com>


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

package org.rm3l.maoni.sample;

import android.app.Application;

import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary;

public class MaoniSampleApplication extends Application {

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

        if (BuildConfig.DEBUG) {
            LeakCanary.install(this);
            Stetho.initializeWithDefaults(this);
        }
    }
}

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

package org.rm3l.maoni.sample;

import android.app.Application;

import com.facebook.stetho.Stetho;

public class MaoniSampleApplication extends Application {

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

        if (BuildConfig.DEBUG) {
            Stetho.initializeWithDefaults(this);
        }
    }
}

Remove explicit installation of LeakCanary

As of version 2, it should now auto-install itself


package edu.oakland.OUSoft.linkedList;

import static org.junit.Assert.*;

/**
 * Created on 3/15/17.
 */
public class cseSortedArrayLinkedListTest {
	@org.junit.Test
	public void add() throws Exception {

	}

	@org.junit.Test
	public void add1() throws Exception {

	}

}

package edu.oakland.OUSoft.linkedList;

import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class cseSortedArrayLinkedListTest {

	private cseSortedArrayLinkedList<Integer> list;

	@Before
	public void setUp() throws Exception {
		list = new cseSortedArrayLinkedList<>(6);
	}

	@Test
	public void add() throws Exception {
		assertTrue(list.add(10));
		assertTrue(list.contains(10));
		assertEquals((Object) 10, list.get(0));
		assertEquals(1, list.size());

		assertTrue(list.add(5));
		assertTrue(list.contains(5));
		assertEquals((Object) 5, list.get(0));
		assertEquals((Object) 10, list.get(1));
		assertEquals(2, list.size());

		assertTrue(list.add(1));
		assertTrue(list.contains(1));
		assertEquals((Object) 1, list.get(0));
		assertEquals((Object) 5, list.get(1));
		assertEquals((Object) 10, list.get(2));
		assertEquals(3, list.size());

		assertTrue(list.add(20));
		assertEquals((Object) 1, list.get(0));
		assertEquals((Object) 5, list.get(1));
		assertEquals((Object) 10, list.get(2));
		assertEquals((Object) 20, list.get(3));
		assertEquals(4, list.size());

		assertTrue(list.add(1));
		assertEquals((Object) 1, list.get(0));
		assertEquals((Object) 1, list.get(1));
		assertEquals((Object) 5, list.get(2));
		assertEquals((Object) 10, list.get(3));
		assertEquals((Object) 20, list.get(4));
		assertEquals(5, list.size());

		assertTrue(list.add(7));
		assertEquals((Object) 1, list.get(0));
		assertEquals((Object) 1, list.get(1));
		assertEquals((Object) 5, list.get(2));
		assertEquals((Object) 7, list.get(3));
		assertEquals((Object) 10, list.get(4));
		assertEquals((Object) 20, list.get(5));
		assertEquals(6, list.size());
	}
}

Make test for sorted array linked list

Make test for sorted array linked list


package ca.corefacility.bioinformatics.irida.ria.integration.utilities;

import org.openqa.selenium.WebDriver;

import ca.corefacility.bioinformatics.irida.ria.integration.pages.remoteapi.CreateRemoteAPIPage;
import ca.corefacility.bioinformatics.irida.ria.integration.pages.remoteapi.RemoteAPIDetailsPage;

import static org.junit.Assert.assertTrue;

public class RemoteApiUtilities {
	protected static final String BASE_URL =
			System.getProperty("server.base.url", "http://localhost:" + System.getProperty("jetty.port", "8080")) + "/";

	public static void addRemoteApi(WebDriver driver, String clientId, String clientSecret) {
		CreateRemoteAPIPage page = new CreateRemoteAPIPage(driver);

		String baseUrl = page.getBaseUrl();
		String url = baseUrl + "api";

		page.createRemoteAPIWithDetails("new name", url, clientId, clientSecret);

		RemoteAPIDetailsPage remoteAPIDetailsPage = RemoteAPIDetailsPage.gotoDetailsPage(driver);

		remoteAPIDetailsPage.clickConnect();
		remoteAPIDetailsPage.clickAuthorize();

		assertTrue("api status should be connected", remoteAPIDetailsPage.isRemoteAPIConnected());
	}

	/**
	 * Get the location of the OAuth redirect URI for this test server.
	 *
	 * @return The oauth/authorization/token location for this server
	 */
	public static String getRedirectLocation() {
		return BASE_URL + "api/oauth/authorization/token";
	}
}

package ca.corefacility.bioinformatics.irida.ria.integration.utilities;

import org.openqa.selenium.WebDriver;

import ca.corefacility.bioinformatics.irida.ria.integration.pages.remoteapi.CreateRemoteAPIPage;
import ca.corefacility.bioinformatics.irida.ria.integration.pages.remoteapi.RemoteAPIDetailsPage;

import static org.junit.Assert.assertTrue;

public class RemoteApiUtilities {
	protected static final String BASE_URL =
			System.getProperty("server.base.url", "http://localhost:" + System.getProperty("server.port", "8080")) + "/";

	public static void addRemoteApi(WebDriver driver, String clientId, String clientSecret) {
		CreateRemoteAPIPage page = new CreateRemoteAPIPage(driver);

		String baseUrl = page.getBaseUrl();
		String url = baseUrl + "api";

		page.createRemoteAPIWithDetails("new name", url, clientId, clientSecret);

		RemoteAPIDetailsPage remoteAPIDetailsPage = RemoteAPIDetailsPage.gotoDetailsPage(driver);

		remoteAPIDetailsPage.clickConnect();
		remoteAPIDetailsPage.clickAuthorize();

		assertTrue("api status should be connected", remoteAPIDetailsPage.isRemoteAPIConnected());
	}

	/**
	 * Get the location of the OAuth redirect URI for this test server.
	 *
	 * @return The oauth/authorization/token location for this server
	 */
	public static String getRedirectLocation() {
		return BASE_URL + "api/oauth/authorization/token";
	}
}

Remove last reference to jetty.port in the code.


/*
 * Copyright 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.samples.quickstart.analytics;

import android.app.Application;

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Logger;
import com.google.android.gms.analytics.Tracker;

/**
 * This is a subclass of {@link Application} used to provide shared objects for this app, such as
 * the {@link Tracker}.
 */
public class AnalyticsApplication extends Application {
  private Tracker mTracker;

  /**
   * Gets the default {@link Tracker} for this {@link Application}.
   * @return tracker
   */
  synchronized public Tracker getDefaultTracker() {
    if (mTracker == null) {
      GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
      analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
      mTracker = analytics.newTracker(R.xml.tracker);
    }
    return mTracker;
  }
}

/*
 * Copyright 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.samples.quickstart.analytics;

import android.app.Application;

import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Logger;
import com.google.android.gms.analytics.Tracker;

/**
 * This is a subclass of {@link Application} used to provide shared objects for this app, such as
 * the {@link Tracker}.
 */
public class AnalyticsApplication extends Application {
  private Tracker mTracker;

  /**
   * Gets the default {@link Tracker} for this {@link Application}.
   * @return tracker
   */
  synchronized public Tracker getDefaultTracker() {
    if (mTracker == null) {
      GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
      analytics.getLogger().setLogLevel(Logger.LogLevel.VERBOSE);
      mTracker = analytics.newTracker(R.xml.global_tracker);
    }
    return mTracker;
  }
}

Move to generated tracker name

Move to generated tracker name

Change-Id: I1ac24a9278fcfc3a0cc81add5fede9f2435c17ef


package ca.six.unittestapp.todo;

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

import ca.six.unittestapp.todo.data.source.TasksRepositoryTest;
import ca.six.unittestapp.todo.statistics.StatisticsPresenterTest;
import ca.six.unittestapp.todo.taskdetail.TaskDetailPresenterTest;
import ca.six.unittestapp.todo.tasks.TasksPresenterTest;

/**
 * @author hellenxu
 * @date 2017-09-23
 * Copyright 2017 Six. All rights reserved.
 */

@RunWith(Suite.class)
@Suite.SuiteClasses({TasksRepositoryTest.class, StatisticsPresenterTest.class,
        TaskDetailPresenterTest.class, TasksPresenterTest.class})
public class TodoUnitTestSuite {
}

package ca.six.unittestapp.todo;

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

import ca.six.unittestapp.todo.addedittask.AddEditTaskPresenterTest;
import ca.six.unittestapp.todo.data.source.TasksRepositoryTest;
import ca.six.unittestapp.todo.statistics.StatisticsPresenterTest;
import ca.six.unittestapp.todo.taskdetail.TaskDetailPresenterTest;
import ca.six.unittestapp.todo.tasks.TasksPresenterTest;

/**
 * @author hellenxu
 * @date 2017-09-23
 * Copyright 2017 Six. All rights reserved.
 */

@RunWith(Suite.class)
@Suite.SuiteClasses({AddEditTaskPresenterTest.class, TasksRepositoryTest.class,
        StatisticsPresenterTest.class, TaskDetailPresenterTest.class, TasksPresenterTest.class})
public class TodoUnitTestSuite {
}

Add AddEditTaskPresenter into test suite.


/*
 * Copyright 2012-2014 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.boot.context.embedded.tomcat;

import org.apache.catalina.Container;
import org.apache.catalina.core.StandardContext;

/**
 * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to
 * support deferred initialization.
 *
 * @author Phillip Webb
 */
class TomcatEmbeddedContext extends StandardContext {

	@Override
	public void loadOnStartup(Container[] children) {
	}

	public void deferredLoadOnStartup() {
		super.loadOnStartup(findChildren());
	}

}

/*
 * Copyright 2012-2014 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.boot.context.embedded.tomcat;

import org.apache.catalina.Container;
import org.apache.catalina.core.StandardContext;
import org.springframework.util.ClassUtils;

/**
 * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to
 * support deferred initialization.
 *
 * @author Phillip Webb
 */
class TomcatEmbeddedContext extends StandardContext {

	@Override
	public void loadOnStartup(Container[] children) {
	}

	public void deferredLoadOnStartup() {
		// Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class
		// loader to create servlet instances in this phase. If they do that and then try
		// to initialize them later the class loader may have changed, so wrap the call to
		// loadOnStartup in what we think its going to be the main webapp classloader at
		// runtime.
		ClassLoader classLoader = getLoader().getClassLoader();
		ClassLoader existingLoader = null;
		if (classLoader != null) {
			existingLoader = ClassUtils.overrideThreadContextClassLoader(classLoader);
		}
		super.loadOnStartup(findChildren());
		if (existingLoader != null) {
			ClassUtils.overrideThreadContextClassLoader(existingLoader);
		}
	}

}

Set Thread context class loader while Tomcat starts up

Fixes gh-1085


package edu.northwestern.bioinformatics.studycalendar.dao;

import edu.northwestern.bioinformatics.studycalendar.domain.StudySegment;

/**
 * @author Moses Hohman
 * @author Rhett Sutphin
 */
public class StudySegmentDao extends StudyCalendarMutableDomainObjectDao<StudySegment> {
    @Override
    public Class<StudySegment> domainClass() {
        return StudySegment.class;
    }

    public void delete(StudySegment segment) {
        getHibernateTemplate().delete(segment);
    }
}

package edu.northwestern.bioinformatics.studycalendar.dao;

import edu.northwestern.bioinformatics.studycalendar.domain.StudySegment;

/**
 * @author Moses Hohman
 * @author Rhett Sutphin
 */
public class StudySegmentDao extends StudyCalendarMutableDomainObjectDao<StudySegment> {
    @Override
    public Class<StudySegment> domainClass() {
        return StudySegment.class;
    }

    /**
     * Deletes the given study segment
     *
     * @param  segment the study segment to delete
     */
    public void delete(StudySegment segment) {
        getHibernateTemplate().delete(segment);
    }
}

Add javadoc to study segment dao.

Add javadoc to study segment dao.

git-svn-id: 4b387fe5ada7764508e2ca96c335714e4c1692c6@2438 0d517254-b314-0410-acde-c619094fa49f


package uk.gov.register.filters;

import com.google.common.net.HttpHeaders;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
public class ContentSecurityPolicyFilter implements ContainerResponseFilter {
    @Override
    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
        responseContext.getHeaders().add(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self'");
    }
}

package uk.gov.register.filters;

import com.google.common.net.HttpHeaders;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
public class ContentSecurityPolicyFilter implements ContainerResponseFilter {
    @Override
    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException {
        responseContext.getHeaders().add(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self' www.google-analytics.com");
    }
}

Enable google analytics in content security policy filter


package htmlflow;

import java.io.PrintStream;

public interface HtmlWriter<T>{
	/**
	 * Writes into an internal PrintStream the HTML content
	 * of this element with initial indentation of zero.
	 *
	 * @param model An optional object model that could be bind to this element.
	 */
	default void write(T model) {
		write(0, model);
	}
	/**
	 * Writes into an internal PrintStream the HTML content
	 * of this element.
	 *
	 * @param depth The number of tabs indentation.
	 * @param model An optional object model that could be bind to this element.
	 */
	void write(int depth, T model);

	/**
	 * Sets the current PrintStream.
	 * @param out
	 */
	HtmlWriter<T> setPrintStream(PrintStream out);
}

package htmlflow;

import java.io.PrintStream;

public interface HtmlWriter<T>{
	/**
	 * Writes into an internal PrintStream the HTML content
	 * of this element with zero indentation and without a
	 * domain object.
	 */
	default void write() {
		write(0, null);
	}
	/**
	 * Writes into an internal PrintStream the HTML content
	 * of this element with initial indentation of zero.
	 *
	 * @param model An optional object model that could be bind to this element.
	 */
	default void write(T model) {
		write(0, model);
	}
	/**
	 * Writes into an internal PrintStream the HTML content
	 * of this element.
	 *
	 * @param depth The number of tabs indentation.
	 * @param model An optional object model that could be bind to this element.
	 */
	void write(int depth, T model);

	/**
	 * Sets the current PrintStream.
	 * @param out
	 */
	HtmlWriter<T> setPrintStream(PrintStream out);
}

Add a parameterless write() method

Add a parameterless write() method


/*
 * Copyright 2012 Ecwid, 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.ecwid.mailchimp.method.helper;

import java.util.List;
import com.ecwid.mailchimp.MailChimpMethod;

/**
 * See http://apidocs.mailchimp.com/api/1.3/getaccountdetails.func.php
 *
 * @author Matt Farmer <matt@frmr.me>
 */
@MailChimpMethod.Name("getAccountDetails")
public class GetAccountDetailsMethod extends MailChimpMethod<AccountDetails> {

	@Field
	public String apikey;

	@Field
	public List<String> exclude;

	@Override
	public Class<AccountDetails> getResultType() {
		return AccountDetails.class;
	}
}

/*
 * Copyright 2012 Ecwid, 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.ecwid.mailchimp.method.helper;

import java.util.List;
import com.ecwid.mailchimp.MailChimpMethod;

/**
 * See http://apidocs.mailchimp.com/api/1.3/getaccountdetails.func.php
 *
 * @author Matt Farmer <matt@frmr.me>
 */
@MailChimpMethod.Name("getAccountDetails")
public class GetAccountDetailsMethod extends MailChimpMethod<AccountDetails> {

	@Field
	public List<String> exclude;

	@Override
	public Class<AccountDetails> getResultType() {
		return AccountDetails.class;
	}
}

Remove api key field from GetACcountDetailsMethod.

It's already defined in the parent class.


package io.quarkus.it.bouncycastle;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
    @Test
    @Override
    public void testListProviders() {
        doTestListProviders();
        checkLog(true);
    }
}

package io.quarkus.it.bouncycastle;

import org.junit.jupiter.api.Test;

import io.quarkus.test.junit.DisabledOnNativeImage;
import io.quarkus.test.junit.NativeImageTest;

@NativeImageTest
public class BouncyCastleJsseITCase extends BouncyCastleJsseTestCase {
    @Test
    @DisabledOnNativeImage
    @Override
    public void testListProviders() {
        doTestListProviders();
        checkLog(true);
    }
}

Disable Bouncycastle JSSE native test

Disable Bouncycastle JSSE native test

Issue tracked in https://github.com/quarkusio/quarkus/issues/17046


/*
 * Copyright 2015-2017 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.platform.engine.support.hierarchical;

import java.util.HashSet;
import java.util.Set;

import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.UniqueId;

/**
 * @since 1.0
 */
class ExecutionTracker {

	private final Set<UniqueId> executedUniqueIds = new HashSet<>();

	void markExecuted(TestDescriptor testDescriptor) {
		executedUniqueIds.add(testDescriptor.getUniqueId());
	}

	boolean wasAlreadyExecuted(TestDescriptor testDescriptor) {
		return executedUniqueIds.contains(testDescriptor.getUniqueId());
	}
}

/*
 * Copyright 2015-2017 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.platform.engine.support.hierarchical;

import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.junit.platform.engine.TestDescriptor;
import org.junit.platform.engine.UniqueId;

/**
 * @since 1.0
 */
class ExecutionTracker {

	private final Set<UniqueId> executedUniqueIds = ConcurrentHashMap.newKeySet();

	void markExecuted(TestDescriptor testDescriptor) {
		executedUniqueIds.add(testDescriptor.getUniqueId());
	}

	boolean wasAlreadyExecuted(TestDescriptor testDescriptor) {
		return executedUniqueIds.contains(testDescriptor.getUniqueId());
	}
}

Use ConcurrentHashMap for possible concurrent execution in the future


/**
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch 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.elasticsearch.plugin.querytemplate;

import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.script.ScriptModule;
import org.elasticsearch.script.querytemplate.QueryTemplateEngineService;

/**
 * Plugin to enable referencing query templates and parameters.
 *
 * This class is also referenced in the plugin configuration - make sure
 * you change the class name in src/main/resources/es.plugin.properties
 * when refactoring this class to a different name.
 */
public class QueryTemplatePlugin extends AbstractPlugin {

    @Override
    public String name() {
        return "query-template";
    }

    @Override
    public String description() {
        return "Query template plugin allowing to add reference queries by template name";
    }

    public void onModule(ScriptModule module) {
        module.addScriptEngine(QueryTemplateEngineService.class);
    }
}

/**
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch 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.elasticsearch.plugin.querytemplate;

import org.elasticsearch.plugins.AbstractPlugin;

/**
 * Plugin to enable referencing query templates and parameters.
 *
 * This class is also referenced in the plugin configuration - make sure
 * you change the class name in src/main/resources/es.plugin.properties
 * when refactoring this class to a different name.
 */
public class QueryTemplatePlugin extends AbstractPlugin {

    @Override
    public String name() {
        return "query-template";
    }

    @Override
    public String description() {
        return "Query template plugin allowing to add reference queries by template name";
    }

//    public void onModule() {

//    }
}

Remove onModule method that is no longer needed.


/*
 * Copyright 2017-2018, EnMasse authors.
 * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
 */
package io.enmasse.controller.common;

import io.enmasse.address.model.AuthenticationService;
import io.enmasse.address.model.AuthenticationServiceResolver;

import java.util.Optional;

/**
 * Resolves the none authentication service host name.
 */
public class StandardAuthenticationServiceResolver implements AuthenticationServiceResolver {
    private final String host;
    private final int port;

    public StandardAuthenticationServiceResolver(String host, int port) {
        this.host = host;
        this.port = port;
    }

    @Override
    public String getHost(AuthenticationService authService) {
        return host;
    }

    @Override
    public int getPort(AuthenticationService authService) {
        return port;
    }

    @Override
    public Optional<String> getCaSecretName(AuthenticationService authService) {
        return Optional.of("standard-authservice-cert");
    }

    @Override
    public Optional<String> getClientSecretName(AuthenticationService authService) {
        return Optional.empty();
    }

    @Override
    public Optional<String> getSaslInitHost(String addressSpaceName, AuthenticationService authService) {
        return Optional.of(addressSpaceName);
    }
}

/*
 * Copyright 2017-2018, EnMasse authors.
 * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
 */
package io.enmasse.controller.common;

import io.enmasse.address.model.AuthenticationService;
import io.enmasse.address.model.AuthenticationServiceResolver;

import java.util.Optional;

/**
 * Resolves the none authentication service host name.
 */
public class StandardAuthenticationServiceResolver implements AuthenticationServiceResolver {
    private final String host;
    private final int port;

    public StandardAuthenticationServiceResolver(String host, int port) {
        this.host = host;
        this.port = port;
    }

    @Override
    public String getHost(AuthenticationService authService) {
        String overrideHost = (String) authService.getDetails().get("host");
        if (overrideHost != null) {
            return overrideHost;
        } else {
            return host;
        }
    }

    @Override
    public int getPort(AuthenticationService authService) {
        String overridePort = (String) authService.getDetails().get("port");
        if (overridePort != null) {
            return Integer.parseInt(overridePort);
        } else {
            return port;
        }
    }

    @Override
    public Optional<String> getCaSecretName(AuthenticationService authService) {
        return Optional.of("standard-authservice-cert");
    }

    @Override
    public Optional<String> getClientSecretName(AuthenticationService authService) {
        return Optional.empty();
    }

    @Override
    public Optional<String> getSaslInitHost(String addressSpaceName, AuthenticationService authService) {
        return Optional.of(addressSpaceName);
    }
}

Allow standard authservice host port to be overridden

This makes it easier to connect to the standard authservice through
alternative hosts and ports if needed