package net.imglib2.meta;

import net.imglib2.Positionable;

// TODO - what other interface should this mix in besides TypedRealInterval

public interface CalibratedRealInterval<A extends CalibratedAxis> extends
	TypedRealInterval<A>
{

	String unit(int d);

	void setUnit(String unit, int d);

	double calibration(int d);

	void setCalibration(double v, int d);

	// The following are TEMP for compile fixing

	long dimension(int d);

	void dimensions(long[] dest);

	AxisType[] getAxes();

	long[] getDims();

	String getName();

	void setName(String name);

	boolean isDiscrete();

	long min(int d);

	void min(long[] dest);

	void min(Positionable dest);

	long max(int d);

	void max(long[] dest);

	void max(Positionable dest);
}

package net.imglib2.meta;

import net.imglib2.Positionable;

// TODO - what other interface should this mix in besides TypedRealInterval

public interface CalibratedRealInterval<A extends CalibratedAxis> extends
	TypedRealInterval<A>
{

	String unit(int d);

	void setUnit(String unit, int d);

	double calibration(int d);

	void setCalibration(double v, int d);

	// The following are TEMP for compile fixing

	long dimension(int d);

	void dimensions(long[] dest);

	AxisType[] getAxes();

	long[] getDims();

	boolean isDiscrete();

	long min(int d);

	void min(long[] dest);

	void min(Positionable dest);

	long max(int d);

	void max(long[] dest);

	void max(Positionable dest);
}

Remove the TEMP Named methods

Remove the TEMP Named methods


package imagej.event;

import org.bushe.swing.event.EventBus;

/**
 * Simple utility class for subscribing to ImageJ events,
 * as well as publishing them.
 *
 * @author Curtis Rueden
 */
public final class Events {

	private Events() {
		// prevent instantiation of utility class
	}

	public static <E extends ImageJEvent> void publish(final E e) {
		EventBus.publish(e.getClass(), e);
	}

	public static <E extends ImageJEvent> void subscribe(
		final Class<E> c, final EventSubscriber<E> subscriber)
	{
		EventBus.subscribe(c, subscriber);
	}

}

package imagej.event;

import org.bushe.swing.event.EventBus;

/**
 * Simple utility class for subscribing to ImageJ events,
 * as well as publishing them.
 *
 * @author Curtis Rueden
 */
public final class Events {

	private Events() {
		// prevent instantiation of utility class
	}

	public static <E extends ImageJEvent> void publish(final E e) {
		EventBus.publish(e);
	}

	public static <E extends ImageJEvent> void subscribe(
		final Class<E> c, final EventSubscriber<E> subscriber)
	{
		EventBus.subscribe(c, subscriber);
	}

}

Fix problem with EventBus publishing events.

This used to be revision r2281.


package net.folab.fo.runtime._fo._lang;

import net.folab.fo.runtime._fo._lang._Boolean.negate;

import net.folab.fo.runtime.Evaluable;
import net.folab.fo.runtime.Value;
import net.folab.fo.runtime._fo._lang._Boolean.choose;

public class Boolean extends Value<Boolean> {

    public static final Boolean FALSE = new Boolean(false);

    public static final Boolean TRUE = new Boolean(true);

    private final boolean value;

    public final <T extends Evaluable<T>> choose<T> choose() {
        return new choose<T>(this);
    }

    public final negate negate = new negate(this);

    private Boolean(boolean value) {
        this.value = value;
    }

    public boolean getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

}

package net.folab.fo.runtime._fo._lang;

import net.folab.fo.runtime._fo._lang._Boolean.negate;

import net.folab.fo.runtime.Evaluable;
import net.folab.fo.runtime.Value;
import net.folab.fo.runtime._fo._lang._Boolean.choose;

public class Boolean extends Value<Boolean> {

    public static final Boolean FALSE = new Boolean(false);

    public static final Boolean TRUE = new Boolean(true);

    private final boolean value;

    public final <T extends Evaluable<T>> choose<T> choose() {
        return new choose<T>(this);
    }

    public final negate negate = new negate(this);

    public negate negate() {
        return negate;
    }

    private Boolean(boolean value) {
        this.value = value;
    }

    public boolean getValue() {
        return value;
    }

    @Override
    public String toString() {
        return String.valueOf(value);
    }

}

Add omitted method - negate()

Add omitted method - negate()


package com.bt.openlink.type;

import java.util.Objects;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class AbstractType<T> {
    private final T value;

    protected AbstractType(final T value) {
        this.value = value;
    }

    @Nullable
    public T value() {
        return value;
    }

    @Nonnull
    @Override
    public String toString() {
        return String.valueOf(value);
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }

        final AbstractType that = (AbstractType) o;
        return Objects.equals(this.value, that.value);
    }

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

}

package com.bt.openlink.type;

import java.util.Objects;

import javax.annotation.Nonnull;

public class AbstractType<T> {
    @Nonnull private final T value;

    protected AbstractType(@Nonnull final T value) {
        this.value = value;
    }

    @Nonnull
    public T value() {
        return value;
    }

    @Nonnull
    @Override
    public String toString() {
        return String.valueOf(value);
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }

        final AbstractType that = (AbstractType) o;
        return Objects.equals(this.value, that.value);
    }

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

}

Make the abstract types non-nullable

Make the abstract types non-nullable


/*
 * Copyright (c) 2015-2017, Index Data
 * All rights reserved.
 * See the file LICENSE for details.
 */
package org.folio.okapi.bean;

/**
 * List of Permissions (and permission sets) belonging to a module. Used as a
 * parameter in the system request to initialize the permission module when a a
 * module is being enabled for a tenant.
 *
 * @author heikki
 */
public class PermissionList {
  String moduleId; // The module that own these permissions.
  Permission[] perms;

  public PermissionList() {
  }

  public PermissionList(String moduleId, Permission[] perms) {
    this.moduleId = moduleId;
    this.perms = perms.clone();
  }

  public PermissionList(PermissionList other) {
    this.moduleId = other.moduleId;
    this.perms = other.perms.clone();
  }

  public String getModuleId() {
    return moduleId;
  }

  public void setModuleId(String moduleId) {
    this.moduleId = moduleId;
  }

  public Permission[] getPerms() {
    return perms;
  }

  public void setPerms(Permission[] perms) {
    this.perms = perms;
  }

}

package org.folio.okapi.bean;

/**
 * List of Permissions (and permission sets) belonging to a module. Used as a
 * parameter in the system request to initialize the permission module when a
 * module is being enabled for a tenant.
 *
 * @author heikki
 */
public class PermissionList {
  String moduleId; // The module that owns these permissions.
  Permission[] perms;

  public PermissionList() {
  }

  public PermissionList(String moduleId, Permission[] perms) {
    this.moduleId = moduleId;
    this.perms = perms.clone();
  }

  public PermissionList(PermissionList other) {
    this.moduleId = other.moduleId;
    this.perms = other.perms.clone();
  }

  public String getModuleId() {
    return moduleId;
  }

  public void setModuleId(String moduleId) {
    this.moduleId = moduleId;
  }

  public Permission[] getPerms() {
    return perms;
  }

  public void setPerms(Permission[] perms) {
    this.perms = perms;
  }

}

Remove superfluous license headers (OKAPI-109)


package org.dandelion.config;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.*;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
 * Created on 2016-01-18.
 *
 * @author dolphineor
 */
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
@ImportResource(locations = {"classpath:spring-mybatis.xml"})
@ComponentScan(basePackages = {"com.github.dolphineor.service"},
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.stereotype.Repository.class),
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.stereotype.Controller.class),
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.web.bind.annotation.RestController.class)}
)
public class RootConfig {

    private static Resource[] propertyLocations = {new ClassPathResource("jdbc-mysql.properties")};

    // 加载*.properties文件
    @Bean
    public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
        PropertyPlaceholderConfigurer propertyPlaceholderConfigurer =
                new PropertyPlaceholderConfigurer();
        propertyPlaceholderConfigurer.setLocations(propertyLocations);

        return propertyPlaceholderConfigurer;
    }
}

package org.dandelion.config;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.*;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
 * Created on 2016-01-18.
 *
 * @author dolphineor
 */
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
@ImportResource(locations = {"classpath:spring-mybatis.xml"})
@ComponentScan(basePackages = {"org.dandelion.service"},
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.stereotype.Repository.class),
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.stereotype.Controller.class),
                @ComponentScan.Filter(type = FilterType.ANNOTATION, value = org.springframework.web.bind.annotation.RestController.class)}
)
public class RootConfig {

    private static Resource[] propertyLocations = {new ClassPathResource("jdbc-mysql.properties")};

    // 加载*.properties文件
    @Bean
    public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
        PropertyPlaceholderConfigurer propertyPlaceholderConfigurer =
                new PropertyPlaceholderConfigurer();
        propertyPlaceholderConfigurer.setLocations(propertyLocations);

        return propertyPlaceholderConfigurer;
    }
}

[master] Change Spring basePackages scan directory


package org.gluu.jsf2.service;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;

/**
 * @author Yuriy Movchan
 * @version 03/17/2017
 */
public class FacesResources {

	@Produces
	@Dependent
	public FacesContext getFacesContext() {
		return FacesContext.getCurrentInstance();
	}

	@Produces
	@Dependent
	public ExternalContext getExternalContext() {
		FacesContext facesContext = getFacesContext();
		if (facesContext != null) {
			return facesContext.getExternalContext();
		}

		return null;
	}

	@Produces
	@Dependent
	public ViewHandler getViewHandler() {
		FacesContext facesContext = getFacesContext();
		if (facesContext != null) {
			return facesContext.getApplication().getViewHandler();
		}

		return null;
	}

}

package org.gluu.jsf2.service;

import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Produces;
import javax.faces.application.ViewHandler;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

/**
 * @author Yuriy Movchan
 * @version 03/17/2017
 */
public class FacesResources {

	@Produces
	@RequestScoped
	public FacesContext getFacesContext() {
		return FacesContext.getCurrentInstance();
	}

	@Produces
	@RequestScoped
	public ExternalContext getExternalContext() {
		FacesContext facesContext = getFacesContext();
		if (facesContext != null) {
			return facesContext.getExternalContext();
		}

		return null;
	}

	@Produces
	@Dependent
	public ViewHandler getViewHandler() {
		FacesContext facesContext = getFacesContext();
		if (facesContext != null) {
			return facesContext.getApplication().getViewHandler();
		}

		return null;
	}

}

Fix External and Faces contexts scopes

Fix External and Faces contexts scopes


package com.antew.redditinpictures.library;

import com.antew.redditinpictures.library.utils.MainThreadBus;
import com.squareup.otto.Bus;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;

/**
 * Dagger module for setting up provides statements.
 * Register all of your entry points below.
 */
@Module
    (
        complete = false,

        injects = {
            RedditInPicturesApplication.class,
        }, library = true

    )
public class ApplicationModule {

    @Singleton
    @Provides Bus provideOttoBus() {
        return new MainThreadBus(new Bus());
    }

}

package com.antew.redditinpictures.library;

import com.antew.redditinpictures.library.ui.ImageDetailActivity;
import com.antew.redditinpictures.library.ui.ImageGridActivity;
import com.antew.redditinpictures.library.ui.ImageGridFragment;
import com.antew.redditinpictures.library.ui.ImageListFragment;
import com.antew.redditinpictures.library.utils.MainThreadBus;
import com.squareup.otto.Bus;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Dagger module for setting up provides statements.
 * Register all of your entry points below.
 */
@Module
    (
        complete = false,

        injects = {
            RedditInPicturesApplication.class,
            ImageGridFragment.class,
            ImageListFragment.class,
            ImageGridActivity.class,
            ImageDetailActivity.class
        }, library = true
    )
public class ApplicationModule {

    @Singleton
    @Provides Bus provideOttoBus() {
        return new MainThreadBus(new Bus());
    }

}

Add additional classes for injection.

Add additional classes for injection.


// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.dnd;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public abstract class DnDManager {
  public static DnDManager getInstance() {
    return ApplicationManager.getApplication().getService(DnDManager.class);
  }

  public abstract void registerSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void registerSource(@NotNull AdvancedDnDSource source);

  public abstract void unregisterSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void unregisterSource(@NotNull AdvancedDnDSource source);

  public abstract void registerTarget(DnDTarget target, JComponent component);

  public abstract void unregisterTarget(DnDTarget target, JComponent component);

  @Nullable
  public abstract Component getLastDropHandler();

  /**
   * This key is intended to switch on a smooth scrolling during drag-n-drop operations.
   * Note, that the target component must not use default auto-scrolling.
   *
   * @see java.awt.dnd.Autoscroll
   * @see JComponent#setAutoscrolls
   * @see JComponent#putClientProperty
   */
  public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
}

// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.ide.dnd;

import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.Key;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;
import java.awt.*;

public abstract class DnDManager {
  public static DnDManager getInstance() {
    return ApplicationManager.getApplication().getService(DnDManager.class);
  }

  public abstract void registerSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void registerSource(@NotNull AdvancedDnDSource source);

  public abstract void unregisterSource(@NotNull DnDSource source, @NotNull JComponent component);

  public abstract void unregisterSource(@NotNull AdvancedDnDSource source);

  public abstract void registerTarget(DnDTarget target, JComponent component);

  public abstract void unregisterTarget(DnDTarget target, JComponent component);

  @Nullable
  public abstract Component getLastDropHandler();

  /**
   * This key is intended to switch on a smooth scrolling during drag-n-drop operations.
   * Note, that the target component must not use default auto-scrolling.
   *
   * @see java.awt.dnd.Autoscroll
   * @see JComponent#setAutoscrolls
   * @see JComponent#putClientProperty
   */
  @ApiStatus.Experimental
  public static final Key<Boolean> AUTO_SCROLL = Key.create("AUTO_SCROLL");
}

Mark API as experimental, because of javax.swing.TransferHandler.DropHandler.autoscroll

GitOrigin-RevId: c8522f07307517203906b9c867fd4fca6713b708


/*
 * Copyright (C) 2013 Jerzy Chalupski
 *
 * 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.getbase.autoindexer;

import com.google.common.base.Objects;

public class SqliteIndex {
  public final String mTable;
  public final String[] mColumns;

  public SqliteIndex(String table, String... columns) {
    mTable = table;
    mColumns = columns;
  }

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

    SqliteIndex that = (SqliteIndex) o;

    return Objects.equal(mTable, that.mTable) &&
        Objects.equal(mColumns, that.mColumns);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(mTable, mColumns);
  }
}

/*
 * Copyright (C) 2013 Jerzy Chalupski
 *
 * 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.getbase.autoindexer;

import com.google.common.base.Objects;

import java.util.Arrays;

public class SqliteIndex {
  public final String mTable;
  public final String[] mColumns;

  public SqliteIndex(String table, String... columns) {
    mTable = table;
    mColumns = columns;
  }

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

    SqliteIndex that = (SqliteIndex) o;

    return Objects.equal(mTable, that.mTable) &&
        Objects.equal(mColumns, that.mColumns);
  }

  @Override
  public String toString() {
    return "SQLiteIndex on " + mTable + Arrays.toString(mColumns);
  }

  @Override
  public int hashCode() {
    return Objects.hashCode(mTable, mColumns);
  }
}

Add custom toString() to SQLiteIndex

Add custom toString() to SQLiteIndex


package com.alibaba.json.bvt.issue_1100;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.alibaba.fastjson.TypeReference;
import junit.framework.TestCase;

import java.util.Map;

/**
 * Created by wenshao on 05/05/2017.
 */
public class Issue1177_2 extends TestCase {
    public void test_for_issue() throws Exception {
        String text = "{\"a\":{\"x\":\"y\"},\"b\":{\"x\":\"y\"}}";
        Map<String, Model> jsonObject = JSONObject.parseObject(text, new TypeReference<Map<String, Model>>(){});
        System.out.println(JSON.toJSONString(jsonObject));
        String jsonpath = "$..x";
        String value="y2";
        JSONPath.set(jsonObject, jsonpath, value);
        assertEquals("{\"a\":{\"x\":\"y2\"},\"b\":{\"x\":\"y2\"}}", JSON.toJSONString(jsonObject));

    }

    public static class Model {
        public String x;
    }
}

package com.alibaba.json.bvt.issue_1100;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPath;
import com.alibaba.fastjson.TypeReference;
import junit.framework.TestCase;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Created by wenshao on 05/05/2017.
 */
public class Issue1177_2 extends TestCase {
    public void test_for_issue() throws Exception {
        String text = "{\"a\":{\"x\":\"y\"},\"b\":{\"x\":\"y\"}}";
        Map<String, Model> jsonObject = JSONObject.parseObject(text, new TypeReference<LinkedHashMap<String, Model>>(){});
        System.out.println(JSON.toJSONString(jsonObject));
        String jsonpath = "$..x";
        String value="y2";
        JSONPath.set(jsonObject, jsonpath, value);
        assertEquals("{\"a\":{\"x\":\"y2\"},\"b\":{\"x\":\"y2\"}}", JSON.toJSONString(jsonObject));

    }

    public static class Model {
        public String x;
    }
}

Use LinkedHashMap for deterministic order


package mesosphere.marathon.client.model.v2;

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

import mesosphere.marathon.client.utils.ModelUtils;

public class Docker {
	private String image;
	private String network;
	private Collection<Port> portMappings;
	private List<Parameter> parameters;
	private boolean privileged;

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getNetwork() {
		return network;
	}

	public void setNetwork(String network) {
		this.network = network;
	}

	public Collection<Port> getPortMappings() {
		return portMappings;
	}

	public void setPortMappings(Collection<Port> portMappings) {
		this.portMappings = portMappings;
	}

	public boolean isPrivileged() {
		return privileged;
	}

	public void setPrivileged(boolean privileged) {
		this.privileged = privileged;
	}

	public List<Parameter> getParameters() {
		return parameters;
	}

	public void setParameters(List<Parameter> parameters) {
		this.parameters = parameters;
	}

	@Override
	public String toString() {
		return ModelUtils.toString(this);
	}
}

package mesosphere.marathon.client.model.v2;

import mesosphere.marathon.client.utils.ModelUtils;

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

public class Docker {
	private String image;
	private String network;
	private boolean forcePullImage;
	private Collection<Port> portMappings;
	private List<Parameter> parameters;
	private boolean privileged;

	public String getImage() {
		return image;
	}

	public void setImage(String image) {
		this.image = image;
	}

	public String getNetwork() {
		return network;
	}

	public void setNetwork(String network) {
		this.network = network;
	}

	public Collection<Port> getPortMappings() {
		return portMappings;
	}

	public void setPortMappings(Collection<Port> portMappings) {
		this.portMappings = portMappings;
	}

	public boolean isPrivileged() {
		return privileged;
	}

	public void setPrivileged(boolean privileged) {
		this.privileged = privileged;
	}

	public List<Parameter> getParameters() {
		return parameters;
	}

	public void setParameters(List<Parameter> parameters) {
		this.parameters = parameters;
	}

	public boolean isForcePullImage() {
		return forcePullImage;
	}

	public void setForcePullImage(boolean forcePullImage) {
		this.forcePullImage = forcePullImage;
	}
	@Override
	public String toString() {
		return ModelUtils.toString(this);
	}

}

Add option to force docker pull

Add option to force docker pull

mesos v 0.22.0 has option to force pull of docker image, marathon will get the same option in 0.8.2

see mesosphere/marathon#837 for more details


package com.bazaarvoice.dropwizard.assets;

import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;
import java.util.Map;

public class AssetsConfiguration {

    @NotNull
    @JsonProperty
    private String cacheSpec = ConfiguredAssetsBundle.DEFAULT_CACHE_SPEC.toParsableString();

    @NotNull
    @JsonProperty
    private Map<String, String> overrides = Maps.newHashMap();

    @JsonProperty
    private Map<String, String> mimeTypes = Maps.newHashMap();

    /** The caching specification for how to memoize assets. */
    public String getCacheSpec() {
        return cacheSpec;
    }

    public Iterable<Map.Entry<String, String>> getOverrides() {
        return Iterables.unmodifiableIterable(overrides.entrySet());
    }

    public Iterable<Map.Entry<String, String>> getMimeTypes() {
        return Iterables.unmodifiableIterable(mimeTypes.entrySet());
    }
}

package com.bazaarvoice.dropwizard.assets;

import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;
import java.util.Map;

public class AssetsConfiguration {
    @NotNull
    @JsonProperty
    private String cacheSpec = ConfiguredAssetsBundle.DEFAULT_CACHE_SPEC.toParsableString();

    @NotNull
    @JsonProperty
    private Map<String, String> overrides = Maps.newHashMap();

    @NotNull
    @JsonProperty
    private Map<String, String> mimeTypes = Maps.newHashMap();

    /** The caching specification for how to memoize assets. */
    public String getCacheSpec() {
        return cacheSpec;
    }

    public Iterable<Map.Entry<String, String>> getOverrides() {
        return Iterables.unmodifiableIterable(overrides.entrySet());
    }

    public Iterable<Map.Entry<String, String>> getMimeTypes() {
        return Iterables.unmodifiableIterable(mimeTypes.entrySet());
    }
}

Revert "remove not null constraint"

Revert "remove not null constraint"

This reverts commit 32f5c29a23341c4f1dd6c1241a751201ce286430.


package tr.xip.horriblesubsschedule;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

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

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }
}

package tr.xip.horriblesubsschedule;

import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;

public class MainActivity extends Activity {

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

        if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT)
            getActionBar().setIcon(android.R.color.transparent);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }
}

Hide action bar icon on pre-L devices

Hide action bar icon on pre-L devices


package lib.morkim.mfw.ui;

import lib.morkim.mfw.usecase.UseCase;
import lib.morkim.mfw.usecase.UseCaseResult;
import lib.morkim.mfw.usecase.UseCaseProgress;

public class EmptyPresenter extends Presenter {

	public EmptyPresenter(Viewable viewable) {
		super(viewable);
	}

	@Override
	public void onUseCaseStart(UseCase useCase) {}

	@Override
	public void onUseCaseUpdate(UseCaseProgress response) {}

	@Override
	public void onUseCaseComplete(UseCaseResult response) {}

	@Override
	public void onUseCaseCancel() {}

}

package lib.morkim.mfw.ui;

public class EmptyPresenter extends Presenter {

	public EmptyPresenter(Viewable viewable) {
		super(viewable);
	}

}

Remove view model in presenter

Remove view model in presenter


package org.ligoj.app.model;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import org.ligoj.bootstrap.core.model.AbstractAudited;
import lombok.Getter;
import lombok.Setter;

/**
 * A message to target audience.
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_MESSAGE")
public class Message extends AbstractAudited<Integer> {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Type of target (group, user, ...). When null the target is everybody.
	 *
	 * @see MessageTargetType
	 */
	@Enumerated(EnumType.STRING)
	@NotNull
	private MessageTargetType targetType;

	/**
	 * Optional related target : user, group, node, ...
	 */
	@NotNull
	private String target;

	/**
	 * Value of the message.
	 */
	@Length(max = 500)
	@NotNull
	@NotBlank
	private String value;
}

package org.ligoj.app.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import org.ligoj.bootstrap.core.model.AbstractAudited;
import lombok.Getter;
import lombok.Setter;

/**
 * A message to target audience.
 */
@Getter
@Setter
@Entity
@Table(name = "LIGOJ_MESSAGE")
public class Message extends AbstractAudited<Integer> {

	/**
	 * SID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * Type of target (group, user, ...). When null the target is everybody.
	 *
	 * @see MessageTargetType
	 */
	@Enumerated(EnumType.STRING)
	@NotNull
	@Column(length = 10)
	private MessageTargetType targetType;

	/**
	 * Optional related target : user, group, node, ...
	 */
	@NotNull
	private String target;

	/**
	 * Value of the message.
	 */
	@Length(max = 500)
	@NotNull
	@NotBlank
	private String value;
}

Reduce the column size for well known content


package camelinaction;

import org.apache.camel.jsonpath.JsonPath;
import org.apache.camel.language.Bean;

/**
 * A bean that acts as a JSon order service to handle incoming JSon orders
 */
public class JSonOrderService {

    public String handleIncomingOrder(@JsonPath("$.order.customerId") int customerId,
                                      @JsonPath("$.order.item") String item,
                                      @Bean(ref = "guid", method = "generate") int orderId) {

        // convert the order to a CSV and inject the generated order id
        return String.format("%s,%s,'%s'", orderId, customerId, item);
    }

}

package camelinaction;

import org.apache.camel.jsonpath.JsonPath;
import org.apache.camel.language.Bean;

/**
 * A bean that acts as a JSon order service to handle incoming JSon orders
 */
public class JSonOrderService {

    public String handleIncomingOrder(@JsonPath("$.order.customerId") int customerId,
                                      @JsonPath("$.order.item") String item,
                                      @Bean(ref = "guid", method = "generate") int orderId) {

        // convert the order to a CSV and inject the generated order id
        return String.format("%d,%s,'%s'", orderId, customerId, item);
    }

}

Use %d to format int value

Use %d to format int value


package remonsinnema.blog.fizzbuzz;

import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;

public class FizzBuzz {

  private final Collection<MultipleReplacer> replacers = Arrays.asList(
      new MultipleReplacer(3, "Fizz"), new MultipleReplacer(5, "Buzz"));

  public String get(int n) {
    StringBuilder result = new StringBuilder();
    for (MultipleReplacer replacer : replacers) {
      Optional<String> replacement = replacer.textFor(n);
      if (replacement.isPresent()) {
        result.append(replacement.get());
      }
    }
    if (result.length() > 0) {
      return result.toString();
    }
    return Integer.toString(n);
  }

}

package remonsinnema.blog.fizzbuzz;

import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;

public class FizzBuzz {

  private final Collection<MultipleReplacer> replacers = Arrays.asList(
      new MultipleReplacer(3, "Fizz"), new MultipleReplacer(5, "Buzz"));

  public String get(int n) {
    return replacers.stream()
        .map(replacer -> replacer.textFor(n))
        .filter(Optional::isPresent)
        .map(optional -> optional.get())
        .reduce((a, b) -> a + b)
        .orElse(Integer.toString(n));
  }

}

Use streams instead of loops and conditionals


package sizebay.catalog.client.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
public class DevolutionSummary {
	private Long id;
	private long tenantId;
	private int insertedReturns;
	private int invalidReturns;
	private int totalReturns;
}

package sizebay.catalog.client.model;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class DevolutionSummary {
	private Long id;
	private long tenantId;
	private int insertedReturns;
	private int invalidReturns;
	private int totalReturns;

	public DevolutionSummary(long tenantId) {
		this.setTenantId(tenantId);
	}
}

feat: Create constructor in devolutionSummary class


package im.delight.android.ddp.db;

/*
 * Copyright (c) delight.im <info@delight.im>
 *
 * 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.
 */

import im.delight.android.ddp.Fields;

/** Storage for data that exposes write access */
public interface DataStore {

	public void onDataAdded(String collectionName, String documentID, Fields newValues);
	public void onDataChanged(String collectionName, String documentID, Fields updatedValues, Fields removedValues);
	public void onDataRemoved(String collectionName, String documentID);

}

package im.delight.android.ddp.db;

/*
 * Copyright (c) delight.im <info@delight.im>
 *
 * 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.
 */

import im.delight.android.ddp.Fields;

/** Storage for data that exposes write access */
public interface DataStore {

	void onDataAdded(String collectionName, String documentID, Fields newValues);
	void onDataChanged(String collectionName, String documentID, Fields updatedValues, Fields removedValues);
	void onDataRemoved(String collectionName, String documentID);

}

Remove unnecessary visibility modifiers in interface


// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.restapi;

import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;

/**
 * @author bjorncs
 */
public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>> extends LoggingRequestHandler {

    private final RestApi restApi;

    @FunctionalInterface public interface RestApiProvider<T> { RestApi createRestApi(T self); }

    /**
     * RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed.
     * This is hack to leak reference to subclass instance's "this" reference.
     * Caller must ensure that provider instance does not try to access any uninitialized fields.
     */
    @SuppressWarnings("unchecked")
    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApiProvider<T> provider) {
        super(context);
        this.restApi = provider.createRestApi((T)this);
    }

    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApi restApi) {
        super(context);
        this.restApi = restApi;
    }

    @Override public final HttpResponse handle(HttpRequest request) { return restApi.handleRequest(request); }
}

// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.restapi;

import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;

/**
 * @author bjorncs
 */
public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>> extends LoggingRequestHandler {

    private final RestApi restApi;

    @FunctionalInterface public interface RestApiProvider<T> { RestApi createRestApi(T self); }

    /**
     * RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed.
     * This is hack to leak reference to subclass instance's "this" reference.
     * Caller must ensure that provider instance does not try to access any uninitialized fields.
     */
    @SuppressWarnings("unchecked")
    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApiProvider<T> provider) {
        super(context);
        this.restApi = provider.createRestApi((T)this);
    }

    protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApi restApi) {
        super(context);
        this.restApi = restApi;
    }

    @Override public final HttpResponse handle(HttpRequest request) { return restApi.handleRequest(request); }

    protected RestApi restApi() { return restApi; }
}

Add getter for restapi instance

Add getter for restapi instance


package org.cru.godtools.domain;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.MigrationVersion;

/**
 * Created by ryancarlson on 4/1/14.
 */
public class UnittestDatabaseBuilder
{
	public static void main(String[] args)
	{
		new UnittestDatabaseBuilder().build();
	}

	public void build()
	{
		Flyway flyway = new Flyway();
		flyway.setDataSource("jdbc:postgresql://localhost/godtoolstest", "godtoolsuser", "godtoolsuser");
		flyway.setInitVersion("0");
		flyway.setTarget(MigrationVersion.fromVersion("0.3"));
		flyway.clean();
		flyway.init();
		flyway.migrate();
	}
}

package org.cru.godtools.domain;

import com.googlecode.flyway.core.Flyway;
import com.googlecode.flyway.core.api.MigrationVersion;
import org.cru.godtools.domain.properties.GodToolsProperties;
import org.cru.godtools.domain.properties.GodToolsPropertiesFactory;

/**
 * Created by ryancarlson on 4/1/14.
 */
public class UnittestDatabaseBuilder
{
	static GodToolsProperties properties = new GodToolsPropertiesFactory().get();

	public static void main(String[] args)
	{
		new UnittestDatabaseBuilder().build();
	}

	public void build()
	{
		Flyway flyway = new Flyway();
		flyway.setDataSource(properties.getProperty("unittestDatabaseUrl"),
				properties.getProperty("unittestDatabaseUsername"),
				properties.getProperty("unittestDatabasePassword"));
		flyway.setInitVersion("0");
		flyway.setTarget(MigrationVersion.fromVersion("0.3"));
		flyway.clean();
		flyway.init();
		flyway.migrate();
	}
}

Remove hardcoded database info, use properties


package edu.stuy.starlorn.entities;

import java.awt.geom.Rectangle2D;

import edu.stuy.starlorn.upgrades.Upgrade;

public class Pickup extends Entity {

    protected Upgrade upgrade;
    protected double speed;

    public Pickup(Upgrade up, double x, double y) {
        super(x, y, up.getSpriteName());
        upgrade = up;
        speed = 5;
    }

    public Pickup(Upgrade up) {
        this(up, 0, 0);
    }

    public Upgrade getUpgrade() {
        return upgrade;
    }

    @Override
    public void step() {
        Rectangle2D.Double playerRect = world.getPlayer().getRect();
        double playerx = playerRect.x + playerRect.width / 2,
               playery = playerRect.y + playerRect.height / 2,
               thisx = getRect().x + getRect().width / 2,
               thisy = getRect().y + getRect().height / 2,
               theta = Math.atan2(playery - thisy, playerx - thisx),
               dist = Math.sqrt(Math.pow(playerx - thisx, 2) + Math.pow(playery - thisy, 2));

        setXvel(speed * Math.cos(theta));
        setYvel(speed * Math.sin(theta));
        super.step();
        if (dist < 50) {
            world.getPlayer().addUpgrade(getUpgrade());
            kill();
        }
    }
}

package edu.stuy.starlorn.entities;

import java.awt.geom.Rectangle2D;

import edu.stuy.starlorn.upgrades.Upgrade;

public class Pickup extends Entity {

    protected Upgrade upgrade;
    protected double speed;

    public Pickup(Upgrade up, double x, double y) {
        super(x, y, up.getSpriteName());
        upgrade = up;
        speed = 5;
    }

    public Pickup(Upgrade up) {
        this(up, 0, 0);
    }

    public Upgrade getUpgrade() {
        return upgrade;
    }

    @Override
    public void step() {
        Rectangle2D.Double playerRect = world.getPlayer().getRect();
        double playerx = playerRect.x + playerRect.width / 2,
               playery = playerRect.y + playerRect.height / 2,
               thisx = getRect().x + getRect().width / 2,
               thisy = getRect().y + getRect().height / 2,
               theta = Math.atan2(playery - thisy, playerx - thisx);

        setXvel(speed * Math.cos(theta));
        setYvel(speed * Math.sin(theta));
        super.step();
        if (playerRect.intersects(rect)) {
            world.getPlayer().addUpgrade(getUpgrade());
            kill();
        }
    }
}

Make pickup collisions more sensible.

Make pickup collisions more sensible.


package gov.nih.nci.evs.api.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import gov.nih.nci.evs.api.properties.ApplicationProperties;

@RestController
@RequestMapping("${nci.evs.application.contextPath}")
public class GeneratedFileController {

	@Autowired
	ApplicationProperties applicationProperties;

    @RequestMapping(value = "/getDataFromFile/{fileName}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
    public @ResponseBody byte[] getDataFromFile(@PathVariable(value = "fileName") String fileName,
                    HttpServletResponse response ) throws IOException {
        String baseDirectory = applicationProperties.getGeneratedFilePath();

        File inputFile = new File(baseDirectory + fileName);
        InputStream in = new FileInputStream(inputFile);
        response.setHeader("Content-Disposition", "attachment; filename=" + inputFile.getName());
        return IOUtils.toByteArray(in);
    }

}

package gov.nih.nci.evs.api.controller;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import gov.nih.nci.evs.api.properties.ApplicationProperties;

@RestController
@RequestMapping("${nci.evs.application.contextPath}")
public class GeneratedFileController {

	@Autowired
	ApplicationProperties applicationProperties;

    @RequestMapping(value = "/getDataFromFile/{fileName}", method = RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
    public @ResponseBody byte[] getDataFromFile(@PathVariable(value = "fileName") String fileName,
                    HttpServletResponse response ) throws IOException {
        String baseDirectory = applicationProperties.getGeneratedFilePath();

        File inputFile = new File(baseDirectory + fileName);
        try (FileInputStream in = new FileInputStream(inputFile)) {
            response.setHeader("Content-Disposition", "attachment; filename=" + inputFile.getName());
            return IOUtils.toByteArray(in);
        }
    }
}

Change file code to use Try-With-Resource


package io.github.likcoras.asuka.handler.response;

import org.pircbotx.PircBotX;
import org.pircbotx.hooks.types.GenericMessageEvent;
import io.github.likcoras.asuka.AsukaBot;

public class QuitResponse implements BotResponse {

	private GenericMessageEvent<PircBotX> event;
	private String reply;
	private String message;

	public QuitResponse(GenericMessageEvent<PircBotX> event, String reply, String message) {
		this.event = event;
		this.reply = reply;
		this.message = message;
	}

	@Override
	public void send(AsukaBot bot) {
		event.respond(reply.replaceAll("%s", event.getUser().getNick()));
		bot.getIrcBot().stopBotReconnect();
		bot.getIrcBot().sendIRC().quitServer(message);
	}

}

package io.github.likcoras.asuka.handler.response;

import org.pircbotx.PircBotX;
import org.pircbotx.hooks.types.GenericMessageEvent;
import io.github.likcoras.asuka.AsukaBot;

public class QuitResponse implements BotResponse {

	private GenericMessageEvent<PircBotX> event;
	private String reply;
	private String message;

	public QuitResponse(GenericMessageEvent<PircBotX> event, String reply, String message) {
		this.event = event;
		this.reply = reply.replaceAll("%s", event.getUser().getNick());
		this.message = message.replaceAll("%s", event.getUser().getNick());
	}

	@Override
	public void send(AsukaBot bot) {
		event.respond(reply);
		bot.getIrcBot().stopBotReconnect();
		bot.getIrcBot().sendIRC().quitServer(message);
	}

}

Make sure to add the requester to both the reply and message


package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

package net.onrc.onos.core.topology.serializers;

import java.io.IOException;

import net.onrc.onos.core.topology.Port;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;

public class PortSerializer extends SerializerBase<Port> {

    public PortSerializer() {
        super(Port.class);
    }

    @Override
    public void serialize(Port port, JsonGenerator jsonGenerator,
                          SerializerProvider serializerProvider)
            throws IOException, JsonProcessingException {
        jsonGenerator.writeStartObject();
        jsonGenerator.writeStringField("state", "ACTIVE");
        jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
        jsonGenerator.writeNumberField("number", port.getNumber());
        jsonGenerator.writeStringField("desc", port.getDescription());
        jsonGenerator.writeArrayFieldStart("devices");
        jsonGenerator.writeEndArray();
        jsonGenerator.writeEndObject();
    }

}

Add dpid to Port JSON object.

Add dpid to Port JSON object.

Change-Id: I69a78ce0a8cfb07883d4ac13318a7811ab951f02


package tw.davy.minecraft.treelogging.bukkit;

import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

import tw.davy.minecraft.treelogging.bukkit.listener.BlockListener;

/**
 * The main class for TreeLogging as a Bukkit plugin.
 *
 * @author Davy
 */
public final class TreeLoggingPlugin extends JavaPlugin
{
  public static final Logger logger = Logger.getLogger("Minecraft.LyTreeHelper");

  /**
   * Called on plugin enable.
   */
  public void onEnable()
  {
    (new BlockListener(this)).registerEvents();
    logger.info("[TreeLogging] Enabled.");
  }

  /**
   * Called on plugin disable.
   */
  public void onDisable()
  {
    logger.info("[TreeLogging] Disabled.");
  }

  /**
   * Called on command trigged.
   */
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    if (cmd.getName().equalsIgnoreCase("treelogging"))
    {
      //if (!(sender instanceof Player)) {
      //} else {
      //   Player player = (Player) sender;
      //}
      sender.sendMessage("TreeLogging, Makes logging trees truely.");
      sender.sendMessage("    Version: 0.1.0");
      return true;
    }
    return false;
  }
}

package tw.davy.minecraft.treelogging.bukkit;

import java.util.logging.Logger;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

import tw.davy.minecraft.treelogging.bukkit.listener.BlockListener;

/**
 * The main class for TreeLogging as a Bukkit plugin.
 *
 * @author Davy
 */
public final class TreeLoggingPlugin extends JavaPlugin
{
  public static final Logger logger = Logger.getLogger("Minecraft.TreeLogging");

  /**
   * Called on plugin enable.
   */
  public void onEnable()
  {
    (new BlockListener(this)).registerEvents();
    logger.info("[TreeLogging] Enabled.");
  }

  /**
   * Called on plugin disable.
   */
  public void onDisable()
  {
    logger.info("[TreeLogging] Disabled.");
  }

  /**
   * Called on command trigged.
   */
  public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
  {
    if (cmd.getName().equalsIgnoreCase("treelogging"))
    {
      //if (!(sender instanceof Player)) {
      //} else {
      //   Player player = (Player) sender;
      //}
      sender.sendMessage("TreeLogging, Makes logging trees truely.");
      sender.sendMessage("    Version: 0.1.0");
      return true;
    }
    return false;
  }
}

Fix name of the logger

Fix name of the logger


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

package net.myrrix.client.translating;

import org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator;

/**
 * Used when translation is needed only one-way, never back. The mappings do not need to be remembered.
 */
public final class OneWayMigrator extends AbstractIDMigrator {

  @Override
  public String toStringID(long longID) {
    throw new UnsupportedOperationException();
  }

}

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

package net.myrrix.client.translating;

import org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator;

/**
 * Used when translation is needed only one-way, never back. The mappings do not need to be remembered.
 */
public final class OneWayMigrator extends AbstractIDMigrator {

  @Override
  public String toStringID(long longID) {
    throw new UnsupportedOperationException();
  }

  /**
   * Prints the hashed long value of the given string argument.
   *
   * @param args first argument is string to hash
   */
  public static void main(String[] args) {
    System.out.println(new OneWayMigrator().toLongID(args[0]));
  }

}

Add handy main() method for hashing a given value


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

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

import org.jreversepro.jls.emitter.BlockEmitterConfig;

/**
 *
 * @author karthikeyanc
 *
 */
public class BlockEmitterConfigImpl_14 extends BlockEmitterConfig {

  public Map<String, String> getConfig() {
    Map<String, String> map = new HashMap<String, String>();
    map.put("net.sf.jrevpro.ast.block.MethodBlock",
        "net.sf.jrevpro.jls.emitter.java14.MethodEmitter");
    map.put("net.sf.jrevpro.ast.block.Statement",
        "net.sf.jrevpro.jls.emitter.java14.StatementEmitter");
    return map;
  }

}

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

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

import org.jreversepro.ast.block.MethodBlock;
import org.jreversepro.ast.block.Statement;
import org.jreversepro.jls.emitter.BlockEmitterConfig;

/**
 *
 * @author karthikeyanc
 *
 */
public class BlockEmitterConfigImpl_14 extends BlockEmitterConfig {

  @Override
  public Map<String, String> getConfig() {
    Map<String, String> map = new HashMap<String, String>();
    map.put(MethodBlock.class.getName(),
        MethodEmitter.class.getName());
    map.put(Statement.class.getName(),
        StatementEmitter.class.getName());
    return map;
  }

}

Fix nasty hardcoded class name.

Fix nasty hardcoded class name.


package com.orbekk.same;

public interface ClientService {
    void notifyNetwork(String networkName, String masterUrl);

    void setState(String component, long revision, String data);
}

package com.orbekk.same;

public interface ClientService {
    void notifyNetwork(String networkName, String masterUrl);

    void setState(String component, String data, long revision);
}

Switch parameter order for consistency.

Switch parameter order for consistency.


/*
 * Created by brightSPARK Labs
 * www.brightsparklabs.com
 */

package com.brightsparklabs.asanti.validator;

import com.brightsparklabs.asanti.model.data.DecodedAsnData;
import com.brightsparklabs.asanti.model.schema.typedefinition.AsnSchemaTypeDefinition;
import com.brightsparklabs.asanti.validator.rule.ValidationRule;
import com.google.common.collect.ImmutableSet;

/**
 * Default implementation of {@link Validator}.
 *
 * @author brightSPARK Labs
 */
public class ValidatorImpl implements Validator
{
    // -------------------------------------------------------------------------
    // INSTANCE VARIABLES
    // -------------------------------------------------------------------------

    /** visitor to determine which {@link ValidationRule} to apply to a tag */
    private final ValidationVisitor validationVisitor = new ValidationVisitor();

    // -------------------------------------------------------------------------
    // IMPLEMENTATION: Validator
    // -------------------------------------------------------------------------

    @Override
    public ValidationResult validate(DecodedAsnData decodedAsnData)
    {
        final ValidationResultImpl.Builder builder = ValidationResultImpl.builder();
        for (final String tag : decodedAsnData.getTags())
        {
            final AsnSchemaTypeDefinition type = decodedAsnData.getType(tag);
            final ValidationRule rule = (ValidationRule) type.visit(validationVisitor);
            final ImmutableSet<ValidationFailure> failures = rule.validate(tag, decodedAsnData);
            builder.addAll(failures);
        }

        // process unmapped tags
        decodedAsnData.getUnmappedTags();

        return builder.build();
    }
}

/*
 * Created by brightSPARK Labs
 * www.brightsparklabs.com
 */

package com.brightsparklabs.asanti.validator;

import com.brightsparklabs.asanti.model.data.DecodedAsnData;
import com.brightsparklabs.asanti.model.schema.typedefinition.AsnSchemaTypeDefinition;
import com.brightsparklabs.asanti.validator.rule.ValidationRule;
import com.google.common.collect.ImmutableSet;

/**
 * Default implementation of {@link Validator}.
 *
 * @author brightSPARK Labs
 */
public class ValidatorImpl implements Validator
{
    // -------------------------------------------------------------------------
    // INSTANCE VARIABLES
    // -------------------------------------------------------------------------

    /** visitor to determine which {@link ValidationRule} to apply to a tag */
    private final ValidationVisitor validationVisitor = new ValidationVisitor();

    // -------------------------------------------------------------------------
    // IMPLEMENTATION: Validator
    // -------------------------------------------------------------------------

    @Override
    public ValidationResult validate(DecodedAsnData decodedAsnData)
    {
        final ValidationResultImpl.Builder builder = ValidationResultImpl.builder();
        for (final String tag : decodedAsnData.getTags())
        {
            final AsnSchemaTypeDefinition type = decodedAsnData.getType(tag);
            final ValidationRule rule = (ValidationRule) type.visit(validationVisitor);
            final ImmutableSet<ValidationFailure> failures = rule.validate(tag, decodedAsnData);
            builder.addAll(failures);
        }

        // TODO: ASN-92 process unmapped tags
        decodedAsnData.getUnmappedTags();

        return builder.build();
    }
}

ASN-8: Add TODO note to unfinished validator method


package mobi.hsz.idea.gitignore.treeviewfilter.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.IgnoreManager;
import mobi.hsz.idea.gitignore.settings.IgnoreSettings;
import mobi.hsz.idea.gitignore.util.CommonDataKeys;

import java.util.Calendar;

/**
 * Created by maxi on 03/01/17.
 */
public class ShowHideIgnoredFilesAction extends AnAction {

    public ShowHideIgnoredFilesAction() {
        super(IgnoreBundle.message("action.toggleIgnoredVisibility"), IgnoreBundle.message("action.toggleIgnoredVisibility"), null);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        IgnoreSettings.getInstance().hideIgnoredFilesOnProjectView(!IgnoreSettings.getInstance().shouldHideIgnoredFilesOnProjectView());

        Presentation presentation = this.getTemplatePresentation();
        presentation.setText(Calendar.getInstance().getTime().toString());

//        presentation.setDescription(description);
//        presentation.setIcon(icon);
/*

//        IgnoreManager ignoreManager = IgnoreManager.getInstance(e.getProject());

        final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY);
        for (VirtualFile f : files) {
//            System.out.println(f.getName());
//            System.out.println("ignored: " + ignoreManager.isFileIgnored(f));
        }
*/
    }

}

package mobi.hsz.idea.gitignore.treeviewfilter;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.IgnoreManager;
import mobi.hsz.idea.gitignore.settings.IgnoreSettings;
import mobi.hsz.idea.gitignore.util.CommonDataKeys;

import java.util.Calendar;

/**
 * Created by maxi on 03/01/17.
 */
public class ShowHideIgnoredFilesAction extends AnAction {

    public ShowHideIgnoredFilesAction() {
        super(IgnoreBundle.message("action.toggleIgnoredVisibility"), IgnoreBundle.message("action.toggleIgnoredVisibility"), null);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        IgnoreSettings.getInstance().hideIgnoredFilesOnProjectView(!IgnoreSettings.getInstance().shouldHideIgnoredFilesOnProjectView());

        Presentation presentation = this.getTemplatePresentation();
        presentation.setText(Calendar.getInstance().getTime().toString());

//        presentation.setDescription(description);
//        presentation.setIcon(icon);

    }

}

Create action to toggle ignored files visibility


package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

package com.pm.server.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/")
public class HomeController implements Controller {

	private final static Logger log =
			LogManager.getLogger(HomeController.class.getName());

	@RequestMapping(
			value="/",
			method=RequestMethod.GET)
	@ResponseStatus(value = HttpStatus.OK)
	public String home() {

		log.debug("Mapped GET /");

		return "Welcome to the Pac Macro server!";
	}

}

Add default 200 status to Home mapping

Add default 200 status to Home mapping


/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2013 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brltty.android;

public final class SystemServiceReference<T> extends SingletonReference<T> {
  private final String serviceName;

  protected T onNeedReference () {
    return (T)ApplicationUtilities.getContext().getSystemService(serviceName);
  }

  SystemServiceReference (String name) {
    super();
    serviceName = name;
  }
}

/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2013 by The BRLTTY Developers.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any
 * later version. Please see the file LICENSE-GPL for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

package org.a11y.brltty.android;

public final class SystemServiceReference<T> extends SingletonReference<T> {
  private final String serviceName;

  @Override
  protected final T onNeedReference () {
    return (T)ApplicationUtilities.getContext().getSystemService(serviceName);
  }

  SystemServiceReference (String name) {
    super();
    serviceName = name;
  }
}

Add a missing @Override. (dm)

Add a missing @Override. (dm)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@6994 91a5dbb7-01b9-0310-9b5f-b28072856b6e


package org.rmatil.sync.core.messaging;

import org.rmatil.sync.core.messaging.fileexchange.offer.FileOfferRequest;

public enum StatusCode {

    NONE,

    ACCEPTED,

    /**
     * If the client sending the response
     * has denied the request
     */
    DENIED,

    /**
     * If the client has a conflict if
     * he would execute the requested action
     */
    CONFLICT,

    /**
     * If the client already has the state,
     * offered in an {@link FileOfferRequest}
     */
    REQUEST_OBSOLETE,

    /**
     * If the sending client is not authorized
     * to start a particular action on the receiving client
     */
    ACCESS_DENIED,

    /**
     * The status code of a file exchange message, if the
     * file has changed while transferring
     */
    FILE_CHANGED,

    FILE_CORRUPT,

    /**
     * The status code of a file exchange, if the
     * requested file has been lost
     */
    FILE_MISSING
}

package org.rmatil.sync.core.messaging;

import org.rmatil.sync.core.messaging.base.AMessage;
import org.rmatil.sync.core.messaging.base.ARequest;
import org.rmatil.sync.core.messaging.base.AResponse;
import org.rmatil.sync.core.messaging.fileexchange.offer.FileOfferRequest;
import org.rmatil.sync.core.messaging.fileexchange.push.FilePushExchangeHandler;

/**
 * Similar to HTTP responses, a {@link AMessage}, the base class
 * for an {@link ARequest} resp. {@link AResponse}, contains
 * a flag indicating the message's status.
 * <p>
 * However, not only responses may have a status but also
 * requests. The {@link FilePushExchangeHandler} uses this flag
 * to indicate whether a file has changed in the mean time of synchronising
 * to allow the receiving client to restart the exchange.
 */
public enum StatusCode {

    /**
     * Used for initial requests
     * which do not have any status yet
     */
    NONE,

    /**
     * If the request was accepted
     * and the corresponding operation executed
     */
    ACCEPTED,

    /**
     * If the client sending the response
     * has denied the request
     */
    DENIED,

    /**
     * If the client has a conflict if
     * he would execute the requested action
     */
    CONFLICT,

    /**
     * If the client already has the state,
     * offered in an {@link FileOfferRequest}
     */
    REQUEST_OBSOLETE,

    /**
     * If the sending client is not authorized
     * to start a particular action on the receiving client
     */
    ACCESS_DENIED,

    /**
     * The status code of a file exchange message, if the
     * file has changed while transmitting
     */
    FILE_CHANGED,

    /**
     * The status code of a file exchange, if the
     * requested file has been lost
     */
    FILE_MISSING
}

Add documentation and remove obsolete FILE_CORRUPT status


package annotator.find;

/**
 * This insertion adds two closing parentheses to close the unclosed parentheses
 * left by a {@link CastInsertion}. This should be inserted after the expression
 * that's being casted.
 */
public class CloseParenthesisInsertion extends Insertion {

    public CloseParenthesisInsertion(Criteria criteria,
            boolean separateLine) {
        super("))", criteria, separateLine);
    }

    /** {@inheritDoc} */
    @Override
    public String getText(boolean comments, boolean abbreviate) {
        return super.getText(false, false);
    }
}

package annotator.find;

/**
 * This insertion adds two closing parentheses to close the unclosed parentheses
 * left by a {@link CastInsertion}. This should be inserted after the expression
 * that's being casted.
 */
public class CloseParenthesisInsertion extends Insertion {

    public CloseParenthesisInsertion(Criteria criteria,
            boolean separateLine) {
        super("", criteria, separateLine);
    }

    /** {@inheritDoc} */
    @Override
    public String getText(boolean comments, boolean abbreviate) {
        return "))";
    }
}

Fix bug in close parenthesis insertion.

Fix bug in close parenthesis insertion.


/*
 * Copyright (c) 2013 3 Round Stones Inc., Some 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 org.callimachusproject.webdriver.pages;

import org.callimachusproject.webdriver.helpers.WebBrowserDriver;
import org.openqa.selenium.By;

public class FolderEdit extends CalliPage {

	public FolderEdit(WebBrowserDriver driver) {
		super(driver);
	}

	public FolderEdit waitUntilTitle(String title) {
		super.waitUntilTitle(title);
		return this;
	}

	public CalliPage delete() {
		browser.click(By.id("delete"));
		browser.confirm("Are you sure you want to delete this folder and all the contents of this folder");
		return page();
	}

}

/*
 * Copyright (c) 2013 3 Round Stones Inc., Some 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 org.callimachusproject.webdriver.pages;

import org.callimachusproject.webdriver.helpers.WebBrowserDriver;
import org.openqa.selenium.By;

public class FolderEdit extends CalliPage {

	public FolderEdit(WebBrowserDriver driver) {
		super(driver);
	}

	public FolderEdit waitUntilTitle(String title) {
		super.waitUntilTitle(title);
		return this;
	}

	public CalliPage delete() {
		browser.click(By.id("delete-path"));
		browser.confirm("Are you sure you want to delete this folder and all the contents of this folder");
		return page();
	}

}

Update delete link in test

Update delete link in test


package com.kryptnostic.mail.v1.http;

import com.kryptnostic.kodex.v1.models.response.BasicResponse;
import com.kryptnostic.mail.v1.models.EmailRequest;

import retrofit.http.Body;
import retrofit.http.POST;

public interface MailServiceApi {

    String INVITE = "invite";

    @POST( INVITE )
    BasicResponse<String> sendInvitationEmail( @Body EmailRequest request );

}

package com.kryptnostic.mail.v1.http;

import retrofit.http.Body;
import retrofit.http.POST;

import com.kryptnostic.kodex.v1.models.response.BasicResponse;
import com.kryptnostic.mail.v1.models.EmailRequest;

public interface MailServiceApi {
    String CONTROLLER = "/mail";
    String INVITE     = "/invite";

    @POST( INVITE )
    BasicResponse<String> sendInvitationEmail( @Body EmailRequest request );

}

Add controller constant and "/" to invite constant


package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
//		float a = (color >> 24) & 0xFF;
//		float r = color >> 16 & 0xFF;  // Faster way of getting red(argb)
//		float g = color >> 8 & 0xFF;   // Faster way of getting green(argb)
//		float b = color & 0xFF;          // Faster way of getting blue(argb)

//		float r = color >> 16 & 0xFF;  // Faster way of getting red(argb)
//		float g = color >> 8 & 0xFF;   // Faster way of getting green(argb)
//		float b = color & 0xFF;          // Faster way of getting blue(argb)

//		float r = p.red(color);
//		float g = p.green(color);
//		float b = p.blue(color);

//		return p.color(r, g, b, alpha);

		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}
}

package com.haxademic.core.draw.color;

import processing.core.PApplet;

import com.haxademic.core.app.P;

public class ColorUtil {

	public static int colorWithIntAndAlpha( PApplet p, int color, int alpha ) {
		// from: http://processing.org/discourse/beta/num_1261125421.html
		return (color & 0xffffff) | (alpha << 24);
	}

	public static int colorFromHex( String hex ) {
		return P.unhex("FF"+hex.substring(1));
	}

	public final static int alphaFromColorInt( int c ) { return (c >> 24) & 0xFF; }
	public final static int redFromColorInt( int c ) { return (c >> 16) & 0xFF;	}
	public final static int greenFromColorInt( int c ) { return (c >> 8)  & 0xFF; }
	public final static int blueFromColorInt( int c ) { return c & 0xFF; }

}

Add r,g,b-from-int color extractor methods


package fr.insee.pogues.transforms;

import org.junit.Test;

import java.util.Map;

import static org.junit.Assert.assertEquals;

public class TestPipeline {

    @Test
    public void passThroughTest() throws Exception {
        String input = "";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).transform();
        assertEquals(input, output);
    }

    @Test
    public void mappingTest() throws Exception {
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> i + "concat";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).map(t0, null).transform();
        assertEquals("concat", output);
    }
}

package fr.insee.pogues.transforms;

import fr.insee.pogues.webservice.rest.PoguesException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.util.Map;

import static org.junit.Assert.assertEquals;

public class TestPipeline {

    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Test
    public void passesThroughTest() throws Exception {
        String input = "";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).transform();
        assertEquals(input, output);
    }

    @Test
    public void mapsTest() throws Exception {
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> i + "concat";
        PipeLine pipeline = new PipeLine();
        String output = pipeline.from(input).map(t0, null).transform();
        assertEquals("concat", output);
    }

    @Test
    public void throwsExceptionTest() throws Exception {
        exception.expect(RuntimeException.class);
        exception.expectMessage("Exception occured while executing mapping function: Expected error");
        String input = "";
        PipeLine.Transform<String, String> t0 = (String i, Map<String, Object> params) -> {
            throw new PoguesException(500, "Expected error", "Mapping function exception correctly propagates through pipeline");
        };
        PipeLine pipeline = new PipeLine();
        pipeline.from(input).map(t0, null).transform();
    }
}

Add Pipeline Unit Test: Exception should propagate through pipeline


package com.BV.LinearGradient;

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

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

public class LinearGradientPackage implements ReactPackage {

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

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

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

package com.BV.LinearGradient;

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

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

public class LinearGradientPackage implements ReactPackage {

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

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

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

Handle Android RN 0.47 breaking change

Handle Android RN 0.47 breaking change


package com.mapzen.tangram.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import com.mapzen.tangram.MapController;
import com.mapzen.tangram.MapView;

public class MainActivity extends Activity {

    MapController mapController;
    MapView mapView;

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

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.main);

        mapView = (MapView)findViewById(R.id.map);
        mapController = new MapController(this, mapView);

    }

}

package com.mapzen.tangram.android;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;

import com.mapzen.tangram.MapController;
import com.mapzen.tangram.MapView;

public class MainActivity extends Activity {

    MapController mapController;
    MapView mapView;

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

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.main);

        mapView = (MapView)findViewById(R.id.map);
        mapController = new MapController(this, mapView);
        mapController.setMapZoom(16);
        mapController.setMapPosition(-74.00976419448854, 40.70532700869127);

    }

}

Add default position and zoom to android demo


/*
 * Created on 11-Jan-2006
 */
package uk.org.ponder.rsf.test.sitemap;

import java.util.HashMap;

import uk.org.ponder.rsf.bare.junit.PlainRSFTests;
import uk.org.ponder.rsf.viewstate.EntityCentredViewParameters;
import uk.org.ponder.rsf.viewstate.support.BasicViewParametersParser;

public class TestSiteMap extends PlainRSFTests {
  public void testParseECVP() {
    BasicViewParametersParser bvpp = (BasicViewParametersParser) applicationContext.getBean("viewParametersParser");
    HashMap attrmap = new HashMap();
    attrmap.put("flowtoken", "ec38f0");
    EntityCentredViewParameters ecvp = (EntityCentredViewParameters) bvpp.parse("/recipe/3652/", attrmap);
    System.out.println("ECVP for entity " + ecvp.entity.ID + " of type " + ecvp.entity.entityname);
  }

}

/*
 * Created on 11-Jan-2006
 */
package uk.org.ponder.rsf.test.sitemap;

import java.util.HashMap;

import uk.org.ponder.rsf.bare.junit.PlainRSFTests;
import uk.org.ponder.rsf.viewstate.EntityCentredViewParameters;
import uk.org.ponder.rsf.viewstate.support.BasicViewParametersParser;

public class TestSiteMap extends PlainRSFTests {
  public TestSiteMap() {
    contributeConfigLocation("classpath:uk/org/ponder/rsf/test/sitemap/sitemap-context.xml");
  }

  public void testParseECVP() {
    BasicViewParametersParser bvpp = (BasicViewParametersParser) applicationContext.getBean("viewParametersParser");
    HashMap attrmap = new HashMap();
    attrmap.put("flowtoken", "ec38f0");
    EntityCentredViewParameters ecvp = (EntityCentredViewParameters) bvpp.parse("/recipe/3652/", attrmap);
    System.out.println("ECVP for entity " + ecvp.entity.ID + " of type " + ecvp.entity.entityname);
  }

}

Fix for loading SiteMap entry on Spring 2.x


package io.openex.scheduler;

import com.google.common.collect.ImmutableMap;
import io.openex.management.Executor;
import io.openex.management.contract.Contract;
import org.apache.camel.Component;
import org.apache.camel.component.gson.GsonDataFormat;
import org.apache.camel.component.http4.HttpComponent;
import org.apache.camel.component.quartz2.QuartzComponent;

@SuppressWarnings("PackageAccessibility")
class SchedulerExecutor implements Executor {

	public String id() {
		return "openex_scheduler";
	}

	@Override
	public Contract contract() {
		return null;
	}

	@Override
	public ImmutableMap<String, Component> components() {
		QuartzComponent quartzComponent = new QuartzComponent();
		quartzComponent.setEnableJmx(false); //Standalone scheduler, no need to register it in mbean
		return ImmutableMap.of("http", new HttpComponent(), "quartz", quartzComponent);
	}

	@Override
	public ImmutableMap<String, Object> beans() {
		return ImmutableMap.of("json-gson", new GsonDataFormat());
	}
}

package io.openex.scheduler;

import com.google.common.collect.ImmutableMap;
import io.openex.management.Executor;
import io.openex.management.contract.Contract;
import org.apache.camel.Component;
import org.apache.camel.component.gson.GsonDataFormat;
import org.apache.camel.component.http4.HttpComponent;
import org.apache.camel.component.quartz2.QuartzComponent;

@SuppressWarnings("PackageAccessibility")
class SchedulerExecutor implements Executor {

	public String id() {
		return "openex_scheduler";
	}

	@Override
	public Contract contract() {
		return null;
	}

	@Override
	public ImmutableMap<String, Component> components() {
		QuartzComponent quartzComponent = new QuartzComponent();
		quartzComponent.setEnableJmx(false); //Standalone scheduler, no need to register it in mbean
		HttpComponent httpComponent = new HttpComponent();
		return ImmutableMap.of("http", httpComponent, "https", httpComponent, "quartz", quartzComponent);
	}

	@Override
	public ImmutableMap<String, Object> beans() {
		return ImmutableMap.of("json-gson", new GsonDataFormat());
	}
}

Add https support in the worker

Add https support in the worker


package com.aviras.mrassistant.data.models;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Represent doctor
 * <p/>
 * Created by ashish on 8/6/16.
 */
public class Doctor extends RealmObject{

    @PrimaryKey
    private int id;

    private CharSequence name;

    private CharSequence address;

    private CharSequence notes;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public CharSequence getName() {
        return name;
    }

    public void setName(CharSequence name) {
        this.name = name;
    }

    public CharSequence getAddress() {
        return address;
    }

    public void setAddress(CharSequence address) {
        this.address = address;
    }

    public CharSequence getNotes() {
        return notes;
    }

    public void setNotes(CharSequence notes) {
        this.notes = notes;
    }
}

package com.aviras.mrassistant.data.models;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Represent doctor
 * <p/>
 * Created by ashish on 8/6/16.
 */
public class Doctor extends RealmObject {

    @PrimaryKey
    private int id;

    private CharSequence name;

    private CharSequence contactNumber;

    private CharSequence address;

    private CharSequence notes;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public CharSequence getName() {
        return name;
    }

    public void setName(CharSequence name) {
        this.name = name;
    }

    public CharSequence getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(CharSequence contactNumber) {
        this.contactNumber = contactNumber;
    }

    public CharSequence getAddress() {
        return address;
    }

    public void setAddress(CharSequence address) {
        this.address = address;
    }

    public CharSequence getNotes() {
        return notes;
    }

    public void setNotes(CharSequence notes) {
        this.notes = notes;
    }
}

Add contactNumber field to doctor

Add contactNumber field to doctor


package net.teamio.taam.content;

import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;

public class MaterialMachinesTransparent extends Material {
	public static final MaterialMachinesTransparent INSTANCE = new MaterialMachinesTransparent(MapColor.ironColor);

	public MaterialMachinesTransparent(MapColor color) {
		super(color);
		this.setRequiresTool();
	}

    @Override
    public boolean isSolid()
    {
        return false;
    }

	@Override
	public boolean blocksLight() {
		return false;
	}

    @Override
    public boolean blocksMovement()
    {
        return false;
    }

    @Override
    public boolean isOpaque() {
    	return false;
    }
}

package net.teamio.taam.content;

import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;

public class MaterialMachinesTransparent extends Material {
	public static final MaterialMachinesTransparent INSTANCE = new MaterialMachinesTransparent(MapColor.ironColor);

	public MaterialMachinesTransparent(MapColor color) {
		super(color);
		this.setRequiresTool();
	}

    @Override
    public boolean isSolid()
    {
        return false;
    }

	@Override
	public boolean blocksLight() {
		return false;
	}

    @Override
    public boolean blocksMovement()
    {
        return true;
    }

    @Override
    public boolean isOpaque() {
    	return false;
    }
}

Fix machines getting destroyed by fluids


package com.chaquo.python.demo;

import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

package com.chaquo.python.demo;

import android.content.pm.*;
import android.os.*;
import android.support.v7.app.*;
import android.support.v7.preference.*;
import android.text.method.*;
import android.widget.*;
import com.chaquo.python.*;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        try {
            String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
            setTitle(getTitle() + " " + version);
        } catch (PackageManager.NameNotFoundException ignored) {}

        if (! Python.isStarted()) {
            Python.start(new AndroidPlatform(this));
        }

        setContentView(R.layout.activity_main);
        getSupportFragmentManager().beginTransaction()
            .replace(R.id.flMenu, new MenuFragment())
            .commit();

        ((TextView)findViewById(R.id.tvCaption)).setMovementMethod(LinkMovementMethod.getInstance());
    }

    public static class MenuFragment extends PreferenceFragmentCompat {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            addPreferencesFromResource(R.xml.activity_main);
        }
    }
}

Add version number to menu screen

Add version number to menu screen


package org.pdxfinder.dao;

import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;

/**
 * Created by jmason on 17/03/2017.
 */
@NodeEntity
public class QualityAssurance {

    @GraphId
    Long id;

    private String technology;
    private String description;
    private String passages;

    public QualityAssurance() {
    }

    public QualityAssurance(String technology, String description, String passages) {
        this.technology = technology;
        this.description = description;

        this.passages = passages;
    }

    public String getTechnology() {
        return technology;
    }

    public void setTechnology(String technology) {
        this.technology = technology;
    }

    public String getDescription() {
        return description;
    }

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

    public String getPassages() {
        return passages;
    }

    public void setPassages(String passages) {
        this.passages = passages;
    }
}

package org.pdxfinder.dao;

import org.neo4j.ogm.annotation.GraphId;
import org.neo4j.ogm.annotation.NodeEntity;

/**
 * Created by jmason on 17/03/2017.
 */
@NodeEntity
public class QualityAssurance {

    @GraphId
    Long id;

    private String technology;
    private String description;
    private String passages;
    private String validationHostStrain;

    public QualityAssurance() {
    }

    public QualityAssurance(String technology, String description, String passages) {
        this.technology = technology;
        this.description = description;

        this.passages = passages;
    }

    public QualityAssurance(String technology, String description, String passages, String validationHostStrain) {
        this.technology = technology;
        this.description = description;
        this.passages = passages;
        this.validationHostStrain = validationHostStrain;
    }

    public String getTechnology() {
        return technology;
    }

    public void setTechnology(String technology) {
        this.technology = technology;
    }

    public String getDescription() {
        return description;
    }

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

    public String getPassages() {
        return passages;
    }

    public void setPassages(String passages) {
        this.passages = passages;
    }

    public String getValidationHostStrain() {
        return validationHostStrain;
    }

    public void setValidationHostStrain(String validationHostStrain) {
        this.validationHostStrain = validationHostStrain;
    }
}

Add host strain to validation

Add host strain to validation


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

import javax.time.Instant;

import com.opengamma.id.UniqueId;

/**
 * Implementation of {@link ChangeManager} to use when change notifications are not supported or never needed.
 */
public final class DummyChangeManager implements ChangeManager {

  /**
   * Singleton instance
   */
  public static final DummyChangeManager INSTANCE = new DummyChangeManager();

  /**
   * Hidden constructor.
   */
  private DummyChangeManager() {
  }

  @Override
  public void addChangeListener(ChangeListener listener) {
  }

  @Override
  public void removeChangeListener(ChangeListener listener) {
  }

  @Override
  public void entityChanged(ChangeType type, UniqueId beforeId, UniqueId afterId, Instant versionInstant) {
    throw new UnsupportedOperationException(DummyChangeManager.class.getSimpleName() + " does not support change notifications");
  }

}

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

import javax.time.Instant;

import com.opengamma.id.UniqueId;

/**
 * Implementation of {@link ChangeManager} to use when change notifications are not supported or never needed.
 */
public final class DummyChangeManager implements ChangeManager {

  /**
   * Singleton instance
   */
  public static final DummyChangeManager INSTANCE = new DummyChangeManager();

  /**
   * Hidden constructor.
   */
  private DummyChangeManager() {
  }

  @Override
  public void addChangeListener(ChangeListener listener) {
    // dummy manager does nothing
  }

  @Override
  public void removeChangeListener(ChangeListener listener) {
    // dummy manager does nothing
  }

  @Override
  public void entityChanged(ChangeType type, UniqueId beforeId, UniqueId afterId, Instant versionInstant) {
    // dummy manager does nothing
  }

}

Make dummy change manager do nothing

Make dummy change manager do nothing