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

package com.google.androidbrowserhelper.demos.playbilling;

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

import com.google.androidbrowserhelper.trusted.LauncherActivity;

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

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

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

package com.google.androidbrowserhelper.demos.playbilling;

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

import com.google.androidbrowserhelper.trusted.LauncherActivity;

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

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

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

        startActivity(intent);
    }
}

Add demo app version code to launch URL.


package com.braintreepayments.api.exceptions;

public class AppSwitchNotAvailableException extends BraintreeException {
}

package com.braintreepayments.api.exceptions;

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

Add comment to exception class

Add comment to exception class


package org.tinylog.benchmarks.file;

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

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

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

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

	/** */
	public LogFileState() {
	}

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

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

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

}

package org.tinylog.benchmarks.file;

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

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

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

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

	/** */
	public LogFileState() {
	}

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

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

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

}

Fix writing strings in FileOutputBenchmark via FileLogState


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

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

public class AddSavingsAccountPagerAdapter extends FragmentPagerAdapter {

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

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

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

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

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

public class AddSavingsAccountPagerAdapter extends FragmentPagerAdapter {

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

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

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

Use name fragment as only fragment in pager adapter for now


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

package org.springframework.boot.actuate.health;

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

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

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

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

}

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

package org.springframework.boot.actuate.health;

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

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

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

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

}

Update copyright year of changed file

Update copyright year of changed file

See gh-26321


package com.hubspot.singularity.executor.config;

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

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

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

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

    public String getFilename() {
        return filename;
    }

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

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

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

}

package com.hubspot.singularity.executor.config;

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

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

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

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

    public String getFilename() {
        return filename;
    }

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

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

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

}

Make parameters final that can be made final.


package org.grouplens.lenskit.util.tablewriter;

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

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

public class MultiplexedTableWriter implements TableWriter {

	private TableLayout layout;
	private List<TableWriter> writers;

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

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

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

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

	}

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

package org.grouplens.lenskit.util.tablewriter;

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

public class MultiplexedTableWriter implements TableWriter {

	private TableLayout layout;
	private List<TableWriter> writers;

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

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

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

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

	}

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

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


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

import com.google.common.collect.ImmutableList;

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

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

    public static final String VESPA_CONSUMER_ID = "Vespa";

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

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

}

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

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

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

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

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

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

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

}

Use string constant from metrics-proxy to avoid duplication.


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

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

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

public class TimeOutInventoryRequestCommandTest {

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

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

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

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

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

public class TimeOutInventoryRequestCommandTest {

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

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

Enhance readability of time out command test


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

import org.springframework.core.io.Resource;

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

public class AdminPagesSecurityProperties {

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

    public boolean isActuatorEndpointsEnabled() {
        return actuatorEndpointsEnabled;
    }

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

    public String getIp() {
        return ip;
    }

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

    public String getAdminRoles() {
        return adminRoles;
    }

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

    public String getLoginUrl() {
        return loginUrl;
    }

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

    public String getService() {
        return service;
    }

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

    public Resource getUsers() {
        return users;
    }

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

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

import org.springframework.core.io.Resource;

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

public class AdminPagesSecurityProperties {

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

    public boolean isActuatorEndpointsEnabled() {
        return actuatorEndpointsEnabled;
    }

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

    public String getIp() {
        return ip;
    }

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

    public String getAdminRoles() {
        return adminRoles;
    }

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

    public String getLoginUrl() {
        return loginUrl;
    }

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

    public String getService() {
        return service;
    }

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

    public Resource getUsers() {
        return users;
    }

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

Support ipv6 for status endpoint security


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

import javax.swing.Icon;

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

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

	public String getName() {
		return BEANSHELL;
	}

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

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

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

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

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

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

import java.net.URI;

import javax.swing.Icon;

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

public class BeanshellTemplateService extends
		AbstractTemplateService<BeanshellActivityConfigurationBean> {

	private static final String BEANSHELL = "Beanshell";

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

	public String getName() {
		return BEANSHELL;
	}

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

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

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

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

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

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

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

git-svn-id: 2b4c7ad77658e4b3615e54128c4b6795c159dfbb@10041 bf327186-88b3-11dd-a302-d386e5130c1c


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

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

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

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

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

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

    @Inject
    Config config;

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

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

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

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

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

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

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

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

    @Inject
    Config config;

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

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

Rename test configuration property names clashing with maven deploy


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

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

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

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

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

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

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

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

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

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

Add missing @Test annotation to test class


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

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

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

class NamedayJSONResourceProvider {

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

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

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

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

}

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

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

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

class NamedayJSONResourceProvider {

    private static final JSONArray EMPTY = new JSONArray();

    private final NamedayJSONResourceLoader loader;

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

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

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

}

Mark empty object as static

Mark empty object as static


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

import java.util.Map;

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

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

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

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

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

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

    Boolean convertsBindingTargetTypeListsToMap(Class bindingTargetType);

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

    Boolean handlesBindingTargetTypeMaps(Class bindingTargetType);
}

Add handling methds to the databinder helper interface

* boolean methods for whether it handles the class to speed up searching
* handles list to map conversions as well


/**********************************************************************
Copyright (c) 2005 Erik Bengtson and others.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

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

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

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

/**********************************************************************
Copyright (c) 2005 Erik Bengtson and others.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

fix: Set default header for transaction handler


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

package tripleplay.flump;

import tripleplay.anim.Animation;

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

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

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

    protected Movie _movie;
}

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

package tripleplay.flump;

import tripleplay.anim.Animation;

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

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

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

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

    protected Movie _movie;
    protected float _lastTime;
}

Use paint() instead of setPosition() here.

setPosition() doesn't work nicely with nested movies. Should probably
fix that.


package assignment2;

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

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

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

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

		return leftHeight == rightHeight;
	}

}

package assignment2;

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

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

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

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

		return leftHeight == rightHeight;
	}

}

Enforce the invariant contraints of the parent.


package com.example.georgekaraolanis.project9_habittracker;

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

public class MainActivity extends AppCompatActivity {

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

package com.example.georgekaraolanis.project9_habittracker;

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

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

public class MainActivity extends AppCompatActivity {

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

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

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

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

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

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

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

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

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

    }

}

Add method to insert data into database

Project9: Add method to insert data into database


public class Widget {
    private String prop;

    public Widget() {
    }

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

public class Widget {
    private String prop;

    public Widget() {
    }

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

Fix throws typo in test data class.

Fix throws typo in test data class.


package devopsdistilled.operp.client.items.controllers;

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

public interface CreateItemPaneController extends SubTaskPaneController {

	void validate(Item item);

}

package devopsdistilled.operp.client.items.controllers;

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

public interface CreateItemPaneController extends SubTaskPaneController {

	void validate(Item item) throws ProductBrandPairExistsException,
			ItemNameExistsException;

}

Append throws clause to validate() declaration

OPEN - task 32: Add "Create Item" functionalities
http://github.com/DevOpsDistilled/OpERP/issues/issue/32


package de.plushnikov.intellij.plugin.inspection;

import com.intellij.codeInspection.InspectionProfileEntry;

public class BuilderInspectionTest extends LombokInspectionTest {

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

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

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

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

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

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

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

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

package de.plushnikov.intellij.plugin.inspection;

import com.intellij.codeInspection.InspectionProfileEntry;

public class BuilderInspectionTest extends LombokInspectionTest {

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

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

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

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

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

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

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

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

Remove todo because it is implemented now

GitOrigin-RevId: c3086ef8f503559f6f3c54aead0d2a526538fc5b


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

package com.teradata.tempto.internal.fulfillment.table.jdbc;

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

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

import static org.slf4j.LoggerFactory.getLogger;

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

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

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

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

package com.teradata.tempto.internal.fulfillment.table.jdbc;

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

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

import static org.slf4j.LoggerFactory.getLogger;

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

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

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

Remove LIMIT for Batch Loader

Remove LIMIT for Batch Loader

LIMIT doesn't exist for SQL Server, hence we need a different method to
get the column count for creating Batch Loader


package com.rntestproject;

import android.app.Application;

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

import com.reactnativenavigation.NavigationApplication;

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

public class MainApplication extends NavigationApplication {

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

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

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

  // };

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

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

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

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

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

package com.rntestproject;

import android.app.Application;

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

import com.reactnativenavigation.NavigationApplication;

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

public class MainApplication extends NavigationApplication {

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

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

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

Delete unused code after adding the react-native-nagivation


package br.com.alura.agenda.tasks;

import android.os.AsyncTask;

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

public class InsereAlunoTask extends AsyncTask {
    private final Aluno aluno;

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

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

package br.com.alura.agenda.tasks;

import android.os.AsyncTask;

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

public class InsereAlunoTask extends AsyncTask {
    private final Aluno aluno;

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

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

Add call to WebClient on insert student AsyncTask


/*
 * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
 * under one or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information regarding copyright
 * ownership. Camunda licenses this file to you under the Apache License,
 * Version 2.0; 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.camunda.bpm.client.interceptor;

/**
 *
Client request interceptor makes it possible to apply changes to each request before it is sent to the http server

 *
 * @author Tassilo Weidner
 */
@FunctionalInterface
public interface ClientRequestInterceptor {

  /**
   * Has been invoked before a request is sent to the http server
   *
   * @param requestContext provides the data of the request and offers methods to change it
   */
  void intercept(ClientRequestContext requestContext);

}

/*
 * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
 * under one or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information regarding copyright
 * ownership. Camunda licenses this file to you under the Apache License,
 * Version 2.0; 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.camunda.bpm.client.interceptor;

/**
 *
Client request interceptor makes it possible to apply changes to each request before it is sent to the http server

 *
 * @author Tassilo Weidner
 */
@FunctionalInterface
public interface ClientRequestInterceptor {

  /**
   * Gets invoked before a request is sent to the http server
   *
   * @param requestContext provides the data of the request and offers methods to change it
   */
  void intercept(ClientRequestContext requestContext);

}

Improve wording in a javadoc comment

chore(engine): Improve wording in a javadoc comment


package com.orientechnologies.orient.core.sql.executor;

import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import static com.orientechnologies.orient.core.sql.executor.ExecutionPlanPrintUtils.printExecutionPlan;

/**
 * @author Luigi Dell'Aquila (l.dellaquila-(at)-orientdb.com)
 */
public class OSleepStatementExecutionTest {
  static ODatabaseDocument db;

  @BeforeClass public static void beforeClass() {
    db = new ODatabaseDocumentTx("memory:OSleepStatementExecutionTest");
    db.create();
  }

  @AfterClass public static void afterClass() {
    db.close();
  }

  @Test public void testBegin() {
    long begin = System.currentTimeMillis();
    OTodoResultSet result = db.command("sleep 1000");
    Assert.assertTrue(System.currentTimeMillis() - begin > 1000);
    printExecutionPlan(null, result);
    Assert.assertNotNull(result);
    Assert.assertTrue(result.hasNext());
    OResult item = result.next();
    Assert.assertEquals("sleep", item.getProperty("operation"));
    Assert.assertFalse(result.hasNext());
  }

}

package com.orientechnologies.orient.core.sql.executor;

import com.orientechnologies.orient.core.db.document.ODatabaseDocument;
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;

import static com.orientechnologies.orient.core.sql.executor.ExecutionPlanPrintUtils.printExecutionPlan;

/**
 * @author Luigi Dell'Aquila (l.dellaquila-(at)-orientdb.com)
 */
public class OSleepStatementExecutionTest {
  static ODatabaseDocument db;

  @BeforeClass public static void beforeClass() {
    db = new ODatabaseDocumentTx("memory:OSleepStatementExecutionTest");
    db.create();
  }

  @AfterClass public static void afterClass() {
    db.close();
  }

  @Test public void testBasic() {
    long begin = System.currentTimeMillis();
    OTodoResultSet result = db.command("sleep 1000");
    Assert.assertTrue(System.currentTimeMillis() - begin >= 1000);
    printExecutionPlan(null, result);
    Assert.assertNotNull(result);
    Assert.assertTrue(result.hasNext());
    OResult item = result.next();
    Assert.assertEquals("sleep", item.getProperty("operation"));
    Assert.assertFalse(result.hasNext());
  }

}

Fix test case for SLEEP statement

Fix test case for SLEEP statement


/*
 * Copyright (C) 2015 hops.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.hops.exception;

public class UniqueKeyConstraintViolationException extends TransientStorageException{
  public UniqueKeyConstraintViolationException() {
  }

  public UniqueKeyConstraintViolationException(String message) {
    super(message);
  }

  public UniqueKeyConstraintViolationException(Throwable cause) {
    super(cause);
  }

  public UniqueKeyConstraintViolationException(String message, Throwable cause) {
    super(message, cause);
  }
}

/*
 * Copyright (C) 2015 hops.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.hops.exception;

public class UniqueKeyConstraintViolationException extends StorageException{
  public UniqueKeyConstraintViolationException() {
  }

  public UniqueKeyConstraintViolationException(String message) {
    super(message);
  }

  public UniqueKeyConstraintViolationException(Throwable cause) {
    super(cause);
  }

  public UniqueKeyConstraintViolationException(String message, Throwable cause) {
    super(message, cause);
  }
}

[HOPS-1152] Allow disabling Users/Groups Cache on the NN side


package net.wequick.example.small;

import net.wequick.small.Small;

/**
 * Created by galen on 15/11/3.
 */
public class Application extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();
        Small.setBaseUri("http://m.wequick.net/demo/");
    }
}

package net.wequick.example.small;

import net.wequick.small.Small;

/**
 * Created by galen on 15/11/3.
 */
public class Application extends android.app.Application {
    @Override
    public void onCreate() {
        super.onCreate();

        // Options
        Small.setBaseUri("http://m.wequick.net/demo/");

        // Required
        Small.preSetUp(this);
    }
}

Add Small.preSetUp to sample application


package ca.jaysoo.extradimensions;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

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

public class ExtraDimensionsPackage implements ReactPackage {

    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Arrays.asList();
    }

    @Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new ExtraDimensionsModule(reactContext));

        return modules;
    }
}

package ca.jaysoo.extradimensions;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;

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

public class ExtraDimensionsPackage implements ReactPackage {

    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Arrays.asList();
    }

    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new ExtraDimensionsModule(reactContext));

        return modules;
    }
}

Add support for RN 0.55

Add support for RN 0.55


package de.asw.courses.web2016.demo.backend.servlet.redir;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * {@code http://localhost:8080/asw2016-demo-webapp/redirect?redirect_uri=http://www.google.de }
 * @author tom
 *
 */
@WebServlet("/redirect")
public class ExternalRedirectionExampleServlet extends HttpServlet{

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		String redirectUri = req.getParameter("redirect_uri");
		resp.sendRedirect(redirectUri); // sends a 302 Temporary Redirect
	}
}

Add servlet example for external redirection


package org.gemoc.sample.tfsm.design.services;

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

import org.gemoc.gemoc_language_workbench.extensions.sirius.services.AbstractGemocAnimatorServices;

public class TFSMAnimatorServices extends AbstractGemocAnimatorServices {

	@Override
	protected List<StringCouple> getRepresentationRefreshList() {
		final List<StringCouple> res = new ArrayList<StringCouple>();

		res.add(new StringCouple("TFSM", "Animator"));

		return res;
	}

}

package org.gemoc.sample.tfsm.design.services;

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

import org.gemoc.gemoc_language_workbench.extensions.sirius.services.AbstractGemocAnimatorServices;
import org.gemoc.gemoc_modeling_workbench.ui.debug.sirius.services.AbstractGemocDebuggerServices.StringCouple;

public class TFSMAnimatorServices extends AbstractGemocAnimatorServices {

	@Override
	protected List<StringCouple> getRepresentationRefreshList() {
		final List<StringCouple> res = new ArrayList<StringCouple>();

		res.add(new StringCouple("TrafficControl","Debug"));
		res.add(new StringCouple("Semaphore","Debug"));

		res.add(new StringCouple("TrafficControl","Animation"));
		res.add(new StringCouple("Semaphore","Animation"));

		//res.add(new StringCouple("TFSM","Animator"));

		return res;
	}

}

Fix content of the map.

Fix content of the map.


package internal.org.springframework.content.rest.utils;

import org.springframework.content.commons.utils.BeanUtils;

public final class DomainObjectUtils {

    private DomainObjectUtils() {}

    public static final Object getId(Object entity) {

        if (BeanUtils.hasFieldWithAnnotation(entity, javax.persistence.Id.class)) {
            return BeanUtils.getFieldWithAnnotation(entity, javax.persistence.Id.class);
        } else if (BeanUtils.hasFieldWithAnnotation(entity, org.springframework.data.annotation.Id.class)) {
            return BeanUtils.getFieldWithAnnotation(entity, org.springframework.data.annotation.Id.class);
        }

        return null;
    }
}

package internal.org.springframework.content.rest.utils;

import org.springframework.content.commons.utils.BeanUtils;

public final class DomainObjectUtils {

    private static boolean JAVAX_PERSISTENCE_ID_CLASS_PRESENT = false;

    static {
        try {
            JAVAX_PERSISTENCE_ID_CLASS_PRESENT = DomainObjectUtils.class.getClassLoader().loadClass("javax.persistence.Id") != null;
        } catch (ClassNotFoundException e) {}
    }

    private DomainObjectUtils() {}

    public static final Object getId(Object entity) {

        if (JAVAX_PERSISTENCE_ID_CLASS_PRESENT && BeanUtils.hasFieldWithAnnotation(entity, javax.persistence.Id.class)) {
            return BeanUtils.getFieldWithAnnotation(entity, javax.persistence.Id.class);
        } else if (BeanUtils.hasFieldWithAnnotation(entity, org.springframework.data.annotation.Id.class)) {
            return BeanUtils.getFieldWithAnnotation(entity, org.springframework.data.annotation.Id.class);
        }

        return null;
    }
}

Add class check before attempting to find javax.persistence.Id annotation


package org.carlspring.strongbox.storage.repository;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import java.io.Serializable;

/**
 * @author carlspring
 */
//@XmlAccessorType(XmlAccessType.FIELD)
public abstract class CustomConfiguration
        implements Serializable
{

}

package org.carlspring.strongbox.storage.repository;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import java.io.Serializable;

/**
 * @author carlspring
 */
@XmlAccessorType(XmlAccessType.FIELD)
public abstract class CustomConfiguration
        implements Serializable
{

}

SB-710: Make it possible to specify custom configuration for repositories

Committing work in progress. This causes:

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions

Invalid @XmlElementRef : Type "class org.carlspring.strongbox.storage.repository.CustomConfiguration" or any of its subclasses are not known to this context.
	this problem is related to the following location:
		at private java.util.List org.carlspring.strongbox.storage.repository.Repository.customConfigurations
		at org.carlspring.strongbox.storage.repository.Repository
		at private java.util.List org.carlspring.strongbox.xml.RepositoryMap.entries
		at org.carlspring.strongbox.xml.RepositoryMap
		at private java.util.Map org.carlspring.strongbox.storage.Storage.repositories
		at org.carlspring.strongbox.storage.Storage
		at private java.util.List org.carlspring.strongbox.xml.StorageMap.entries
		at org.carlspring.strongbox.xml.StorageMap
		at private java.util.Map org.carlspring.strongbox.configuration.Configuration.storages
		at org.carlspring.strongbox.configuration.Configuration

	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:445)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:124)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1123)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:147)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:247)
	at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234)
	at javax.xml.bind.ContextFinder.find(ContextFinder.java:462)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
	at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
	at org.carlspring.strongbox.xml.parsers.GenericParser.getContext(GenericParser.java:199)
	at org.carlspring.strongbox.xml.parsers.GenericParser.serialize(GenericParser.java:156)
	at org.carlspring.strongbox.storage.repository.RepositoryTest.testAddRepositoryWithCustomConfiguration(RepositoryTest.java:71)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)


/*
 * Copyright 2022-2022 Asynchronous Game Query Library
 *
 * 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.ibasco.agql.protocols.valve.source.query.message;

/**
 * A special {@link SourceQueryRequest} which supports challenge based protocols
 *
 * @author Rafael Luis Ibasco
 */
abstract public class SourceQueryAuthRequest extends SourceQueryRequest {

    private Integer challenge;

    private boolean autoUpdate = true;

    protected SourceQueryAuthRequest() {
        this(null);
    }

    protected SourceQueryAuthRequest(Integer challenge) {
        this.challenge = challenge;
    }

    public Integer getChallenge() {
        return challenge;
    }

    public void setChallenge(Integer challenge) {
        this.challenge = challenge;
    }

    public boolean isAutoUpdate() {
        return autoUpdate;
    }

    public void setAutoUpdate(boolean autoUpdate) {
        this.autoUpdate = autoUpdate;
    }
}

/*
 * Copyright (c) 2022 Asynchronous Game Query Library
 *
 * 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.ibasco.agql.protocols.valve.source.query.message;

/**
 * A special {@link SourceQueryRequest} which supports challenge based protocols
 *
 * @author Rafael Luis Ibasco
 */
abstract public class SourceQueryAuthRequest extends SourceQueryRequest {

    private Integer challenge;

    private boolean autoUpdate;

    protected SourceQueryAuthRequest() {
        this(null);
    }

    protected SourceQueryAuthRequest(Integer challenge) {
        this.challenge = challenge;
        this.autoUpdate = challenge == null;
    }

    public Integer getChallenge() {
        return challenge;
    }

    public void setChallenge(Integer challenge) {
        this.challenge = challenge;
    }

    public boolean isAutoUpdate() {
        return autoUpdate;
    }

    public void setAutoUpdate(boolean autoUpdate) {
        this.autoUpdate = autoUpdate;
    }
}

Set autoUpdate to true if challenge is null

Signed-off-by: Rafael Luis Ibasco <80d89b34d8cf04643e39f61fb924744a8cfa1566@gmail.com>


package nl.idgis.publisher.provider.database.messages;

import java.io.Serializable;

import nl.idgis.publisher.domain.service.Type;

public class DatabaseColumnInfo implements Serializable {

	private static final long serialVersionUID = 8052868017910750424L;

	private final String name;

	private final String typeName;

	public DatabaseColumnInfo(String name, String typeName) {
		this.name = name;
		this.typeName = typeName;
	}

	public String getName() {
		return name;
	}

	public String getTypeName() {
		return typeName;
	}

	public Type getType() {
		switch(typeName.toUpperCase()) {
			case "NUMBER":
			case "FLOAT":
				return Type.NUMERIC;
			case "DATE":
				return Type.DATE;
			case "VARCHAR2":
			case "NVARCHAR2":
			case "NCHAR":
			case "CHAR":
			case "CLOB":
			case "NCLOB":
				return Type.TEXT;
			case "SDO_GEOMETRY":
			case "ST_GEOMETRY":
				return Type.GEOMETRY;
		}

		return null;
	}

	@Override
	public String toString() {
		return "DatabaseColumnInfo [name=" + name + ", typeName=" + typeName + "]";
	}
}

package nl.idgis.publisher.provider.database.messages;

import java.io.Serializable;

import nl.idgis.publisher.domain.service.Type;

public class DatabaseColumnInfo implements Serializable {

	private static final long serialVersionUID = 8052868017910750424L;

	private final String name;

	private final String typeName;

	public DatabaseColumnInfo(String name, String typeName) {
		this.name = name;
		this.typeName = typeName;
	}

	public String getName() {
		return name;
	}

	public String getTypeName() {
		return typeName;
	}

	public Type getType() {
		switch(typeName.toUpperCase()) {
			case "NUMBER":
			case "FLOAT":
				return Type.NUMERIC;
			case "DATE":
			case "TIMESTAMP(6)":
				return Type.DATE;
			case "VARCHAR2":
			case "NVARCHAR2":
			case "NCHAR":
			case "CHAR":
			case "CLOB":
			case "NCLOB":
				return Type.TEXT;
			case "SDO_GEOMETRY":
			case "ST_GEOMETRY":
				return Type.GEOMETRY;
		}

		return null;
	}

	@Override
	public String toString() {
		return "DatabaseColumnInfo [name=" + name + ", typeName=" + typeName + "]";
	}
}

Add timestamp to types column info

Add timestamp to types column info


/*
Copyright 2015 Anton Vorobyev
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 co.vorobyev.exitsign;

/**
 * Constant class collecting exit status codes.
 *
 * @author Anton Vorobyev
 * @since 0.1
 */
public final class ExitStatus {

    /**
     * Don't create instance of this class, it is constant class.
     */
    private ExitStatus() {
        throw new AssertionError();
    }

    /**
     * Exit code returned when execution finishes successfully
     */
    public static final int SUCCESS = 0;

    /**
     * Exit code returned when execution finishes successfully, synonym of SUCCESS
     */
    public static final int OK = 0;

    /**
     * Exit code returned when execution finishes failingly
     */
    public static final int FAILURE = 1;

    /**
     * Exit code returned when execution finishes failingly, synonym of FAILURE
     */
    public static final int BAD = 1;

}

/*
Copyright 2015 Anton Vorobyev
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 co.vorobyev.exitsign;

/**
 * Constant class collecting exit status codes.
 *
 * @author Anton Vorobyev
 * @since 0.1
 */
public final class ExitStatus {

    /**
     * Don't create instance of this class, it is constant class.
     */
    private ExitStatus() {
        throw new AssertionError();
    }

    /**
     * Exit code returned when execution finishes successfully
     */
    public static final int SUCCESS = 0;

    /**
     * Exit code returned when execution finishes failingly
     */
    public static final int FAILURE = 1;

}

Remove synonyms of primitive statuses

Remove synonyms of primitive statuses

Refers #1


package org.kohsuke.github;

import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.File;

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

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        File f = new File(System.getProperty("user.home"), ".github.kohsuke2");
        if (f.exists()) {
            // use the non-standard credential preferentially, so that developers of this library do not have
            // to clutter their event stream.
            gitHub = GitHubBuilder.fromPropertyFile(f.getPath()).build();
        } else {
            gitHub = GitHub.connect();
        }
    }

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

package org.kohsuke.github;

import org.junit.Assert;
import org.junit.Before;
import org.kohsuke.randname.RandomNameGenerator;

import java.io.File;

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

    protected GitHub gitHub;

    @Before
    public void setUp() throws Exception {
        File f = new File(System.getProperty("user.home"), ".github.kohsuke2");
        if (f.exists()) {
            // use the non-standard credential preferentially, so that developers of this library do not have
            // to clutter their event stream.
            gitHub = GitHubBuilder.fromPropertyFile(f.getPath()).withRateLimitHandler(RateLimitHandler.FAIL).build();
        } else {
            gitHub = GitHubBuilder.fromCredentials().withRateLimitHandler(RateLimitHandler.FAIL).build();
        }
    }

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

Use FAIL rate-limit handler for tests

Use FAIL rate-limit handler for tests

Should avoid possible Thread.sleep() for tests execution.


/**
 * Project RSA Algorithm.
 * Copyright Michał Szczygieł.
 * Created at Feb 25, 2014.
 */

/**
 *
 * This class is responsible for safe operations on files. This class contatin
 * the basic input/output operations.
 *
 * @author Michał Szczygieł <michal.szczygiel@wp.pl>
 *
 */
public class IOOperations {

}

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Project RSA Algorithm.
 * Copyright Michał Szczygieł.
 * Created at Feb 25, 2014.
 */

/**
 *
 * This class is responsible for safe operations on files. This class contain
 * the basic input/output operations.
 *
 * @author Michał Szczygieł <michal.szczygiel@wp.pl>
 *
 */
public class IOOperations {

    /**
     * Object to keep instance of RSA.
     */
    private RSA rsa;

    /**
     *
     * @param rsa
     */
    public IOOperations(RSA rsa) {
        this.setRsa(rsa);
    }

    /**
     * This method gets RSA instance.
     *
     * @return the RSA instance.
     */
    public RSA getRsa() {
        return rsa;
    }

    /**
     * This method reads file from given directory.
     *
     * @param filePath
     *            The directory for file.
     * @return The {@link InputStream} for read file.
     * @throws IOException
     */
    public InputStream readFile(String filePath) throws IOException {
        InputStream InputStream = null;
        File file = new File(filePath);

        if (file.exists()) {
            InputStream = new FileInputStream(file);
        }

        return InputStream;
    }

    /**
     * This method sets RSA instance.
     *
     * @param rsa
     *            The RSA to set
     */
    public void setRsa(RSA rsa) {
        this.rsa = rsa;
    }

    /**
     * This method creates output stream to write into file.
     *
     * @param filePath
     *            The directory for file location.
     * @return The {@link OutputStream} for file to write.
     * @throws FileNotFoundException
     */
    public OutputStream writeFile(String filePath) throws FileNotFoundException {
        OutputStream outputStream = null;
        File file = new File(filePath);

        if (file.exists()) {
            outputStream = new FileOutputStream(file);
        }

        return outputStream;
    }

}

Add method for read and write file

Add method for read and write file


package uk.ac.ebi.atlas.dao;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import javax.inject.Inject;
import java.util.Map;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:solrContextIT.xml", "classpath:oracleContext.xml"})
public class OrganismEnsemblDAOIT {

    @Inject
    private OrganismEnsemblDAO subject;

    @Test
    public void getOrganismEnsemblNamesMap() throws Exception {
        Map<String, String> organismEnsemblNames = subject.getEnsemblOrganismNamesMap();

        assertThat(organismEnsemblNames.get("homo sapiens"), is("ensembl"));
        assertThat(organismEnsemblNames.get("mus musculus"), is("ensembl"));
        assertThat(organismEnsemblNames.size(), is(31));
        assertThat(organismEnsemblNames.get("arabidopsis thaliana"), is("plants"));

    }

}

package uk.ac.ebi.atlas.dao;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;

import javax.inject.Inject;
import java.util.Map;

import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(locations = {"classpath:applicationContext.xml", "classpath:solrContextIT.xml", "classpath:oracleContext.xml"})
public class OrganismEnsemblDAOIT {

    @Inject
    private OrganismEnsemblDAO subject;

    @Test
    public void getOrganismEnsemblNamesMap() throws Exception {
        Map<String, String> organismEnsemblNames = subject.getEnsemblOrganismNamesMap();

        assertThat(organismEnsemblNames.get("homo sapiens"), is("ensembl"));
        assertThat(organismEnsemblNames.get("mus musculus"), is("ensembl"));
        assertThat(organismEnsemblNames.size(), is(33));
        assertThat(organismEnsemblNames.get("arabidopsis thaliana"), is("plants"));

    }

}

Modify test to pass with two new DB rows


package org.wildfly.swarm.it.transactions;

import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.wildfly.swarm.it.AbstractIntegrationTest;

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

/**
 * @author Bob McWhirter
 */
@RunWith(Arquillian.class)
public class TransactionsApplicationIT extends AbstractIntegrationTest {

    @Drone
    WebDriver browser;

    @Test
    public void testActive() {
        browser.navigate().to("http://localhost:8080/");
        assertThat(browser.getPageSource()).contains("Active");
    }

    @Test
    public void testBeginCommit() {
        browser.navigate().to("http://localhost:8080/begincommit");
        assertThat(browser.getPageSource()).contains("Transaction begun ok and committed ok" );
    }

    @Test
    public void testBeginRollback() {
        browser.navigate().to("http://localhost:8080/beginrollback");
        assertThat(browser.getPageSource()).contains("Transaction begun ok and rolled back ok" );
    }
}

package org.wildfly.swarm.it.transactions;

import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.junit.Arquillian;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.wildfly.swarm.it.AbstractIntegrationTest;

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

/**
 * @author Bob McWhirter
 * @author Ken Finnigan
 */
@RunWith(Arquillian.class)
public class TransactionsApplicationIT extends AbstractIntegrationTest {

    @Drone
    WebDriver browser;

    @Test
    public void testTransactions() {
        browser.navigate().to("http://localhost:8080/");
        assertThat(browser.getPageSource()).contains("Active");

        browser.navigate().to("http://localhost:8080/begincommit");
        assertThat(browser.getPageSource()).contains("Transaction begun ok and committed ok" );

        browser.navigate().to("http://localhost:8080/beginrollback");
        assertThat(browser.getPageSource()).contains("Transaction begun ok and rolled back ok" );
    }
}

Modify Transactions tests into a single ordered test, as ordering of separate test methods is unpredictable


public class Fibonacci {
    private static final int MAX_TERM_VALUE = 10000;

    public static void main(String[] args) {
        System.out.println("This program lists the Fibonacci sequence.");

        int prevTerm = 0;
        int term = 0;

        while (term < MAX_TERM_VALUE) {
            System.out.println(term);

            if (term == 0) {
                term++;

            } else {
                term = prevTerm + term;
                prevTerm = term - prevTerm;
            }
        }
    }
}

public class Fibonacci {
    private static final int MAX_TERM_VALUE = 10000;

    public static void main(String[] args) {
        System.out.println("This program lists the Fibonacci sequence.");

        int term1 = 0;
        int term2 = 1;

        while (term1 < MAX_TERM_VALUE) {
            System.out.println(term1);

            term2 = term1 + term2;
            term1 = term2 - term1;
        }
    }
}

Refactor section assigment 2 problem 1

Refactor section assigment 2 problem 1


/**
 *
OData JPA Processor API Library - Mapping Model

 * The JPA EDM Mapping model (XML document) is represented as JAXB annotated Java Classes.
 *
 * @author SAP AG
 */
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.sap.com/core/odata/processor/api/jpa/model/mapping", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package com.sap.core.odata.processor.api.jpa.model.mapping;

Package Info for Mapping Model

Package Info for Mapping Model

Change-Id: Iff30ddccf0922da06178016e5a8ba842b6a02574
Signed-off-by: Chandan V A <bd0fd086b01161f47f837a6342dc5514038ba6c8@sap.com>


/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2012, Red Hat, Inc., and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.jboss.as.test.integration.sar.injection.pojos;

/**
 * @author Richard Opalka
 */
interface AMBean {

    int getCount();

    boolean getStartCalled();

    boolean getCreateCalled();

}

/*
 * JBoss, Home of Professional Open Source.
 * Copyright 2012, Red Hat, Inc., and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.jboss.as.test.integration.sar.injection.pojos;

/**
 * @author Richard Opalka
 */
public interface AMBean {

    int getCount();

    boolean getStartCalled();

    boolean getCreateCalled();

}

Fix Mbean interface must be public, fails validation on JDK8


/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.server.push.analytics.formatting;

import com.opengamma.core.historicaltimeseries.HistoricalTimeSeries;
import com.opengamma.engine.value.ValueSpecification;

/**
 *
 */
/* package */ class HistoricalTimeSeriesFormatter extends AbstractFormatter<HistoricalTimeSeries> {

  private final LocalDateDoubleTimeSeriesFormatter _delegate = new LocalDateDoubleTimeSeriesFormatter();

  /* package */ HistoricalTimeSeriesFormatter() {
    super(HistoricalTimeSeries.class);
  }

  @Override
  public Object formatCell(HistoricalTimeSeries value, ValueSpecification valueSpec) {
    return _delegate.formatCell(value.getTimeSeries(), valueSpec);
  }

  @Override
  public Object format(HistoricalTimeSeries value, ValueSpecification valueSpec, Format format) {
    return super.format(value, valueSpec, format);
  }

  @Override
  public DataType getDataType() {
    return DataType.TIME_SERIES;
  }
}

/**
 * Copyright (C) 2012 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.web.server.push.analytics.formatting;

import com.opengamma.core.historicaltimeseries.HistoricalTimeSeries;
import com.opengamma.engine.value.ValueSpecification;

/**
 *
 */
/* package */ class HistoricalTimeSeriesFormatter extends AbstractFormatter<HistoricalTimeSeries> {

  private final LocalDateDoubleTimeSeriesFormatter _delegate = new LocalDateDoubleTimeSeriesFormatter();

  /* package */ HistoricalTimeSeriesFormatter() {
    super(HistoricalTimeSeries.class);
  }

  @Override
  public Object formatCell(HistoricalTimeSeries value, ValueSpecification valueSpec) {
    return _delegate.formatCell(value.getTimeSeries(), valueSpec);
  }

  @Override
  public Object format(HistoricalTimeSeries value, ValueSpecification valueSpec, Format format) {
    return _delegate.format(value.getTimeSeries(), valueSpec, format);
  }

  @Override
  public DataType getDataType() {
    return DataType.TIME_SERIES;
  }
}

Tweak to time series formatting

[PLAT-2785] Tweak to time series formatting