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

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import io.airlift.dbpool.H2EmbeddedDataSource;
import io.airlift.dbpool.H2EmbeddedDataSourceConfig;
import io.airlift.units.Duration;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.IDBI;

import javax.inject.Singleton;

import java.io.File;

import static io.airlift.configuration.ConfigurationModule.bindConfig;
import static java.util.concurrent.TimeUnit.SECONDS;

public class StorageModule
        implements Module
{
    @Override
    public void configure(Binder binder)
    {
        bindConfig(binder).to(StorageManagerConfig.class);
        binder.bind(StorageManager.class).to(OrcStorageManager.class).in(Scopes.SINGLETON);
    }

    @Provides
    @Singleton
    @ForStorageManager
    public IDBI createLocalStorageManagerDBI(StorageManagerConfig config)
            throws Exception
    {
        return new DBI(new H2EmbeddedDataSource(new H2EmbeddedDataSourceConfig()
                .setFilename(new File(config.getDataDirectory(), "db/StorageManager").getAbsolutePath())
                .setMaxConnections(500)
                .setMaxConnectionWait(new Duration(1, SECONDS))));
    }
}

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

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Scopes;

import static io.airlift.configuration.ConfigurationModule.bindConfig;

public class StorageModule
        implements Module
{
    @Override
    public void configure(Binder binder)
    {
        bindConfig(binder).to(StorageManagerConfig.class);
        binder.bind(StorageManager.class).to(OrcStorageManager.class).in(Scopes.SINGLETON);
    }
}

Remove unused StorageManager H2 database


package org.xwiki.extension.repository.xwiki;

/**
 * Resources to use to access Extension Manager REST service.
 *

 * Resources producing list of result support the following arguments:
 *

 *
start: offset where the search start to return results

 *
number: maximum number of results

 *

 *

 * Resources producing extensions descriptor support the following arguments:
 *

 *
language: language used to resolve the descriptor values

 *

 *
 * @version $Id$
 */
public class Resources
{
    // Entry point

    public final static String ENTRYPOINT = "/extensions";

    // Extensions

    /**
     * ?start={offset}&number={number}
     */
    public final static String EXTENSION_ID = ENTRYPOINT + "/ids/{extensionId}";

    public final static String EXTENSION = EXTENSION_ID + "/versions/{extensionVersion}";

    public final static String EXTENSIONFILE = EXTENSION + "/file";

    // Search

    /**
     * ?q={keywords}
     */
    public final static String SEARCH = ENTRYPOINT + "/search";

    /**
     * ?q={keywords}
     */
    public final static String SEARCH_FROM_ID = EXTENSION_ID + "/search";

    // Index

    public final static String EXTENSION_INDEX = ENTRYPOINT + "/index";
}

package org.xwiki.extension.repository.xwiki;

/**
 * Resources to use to access Extension Manager REST service.
 *

 * Resources producing list of result support the following arguments:
 *

 *
start: offset where the search start to return results

 *
number: maximum number of results

 *

 *

 * Resources producing extensions descriptor support the following arguments:
 *

 *
language: language used to resolve the descriptor values

 *

 *
 * @version $Id$
 */
public class Resources
{
    // Entry point

    public final static String ENTRYPOINT = "/repository";

    // Extensions

    /**
     * ?start={offset}&number={number}
     */
    public final static String EXTENSIONS = ENTRYPOINT + "/extensions";

    public final static String EXTENSIONS_ID = EXTENSIONS + "/{extensionId}";

    public final static String EXTENSIONSVERSIONS = EXTENSIONS_ID + "/versions";

    public final static String EXTENSIONSVERSIONS_VERSION = EXTENSIONSVERSIONS + "/{extensionVersion}";

    public final static String EXTENSIONFILE = EXTENSIONSVERSIONS + "/file";

    // Search

    /**
     * ?q={keywords}
     */
    public final static String SEARCH = ENTRYPOINT + "/search";

    /**
     * ?q={keywords}
     */
    public final static String SEARCH_FROM_ID = EXTENSIONS_ID + "/search";
}

XWIKI-6871: Make XWiki Repository protocol more restfull


package org.jmeterplugins.repository;

import org.apache.jmeter.gui.plugin.MenuCreator;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import javax.swing.*;

public class PluginManagerMenuCreator implements MenuCreator {
    private static final Logger log = LoggingManager.getLoggerForClass();

    @Override
    public JMenuItem[] getMenuItemsAtLocation(MENU_LOCATION location) {
        if (location == MENU_LOCATION.OPTIONS) {
            try {
                return new JMenuItem[]{new PluginManagerMenuItem()};
            } catch (Throwable e) {
                log.error("Failed to load Plugins Manager", e);
                return new JMenuItem[0];
            }

        } else {
            return new JMenuItem[0];
        }
    }

    @Override
    public javax.swing.JMenu[] getTopLevelMenus() {
        return new javax.swing.JMenu[0];
    }

    @Override
    public boolean localeChanged(javax.swing.MenuElement menu) {
        return false;
    }

    @Override
    public void localeChanged() {
    }
}

package org.jmeterplugins.repository;

import org.apache.jmeter.gui.plugin.MenuCreator;
import org.apache.jorphan.logging.LoggingManager;
import org.apache.log.Logger;

import javax.swing.*;

public class PluginManagerMenuCreator implements MenuCreator {
    private static final Logger log = LoggingManager.getLoggerForClass();

    @Override
    public JMenuItem[] getMenuItemsAtLocation(MENU_LOCATION location) {
        if (location == MENU_LOCATION.OPTIONS) {
            try {
                PluginManagerCMDInstaller.main(new String[0]);
            } catch (Throwable e) {
                log.warn("Was unable to install pmgr cmdline tool");
            }

            try {
                return new JMenuItem[]{new PluginManagerMenuItem()};
            } catch (Throwable e) {
                log.error("Failed to load Plugins Manager", e);
                return new JMenuItem[0];
            }

        } else {
            return new JMenuItem[0];
        }
    }

    @Override
    public javax.swing.JMenu[] getTopLevelMenus() {
        return new javax.swing.JMenu[0];
    }

    @Override
    public boolean localeChanged(javax.swing.MenuElement menu) {
        return false;
    }

    @Override
    public void localeChanged() {
    }
}

Install cmdline tools on first dialog show


/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.desktop.common.view;

import org.springframework.util.ClassUtils;

public class DefaultPathConvention implements FxmlView.PathConvention {
    @Override
    public String apply(Class<? extends View> viewClass) {
        return ClassUtils.convertClassNameToResourcePath(viewClass.getName()).concat(".fxml");
    }
}

/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.desktop.common.view;

public class DefaultPathConvention implements FxmlView.PathConvention {

    /**
     * Convert a '.'-based fully-qualified name of {@code viewClass} to a '/'-based
     * resource path suffixed with ".fxml".
     */
    @Override
    public String apply(Class<? extends View> viewClass) {
        return viewClass.getName().replace('.', '/').concat(".fxml");
    }
}

Replace use of Spring's ClassUtils

Replace use of Spring's ClassUtils


package com.github.emalock3.camel.issues;

import org.apache.camel.EndpointInject;
import org.apache.camel.Produce;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class ApacheJiraIssuesComponentTest extends CamelTestSupport {

	@EndpointInject(uri = "mock:result")
	protected MockEndpoint resultEndpoint;

	@Produce(uri = "direct:start")
	protected ProducerTemplate template;

	@Test
	public void test() {
		template.sendBody("direct:start", "hoge1");
	}

	@Override
	protected RouteBuilder createRouteBuilder() {
		return new RouteBuilder() {
			@Override
			public void configure() throws Exception {
				from("direct:start")
					.to("apache-jira-issues:CAMEL")
					.split(body())
						.to("log:camelIssues")
					.end()
					.log("end");
			}
		};
	}

}

package com.github.emalock3.camel.issues;

import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;

public class ApacheJiraIssuesComponentTest extends CamelTestSupport {

	@Test
	public void test() {
		template.sendBody("direct:start", "hoge1");
	}

	@Override
	protected RouteBuilder createRouteBuilder() {
		return new RouteBuilder() {
			@Override
			public void configure() throws Exception {
				from("direct:start")
					.to("apache-jira-issues:CAMEL")
					.split(body())
						.to("log:camelIssues")
					.end()
					.log("end");
			}
		};
	}

}

Remove unnecessary variables and organize imports


package com.xtremelabs.droidsugar.view;

import java.io.File;

public class ResourceLoader {
    public final ViewLoader viewLoader;
    public final StringResourceLoader stringResourceLoader;

    public ResourceLoader(Class rClass, File resourceDir) throws Exception {
        ResourceExtractor resourceExtractor = new ResourceExtractor();
        resourceExtractor.addRClass(rClass);

        viewLoader = new ViewLoader(resourceExtractor);
        viewLoader.addResourceXmlDir(new File(resourceDir, "layout"));

        stringResourceLoader = new StringResourceLoader(resourceExtractor);
        stringResourceLoader.addResourceXmlDir(new File(resourceDir, "values"));
    }
}

package com.xtremelabs.droidsugar.view;

import java.io.File;
import java.io.FileFilter;

public class ResourceLoader {
    public final ViewLoader viewLoader;
    public final StringResourceLoader stringResourceLoader;

    public ResourceLoader(Class rClass, File resourceDir) throws Exception {
        ResourceExtractor resourceExtractor = new ResourceExtractor();
        resourceExtractor.addRClass(rClass);

        viewLoader = new ViewLoader(resourceExtractor);
        File[] layoutDirs = resourceDir.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return pathname.getPath().contains("/layout");
            }
        });
        for (File layoutDir : layoutDirs) {
            viewLoader.addResourceXmlDir(layoutDir);
        }

        stringResourceLoader = new StringResourceLoader(resourceExtractor);
        stringResourceLoader.addResourceXmlDir(new File(resourceDir, "values"));
    }
}

Load resources from all layout* directories


package ru.ydn.wicket.wicketorientdb.utils;

import java.util.List;

import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;

import ru.ydn.wicket.wicketorientdb.OrientDbWebSession;
import ru.ydn.wicket.wicketorientdb.model.OClassNamingModel;

import com.orientechnologies.orient.core.metadata.schema.OClass;

/**
 * {@link IChoiceRenderer} for {@link OClass}es
 */
public class OClassChoiceRenderer implements IChoiceRenderer<OClass> {

	public static final OClassChoiceRenderer INSTANCE = new OClassChoiceRenderer();

	private static final long serialVersionUID = 1L;

	@Override
	public Object getDisplayValue(OClass object) {
		return new OClassNamingModel(object).getObject();
	}

	@Override
	public String getIdValue(OClass object, int index) {
		return object.getName();
	}

	@Override
	public OClass getObject(String id,
			IModel<? extends List<? extends OClass>> choicesModel) {
		OClass ret = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass(id);
		List<? extends OClass> choices = choicesModel.getObject();
		return choices!=null && choices.contains(ret) ? ret : null;
	}
}

package ru.ydn.wicket.wicketorientdb.utils;

import java.util.List;

import org.apache.wicket.markup.html.form.IChoiceRenderer;
import org.apache.wicket.model.IModel;

import ru.ydn.wicket.wicketorientdb.OrientDbWebSession;
import ru.ydn.wicket.wicketorientdb.model.OClassNamingModel;

import com.orientechnologies.orient.core.metadata.schema.OClass;

/**
 * {@link IChoiceRenderer} for {@link OClass}es
 */
public class OClassChoiceRenderer implements IChoiceRenderer<OClass> {

	public static final OClassChoiceRenderer INSTANCE = new OClassChoiceRenderer(true);
	public static final OClassChoiceRenderer INSTANCE_NO_LOCALIZATION = new OClassChoiceRenderer(false);

	private static final long serialVersionUID = 1L;

	private boolean localize;

	public OClassChoiceRenderer(boolean localize) {
		this.localize = localize;
	}

	@Override
	public Object getDisplayValue(OClass object) {
		return localize?new OClassNamingModel(object).getObject():object.getName();
	}

	@Override
	public String getIdValue(OClass object, int index) {
		return object.getName();
	}

	@Override
	public OClass getObject(String id,
			IModel<? extends List<? extends OClass>> choicesModel) {
		OClass ret = OrientDbWebSession.get().getDatabase().getMetadata().getSchema().getClass(id);
		List<? extends OClass> choices = choicesModel.getObject();
		return choices!=null && choices.contains(ret) ? ret : null;
	}
}

Allow to avoid translation of classname

Allow to avoid translation of classname


package com.centralnabanka.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import java.math.BigDecimal;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Entity
public class Bank extends Base {

    private String name;
    private String accountNumber;
    private BigDecimal accountBalance;
    private String swiftCode;
}

package com.centralnabanka.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import java.math.BigDecimal;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Entity
public class Bank extends Base {

    private String name;
    private String accountNumber;
    private BigDecimal accountBalance;
    private String swiftCode;
    private String url;
}

Add URL to bank model

Add URL to bank model


package com.github.sormuras.bach.internal;

import java.util.List;
import java.util.stream.Collectors;

public interface StringSupport {
  static String join(List<String> strings) {
    return strings.stream().map(StringSupport::firstLine).collect(Collectors.joining(" "));
  }

  static String firstLine(String string) {
    var lines = string.lines().toList();
    var size = lines.size();
    return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
  }

  record Property(String key, String value) {}

  static Property parseProperty(String string) {
    return StringSupport.parseProperty(string, '=');
  }

  static Property parseProperty(String string, char separator) {
    int index = string.indexOf(separator);
    if (index < 0) {
      var message = "Expected a `KEY%sVALUE` string, but got: %s".formatted(separator, string);
      throw new IllegalArgumentException(message);
    }
    var key = string.substring(0, index);
    var value = string.substring(index + 1);
    return new Property(key, value);
  }
}

package com.github.sormuras.bach.internal;

import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.stream.Collectors;

public interface StringSupport {
  static String join(List<String> strings) {
    return strings.stream().map(StringSupport::firstLine).collect(Collectors.joining(" "));
  }

  static String firstLine(String string) {
    var lines = string.lines().toList();
    var size = lines.size();
    return size <= 1 ? string : lines.get(0) + "[...%d lines]".formatted(size);
  }

  static String parseFileName(String string) {
    var path = string.indexOf(':') > 0 ? URI.create(string).getPath() : string;
    return Path.of(path).getFileName().toString();
  }

  record Property(String key, String value) {}

  static Property parseProperty(String string) {
    return StringSupport.parseProperty(string, '=');
  }

  static Property parseProperty(String string, char separator) {
    int index = string.indexOf(separator);
    if (index < 0) {
      var message = "Expected a `KEY%sVALUE` string, but got: %s".formatted(separator, string);
      throw new IllegalArgumentException(message);
    }
    var key = string.substring(0, index);
    var value = string.substring(index + 1);
    return new Property(key, value);
  }
}

Add file name parsing helper

Add file name parsing helper


package de.otto.edison.togglz.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.togglz.console.TogglzConsoleServlet;
import org.togglz.servlet.TogglzFilter;

@Configuration
public class TogglzWebConfiguration {

    @Bean
    public FilterRegistrationBean togglzFilter() {
        FilterRegistrationBean filterRegistration = new FilterRegistrationBean();
        filterRegistration.setFilter(new TogglzFilter());
        filterRegistration.addUrlPatterns("/*");
        return filterRegistration;
    }

    @Bean
    public ServletRegistrationBean togglzServlet(@Value("${management.context-path:/internal}") String prefix) {
        return new ServletRegistrationBean(new TogglzConsoleServlet(), prefix + "/togglz/*");
    }
}

package de.otto.edison.togglz.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.togglz.console.TogglzConsoleServlet;

@Configuration
public class TogglzWebConfiguration {

    @Bean
    public ServletRegistrationBean togglzServlet(@Value("${management.context-path:/internal}") String prefix) {
        return new ServletRegistrationBean(new TogglzConsoleServlet(), prefix + "/togglz/*");
    }
}

Make Togglz compatible to not embedded Tomcat


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

package com.google.errorprone.annotations;

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

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

/**
 * The method to which this annotation is applied cannot not be called.
 *
 *
The annotation is applied to methods that are required to satisfy the contract of an
 * interface, but that are not supported. One example is the implementation of {@link
 * java.util.Collection#add} in an immutable collection implementation.
 *
 *
Marking methods annotated with {@code @DoNotCall} as {@code @Deprecated} is recommended, since
 * it provides IDE users with more immediate feedback.
 */
@Retention(CLASS)
@Target(METHOD)
public @interface DoNotCall {

  /** An optional explanation of why the method should not be called. */
  String value() default "";
}

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

package com.google.errorprone.annotations;

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

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

/**
 * The method to which this annotation is applied cannot be called.
 *
 *
The annotation is applied to methods that are required to satisfy the contract of an
 * interface, but that are not supported. One example is the implementation of {@link
 * java.util.Collection#add} in an immutable collection implementation.
 *
 *
Marking methods annotated with {@code @DoNotCall} as {@code @Deprecated} is recommended, since
 * it provides IDE users with more immediate feedback.
 */
@Retention(CLASS)
@Target(METHOD)
public @interface DoNotCall {

  /** An optional explanation of why the method should not be called. */
  String value() default "";
}

Fix double negative typo in Javadoc comment.

RELNOTES: N/A

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


package com.mercateo.common.rest.schemagen.link;

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

import javax.ws.rs.core.Link;

import com.mercateo.common.rest.schemagen.JerseyResource;
import com.mercateo.common.rest.schemagen.link.helper.MethodInvocation;
import com.mercateo.common.rest.schemagen.link.relation.Rel;

public class SchemaGenerator<T extends JerseyResource> {
    private LinkFactory<T> linkFactory;

    private final List<Optional<Link>> links;

    public static <T extends JerseyResource> SchemaGenerator<T> builder(
            LinkFactory<T> linkFactory) {
        return new SchemaGenerator<T>(linkFactory, new ArrayList<>());
    }

    public SchemaGenerator(
            LinkFactory<T> linkFactory, List<Optional<Link>> links) {
        this.linkFactory = linkFactory;
        this.links = links;
    }

    public SchemaGenerator<T> withLink(Rel rel, MethodInvocation<T> methodInvocation) {
        links.add(linkFactory.forCall(rel, methodInvocation));
        return this;
    }

    public <V extends JerseyResource> SchemaGenerator<V> withFactory(LinkFactory<V> linkFactory) {
        return new SchemaGenerator<V>(linkFactory, links);
    }

    public List<Optional<Link>> build() {
        return links;
    }
}

package com.mercateo.common.rest.schemagen.link;

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

import javax.ws.rs.core.Link;

import com.mercateo.common.rest.schemagen.JerseyResource;
import com.mercateo.common.rest.schemagen.link.helper.MethodInvocation;
import com.mercateo.common.rest.schemagen.link.relation.RelationContainer;

public class SchemaGenerator<T extends JerseyResource> {
    private LinkFactory<T> linkFactory;

    private final List<Optional<Link>> links;

    public static <T extends JerseyResource> SchemaGenerator<T> builder(
            LinkFactory<T> linkFactory) {
        return new SchemaGenerator<T>(linkFactory, new ArrayList<>());
    }

    public SchemaGenerator(
            LinkFactory<T> linkFactory, List<Optional<Link>> links) {
        this.linkFactory = linkFactory;
        this.links = links;
    }

    public SchemaGenerator<T> withLink(RelationContainer rel,
            MethodInvocation<T> methodInvocation) {
        links.add(linkFactory.forCall(rel, methodInvocation));
        return this;
    }

    public <V extends JerseyResource> SchemaGenerator<V> withFactory(LinkFactory<V> linkFactory) {
        return new SchemaGenerator<V>(linkFactory, links);
    }

    public List<Optional<Link>> build() {
        return links;
    }
}

Change method signature to accept any interface implementation


package com.example.todocloud.fragment;

import android.support.v4.app.Fragment;

public class TodoListFragmentTest extends Fragment {
}

package com.example.todocloud.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.todocloud.R;
import com.example.todocloud.adapter.TodoAdapterTest;
import com.example.todocloud.data.Todo;

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

public class TodoListFragmentTest extends Fragment {

  private List<Todo> todosList = new ArrayList<>();
  private TodoAdapterTest todoAdapterTest;
  private RecyclerView recyclerView;

  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    todoAdapterTest = new TodoAdapterTest(todosList);
    updateTodoAdapterTest();
  }

  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                           @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.todo_list_test, container, false);
    recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    recyclerView.setAdapter(todoAdapterTest);
    return view;
  }

  private void updateTodoAdapterTest() {
    Todo todo = new Todo(1, "test", "test", "test", "Test1", false,
        "test", "test", "test", false, 1, false, false);
    todosList.add(todo);

    todo = new Todo(1, "test", "test", "test", "Test2", false,
        "test", "test", "test", false, 1, false, false);
    todosList.add(todo);

    todo = new Todo(1, "test", "test", "test", "Test3", false,
        "test", "test", "test", false, 1, false, false);
    todosList.add(todo);

    todoAdapterTest.notifyDataSetChanged();
  }

}

Add basic functionality to display some test data


package org.pentaho.ui.xul.swing.tags;

import java.awt.GridBagLayout;

import javax.swing.JPanel;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.components.XulTab;
import org.pentaho.ui.xul.swing.SwingElement;
import org.pentaho.ui.xul.util.Orient;

public class SwingTab extends SwingElement implements XulTab{

	private String label;
	private boolean disabled = false;
	private String onclick;

	public SwingTab(XulComponent parent, XulDomContainer domContainer, String tagName) {
		super("tab");
	}

	public boolean isDisabled() {
		return disabled;
	}

	public String getLabel() {
		return label;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;

	}

	public void setLabel(String label) {
		this.label = label;

	}

	public void setOnclick(String onClick) {
		this.onclick = onClick;

	}
	@Override
	public void layout() {
	}
}

package org.pentaho.ui.xul.swing.tags;

import java.awt.GridBagLayout;

import javax.swing.JPanel;

import org.pentaho.ui.xul.XulComponent;
import org.pentaho.ui.xul.XulDomContainer;
import org.pentaho.ui.xul.components.XulTab;
import org.pentaho.ui.xul.swing.SwingElement;
import org.pentaho.ui.xul.util.Orient;

public class SwingTab extends SwingElement implements XulTab{

	private String label;
	private boolean disabled = false;
	private String onclick;

	public SwingTab(XulComponent parent, XulDomContainer domContainer, String tagName) {
		super("tab");
		managedObject = "empty";
	}

	public boolean isDisabled() {
		return disabled;
	}

	public String getLabel() {
		return label;
	}

	public String getOnclick() {
		return onclick;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;

	}

	public void setLabel(String label) {
		this.label = label;

	}

	public void setOnclick(String onClick) {
		this.onclick = onClick;

	}
	@Override
	public void layout() {
	}
}

Set the ManagedObject to empty

Set the ManagedObject to empty


package org.cogroo.dictionary.impl;

import static org.junit.Assert.*;

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

import org.junit.Test;

public class FSADictionaryTest {

  @Test
  public void testSimpleCount() throws IOException {
    String path = "/fsa_dictionaries/pos/pt_br_jspell_corpus";
    InputStream dict = FSADictionary.class.getResourceAsStream(path + ".dict");
    InputStream info = FSADictionary.class.getResourceAsStream(path + ".info");

    FSADictionary td = FSADictionary.create(dict, info);

    System.out.println(td.getTagsAndLemms("d"));;
  }
}

package org.cogroo.dictionary.impl;

import static org.junit.Assert.*;

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

import org.junit.Test;

public class FSADictionaryTest {

  @Test
  public void testLemmatizerDict() throws IOException {
    String path = "/fsa_dictionaries/pos/pt_br_jspell";
    InputStream dict = FSADictionary.class.getResourceAsStream(path + ".dict");
    InputStream info = FSADictionary.class.getResourceAsStream(path + ".info");

    FSADictionary td = FSADictionary.create(dict, info);

    assertEquals("menino", td.getLemmas("meninos", "n")[0]);

  }
}

Add unit test for FSADictionary

Add unit test for FSADictionary


/*
 * Copyright (C) 2009-2013 Typesafe Inc. <http://www.typesafe.com>
 */
package play.core.server;

/**
 * A server that can be stopped.
 */
public interface ServerWithStop {

    /**
     * Stop the server.
     */
	public void stop();

    /**
     * Get the address of the server.
     *
     * @return The address of the server.
     */
	public java.net.InetSocketAddress mainAddress();

}

Replace tabs/spaces with only spaces

Replace tabs/spaces with only spaces


package de.fu_berlin.cdv.chasingpictures.util;

import android.content.Context;
import android.support.annotation.StringRes;
import android.widget.Toast;

/**
 * Class that provides utility methods.
 *
 * @author Simon Kalt
 */
public class Utilities {

    /**
     *
     * @param context The current context
     * @param message The message to be displayed
     * @deprecated Use {@link #showError(Context, int)} if possible.
     */
    @Deprecated
    public static void showError(Context context, String message) {
        Toast.makeText(
                context,
                message,
                Toast.LENGTH_SHORT
        ).show();
    }

    /**
     * Displays an error to the user.
     * Currently does the same thing as {@link #showToast(Context, int)} but
     * could later be changed to look differently.
     *
     * @param context The current context
     * @param resID A string resource to be displayed
     */
    public static void showError(Context context, @StringRes int resID) {
        Toast.makeText(
                context,
                resID,
                Toast.LENGTH_SHORT
        ).show();
    }

    /**
     * Displays a message to the user.
     *
     * @param context The current context
     * @param resID A string resource to be displayed
     */
    public static void showToast(Context context, @StringRes int resID) {
        Toast.makeText(
                context,
                resID,
                Toast.LENGTH_SHORT
        ).show();
    }
}

package de.fu_berlin.cdv.chasingpictures.util;

import android.content.Context;
import android.support.annotation.StringRes;
import android.widget.Toast;

/**
 * Class that provides utility methods.
 *
 * @author Simon Kalt
 */
public class Utilities {
    /**
     *
     * @param context The current context
     * @param formatString The message to be displayed
     * @param args Arguments to be formatted into the string
     * @deprecated Use {@link #showError(Context, int, Object...)} if possible.
     */
    @Deprecated
    public static void showError(Context context, String formatString, Object... args) {
        Toast.makeText(
                context,
                String.format(formatString, args),
                Toast.LENGTH_SHORT
        ).show();
    }

    /**
     * Displays an error to the user.
     * Currently does the same thing as {@link #showToast(Context, int, Object...)} but
     * could later be changed to look differently.
     * @param context The current context
     * @param resID A string resource to be displayed
     * @param args Arguments to be formatted into the string
     */
    public static void showError(Context context, @StringRes int resID, Object... args) {
        showToast(context, resID, args);
    }

    /**
     * Displays a message to the user.
     * @param context The current context
     * @param resID A string resource to be displayed
     * @param args Arguments to be formatted into the string
     */
    public static void showToast(Context context, @StringRes int resID, Object... args) {
        Toast.makeText(
                context,
                String.format(context.getString(resID), args),
                Toast.LENGTH_SHORT
        ).show();
    }
}

Update error message display methods to take formatting arguments


package org.nibiru.ui.gwt.loop;

import static com.google.common.base.Preconditions.checkNotNull;

import javax.inject.Inject;

import org.nibiru.ui.core.api.loop.Looper;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;

public class SchedulerLooper implements Looper {
	private final Scheduler scheduler;

	@Inject
	public SchedulerLooper(Scheduler scheduler) {
		this.scheduler = checkNotNull(scheduler);
	}

	@Override
	public void post(final Runnable runnable) {
		checkNotNull(runnable);
		scheduler.scheduleDeferred(new ScheduledCommand() {
			@Override
			public void execute() {
				runnable.run();
			}
		});
	}
}

package org.nibiru.ui.gwt.loop;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.user.client.ui.RootPanel;

import org.nibiru.ui.core.api.loop.Looper;

import javax.inject.Inject;

import static com.google.common.base.Preconditions.checkNotNull;

public class SchedulerLooper implements Looper {
	private final Scheduler scheduler;

	@Inject
	public SchedulerLooper(Scheduler scheduler) {
		this.scheduler = checkNotNull(scheduler);
	}

    @Override
    public void post(final Runnable runnable) {
        checkNotNull(runnable);
        RootPanel.get().setVisible(false);
        scheduler.scheduleDeferred(() -> {
            runnable.run();
            RootPanel.get().setVisible(true);
        });
    }
}

Hide the root panel during the looper post to avoid rendering widgets while computing the layout


package ibis.impl.tcp;

import ibis.util.TypedProperties;

interface Config {
    static final String PROPERTY_PREFIX = "ibis.tcp.";
    static final String s_debug = PROPERTY_PREFIX + "debug";
    static final String s_stats = PROPERTY_PREFIX + "stats";
    static final String s_asserts = PROPERTY_PREFIX + "asserts";
    static final String s_cache = PROPERTY_PREFIX + "cache";

    static final boolean DEBUG = TypedProperties.booleanProperty(s_debug);
    static final boolean STATS = TypedProperties.booleanProperty(s_stats);
    static final boolean ASSERTS = TypedProperties.booleanProperty(s_asserts);
    static final boolean CONNECTION_CACHE = TypedProperties.booleanProperty(s_cache, true);

    static final String[] sysprops = {
	s_debug,
	s_stats,
	s_asserts,
	s_cache
    };
}

package ibis.impl.tcp;

import ibis.util.TypedProperties;

interface Config {
    static final String PROPERTY_PREFIX = "ibis.tcp.";
    static final String s_debug = PROPERTY_PREFIX + "debug";
    static final String s_stats = PROPERTY_PREFIX + "stats";
    static final String s_asserts = PROPERTY_PREFIX + "asserts";
    static final String s_cache = PROPERTY_PREFIX + "cache";

    static final boolean DEBUG = TypedProperties.booleanProperty(s_debug);
    static final boolean STATS = TypedProperties.booleanProperty(s_stats, true);
    static final boolean ASSERTS = TypedProperties.booleanProperty(s_asserts);
    static final boolean CONNECTION_CACHE = TypedProperties.booleanProperty(s_cache, true);

    static final String[] sysprops = {
	s_debug,
	s_stats,
	s_asserts,
	s_cache
    };
}

Set default for STATS to true to get byte counts for messages

git-svn-id: f22e84ca493ccad7df8d2727bca69d1c9fc2e5c5@2714 aaf88347-d911-0410-b711-e54d386773bb


/*******************************************************************************
 * This file is part of TERMINAL RECALL
 * Copyright (c) 2012-2014 Chuck Ritola
 * Part of the jTRFP.org project
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 *
 * Contributors:
 *     chuck - initial API and implementation
 ******************************************************************************/
package org.jtrfp.trcl;

import java.nio.ByteBuffer;

public interface Renderable {
    ByteBuffer getOpaqueObjectDefinitionAddresses();

    ByteBuffer getTransparentObjectDefinitionAddresses();

    void updateStateToGPU();
}

/*******************************************************************************
 * This file is part of TERMINAL RECALL
 * Copyright (c) 2012-2014 Chuck Ritola
 * Part of the jTRFP.org project
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 *
 * Contributors:
 *     chuck - initial API and implementation
 ******************************************************************************/
package org.jtrfp.trcl;

import java.util.Collection;

import org.jtrfp.trcl.mem.VEC4Address;

public interface Renderable {
    Collection<VEC4Address> getOpaqueObjectDefinitionAddresses();

    Collection<VEC4Address> getTransparentObjectDefinitionAddresses();

    void updateStateToGPU();
}

Append to VEC4Address object defs commit (fix broken build).


package org.openprovenance.prov.xml;
import java.util.List;
import java.util.LinkedList;

import javax.xml.namespace.QName;
import java.util.Hashtable;
import javax.xml.bind.JAXBElement;

public class AttributeProcessor {

    final private Hashtable<String,Hashtable<String,List<Object>>> namespaceIndex=
        new Hashtable<String,Hashtable<String,List<Object>>>();

    final private List<Object> attributes;

    public AttributeProcessor(List attributes) {
        this.attributes=attributes;
    }

    /* Processing of attributes */

    Hashtable<String,List<Object>> attributesWithNamespace(String namespace) {

        Hashtable<String,List<Object>> result=namespaceIndex.get(namespace);
        if (result==null) {
            result=new Hashtable<String,List<Object>>();
            namespaceIndex.put(namespace,result);
        }

        for (Object attribute: attributes) {
            if (attribute instanceof JAXBElement) {
                @SuppressWarnings("rawtypes")
				JAXBElement je=(JAXBElement) attribute;
                QName name=je.getName();
                if (namespace.equals(name.getNamespaceURI())) {
                    List<Object> ll=result.get(name.getLocalPart());
                    if (ll==null) {
                        List<Object> tmp=new LinkedList<Object>();
                        tmp.add(je.getValue());
                        result.put(name.getLocalPart(),tmp);
                    } else {
                        ll.add(je.getValue());
                    }
                }
            }
        }
        return result;
    }
}

package org.openprovenance.prov.xml;
import java.util.List;
import java.util.LinkedList;

import javax.xml.namespace.QName;
import java.util.Hashtable;
import javax.xml.bind.JAXBElement;

public class AttributeProcessor {

    final private Hashtable<String,Hashtable<String,List<Attribute>>> namespaceIndex=
        new Hashtable<String,Hashtable<String,List<Attribute>>>();

    final private List<Attribute> attributes;

    public AttributeProcessor(List<Attribute> attributes) {
        this.attributes=attributes;
    }

    /* Processing of attributes */

    Hashtable<String,List<Attribute>> attributesWithNamespace(String namespace) {

        Hashtable<String,List<Attribute>> result=namespaceIndex.get(namespace);
        if (result==null) {
            result=new Hashtable<String,List<Attribute>>();
            namespaceIndex.put(namespace,result);
        }

        for (Attribute attribute: attributes) {

            QName name=attribute.getElementName();
            if (namespace.equals(name.getNamespaceURI())) {
                List<Attribute> ll=result.get(name.getLocalPart());
                if (ll==null) {
                    List<Attribute> tmp=new LinkedList<Attribute>();
                    tmp.add(attribute);
                    result.put(name.getLocalPart(),tmp);
                } else {
                    ll.add(attribute);
                }
            }
        }
        return result;
    }
}

Support for Attribute in prov-n and round trip testing (usage and generation)


/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.types.requests.idol.actions.tags;

import lombok.Data;

import java.io.Serializable;

@SuppressWarnings({"WeakerAccess", "unused"})
@Data
public class TagName implements Serializable {
    private static final long serialVersionUID = -6221132711228529797L;
    private final String id;
    private final String name;

    public TagName(final String name, final String path) {
        this.name = name;
        this.id = path;
    }
}

/*
 * Copyright 2015 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.types.requests.idol.actions.tags;

import lombok.Data;

import java.io.Serializable;

@SuppressWarnings({"WeakerAccess", "unused"})
@Data
public class TagName implements Serializable {
    private static final long serialVersionUID = -6221132711228529797L;
    private final String id;
    private final String name;

    public TagName(final String name, final String id) {
        this.name = name;
        this.id = id;
    }
}

Fix bug that prevented JSON to Java

[FIND-204] Fix bug that prevented JSON to Java

There was a bug with the constructor for TagName which prevented using
jackson to map from JSON to Java.


package com.indeed.proctor.common.dynamic;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.base.Preconditions;
import com.indeed.proctor.common.model.ConsumableTestDefinition;
import org.springframework.util.CollectionUtils;

import java.util.Objects;
import java.util.Set;

@JsonTypeName("meta_tags_filter")
public class MetaTagsFilter implements DynamicFilter {
    private final Set<String> metaTags;

    public MetaTagsFilter(@JsonProperty("meta_tags") final Set<String> metaTags) {
        Preconditions.checkArgument(!CollectionUtils.isEmpty(metaTags), "meta_tags should be non-empty string list.");
        this.metaTags = metaTags;
    }

    @JsonProperty("meta_tags")
    public Set<String> getMetaTags() {
        return this.metaTags;
    }

    @Override
    public boolean matches(final String testName, final ConsumableTestDefinition testDefinition) {
        return testDefinition.getMetaTags().stream().anyMatch(this.metaTags::contains);
    }

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

    @Override
    public int hashCode() {
        return Objects.hash(metaTags);
    }
}

package com.indeed.proctor.common.dynamic;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableSet;
import com.indeed.proctor.common.model.ConsumableTestDefinition;
import org.springframework.util.CollectionUtils;

import java.util.Objects;
import java.util.Set;

@JsonTypeName("meta_tags_filter")
public class MetaTagsFilter implements DynamicFilter {
    private final Set<String> metaTags;

    public MetaTagsFilter(@JsonProperty("meta_tags") final Set<String> metaTags) {
        Preconditions.checkArgument(!CollectionUtils.isEmpty(metaTags), "meta_tags should be non-empty string list.");
        this.metaTags = ImmutableSet.copyOf(metaTags);
    }

    @JsonProperty("meta_tags")
    public Set<String> getMetaTags() {
        return this.metaTags;
    }

    @Override
    public boolean matches(final String testName, final ConsumableTestDefinition testDefinition) {
        return testDefinition.getMetaTags().stream().anyMatch(this.metaTags::contains);
    }

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

    @Override
    public int hashCode() {
        return Objects.hash(metaTags);
    }
}

PROC-690: Fix to use ImmutableSet to avoid being modified via getter


package org.hibernate.ogm.test.simpleentity;

import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 * @author Emmanuel Bernard
 */
public class BootstrapTest extends OgmTestCase {

	public void testBootstrap() throws Exception {
		final Session session = openSession();
		Hypothesis hyp = new Hypothesis();
		hyp.setId( "1234567890" );
		hyp.setDescription( "P != NP" );
		hyp.setPosition( 1 );
		final Transaction transaction = session.beginTransaction();
		session.persist( hyp );
		session.flush();
		session.clear();
		final Hypothesis loadedHyp = (Hypothesis) session.get( Hypothesis.class, hyp.getId() );
		assertEquals( hyp.getDescription(), loadedHyp.getDescription() );
		assertEquals( hyp.getPosition(), loadedHyp.getPosition() );
		transaction.rollback();
		session.close();
	}

	@Override
	protected Class<?>[] getAnnotatedClasses() {
		return new Class<?>[] {
				Hypothesis.class
		};
	}
}

package org.hibernate.ogm.test.simpleentity;

import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 * @author Emmanuel Bernard
 */
public class BootstrapTest extends OgmTestCase {

	public void testSimpleCRUD() throws Exception {
		final Session session = openSession();

		Transaction transaction = session.beginTransaction();
		Hypothesis hyp = new Hypothesis();
		hyp.setId( "1234567890" );
		hyp.setDescription( "NP != P" );
		hyp.setPosition( 1 );
		session.persist( hyp );
		transaction.commit();

		session.clear();

		transaction = session.beginTransaction();
		final Hypothesis loadedHyp = (Hypothesis) session.get( Hypothesis.class, hyp.getId() );
		assertNotNull( "Cannot load persisted object", loadedHyp );
		assertEquals( "persist and load fails", hyp.getDescription(), loadedHyp.getDescription() );
		assertEquals( "@Column fails", hyp.getPosition(), loadedHyp.getPosition() );
		transaction.commit();

		session.clear();

		transaction = session.beginTransaction();
		loadedHyp.setDescription( "P != NP");
		session.merge( loadedHyp );
		transaction.commit();

		session.clear();

		transaction = session.beginTransaction();
		Hypothesis secondLoadedHyp = (Hypothesis) session.get( Hypothesis.class, hyp.getId() );
		assertEquals( "Merge fails", loadedHyp.getDescription(), secondLoadedHyp.getDescription() );
		session.delete( secondLoadedHyp );
		transaction.commit();

		session.clear();

		transaction = session.beginTransaction();
		assertNull( session.get( Hypothesis.class, hyp.getId() ) );
		transaction.commit();

		session.close();
	}

	@Override
	protected Class<?>[] getAnnotatedClasses() {
		return new Class<?>[] {
				Hypothesis.class
		};
	}
}

Improve CRUD test for OGM

Improve CRUD test for OGM

Separate work in different transactions
Test persist/merge/load existing/load empty


package com.mindoo.domino.jna.xsp.internal;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

public class DominoJNAActivator extends Plugin {
	public static final String PLUGIN_ID = "com.mindoo.domino.jna.xsp";

	private static DominoJNAActivator plugin;

	@Override
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}

	@Override
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	public static DominoJNAActivator getDefault() {
		return plugin;
	}
}

package com.mindoo.domino.jna.xsp.internal;

import java.security.AccessController;
import java.security.PrivilegedAction;

import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

public class DominoJNAActivator extends Plugin {
	public static final String PLUGIN_ID = "com.mindoo.domino.jna.xsp";

	private static DominoJNAActivator plugin;
	private static Class m_jnaNativeClazz;

	@Override
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
		if (m_jnaNativeClazz==null) {
			m_jnaNativeClazz = AccessController.doPrivileged(new PrivilegedAction<Class>() {

				@Override
				public Class run() {
					//enforce using the extracted JNA .dll/.so file instead of what we find on the PATH
					System.setProperty("jna.nosys", "true");
					//change the library name from the default "jnidispatch" to our own name, so that
					//JNA does not load an jnidispatcher.dll from the Server's program directory
					String oldLibName = System.getProperty("jna.boot.library.name");
					System.setProperty("jna.boot.library.name", "dominojnadispatch");
					try {
						//loading the Native class runs its static code that extracts and loads the jna dll
						return DominoJNAActivator.class.forName("com.sun.jna.Native");
					} catch (ClassNotFoundException e) {
						e.printStackTrace();
					}
					finally {
						if (oldLibName!=null)
							System.setProperty("jna.boot.library.name",oldLibName);
					}
					return null;
				}
			});
		}
	}

	@Override
	public void stop(BundleContext context) throws Exception {
		plugin = null;
		super.stop(context);
	}

	public static DominoJNAActivator getDefault() {
		return plugin;
	}
}

Work around dll version conflicts w/ jnidispatch.dll in Domino progdir


package de.otto.edison.status.configuration;

import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Configuration
public class SystemInfoConfiguration {

    private static final String defaultHostname;

    static {
        String localHost = null;
        try {
            localHost = InetAddress.getLocalHost().getHostName();
        } catch (final UnknownHostException ignored) { }
        defaultHostname = localHost;
    }

    @Value("${HOSTNAME:}")
    private String hostname;
    @Value("${server.hostname:}")
    private String envhostname;
    @Value("${server.port:}")
    private int port;

    @Bean
    @ConditionalOnMissingBean(SystemInfo.class)
    public SystemInfo systemInfo() {
        return SystemInfo.systemInfo(hostname(), port);
    }

    private String hostname() {
        if (envhostname != null && !envhostname.isEmpty()) {
            return envhostname;
        }
        if(hostname != null && !hostname.isEmpty()) {
            return hostname;
        }
        return defaultHostname;
    }
}

package de.otto.edison.status.configuration;

import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Configuration
public class SystemInfoConfiguration {

    private static final String defaultHostname;

    static {
        String localHost = null;
        try {
            localHost = InetAddress.getLocalHost().getHostName();
        } catch (final UnknownHostException ignored) {
        }
        defaultHostname = localHost;
    }

    @Value("${HOSTNAME:}")
    private String hostname;
    @Value("${server.hostname:}")
    private String envhostname;
    @Value("${server.port:8080}")
    private int port;

    @Bean
    @ConditionalOnMissingBean(SystemInfo.class)
    public SystemInfo systemInfo() {
        return SystemInfo.systemInfo(hostname(), port);
    }

    private String hostname() {
        if (!StringUtils.isEmpty(envhostname)) {
            return envhostname;
        }
        if (!StringUtils.isEmpty(hostname)) {
            return hostname;
        }
        return defaultHostname;
    }
}

Set default for server port.

Set default for server port.


package jpower.core.utils;

import java.util.Scanner;
import java.util.regex.Pattern;

/**
 * Scans a String for Patterns
 */
public class StringScanner
{
   private Scanner scanner;

   /**
    * Creates a new String Scanner
    *
    * @param str input string
    */
   public StringScanner(String str)
   {
      scanner = new Scanner(str);
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(String pattern)
   {
      return scanner.next(pattern);
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(Pattern pattern)
   {
      return scanner.next(pattern);
   }
}

package jpower.core.utils;

import java.util.Scanner;
import java.util.regex.Pattern;

/**
 * Scans a String for Patterns
 */
public class StringScanner
{
   private Scanner scanner;

   /**
    * Creates a new String Scanner
    *
    * @param str input string
    */
   public StringScanner(String str)
   {
      scanner = new Scanner(str);
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(String pattern)
   {
      return scan(Pattern.compile(pattern));
   }

   /**
    * Find the next string matching the pattern
    * @param pattern pattern
    * @return matched
    */
   public String scan(Pattern pattern)
   {
      return scanner.hasNext(pattern) ? scanner.next(pattern) : null;
   }

   /**
    * Skips over the specified pattern
    *
    * @param pattern pattern
    */
   public void skip(Pattern pattern)
   {
      scanner.skip(pattern);
   }

   /**
    * Skips over the specified pattern
    *
    * @param pattern pattern
    */
   public void skip(String pattern)
   {
      scanner.skip(pattern);
   }

   /**
    * Skips over the specified pattern until it no longer matches
    *
    * @param pattern pattern
    */
   @SuppressWarnings("StatementWithEmptyBody")
   public void skipUntil(String pattern)
   {
      while (scan(pattern) != null)
      {
         ;
      }
   }

   /**
    * Skips over the specified pattern until it no longer matches
    *
    * @param pattern pattern
    */
   @SuppressWarnings("StatementWithEmptyBody")
   public void skipUntil(Pattern pattern)
   {
      while (scan(pattern) != null)
      {
         ;
      }
   }
}

Add Super Awesome String Scanner Stuff

Add Super Awesome String Scanner Stuff


package sherlock;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.List;
import java.util.stream.Collectors;

public class CommitParserTest {

	public void testA() throws IOException {
		InputStream is = this.getClass().getClassLoader().getResourceAsStream("migration-task.diff");
		List<String> commits = new CommitParser(is).getCommits().collect(Collectors.toList());
		System.out.println(commits);
	}
}

package sherlock;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.stream.Collectors;

import static junit.framework.Assert.assertEquals;

public class CommitParserTest {

	public void testA() throws IOException {
		InputStream is = this.getClass().getClassLoader().getResourceAsStream("migration-task.diff");
		List<String> commits = new CommitParser(is).getCommits().collect(Collectors.toList());
		assertEquals(4, commits.size());
	}
}

Test for SVN commit parser

Test for SVN commit parser


package com.wrapp.android.webimageexample;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class WebImageListAdapter extends BaseAdapter {
  private static final boolean USE_AWESOME_IMAGES = true;
  private static final int NUM_IMAGES = 100;
  private static final int IMAGE_SIZE = 100;

  public int getCount() {
    return NUM_IMAGES;
  }

  private String getImageUrl(int i) {
    if(USE_AWESOME_IMAGES) {
      // Unicorns!
      return "http://unicornify.appspot.com/avatar/" + i + "?s=" + IMAGE_SIZE;
    }
    else {
      // Boring identicons
      return "http://www.gravatar.com/avatar/" + i + "?s=" + IMAGE_SIZE + "&d=identicon";
    }
  }

  public Object getItem(int i) {
    return getImageUrl(i);
  }

  public long getItemId(int i) {
    return i;
  }

  public View getView(int i, View convertView, ViewGroup parentViewGroup) {
    WebImageContainerView containerView;
    if(convertView != null) {
      containerView = (WebImageContainerView)convertView;
    }
    else {
      containerView = new WebImageContainerView(parentViewGroup.getContext());
    }

    containerView.setImageUrl(getImageUrl(i));
    return containerView;
  }
}

package com.wrapp.android.webimageexample;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class WebImageListAdapter extends BaseAdapter {
  private static final boolean USE_AWESOME_IMAGES = true;
  private static final int NUM_IMAGES = 100;
  private static final int IMAGE_SIZE = 100;

  public int getCount() {
    return NUM_IMAGES;
  }

  private String getImageUrl(int i) {
    if(USE_AWESOME_IMAGES) {
      // Unicorns!
      return "http://unicornify.appspot.com/avatar/" + i + "?s=" + IMAGE_SIZE;
    }
    else {
      // Boring identicons
      return "http://www.gravatar.com/avatar/" + i + "?s=" + IMAGE_SIZE + "&d=identicon";
    }
  }

  public Object getItem(int i) {
    return getImageUrl(i);
  }

  public long getItemId(int i) {
    return i;
  }

  public View getView(int i, View convertView, ViewGroup parentViewGroup) {
    WebImageContainerView containerView;
    if(convertView != null) {
      containerView = (WebImageContainerView)convertView;
    }
    else {
      containerView = new WebImageContainerView(parentViewGroup.getContext());
    }

    containerView.setImageUrl(getImageUrl(i));
    containerView.setImageText("Image #" + i);
    return containerView;
  }
}

Set image title in list container views

Set image title in list container views


package uk.ac.ebi.quickgo.ontology.common.coterm;

import java.util.List;
import java.util.function.Predicate;
import org.springframework.data.repository.Repository;

/**
 * Represents the store of co-occurring GO Term information.
 *
 * @author Tony Wardell
 * Date: 29/09/2016
 * Time: 11:39
 * Created with IntelliJ IDEA.
 */
public interface CoTermRepository extends Repository<List<CoTerm>, String> {

    /**
     * For a single GO Term, retrieve a list of co-occurring terms and related statistics, in order of the
     * co-occurring terms similarity probablity (descending).
     * @param id is the target GO term, for which the method will retrieve co-occurring terms (GO terms that are used
     * to annotation the same gene products as this GO Term is used to annotate).
     * @param source is the method from which the annotation that uses the GO term was generated.
     * @param limit Limit the number of co-occurring terms return to the limit specified.
     * @param similarityThreshold if specified (greater than zero), only return co-occurring GO terms with a
     * similarity ratio above this figure.
     * @return a list of objects, each one of which represent a GO Term that is used to annotate the same gene
     * product as the id. Each object holds statistics related to that co-occurrence.
     */
    List<CoTerm> findCoTerms(String id, CoTermSource source, int limit, Predicate filter);
}

package uk.ac.ebi.quickgo.ontology.common.coterm;

import java.util.List;
import java.util.function.Predicate;
import org.springframework.data.repository.Repository;

/**
 * Represents the store of co-occurring GO Term information.
 *
 * @author Tony Wardell
 * Date: 29/09/2016
 * Time: 11:39
 * Created with IntelliJ IDEA.
 */
public interface CoTermRepository extends Repository<List<CoTerm>, String> {

    /**
     * For a single GO Term, retrieve a list of co-occurring terms and related statistics, in order of the
     * co-occurring terms similarity probablity (descending).
     * @param id is the target GO term, for which the method will retrieve co-occurring terms (GO terms that are used
     * to annotation the same gene products as this GO Term is used to annotate).
     * @param source is the method from which the annotation that uses the GO term was generated.
     * @param limit Limit the number of co-occurring terms return to the limit specified.
     * @param filter apply the predicate to filter the results.
     * @return a list of objects, each one of which represent a GO Term that is used to annotate the same gene
     * product as the id. Each object holds statistics related to that co-occurrence.
     */
    List<CoTerm> findCoTerms(String id, CoTermSource source, int limit, Predicate<CoTerm> filter);
}

Change javadoc similarityThreshold -> Predicate.


package com.suse.saltstack.netapi.event;

/**
 * Defines a client notification interface for SSE stream events.
 */
public interface EventListener {

    /**
     * Notify the listener of a new event stream event.  Returned data is a {@link String}
     * in JSON format.
     * @param event Return a JSON representation of the latest stream event.
     */
    void notify(String event);

    /**
     * Notify the listener that the backing event stream was closed.  Listener may
     * need to recreate the event stream or take other actions.
     */
    void eventStreamClosed();
}

package com.suse.saltstack.netapi.event;

/**
 * Defines a client notification interface for events stream.
 */
public interface EventListener {

    /**
     * Notify the listener of a new event stream event.  Returned data is a {@link String}
     * in JSON format.
     * @param event Return a JSON representation of the latest stream event.
     */
    void notify(String event);

    /**
     * Notify the listener that the backing event stream was closed.  Listener may
     * need to recreate the event stream or take other actions.
     */
    void eventStreamClosed();
}

Change class description to be indipendent against the EventStream implementation


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hudson.plugins.disk_usage;

import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.model.RootAction;

/**
 *
 * @author Lucie Votypkova
 */
@Extension
public class DiskUsageManagement extends ManagementLink implements RootAction{

   public final String[] COLUMNS = new String[]{"Project name", "Builds", "Workspace", "JobDirectory (without builds)"};

        public String getIconFileName() {
            return "/plugin/disk-usage/icons/diskusage48.png";
        }

        public String getDisplayName() {
            return Messages.DisplayName();
        }

        public String getUrlName() {
            return "plugin/disk-usage/";
        }

        @Override public String getDescription() {
            return Messages.Description();
        }

}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hudson.plugins.disk_usage;

import hudson.Extension;
import hudson.model.ManagementLink;
import hudson.model.RootAction;
import java.io.IOException;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;

/**
 *
 * @author Lucie Votypkova
 */
@Extension
public class DiskUsageManagement extends ManagementLink implements RootAction{

   public final String[] COLUMNS = new String[]{"Project name", "Builds", "Workspace", "JobDirectory (without builds)"};

        public String getIconFileName() {
            return "/plugin/disk-usage/icons/diskusage48.png";
        }

        public String getDisplayName() {
            return Messages.DisplayName();
        }

        public String getUrlName() {
            return "disk-usage";
        }

        @Override public String getDescription() {
            return Messages.Description();
        }

        public void doIndex(StaplerRequest req, StaplerResponse res) throws ServletException, IOException{
            DiskUsagePlugin plugin = Jenkins.getInstance().getPlugin(DiskUsagePlugin.class);
            res.sendRedirect(Jenkins.getInstance().getRootUrl() + "plugin/disk-usage");
        }

}

Fix link in menu on main page.

Fix link in menu on main page.


package ca.antonious.sample.models;

import android.app.Activity;

/**
 * Created by George on 2017-01-01.
 */

public class Sample {
    private String title;
    private Class<? extends Activity> showcaseActivityClass;

    public Sample(String title, Class<? extends Activity> showcaseActivityClass) {
        this.title = title;
        this.showcaseActivityClass = showcaseActivityClass;
    }

    public String getTitle() {
        return title;
    }

    public Class<? extends Activity> getShowcaseActivityClass() {
        return showcaseActivityClass;
    }
}

package ca.antonious.sample.models;

import android.app.Activity;

/**
 * Created by George on 2017-01-01.
 */

public class Sample {
    private String title;
    private String description;
    private Class<? extends Activity> showcaseActivityClass;

    public Sample(String title, String description, Class<? extends Activity> showcaseActivityClass) {
        this.title = title;
        this.description = description;
        this.showcaseActivityClass = showcaseActivityClass;
    }

    public String getTitle() {
        return title;
    }

    public String getDescription() {
        return description;
    }

    public Class<? extends Activity> getShowcaseActivityClass() {
        return showcaseActivityClass;
    }

    public static class Builder {
        private String title;
        private String description;
        private Class<? extends Activity> showcaseActivityClass;

        public Sample build() {
            return new Sample(title, description, showcaseActivityClass);
        }

        public Builder setTitle(String title) {
            this.title = title;
            return this;
        }

        public Builder setDescription(String description) {
            this.description = description;
            return this;
        }

        public Builder setShowcaseActivityClass(Class<? extends Activity> showcaseActivityClass) {
            this.showcaseActivityClass = showcaseActivityClass;
            return this;
        }
    }
}

Add description and builder to the sample


package info.u_team.u_team_test.init;

import info.u_team.u_team_core.util.registry.BaseRegistryUtil;
import info.u_team.u_team_test.TestMod;
import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
import net.minecraft.enchantment.Enchantment;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;

@EventBusSubscriber(modid = TestMod.MODID, bus = Bus.MOD)
public class TestEnchantments {

	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

	@SubscribeEvent
	public static void register(Register<Enchantment> event) {
		BaseRegistryUtil.getAllRegistryEntriesAndApplyNames(TestMod.MODID, Enchantment.class).forEach(event.getRegistry()::register);
	}

}

package info.u_team.u_team_test.init;

import info.u_team.u_team_test.enchantment.AutoSmeltEnchantment;
import net.minecraft.enchantment.Enchantment;

public class TestEnchantments {

	public static final Enchantment AUTO_SMELT = new AutoSmeltEnchantment("auto_smelt");

}

Remove unused annotations for test enchantments


package com.github.sherter.googlejavaformatgradleplugin;

import dagger.Module;
import dagger.Provides;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;

import javax.inject.Named;
import java.nio.file.Path;
import java.nio.file.Paths;

@Module
class PersistenceModule {

  private final Project project;

  PersistenceModule(Project project) {
    this.project = project;
  }

  @Provides
  Logger provideLogger() {
    return project.getLogger();
  }

  @Provides
  @Named("plugin version")
  String providePluginVersion() {
    // TODO(sherter): compute this dynamically
    return "0.3";
  }

  @Provides
  @Named("base path")
  Path provideBasePath() {
    return project.getProjectDir().toPath();
  }

  @Provides
  @Named("output path")
  Path provideOutputPath(@Named("plugin version") String pluginVersion) {
    Path buildDir = project.getBuildDir().toPath();
    return buildDir.resolve(Paths.get("google-java-format", pluginVersion));
  }

  @Provides
  @Named("storage")
  Path provideStoragePath(@Named("output path") Path outputPath) {
    return outputPath.resolve("fileStates.txt");
  }

  @Provides
  @Named("settings")
  Path provideSettingsPath(@Named("output path") Path outputPath) {
    return outputPath.resolve("settings.txt");
  }
}

package com.github.sherter.googlejavaformatgradleplugin;

import com.google.common.base.Throwables;
import com.google.common.io.CharStreams;
import dagger.Module;
import dagger.Provides;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;

import javax.inject.Named;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.nio.file.Paths;

@Module
class PersistenceModule {

  private final Project project;

  PersistenceModule(Project project) {
    this.project = project;
  }

  @Provides
  Logger provideLogger() {
    return project.getLogger();
  }

  @Provides
  @Named("plugin version")
  String providePluginVersion() {
    try (InputStream is = getClass().getResourceAsStream("/VERSION")) {
      return CharStreams.toString(new InputStreamReader(is, StandardCharsets.UTF_8));
    } catch (IOException e) {
      throw Throwables.propagate(e);
    }
  }

  @Provides
  @Named("base path")
  Path provideBasePath() {
    return project.getProjectDir().toPath();
  }

  @Provides
  @Named("output path")
  Path provideOutputPath(@Named("plugin version") String pluginVersion) {
    Path buildDir = project.getBuildDir().toPath();
    return buildDir.resolve(Paths.get("google-java-format", pluginVersion));
  }

  @Provides
  @Named("storage")
  Path provideStoragePath(@Named("output path") Path outputPath) {
    return outputPath.resolve("fileStates.txt");
  }

  @Provides
  @Named("settings")
  Path provideSettingsPath(@Named("output path") Path outputPath) {
    return outputPath.resolve("settings.txt");
  }
}

Read plugin version from VERSION file

Read plugin version from VERSION file


package com.paritytrading.philadelphia;

import java.io.IOException;

/**
 * The interface for inbound messages.
 */
public interface FIXMessageListener {

    /**
     * Receive a message.
     *
     * @param message a message
     * @throws IOException if an I/O error occurs
     */
    public void message(FIXMessage message) throws IOException;

}

package com.paritytrading.philadelphia;

import java.io.IOException;

/**
 * The interface for inbound messages.
 */
public interface FIXMessageListener {

    /**
     * Receive a message.
     *
     * @param message a message
     * @throws IOException if an I/O error occurs
     */
    void message(FIXMessage message) throws IOException;

}

Remove public modifier on interface

philadelphia-core: Remove public modifier on interface


package org.spoofax.interpreter.terms;

public class InlinePrinter implements ITermPrinter {
	String out;

	public InlinePrinter() {
		out = "";
	}

	public String getString() {
		return out;
	}

	public void print(String string) {
		if (string.matches("^ *$")) {
			return ;
		}
		out += string;
	}

	public void indent(int i) {
	}

	public void nextIndentOff() {
	}

	public void outdent(int i) {
	}

	public void println(String string, boolean b) {
		if (string.matches("^ *$")) {
			return ;
		}
		out += string;
	}

	public void println(String string) {
		out += string;
	}
}

package org.spoofax.interpreter.terms;

public class InlinePrinter implements ITermPrinter {
	StringBuffer out;

	public InlinePrinter() {
		out = new StringBuffer();
	}

	public String getString() {
		return out.toString();
	}

	public void print(String string) {
		if (string.matches("^ *$")) {
			return ;
		}
		out.append(string);
	}

	public void indent(int i) {
	}

	public void nextIndentOff() {
	}

	public void outdent(int i) {
	}

	public void println(String string, boolean b) {
		if (string.matches("^ *$")) {
			return ;
		}
		out.append(string);
	}

	public void println(String string) {
		out.append(string);
	}
}

Use StringBuffer to avoid string concatenation while inline printing.

svn path=/spoofax/trunk/spoofax/org.spoofax.interpreter/; revision=17214


package io.tehtotalpwnage.pvptoggle.utils;

public class PluginInfo {
	public static final String AUTHOR = "TehTotalPwnage";
	public static final String DESCRIPTION = "A simple command to toggle PvP per individual player.";
	public static final String ID = "io.tehtotalpwnage.pvptoggle";
	public static final String NAME = "PvPToggle";
	public static final String URL = "https://ore-staging.spongepowered.org/TehTotalPwnage/PvPToggle/pages/Home";
	public static final String VERSION = "1.0.2";
}

package io.tehtotalpwnage.pvptoggle.utils;

public class PluginInfo {
	public static final String AUTHOR = "TehTotalPwnage";
	public static final String DESCRIPTION = "A simple command to toggle PvP per individual player.";
	public static final String ID = "io.tehtotalpwnage.pvptoggle";
	public static final String NAME = "PvPToggle";
	public static final String URL = "https://ore-staging.spongepowered.org/TehTotalPwnage/PvPToggle/pages/Home";
	public static final String VERSION = "1.0.3";
}

Update plugin version to 1.0.3

Update plugin version to 1.0.3


package com.jvm_bloggers.core.social.fb;

import org.springframework.stereotype.Component;

import static java.lang.String.format;

@Component
class FacebookMessageGenerator {

    private static final String MESSAGE_TEMPLATE =
        "Nowe wydanie JVM Bloggers czeka już na Was: %s #java #jvm #newsletter #jvmbloggers #blogs";

    public String generateFacebookMessage(String issueLink) {
        return format(MESSAGE_TEMPLATE, issueLink);
    }

}

package com.jvm_bloggers.core.social.fb;

import org.springframework.stereotype.Component;

import static java.lang.String.format;

@Component
class FacebookMessageGenerator {

    private static final String MESSAGE_TEMPLATE =
        "Nowe wydanie JVM Bloggers czeka już na Was: %s #java #jvm #blogs";

    public String generateFacebookMessage(String issueLink) {
        return format(MESSAGE_TEMPLATE, issueLink);
    }

}

Reduce hashtags noise in Facebook message


package com.battlelancer.seriesguide.modules;

import android.app.Application;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;

@Module
public class AppModule {

    Application application;

    public AppModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    Application providesApplication() {
        return application;
    }
}

package com.battlelancer.seriesguide.modules;

import android.app.Application;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;

@Module
public class AppModule {

    private Application application;

    public AppModule(Application application) {
        this.application = application;
    }

    @Provides
    @Singleton
    Application providesApplication() {
        return application;
    }
}

Make app module field private.

Make app module field private.


/*
 * DataOneOf.java
 *
 */

package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;

import de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.BaseNode;

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

/**
 *
 */
public class DataOneOf extends BaseDatatype {
	protected List<BaseNode> oneOf;

	public DataOneOf() {
		super();
		//setType(...); TODO
		oneOf = new ArrayList<BaseNode>();
		setName("Data One Of");
		setID();
	}

	public List<BaseNode> getOneOf() {
		return oneOf;
	}

	@Override
	protected void setID() {
		id = "dataoneof" + counterObjects;
		counterObjects++;
	}
}

/*
 * DataOneOf.java
 *
 */

package de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.datatypes;

import de.uni_stuttgart.vis.vowl.owl2vowl.model.nodes.BaseNode;

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

/**
 *
 */
public class DataOneOf extends BaseDatatype {
	protected List<BaseNode> oneOf;

	public DataOneOf() {
		super();
		//setType(...); TODO
		oneOf = new ArrayList<BaseNode>();
		setName("Data One Of");
		setID();
		setComment("Dummy implementation. Not the real extracted element because not supported currently.");
	}

	public List<BaseNode> getOneOf() {
		return oneOf;
	}

	@Override
	protected void setID() {
		id = "dataoneof" + counterObjects;
		counterObjects++;
	}
}

Set dummy comment for data one of nodes.


package org.apache.maven.lifecycle.internal;

/*
 * 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 java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Simple {@link ThreadFactory} implementation that ensures the corresponding threads have a meaningful name.
 */
public class BuildThreadFactory
    implements ThreadFactory
{
    private final AtomicInteger id = new AtomicInteger();

    private static final String PREFIX = "BuilderThread";

    public Thread newThread( Runnable r )
    {
        return new Thread( r, String.format( "%s %d", PREFIX, id.getAndIncrement() ) );
    }
}

package org.apache.maven.lifecycle.internal;

/*
 * 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 java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * Simple {@link ThreadFactory} implementation that ensures the corresponding threads have a meaningful name.
 */
public class BuildThreadFactory
    implements ThreadFactory
{
    private final AtomicInteger id = new AtomicInteger();

    private static final String PREFIX = "BuilderThread";

    public Thread newThread( Runnable r )
    {
        return new Thread( r, String.format( "%s-%d", PREFIX, id.getAndIncrement() ) );
    }
}

[MNG-6977] Use hyphen when creating builder threads (names)


/*
 * ApiController.java
 *
 * Copyright (C) 2017 [ A Legge Up ]
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

package com.aleggeup.confagrid.controller;

import java.util.LinkedHashMap;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.aleggeup.confagrid.filter.JwtFilter;

import io.jsonwebtoken.Claims;

@RestController
@RequestMapping("/api")
public class ApiController {

    @RequestMapping(value = "role/{role}", method = RequestMethod.GET)
    public Boolean login(@PathVariable final String role,
            final HttpServletRequest request) throws ServletException {

        final Claims claims = (Claims) request.getAttribute(JwtFilter.ATTRIBUTE_CLAIMS);

        if (claims == null || claims.isEmpty()) {
            return false;
        }

        return getRoles(claims).stream().anyMatch(map -> map.containsValue(role));
    }

    @SuppressWarnings("unchecked")
    private List<LinkedHashMap<String, String>> getRoles(final Claims claims) {
        return (List<LinkedHashMap<String, String>>)claims.get("roles");
    }
}

/*
 * ApiController.java
 *
 * Copyright (C) 2017 [ A Legge Up ]
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

package com.aleggeup.confagrid.controller;

import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.aleggeup.confagrid.filter.JwtFilter;

import io.jsonwebtoken.Claims;

@RestController
@RequestMapping("/api")
public class ApiController {

    @RequestMapping(value = "role/{role}", method = RequestMethod.GET)
    public Boolean login(@PathVariable final String role,
            final HttpServletRequest request) throws ServletException {

        final Claims claims = (Claims) request.getAttribute(JwtFilter.ATTRIBUTE_CLAIMS);

        if (claims == null || claims.isEmpty()) {
            return false;
        }

        return getRoles(claims).stream().anyMatch(map -> map.containsValue(role));
    }

    @SuppressWarnings("unchecked")
    private List<LinkedHashMap<String, String>> getRoles(final Claims claims) {
        final Object roles = claims.get("roles");
        if (roles != null) {
            return (List<LinkedHashMap<String, String>>)claims.get("roles");
        } else {
            return Collections.EMPTY_LIST;
        }
    }
}

Handle case of no roles in claims if not authenticated


package com.codahale.dropwizard.logging;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.net.SyslogAppender;
import com.codahale.dropwizard.jackson.DiscoverableSubtypeResolver;
import org.junit.Test;

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

public class SyslogAppenderFactoryTest {
    @Test
    public void isDiscoverable() throws Exception {
        assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes())
                .contains(SyslogAppenderFactory.class);
    }

    @Test
    public void defaultIncludesAppName() throws Exception {
        assertThat(new SyslogAppenderFactory().getLogFormat())
                .contains("%app");
    }

    @Test
    public void defaultIncludesPid() throws Exception {
        assertThat(new SyslogAppenderFactory().getLogFormat())
                .contains("%pid");
    }

    @Test
    public void patternIncludesAppNameAndPid() throws Exception {
        SyslogAppender appender = (SyslogAppender) new SyslogAppenderFactory()
                .build(new LoggerContext(), "MyApplication", null);
        assertThat(appender.getSuffixPattern())
                .matches("^MyApplication\\[\\d+\\].+");
    }
}

package com.codahale.dropwizard.logging;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.net.SyslogAppender;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.Appender;
import com.codahale.dropwizard.jackson.DiscoverableSubtypeResolver;
import org.junit.Test;

import java.lang.reflect.Field;

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

public class SyslogAppenderFactoryTest {
    @Test
    public void isDiscoverable() throws Exception {
        assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes())
                .contains(SyslogAppenderFactory.class);
    }

    @Test
    public void defaultIncludesAppName() throws Exception {
        assertThat(new SyslogAppenderFactory().getLogFormat())
                .contains("%app");
    }

    @Test
    public void defaultIncludesPid() throws Exception {
        assertThat(new SyslogAppenderFactory().getLogFormat())
                .contains("%pid");
    }

    @Test
    public void patternIncludesAppNameAndPid() throws Exception {
        Appender<ILoggingEvent> wrapper = new SyslogAppenderFactory()
                .build(new LoggerContext(), "MyApplication", null);

        // hack to get at the SyslogAppender beneath the AsyncAppender
        // todo: find a nicer way to do all this
        Field delegate = AsyncAppender.class.getDeclaredField("delegate");
        delegate.setAccessible(true);
        SyslogAppender appender = (SyslogAppender) delegate.get(wrapper);

        assertThat(appender.getSuffixPattern())
                .matches("^MyApplication\\[\\d+\\].+");
    }
}

Fix test to work with new AsyncAppender

Fix test to work with new AsyncAppender

This is supremely dirty. I'd rather do it differently, but didn't want
to pollute the public API of AsyncAppender to do it.


/*
 * Copyright (c) Oct 1, 2018 StarChart Labs Authors.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    romeara - initial API and implementation and/or initial documentation
 */
package org.starchartlabs.chronicler.calamari.core;

//TODO romeara
public final class MediaTypes {

    public static final String APP_PREVIEW = "application/vnd.github.machine-man-preview+json";

    /**
     * Prevent instantiation of utility class
     */
    private MediaTypes() throws InstantiationException {
        throw new InstantiationException("Cannot instantiate instance of utility class '" + getClass().getName() + "'");
    }

}

/*
 * Copyright (c) Oct 1, 2018 StarChart Labs Authors.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    romeara - initial API and implementation and/or initial documentation
 */
package org.starchartlabs.chronicler.calamari.core;

/**
 * Represents various data format identifiers which may be sent or requested to/from GitHub via Accept/Content-Type
 * headers in web requests
 *
 * @author romeara
 * @since 0.1.0
 */
public final class MediaTypes {

    /**
     * Media type used by GitHub app's during the preview period
     *
     * @since 0.1.0
     */
    public static final String APP_PREVIEW = "application/vnd.github.machine-man-preview+json";

    /**
     * Prevent instantiation of utility class
     */
    private MediaTypes() throws InstantiationException {
        throw new InstantiationException("Cannot instantiate instance of utility class '" + getClass().getName() + "'");
    }

}

Add documentation to MediaType class

Add documentation to MediaType class


package com.rbase.rcommander;

import java.io.File;
import java.nio.file.Paths;

public class RCommanderPaths {

    private static final String RBTI_DIRECTORY = "C:\\RBTI";
    private static final String RCOMMANDER_PREFIX = "RCommander";

    public static String getPathForVersion(String version) {
        String fullName = RCOMMANDER_PREFIX + version;
        String path = Paths.get(RBTI_DIRECTORY, fullName, fullName + ".exe").toString();
        File file = new File(path);
        if (!file.exists()) {
            throw new IllegalArgumentException("R:Commander version " + version + " does not exist at " + path);
        } else if (!file.canExecute()) {
            throw new IllegalArgumentException("R:Commander version " + version + " is not executable");
        }
        return path;
    }

}

package com.rbase.rcommander;

import java.io.File;
import java.nio.file.Paths;

public class RCommanderPaths {

    private RCommanderPaths() {
        // utility class
    }

    private static final String RBTI_DIRECTORY = "C:\\RBTI";
    private static final String RCOMMANDER_PREFIX = "RCommander";

    public static String getPathForVersion(String version) {
        String fullName = RCOMMANDER_PREFIX + version;
        String path = Paths.get(RBTI_DIRECTORY, fullName, fullName + ".exe").toString();
        File file = new File(path);
        if (!file.exists()) {
            throw new IllegalArgumentException("R:Commander version " + version + " does not exist at " + path);
        } else if (!file.canExecute()) {
            throw new IllegalArgumentException("R:Commander version " + version + " is not executable");
        }
        return path;
    }

}

Add private constructor for utility class


package java.awt;

/**
 * Canvas -
 *
 * Copyright (c) 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 *
 * @author J. Mehlitz
 */
public class Canvas
  extends Component
{
public Canvas() {
	// Canvases usually get their own update events, not being updated
	// sync within their parents
	flags |= IS_ASYNC_UPDATED;
}

ClassProperties getClassProperties () {
	return ClassAnalyzer.analyzeAll( getClass(), true);
}

public Graphics getGraphics () {
	Graphics g = super.getGraphics();
	if ( g != null )
		g.setTarget( this);

	return g;
}

public void paint( Graphics g) {
	// Canvas is a nativeLike Component, i.e. its background would
	// normally be blanked by the native window system
	g.clearRect( 0, 0, width, height);
}
}

package java.awt;

/**
 * Canvas -
 *
 * Copyright (c) 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 *
 * @author J. Mehlitz
 */
public class Canvas
  extends Component
{
public Canvas() {
	// Canvases usually get their own update events, not being updated
	// sync within their parents
	flags |= IS_ASYNC_UPDATED;
}

ClassProperties getClassProperties () {
	return ClassAnalyzer.analyzeAll( getClass(), true);
}

public Graphics getGraphics () {
	Graphics g = super.getGraphics();
	if ( g != null )
		g.setTarget( this);

	return g;
}

// Sun's version of this class apparently has this method. So we put
// one here so applets compiled against kaffe's version of this class
// will call the right method when they do super.addNotify().

public void addNotify () {
	super.addNotify();
}

public void paint( Graphics g) {
	// Canvas is a nativeLike Component, i.e. its background would
	// normally be blanked by the native window system
	g.clearRect( 0, 0, width, height);
}
}

Add addNotify() which just calls super.addNotify() to fix applet problem