package sopc2dts.lib.components.altera;

import org.xml.sax.ContentHandler;
import org.xml.sax.XMLReader;

import sopc2dts.generators.AbstractSopcGenerator;
import sopc2dts.lib.SopcInfoConnection;
import sopc2dts.lib.components.SopcComponentDescription;
import sopc2dts.lib.components.SopcInfoComponent;

public class SICTrippleSpeedEthernet extends SopcInfoComponent {

	public SICTrippleSpeedEthernet(ContentHandler p, XMLReader xr,
			SopcComponentDescription scd, String iName, String version) {
		super(p, xr, scd, iName, version);
	}
	public String toDtsExtras(int indentLevel, SopcInfoConnection conn, Boolean endComponent)
	{
		String res = "";
		SopcInfoComponent compTX, compRX;
		compTX = getInterfaceByName("transmit").getConnections().get(0).getMasterInterface().getOwner();
		compRX = getInterfaceByName("receive").getConnections().get(0).getSlaveInterface().getOwner();
		res += AbstractSopcGenerator.indent(indentLevel) + "altera,sgdma_tx = < &" + compTX.getInstanceName() + " >;\n";
		res += AbstractSopcGenerator.indent(indentLevel) + "altera,sgdma_rx = < &" + compRX.getInstanceName() + " >;\n";
		return res;
	}
}

package sopc2dts.lib.components.altera;

import org.xml.sax.ContentHandler;
import org.xml.sax.XMLReader;

import sopc2dts.generators.AbstractSopcGenerator;
import sopc2dts.lib.SopcInfoConnection;
import sopc2dts.lib.components.SopcComponentDescription;
import sopc2dts.lib.components.SopcInfoComponent;

public class SICTrippleSpeedEthernet extends SopcInfoComponent {

	public SICTrippleSpeedEthernet(ContentHandler p, XMLReader xr,
			SopcComponentDescription scd, String iName, String version) {
		super(p, xr, scd, iName, version);
	}
	public String toDtsExtras(int indentLevel, SopcInfoConnection conn, Boolean endComponent)
	{
		String res = "";
		SopcInfoComponent compTX, compRX;
		compTX = getInterfaceByName("transmit").getConnections().get(0).getMasterInterface().getOwner();
		compRX = getInterfaceByName("receive").getConnections().get(0).getSlaveInterface().getOwner();
		res += AbstractSopcGenerator.indent(indentLevel) + "altr,sgdma_tx = < &" + compTX.getInstanceName() + " >;\n";
		res += AbstractSopcGenerator.indent(indentLevel) + "altr,sgdma_rx = < &" + compRX.getInstanceName() + " >;\n";
		return res;
	}
}

Use altr for vendor altera

Use altr for vendor altera

Signed-off-by: Walter Goossens <423eb823df3d47e4be79896b836c41319472e26c@home.nl>


package org.wikipedia.search;

import org.json.JSONArray;
import org.mediawiki.api.json.Api;
import org.mediawiki.api.json.ApiResult;
import org.mediawiki.api.json.RequestBuilder;
import org.wikipedia.ApiTask;
import org.wikipedia.PageTitle;
import org.wikipedia.Site;
import org.wikipedia.concurrency.ExecutorService;

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

public class SearchArticlesTask extends ApiTask<List<PageTitle>> {
    private final String prefix;
    private final Site site;

    public SearchArticlesTask(Api api, Site site, String prefix) {
        super(ExecutorService.getSingleton().getExecutor(SearchArticlesTask.class, 4), api);
        this.prefix = prefix;
        this.site = site;
    }

    @Override
    public RequestBuilder buildRequest(Api api) {
        return api.action("opensearch").param("search", prefix).param("limit", "5");
    }

    @Override
    public List<PageTitle> processResult(ApiResult result) throws Throwable {
        JSONArray searchResults = result.asArray().optJSONArray(1);

        ArrayList<PageTitle> pageTitles = new ArrayList<PageTitle>();
        for (int i = 0; i < searchResults.length(); i++) {
            pageTitles.add(new PageTitle(null, searchResults.optString(i), site));
        }

        return pageTitles;
    }
}

package org.wikipedia.search;

import org.json.JSONArray;
import org.mediawiki.api.json.Api;
import org.mediawiki.api.json.ApiResult;
import org.mediawiki.api.json.RequestBuilder;
import org.wikipedia.ApiTask;
import org.wikipedia.PageTitle;
import org.wikipedia.Site;
import org.wikipedia.concurrency.ExecutorService;

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

public class SearchArticlesTask extends ApiTask<List<PageTitle>> {
    private final String prefix;
    private final Site site;

    public SearchArticlesTask(Api api, Site site, String prefix) {
        super(ExecutorService.getSingleton().getExecutor(SearchArticlesTask.class, 4), api);
        this.prefix = prefix;
        this.site = site;
    }

    @Override
    public RequestBuilder buildRequest(Api api) {
        return api.action("opensearch").param("search", prefix).param("limit", "12");
    }

    @Override
    public List<PageTitle> processResult(ApiResult result) throws Throwable {
        JSONArray searchResults = result.asArray().optJSONArray(1);

        ArrayList<PageTitle> pageTitles = new ArrayList<PageTitle>();
        for (int i = 0; i < searchResults.length(); i++) {
            pageTitles.add(new PageTitle(null, searchResults.optString(i), site));
        }

        return pageTitles;
    }
}

Increase default search count to 12

Increase default search count to 12

Based off designer feedback

Change-Id: Icbccadb089a2ce650fdcfe4f0560aa5ef0087441


package ch.ethz.scu.obit.common.version;

public class VersionInfo {

	// Program version
	public static final String version = "0.5.6";

	// Version status: "alpha", "beta", or "" for a stable release
	public static final String status = "";

	// Copyright string
	public static final String copyright = "Copyright " +
			Character.toString('\u00A9') +
			" 2012 - 2015, Single Cell Unit, " +
			"D-BSSE, ETH Zurich (Basel)";

	// Properties (XML) file version
	public static final int propertiesVersion = 4;

}

package ch.ethz.scu.obit.common.version;

public class VersionInfo {

	// Program version
	public static final String version = "0.5.7";

	// Version status: "alpha", "beta", or "" for a stable release
	public static final String status = "alpha";

	// Copyright string
	public static final String copyright = "Copyright " +
			Character.toString('\u00A9') +
			" 2012 - 2015, Single Cell Unit, " +
			"D-BSSE, ETH Zurich (Basel)";

	// Properties (XML) file version
	public static final int propertiesVersion = 4;

}

Set devel version to 0.5.7 alpha.

Set devel version to 0.5.7 alpha.


package org.apache.lucene;

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

import org.apache.lucene.util.LuceneTestCase;

public class TestAssertions extends LuceneTestCase {

  public void test() {
    try {
      assert Boolean.FALSE.booleanValue();
      fail("assertions are not enabled!");
    } catch (AssertionError e) {
    }
  }

}

package org.apache.lucene;

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

import org.apache.lucene.util.LuceneTestCase;

public class TestAssertions extends LuceneTestCase {

  public void test() {
    try {
      assert Boolean.FALSE.booleanValue();
      fail("assertions are not enabled!");
    } catch (AssertionError e) {
      assert Boolean.TRUE.booleanValue();
    }
  }

}

Add also the opposite assert statement

LUCENE-1769: Add also the opposite assert statement

git-svn-id: 4c5078813df38efa56971a28e09a55254294f104@891907 13f79535-47bb-0310-9956-ffa450edef68


/*
package com.spectralogic.ds3autogen.c;

import com.spectralogic.ds3autogen.c.models.Element;
import org.junit.Test;

import java.text.ParseException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class Type_Test {
    @Test
    public void testElementTypeArrayToString() throws ParseException {
        Element stringElement = new Element("arrayElement", "array", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    @Test
    public void testElementTypeSetToString() throws ParseException {
        Element stringElement = new Element("setElement", "java.util.Set", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
}
*/

package com.spectralogic.ds3autogen.c;

import com.google.common.collect.ImmutableList;
import com.spectralogic.ds3autogen.api.models.Ds3Element;
import com.spectralogic.ds3autogen.c.models.Type;
import org.junit.Test;

import java.text.ParseException;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class Type_Test {
    @Test
    public void testTypeIsPrimitive() throws ParseException {
        Ds3Element testElement1 = new Ds3Element("intElement", "int", null, null);
        Ds3Element testElement2 = new Ds3Element("boolElement", "boolean", null, null);
        final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
        builder.add(testElement1);
        builder.add(testElement2);
        Type testType = new Type("testType", null, builder.build());
        assertThat(testType.isPrimitiveType(), is(true));
    }
    @Test
    public void testTypeIsNotPrimitive() throws ParseException {
        Ds3Element testElement1 = new Ds3Element("boolElement", "boolean", null, null);
        Ds3Element testElement2 = new Ds3Element("complexElement", "com.spectralogic.s3.server.domain.UserApiBean", null, null);
        final ImmutableList.Builder<Ds3Element> builder = ImmutableList.builder();
        builder.add(testElement1);
        builder.add(testElement2);
        Type testType = new Type("testType", null, builder.build());
        assertThat(testType.isPrimitiveType(), is(false));
    }
    /*
    @Test
    public void testElementTypeArrayToString() throws ParseException {
        Element stringElement = new Element("arrayElement", "array", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    @Test
    public void testElementTypeSetToString() throws ParseException {
        Element stringElement = new Element("setElement", "java.util.Set", null, null);
        assertThat(CHelper.elementTypeToString(stringElement), is(""));
    }
    */
}

Add a few tests for ds3_autogen_c::Type

Add a few tests for ds3_autogen_c::Type


package com.example.e4.rcp.todo.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;

import com.example.e4.rcp.todo.model.ITodoService;
import com.example.e4.rcp.todo.model.Todo;

public class RemoveTodoHandler {
	@Execute
	public void execute(ITodoService model,
			@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Todo todo,
			@Named (IServiceConstants.ACTIVE_SHELL) Shell shell
			) {
		if (todo != null) {
			model.deleteTodo(todo.getId());
		} else {
			MessageDialog.openInformation(shell, "Deletion not possible",
					"No todo selected");
		}
	}
}

package com.example.e4.rcp.todo.handlers;

import javax.inject.Named;

import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;

import com.example.e4.rcp.todo.model.ITodoService;
import com.example.e4.rcp.todo.model.Todo;

public class RemoveTodoHandler {
	@Execute
	public void execute(ITodoService todoService,
			@Optional @Named(IServiceConstants.ACTIVE_SELECTION) Todo todo,
			@Named (IServiceConstants.ACTIVE_SHELL) Shell shell
			) {
		if (todo != null) {
			todoService.deleteTodo(todo.getId());
		} else {
			MessageDialog.openInformation(shell, "Deletion not possible",
					"No todo selected");
		}
	}
}

Rename model to todoService in RemoveTodohandler


package controllers;

import play.*;
import play.data.*;
import play.mvc.*;

import views.html.*;

import static play.data.Form.*;

public class Application extends Controller {

    public static Result home() {
        return ok(home.render("Hi! This is Ode."));
    }

    public static Result login() {
        return ok(login.render("Hi! Use the form below to log in.",
                               form(Login.class)));
    }

    public static Result authenticate() {
        Form<Login> loginForm = form(Login.class).bindFromRequest();
        if (loginForm.hasErrors()) {
            return badRequest(login.render("Do I know you?", loginForm));
        } else {
            return redirect(routes.Application.home());
        }
    }

    public static Result rules() {
        return ok(rules.render("Hi! This is Ode's Rule Browser."));
    }

    public static Result rule(int id) {
        return ok(rule.render("Hi! You are looking at rule " + id + "."));
    }

    public static Result search() {
        return ok(search.render("Hi! This is Ode's Search Interface."));
    }

    public static Result features() {
        return ok(features.render("Hi! This is Ode's Feature Editor."));
    }

    // Forms

    public static class Login {
        public String email;
        public String password;

        public String validate() {
            if (email == "" || password == "") {
                return "You must provide input for all fields.";
            }
            return null;
        }
    }

}

package controllers;

import play.*;
import play.data.*;
import play.mvc.*;

import views.html.*;

import static play.data.Form.*;

public class Application extends Controller {

    public static Result home() {
        return ok(home.render("Hi! This is Ode."));
    }

    public static Result login() {
        return ok(login.render("Hi! Use the form below to log in.",
                               form(Login.class)));
    }

    public static Result authenticate() {
        Form<Login> loginForm = form(Login.class).bindFromRequest();
        if (loginForm.hasErrors()) {
            return badRequest(login.render("Do I know you?", loginForm));
        } else {
            session().clear();
            session("email", loginForm.get().email);
            return redirect(routes.Application.home());
        }
    }

    public static Result rules() {
        return ok(rules.render("Hi! This is Ode's Rule Browser."));
    }

    public static Result rule(int id) {
        return ok(rule.render("Hi! You are looking at rule " + id + "."));
    }

    public static Result search() {
        return ok(search.render("Hi! This is Ode's Search Interface."));
    }

    public static Result features() {
        return ok(features.render("Hi! This is Ode's Feature Editor."));
    }

    // Forms

    public static class Login {
        public String email;
        public String password;

        public String validate() {
            if (email == "" || password == "") {
                return "You must provide input for all fields.";
            }
            return null;
        }
    }

}

Establish new session upon login.

Establish new session upon login.


package com.bishnet.cucumber.parallel.runtime;

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

import cucumber.runtime.ClassFinder;
import cucumber.runtime.Runtime;
import cucumber.runtime.RuntimeOptions;
import cucumber.runtime.io.MultiLoader;
import cucumber.runtime.io.ResourceLoader;
import cucumber.runtime.io.ResourceLoaderClassFinder;

public class FakeCucumberRuntimeFactory extends CucumberRuntimeFactory {

	private byte[] perInvocationExitCodes;
	private boolean[] perInvocationShouldThrowException;
	private int invocationCount;

	public FakeCucumberRuntimeFactory(byte[] perInvocationExitCodes, boolean[] perInvocationShouldThrowException) {
		super(new ArrayList<String>(), new ArrayList<String>());
		this.perInvocationExitCodes = perInvocationExitCodes;
		this.perInvocationShouldThrowException = perInvocationShouldThrowException;
	}

	@Override
	public Runtime getRuntime(List<String> additionalCucumberArgs) {
		RuntimeOptions runtimeOptions = new RuntimeOptions(additionalCucumberArgs);
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		ResourceLoader resourceLoader = new MultiLoader(classLoader);
		ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
		byte exitCode = perInvocationExitCodes[invocationCount % perInvocationExitCodes.length];
		boolean shouldThrowException = perInvocationShouldThrowException[invocationCount % perInvocationExitCodes.length];
		invocationCount++;
        return new FakeCucumberRuntime(exitCode, shouldThrowException, resourceLoader, classFinder, classLoader, runtimeOptions);
	}
}

package com.bishnet.cucumber.parallel.runtime;

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

import cucumber.runtime.ClassFinder;
import cucumber.runtime.Runtime;
import cucumber.runtime.RuntimeOptions;
import cucumber.runtime.io.MultiLoader;
import cucumber.runtime.io.ResourceLoader;
import cucumber.runtime.io.ResourceLoaderClassFinder;

public class FakeCucumberRuntimeFactory extends CucumberRuntimeFactory {

	private byte[] perInvocationExitCodes;
	private boolean[] perInvocationShouldThrowException;
	private int invocationCount;

	public FakeCucumberRuntimeFactory(byte[] perInvocationExitCodes, boolean[] perInvocationShouldThrowException) {
		super(new ArrayList<String>(), new ArrayList<String>());
		this.perInvocationExitCodes = perInvocationExitCodes;
		this.perInvocationShouldThrowException = perInvocationShouldThrowException;
	}

	@Override
	public synchronized Runtime getRuntime(List<String> additionalCucumberArgs) {
		RuntimeOptions runtimeOptions = new RuntimeOptions(additionalCucumberArgs);
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		ResourceLoader resourceLoader = new MultiLoader(classLoader);
		ClassFinder classFinder = new ResourceLoaderClassFinder(resourceLoader, classLoader);
		byte exitCode = perInvocationExitCodes[invocationCount % perInvocationExitCodes.length];
		boolean shouldThrowException = perInvocationShouldThrowException[invocationCount % perInvocationExitCodes.length];
		invocationCount++;
        return new FakeCucumberRuntime(exitCode, shouldThrowException, resourceLoader, classFinder, classLoader, runtimeOptions);
	}
}

Fix race condition in test.

Fix race condition in test.

It must not be possible for two threads to get a runtime at the same
time as this breaks the invocation tracking and associated canned
responses. Synchronizing the get of the runtime prevents this happening.


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

package com.google.sps.servlets;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.logging.Level;
import java.util.logging.Logger;

@WebServlet("/load-event")
public class LoadEventServlet extends HttpServlet {

  private static final Logger LOGGER = Logger.getLogger(EventServlet.class.getName());

  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    // TODO: Implement doGet function.
  }
}

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

package com.google.sps.servlets;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.logging.Level;
import java.util.logging.Logger;

@WebServlet("/load-event")
public class LoadEventServlet extends HttpServlet {

  private static final Logger LOGGER = Logger.getLogger(LoadEventServlet.class.getName());

  @Override
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
    // TODO: Implement doGet function.
  }
}

Change name of class retrieved from logger


/*
 * *****************************************************
 * Copyright VMware, Inc. 2010-2012.  All Rights Reserved.
 * *****************************************************
 *
 * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
 * WARRANTIES OR CONDITIONS # OF ANY KIND, WHETHER ORAL OR WRITTEN,
 * EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY # DISCLAIMS ANY IMPLIED
 * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY # QUALITY,
 * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
 */

package com.vmware.connection.helpers;

import com.vmware.connection.Connection;
import com.vmware.vim25.ServiceContent;
import com.vmware.vim25.VimPortType;

public abstract class BaseHelper {
    Connection connection = null;

    public BaseHelper(final Connection connection) {
    	this.connection = connection.connect();
    }

    public BaseHelper() { }

    public class HelperException extends RuntimeException {
        public HelperException(Throwable cause) {
            super(cause);
        }
    }
}

/*
 * *****************************************************
 * Copyright VMware, Inc. 2010-2012.  All Rights Reserved.
 * *****************************************************
 *
 * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
 * WARRANTIES OR CONDITIONS # OF ANY KIND, WHETHER ORAL OR WRITTEN,
 * EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY # DISCLAIMS ANY IMPLIED
 * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY # QUALITY,
 * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
 */

package com.vmware.connection.helpers;

import com.vmware.connection.Connection;
import com.vmware.vim25.ServiceContent;
import com.vmware.vim25.VimPortType;

public abstract class BaseHelper {
    Connection connection = null;

    public BaseHelper(final Connection connection) {
    	this.connection = connection;
    }

    public BaseHelper() { }

    public class HelperException extends RuntimeException {
        public HelperException(Throwable cause) {
            super(cause);
        }
    }
}

Remove call to the method connect() on the connection


package org.realityforge.replicant.client;

import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public final class ChannelDescriptor
{
  @Nonnull
  private final Enum _graph;
  @Nullable
  private final Object _id;

  public ChannelDescriptor( @Nonnull final Enum graph )
  {
    this( graph, null );
  }

  public ChannelDescriptor( @Nonnull final Enum graph, @Nullable final Object id )
  {
    _graph = Objects.requireNonNull( graph );
    _id = id;
  }

  @Nonnull
  public Class getSystem()
  {
    return _graph.getDeclaringClass();
  }

  @Nonnull
  public Enum getGraph()
  {
    return _graph;
  }

  @Nullable
  public Object getID()
  {
    return _id;
  }

  @Override
  public String toString()
  {
    return _graph.toString() + ( null != _id ? ":" + _id : "" );
  }

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

    final ChannelDescriptor that = (ChannelDescriptor) o;
    return Objects.equals( _graph, that._graph ) && Objects.equals( _id, that._id );
  }

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

package org.realityforge.replicant.client;

import java.util.Objects;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public final class ChannelDescriptor
{
  @Nonnull
  private final Enum _graph;
  @Nullable
  private final Object _id;

  public ChannelDescriptor( @Nonnull final Enum graph )
  {
    this( graph, null );
  }

  public ChannelDescriptor( @Nonnull final Enum graph, @Nullable final Object id )
  {
    _graph = Objects.requireNonNull( graph );
    _id = id;
  }

  @Nonnull
  public Class getSystem()
  {
    return _graph.getDeclaringClass();
  }

  @Nonnull
  public Enum getGraph()
  {
    return _graph;
  }

  @Nullable
  public Object getID()
  {
    return _id;
  }

  @Override
  public String toString()
  {
    return getSystem().getSimpleName() + "." + _graph.toString() + ( null != _id ? ":" + _id : "" );
  }

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

    final ChannelDescriptor that = (ChannelDescriptor) o;
    return Objects.equals( _graph, that._graph ) && Objects.equals( _id, that._id );
  }

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

Increase the level of debugging by outputting system as well


package fr.jcgay.jenkins.plugins.pushbullet;

import hudson.Extension;
import hudson.model.User;
import hudson.model.UserProperty;
import hudson.model.UserPropertyDescriptor;
import hudson.util.Secret;
import org.kohsuke.stapler.DataBoundConstructor;

public class PushbulletUser extends UserProperty {

    private final Secret apiToken;

    @DataBoundConstructor
    public PushbulletUser(String apiToken) {
        this.apiToken = Secret.fromString(apiToken);
    }

    public String getApiToken() {
        return apiToken.getEncryptedValue();
    }

    public Secret getSecretApiToken() {
        return apiToken;
    }

    @Extension
    public static final class DescriptorImpl extends UserPropertyDescriptor {
        public String getDisplayName() {
            return "Pusbullet";
        }

        @Override
        public UserProperty newInstance(User user) {
            return new PushbulletUser(null);
        }
    }

}

package fr.jcgay.jenkins.plugins.pushbullet;

import hudson.Extension;
import hudson.model.User;
import hudson.model.UserProperty;
import hudson.model.UserPropertyDescriptor;
import hudson.util.Secret;
import org.kohsuke.stapler.DataBoundConstructor;

public class PushbulletUser extends UserProperty {

    private final Secret apiToken;

    @DataBoundConstructor
    public PushbulletUser(String apiToken) {
        this.apiToken = Secret.fromString(apiToken);
    }

    public String getApiToken() {
        return apiToken.getEncryptedValue();
    }

    public Secret getSecretApiToken() {
        return apiToken;
    }

    @Extension
    public static final class DescriptorImpl extends UserPropertyDescriptor {
        public String getDisplayName() {
            return "Pushbullet";
        }

        @Override
        public UserProperty newInstance(User user) {
            return new PushbulletUser(null);
        }
    }

}

Fix typo in Pushbullet user section title


/*
Copyright 2010 WebDriver committers
Copyright 2010 Google Inc.
Portions copyright 2011 Software Freedom Conservatory

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.openqa.selenium.android.environment;

import org.openqa.selenium.environment.TestEnvironment;
import org.openqa.selenium.environment.webserver.AppServer;
import org.openqa.selenium.environment.webserver.Jetty7AppServer;

public class AndroidTestEnvironment implements TestEnvironment {
  private AppServer appServer;

  public AndroidTestEnvironment() {
    appServer = new Jetty7AppServer("10.0.2.2");
    appServer.start();
  }

  public AppServer getAppServer() {
    return appServer;
  }

  public void stop() {
    appServer.stop();
  }

  public static void main(String[] args) {
    new AndroidTestEnvironment();
  }
}

/*
Copyright 2010 WebDriver committers
Copyright 2010 Google Inc.
Portions copyright 2011 Software Freedom Conservatory

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.openqa.selenium.android.environment;

import org.openqa.selenium.environment.TestEnvironment;
import org.openqa.selenium.environment.webserver.AppServer;
import org.openqa.selenium.environment.webserver.Jetty7AppServer;

public class AndroidTestEnvironment implements TestEnvironment {
  private AppServer appServer;
  // In order to run the tests on a real device, the device and the host
  // running the tests must be on the same network. This variable should
  // contain the externally-visible IP of the host.
  private static String ANDROID_HOST_IP = "ANDROID_HTTP_HOST";

  public AndroidTestEnvironment() {
    String servingHost = System.getenv(ANDROID_HOST_IP);
    if (servingHost == null) {
      servingHost = "10.0.2.2";
    }
    appServer = new Jetty7AppServer(servingHost);
    appServer.start();
  }

  public AppServer getAppServer() {
    return appServer;
  }

  public void stop() {
    appServer.stop();
  }

  public static void main(String[] args) {
    new AndroidTestEnvironment();
  }
}

EranMes: Allow running the Android tests on a real device by specifying the external IP of the in-process test server.

git-svn-id: 4179480af2c2519a5eb5e1e9b541cbdf5cf27696@14991 07704840-8298-11de-bf8c-fd130f914ac9


/*
 * Copyright 2020 The Netty Project
 *
 * The Netty Project 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:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
final class JniUtil {
    JniUtil() {
        // Dummy class
    }
}

/*
 * Copyright 2020 The Netty Project
 *
 * The Netty Project 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:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/**
 * Dummy class
 */
public final class JniUtil {
    JniUtil() {
        // Dummy class
    }
}

Allow to generate javadocs so the release will not fail


package org.lantern;

import org.apache.commons.lang3.StringUtils;

public class LanternXmppUtils {

    /** This is misspelled -- use jidToResourceId */
    @Deprecated
    public static String jidToInstanceId(final String fullId) {
        return fullId.split("/", 2)[1];
    }

    public static String jidToResourceId(final String fullId) {
        return fullId.split("/", 2)[1];
    }

    public static boolean isLanternJid(final String from) {
        // Here's the format we're looking for: "-lan-"
        if (from.contains("/"+LanternConstants.UNCENSORED_ID)) {
            return true;
        }
        return false;
    }

    public static String jidToEmail(final String jid) {
        if (jid.contains("/")) {
            return StringUtils.substringBefore(jid, "/").toLowerCase();
        }
        return jid.toLowerCase();
    }
}

package org.lantern;

import org.apache.commons.lang3.StringUtils;

public class LanternXmppUtils {

    public static String jidToResourceId(final String fullId) {
        return fullId.split("/", 2)[1];
    }

    public static boolean isLanternJid(final String from) {
        // Here's the format we're looking for: "-lan-"
        if (from.contains("/"+LanternConstants.UNCENSORED_ID)) {
            return true;
        }
        return false;
    }

    public static String jidToEmail(final String jid) {
        return EmailAddressUtils.normalizedEmail(
                StringUtils.substringBefore(jid, "/"));
    }
}

Normalize emails when extracting them from the jid.

This seems to have been the intention before, since it was being
folded to lowercase.


package com.khmelenko.lab.travisclient.fragment;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.webkit.WebView;

import com.khmelenko.lab.travisclient.R;

/**
 * Dialog with licenses
 *
 * @author Dmytro Khmelenko (d.khmelenko@gmail.com)
 */
public class LicensesDialogFragment extends DialogFragment {

    public static LicensesDialogFragment newInstance() {
        return new LicensesDialogFragment();
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        WebView view = (WebView) LayoutInflater.from(getActivity()).inflate(R.layout.dialog_licenses, null);
        view.loadUrl("file:///android_asset/opensource_licenses.html");
        return new AlertDialog.Builder(getActivity(), R.style.Theme_AppCompat_Light_Dialog_Alert)
                .setTitle(getString(R.string.dialog_licenses_title))
                .setView(view)
                .setPositiveButton(android.R.string.ok, null)
                .create();
    }
}

package com.khmelenko.lab.travisclient.fragment;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.webkit.WebView;

import com.khmelenko.lab.travisclient.R;

/**
 * Dialog with licenses
 *
 * @author Dmytro Khmelenko (d.khmelenko@gmail.com)
 */
public class LicensesDialogFragment extends DialogFragment {

    public static LicensesDialogFragment newInstance() {
        return new LicensesDialogFragment();
    }

    @NonNull
    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        WebView view = (WebView) LayoutInflater.from(getActivity()).inflate(R.layout.dialog_licenses, null);
        view.loadUrl("file:///android_asset/opensource_licenses.html");
        return new AlertDialog.Builder(getActivity())
                .setTitle(getString(R.string.dialog_licenses_title))
                .setView(view, 0, 25, 0, 0)
                .create();
    }
}

Update the style of the dialog with open source licenses


import org.fluentlenium.adapter.FluentTest;
import org.junit.ClassRule;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.junit.Rule;

import static org.assertj.core.api.Assertions.assertThat;
import static org.fluentlenium.core.filter.FilterConstructor.*;

public class AppTest extends FluentTest {
  public WebDriver webDriver = new HtmlUnitDriver();

  @Override
  public WebDriver getDefaultDriver() {
    return webDriver;
  }

  @ClassRule
  public static ServerRule server = new ServerRule();

  @Rule
  public DatabaseRule database = new DatabaseRule();

  @Test
  public void rootTest() {
    goTo("http://localhost:4567/");
    assertThat(pageSource()).contains("Welcome to your Stylist Database");
  }

  @Test
  public void categoryIsCreatedTest() {
    Stylist newStylist = new Stylist("Otto Von Bismarck");
    newStylist.save();
    String stylistPath = String.format("http://localhost:4567/stylist/%d", newStylist.getId());
    goTo(stylistPath);
    assertThat(pageSource()).contains("Otto Von Bismarck");
  }

}

import org.fluentlenium.adapter.FluentTest;
import org.junit.ClassRule;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.junit.Rule;

import static org.assertj.core.api.Assertions.assertThat;
import static org.fluentlenium.core.filter.FilterConstructor.*;

public class AppTest extends FluentTest {
  public WebDriver webDriver = new HtmlUnitDriver();

  @Override
  public WebDriver getDefaultDriver() {
    return webDriver;
  }

  @ClassRule
  public static ServerRule server = new ServerRule();

  @Rule
  public DatabaseRule database = new DatabaseRule();

  @Test
  public void rootTest() {
    goTo("http://localhost:4567/");
    assertThat(pageSource()).contains("Welcome to your Stylist Database");
  }

  @Test
  public void stylistIsCreatedTest() {
    Stylist newStylist = new Stylist("Otto Von Bismarck");
    newStylist.save();
    String stylistPath = String.format("http://localhost:4567/stylist/%d", newStylist.getId());
    goTo(stylistPath);
    assertThat(pageSource()).contains("Otto Von Bismarck");
  }

  @Test
  public void stylistIsDisplayedTest() {
    Stylist newStylist = new Stylist("Otto Von Bismarck");
    newStylist.save();
    String stylistPath = String.format("http://localhost:4567/");
    goTo(stylistPath);
    assertThat(pageSource()).contains("Otto Von Bismarck");
  }

}

Add Integration test to ensure new stylists are displaying.


/*
 * Copyright 2014 Click Travel Ltd
 *
 * 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.clicktravel.cheddar.rest.media;

import javax.ws.rs.core.MediaType;

public class MediaTypes {

    public static final String CDM_V1_JSON = "application/vnd.clicktravel.schema-v1+json";

    public static final MediaType CDM_V1_JSON_TYPE = new MediaType("application", "vnd.clicktravel.schema-v1+json");

}

/*
 * Copyright 2014 Click Travel Ltd
 *
 * 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.clicktravel.cheddar.rest.media;

public class MediaTypes {

    public static final String CDM_V1_JSON = "application/vnd.clicktravel.schema-v1+json";

}

Revert "Add MediaType for CDM"

Revert "Add MediaType for CDM"

This reverts commit eaf85e1597ad78baba3a2a4a55ae0081f0acd582.

Signed-off-by: Steffan Westcott <f3c2708f096cd7bd1163d9748b17f6e154c59391@clicktravel.com>


package net.sf.jabref.logic;

import net.sf.jabref.export.layout.format.CreateDocBookAuthors;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AuthorListTest {

    @Test
    public void authorListTest() {
        String authorString = "Olaf von Nilsen, Jr.";
        AuthorList authorList = AuthorList.getAuthorList(authorString);
        for (int i = 0; i < authorList.size(); i++) {
            AuthorList.Author author = authorList.getAuthor(i);
            assertEquals("Jr.", author.getFirst());
            assertEquals("Olaf von Nilsen", author.getLast());
            assertEquals(null, author.getJr());
            assertEquals(null, author.getVon());
        }

        assertEquals("<author><firstname>Jr.</firstname><surname>Olaf von Nilsen</surname></author>", new CreateDocBookAuthors().format(authorString));
    }
}

package net.sf.jabref.logic;

import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class AuthorListTest {

    @Ignore
    @Test
    public void authorListTest() {
        String authorString = "Olaf von Nilsen, Jr.";
        AuthorList authorList = AuthorList.getAuthorList(authorString);
        for (int i = 0; i < authorList.size(); i++) {
            AuthorList.Author author = authorList.getAuthor(i);
            assertEquals("Olaf", author.getFirst());
            assertEquals("Nilsen", author.getLast());
            assertEquals("Jr.", author.getJr());
            assertEquals("von", author.getVon());
        }
    }
}

Fix and disable AuthorList test case

Fix and disable AuthorList test case

The parsing logic in AuthorList.Author is broken and also terribly written (Even Intellij complains that it is too complex for its dataflow analyzer). Until somebody has the will to fix this, there is no point in executing this test.


/*
 * #%L
 * ACS AEM Commons Bundle
 * %%
 * Copyright (C) 2016 Adobe
 * %%
 * 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.
 * #L%
 */
@aQute.bnd.annotation.Version("1.0.2")
package com.adobe.acs.commons.functions;

/*
 * #%L
 * ACS AEM Commons Bundle
 * %%
 * Copyright (C) 2016 Adobe
 * %%
 * 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.
 * #L%
 */
@aQute.bnd.annotation.Version("1.1.0")
package com.adobe.acs.commons.functions;

Update to functions version number

Update to functions version number


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

import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.base.model.primitives.Kind;
import com.google.idea.blaze.base.model.primitives.LanguageClass;
import com.google.idea.blaze.base.model.primitives.RuleType;

class TypeScriptBlazeRules implements Kind.Provider {

  @Override
  public ImmutableSet<Kind> getTargetKinds() {
    return ImmutableSet.of(
        Kind.Provider.create("ng_module", LanguageClass.TYPESCRIPT, RuleType.LIBRARY),
        Kind.Provider.create("ts_library", LanguageClass.TYPESCRIPT, RuleType.LIBRARY),
        Kind.Provider.create("ts_config", LanguageClass.TYPESCRIPT, RuleType.BINARY));
  }
}

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

import com.google.common.collect.ImmutableSet;
import com.google.idea.blaze.base.model.primitives.Kind;
import com.google.idea.blaze.base.model.primitives.LanguageClass;
import com.google.idea.blaze.base.model.primitives.RuleType;

class TypeScriptBlazeRules implements Kind.Provider {

  @Override
  public ImmutableSet<Kind> getTargetKinds() {
    return ImmutableSet.of(
        Kind.Provider.create("ng_module", LanguageClass.TYPESCRIPT, RuleType.LIBRARY),
        Kind.Provider.create("ts_library", LanguageClass.TYPESCRIPT, RuleType.LIBRARY),
        Kind.Provider.create("ts_declaration", LanguageClass.TYPESCRIPT, RuleType.LIBRARY),
        Kind.Provider.create("ts_config", LanguageClass.TYPESCRIPT, RuleType.BINARY));
  }
}

Add `ts_declaration` to the target kinds for the Intellij TypeScript kind provider.

PiperOrigin-RevId: 443097363


/* Copyright (c) 2013 OpenPlans. All rights reserved.
 * This code is licensed under the BSD New License, available at the root
 * application directory.
 */
package org.geogit.api.plumbing.merge;

import java.net.URL;
import java.util.Collections;
import java.util.List;

import org.geogit.api.AbstractGeoGitOp;
import org.geogit.api.plumbing.ResolveGeogitDir;
import com.google.common.base.Preconditions;

public class ConflictsReadOp extends AbstractGeoGitOp<List<Conflict>> {
    @Override
    public List<Conflict> call() {
        final URL repoUrl = getCommandLocator().command(ResolveGeogitDir.class).call();
        if (repoUrl == null) {
            return Collections.emptyList();
        } else {
            getIndex().getDatabase().open();
            return getIndex().getDatabase().getConflicts(null, null);
        }
    }
}

/* Copyright (c) 2013 OpenPlans. All rights reserved.
 * This code is licensed under the BSD New License, available at the root
 * application directory.
 */
package org.geogit.api.plumbing.merge;

import java.net.URL;
import java.util.List;

import org.geogit.api.AbstractGeoGitOp;
import org.geogit.api.plumbing.ResolveGeogitDir;

import com.google.common.collect.ImmutableList;

public class ConflictsReadOp extends AbstractGeoGitOp<List<Conflict>> {
    @Override
    public List<Conflict> call() {
        final URL repoUrl = getCommandLocator().command(ResolveGeogitDir.class).call();
        if (repoUrl == null) {
            return ImmutableList.of();
        } else {
            return getIndex().getDatabase().getConflicts(null, null);
        }
    }
}

Remove unneeded call to StagingDatabase.open()


package dgcj;

public class TemplateDgcjMain {
	static final Object PROBLEM = new TemplateDgcjProblem(); // PROBLEM NAME goes here

	public String run() {
//		long n = ;
//		long from = 1L * n * ID / NODES;
//		long to = 1L * n * (ID + 1) / NODES;

		return null;
	}

	final static boolean SINGLE = false;
	final int NODES = SINGLE ? 1 : message.NumberOfNodes();
	final int ID = SINGLE ? 0 : message.MyNodeId();

	// EXECUTE with non-empty args
	public static void main(String[] args) {
		if (!SINGLE) {
			PROBLEM.equals(args); // Local testing framework invocation
		}
		String ans = new TemplateDgcjMain().run();
		if (ans != null) {
			System.out.println(ans);
		}
	}

	public void log(String msg) {
		PROBLEM.equals(ID + ": " + msg); // Local testing framework log
	}
}

package dgcj;

public class TemplateDgcjMain {
	static final Object PROBLEM = new TemplateDgcjProblem(); // PROBLEM NAME goes here

	public String run() {
//		long n = ;
//		long from = 1L * n * ID / NODES;
//		long to = 1L * n * (ID + 1) / NODES;

		return null;
	}

	static int NODES;
	static int ID;

	/**
	 * Arguments:
	 * ""	= as for submit
	 * "0"	= run multi node infrastructure
	 * "1"	= run single node
	 */
	public static void main(String[] args) {
		PROBLEM.equals(args); // Local testing framework invocation
		boolean single = args.length == 1 && args[0].equals("1");
		NODES = single ? 1 : message.NumberOfNodes();
		ID = single ? 0 : message.MyNodeId();
		String ans = new TemplateDgcjMain().run();
		if (ans != null) {
			System.out.println(ans);
		}
	}

	public void log(String msg) {
		PROBLEM.equals(ID + ": " + msg); // Local testing framework log
	}
}

Update infrastructure for single node run


package ciir.jfoley.chai.collections.iters;

import org.junit.Test;

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

import static org.junit.Assert.assertEquals;

/**
 * @author jfoley
 */
public class GroupByIteratorTest {

  @Test
  public void testLazyGroupBy() {
    List<Integer> data = Arrays.asList(3,3,3,2,2,1,4,4,4,4,6,6,6,6,6,6);

    for (List<Integer> xs : new OneShotIterable<>(new GroupByIterator<>(data.iterator()))) {
      int value = xs.get(0);
      assertEquals(value, xs.size());
    }
  }

}

package ciir.jfoley.chai.collections.iters;

import org.junit.Test;

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

import static org.junit.Assert.assertEquals;

/**
 * @author jfoley
 */
public class GroupByIteratorTest {

  @Test
  public void testLazyGroupBy() {
    List<Integer> data = Arrays.asList(
        3,3,3,
        2,2,
        1,
        4,4,4,4,
        6,6,6,6,6,6);

    for (List<Integer> xs : new OneShotIterable<>(new GroupByIterator<>(data.iterator()))) {
      int value = xs.get(0);
      assertEquals(value, xs.size());
    }
  }

}

Clarify input data for test

Clarify input data for test


package pt.webdetails.cda.exporter;

import java.io.OutputStream;
import java.sql.Timestamp;
import java.util.Date;
import javax.swing.table.TableModel;

/**
 * Created by IntelliJ IDEA.
 * User: pedro
 * Date: Feb 5, 2010
 * Time: 5:06:31 PM
 */
public abstract class AbstractExporter implements Exporter
{

  public abstract void export(final OutputStream out, final TableModel tableModel) throws ExporterException;

  public abstract String getMimeType();

  protected String getColType(final Class<?> columnClass) throws ExporterException
  {

    if (columnClass.equals(String.class))
    {
      return "String";
    }
    else if (columnClass.equals(Integer.class))
    {
      return "Integer";
    }
    else if (columnClass.equals(Number.class) || columnClass.equals(Long.class) || columnClass.equals(Double.class) || columnClass.equals(Float.class) )
    {
      return "Numeric";
    }
    else if (columnClass.equals(Date.class) || columnClass.equals(java.sql.Date.class) || columnClass.equals(Timestamp.class) )
    {
      return "Date";
    }
    else if (columnClass.equals(Object.class) )
    {
      // todo: Quick and dirty hack, as the formula never knows what type is returned.
      return "String";
    }
    else{

      throw new ExporterException("Unknown class: " + columnClass.toString(), null);

    }

  }

}

package pt.webdetails.cda.exporter;

import java.io.OutputStream;
import java.sql.Timestamp;
import java.util.Date;
import javax.swing.table.TableModel;

/**
 * Created by IntelliJ IDEA.
 * User: pedro
 * Date: Feb 5, 2010
 * Time: 5:06:31 PM
 */
public abstract class AbstractExporter implements Exporter
{

  public abstract void export(final OutputStream out, final TableModel tableModel) throws ExporterException;

  public abstract String getMimeType();

  protected String getColType(final Class<?> columnClass) throws ExporterException
  {

    if (columnClass.equals(String.class))
    {
      return "String";
    }
    else if (columnClass.equals(Integer.class) || columnClass.equals(Short.class))
    {
      return "Integer";
    }
    else if (columnClass.equals(Number.class) || columnClass.equals(Long.class) || columnClass.equals(Double.class) || columnClass.equals(Float.class) )
    {
      return "Numeric";
    }
    else if (columnClass.equals(Date.class) || columnClass.equals(java.sql.Date.class) || columnClass.equals(Timestamp.class) )
    {
      return "Date";
    }
    else if (columnClass.equals(Object.class) )
    {
      // todo: Quick and dirty hack, as the formula never knows what type is returned.
      return "String";
    }
    else{

      throw new ExporterException("Unknown class: " + columnClass.toString(), null);

    }

  }

}

Fix for SQL Server smallint

Fix for SQL Server smallint


package fixtures.report;

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

public final class CoverageReporter {
    private static AutoRestReportService client = new AutoRestReportServiceImpl("http://localhost:3000");

    private CoverageReporter() { }

    public static void main(String[] args) throws Exception {
        Map<String, Integer> report = client.getReport().getBody();

        // Body cannot be null
        report.put("putStringNull", 1);
        report.put("OptionalIntegerParameter", 1);
        report.put("OptionalStringParameter", 1);
        report.put("OptionalClassParameter", 1);
        report.put("OptionalArrayParameter", 1);

        // Put must contain a body
        report.put("OptionalImplicitBody", 1);

        // OkHttp can actually overwrite header "Content-Type"
        report.put("HeaderParameterProtectedKey", 1);

        // Redirects not suppoted by OkHttp
        report.put("HttpRedirect301Put", 1);
        report.put("HttpRedirect302Patch", 1);

        report.put("FileStreamVeryLarge", 1);

        int total = report.size();
        int hit = 0;
        List<String> missing = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : report.entrySet()) {
            if (entry.getValue() != 0) {
                hit++;
            } else {
                missing.add(entry.getKey());
            }
        }
        System.out.println(hit + " out of " + total + " tests hit. Missing tests:");
        for (String scenario : missing) {
            System.out.println(scenario);
        }
    }
}

package fixtures.report;

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

public final class CoverageReporter {
    private static AutoRestReportService client = new AutoRestReportServiceImpl("http://localhost:3000");

    private CoverageReporter() { }

    public static void main(String[] args) throws Exception {
        Map<String, Integer> report = client.getReport().getBody();

        // Body cannot be null
        report.put("putStringNull", 1);
        report.put("OptionalIntegerParameter", 1);
        report.put("OptionalStringParameter", 1);
        report.put("OptionalClassParameter", 1);
        report.put("OptionalArrayParameter", 1);

        // Put must contain a body
        report.put("OptionalImplicitBody", 1);

        // OkHttp can actually overwrite header "Content-Type"
        report.put("HeaderParameterProtectedKey", 1);

        // Redirects not suppoted by OkHttp
        report.put("HttpRedirect301Put", 1);
        report.put("HttpRedirect302Patch", 1);

        int total = report.size();
        int hit = 0;
        List<String> missing = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : report.entrySet()) {
            if (entry.getValue() != 0) {
                hit++;
            } else {
                missing.add(entry.getKey());
            }
        }
        System.out.println(hit + " out of " + total + " tests hit. Missing tests:");
        for (String scenario : missing) {
            System.out.println(scenario);
        }
    }
}

Remove entry from coverage reporter

Remove entry from coverage reporter


package me.footlights.plugin;

public interface ModifiablePreferences extends Preferences
{
	public Preferences set(String key, String value);
	public Preferences set(String key, boolean value);
	public Preferences set(String key, int value);
	public Preferences set(String key, float value);
}

/*
 * Copyright 2011 Jonathan Anderson
 *
 * 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 me.footlights.plugin;

/**
 * A mutable version of {@link Preferences}.
 *
 * The actual storage bookkeeping is hidden as an implementation detail.
 */
public interface ModifiablePreferences extends Preferences
{
	public Preferences set(String key, String value);
	public Preferences set(String key, boolean value);
	public Preferences set(String key, int value);
	public Preferences set(String key, float value);
}

Add missing copyright notice and description.


package com.elmakers.mine.bukkit.magicquests;

import com.elmakers.mine.bukkit.api.event.CastEvent;
import com.elmakers.mine.bukkit.api.spell.Spell;
import me.blackvein.quests.CustomObjective;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;

import java.util.Map;

public class SpellCastObjective extends CustomObjective {

    public SpellCastObjective() {
        this.setName("Magic Spell Cast");
        this.setAuthor("NathanWolf");
        this.setEnableCount(true);
        this.setShowCount(true);
        this.addData("Spell");
        this.setCountPrompt("Enter the number of times the player must cast the spell:");
        this.addDescription("Spell", "The name of the Magic spell the player must have cast.");
        this.setDisplay("Cast %Spell%: %count%");
    }

    @EventHandler
    public void onSpellCast(CastEvent event) {
        Player player = event.getMage().getPlayer();
        if (player == null) return;

        Map<String, Object> map = getDatamap(player, this);
        String spellName = (String)map.get("Spell");
        if (spellName == null) return;

        Spell spell = event.getSpell();
        if (!spellName.equalsIgnoreCase(spell.getName()) && !spellName.equalsIgnoreCase(spell.getKey())) return;

        incrementObjective(player, this, 1);
    }
}

Fix nbsp characters in text

Fix nbsp characters in text


package com.gmail.St3venAU.plugins.ArmorStandTools;

@SuppressWarnings("unused")
class NMS_v1_16_R2 extends NMS {

    public NMS_v1_16_R2(String nmsVersion) {
        super(
                nmsVersion,
                "bA"
        );
    }

}

package com.gmail.St3venAU.plugins.ArmorStandTools;

@SuppressWarnings("unused")
class NMS_v1_16_R2 extends NMS {

    public NMS_v1_16_R2(String nmsVersion) {
        super(
                nmsVersion,
                "bv"
        );
    }

}

Update disabled slots field name to 'bv' for 1.16.2


package io.github.hidroh.materialistic;

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

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

public abstract class TrackableActivity extends ActionBarActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (Preferences.darkThemeEnabled(this)) {
            setTheme(R.style.AppTheme_Dark);
        }
        getTheme().applyStyle(Preferences.resolveTextSizeResId(this), true);
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onStart() {
        super.onStart();
        GoogleAnalytics.getInstance(this).reportActivityStart(this);
    }

    @Override
    protected void onStop() {
        GoogleAnalytics.getInstance(this).reportActivityStop(this);
        super.onStop();
    }
}

package io.github.hidroh.materialistic;

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

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

public abstract class TrackableActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        if (Preferences.darkThemeEnabled(this)) {
            setTheme(R.style.AppTheme_Dark);
        }
        getTheme().applyStyle(Preferences.resolveTextSizeResId(this), true);
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onStart() {
        super.onStart();
        GoogleAnalytics.getInstance(this).reportActivityStart(this);
    }

    @Override
    protected void onStop() {
        GoogleAnalytics.getInstance(this).reportActivityStop(this);
        super.onStop();
    }
}

Switch from deprecated ActionBarActivity to AppCompatActivity


/*
 * Copyright ©1998-2021 by Richard A. Wilkes. All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, version 2.0. If a copy of the MPL was not distributed with
 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as
 * defined by the Mozilla Public License, version 2.0.
 */

package com.trollworks.gcs.expression.function;

import com.trollworks.gcs.expression.EvaluationException;
import com.trollworks.gcs.expression.Evaluator;
import com.trollworks.gcs.utility.Dice;
import com.trollworks.gcs.utility.I18n;

public class Roll implements ExpressionFunction {
    @Override
    public final String getName() {
        return "roll";
    }

    @Override
    public final Object execute(Evaluator evaluator, String arguments) throws EvaluationException {
        try {
            Dice dice = new Dice(arguments);
            return Double.valueOf(dice.roll(false));
        } catch (Exception exception) {
            throw new EvaluationException(String.format(I18n.text("Invalid dice specification: %s"), arguments));
        }
    }
}

/*
 * Copyright ©1998-2021 by Richard A. Wilkes. All rights reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, version 2.0. If a copy of the MPL was not distributed with
 * this file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This Source Code Form is "Incompatible With Secondary Licenses", as
 * defined by the Mozilla Public License, version 2.0.
 */

package com.trollworks.gcs.expression.function;

import com.trollworks.gcs.expression.EvaluationException;
import com.trollworks.gcs.expression.Evaluator;
import com.trollworks.gcs.utility.Dice;
import com.trollworks.gcs.utility.I18n;

public class Roll implements ExpressionFunction {
    @Override
    public final String getName() {
        return "roll";
    }

    @Override
    public final Object execute(Evaluator evaluator, String arguments) throws EvaluationException {
        try {
            Dice dice = new Dice(arguments.contains("(") ? new Evaluator(evaluator).evaluate(arguments).toString() : arguments);
            return Double.valueOf(dice.roll(false));
        } catch (Exception exception) {
            throw new EvaluationException(String.format(I18n.text("Invalid dice specification: %s"), arguments));
        }
    }
}

Allow expressions like roll(dice(1, 4, 1)) to work


package com.github.aleksandermielczarek.napkin;

import android.content.Context;
import android.support.v4.app.Fragment;

/**
 * Created by Aleksander Mielczarek on 14.05.2016.
 */
public class Napkin {

    private Napkin() {

    }

    public static <T> T provideComponent(Object object) {
        ComponentProvider<T> componentProvider = (ComponentProvider<T>) object;
        return componentProvider.provideComponent();
    }

    public static <T> T provideAppComponent(Context context) {
        Context application = context.getApplicationContext();
        return provideComponent(application);
    }

    public static <T> T provideAppComponent(Fragment fragment) {
        Context application = fragment.getContext().getApplicationContext();
        return provideComponent(application);
    }

    public static <T> T provideActivityComponent(Fragment fragment) {
        Context activity = fragment.getActivity();
        return provideComponent(activity);
    }

}

package com.github.aleksandermielczarek.napkin;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.view.View;

/**
 * Created by Aleksander Mielczarek on 14.05.2016.
 */
public class Napkin {

    private Napkin() {

    }

    @SuppressWarnings("unchecked")
    public static <T> T provideComponent(Object object) {
        ComponentProvider<T> componentProvider = (ComponentProvider<T>) object;
        return componentProvider.provideComponent();
    }

    public static <T> T provideAppComponent(Context context) {
        Context application = context.getApplicationContext();
        return provideComponent(application);
    }

    public static <T> T provideAppComponent(Fragment fragment) {
        Context context = fragment.getContext();
        return provideAppComponent(context);
    }

    public static <T> T provideAppComponent(View view) {
        Context context = view.getContext();
        return provideAppComponent(context);
    }

    public static <T> T provideActivityComponent(Fragment fragment) {
        Context activity = fragment.getActivity();
        return provideComponent(activity);
    }

    public static <T> T provideActivityComponent(View view) {
        Context activity = view.getContext();
        return provideComponent(activity);
    }
}

Allow to retrieve component from View

Allow to retrieve component from View


package au.gov.ga.geodesy.domain.model.event;

import java.time.Instant;
import java.util.Calendar;
import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

public class EventRepositoryImpl implements EventRepositoryCustom {

    @PersistenceContext(unitName = "geodesy")
    private EntityManager entityManager;

    public List<Event> getPendingEvents() {

        // TODO: try to remove oneMinuteAgo
        String queryString = "select e from Event e "
            + "where e.timeHandled is null and (e.retries is null or e.retries < " + Event.MAX_RETRIES + ") and (e.timePublished is null or e.timePublished < :oneMinuteAgo)";

        TypedQuery<Event> query = entityManager.createQuery(queryString, Event.class);
        Calendar c = Calendar.getInstance();
        c.add(Calendar.MINUTE, -1);
        query.setParameter("oneMinuteAgo", c.getTime());
        return query.getResultList();
    }
}

package au.gov.ga.geodesy.domain.model.event;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;

public class EventRepositoryImpl implements EventRepositoryCustom {

    @PersistenceContext(unitName = "geodesy")
    private EntityManager entityManager;

    // TODO: move out of custom
    public List<Event> getPendingEvents() {

        String queryString = "select e from Event e "
            + "where e.timeHandled is null and (e.retries is null or e.retries < " + Event.MAX_RETRIES + ") and (e.timePublished is null)";

        TypedQuery<Event> query = entityManager.createQuery(queryString, Event.class);
        return query.getResultList();
    }
}

Remove recently published test for pending events

Former-commit-id: c85ae777aea382c08b9d5da5fd519d20d2b6baf6


/*
 * Copyright (C) 2009 JavaRosa
 *
 * 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.javarosa.xpath.parser.ast;

import org.javarosa.xpath.expr.XPathExpression;
import org.javarosa.xpath.expr.XPathFilterExpr;
import org.javarosa.xpath.parser.XPathSyntaxException;

import java.util.Enumeration;
import java.util.Vector;

public class ASTNodeFilterExpr extends ASTNode {
    public ASTNodeAbstractExpr expr;
    public Vector predicates;

    public ASTNodeFilterExpr() {
        predicates = new Vector();
    }

    public Vector getChildren() {
        Vector v = new Vector();
        v.addElement(expr);
        for (Enumeration e = predicates.elements(); e.hasMoreElements(); )
            v.addElement(e.nextElement());
        return v;
    }

    public XPathExpression build() throws XPathSyntaxException {
        XPathExpression[] preds = new XPathExpression[predicates.size()];
        for (int i = 0; i < preds.length; i++)
            preds[i] = ((ASTNode)predicates.elementAt(i)).build();

        return new XPathFilterExpr(expr.build(), preds);
    }
}

package org.javarosa.xpath.parser.ast;

import org.javarosa.xpath.expr.XPathExpression;
import org.javarosa.xpath.expr.XPathFilterExpr;
import org.javarosa.xpath.parser.XPathSyntaxException;

import java.util.Enumeration;
import java.util.Vector;

public class ASTNodeFilterExpr extends ASTNode {
    public ASTNodeAbstractExpr expr;
    public Vector predicates;

    public ASTNodeFilterExpr() {
        predicates = new Vector();
    }

    @Override
    public Vector getChildren() {
        Vector v = new Vector();
        v.addElement(expr);
        for (Enumeration e = predicates.elements(); e.hasMoreElements(); )
            v.addElement(e.nextElement());
        return v;
    }

    @Override
    public XPathExpression build() throws XPathSyntaxException {
        XPathExpression[] preds = new XPathExpression[predicates.size()];
        for (int i = 0; i < preds.length; i++)
            preds[i] = ((ASTNode)predicates.elementAt(i)).build();

        return new XPathFilterExpr(expr.build(), preds);
    }
}

Add override and remove licensing comment


package org.granite.classification.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.TreeSet;

@JsonIgnoreProperties(ignoreUnknown = true)
public class TrainingText implements Comparable<TrainingText> {
    private int id;
    private TreeSet<String> classifications = new TreeSet<>();
    private TreeSet<String> wordBag = new TreeSet<>();
    private String text;

    TrainingText(){}

    public TrainingText(final int id, final TreeSet<String> classifications, final String text) {
        this.id = id;
        this.classifications = classifications;
        this.text = text;
    }

    public int getId() {
        return id;
    }

    public TreeSet<String> getClassifications() {
        return classifications;
    }

    public TreeSet<String> getWordBag() {
        return wordBag;
    }

    public String getText() {
        return text;
    }

    @Override
    public int compareTo(TrainingText trainingText) {
        return Integer.compare(id, trainingText.getId());
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof TrainingText
                && getId() == ((TrainingText) obj).getId();
    }

    @Override
    public int hashCode() {
        return getId();
    }
}

package org.granite.classification.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.TreeSet;

@JsonIgnoreProperties(ignoreUnknown = true)
public class TrainingText implements Comparable<TrainingText> {
    private int id;
    private TreeSet<String> classifications = new TreeSet<>();
    private TreeSet<String> wordBag = new TreeSet<>();
    private String text;

    TrainingText(){}

    public TrainingText(final int id, final String text) {
        this.id = id;
        this.text = text;
    }

    public int getId() {
        return id;
    }

    public TreeSet<String> getClassifications() {
        return classifications;
    }

    public TreeSet<String> getWordBag() {
        return wordBag;
    }

    public String getText() {
        return text;
    }

    @Override
    public int compareTo(TrainingText trainingText) {
        return Integer.compare(id, trainingText.getId());
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof TrainingText
                && getId() == ((TrainingText) obj).getId();
    }

    @Override
    public int hashCode() {
        return getId();
    }
}

Remove set requirement in training text class constructor


package com.thaiopensource.xml.dtd.app;

import java.io.IOException;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;

import com.thaiopensource.xml.out.CharRepertoire;
import com.thaiopensource.xml.out.XmlWriter;
import com.thaiopensource.xml.util.EncodingMap;
import com.thaiopensource.xml.dtd.om.DtdParser;
import com.thaiopensource.xml.dtd.om.Dtd;
import com.thaiopensource.xml.dtd.parse.DtdParserImpl;

public class Driver {
  public static void main (String args[]) throws IOException {
    DtdParser dtdParser = new DtdParserImpl();
    Dtd dtd = dtdParser.parse(args[0], new FileEntityManager());
    String enc = EncodingMap.getJavaName(dtd.getEncoding());
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out,
								 enc));
    CharRepertoire cr = CharRepertoire.getInstance(enc);
    new SchemaWriter(new XmlWriter(w, cr)).writeDtd(dtd);
    w.flush();
  }
}

package com.thaiopensource.xml.dtd.app;

import java.io.IOException;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;

import com.thaiopensource.xml.out.CharRepertoire;
import com.thaiopensource.xml.out.XmlWriter;
import com.thaiopensource.xml.util.EncodingMap;
import com.thaiopensource.xml.dtd.om.DtdParser;
import com.thaiopensource.xml.dtd.om.Dtd;
import com.thaiopensource.xml.dtd.parse.DtdParserImpl;

public class Driver {
  public static void main (String args[]) throws IOException {
    DtdParser dtdParser = new DtdParserImpl();
    Dtd dtd = dtdParser.parse(args[0], new FileEntityManager());
    new RelaxNgWriter(null).writeDtd(dtd);
    String enc = EncodingMap.getJavaName(dtd.getEncoding());
    BufferedWriter w = new BufferedWriter(new OutputStreamWriter(System.out,
								 enc));
    CharRepertoire cr = CharRepertoire.getInstance(enc);
    new SchemaWriter(new XmlWriter(w, cr)).writeDtd(dtd);
    w.flush();
  }
}

Call RelaxNgWriter as a temporary hack.

Call RelaxNgWriter as a temporary hack.


package net.happygiraffe.jslint;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

/**
 * A command line interface to {@link JSLint}.
 *
 * @author dom
 * @version $Id$
 */
public class Main {

    /**
     * The main entry point. Try passing in "--help" for more details.
     *
     * @param args  One or more JavaScript files.
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        JSLint lint = new JSLint();
        lint.addOption(Option.EQEQEQ);
        lint.addOption(Option.UNDEF);
        lint.addOption(Option.WHITE);
        for (String file : args) {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    new FileInputStream(file)));
            List<Issue> issues = lint.lint(file, reader);
            for (Issue issue : issues) {
                System.err.println(issue);
            }
        }
    }

}

package net.happygiraffe.jslint;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

/**
 * A command line interface to {@link JSLint}.
 *
 * @author dom
 * @version $Id$
 */
public class Main {

    /**
     * The main entry point. Try passing in "--help" for more details.
     *
     * @param args
     *                One or more JavaScript files.
     * @throws IOException
     */
    public static void main(String[] args) throws IOException {
        JSLint lint = new JSLint();
        lint.addOption(Option.EQEQEQ);
        lint.addOption(Option.UNDEF);
        lint.addOption(Option.WHITE);
        for (String file : args) {
            lintFile(lint, file);
        }
    }

    private static void lintFile(JSLint lint, String file) throws IOException {
        try {
            BufferedReader reader = new BufferedReader(new InputStreamReader(
                    new FileInputStream(file)));
            List<Issue> issues = lint.lint(file, reader);
            for (Issue issue : issues) {
                System.err.println(issue);
            }
        } catch (FileNotFoundException e) {
            System.err.println(file + ":no such file");
        }
    }

}

Print out a file not found message instead of blowing up.


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

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

class CustomNamesParameterizedTest {

    @DisplayName("Display name of test container")
    @ParameterizedTest(name = "[{index}] first argument=\"{0}\", second argument={1}")
    @CsvSource({ "hello, 1", "world, 2", "'hello, world', 3" })
    void testWithCustomDisplayNames(String first, int second) {
        System.out.println(
                "Testing with parameters: " + first + " and " + second);
    }

}

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

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;

class CustomNamesParameterizedTest {

    @DisplayName("Display name of test container")
    @ParameterizedTest(name = "[{index}] first argument=\"{0}\", second argument={1}")
    @CsvSource({ "mastering, 1", "parameterized, 2", "tests, 3" })
    void testWithCustomDisplayNames(String first, int second) {
        System.out.println(
                "Testing with parameters: " + first + " and " + second);
    }

}

Update parameterized test with custom display name


package refinedstorage.integration;

import com.google.common.base.Function;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import refinedstorage.block.EnumGridType;
import refinedstorage.container.ContainerGrid;

public class IntegrationCraftingTweaks {

	public static final String MOD_ID = "craftingtweaks";

	public static void register() {
		if(Loader.isModLoaded(MOD_ID)) {
			NBTTagCompound tagCompound = new NBTTagCompound();
			tagCompound.setString("ContainerClass", ContainerGrid.class.getName());
			tagCompound.setString("ContainerCallback", ContainerCallback.class.getName());
			tagCompound.setInteger("GridSlotNumber", 36);
			tagCompound.setString("AlignToGrid", "left");
			FMLInterModComms.sendMessage(MOD_ID, "RegisterProvider", tagCompound);
		}
	}

	public static class ContainerCallback implements Function<ContainerGrid, Boolean> {
		@Override
		public Boolean apply(ContainerGrid containerGrid) {
			return containerGrid.getGrid().getType() == EnumGridType.CRAFTING;
		}
	}
}

package refinedstorage.integration;

import com.google.common.base.Function;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import refinedstorage.block.EnumGridType;
import refinedstorage.container.ContainerGrid;

public class IntegrationCraftingTweaks {

	public static final String MOD_ID = "craftingtweaks";

	public static void register() {
		if(Loader.isModLoaded(MOD_ID)) {
			NBTTagCompound tagCompound = new NBTTagCompound();
			tagCompound.setString("ContainerClass", ContainerGrid.class.getName());
			tagCompound.setString("ContainerCallback", ContainerCallback.class.getName());
			tagCompound.setInteger("GridSlotNumber", 36);
			tagCompound.setString("AlignToGrid", "left");
			FMLInterModComms.sendMessage(MOD_ID, "RegisterProviderV2", tagCompound);
		}
	}

	public static class ContainerCallback implements Function<ContainerGrid, Boolean> {
		@Override
		public Boolean apply(ContainerGrid containerGrid) {
			return containerGrid.getGrid().getType() == EnumGridType.CRAFTING;
		}
	}
}

Make CraftingTweaks integration use RegisterProviderV2 so it doesn't trigger on older versions of CraftingTweaks.


package ca.etsmtl.applets.etsmobile.util;

import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.util.Comparator;

import ca.etsmtl.applets.etsmobile.model.Moodle.MoodleCourse;
import ca.etsmtl.applets.etsmobile.model.Moodle.MoodleCourses;
import ca.etsmtl.applets.etsmobile.model.Seances;

/**
 * Created by Steven on 2016-01-14.
 */
public class CourseComparator implements Comparator<MoodleCourse> {

    @Override
    public int compare(MoodleCourse course1, MoodleCourse course2) {
        String shortname1 = course1.getShortname().substring(3,5) + "." + course1.getShortname().substring(5,6);
        String shortname2 = course2.getShortname().substring(3,5) + "." + course2.getShortname().substring(5,6);

        if (Double.valueOf(shortname1) > Double.valueOf(shortname2)) {
            return 1;
        }

        if (Double.valueOf(shortname1) < Double.valueOf(shortname2)) {
            return -1;
        }

        return 0;
    }
}

package ca.etsmtl.applets.etsmobile.util;

import java.util.Comparator;

import ca.etsmtl.applets.etsmobile.model.Moodle.MoodleCourse;

/**
 * Created by Steven on 2016-01-14.
 */
public class CourseComparator implements Comparator<MoodleCourse> {

    @Override
    public int compare(MoodleCourse course1, MoodleCourse course2) {
        String shortname1 = course1.getShortname().substring(3,5) + "." + course1.getShortname().substring(5,6);
        String shortname2 = course2.getShortname().substring(3,5) + "." + course2.getShortname().substring(5,6);

        if (shortname1.equals("cu.l") || shortname2.equals("cu.l"))
            return 0;

        if (Double.valueOf(shortname1) > Double.valueOf(shortname2)) {
            return 1;
        }

        if (Double.valueOf(shortname1) < Double.valueOf(shortname2)) {
            return -1;
        }

        return 0;
    }
}

Return 0 if a shortname equals to "cu.l"

"cu.l" can't be converted to double


/**
 * Copyright © 2012-2019 Jesse Gallagher
 *
 * 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 darwino;

import java.util.List;

import com.darwino.commons.platform.beans.ManagedBeansExtension;
import com.darwino.commons.platform.properties.PropertiesExtension;
import com.darwino.j2ee.platform.DefaultWebBeanExtension;
import com.darwino.j2ee.platform.DefaultWebPropertiesExtension;

/**
 * J2EE Plugin for registering the services.
 */
public class AppPlugin extends AppBasePlugin {

	public AppPlugin() {
		super("frostillic.us J2EE Application"); //$NON-NLS-1$
	}

	@Override
	public void findExtensions(Class<?> serviceClass, List<Object> extensions) {
		if(serviceClass==ManagedBeansExtension.class) {
			extensions.add(new DefaultWebBeanExtension());
		} else if(serviceClass==PropertiesExtension.class) {
			extensions.add(new DefaultWebPropertiesExtension());
		}
	}
}

/**
 * Copyright © 2012-2019 Jesse Gallagher
 *
 * 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 darwino;

import java.util.List;

import com.darwino.commons.platform.beans.ManagedBeansExtension;
import com.darwino.commons.platform.properties.PropertiesExtension;
import com.darwino.j2ee.platform.DefaultWebBeanExtension;
import com.darwino.j2ee.platform.DefaultWebPropertiesExtension;

/**
 * J2EE Plugin for registering the services.
 */
public class AppPlugin extends AppBasePlugin {

	public AppPlugin() {
		super("frostillic.us Jakarta EE Application"); //$NON-NLS-1$
	}

	@Override
	public void findExtensions(Class<?> serviceClass, List<Object> extensions) {
		if(serviceClass==ManagedBeansExtension.class) {
			extensions.add(new DefaultWebBeanExtension());
		} else if(serviceClass==PropertiesExtension.class) {
			extensions.add(new DefaultWebPropertiesExtension());
		}
	}
}

Change an instance of J2EE -> Jakarta EE


package com.pennapps.labs.pennmobile.api;

public class DiningAPI extends API {

    public DiningAPI() {
        super();
        BASE_URL = "https://37922702.ngrok.com/";
    }
}

package com.pennapps.labs.pennmobile.api;

import android.util.Log;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

import java.io.IOException;

public class DiningAPI extends API {

    public DiningAPI() {
        super();
        BASE_URL = "http://api.pennlabs.org:5000/dining/";
    }

    public JSONObject getVenues() {
        HttpGet httpGet = new HttpGet(BASE_URL + "venues");
        try {
            HttpResponse response = httpClient.execute(httpGet);
            JSONTokener tokener = new JSONTokener(inputStreamToString
                    (response.getEntity().getContent()).toString());
            return new JSONObject(tokener);
        } catch (IOException e) {
            Log.v("vivlabs", "" + e);
            return null;
        } catch (JSONException e) {
            Log.v("vivlabs", "" + e);
            return null;
        }
    }

    public JSONObject getDailyMenu(String hallID) {
        HttpGet httpGet = new HttpGet(BASE_URL + "daily_menu/" + hallID);
        try {
            HttpResponse response = httpClient.execute(httpGet);
            JSONTokener tokener = new JSONTokener(inputStreamToString
                    (response.getEntity().getContent()).toString());
            return new JSONObject(tokener);
        } catch (IOException e) {
            Log.v("vivlabs", "" + e);
            return null;
        } catch (JSONException e) {
            Log.v("vivlabs", "" + e);
            return null;
        }
    }

    public JSONObject getWeeklyMenu(String hallID) {
        HttpGet httpGet = new HttpGet(BASE_URL + "weekly_menu/" + hallID);
        try {
            HttpResponse response = httpClient.execute(httpGet);
            JSONTokener tokener = new JSONTokener(inputStreamToString
                    (response.getEntity().getContent()).toString());
            return new JSONObject(tokener);
        } catch (IOException e) {
            Log.v("vivlabs", "" + e);
            return null;
        } catch (JSONException e) {
            Log.v("vivlabs", "" + e);
            return null;
        }
    }
}

Update Dining API URL and add URL methods


package com.mudalov.safe.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

/**
 * API Entry point, links commands and execution contexts
 *
 * User: mudalov
 * Date: 22/01/15
 * Time: 23:57
 */
public class SafeCommands {

    private static final Logger log = LoggerFactory.getLogger(SafeCommands.class);

    private static final ReentrantLock groupContextLock = new ReentrantLock();

    private static final Map<String, GroupExecutionContext> groupContexts = new ConcurrentHashMap<String, GroupExecutionContext>();

    private static final String DefaultGroup = "DefaultGroup";

    private SafeCommands() {
    }

    public static <T> CommandRef<T> create(AbstractCommand<T> command, String group) {
        GroupExecutionContext groupContext = getGroupContext(group);
        command.setContext(groupContext);
        return new CommandRef<T>(groupContext, command);
    }

    public static <T> CommandRef<T> create(AbstractCommand<T> command) {
        return create(command, DefaultGroup);
    }

    private static GroupExecutionContext getGroupContext(String groupName) {
        GroupExecutionContext context = groupContexts.get(groupName);
        if (context != null) {
            return context;
        }
        groupContextLock.lock();
        try {
            context = groupContexts.get(groupName);
            if (context != null) {
                return context;
            }
            context = new GroupExecutionContext(groupName);
            groupContexts.put(groupName, context);
            return context;
        } finally {
            groupContextLock.unlock();
        }
    }

}

package com.mudalov.safe.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

/**
 * API Entry point, links commands and execution contexts
 *
 * User: mudalov
 * Date: 22/01/15
 * Time: 23:57
 */
public class SafeCommands {

    private static final ConcurrentHashMap<String, GroupExecutionContext> groupContexts = new ConcurrentHashMap<String, GroupExecutionContext>();

    private static final String DefaultGroup = "DefaultGroup";

    private SafeCommands() {
    }

    public static <T> CommandRef<T> create(AbstractCommand<T> command, String group) {
        GroupExecutionContext groupContext = getGroupContext(group);
        command.setContext(groupContext);
        return new CommandRef<T>(groupContext, command);
    }

    public static <T> CommandRef<T> create(AbstractCommand<T> command) {
        return create(command, DefaultGroup);
    }

    private static GroupExecutionContext getGroupContext(String groupName) {
        GroupExecutionContext context = groupContexts.get(groupName);
        if (context != null) {
            return context;
        }
        context = new GroupExecutionContext(groupName);
        GroupExecutionContext prevContext = groupContexts.putIfAbsent(groupName, context);
        if (prevContext == null) {
            return context;
        } else {
            return prevContext;
        }
    }

}

Remove unnecessary lock on context creation


package hudson.plugins.git;

import com.google.common.base.Joiner;

import java.util.regex.Pattern;

public class SubmoduleConfig implements java.io.Serializable {
    private static final long serialVersionUID = 1L;
    String   submoduleName;
    String[] branches;

    public String getSubmoduleName() {
        return submoduleName;
    }

    public void setSubmoduleName(String submoduleName) {
        this.submoduleName = submoduleName;
    }

    public String[] getBranches() {
        return branches;
    }

    public void setBranches(String[] branches) {
        this.branches = branches;
    }

    public boolean revisionMatchesInterest(Revision r) {
        for (Branch br : r.getBranches()) {
            if (branchMatchesInterest(br)) return true;
        }
        return false;
    }

    public boolean branchMatchesInterest(Branch br) {
        for (String regex : branches) {
            if (!Pattern.matches(regex, br.getName())) {
                return false;
            }
        }
        return true;
    }

    public String getBranchesString() {
        return Joiner.on(',').join(branches);
    }
}

package hudson.plugins.git;

import com.google.common.base.Joiner;
import java.util.Arrays;

import java.util.regex.Pattern;

public class SubmoduleConfig implements java.io.Serializable {
    private static final long serialVersionUID = 1L;
    String   submoduleName;
    String[] branches;

    public String getSubmoduleName() {
        return submoduleName;
    }

    public void setSubmoduleName(String submoduleName) {
        this.submoduleName = submoduleName;
    }

    public String[] getBranches() {
        /* findbugs correctly complains that returning branches exposes the
         * internal representation of the class to callers.  Returning a copy
         * of the array does not expose internal representation, at the possible
         * expense of some additional memory.
         */
        return Arrays.copyOf(branches, branches.length);
    }

    public void setBranches(String[] branches) {
        /* findbugs correctly complains that assign to branches exposes the
         * internal representation of the class to callers.  Assigning a copy
         * of the array does not expose internal representation, at the possible
         * expense of some additional memory.
         */
        this.branches = Arrays.copyOf(branches, branches.length);
    }

    public boolean revisionMatchesInterest(Revision r) {
        for (Branch br : r.getBranches()) {
            if (branchMatchesInterest(br)) return true;
        }
        return false;
    }

    public boolean branchMatchesInterest(Branch br) {
        for (String regex : branches) {
            if (!Pattern.matches(regex, br.getName())) {
                return false;
            }
        }
        return true;
    }

    public String getBranchesString() {
        return Joiner.on(',').join(branches);
    }
}

Return copy of String array rather than returning internal String array

Findbugs correctly complains that returning the internal String array exposes
internal implementation to callers.