package ca.corefacility.bioinformatics.irida.web.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.SessionCreationPolicy;

import ca.corefacility.bioinformatics.irida.config.IridaApiSecurityConfig;

@Configuration
@EnableWebSecurity
@Import(IridaApiSecurityConfig.class)
public class IridaRestApiSecurityConfig extends WebSecurityConfigurerAdapter {
	@Autowired
	private AuthenticationManager authenticationManager;

	@Override
	public void configure(HttpSecurity http) throws Exception {
		http.authorizeUrls().anyRequest().fullyAuthenticated().and().httpBasic().and().sessionManagement()
				.sessionCreationPolicy(SessionCreationPolicy.stateless);
	}

	@Override
	protected void registerAuthentication(AuthenticationManagerBuilder auth) {
		auth.parentAuthenticationManager(authenticationManager);
	}
}

package ca.corefacility.bioinformatics.irida.web.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configurers.SessionCreationPolicy;

import ca.corefacility.bioinformatics.irida.config.IridaApiSecurityConfig;

@Configuration
@EnableWebSecurity
// DO NOT WANT. For some reason, even though we import the
// IridaApiSecurityConfig below (that already has @EnableGlobalMethodSecurity),
// we must add the annotation again to this configuration class. That doesn't
// allow us to turn method security on in the API project, then use the API
// project configuration elsewhere.
@EnableGlobalMethodSecurity(prePostEnabled = true)
@Import(IridaApiSecurityConfig.class)
public class IridaRestApiSecurityConfig extends WebSecurityConfigurerAdapter {
	@Autowired
	private AuthenticationManager authenticationManager;

	@Override
	public void configure(HttpSecurity http) throws Exception {
		http.authorizeUrls().anyRequest().fullyAuthenticated().and().httpBasic().and().sessionManagement()
				.sessionCreationPolicy(SessionCreationPolicy.stateless);
	}
}

Enable method-level security by annotating the configuration class in *this* project. Works (for now), but not an ideal solution.


/**
 * Copyright (c) 2001, SAIC, its vendors, and suppliers. ALL RIGHTS RESERVED.
 *
 * @author: Johnita Beasley
 * @date: July 20, 2005
 *
 * Revision History
 * ----------------
 *
 * 2005 July 21    Johnita Beasley    Created and successfully compiled.
 * 2005 August 18  Sumeet Rajput      Integrated with caMOD codebase
 *
 */
package gov.nih.nci.camod.service;

import gov.nih.nci.camod.domain.Curateable;

/**
 * This interface describes a realized/implementing CurationManager.
 */
public interface CurationManager {
    public String getDefaultState();
    public Curateable changeState(Curateable inCuratableObject, String inEvent);
}

/**
 * Copyright (c) 2001, SAIC, its vendors, and suppliers. ALL RIGHTS RESERVED.
 *
 * @author: Johnita Beasley
 * @date: July 20, 2005
 *
 * Revision History
 * ----------------
 *
 * 2005 July 21    Johnita Beasley    Created and successfully compiled.
 * 2005 August 18  Sumeet Rajput      Integrated with caMOD codebase
 *
 */
package gov.nih.nci.camod.service;

import gov.nih.nci.camod.domain.Curateable;

/**
 * This interface describes a realized/implementing CurationManager.
 */
public interface CurationManager {
    public String getDefaultState();
    public Curateable changeState(Curateable inCuratableObject, String inEvent);
    public void applyActionsForState(Curateable inCuratableObject);
}

Change to process flow for curation model

SVN-Revision: 271


package org.skywalking.apm.agent.core.remote;

/**
 * @author wusheng
 */
public class GRPCStreamServiceStatus {
    private volatile boolean status;

    public GRPCStreamServiceStatus(boolean status) {
        this.status = status;
    }

    public boolean isStatus() {
        return status;
    }

    public void finished() {
        this.status = true;
    }

    /**
     *
     * @param maxTimeout max wait time, milliseconds.
     */
    public void wait4Finish(long maxTimeout) {
        long time = 0;
        while (status == false) {
            if (time > maxTimeout) {
                break;
            }
            try2Sleep(50);
            time += 50;
        }
    }

    /**
     * Try to sleep, and ignore the {@link InterruptedException}
     *
     * @param millis the length of time to sleep in milliseconds
     */
    private void try2Sleep(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {

        }
    }
}

package org.skywalking.apm.agent.core.remote;

/**
 * @author wusheng
 */
public class GRPCStreamServiceStatus {
    private volatile boolean status;

    public GRPCStreamServiceStatus(boolean status) {
        this.status = status;
    }

    public boolean isStatus() {
        return status;
    }

    public void finished() {
        this.status = true;
    }

    /**
     * @param maxTimeout max wait time, milliseconds.
     */
    public void wait4Finish(long maxTimeout) {
        long time = 0;
        while (status == false) {
            if (time > maxTimeout) {
                break;
            }
            try2Sleep(5);
            time += 5;
        }
    }

    /**
     * Try to sleep, and ignore the {@link InterruptedException}
     *
     * @param millis the length of time to sleep in milliseconds
     */
    private void try2Sleep(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {

        }
    }
}

Set the wait time shorter than before.

Set the wait time shorter than before.


package org.spoofax.jsglr2.testset;

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

import org.spoofax.jsglr2.testset.testinput.IncrementalStringInput;

public class TestSetIncrementalInput extends TestSetInput<String[], IncrementalStringInput> {

    // Directory in the org.spoofax.jsglr2.integration/src/main/resources/samples directory, containing files %d.in
    public final String directory;

    public TestSetIncrementalInput(String directory) {
        super(Type.INCREMENTAL);

        this.directory = directory;
    }

    @Override protected IncrementalStringInput getInput(String filename, String[] input) {
        return new IncrementalStringInput(filename, input);
    }

    @Override public List<IncrementalStringInput> getInputs() throws IOException {
        List<String> inputs = new ArrayList<>();
        for(int i = 0;; i++) {
            try {
                inputs.add(getFileAsString(directory + "/" + i + ".in"));
            } catch(NullPointerException | IOException ignored) {
                break;
            }
        }
        return Collections.singletonList(getInput(directory, inputs.toArray(new String[0])));
    }
}

package org.spoofax.jsglr2.testset;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.spoofax.jsglr2.testset.testinput.IncrementalStringInput;

public class TestSetIncrementalInput extends TestSetInput<String[], IncrementalStringInput> {

    // Directory in the org.spoofax.jsglr2.integration/src/main/resources/samples directory, containing files %d.in
    public final String directory;

    public TestSetIncrementalInput(String directory) {
        super(Type.INCREMENTAL);

        this.directory = directory;
    }

    @Override protected IncrementalStringInput getInput(String filename, String[] input) {
        return new IncrementalStringInput(filename, input);
    }

    @Override public List<IncrementalStringInput> getInputs() throws IOException {
        List<String> inputs = new ArrayList<>();
        for(int i = 0;; i++) {
            try {
                inputs.add(getFileAsString(
                    directory + (directory.endsWith(File.separator) ? "" : File.separator) + i + ".in"));
            } catch(NullPointerException | IOException ignored) {
                break;
            }
        }
        return Collections.singletonList(getInput(directory, inputs.toArray(new String[0])));
    }
}

Fix duplicate trailing directory separator


package io.quarkus.micrometer.runtime.config;

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;

@ConfigGroup
public class PrometheusConfigGroup implements MicrometerConfig.CapabilityEnabled {
    /**
     * Support for export to Prometheus.
     *

     * Support for Prometheus will be enabled if Micrometer
     * support is enabled, the PrometheusMeterRegistry is on the classpath
     * and either this value is true, or this value is unset and
     * {@code quarkus.micrometer.registry-enabled-default} is true.
     */
    @ConfigItem
    public Optional<Boolean> enabled;

    /**
     * The path for the prometheus metrics endpoint (produces text/plain).
     * The default value is {@code metrics}.
     */
    @ConfigItem(defaultValue = "metrics")
    public String path;

    /**
     * By default, this extension will create a Prometheus MeterRegistry instance.
     *

     * Use this attribute to veto the creation of the default Prometheus MeterRegistry.
     */
    @ConfigItem(defaultValue = "true")
    public boolean defaultRegistry;

    @Override
    public Optional<Boolean> getEnabled() {
        return enabled;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName()
                + "{path='" + path
                + ",enabled=" + enabled
                + ",defaultRegistry=" + defaultRegistry
                + '}';
    }
}

package io.quarkus.micrometer.runtime.config;

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;

@ConfigGroup
public class PrometheusConfigGroup implements MicrometerConfig.CapabilityEnabled {
    /**
     * Support for export to Prometheus.
     *

     * Support for Prometheus will be enabled if Micrometer
     * support is enabled, the PrometheusMeterRegistry is on the classpath
     * and either this value is true, or this value is unset and
     * {@code quarkus.micrometer.registry-enabled-default} is true.
     */
    @ConfigItem
    public Optional<Boolean> enabled;

    /**
     * The path for the prometheus metrics endpoint (produces text/plain). The default value is
     * `metrics` and is resolved relative to the non-application endpoint (`q`), e.g.
     * `${quarkus.http.root-path}/${quarkus.http.non-application-root-path}/metrics`.
     * If an absolute path is specified (`/metrics`), the prometheus endpoint will be served
     * from the configured path.
     *
     * @asciidoclet
     */
    @ConfigItem(defaultValue = "metrics")
    public String path;

    /**
     * By default, this extension will create a Prometheus MeterRegistry instance.
     *

     * Use this attribute to veto the creation of the default Prometheus MeterRegistry.
     */
    @ConfigItem(defaultValue = "true")
    public boolean defaultRegistry;

    @Override
    public Optional<Boolean> getEnabled() {
        return enabled;
    }

    @Override
    public String toString() {
        return this.getClass().getSimpleName()
                + "{path='" + path
                + ",enabled=" + enabled
                + ",defaultRegistry=" + defaultRegistry
                + '}';
    }
}

Update docs for prometheus path config

Update docs for prometheus path config


package com.hypirion.beckon;

import sun.misc.Signal;
import sun.misc.SignalHandler;

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

public class SignalRegistererHelper {

    private static Map<String, SignalHandler> originalHandlers =
        new HashMap<String, SignalHandler>();

    /**
     * Registers the new list of functions to the signal name, and returns the
     * old SignalHandler.
     */
    private static SignalHandler reset_BANG_(String signame, List fns) {
        Signal sig = new Signal(signame);
        SignalFolder folder = new SignalFolder(fns);
        SignalHandler oldHandler = Signal.handle(sig, folder);
        return oldHandler;
    }

    static synchronized void register(String signame, List fns) {
        SignalHandler old = reset_BANG_(signame, fns);
        if (!originalHandlers.containsKey(signame)) {
            originalHandlers.put(signame, old);
        }
    }
}

package com.hypirion.beckon;

import sun.misc.Signal;
import sun.misc.SignalHandler;

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

public class SignalRegistererHelper {

    /**
     * A mapping of the signal name to the original signal handler.
     */
    private final static Map<String, SignalHandler> originalHandlers =
        new HashMap<String, SignalHandler>();

    /**
     * Registers the new list of functions to the signal name, and returns the
     * old SignalHandler.
     */
    private static SignalHandler reset_BANG_(String signame, List fns) {
        Signal sig = new Signal(signame);
        SignalFolder folder = new SignalFolder(fns);
        SignalHandler oldHandler = Signal.handle(sig, folder);
        return oldHandler;
    }

    /**
     * Registers the signal name to a List of Callables, where each callable
     * returns an Object. The signal handling is performed as follows: The first
     * callable is called, and if it returns a value equal to false
     * or null it will stop. Otherwise it will repeat on the next
     * callable, until there are no more left.
     *
     * @param signame the signal name to register this list of callables on.
     * @param fns the list of Callables to (potentially) call.
     */
    static synchronized void register(String signame, List fns) {
        SignalHandler old = reset_BANG_(signame, fns);
        if (!originalHandlers.containsKey(signame)) {
            originalHandlers.put(signame, old);
        }
    }
}

Document and synchronize register method.


package com.documents4j.ws.endpoint;

import com.documents4j.api.DocumentType;
import com.documents4j.job.MockConversion;
import com.documents4j.ws.application.WebConverterTestConfiguration;
import org.junit.Before;
import org.junit.Test;

import javax.ws.rs.core.Response;

import static org.junit.Assert.*;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;

public class MonitoringHealthCreateDocumentResourceTest {

    @Test
    public void testHealthCreateDocument() {
        final MonitoringHealthCreateDocumentResource monitoringHealthCreateDocumentResource = spy(new MonitoringHealthCreateDocumentResource());
        doReturn(MockConversion.OK.toInputStream("")).when(monitoringHealthCreateDocumentResource).getTestStream();
        monitoringHealthCreateDocumentResource.webConverterConfiguration = new WebConverterTestConfiguration(
                true, 2000L, DocumentType.DOCX, DocumentType.PDF
        );
        final Response response = monitoringHealthCreateDocumentResource.serverInformation();
        assertEquals(200, response.getStatus());
    }
}

Add missing new line at end of file

Add missing new line at end of file


package com.worldcretornica.plotme_abstractgenerator.bukkit;

public class BukkitBlockRepresentation {

    private final short id;
    private final byte data;

    public BukkitBlockRepresentation(short id, byte value) {
        this.id = id;
        this.data = value;
    }

    public BukkitBlockRepresentation(String idValue) {
        this(getBlockId(idValue), getBlockData(idValue));
    }

    public static byte getBlockId(String idValue) throws NumberFormatException {
        if (idValue.indexOf(":") > 0) {
            return Byte.parseByte(idValue.split(":")[0]);
        } else {
            return Byte.parseByte(idValue);
        }
    }

    public static byte getBlockData(String idValue) throws NumberFormatException {
        if (idValue.indexOf(":") > 0) {
            return Byte.parseByte(idValue.split(":")[1]);
        } else {
            return 0;
        }
    }

    public short getId() {
        return id;
    }

    public byte getData() {
        return data;
    }

}

package com.worldcretornica.plotme_abstractgenerator.bukkit;

public class BukkitBlockRepresentation {

    private final short id;
    private final byte data;

    public BukkitBlockRepresentation(short id, byte value) {
        this.id = id;
        this.data = value;
    }

    public BukkitBlockRepresentation(String idValue) {
        this(getBlockId(idValue), getBlockData(idValue));
    }

    public static short getBlockId(String idValue) throws NumberFormatException {
        if (idValue.indexOf(":") > 0) {
            return Short.parseShort(idValue.split(":")[0]);
        } else {
            return Short.parseShort(idValue);
        }
    }

    public static byte getBlockData(String idValue) throws NumberFormatException {
        if (idValue.indexOf(":") > 0) {
            return Byte.parseByte(idValue.split(":")[1]);
        } else {
            return 0;
        }
    }

    public short getId() {
        return id;
    }

    public byte getData() {
        return data;
    }

}

Use short instead of bytes for block id

Use short instead of bytes for block id


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

import java.util.List;

public class Table extends AbstractTable {

	public Table() {
		super();
	}

    /**
     * for now the method isn't implemented. I still need to decide how
     * it should be implemented.
     */
    public String[][] getTableData(List data) {
        return null;
    }
}

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

import java.util.List;

public class Table extends AbstractTable {

	public Table() {
		super();
	}

    /**
     * for now the method isn't implemented. I still need to decide how
     * it should be implemented.
     */
    public String[][] getTableData(List data) {
        return new String[0][0];
    }
}

Return empty array rather than null

Return empty array rather than null

git-svn-id: https://svn.apache.org/repos/asf/jakarta/jmeter/branches/rel-2-1@330255 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: f33744d43f181e5c7fa384c4a2fbafeb8deb198e


package com.gu.conf;

import org.junit.Test;

import java.io.IOException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;

public class LocalHostResolverTest {

	LocalHostResolver resolver = new LocalHostResolver();

    @Test
	public void shouldNotGetEmptyDomain() throws IOException {
		assertThat(resolver.getLocalHostDomain(), notNullValue());
	}

    @Test
	public void shouldNotGetLocalHostForDomain() throws IOException {
		assertThat(resolver.getLocalHostDomain(), not("localhost"));
	}

    @Test
	public void shouldGetDomainWithAtLeastOneDot() throws IOException {
		assertThat(resolver.getLocalHostDomain().contains("."), is(true));
	}
}

package com.gu.conf;

import org.junit.Test;

import java.io.IOException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;

public class LocalHostResolverTest {

	LocalHostResolver resolver = new LocalHostResolver();

    @Test
	public void shouldNotGetEmptyDomain() throws IOException {
		assertThat(resolver.getLocalHostDomain(), notNullValue());
	}

    @Test
	public void shouldNotGetLocalHostForDomain() throws IOException {
		assertThat(resolver.getLocalHostDomain(), not("localhost"));
	}

//    @Test
//	public void shouldGetDomainWithAtLeastOneDot() throws IOException {
//		assertThat(resolver.getLocalHostDomain().contains("."), is(true));
//	}
}

Remove broken test for now.

[Daithi] Remove broken test for now.


/**
 * Copyright 2015 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.devtools.cdbg.debuglets.java;

/**
 * Defines the version of the Java Cloud Debugger agent.
 */
public final class GcpDebugletVersion {
  /**
   * Major version of the debugger.

   * All agents of the same major version are compatible with each other. In other words an
   * application can mix different agents with the same major version within the same debuggee.
   */
  public static final int MAJOR_VERSION = 2;

  /**
   * Minor version of the agent.
   */
  public static final int MINOR_VERSION = 15;

  /**
   * Debugger agent version string in the format of MAJOR.MINOR.
   */
  public static final String VERSION = String.format("%d.%d", MAJOR_VERSION, MINOR_VERSION);

  /**
   * Main function to print the version string.
   */
  public static void main(String[] args) {
    System.out.println(VERSION);
  }
}

/**
 * Copyright 2015 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.devtools.cdbg.debuglets.java;

/**
 * Defines the version of the Java Cloud Debugger agent.
 */
public final class GcpDebugletVersion {
  /**
   * Major version of the debugger.

   * All agents of the same major version are compatible with each other. In other words an
   * application can mix different agents with the same major version within the same debuggee.
   */
  public static final int MAJOR_VERSION = 2;

  /**
   * Minor version of the agent.
   */
  public static final int MINOR_VERSION = 16;

  /**
   * Debugger agent version string in the format of MAJOR.MINOR.
   */
  public static final String VERSION = String.format("%d.%d", MAJOR_VERSION, MINOR_VERSION);

  /**
   * Main function to print the version string.
   */
  public static void main(String[] args) {
    System.out.println(VERSION);
  }
}

Increment Java Cloud Debugger version to 2.16

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=174711041


/*
 * 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.trino.tests.product.launcher.env;

public final class EnvironmentDefaults
{
    public static final String DOCKER_IMAGES_VERSION = "46";
    public static final String HADOOP_BASE_IMAGE = "ghcr.io/trinodb/testing/hdp2.6-hive";
    public static final String HADOOP_IMAGES_VERSION = DOCKER_IMAGES_VERSION;
    public static final String TEMPTO_ENVIRONMENT_CONFIG = "/dev/null";

    private EnvironmentDefaults() {}
}

/*
 * 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.trino.tests.product.launcher.env;

public final class EnvironmentDefaults
{
    public static final String DOCKER_IMAGES_VERSION = "47";
    public static final String HADOOP_BASE_IMAGE = "ghcr.io/trinodb/testing/hdp2.6-hive";
    public static final String HADOOP_IMAGES_VERSION = DOCKER_IMAGES_VERSION;
    public static final String TEMPTO_ENVIRONMENT_CONFIG = "/dev/null";

    private EnvironmentDefaults() {}
}

Update docker images to version 47

Update docker images to version 47


package org.yeastrc.xlink.base.config_system_table_common_access;

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

public class ConfigSystemsKeysSharedConstants {

	//////   Any plain text inputs need to be added to textConfigKeys in the "static {}" at the bottom

	////  Proxl XML File Import Set Up keys

	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

	//   Lists of config keys for validation on save

	public static final Set<String> textConfigKeys = new HashSet<>();

	static {
		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );

	}
}

package org.yeastrc.xlink.base.config_system_table_common_access;

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

public class ConfigSystemsKeysSharedConstants {

	//////   Any plain text inputs need to be added to textConfigKeys in the "static {}" at the bottom

	////  Proxl XML File Import Set Up keys

	public static final String PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY = "proxl_xml_file_import_temp_dir";

	public static final String SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY = "scan_file_import_allowed_via_web_submit";

	//   Lists of config keys for validation on save

	public static final Set<String> textConfigKeys = new HashSet<>();

	static {
		textConfigKeys.add( PROXL_XML_FILE_IMPORT_TEMP_DIR_KEY );
		textConfigKeys.add( SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY );

	}
}

Add Constant for config: SCAN_FILE_IMPORT_ALLOWED_VIA_WEB_SUBMIT_KEY


package uk.ac.ebi.quickgo.annotation.search;

import uk.ac.ebi.quickgo.rest.search.query.FieldQuery;
import uk.ac.ebi.quickgo.rest.search.query.QueryRequest;
import uk.ac.ebi.quickgo.rest.search.query.SolrQueryConverter;

import org.apache.solr.client.solrj.SolrQuery;

/**
 * @author Tony Wardell
 * Date: 28/04/2016
 * Time: 13:20
 * Created with IntelliJ IDEA.
 */
public class AnnotationSolrQueryConverter extends SolrQueryConverter{

    public AnnotationSolrQueryConverter(String requestHandler) {
        super(requestHandler);
    }

    @Override public String visit(FieldQuery query) {
        return "(" + query.field() + SOLR_FIELD_SEPARATOR + query.value() + ")";
    }

    /**
     * For annotation filtering (and we use fq only for annotations) don't set a query String
     * @param request
     * @param solrQuery
     */
    protected void assignQuery(QueryRequest request, SolrQuery solrQuery) {
        return;
    }

}

package uk.ac.ebi.quickgo.annotation.search;

import uk.ac.ebi.quickgo.rest.search.query.FieldQuery;
import uk.ac.ebi.quickgo.rest.search.query.QueryRequest;
import uk.ac.ebi.quickgo.rest.search.query.SolrQueryConverter;

import org.apache.solr.client.solrj.SolrQuery;

/**
 *
 * Specialized SolrQueryConverter. Doesn't assign a parameter to query (q) on
 * the SolrQuery instance.
 *
 * @author Tony Wardell
 * Date: 28/04/2016
 * Time: 13:20
 * Created with IntelliJ IDEA.
 */
public class AnnotationSolrQueryConverter extends SolrQueryConverter{

    public AnnotationSolrQueryConverter(String requestHandler) {
        super(requestHandler);
    }

    /**
     * For annotation filtering (and we use fq only for annotations) don't set a query String
     * @param request
     * @param solrQuery
     */
    protected void assignQuery(QueryRequest request, SolrQuery solrQuery) {
        return;
    }

}

Add javadoc. Override of visit method no longer required.


package nl.fontys.sofa.limo.view.node.property.editor;

import com.sksamuel.gaia.Country;
import java.awt.Component;
import java.beans.PropertyEditorSupport;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import nl.fontys.sofa.limo.domain.component.hub.Location;
import org.openide.nodes.PropertyEditorRegistration;

/**
 *
 * @author Dominik Kaisers <d.kaisers@student.fontys.nl>
 */
@PropertyEditorRegistration(targetType = Country.class)
public class CountryPopertyEditor extends PropertyEditorSupport{

    private HashMap<String, Country> countriesByName = new HashMap<>();

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        setValue(countriesByName.get(text));
    }

    @Override
    public String getAsText() {
        if (getValue() == null)
            return "";

        return ((Country) getValue()).getName();
    }

    @Override
    public String[] getTags() {
        String[] names = new String[Country.getAll().size()];
        List<Country> selectable = Country.getAll();
        countriesByName.clear();
        for (Country country : selectable) {
            names[selectable.indexOf(country)] = country.getName();
            countriesByName.put(country.getName(), country);
        }
        return names;
    }

}

package nl.fontys.sofa.limo.view.node.property.editor;

import com.sksamuel.gaia.Country;
import java.beans.PropertyEditorSupport;
import java.util.HashMap;
import java.util.List;
import org.openide.nodes.PropertyEditorRegistration;

/**
 *
 * @author Dominik Kaisers <d.kaisers@student.fontys.nl>
 */
@PropertyEditorRegistration(targetType = Country.class)
public class CountryPopertyEditor extends PropertyEditorSupport{

    private HashMap<String, Country> countriesByName = new HashMap<>();

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        if (text.equals("-"))
            setValue(null);

        setValue(countriesByName.get(text));
    }

    @Override
    public String getAsText() {
        if (getValue() == null)
            return "-";

        return ((Country) getValue()).getName();
    }

    @Override
    public String[] getTags() {
        String[] names = new String[Country.getAll().size() + 1];
        List<Country> selectable = Country.getAll();
        countriesByName.clear();
        names[0] = "-";
        for (Country country : selectable) {
            names[selectable.indexOf(country) + 1] = country.getName();
            countriesByName.put(country.getName(), country);
        }
        return names;
    }

}

Fix for "no country select"

Fix for "no country select"


package com.centurylink.cloud.sdk.servers.services;

import com.centurylink.cloud.sdk.servers.AbstractServersSdkTest;
import com.centurylink.cloud.sdk.servers.client.domain.server.metadata.ServerMetadata;
import com.centurylink.cloud.sdk.servers.services.domain.Response;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Inject;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterTest;
import org.testng.annotations.Test;

import static com.centurylink.cloud.sdk.servers.services.TestServerSupport.anyServerConfig;

/**
 * @author ilya.drabenia
 */
@Test(groups = "LongRunning")
public class CreateServerAsyncTest extends AbstractServersSdkTest {

    @Inject
    ServerService serverService;

    Response<ServerMetadata> createServerResponse;

    @Test
    public void testCreateServerAsync() throws Exception {
        ListenableFuture<Response<ServerMetadata>> future =
                serverService.createAsync(anyServerConfig().name("CSAC"));

        createServerResponse = future.get();

        assert createServerResponse.getResult().getId() != null;
    }

    @AfterMethod
    public void deleteTestServer() {
        createServerResponse
                .waitUntilComplete();

        serverService
                .delete(createServerResponse.getResult().asRefById())
                .waitUntilComplete();
    }

}

Improve integration test tear down functionality


/*
 * Copyright © 2012 Sebastian Hoß <mail@shoss.de>
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */
package com.github.sebhoss.contract.verifier.impl;

import ch.qos.cal10n.BaseName;
import ch.qos.cal10n.Locale;
import ch.qos.cal10n.LocaleData;

import com.github.sebhoss.common.annotation.CompilerWarnings;
import com.github.sebhoss.contract.verifier.ContractExceptionFactory;

/**
 * Enumeration of errors of a {@link ContractExceptionFactory}
 */
@BaseName("errors")
@LocaleData({ @Locale("en") })
@SuppressWarnings(CompilerWarnings.JAVADOC)
public enum ExceptionFactoryErrors {

    TYPE_IS_ABSTRACT,

    NO_ACCESSIBLE_CONSTRUCTOR,

    CONSTRUCTOR_EXCEPTION,

    NO_STRING_CONSTRUCTOR,

    NO_DEFAULT_CONSTRUCTOR;

}

/*
 * Copyright © 2012 Sebastian Hoß <mail@shoss.de>
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */
package com.github.sebhoss.contract.verifier.impl;

import ch.qos.cal10n.BaseName;
import ch.qos.cal10n.Locale;
import ch.qos.cal10n.LocaleData;

import com.github.sebhoss.common.annotation.CompilerWarnings;
import com.github.sebhoss.contract.verifier.ContractExceptionFactory;

/**
 * Enumeration of errors of a {@link ContractExceptionFactory}
 */
@BaseName("errors")
@LocaleData(defaultCharset = "UTF8", value = { @Locale("en") })
@SuppressWarnings(CompilerWarnings.JAVADOC)
public enum ExceptionFactoryErrors {

    TYPE_IS_ABSTRACT,

    NO_ACCESSIBLE_CONSTRUCTOR,

    CONSTRUCTOR_EXCEPTION,

    NO_STRING_CONSTRUCTOR,

    NO_DEFAULT_CONSTRUCTOR;

}

Set default charset to UTF-8

Set default charset to UTF-8

Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de>


package org.jboss.as.test.clustering.twoclusters.bean.forwarding;

import org.jboss.as.test.clustering.twoclusters.bean.stateful.RemoteStatefulSB;
import org.jboss.ejb3.annotation.Clustered;

import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

@Stateful
@Clustered
@TransactionAttribute(TransactionAttributeType.REQUIRED) // this is the default anyway
public class ForwardingStatefulSBImpl extends AbstractForwardingStatefulSBImpl implements RemoteStatefulSB {
}

package org.jboss.as.test.clustering.twoclusters.bean.forwarding;

import org.jboss.as.test.clustering.twoclusters.bean.stateful.RemoteStatefulSB;
import org.jboss.ejb3.annotation.Clustered;

import javax.ejb.Stateful;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

@Stateful
@Clustered
@TransactionAttribute(TransactionAttributeType.REQUIRED) // this is the default anyway
public class ForwardingStatefulSBImpl extends AbstractForwardingStatefulSBImpl implements RemoteStatefulSB {

    // we need to override these methods so that the TransactionAttribute gets processed on this class!

    @Override
    public int getSerial()
    {
        return super.getSerial();
    }

    @Override
    public int getSerialAndIncrement()
    {
        return super.getSerialAndIncrement();
    }

    @Override
    public byte[] getCargo()
    {
        return super.getCargo();
    }
}

[WFLY-4853] Add in overrides for methods otherwise TransactionAttribute changes don't get applied.


/*
 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.controller.cluster.akka.osgi.impl;

import akka.actor.Props;
import org.opendaylight.controller.cluster.common.actor.QuarantinedMonitorActor;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class QuarantinedMonitorActorPropsFactory {
    private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);

    private QuarantinedMonitorActorPropsFactory() {

    }

    public static Props createProps(final BundleContext bundleContext) {
        return QuarantinedMonitorActor.props(() -> {
            // restart the entire karaf container
            LOG.warn("Restarting karaf container");
            System.setProperty("karaf.restart.jvm", "true");
            bundleContext.getBundle(0).stop();
        });
    }
}

/*
 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.controller.cluster.akka.osgi.impl;

import akka.actor.Props;
import org.opendaylight.controller.cluster.common.actor.QuarantinedMonitorActor;
import org.osgi.framework.BundleContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class QuarantinedMonitorActorPropsFactory {
    private static final Logger LOG = LoggerFactory.getLogger(QuarantinedMonitorActorPropsFactory.class);

    private QuarantinedMonitorActorPropsFactory() {

    }

    public static Props createProps(final BundleContext bundleContext) {
        return QuarantinedMonitorActor.props(() -> {
            // restart the entire karaf container
            LOG.warn("Restarting karaf container");
            System.setProperty("karaf.restart.jvm", "true");
            System.setProperty("karaf.restart", "true");
            bundleContext.getBundle(0).stop();
        });
    }
}

Update procedure to restart controller on quarantined condition.

There was a behavior change in Karaf [0] because of which restarting
the container now requires the system property karaf.restart to be
set to true in addition to karaf.restart.jvm property. Update
controller restart logic on quarantined condition for the same.

[0] https://issues.apache.org/jira/browse/KARAF-5179

Change-Id: I7b93eb87f53870efea70f2c9a9b82eeca783aa0b
Signed-off-by: Ajay Lele <0c60352b9c35f386562c10f2260731d7efbca4a6@gmail.com>


package edu.kit.ipd.sdq.vitruvius.applications.pcmjava.linkingintegration;

import java.util.List;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;

import edu.kit.ipd.sdq.vitruvius.framework.correspondence.CorrespondenceModel;

public interface CorrespondenceTypeDeciding {

    String ID = "edu.kit.ipd.sdq.vitruvius.codeintegration.correspondencetypedeciding";

    default boolean useIntegratedCorrespondence(final EObject objectA, final EObject objectB,
            final CorrespondenceModel cInstance, final List<Resource> jaMoppResources) {
        return true;
    }
}

package edu.kit.ipd.sdq.vitruvius.applications.pcmjava.linkingintegration;

import java.util.List;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;

import edu.kit.ipd.sdq.vitruvius.framework.correspondence.CorrespondenceModel;

public interface CorrespondenceTypeDeciding {

    String ID = "edu.kit.ipd.sdq.vitruvius.applications.pcmjava.linkingintegration.correspondencetypedeciding";

    default boolean useIntegratedCorrespondence(final EObject objectA, final EObject objectB,
            final CorrespondenceModel cInstance, final List<Resource> jaMoppResources) {
        return true;
    }
}

Fix a bug in the correspondencetypedeciding extension point reference.


/*******************************************************************************
 * Copyright (c) 2012-2016 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package org.eclipse.che.ide.extension.machine.client.command.valueproviders;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import org.eclipse.che.ide.api.app.AppContext;

/**
 * Provides relative path to specific project. Path to project resolves from current workspace root.
 * e.g. /project_name.
 *
 * Need for IDEX-3924 as intermediate solution.
 *
 * @author Vlad Zhukovskiy
 */
@Singleton
public class CurrentProjectRelativePathProvider implements CommandPropertyValueProvider {

    private static final String KEY = "${current.project.relpath}";

    private AppContext appContext;

    @Inject
    public CurrentProjectRelativePathProvider(AppContext appContext) {
        this.appContext = appContext;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getValue() {
        return appContext.getCurrentProject().getProjectConfig().getPath().substring(1);
    }
}

/*******************************************************************************
 * Copyright (c) 2012-2016 Codenvy, S.A.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *   Codenvy, S.A. - initial API and implementation
 *******************************************************************************/
package org.eclipse.che.ide.extension.machine.client.command.valueproviders;

import com.google.inject.Inject;
import com.google.inject.Singleton;

import org.eclipse.che.ide.api.app.AppContext;
import org.eclipse.che.ide.api.app.CurrentProject;

/**
 * Provides relative path to specific project. Path to project resolves from current workspace root.
 * e.g. /project_name.
 *
 * Need for IDEX-3924 as intermediate solution.
 *
 * @author Vlad Zhukovskiy
 */
@Singleton
public class CurrentProjectRelativePathProvider implements CommandPropertyValueProvider {

    private static final String KEY = "${current.project.relpath}";

    private AppContext appContext;

    @Inject
    public CurrentProjectRelativePathProvider(AppContext appContext) {
        this.appContext = appContext;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getValue() {
        CurrentProject currentProject = appContext.getCurrentProject();
        if (currentProject == null) {
            return "";
        }
        return currentProject.getProjectConfig().getPath().substring(1);
    }
}

Add checking on current project == null

Add checking on current project == null

Signed-off-by: Vitaly Parfonov <3980a3d6ad736918e593101a7ff03dfd34097f49@codenvy.com>


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

public class Main {
  public static void main(String[] args) throws Exception {
    Thread t = new Thread(null, new Runnable() { public void run() {} }, "", 3*1024*1024*1024);
    try {
      t.start();
    } catch (OutOfMemoryError expected) {
      // TODO: fix bionic bug https://b/6702535 so we can check the full detail message.
      if (!expected.getMessage().startsWith("pthread_create (3GB stack) failed: ")) {
        throw new AssertionError(expected);
      }
    }
  }
}

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

public class Main {
  public static void main(String[] args) throws Exception {
    Thread t = new Thread(null, new Runnable() { public void run() {} }, "", 3L*1024*1024*1024);
    try {
      t.start();
    } catch (OutOfMemoryError expected) {
      // TODO: fix bionic bug https://b/6702535 so we can check the full detail message.
      if (!expected.getMessage().startsWith("pthread_create (3GB stack) failed: ")) {
        throw new AssertionError(expected);
      }
    }
  }
}

Fix type of constant to be long.

Fix type of constant to be long.

Change-Id: Ie6bf60ccfd0517b6e07c7e4461f58c84b4a51fe4


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

package org.apache.tapestry5.internal.services.assets;

import java.util.Map;

import org.apache.tapestry5.services.assets.CompressionAnalyzer;

public class CompressionAnalyzerImpl implements CompressionAnalyzer
{
    private final Map<String, Boolean> configuration;

    public CompressionAnalyzerImpl(Map<String, Boolean> configuration)
    {
        this.configuration = configuration;
    }

    public boolean isCompressable(String contentType)
    {
        assert contentType != null;

        int x = contentType.indexOf(';');

        String key = x < 0 ? contentType : contentType.substring(0, x);

        Boolean result = configuration.get(key);

        if (result != null) {
            return result.booleanValue();
        }

        // Now look for a wild card.

        x = contentType.indexOf('/');

        String wildKey = contentType.substring(0, x) + "/*";

        result = configuration.get(wildKey);

        return result == null ? true : result.booleanValue();
    }
}

package org.apache.tapestry5.internal.services.assets;

import java.util.Map;

import org.apache.tapestry5.services.assets.CompressionAnalyzer;

public class CompressionAnalyzerImpl implements CompressionAnalyzer
{
    private final Map<String, Boolean> configuration;

    public CompressionAnalyzerImpl(Map<String, Boolean> configuration)
    {
        this.configuration = configuration;
    }

    public boolean isCompressable(String contentType)
    {
        if (contentType == null) {
            throw new IllegalStateException("Content type provided to CompressionAnalyzer is null, which is not allowed.");
        }

        int x = contentType.indexOf(';');

        String key = x < 0 ? contentType : contentType.substring(0, x);

        Boolean result = configuration.get(key);

        if (result != null) {
            return result;
        }

        // Now look for a wild card.

        x = contentType.indexOf('/');

        String wildKey = contentType.substring(0, x) + "/*";

        result = configuration.get(wildKey);

        return result == null ? true : result;
    }
}

TAP5-2430: Throw an exception in the case that the content type is null.


package com.tinkerpop.etc.github.beans;

/**
 * @author Joshua Shinavier (http://fortytwo.net)
 */
public class Payload {

    public String action;
    public Comment comment;
    public Long comment_id;
    public String commit;
    public String description;
    public String head;
    public Long issue;
    public Long issue_id;
    public String master_branch;
    public User member;
    public Integer number;
    public Page[] pages;
    public PullRequest pull_request;
    public String pusher_type;
    public String ref;
    public String ref_type;
    public Release release;
    public Repository repository;
    public Object[] shas;
    public Integer size;
    public Team team;

    public String before;
    public String after;
    public String name;
    public String url;
    public Long id;
    public String desc;
    public User target;
}

package com.tinkerpop.etc.github.beans;

/**
 * @author Joshua Shinavier (http://fortytwo.net)
 */
public class Payload {

    public String action;
    public Comment comment;
    public Long comment_id;
    public String commit;
    public String description;
    public String head;
    public Long issue;
    public Long issue_id;
    public String master_branch;
    public User member;
    public Integer number;
    public Page[] pages;
    public PullRequest pull_request;
    public String pusher_type;
    public String ref;
    public String ref_type;
    public Release release;
    public Repository repository;
    public Object[] shas;
    public Integer size;
    public Team team;

    public String before;
    public String after;
    public String name;
    public String url;
    public Long id;
    public String desc;
    public User target;
    public Long membership_id;
}

Format tweaks, complete through present

Format tweaks, complete through present


package com.lmax.disruptor;

public class PerfTestContext {
    private long disruptorOps;
    private long batchesProcessedCount;
    private long iterations;

    public PerfTestContext() {
    }

    public long getDisruptorOps() {
        return disruptorOps;
    }

    public void setDisruptorOps(long disruptorOps) {
        this.disruptorOps = disruptorOps;
    }

    public long getBatchesProcessedCount() {
        return batchesProcessedCount;
    }

    public double getBatchPercent() {
        return 1 - (double)batchesProcessedCount / iterations;
    }

    public double getAverageBatchSize() {
        if (batchesProcessedCount == 0) return -1;
        return (double)iterations / batchesProcessedCount;
    }

    public void setBatchData(long batchesProcessedCount, long iterations) {
        this.batchesProcessedCount = batchesProcessedCount;
        this.iterations = iterations;
    }
}

package com.lmax.disruptor;

public class PerfTestContext {
    private long disruptorOps;
    private long batchesProcessedCount;
    private long iterations;

    public PerfTestContext() {
    }

    public long getDisruptorOps() {
        return disruptorOps;
    }

    public void setDisruptorOps(long disruptorOps) {
        this.disruptorOps = disruptorOps;
    }

    public long getBatchesProcessedCount() {
        return batchesProcessedCount;
    }

    public double getBatchPercent() {
        if (batchesProcessedCount == 0) return 0;
        return 1 - (double)batchesProcessedCount / iterations;
    }

    public double getAverageBatchSize() {
        if (batchesProcessedCount == 0) return -1;
        return (double)iterations / batchesProcessedCount;
    }

    public void setBatchData(long batchesProcessedCount, long iterations) {
        this.batchesProcessedCount = batchesProcessedCount;
        this.iterations = iterations;
    }
}

Fix display when batches are not counted


/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * 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.github.pedrovgs.problem32;

/**
 * Given two strings passed as argument, can you write a method to return true if the second
 * contains the first one?
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class Contains {

  public boolean evaluate(String word1, String word2) {
    return false;
  }
}

/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * 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.github.pedrovgs.problem32;

/**
 * Given two strings passed as argument, can you write a method to return true if the second
 * contains the first one?
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class Contains {

  /**
   * Iterative solution to this problem. The complexity order of this algorithm is O(N*M) where N
   * is the length of the first word and M is the length of the second word. In space terms the
   * complexity order of this algorithm is O(1) because we are not using any auxiliary data
   * structure to solve this problem.
   */
  public boolean evaluate(String w1, String w2) {
    if (w1 == null || w2 == null) {
      throw new IllegalArgumentException("You can't pass null strings as input.");
    }
    boolean contains = false;
    for (int i = 0; i < w2.length() - 1; i++) {
      if (w2.charAt(i) == w1.charAt(0)) {
        for (int j = 0; j < w1.length(); j++) {
          if (w1.charAt(j) == w2.charAt(i + j) && j == w1.length() - 1) {
            contains = true;
            break;
          }
        }
      }
    }
    return contains;
  }
}

Add iterative solution to problem 32

Add iterative solution to problem 32


package com.bourke.glimmr.common;

public class Keys {

    public static final String API_KEY = "***REMOVED***";
    public static final String API_SECRET = "***REMOVED***";
}

package com.bourke.glimmr.common;

public class Keys {

    public static final String API_KEY = "";
    public static final String API_SECRET = "";
}

Remove api keys for open sourcing

Remove api keys for open sourcing


/*
 * Copyright © 2012 Sebastian Hoß <mail@shoss.de>
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */
package com.github.sebhoss.contract.example;

import com.github.sebhoss.contract.annotation.Clause;
import com.github.sebhoss.contract.annotation.Contract;
import com.github.sebhoss.contract.annotation.OGNL;
import com.github.sebhoss.contract.annotation.SpEL;

@OGNL
@SpEL
class OgnlSpELBasedInsuranceCompany extends AbstractInsuranceCompany {

    @Contract(preconditions = {
            @Clause(value = "#damage > 0", message = "Reported damage must be positive!", exception = IllegalStateException.class),
            @Clause(value = "#damage <= 5000", message = "We won't pay that!") }, postconditions = {
            @Clause(value = "#return >= 0", message = "We won't take any more!"),
            @Clause(value = "#return <= 2000", message = "We can't pay that much!") })
    @Override
    public double calculateCover(final double damage) {
        return damage * 0.5;
    }

}

/*
 * Copyright © 2012 Sebastian Hoß <mail@shoss.de>
 * This work is free. You can redistribute it and/or modify it under the
 * terms of the Do What The Fuck You Want To Public License, Version 2,
 * as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
 */
package com.github.sebhoss.contract.example;

import com.github.sebhoss.contract.annotation.Clause;
import com.github.sebhoss.contract.annotation.Contract;
import com.github.sebhoss.contract.annotation.OGNL;
import com.github.sebhoss.contract.annotation.SpEL;

@OGNL
@SpEL
class OgnlSpELBasedInsuranceCompany extends AbstractInsuranceCompany {

    @Contract(preconditions = {
            @Clause(value = "#damage > 0", message = "Reported damage must be positive!", exception = IllegalStateException.class),
            @Clause(value = "#damage <= maximumReportableDamage", message = "We won't pay that!") }, postconditions = {
            @Clause(value = "#return >= 0", message = "We won't take any more!"),
            @Clause(value = "#return <= remainingMoney", message = "We can't pay that much!") })
    @Override
    public double calculateCover(final double damage) {
        return damage * 0.5;
    }

}

Use instance methods in contract

Use instance methods in contract

Signed-off-by: Sebastian Hoß <1d6e1cf70ec6f9ab28d3ea4b27a49a77654d370e@shoss.de>


package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;

import java.util.List;

import org.metaborg.meta.lang.dynsem.interpreter.DynSemLanguage;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.source.SourceSection;

public class RuleFactory {

	public static Rule createRule(DynSemLanguage lang, SourceSection source, List<? extends Rule> rules,
			String arrowName, Class<?> dispatchClass) {
		CompilerAsserts.neverPartOfCompilation();
		if (rules.size() == 0) {
			return new FallbackRule(lang, source, arrowName, dispatchClass);
		} else if (rules.size() == 1) {
			return rules.get(0);
		} else {
			Rule tail = createRule(lang, source, rules.subList(1, rules.size()), arrowName, dispatchClass);
			return new Rules(lang, source, rules.get(0), tail);
		}
	}

}

package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;

import java.util.List;

import org.metaborg.meta.lang.dynsem.interpreter.DynSemLanguage;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.source.SourceSection;

public class RuleFactory {

	public static Rule createRule(DynSemLanguage lang, SourceSection source, List<? extends Rule> rules,
			String arrowName, Class<?> dispatchClass) {
		CompilerAsserts.neverPartOfCompilation();
		if (rules.size() == 0) {
			return new FallbackRule(lang, source, arrowName, dispatchClass);
		} else {
			Rule tail = createRule(lang, source, rules.subList(1, rules.size()), arrowName, dispatchClass);
			return new Rules(lang, source, rules.get(0), tail);
		}
	}

}

Fix not injecting fallback rule for singular rules


/*
 * 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.trino.tests.product.launcher.env;

public final class EnvironmentDefaults
{
    public static final String DOCKER_IMAGES_VERSION = "43";
    public static final String HADOOP_BASE_IMAGE = "ghcr.io/trinodb/testing/hdp2.6-hive";
    public static final String HADOOP_IMAGES_VERSION = DOCKER_IMAGES_VERSION;
    public static final String TEMPTO_ENVIRONMENT_CONFIG = "/dev/null";

    private EnvironmentDefaults() {}
}

/*
 * 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.trino.tests.product.launcher.env;

public final class EnvironmentDefaults
{
    public static final String DOCKER_IMAGES_VERSION = "45";
    public static final String HADOOP_BASE_IMAGE = "ghcr.io/trinodb/testing/hdp2.6-hive";
    public static final String HADOOP_IMAGES_VERSION = DOCKER_IMAGES_VERSION;
    public static final String TEMPTO_ENVIRONMENT_CONFIG = "/dev/null";

    private EnvironmentDefaults() {}
}

Update docker-images to version 45

Update docker-images to version 45


// Copyright 2014 Square, Inc.
package com.squareup.burst;

import java.lang.annotation.Retention;
import javax.inject.Qualifier;

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

@Retention(RUNTIME) @Qualifier
public @interface Variations {

  Class<? extends VariationValueProvider<?>>[] value();
}

// Copyright 2014 Square, Inc.
package com.squareup.burst;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Retention(RUNTIME) @Target(METHOD)
public @interface Variations {

  Class<? extends VariationValueProvider<?>>[] value();
}

Remove @Qualifier, and add @Target(METHOD)

Since we only support method-level @Variations, for now at least.


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

import com.opengamma.component.OpenGammaComponentServer;

/**
 * Main entry point for OpenGamma Analytic service component-based servers.
 * <p>
 * This class exists to easily capture the classpath.
 */
public class AnalyticServiceComponentServer extends OpenGammaComponentServer {

  /**
   * Main method to start an OpenGamma JVM process.
   *
   * @param args  the arguments
   */
  public static void main(String[] args) { // CSIGNORE
    new AnalyticServiceComponentServer().run(args);
  }

}

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

import com.opengamma.component.OpenGammaComponentServer;

/**
 * Main entry point for OpenGamma Analytic service component-based servers.
 * <p>
 * This class exists to easily capture the classpath.
 */
public class AnalyticServiceComponentServer extends OpenGammaComponentServer {

  /**
   * Main method to start an OpenGamma JVM process.
   *
   * @param args  the arguments
   */
  public static void main(String[] args) { // CSIGNORE
    if (!new AnalyticServiceComponentServer().run(args)) {
      System.exit(-1);
    }
  }

}

[PLAT-2760] Exit with -1 status if server failed to start up


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

package org.apache.camel.test.infra.aws2.services;

public class AWSSQSLocalContainerService extends AWSLocalContainerService {

    public AWSSQSLocalContainerService() {
        super("localstack/localstack:0.12.2", Service.SQS);
    }
}

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

package org.apache.camel.test.infra.aws2.services;

public class AWSSQSLocalContainerService extends AWSLocalContainerService {

    public AWSSQSLocalContainerService() {
        super("localstack/localstack:0.12.3", Service.SQS);
    }
}

Upgrade Localstack image to version 0.12.3


package fr.openwide.core.test.jpa.externallinkchecker.config.spring;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import fr.openwide.core.jpa.config.spring.AbstractConfiguredJpaConfig;
import fr.openwide.core.jpa.config.spring.provider.JpaPackageScanProvider;
import fr.openwide.core.jpa.externallinkchecker.business.JpaExternalLinkCheckerBusinessPackage;

@Configuration
@EnableAspectJAutoProxy
public class JpaExternalLinkCheckerTestJpaConfig extends AbstractConfiguredJpaConfig {

	@Override
	public JpaPackageScanProvider applicationJpaPackageScanProvider() {
		return new JpaPackageScanProvider(JpaExternalLinkCheckerBusinessPackage.class.getPackage());
	}

}

package fr.openwide.core.test.jpa.externallinkchecker.config.spring;

import org.hibernate.Interceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import fr.openwide.core.jpa.config.spring.AbstractConfiguredJpaConfig;
import fr.openwide.core.jpa.config.spring.provider.JpaPackageScanProvider;
import fr.openwide.core.jpa.externallinkchecker.business.JpaExternalLinkCheckerBusinessPackage;
import fr.openwide.core.jpa.externallinkchecker.business.interceptor.ExternalLinkWrapperInterceptor;
import fr.openwide.core.jpa.hibernate.interceptor.ChainedInterceptor;

@Configuration
@EnableAspectJAutoProxy
public class JpaExternalLinkCheckerTestJpaConfig extends AbstractConfiguredJpaConfig {

	@Override
	public JpaPackageScanProvider applicationJpaPackageScanProvider() {
		return new JpaPackageScanProvider(JpaExternalLinkCheckerBusinessPackage.class.getPackage());
	}

	@Bean
	public Interceptor interceptor() {
		return new ChainedInterceptor()
				.add(new ExternalLinkWrapperInterceptor());
	}

}

Declare the interceptor (even if it's not very useful in the tests atm)


package hu.webarticum.treeprinter;

import java.util.List;

public interface TreeNode {

    public String content();

    public List<TreeNode> children();

    public default TreeNode originalNode() {
        return this;
    }

    public default Insets insets() {
        return new Insets(0);
    }

    public default boolean isDecorable() {
        return true;
    }

    public default boolean isPlaceholder() {
        return false;
    }

}

package hu.webarticum.treeprinter;

import java.util.List;

public interface TreeNode {

    public String content();

    public List<TreeNode> children();

    public default TreeNode originalNode() {
        return this;
    }

    public default Insets insets() {
        return Insets.EMPTY;
    }

    public default boolean isDecorable() {
        return true;
    }

    public default boolean isPlaceholder() {
        return false;
    }

}

Use Inset.EMPTY instead of new empty

Use Inset.EMPTY instead of new empty


package seedu.address.testutil;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;

/**
 *
 */
public class ItemBuilder {

    private TestItem person;

    public ItemBuilder() {
        this.person = new TestItem();
    }

    public ItemBuilder withItemType(String itemType) throws IllegalValueException {
        this.person.setItemType(new ItemType(itemType));
        return this;
    }

    public ItemBuilder withTags(String ... tags) throws IllegalValueException {
        for (String tag: tags) {
            person.getTags().add(new Tag(tag));
        }
        return this;
    }

    public ItemBuilder withEndDate(String endDate) throws IllegalValueException {
        this.person.setEndDate(new Date(endDate));
        return this;
    }

    public ItemBuilder withEndTime(String endTime) throws IllegalValueException {
        this.person.setEndTime(new Time(endTime));
        return this;
    }

    public ItemBuilder withName(String name) throws IllegalValueException {
        this.person.setName(new Name(name));
        return this;
    }

    public ItemBuilder withStartDate(String startDate) throws IllegalValueException {
        this.person.setStartDate(new Date(startDate));
        return this;
    }

    public ItemBuilder withStartTime(String startTime) throws IllegalValueException {
        this.person.setStartTime(new Time(startTime));
        return this;
    }

    public TestItem build() {
        return this.person;
    }

}

package seedu.address.testutil;

import seedu.address.commons.exceptions.IllegalValueException;
import seedu.address.model.item.*;
import seedu.address.model.tag.Tag;

/**
 *
 */
public class ItemBuilder {

    private TestItem item;

    public ItemBuilder() {
        this.item = new TestItem();
    }

    public ItemBuilder withItemType(String itemType) throws IllegalValueException {
        this.item.setItemType(new ItemType(itemType));
        return this;
    }

    public ItemBuilder withTags(String ... tags) throws IllegalValueException {
        for (String tag: tags) {
            item.getTags().add(new Tag(tag));
        }
        return this;
    }

    public ItemBuilder withEndDate(String endDate) throws IllegalValueException {
        this.item.setEndDate(new Date(endDate));
        return this;
    }

    public ItemBuilder withEndTime(String endTime) throws IllegalValueException {
        this.item.setEndTime(new Time(endTime));
        return this;
    }

    public ItemBuilder withName(String name) throws IllegalValueException {
        this.item.setName(new Name(name));
        return this;
    }

    public ItemBuilder withStartDate(String startDate) throws IllegalValueException {
        this.item.setStartDate(new Date(startDate));
        return this;
    }

    public ItemBuilder withStartTime(String startTime) throws IllegalValueException {
        this.item.setStartTime(new Time(startTime));
        return this;
    }

    public TestItem build() {
        return this.item;
    }

}

Rename person to item in TestItem class

Rename person to item in TestItem class


package com.paritytrading.parity.fix;

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

class Orders {

    private List<Order> orders;

    public Orders() {
        orders = new ArrayList<>();
    }

    public void add(Order order) {
        orders.add(order);
    }

    public Order findByClOrdID(String clOrdId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (order.getClOrdID().equals(clOrdId))
                return order;
        }

        return null;
    }

    public Order findByOrigClOrdID(String origClOrdId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (order.getOrigClOrdID().equals(origClOrdId))
                return order;
        }

        return null;
    }

    public Order findByOrderEntryID(String orderEntryId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (order.getOrderEntryID().equals(orderEntryId))
                return order;
        }

        return null;
    }

    public void removeByOrderEntryID(String orderEntryId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (order.getOrderEntryID().equals(orderEntryId)) {
                orders.remove(i);
                break;
            }
        }
    }

}

package com.paritytrading.parity.fix;

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

class Orders {

    private List<Order> orders;

    public Orders() {
        orders = new ArrayList<>();
    }

    public void add(Order order) {
        orders.add(order);
    }

    public Order findByClOrdID(String clOrdId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (clOrdId.equals(order.getClOrdID()))
                return order;
        }

        return null;
    }

    public Order findByOrigClOrdID(String origClOrdId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (origClOrdId.equals(order.getOrigClOrdID()))
                return order;
        }

        return null;
    }

    public Order findByOrderEntryID(String orderEntryId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (orderEntryId.equals(order.getOrderEntryID()))
                return order;
        }

        return null;
    }

    public void removeByOrderEntryID(String orderEntryId) {
        for (int i = 0; i < orders.size(); i++) {
            Order order = orders.get(i);

            if (orderEntryId.equals(order.getOrderEntryID())) {
                orders.remove(i);
                break;
            }
        }
    }

}

Fix order cancellation in FIX gateway

Fix order cancellation in FIX gateway

All orders do not have an OrigClOrdID(41).

Thanks to Pekka Enberg for reporting the failure.


// Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.xwalk.runtime;

import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.ServiceConnection;

/**
 * MixContext provides ApplicationContext for the contextImpl object
 * created by Context.CreatePackageContext().
 *
 * For cross package usage, the library part need the possibility to
 * get both the application's context and the library itself's context.
 *
 */
public class MixContext extends ContextWrapper {
    private Context mAppCtx;

    public MixContext(Context base, Context app) {
        super(base);
        mAppCtx = app.getApplicationContext();
    }

    @Override
    public Context getApplicationContext() {
        return mAppCtx;
    }

    @Override
    public boolean bindService(Intent in, ServiceConnection conn, int flags) {
        return mAppCtx.bindService(in, conn, flags);
    }

    @Override
    public void unbindService(ServiceConnection conn) {
        mAppCtx.unbindService(conn);
    }
}

// Copyright (c) 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.xwalk.runtime;

import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.ServiceConnection;

/**
 * MixContext provides ApplicationContext for the contextImpl object
 * created by Context.CreatePackageContext().
 *
 * For cross package usage, the library part need the possibility to
 * get both the application's context and the library itself's context.
 *
 */
public class MixContext extends ContextWrapper {
    private Context mActivityCtx;

    public MixContext(Context base, Context activity) {
        super(base);
        mActivityCtx = activity;
    }

    @Override
    public Context getApplicationContext() {
        return mActivityCtx.getApplicationContext();
    }

    @Override
    public boolean bindService(Intent in, ServiceConnection conn, int flags) {
        return getApplicationContext().bindService(in, conn, flags);
    }

    @Override
    public void unbindService(ServiceConnection conn) {
        getApplicationContext().unbindService(conn);
    }

    @Override
    public Object getSystemService(String name) {
        return mActivityCtx.getSystemService(name);
    }
}

[Android] Fix the context issue to let content create windows

Content Layer needs getSystemService to get window manager. And it
should be created from Activity.


/*
 * Created on Aug 31, 2009
 */
package jwbroek.id3.v2;

import java.io.IOException;
import java.io.InputStream;

import jwbroek.id3.ITunesPodcastFrame;

public class ITunesPodcastFrameReader implements FrameReader
{
  private final int headerSize;

  public ITunesPodcastFrameReader(final int headerSize)
  {
    this.headerSize = headerSize;
  }

  public ITunesPodcastFrame readFrameBody(final int size, final InputStream input)
      throws IOException, UnsupportedEncodingException, MalformedFrameException
  {
    final ITunesPodcastFrame result = new ITunesPodcastFrame(this.headerSize + size);
    final StringBuilder payloadBuilder = new StringBuilder();
    for (int index = 0; index < 4; index++)
    {
      payloadBuilder.append(Integer.toHexString(input.read()));
    }
    result.setPayload(payloadBuilder.toString());
    return result;
  }

}

/*
 * Created on Aug 31, 2009
 */
package jwbroek.id3.v2;

import jwbroek.id3.ITunesPodcastFrame;

import java.io.IOException;
import java.io.InputStream;

public class ITunesPodcastFrameReader implements FrameReader {

    private final int headerSize;

    public ITunesPodcastFrameReader(final int headerSize) {
        this.headerSize = headerSize;
    }

    public ITunesPodcastFrame readFrameBody(final int size, final InputStream input) throws IOException, UnsupportedEncodingException, MalformedFrameException {
        final ITunesPodcastFrame result = new ITunesPodcastFrame(this.headerSize + size);
        final StringBuilder payloadBuilder = new StringBuilder();
        for (int index = 0; index < 4; index++) {
            payloadBuilder.append(Integer.toHexString(input.read()));
        }
        result.setPayload(payloadBuilder.toString());
        return result;
    }

}

Reformat code, remove hardcoded path.

Reformat code, remove hardcoded path.


package ijx.plugin;

import imagej.plugin.PluginEntry;
import imagej.plugin.PluginFinder;

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

import org.openide.util.Lookup;

public class PluginDiscovery {

	/**
	 * Tests the plugin discovery mechanism,
	 * printing a list of all discovered plugins.
	 */
	public static void main(String[] args) {
		System.out.println("Scanning for plugin finders...");
		Collection<? extends PluginFinder> finders =
			Lookup.getDefault().lookupAll(PluginFinder.class);

		List<PluginEntry> plugins = new ArrayList<PluginEntry>();

		for (PluginFinder finder : finders) {
			System.out.println("Querying " + finder + "...");
			finder.findPlugins(plugins);
		}
		System.out.println("Discovered plugins:");
		for (PluginEntry plugin : plugins) {
			System.out.println("\t" + plugin);
		}
	}

}

package ijx.plugin;

import imagej.plugin.api.PluginEntry;
import imagej.plugin.spi.PluginFinder;

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

import org.openide.util.Lookup;

public class PluginDiscovery {

	/**
	 * Tests the plugin discovery mechanism,
	 * printing a list of all discovered plugins.
	 */
	public static void main(String[] args) {
		System.out.println("Scanning for plugin finders...");
		Collection<? extends PluginFinder> finders =
			Lookup.getDefault().lookupAll(PluginFinder.class);

		List<PluginEntry> plugins = new ArrayList<PluginEntry>();

		for (PluginFinder finder : finders) {
			System.out.println("Querying " + finder + "...");
			finder.findPlugins(plugins);
		}
		System.out.println("Discovered plugins:");
		for (PluginEntry plugin : plugins) {
			System.out.println("\t" + plugin);
		}
	}

}

Update package names in ijx.

Update package names in ijx.

This used to be revision r2172.


package org.luxons.sevenwonders.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {

    @Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        // prefixes for all subscriptions
        config.enableSimpleBroker("/queue", "/topic");
        config.setUserDestinationPrefix("/user");

        // prefix for all calls from clients
        config.setApplicationDestinationPrefixes("/app");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/seven-wonders-websocket").setHandshakeHandler(handshakeHandler()).withSockJS();
    }

    @Bean
    public DefaultHandshakeHandler handshakeHandler() {
        return new AnonymousUsersHandshakeHandler();
    }

}

package org.luxons.sevenwonders.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.AbstractWebSocketMessageBrokerConfigurer;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {

    @Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        // prefixes for all subscriptions
        config.enableSimpleBroker("/queue", "/topic");
        config.setUserDestinationPrefix("/user");

        // prefix for all calls from clients
        config.setApplicationDestinationPrefixes("/app");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/seven-wonders-websocket")
                .setHandshakeHandler(handshakeHandler())
                .setAllowedOrigins("http://localhost:3000") // to allow frontend server proxy requests in dev mode
                .withSockJS();
    }

    @Bean
    public DefaultHandshakeHandler handshakeHandler() {
        return new AnonymousUsersHandshakeHandler();
    }

}

Allow cross-origin for frontend server proxy


package li.l1t.tingo.service;

import li.l1t.tingo.exception.TeacherNotFoundException;
import li.l1t.tingo.model.Teacher;
import li.l1t.tingo.model.dto.TeacherDto;
import li.l1t.tingo.model.repo.TeacherRepository;
import org.dozer.DozerBeanMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Service handling teachers, providing a bridge between the controller and the model.
 *
 * @author xxyy
 * @since 2016-02-14
 */
@Service
public class TeacherService {
    private final DozerBeanMapper dozerBeanMapper;
    private final TeacherRepository teacherRepository;

    @Autowired
    public TeacherService(DozerBeanMapper dozerBeanMapper, TeacherRepository teacherRepository) {
        this.dozerBeanMapper = dozerBeanMapper;
        this.teacherRepository = teacherRepository;
    }

    public Iterable<Teacher> getAllTeachers() {
        return teacherRepository.findAll();
    }

    public Teacher getById(int id) {
        Teacher teacher = teacherRepository.findOne(id);
        if(teacher == null) {
            throw new TeacherNotFoundException(id);
        }
        return teacher;
    }

    public TeacherDto toDto(Teacher entity) {
        return dozerBeanMapper.map(entity, TeacherDto.class);
    }
}

package li.l1t.tingo.service;

import li.l1t.tingo.exception.TeacherNotFoundException;
import li.l1t.tingo.model.Teacher;
import li.l1t.tingo.model.dto.TeacherDto;
import li.l1t.tingo.model.repo.TeacherRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Service handling teachers, providing a bridge between the controller and the model.
 *
 * @author xxyy
 * @since 2016-02-14
 */
@Service
public class TeacherService {
    @Autowired
    private TeacherRepository teacherRepository;

    public Iterable<Teacher> getAllTeachers() {
        return teacherRepository.findAll();
    }

    public Teacher getById(int id) {
        Teacher teacher = teacherRepository.findOne(id);
        if(teacher == null) {
            throw new TeacherNotFoundException(id);
        }
        return teacher;
    }

    public TeacherDto toDto(Teacher entity) {
        TeacherDto dto = new TeacherDto();
        dto.setId(entity.getId());
        dto.setAbbreviation(entity.getAbbreviation());
        dto.setName(entity.getName());
        return dto;
    }
}

Fix teacher ids not being mapped

Fix teacher ids not being mapped


package net.md_5.bungee;

public class Bootstrap
{

    public static void main(String[] args) throws Exception
    {
        if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 51.0 )
        {
            System.err.println( "*** ERROR *** BungeeCord requires Java 7 or above to function! Please download and install it!" );
            System.out.println( "You can check your Java version with the command: java -version" );
            return;
        }

        BungeeCordLauncher.main( args );
    }
}

package net.md_5.bungee;

public class Bootstrap
{

    public static void main(String[] args) throws Exception
    {
        if ( Float.parseFloat( System.getProperty( "java.class.version" ) ) < 52.0 )
        {
            System.err.println( "*** ERROR *** BungeeCord requires Java 8 or above to function! Please download and install it!" );
            System.out.println( "You can check your Java version with the command: java -version" );
            return;
        }

        BungeeCordLauncher.main( args );
    }
}

Change version warning to Java 8

Change version warning to Java 8


package fi.cosky.sdk;
/*
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
import java.util.List;

public class ImportData extends BaseData {
	public static final String MimeType = "application/vnd.jyu.nfleet.import";
	public static final double MimeVersion = 2.1;

	private int VersionNumber;
	private int ErrorCount;
	private String State;
	private List<VehicleError> Vehicles;
	private List<TaskError> Tasks;

	public int getVersionNumber() {
		return VersionNumber;
	}
	public void setVersionNumber(int versionNumber) {
		VersionNumber = versionNumber;
	}
	public int getErrorCount() {
		return ErrorCount;
	}
	public void setErrorCount(int errorCount) {
		ErrorCount = errorCount;
	}
	public String getState() {
		return State;
	}
	public void setState(String state) {
		State = state;
	}
	public List<VehicleError> getVehicles() {
		return Vehicles;
	}
	public void setVehicles(List<VehicleError> vehicles) {
		Vehicles = vehicles;
	}
	public List<TaskError> getTasks() {
		return Tasks;
	}
	public void setTasks(List<TaskError> tasks) {
		Tasks = tasks;
	}

}

package fi.cosky.sdk;
/*
 * This file is subject to the terms and conditions defined in
 * file 'LICENSE.txt', which is part of this source code package.
 */
import java.util.List;

public class ImportData extends BaseData {
	public static final String MimeType = "application/vnd.jyu.nfleet.import";
	public static final double MimeVersion = 2.2;

	private int VersionNumber;
	private int ErrorCount;
	private String State;
	private List<VehicleError> Vehicles;
	private List<TaskError> Tasks;
    private List<DepotError> Depots;

	public int getVersionNumber() {
		return VersionNumber;
	}
	public void setVersionNumber(int versionNumber) {
		VersionNumber = versionNumber;
	}
	public int getErrorCount() {
		return ErrorCount;
	}
	public void setErrorCount(int errorCount) {
		ErrorCount = errorCount;
	}
	public String getState() {
		return State;
	}
	public void setState(String state) {
		State = state;
	}
	public List<VehicleError> getVehicles() {
		return Vehicles;
	}
	public void setVehicles(List<VehicleError> vehicles) {
		Vehicles = vehicles;
	}
	public List<TaskError> getTasks() {
		return Tasks;
	}
	public void setTasks(List<TaskError> tasks) {
		Tasks = tasks;
	}
    public List<DepotError> getDepots() { return Depots; }
    public void setDepots(List<DepotError> depots) { Depots = depots; }
}

Add depots into Import and increase mime version to 2.2


package com.github.aureliano.achmed.os;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.github.aureliano.achmed.exception.ServiceResourceException;
import com.github.aureliano.achmed.os.pkg.IPackageManager;
import com.github.aureliano.achmed.types.OS;
import com.github.aureliano.achmed.types.OperatingSystemFamily;

public class LinuxTest {

	private Linux linux;

	public LinuxTest() {
		this.linux = this.createDefaultOs();
	}

	@Test
	public void testGetOperatingSystem() {
		assertEquals(OS.LINUX, this.linux.getOperatingSystem());
	}

	@Test
	public void testGetPsCommand() {
		final String cmd = "ps -ef";
		assertEquals(cmd, this.linux.getPsCommand());
	}

	@Test(expected = ServiceResourceException.class)
	public void testGetPidWithNullPattern() {
		this.linux.getPid(null);
	}

	private Linux createDefaultOs() {
		return new Linux() {

			public OperatingSystemFamily getOperatingSystemFamily() {
				return null;
			}

			public IPackageManager getDefaultPackageManager() {
				return null;
			}
		};
	}
}

package com.github.aureliano.achmed.os;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.github.aureliano.achmed.exception.ServiceResourceException;
import com.github.aureliano.achmed.os.pkg.IPackageManager;
import com.github.aureliano.achmed.types.OS;
import com.github.aureliano.achmed.types.OperatingSystemFamily;

public class LinuxTest {

	private Linux linux;

	public LinuxTest() {
		this.linux = this.createDefaultOs();
	}

	@Test
	public void testGetOperatingSystem() {
		assertEquals(OS.LINUX, this.linux.getOperatingSystem());
	}

	@Test
	public void testGetPsCommand() {
		final String cmd = "ps -ef";
		assertEquals(cmd, this.linux.getPsCommand());
	}

	@Test(expected = ServiceResourceException.class)
	public void testGetPidWithNullPattern() {
		this.linux.getPid(null);
	}

	@Test(expected = ServiceResourceException.class)
	public void testGetPidWithEmptyPattern() {
		this.linux.getPid("");
	}

	private Linux createDefaultOs() {
		return new Linux() {

			public OperatingSystemFamily getOperatingSystemFamily() {
				return null;
			}

			public IPackageManager getDefaultPackageManager() {
				return null;
			}
		};
	}
}

Add unit test to get pid passing empty pattern.


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

package org.bitcoinj.core;

public class SignatureDecodeException extends Exception {
    public SignatureDecodeException() {
        super();
    }

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

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

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

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

package org.bitcoinj.core;

public class SignatureDecodeException extends Exception {
    public SignatureDecodeException() {
        super();
    }

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

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

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

Replace some of my copyright statements by the generic statement.

(cherry picked from commit 5274855f2b5decdc17362c1f3111832acfe5ddfb)
Signed-off-by: HashEngineering <cdfd0e2929fd184ec34228d20f211727fcb487d4@gmail.com>


package com.blocksolid.okrello.display;

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

/**
 * Created by Dan Buckland on 02/12/2015.
 */
public class Scores {
    public String extractScoreFromString(String string) {
        Pattern pattern = Pattern.compile("\\[(\\d{1}\\.\\d{1})\\]");
        Matcher m = pattern.matcher(string);
        if (m.find()) {
            return m.group(1);
        } else {
            return "";
        }
    }
}

package com.blocksolid.okrello.display;

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

/**
 * Created by Dan Buckland on 02/12/2015.
 */
public class Scores {
    public String extractScoreFromString(String string) {
        Pattern pattern = Pattern.compile("\\[(\\d{1}\\.\\d{1})\\]");
        Matcher m = pattern.matcher(string);
        if (m.find()) {
            String score = m.group(1);
            double value = Double.parseDouble(score);
            if (value > 1) {
                return "1.0";
            } else {
                return score;
            }
        } else {
            return "!";
        }
    }
}

Complete extractScoreFromString method to return "1.0" if value of score is above 1.0


package org.qfox.jestful.core;

/**
 *

 * Description: The participant of RESTful action
 *

 *
 *

 * Company: 广州市俏狐信息科技有限公司
 *

 *
 * @author Payne 646742615@qq.com
 *
 * @date 2016年1月15日 下午8:54:19
 *
 * @since 1.0.0
 */
public interface Actor {

	/**
	 * do myself job for this action
	 *
	 * @param action
	 *            the action to execute
	 * @return action result
	 * @throws Exception
	 *             all type exceptions may be thrown
	 */
	Object react(Action action) throws Exception;

}

package org.qfox.jestful.core;

/**
 *

 * Description: The participant of RESTful action
 *

 *
 *

 * Company: 广州市俏狐信息科技有限公司
 *

 *
 * @author Payne 646742615@qq.com
 *
 * @date 2016年1月15日 下午8:54:19
 *
 * @since 1.0.0
 */
public interface Actor {

	/**
	 * do itself job for this action
	 *
	 * @param action
	 *            the action to execute
	 * @return action result
	 * @throws Exception
	 *             all type exceptions may be thrown
	 */
	Object react(Action action) throws Exception;

}

Make the Framework Support JDK 1.5

Make the Framework Support JDK 1.5