package com.untamedears.mustercull;

/**
 * The method used to cull the mobs
 * @author Celdecea
 */
enum CullType {

	/**
	 * Uses Bukkit events to deny a spawn.
	 */
	SPAWN,

	/**
	 * Uses Bukkit events to prevent a spawner from operating.
	 */
	SPAWNER,

	/**
	 * Uses damage on mobs in crowded chunks.
	 */
	DAMAGE;

	/**
	 * Returns a CullType representing the name provided.
	 * @param name A case-sensitive name to compare to.
	 * @return The CullType representing the name provided.
	 */
	public static CullType fromName(String name) {

		if (name == null) {
			return null;
		}

		name = name.trim();

		for (CullType culling : values()) {
			if (0 == name.compareToIgnoreCase(culling.name())) {
				return culling;
			}
		}

		return null;
	}
}

package com.untamedears.mustercull;

/**
 * The method used to cull the mobs
 * @author Celdecea
 */
enum CullType {

	/**
	 * Uses Bukkit events to deny a spawn.
	 */
	SPAWN,

	/**
	 * Uses Bukkit events to prevent a spawner from operating.
	 */
	SPAWNER,

	/**
	 * Uses damage on mobs in crowded chunks.
	 */
	DAMAGE;

	/**
	 * Returns a CullType representing the name provided.
	 * @param name A case-insensitive name to compare to.
	 * @return The CullType representing the name provided, or null.
	 */
	public static CullType fromName(String name) {

		if (name == null) {
			return null;
		}

		for (CullType culling : values()) {
			if (0 == name.compareToIgnoreCase(culling.name())) {
				return culling;
			}
		}

		return null;
	}
}

Comment fix and removed trim() because it is really not this method's job.


package org.reldb.dbrowser.ui.version;

public class Version {
	public static String getVersion() {
		return "User interface version 3.00";
	}

	public static String getCopyright() {
		return "Copyright  2004 - 2015 Dave Voorhis";
	}

	public static String getURL() {
		return "http://reldb.org";
	}

	public static String getPreferencesRepositoryName() {
		return "rel.reldb.org";
	}

}

Remove (c) symbol in favour of word "Copyright".


package org.hummingbirdlang.types;

public class ClassType extends CompositeType {
  private Type superClass;
}

package org.hummingbirdlang.types;

public class ClassType extends CompositeType {
  private String name;
  private Type superClass;

  public ClassType(String name, Type superClass) {
    this.name = name;
    this.superClass = superClass;
  }
}

Add name and constructor to class type

Add name and constructor to class type


package com.facebook.presto.cli;

public final class Help
{
    private Help() {}

    public static String getHelpText()
    {
        return "" +
                "Supported commands:\n" +
                "QUIT\n" +
                "DESCRIBE <table>\n" +
                "SHOW COLUMNS FROM <table>\n" +
                "SHOW FUNCTIONS\n" +
                "SHOW PARTITIONS FROM <table>\n" +
                "SHOW TABLES\n" +
                "";
    }
}

package com.facebook.presto.cli;

public final class Help
{
    private Help() {}

    public static String getHelpText()
    {
        return "" +
                "Supported commands:\n" +
                "QUIT\n" +
                "DESCRIBE <table>\n" +
                "SHOW COLUMNS FROM <table>\n" +
                "SHOW FUNCTIONS\n" +
                "SHOW PARTITIONS FROM <table>\n" +
                "SHOW TABLES [LIKE <pattern>]\n" +
                "";
    }
}

Add full syntax for SHOW TABLES to help

Add full syntax for SHOW TABLES to help


package net.alcuria.umbracraft.definitions.skill;

import net.alcuria.umbracraft.annotations.Tooltip;
import net.alcuria.umbracraft.definitions.Definition;

import com.badlogic.gdx.utils.Array;

public class SkillDefinition extends Definition {

	@Tooltip("The multiplier of the base damage")
	public float damageMultiplier;
	@Tooltip("The cost to use the skill, in EP")
	public int epCost;
	@Tooltip("The icon to use for the skill")
	public String iconId;
	public float maxPercentageCost;
	@Tooltip("The name of the skill")
	public String name;
	@Tooltip("The targets of the skill, relative to the drop point")
	public Array<SkillPositionDefinition> target;
	@Tooltip("The ATB cost of the skill, in turns")
	public float turnCost;

	@Override
	public String getName() {
		return name != null ? name : "Skill";
	}

}

package net.alcuria.umbracraft.definitions.skill;

import net.alcuria.umbracraft.annotations.Tooltip;
import net.alcuria.umbracraft.definitions.Definition;
import net.alcuria.umbracraft.definitions.skill.actions.SkillActionDefinition;

import com.badlogic.gdx.utils.Array;

public class SkillDefinition extends Definition {

	@Tooltip("The action sequence when using the skill")
	public Array<SkillActionDefinition> actions;
	@Tooltip("The multiplier of the base damage")
	public float damageMultiplier;
	@Tooltip("The cost to use the skill, in EP")
	public int epCost;
	@Tooltip("The icon to use for the skill")
	public String iconId;
	public float maxPercentageCost;
	@Tooltip("The name of the skill")
	public String name;
	@Tooltip("The targets of the skill, relative to the drop point")
	public Array<SkillPositionDefinition> targets;
	@Tooltip("The ATB cost of the skill, in turns")
	public float turnCost;

	@Override
	public String getName() {
		return name != null ? name : "Skill";
	}

}

Add fields for targets and actions

Add fields for targets and actions


/**
 * Package containing all command related classes and files.
 */
package com.gmail.jameshealey1994.simplepvptoggle.commands;

Remove newline from end of file.

Remove newline from end of file.


package som;

import java.lang.Thread.UncaughtExceptionHandler;

import tools.concurrency.TracingActivityThread;

/**
 * In case an actor processing thread terminates, provide some info.
 */
public final class UncaughtExceptions implements UncaughtExceptionHandler {

  private final VM vm;

  public UncaughtExceptions(final VM vm) {
    this.vm = vm;
  }

  @Override
  public void uncaughtException(final Thread t, final Throwable e) {
    if (e instanceof ThreadDeath) {
      // Ignore those, we already signaled an error
      return;
    }
    TracingActivityThread thread = (TracingActivityThread) t;
    Output.errorPrintln("Processing failed for: "
        + thread.getActivity().toString());
    e.printStackTrace();

    vm.requestExit(2);
  }
}

package som;

import java.lang.Thread.UncaughtExceptionHandler;

import tools.concurrency.TracingActivityThread;

/**
 * In case an actor processing thread terminates, provide some info.
 */
public final class UncaughtExceptions implements UncaughtExceptionHandler {

  private final VM vm;

  public UncaughtExceptions(final VM vm) {
    this.vm = vm;
  }

  @Override
  public void uncaughtException(final Thread t, final Throwable e) {
    if (e instanceof ThreadDeath) {
      // Ignore those, we already signaled an error
      return;
    }

    Output.errorPrintln("Uncaught exception on " + t.getName());

    TracingActivityThread thread = (TracingActivityThread) t;
    if (thread.getActivity() != null) {
      Output.errorPrintln("Processing failed for: "
          + thread.getActivity().toString());
    }
    e.printStackTrace();

    vm.requestExit(2);
  }
}

Fix NPE in uncaught exception handler, and add info on thread

Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>


package nallar.tickthreading.mod;

import me.nallar.modpatcher.ModPatcher;
import nallar.tickthreading.log.Log;
import nallar.tickthreading.util.PropertyUtil;
import nallar.tickthreading.util.Version;
import nallar.tickthreading.util.unsafe.UnsafeUtil;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

import java.util.*;

@IFMLLoadingPlugin.Name("@MOD_NAME@Core")
@IFMLLoadingPlugin.MCVersion("@MC_VERSION@")
@IFMLLoadingPlugin.SortingIndex(1002)
public class CoreMod implements IFMLLoadingPlugin {
	public static boolean

	static {
		if (PropertyUtil.get("removeSecurityManager", false)) {
			UnsafeUtil.removeSecurityManager();
		}

		ModPatcher.requireVersion("latest", "beta");
		Log.info(Version.DESCRIPTION + " CoreMod initialised");
	}

	@Override
	public String[] getASMTransformerClass() {
		return new String[0];
	}

	@Override
	public String getModContainerClass() {
		return null;
	}

	@Override
	public String getSetupClass() {
		return ModPatcher.getSetupClass();
	}

	@Override
	public void injectData(Map<String, Object> map) {
		ModPatcher.loadMixins("nallar.tickthreading.mixin");
	}

	@Override
	public String getAccessTransformerClass() {
		return null;
	}
}

package nallar.tickthreading.mod;

import me.nallar.modpatcher.ModPatcher;
import nallar.tickthreading.log.Log;
import nallar.tickthreading.util.PropertyUtil;
import nallar.tickthreading.util.Version;
import nallar.tickthreading.util.unsafe.UnsafeUtil;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;

import java.util.*;

@IFMLLoadingPlugin.Name("@MOD_NAME@Core")
@IFMLLoadingPlugin.MCVersion("@MC_VERSION@")
@IFMLLoadingPlugin.SortingIndex(1002)
public class CoreMod implements IFMLLoadingPlugin {
	static {
		if (PropertyUtil.get("removeSecurityManager", false)) {
			UnsafeUtil.removeSecurityManager();
		}

		ModPatcher.requireVersion("latest", "beta");
		Log.info(Version.DESCRIPTION + " CoreMod initialised");
	}

	@Override
	public String[] getASMTransformerClass() {
		return new String[0];
	}

	@Override
	public String getModContainerClass() {
		return null;
	}

	@Override
	public String getSetupClass() {
		return ModPatcher.getSetupClass();
	}

	@Override
	public void injectData(Map<String, Object> map) {
		ModPatcher.loadMixins("nallar.tickthreading.mixin");
	}

	@Override
	public String getAccessTransformerClass() {
		return null;
	}
}

Remove accidental extra line - shouldn't have been part of last commit


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
	protected void initializeViewModel(ViewModel viewModel) {}

	@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;

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() {}

}

Remove view model in presenter

Remove view model in presenter


package com.easternedgerobotics.rov.io;

import com.easternedgerobotics.rov.io.pololu.PololuMaestroInputChannel;

public class MPX4250AP {
    /**
     * Scalar value for calculating pressure from voltage.
     */
    private static final float PRESSURE_SCALAR = 0.264909785f;

    /**
     * Offset value for calculating pressure from voltage.
     */
    private static final float PRESSURE_OFFSET = 54.20054200f;

    /**
     * The Pololu Maestro channel this device uses.
     */
    private final PololuMaestroInputChannel channel;

    /**
     * Constructs a new MPX4250AP sensor on the given channel.
     * @param channel the channel this device uses
     */
    public MPX4250AP(final PololuMaestroInputChannel channel) {
        this.channel = channel;
    }

    /**
     * Returns the pressure.
     * @return the pressure
     */
    public final float read() {
        return channel.voltage() * PRESSURE_OFFSET - PRESSURE_SCALAR;
    }
}

package com.easternedgerobotics.rov.io;

import com.easternedgerobotics.rov.io.pololu.PololuMaestroInputChannel;

/**
 * A MPX4250 is an absolute pressure (AP) sensor. See also: MPX4250.
 */
public class MPX4250AP {
    /**
     * Scalar value for calculating pressure from voltage.
     */
    private static final float PRESSURE_SCALAR = 0.264909785f;

    /**
     * Offset value for calculating pressure from voltage.
     */
    private static final float PRESSURE_OFFSET = 54.20054200f;

    /**
     * The Pololu Maestro channel this device uses.
     */
    private final PololuMaestroInputChannel channel;

    /**
     * Constructs a new MPX4250AP sensor on the given channel.
     * @param channel the channel this device uses
     */
    public MPX4250AP(final PololuMaestroInputChannel channel) {
        this.channel = channel;
    }

    /**
     * Returns the pressure.
     * @return the pressure
     */
    public final float read() {
        return channel.voltage() * PRESSURE_OFFSET - PRESSURE_SCALAR;
    }
}

Add link to MPX4250 spec sheet

Add link to MPX4250 spec sheet


package com.suse.salt.netapi.calls.modules;

import com.suse.salt.netapi.calls.LocalCall;

import com.google.gson.reflect.TypeToken;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * salt.modules.state
 */
public class State {

    private State() { }

    public static LocalCall<Map<String, Object>> apply(List<String> mods) {
        return apply(mods, Optional.empty());
    }

    public static LocalCall<Map<String, Object>> apply(String... mods) {
        return apply(Arrays.asList(mods), Optional.empty());
    }

    public static LocalCall<Map<String, Object>> apply(List<String> mods,
            Optional<Map<String, Object>> pillar) {
        Map<String, Object> args = new LinkedHashMap<>();
        args.put("mods", mods);
        if (pillar.isPresent()) {
            args.put("pillar", pillar.get());
        }
        return new LocalCall<>("state.apply", Optional.empty(), Optional.of(args),
                new TypeToken<Map<String, Object>>() { });
    }

    public static LocalCall<Object> showHighstate() {
        return new LocalCall<>("state.show_highstate", Optional.empty(), Optional.empty(),
                new TypeToken<Object>() { });
    }

}

package com.suse.salt.netapi.calls.modules;

import com.suse.salt.netapi.calls.LocalCall;

import com.google.gson.reflect.TypeToken;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * salt.modules.state
 */
public class State {

    private State() { }

    public static LocalCall<Map<String, Object>> apply(List<String> mods) {
        return apply(mods, Optional.empty(), Optional.empty());
    }

    public static LocalCall<Map<String, Object>> apply(String... mods) {
        return apply(Arrays.asList(mods), Optional.empty(), Optional.empty());
    }

    public static LocalCall<Map<String, Object>> apply(List<String> mods,
            Optional<Map<String, Object>> pillar, Optional<Boolean> queue) {
        Map<String, Object> args = new LinkedHashMap<>();
        args.put("mods", mods);
        if (pillar.isPresent()) {
            args.put("pillar", pillar.get());
        }
        if (queue.isPresent()) {
            args.put("queue", queue.get());
        }
        return new LocalCall<>("state.apply", Optional.empty(), Optional.of(args),
                new TypeToken<Map<String, Object>>() { });
    }

    public static LocalCall<Object> showHighstate() {
        return new LocalCall<>("state.show_highstate", Optional.empty(), Optional.empty(),
                new TypeToken<Object>() { });
    }

}

Add support for the 'queue' parameter

Add support for the 'queue' parameter


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

package io.nodyn.buffer;

import io.netty.buffer.ByteBuf;
import org.dynjs.runtime.ExternalIndexedData;

/**
 * @author Bob McWhirter
 */
public class NettyExternalIndexedData implements ExternalIndexedData {

    private final ByteBuf buf;

    public NettyExternalIndexedData(ByteBuf buf) {
        this.buf = buf;
    }

    public ByteBuf buffer() {
        return this.buf;
    }

    @Override
    public Object get(long l) {
        return this.buf.getUnsignedByte((int) l);
    }

    @Override
    public void put(long l, Object o) {
        if (o instanceof Number) {
            int value = ((Number) o).intValue() & 0xFF;
            this.buf.setByte((int) l, value );
        } else {
            System.err.println("ATTEMPT TO PUT: " + o);
        }
    }
}

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

package io.nodyn.buffer;

import io.netty.buffer.ByteBuf;
import org.dynjs.runtime.ExternalIndexedData;

/**
 * @author Bob McWhirter
 */
public class NettyExternalIndexedData implements ExternalIndexedData {

    private final ByteBuf buf;

    public NettyExternalIndexedData(ByteBuf buf) {
        this.buf = buf;
    }

    public ByteBuf buffer() {
        return this.buf;
    }

    @Override
    public Object get(long l) {
        return this.buf.getUnsignedByte((int) l);
    }

    @Override
    public void put(long l, Object o) {
        if (o instanceof Number) {
            int value = ((Number) o).intValue() & 0xFF;
            this.buf.setByte((int) l, value);
            this.buf.writerIndex((int) Math.max( this.buf.writerIndex(), l ));
        }
    }
}

Adjust writerIndex to highest value if putting a single character using array-index notation.


package mariculture.core.render;

import mariculture.core.tile.TileTankBlock;
import net.minecraftforge.fluids.FluidStack;

public class RenderCopperTank extends RenderBase {
    public RenderCopperTank() {}

    @Override
    public void renderBlock() {
        if (!isItem()) {
            TileTankBlock tank = (TileTankBlock) world.getTileEntity(x, y, z);
            if (tank != null) if (tank.tank.getFluidAmount() > 0) {
                FluidStack fluid = tank.tank.getFluid();
                if (fluid != null) {
                    double height = fluid.amount * 1D / tank.getCapacity();
                    setTexture(fluid.getFluid().getIcon());
                    if(fluid.getFluid().isGaseous()) {
                        renderFluidBlock(0, 1 - height, 0, 1, 1, 1);
                    } else {
                        renderFluidBlock(0, 0, 0, 1, height, 1);
                    }
                }
            }
        }

        setTexture(block);
        renderBlock(-0.01D, -0.01D, -0.01D, 1.01D, 1.01D, 1.01D);
    }
}

package mariculture.core.render;

import mariculture.core.tile.TileTankBlock;
import net.minecraftforge.fluids.FluidStack;

public class RenderCopperTank extends RenderBase {
    public RenderCopperTank() {}

    @Override
    public void renderBlock() {
        if (!isItem()) {
            TileTankBlock tank = (TileTankBlock) world.getTileEntity(x, y, z);
            if (tank != null) if (tank.tank.getFluidAmount() > 0) {
                FluidStack fluid = tank.tank.getFluid();
                if (fluid != null) {
                    double height = fluid.amount * 1D / tank.getCapacity();
                    setTexture(fluid.getFluid().getStillIcon());
                    if(fluid.getFluid().getBlock() != null) {
                        setTexture(fluid.getFluid().getBlock().getIcon(world, x, y, z, 0));
                    }

                    if(fluid.getFluid().isGaseous()) {
                        renderFluidBlock(0, 1 - height, 0, 1, 1, 1);
                    } else {
                        renderFluidBlock(0, 0, 0, 1, height, 1);
                    }
                }
            }
        }

        setTexture(block);
        renderBlock(-0.01D, -0.01D, -0.01D, 1.01D, 1.01D, 1.01D);
    }
}

Fix pressurised water render in copper tanks.


package org.jongo.util;

import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

import com.mongodb.DB;
import com.mongodb.Mongo;

public class EmbeddedMongoRule implements TestRule {

	private static DB db;

	public static Mongo getMongo() {
		return MongoHolder.getInstance();
	}

	public static DB getTestDatabase() {
		return db;
	}

	public EmbeddedMongoRule() {
		setUpTestDatabase();
	}

	public Statement apply(final Statement base, final Description description) {
		return new Statement() {
			@Override
			public void evaluate() throws Throwable {
				before(description);
				try {
					base.evaluate();
				} finally {
					after();
				}
			}
		};
	}

	protected void before(Description description) throws Exception {
		setUpTestDatabase();
	}

	protected void after() {
		tearDownTestDatabase();
	}

	public void setUpTestDatabase(){
		if(db == null) {
			db = getMongo().getDB("test_" + System.nanoTime());
		}
	}

	public void tearDownTestDatabase(){
		if (db != null) {
			db.dropDatabase();
			db = null;
		}
	}

}

package org.jongo.util;

import com.mongodb.MongoClient;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;

import com.mongodb.DB;
import com.mongodb.Mongo;

public class EmbeddedMongoRule implements TestRule {

	private static DB db;

	public static MongoClient getMongo() {
		return MongoHolder.getInstance();
	}

	public static DB getTestDatabase() {
		return db;
	}

	public EmbeddedMongoRule() {
		setUpTestDatabase();
	}

	public Statement apply(final Statement base, final Description description) {
		return new Statement() {
			@Override
			public void evaluate() throws Throwable {
				before(description);
				try {
					base.evaluate();
				} finally {
					after();
				}
			}
		};
	}

	protected void before(Description description) throws Exception {
		setUpTestDatabase();
	}

	protected void after() {
		tearDownTestDatabase();
	}

	public void setUpTestDatabase(){
		if(db == null) {
			db = getMongo().getDB("test_" + System.nanoTime());
		}
	}

	public void tearDownTestDatabase(){
		if (db != null) {
			db.dropDatabase();
			db = null;
		}
	}

}

Replace missing Mongo to MongoClient

Replace missing Mongo to MongoClient


/**
 *
 * Copyright 2016 Florian Schmaus
 *
 * 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.jivesoftware.smackx.iot.data.element;

public class Constants {

    public static final String IOT_SENSORDATA_NAMESPACE = "urn:xmpp:iot:data";

}

/**
 *
 * Copyright 2016 Florian Schmaus
 *
 * 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.jivesoftware.smackx.iot.data.element;

public class Constants {

    public static final String IOT_SENSORDATA_NAMESPACE = "urn:xmpp:iot:sensordata";

}

Fix "XEP-0323: IoT - Sensor Data" namespace


package org.cafebabepy.runtime.module.builtins;

import org.cafebabepy.annotation.DefineCafeBabePyType;
import org.cafebabepy.runtime.Python;
import org.cafebabepy.runtime.module.AbstractCafeBabePyType;

/**
 * Created by yotchang4s on 2017/05/13.
 */
@DefineCafeBabePyType(name = "builtins.object", parent = {})
public class PyObjectType extends AbstractCafeBabePyType {

    public PyObjectType(Python runtime) {
        super(runtime);
    }
}

package org.cafebabepy.runtime.module.builtins;

import org.cafebabepy.annotation.DefineCafeBabePyType;
import org.cafebabepy.runtime.Python;
import org.cafebabepy.runtime.module.AbstractCafeBabePyType;

/**
 * Created by yotchang4s on 2017/05/13.
 */
@DefineCafeBabePyType(name = "builtins.object")
public class PyObjectType extends AbstractCafeBabePyType {

    public PyObjectType(Python runtime) {
        super(runtime);
    }
}

Fix object parent is object

Fix object parent is object


package com.blstream.studybox.api;

import retrofit.RequestInterceptor;
import retrofit.RestAdapter;

public class RestClient {

    private static final String URL = "http://78.133.154.70:2000/";
    private static final String BASE_URL = "http://private-5f2e4b-studybox2.apiary-mock.com/";
    private RestInterface restInterface;

    public RestClient(){
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(BASE_URL)
                .build();

        restInterface = restAdapter.create(RestInterface.class);
    }

    public RestClient(RequestInterceptor interceptor){
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setEndpoint(URL)
                .setRequestInterceptor(interceptor)
                .build();

        restInterface = restAdapter.create(RestInterface.class);
    }

    public RestInterface getService(){
        return restInterface;
    }
}

package com.blstream.studybox.api;

import com.google.gson.GsonBuilder;

import java.lang.reflect.Modifier;

import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.converter.GsonConverter;

public class RestClient {

    private static final String URL = "http://78.133.154.70:2000/";
    private static final String BASE_URL = "http://private-5f2e4b-studybox2.apiary-mock.com/";
    private RestInterface restInterface;

    public RestClient(){
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setConverter(new GsonConverter(new GsonBuilder()
                        .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
                        .serializeNulls()
                        .create()))
                .setEndpoint(BASE_URL)
                .build();

        restInterface = restAdapter.create(RestInterface.class);
    }

    public RestClient(RequestInterceptor interceptor){
        RestAdapter restAdapter = new RestAdapter.Builder()
                .setConverter(new GsonConverter(new GsonBuilder()
                        .excludeFieldsWithModifiers(Modifier.FINAL, Modifier.TRANSIENT, Modifier.STATIC)
                        .serializeNulls()
                        .create()))
                .setEndpoint(URL)
                .setRequestInterceptor(interceptor)
                .build();

        restInterface = restAdapter.create(RestInterface.class);
    }

    public RestInterface getService(){
        return restInterface;
    }
}

Fix problems on Android 6.0

Fix problems on Android 6.0


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


package org.exist.backup;

import java.io.*;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;

/**
 * Implementation of BackupWriter that writes to a zip file.
 */
public class ZipWriter implements BackupWriter {

    private String currentPath;
    private ZipOutputStream out;
    private StringWriter contents;

    public ZipWriter(String zipFile, String collection) throws IOException {
        File file = new File(zipFile);
        out = new ZipOutputStream(new FileOutputStream(file));
        currentPath = collection;
    }

    public Writer newContents() throws IOException {
        contents = new StringWriter();
        return contents;
    }

    public void closeContents() throws IOException {
        ZipEntry entry = new ZipEntry(currentPath + "/__contents__.xml");
        out.putNextEntry(entry);
        out.write(contents.toString().getBytes("UTF-8"));
        out.closeEntry();
    }

    public OutputStream newEntry(String name) throws IOException {
        ZipEntry entry = new ZipEntry(currentPath + '/' + name);
        out.putNextEntry(entry);
        return out;
    }

    public void closeEntry() throws IOException {
        out.closeEntry();
    }

    public void newCollection(String name) {
        currentPath = currentPath + '/' + name;
    }

    public void closeCollection() {
        int p = currentPath.lastIndexOf('/');
        if (p > 0)
            currentPath = currentPath.substring(0, p);
    }

    public void close() throws IOException {
        out.close();
    }
}

package org.exist.backup;

import java.io.*;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;

/**
 * Implementation of BackupWriter that writes to a zip file.
 */
public class ZipWriter implements BackupWriter {

    private String currentPath;
    private ZipOutputStream out;
    private StringWriter contents;

    public ZipWriter(String zipFile, String collection) throws IOException {
        File file = new File(zipFile);
        out = new ZipOutputStream(new FileOutputStream(file));
        currentPath = collection;
    }

    public Writer newContents() throws IOException {
        contents = new StringWriter();
        return contents;
    }

    public void closeContents() throws IOException {
        ZipEntry entry = new ZipEntry(mkRelative(currentPath) + "/__contents__.xml");
        out.putNextEntry(entry);
        out.write(contents.toString().getBytes("UTF-8"));
        out.closeEntry();
    }

    public OutputStream newEntry(String name) throws IOException {
        ZipEntry entry = new ZipEntry(mkRelative(currentPath) + '/' + name);
        out.putNextEntry(entry);
        return out;
    }

    public void closeEntry() throws IOException {
        out.closeEntry();
    }

    public void newCollection(String name) {
        currentPath = currentPath + '/' + name;
    }

    public void closeCollection() {
        int p = currentPath.lastIndexOf('/');
        if (p > 0)
            currentPath = currentPath.substring(0, p);
    }

    public void close() throws IOException {
        out.close();
    }

    private String mkRelative(String path) {
    	if (path.length() > 0 && path.charAt(0) == '/')
    		return path.substring(1);
    	return path;
    }
}

Store relative paths when creating a backup in a .zip file.

svn path=/trunk/eXist/; revision=6315


package info.u_team.u_team_test.init;

import info.u_team.u_team_core.api.construct.*;
import info.u_team.u_team_core.util.registry.BusRegister;

@Construct(client = true)
public class TestClientBusRegister implements IModConstruct {

	@Override
	public void construct() {
		BusRegister.registerMod(TestColors::registerMod);
		BusRegister.registerMod(TestKeys::registerMod);
		BusRegister.registerMod(TestModels::registerMod);
		BusRegister.registerMod(TestScreens::registerMod);

		BusRegister.registerForge(TestKeys::registerForge);
	}

}

package info.u_team.u_team_test.init;

import info.u_team.u_team_core.api.construct.*;
import info.u_team.u_team_core.util.registry.BusRegister;
import info.u_team.u_team_test.TestMod;

@Construct(modid = TestMod.MODID, client = true)
public class TestClientBusRegister implements IModConstruct {

	@Override
	public void construct() {
		BusRegister.registerMod(TestColors::registerMod);
		BusRegister.registerMod(TestKeys::registerMod);
		BusRegister.registerMod(TestModels::registerMod);
		BusRegister.registerMod(TestScreens::registerMod);

		BusRegister.registerForge(TestKeys::registerForge);
	}

}

Add the new modid field in the client construct bus register


package com.red.alert.ui.notifications;

import android.app.NotificationManager;
import android.content.Context;

import com.red.alert.R;
import com.red.alert.services.sound.StopSoundService;

public class AppNotifications {
    public static void clearAll(Context context) {
        // Get notification manager
        NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);

        // Cancel all notifications
        notificationManager.cancel(context.getString(R.string.appName).hashCode());

        // Stop alert playing
        StopSoundService.stopSoundService(context);
    }
}

package com.red.alert.ui.notifications;

import android.app.NotificationManager;
import android.content.Context;

import com.red.alert.R;
import com.red.alert.services.sound.StopSoundService;

public class AppNotifications {
    public static void clearAll(Context context) {
        // Get notification manager
        NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);

        // Cancel all notifications
        notificationManager.cancelAll();

        // Stop alert sound if playing
        StopSoundService.stopSoundService(context);
    }
}

Use NotificationManager.cancelAll() to cancel all app notifications


package me.nallar.exception;

/**
 * Thrown via Thread.stop() to try to resolve a deadlock, should be caught in Thread.run(), and thread should attempt to resume working.
 */
public class ThreadStuckError extends Error {
	public ThreadStuckError() {
		super();
	}

	public ThreadStuckError(final String message) {
		super(message);
	}

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

	public ThreadStuckError(final Throwable cause) {
		super(cause);
	}

	protected ThreadStuckError(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
		super(message, cause, enableSuppression, writableStackTrace);
	}
}

package me.nallar.exception;

/**
 * Thrown via Thread.stop() to try to resolve a deadlock, should be caught in Thread.run(), and thread should attempt to resume working.
 */
public class ThreadStuckError extends Error {
	public ThreadStuckError() {
		super();
	}

	public ThreadStuckError(final String message) {
		super(message);
	}

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

	public ThreadStuckError(final Throwable cause) {
		super(cause);
	}
}

Remove JDK 7 only constructor

Remove JDK 7 only constructor

Signed-off-by: Ross Allan <ca2c77e14df1e7ee673215c1ef658354e220f471@gmail.com>


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

package com.vmware.connection.helpers;

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

public abstract class BaseHelper {
    Connection connection = null;

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

    public BaseHelper() { }

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

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

package com.vmware.connection.helpers;

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

public abstract class BaseHelper {
    Connection connection = null;

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

    public BaseHelper() { }

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

Remove call to the method connect() on the connection


package org.wikipedia.concurrency;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

public class CallbackTask<T> extends SaneAsyncTask<T> {
    public interface Callback<T> {
        void success(T row);
    }

    public interface Task<T> {
        T execute();
    }

    @NonNull private final Task<T> task;
    @Nullable private final Callback<T> callback;

    public static <T> void execute(@NonNull Task<T> task) {
        execute(task, null);
    }

    public static <T> void execute(@NonNull Task<T> task, @Nullable Callback<T> callback) {
        new CallbackTask<>(task, callback).execute();
    }

    CallbackTask(@NonNull Task<T> task, @Nullable Callback<T> callback) {
        this.task = task;
        this.callback = callback;
    }

    @Override public T performTask() throws Throwable {
        return task.execute();
    }

    @Override public void onFinish(T result) {
        super.onFinish(result);
        if (callback != null) {
            callback.success(result);
        }
    }
}

package org.wikipedia.concurrency;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

public class CallbackTask<T> extends SaneAsyncTask<T> {
    public interface Callback<T> {
        void success(T row);
    }

    public interface Task<T> {
        T execute();
    }

    @NonNull private final Task<T> task;
    @Nullable private Callback<T> callback;

    public static <T> void execute(@NonNull Task<T> task) {
        execute(task, null);
    }

    public static <T> void execute(@NonNull Task<T> task, @Nullable Callback<T> callback) {
        new CallbackTask<>(task, callback).execute();
    }

    CallbackTask(@NonNull Task<T> task, @Nullable Callback<T> callback) {
        this.task = task;
        this.callback = callback;
    }

    @Override public T performTask() throws Throwable {
        return task.execute();
    }

    @Override public void onFinish(T result) {
        super.onFinish(result);
        if (callback != null) {
            callback.success(result);
            callback = null;
        }
    }
}

Fix possible memory leak in feed.

Fix possible memory leak in feed.

I've observed a memory leak (on API 17) apparently stemming from the new
functionality to fill in the bookmark icon when the featured article is
detected to be part of a reading list.

This seems to be caused by us passing an anonymous instance of a
CallbackTask.Callback object from FeaturedArticleView, which contains
references to $this, which contains a reference to the activity context.

This patch solves the leak by modifying the CallbackTask to no longer hold
on to a reference of Callback, and instead null it out immediately after
it's called.

Change-Id: I768e24dab7f39652ec741a5d6f9821db7de4f2bd


package edu.virginia.psyc.pi.persistence;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import edu.virginia.psyc.pi.domain.DoNotDelete;
import edu.virginia.psyc.pi.domain.Exportable;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by dan on 3/24/16.
 * Data about a Participant that can be exported.
 */
@Data
@Entity
@Table(name="participant")
@Exportable
@DoNotDelete
public class ParticipantExportDAO {

    @JsonProperty("participantId")
    @Id private long id;
    private String theme;
    private String study;
    private String cbmCondition;
    private String prime;
    private boolean admin;
    private boolean emailOptout;
    private boolean active;
    private boolean increase30;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="EEE, dd MMM yyyy HH:mm:ss Z", timezone="EST")
    private Date   lastLogin;
    private String currentSession;
}

package edu.virginia.psyc.pi.persistence;

import com.fasterxml.jackson.annotation.JsonFormat;
import edu.virginia.psyc.pi.domain.DoNotDelete;
import edu.virginia.psyc.pi.domain.Exportable;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by dan on 3/24/16.
 * Data about a Participant that can be exported.
 */
@Data
@Entity
@Table(name="participant")
@Exportable
@DoNotDelete
public class ParticipantExportDAO {

    @Id private long id;
    private String theme;
    private String study;
    private String cbmCondition;
    private String prime;
    private boolean admin;
    private boolean emailOptout;
    private boolean active;
    private boolean increase30;
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="EEE, dd MMM yyyy HH:mm:ss Z", timezone="EST")
    private Date   lastLogin;
    private String currentSession;
}

Change ParticipantDAO back to id

Change ParticipantDAO back to id


package ee.tuleva.onboarding.auth.session;

import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Component;

@Component
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public class GenericSessionStore implements Serializable {

  @Serial private static final long serialVersionUID = -648103071415508424L;

  private final Map<String, Object> sessionAttributes = new HashMap<>();

  public <T extends Serializable> void save(T sessionAttribute) {
    sessionAttributes.put(sessionAttribute.getClass().getName(), sessionAttribute);
  }

  public <T extends Serializable> Optional<T> get(Class clazz) {
    @SuppressWarnings("unchecked")
    T sessionAttribute = (T) sessionAttributes.get(clazz.getName());

    if (sessionAttribute == null) {
      return Optional.empty();
    }

    return Optional.of(sessionAttribute);
  }
}

package ee.tuleva.onboarding.auth.session;

import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.SessionScope;

@Component
@SessionScope
public class GenericSessionStore implements Serializable {

  @Serial private static final long serialVersionUID = -648103071415508424L;

  private final Map<String, Object> sessionAttributes = new HashMap<>();

  public <T extends Serializable> void save(T sessionAttribute) {
    sessionAttributes.put(sessionAttribute.getClass().getName(), sessionAttribute);
  }

  public <T extends Serializable> Optional<T> get(Class clazz) {
    @SuppressWarnings("unchecked")
    T sessionAttribute = (T) sessionAttributes.get(clazz.getName());

    if (sessionAttribute == null) {
      return Optional.empty();
    }

    return Optional.of(sessionAttribute);
  }
}

Use composed annotation for readability

Use composed annotation for readability


/**
 * Twilio Video for React Native.
 *
 * Authors:
 *   Ralph Pina <ralph.pina@gmail.com>
 *   Jonathan Chang <slycoder@gmail.com>
 */

package com.twiliorn.library;

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 TwilioPackage 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 CustomTwilioVideoViewManager(),
            new TwilioRemotePreviewManager(),
            new TwilioVideoPreviewManager()
        );
    }
}

/**
 * Twilio Video for React Native.
 *
 * Authors:
 *   Ralph Pina <ralph.pina@gmail.com>
 *   Jonathan Chang <slycoder@gmail.com>
 */

package com.twiliorn.library;

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 TwilioPackage implements ReactPackage {
    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }

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

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

Fix android build for RN 0.47

Fix android build for RN 0.47

createJSModules is no longer present.  In order to ensure backwards
compatibility, just remove the Override tag for now.


package com.cwainner.chris.recipecentral;

import android.os.Build;
import android.widget.TextView;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import static org.junit.Assert.*;

@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
@RunWith(RobolectricGradleTestRunner.class)

public class AboutActivityTest {
    private AboutActivity activity;

    @Before
    public void setup() {
        activity = Robolectric.setupActivity(AboutActivity.class);
    }

    @Test
    public void validateAboutHeader(){
        TextView aboutHeaderView = (TextView) activity.findViewById(R.id.aboutHeader);
        assertTrue("About".equals(aboutHeaderView.getText().toString()));
    }
}

package com.cwainner.chris.recipecentral;

import android.os.Build;
import android.widget.TextView;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricGradleTestRunner;
import org.robolectric.annotation.Config;

import static org.junit.Assert.*;

@Config(constants = BuildConfig.class, sdk = Build.VERSION_CODES.LOLLIPOP)
@RunWith(RobolectricGradleTestRunner.class)

public class AboutActivityTest {
    private AboutActivity activity;

    @Before
    public void setup() {
        activity = Robolectric.setupActivity(AboutActivity.class);
    }

    @Test
    public void validateAboutHeader(){
        TextView aboutHeaderView = (TextView) activity.findViewById(R.id.aboutHeader);
        assertTrue("About".equals(aboutHeaderView.getText().toString()));
    }

    @Test
    public void validateAboutText(){
        TextView aboutTextView = (TextView) activity.findViewById(R.id.aboutText);
        String aboutTextContent = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi egestas, ante sit amet facilisis auctor, risus arcu faucibus justo, at tempor odio est ut est. Sed sodales augue a egestas suscipit. Curabitur malesuada tellus dolor, quis laoreet ipsum suscipit tristique. Sed vel ex iaculis, sollicitudin ipsum ac, maximus augue. Phasellus ut dui sed sapien vulputate dapibus. Suspendisse sed neque nec dolor pulvinar iaculis. Suspendisse lorem nisi, tristique a sapien at, porta blandit eros. Nam ut tincidunt mauris, id sollicitudin nulla. Mauris sit amet tincidunt nulla. Etiam elit velit, rutrum sit amet velit in, placerat commodo augue. Curabitur vitae rhoncus velit. In porttitor dictum cursus. Mauris eu fermentum dolor. Phasellus laoreet, metus ut malesuada convallis, elit arcu porta urna, condimentum porttitor magna turpis eget dolor.";
        assertTrue(aboutTextContent.equals(aboutTextView.getText().toString()));
    }
}

Add additional test for About activity

Add additional test for About activity


package water;

import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;

import static org.junit.Assert.*;

public class TCPReceiverThreadTest extends TestUtil {

  @BeforeClass()
  public static void setup() {
    stall_till_cloudsize(1);
  }

  @Test
  public void testDontShutdownOnGarbageRequests() throws Exception {
    NodeLocalEventCollectingListener ext = NodeLocalEventCollectingListener.getFreshInstance();

    // make a bogus request to our H2O PORT (NOT the API PORT!!!)
    // using HTTP is just a cheap trick to send some garbage data that H2O won't recognize
    URL apiURL = new URL("http:/" + H2O.SELF_ADDRESS + ":" + H2O.H2O_PORT + "/");
    try (InputStream is = apiURL.openStream()) {
      assertNull(is); // should never happen
    } catch (IOException e) {
      String m = e.getMessage();
      if (!m.equals("Connection reset") && !m.equals("Connection refused (Connection refused)")) {
        throw e;
      }
    }

    ArrayList<Object[]> protocolFailure = ext.getData("protocol-failure");
    assertEquals(1, protocolFailure.size());
    assertArrayEquals(new Object[]{"handshake"}, protocolFailure.get(0));
  }

}

package water;

import org.junit.BeforeClass;
import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;

import static org.junit.Assert.*;

public class TCPReceiverThreadTest extends TestUtil {

  @BeforeClass()
  public static void setup() {
    stall_till_cloudsize(1);
  }

  @Test
  public void testDontShutdownOnGarbageRequests() throws Exception {
    NodeLocalEventCollectingListener ext = NodeLocalEventCollectingListener.getFreshInstance();

    // make a bogus request to our H2O PORT (NOT the API PORT!!!)
    // using HTTP is just a cheap trick to send some garbage data that H2O won't recognize
    URL apiURL = new URL("http:/" + H2O.SELF_ADDRESS + ":" + H2O.H2O_PORT + "/");
    try (InputStream is = apiURL.openStream()) {
      assertNull(is); // should never happen
    } catch (IOException e) {
      e.printStackTrace();
    }

    ArrayList<Object[]> protocolFailure = ext.getData("protocol-failure");
    assertEquals(1, protocolFailure.size());
    assertArrayEquals(new Object[]{"handshake"}, protocolFailure.get(0));
  }

}

Make a test more robust

Make a test more robust


package net.liftweb.actor;

import java.lang.annotation.*;

/**
 * The internal Java class where the annotations for
 * JavaActor are stored
 */
class JavaActorBase {
    /**
     * A method annotated with Receive will
     * receive a message of the type of its parameter.
     */
    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface Receive {
    }
}

package net.liftweb.actor;

import java.lang.annotation.*;

/**
 * The internal Java class where the annotations for
 * JavaActor are stored
 */
public class JavaActorBase {
    /**
     * A method annotated with Receive will
     * receive a message of the type of its parameter.
     */
    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface Receive {
    }
}

Adjust visibility for javadoc compliance


import java.util.Vector;

/**
 *
 */

/**
 * An interface for password store objects.
 *
 * @author Miltiadis Allamanis
 *
 */
public interface IPasswordStore {
	/**
	 * Return a list of all the stored passwords.
	 *
	 * @return a vector containing the ids of stored passwords
	 */
	public Vector<String> getAllStoredPasswordIds();

	public boolean removePassword(final String aId);

	/**
	 * Retrieve a unique password with the specified id.
	 *
	 * @param aId
	 *            the unique password id to look for
	 * @return a Password object or null if no password with an id is found
	 */
	public Password retrivePassword(final String aId);

	/**
	 * Store a password object to the store.
	 *
	 * @param aPassword
	 *            the password to store
	 * @return true if the password has been stored sucessfully
	 */
	public boolean storePassword(final Password aPassword);
}

import java.util.AbstractList;

/**
 *
 */

/**
 * An interface for password store objects.
 *
 * @author Miltiadis Allamanis
 *
 */
public interface IPasswordStore {
	/**
	 * Return a list of all the stored passwords.
	 *
	 * @return a vector containing the ids of stored passwords
	 */
	public AbstractList<String> getAllStoredPasswordIds();

	/**
	 * Remove password from store.
	 *
	 * @param aId
	 *            the id of the password
	 * @return true if the password has been sucessfuly removed
	 */
	public boolean removePassword(final String aId);

	/**
	 * Retrieve a unique password with the specified id.
	 *
	 * @param aId
	 *            the unique password id to look for
	 * @return a Password object or null if no password with an id is found
	 */
	public Password retrivePassword(final String aId);

	/**
	 * Store a password object to the store.
	 *
	 * @param aPassword
	 *            the password to store
	 * @return true if the password has been stored sucessfully
	 */
	public boolean storePassword(final Password aPassword);
}

Comment addition and interface change from Vector to AbstractList


package org.museautomation.selenium.steps;

import org.museautomation.core.*;
import org.museautomation.core.context.*;
import org.museautomation.core.resource.*;
import org.museautomation.core.step.*;
import org.museautomation.core.step.descriptor.*;
import org.museautomation.core.values.descriptor.*;

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
@MuseTypeId("close-window")
@MuseStepName("Close Window")
@MuseInlineEditString("Close current window")
@MuseStepIcon("glyph:FontAwesome:WINDOW_CLOSE")
@MuseStepTypeGroup("Selenium.Window")
@MuseStepShortDescription("Close the current browser tab and/or window")
@MuseStepLongDescription("Closes the current browser tab or window. If it is the last tab/window opened, it will shutdown the browser.")
public class CloseWindow extends BrowserStep
    {
    @SuppressWarnings("unused") // called via reflection
    public CloseWindow(StepConfiguration config, MuseProject project)
        {
        super(config);
        }

    @Override
    public StepExecutionResult executeImplementation(StepExecutionContext context) throws MuseExecutionError
        {
        getDriver(context).close();
        return new BasicStepExecutionResult(StepExecutionStatus.COMPLETE);
        }

    public final static String TYPE_ID = CloseWindow.class.getAnnotation(MuseTypeId.class).value();
    }

package org.museautomation.selenium.steps;

import org.museautomation.core.*;
import org.museautomation.core.context.*;
import org.museautomation.core.step.*;
import org.museautomation.core.step.descriptor.*;

/**
 * @author Christopher L Merrill (see LICENSE.txt for license details)
 */
@MuseTypeId("close-window")
@MuseStepName("Close Window")
@MuseInlineEditString("Close current window")
@MuseStepIcon("glyph:FontAwesome:WINDOW_CLOSE_ALT")
@MuseStepTypeGroup("Selenium.Window")
@MuseStepShortDescription("Close the current browser tab and/or window")
@MuseStepLongDescription("Closes the current browser tab or window. If it is the last tab/window opened, it will shutdown the browser.")
@SuppressWarnings("unused")  // discovered and instantiated via reflection
public class CloseWindow extends BrowserStep
    {
    @SuppressWarnings("unused") // called via reflection
    public CloseWindow(StepConfiguration config, MuseProject project)
        {
        super(config);
        }

    @Override
    public StepExecutionResult executeImplementation(StepExecutionContext context) throws MuseExecutionError
        {
        getDriver(context).close();
        return new BasicStepExecutionResult(StepExecutionStatus.COMPLETE);
        }

    public final static String TYPE_ID = CloseWindow.class.getAnnotation(MuseTypeId.class).value();
    }

ENHANCE - improve Close Window icon

[selenium] ENHANCE - improve Close Window icon


package se.kth.csc.payload.message;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import se.kth.csc.model.QueuePosition;
import se.kth.csc.payload.api.QueuePositionInQueueSnapshot;
import se.kth.csc.payload.api.Snapshotters;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
public class QueuePositionCreatedInQueue {
    private final QueuePositionInQueueSnapshot position;
    private final String queueName;

    public QueuePositionCreatedInQueue(QueuePosition queuePosition, String queueName) {
        this.queueName = queueName;
        this.position = Snapshotters.QueuePositionInQueueSnapshotter.INSTANCE.apply(queuePosition);
    }

    public QueuePositionInQueueSnapshot getQueuePosition() {
        return position;
    }
    public String getQueueName() {
        return queueName;
    }
}

package se.kth.csc.payload.message;

import com.fasterxml.jackson.annotation.JsonTypeInfo;
import se.kth.csc.model.QueuePosition;
import se.kth.csc.payload.api.QueuePositionInQueueSnapshot;
import se.kth.csc.payload.api.Snapshotters;

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME)
public class QueuePositionCreatedInQueue {
    private final QueuePositionInQueueSnapshot position;
    private final String queueName;

    public QueuePositionCreatedInQueue(QueuePosition queuePosition, String queueName) {
        this.position = Snapshotters.QueuePositionInQueueSnapshotter.INSTANCE.apply(queuePosition);
        this.queueName = queueName;
    }

    public QueuePositionInQueueSnapshot getQueuePosition() {
        return position;
    }
    public String getQueueName() {
        return queueName;
    }
}

Change order of "position" and "queueName" to correspond to QueuePositionCreatedInAccount.


package org.realityforge.arez;

/**
 * Interface that allows caller to release any resources associated with element.
 * It is safe to invoke {@link #dispose()} multiple times on a element. Dispose
 * is considered a state modifying action and must be called either within an
 * action where mutation is true or else it will start it's own transaction before
 * performing dispose. Once an element is disposed, no other methods should be invoked
 * on element.
 */
@FunctionalInterface
public interface Disposable
{
  /**
   * Dispose element.
   */
  void dispose();
}

package org.realityforge.arez;

/**
 * Interface that allows caller to release any resources associated with element.
 * It is safe to invoke {@link #dispose()} multiple times on a element. Dispose
 * is considered a state modifying action and must be called either within an
 * action where mutation is true or else it will start it's own transaction before
 * performing dispose. Once an element is disposed, no other methods should be invoked
 * on element.
 */
@FunctionalInterface
public interface Disposable
{
  /**
   * Dispose element. See {@link Disposable} for a description of the implications.
   */
  void dispose();
}

Update the description so docs can be inherited by implementers


package org.fedoraproject.javadeptools.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table
public class ManifestEntry {
    @Id
    @GeneratedValue(generator = "gen")
    @GenericGenerator(name = "gen", strategy = "increment")
    private Long id;

    @ManyToOne
    @JoinColumn(name = "fileArtifactId", nullable = false)
    private FileArtifact fileArtifact;

    public ManifestEntry() {
    }

    public ManifestEntry(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public Long getId() {
        return id;
    }

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

    public FileArtifact getFileArtifact() {
        return fileArtifact;
    }

    public void setFileArtifact(FileArtifact fileArtifact) {
        this.fileArtifact = fileArtifact;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private String key;

    @Lob
    private String value;
}

package org.fedoraproject.javadeptools.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table
public class ManifestEntry {
    @Id
    @GeneratedValue(generator = "gen")
    @GenericGenerator(name = "gen", strategy = "increment")
    private Long id;

    @ManyToOne
    @JoinColumn(name = "fileArtifactId", nullable = false)
    private FileArtifact fileArtifact;

    public ManifestEntry() {
    }

    public ManifestEntry(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public Long getId() {
        return id;
    }

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

    public FileArtifact getFileArtifact() {
        return fileArtifact;
    }

    public void setFileArtifact(FileArtifact fileArtifact) {
        this.fileArtifact = fileArtifact;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    private String key;

    @Column(columnDefinition = "VARCHAR")
    private String value;
}

Use VARCHAR instead of LOB

Use VARCHAR instead of LOB


package arez.doc.examples.at_observe2;

import arez.Observer;
import arez.SafeProcedure;
import arez.annotations.Action;
import arez.annotations.ArezComponent;
import arez.annotations.CascadeDispose;
import arez.annotations.Observe;
import arez.annotations.ObserverRef;
import arez.annotations.OnDepsChange;
import elemental2.dom.DomGlobal;
import elemental2.dom.Element;
import javax.annotation.Nonnull;

@ArezComponent
public abstract class CurrencyView
{
  @CascadeDispose
  final Currency bitcoin = new Arez_Currency();

  @Observe
  void render()
  {
    final Element element = DomGlobal.document.getElementById( "currencyTracker" );
    element.innerHTML = "1 BTC = $" + bitcoin.getAmount() + "AUD";
  }

  @OnDepsChange
  void onRenderDepsChange()
  {
    debounce( this::scheduleRender, 2000 );
  }

  @ObserverRef
  abstract Observer getRenderObserver();

  @Action( verifyRequired = false )
  void scheduleRender()
  {
    // Actually schedule the re-render. Has to occur within
    // an action or inside a read-write transaction
    getRenderObserver().schedule();
  }

  private void debounce( @Nonnull final SafeProcedure action, final long timeInMillis )
  {
    // Execute this action at most one every timeInMillis
    //DOC ELIDE START
    //DOC ELIDE END
  }
}

package arez.doc.examples.at_observe2;

import arez.Observer;
import arez.SafeProcedure;
import arez.annotations.ArezComponent;
import arez.annotations.CascadeDispose;
import arez.annotations.Observe;
import elemental2.dom.DomGlobal;
import elemental2.dom.Element;
import javax.annotation.Nonnull;

@ArezComponent
public abstract class CurrencyView
{
  @CascadeDispose
  final Currency bitcoin = new Arez_Currency();

  @Observe
  void render()
  {
    final Element element = DomGlobal.document.getElementById( "currencyTracker" );
    element.innerHTML = "1 BTC = $" + bitcoin.getAmount() + "AUD";
  }

  void onRenderDepsChange( @Nonnull final Observer observer )
  {
    debounce( observer::schedule, 2000 );
  }

  private void debounce( @Nonnull final SafeProcedure action, final long timeInMillis )
  {
    // Execute this action at most one every timeInMillis
    //DOC ELIDE START
    //DOC ELIDE END
  }
}

Simplify code by passing an Observer

Simplify code by passing an Observer


package cas.ypsiliform.mediator.negotiation;

import java.util.ArrayList;

import cas.ypsiliform.mediator.async.Thenable;
import cas.ypsiliform.messages.AgentResponse;

public class AgentProxy {
	private ArrayList<AgentDeadListener> listeners = new ArrayList<AgentDeadListener>();

	public void addAgentDeadListener(AgentDeadListener listener) {
		listeners.add(listener);
	}

	public void removeAgentDeadListener(AgentDeadListener listener) {
		listeners.remove(listener);
	}

	public Thenable<AgentResponse> sendSolutionProposal(SolutionProposal solution) {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}

	public Thenable<Void> endNegotiation(SolutionProposal solution) {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}
}

package cas.ypsiliform.mediator.negotiation;

import java.util.ArrayList;

import cas.ypsiliform.mediator.async.Thenable;
import cas.ypsiliform.messages.AgentResponse;

public class AgentProxy {
	private ArrayList<AgentDeadListener> listeners = new ArrayList<AgentDeadListener>();

	public void addAgentDeadListener(AgentDeadListener listener) {
		listeners.add(listener);
	}

	public void removeAgentDeadListener(AgentDeadListener listener) {
		listeners.remove(listener);
	}

	public int getId() {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}

	public int getParentId() {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}

	public Iterable<Integer> getChildIds() {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}

	public Thenable<AgentResponse> sendSolutionProposal(SolutionProposal solution) {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}

	public Thenable<Void> endNegotiation(SolutionProposal solution) {
		// TODO implementation missing
		throw new UnsupportedOperationException();
	}
}

Add agent methods to get supply chain structure


package com.macasaet.fernet;

/**
 * This exception indicates that a Fernet token could not be created because one or more of the parameters was invalid.
 *
 *
Copyright © 2017 Carlos Macasaet.

 *
 * @author Carlos Macasaet
 */
public class IllegalTokenException extends IllegalArgumentException {

    private static final long serialVersionUID = 8019898267609912205L;

    public IllegalTokenException(final String message) {
        super(message);
    }

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

}

package com.macasaet.fernet;

/**
 * This exception indicates that a Fernet token could not be created because one or more of the parameters was invalid.
 *
 *
Copyright © 2017 Carlos Macasaet.

 *
 * @author Carlos Macasaet
 */
public class IllegalTokenException extends IllegalArgumentException {

    private static final long serialVersionUID = -1794971941479648725L;

    public IllegalTokenException(final String message) {
        super(message);
    }

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

}

Update serialVersionUID for updated public API


package de.flux.playground.deckcompare.importer;

public class ImportException extends RuntimeException {

    public ImportException(String string, Throwable cause) {
        super(string, cause);
    }

    private static final long serialVersionUID = 1734612217426583223L;

}

package de.flux.playground.deckcompare.importer;

public class ImportException extends RuntimeException {

    private static final long serialVersionUID = 1734612217426583223L;

    public ImportException(String string, Throwable cause) {
        super(string, cause);
    }

}

Put field to top of class

Put field to top of class


package me.hfox.morphix.query;

import java.util.Iterator;
import java.util.List;

/**
 * Created by Harry on 28/11/2017.
 *
 * An iterable set of results returned by a query object
 */
public interface QueryResult<T> extends Iterator<T> {

    /**
     * Alias of
     * @see me.hfox.morphix.query.QueryResult#first();
     * @return The first result returned by the query
     */
    T get();

    /**
     * Get the first result from the query
     * @return The first result returned by the query
     */
    T first();

    /**
     * Get the last result from the query
     * @return The last result returned by the query
     */
    T last();

    /**
     * Get the results given by the query as a List
     * @return An unmodifiable list of results
     */
    List<T> asList();

}

package me.hfox.morphix.query;

import java.util.Iterator;
import java.util.List;

/**
 * Created by Harry on 28/11/2017.
 *
 * An iterable set of results returned by a query object
 */
public interface QueryResult<T> extends Iterator<T> {

    /**
     * Alias of
     * @see me.hfox.morphix.query.QueryResult#first();
     * @return The first result returned by the query
     */
    T one();

    /**
     * Get the first result from the query
     * @return The first result returned by the query
     */
    T first();

    /**
     * Get the last result from the query
     * @return The last result returned by the query
     */
    T last();

    /**
     * Get the results given by the query as a List
     * @return An unmodifiable list of results
     */
    List<T> all();

}

Rename get -> one and asList -> all

Rename get -> one and asList -> all


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

import static org.assertj.core.api.Java6Assertions.assertThat;

import org.junit.Test;

public class NativeTest {

  /** Verifies that {@link Native#getCPU()} returns non-empty cpu architecture */
  @Test
  public void should_return_cpu_if_call_is_available() {
    if (Native.isPlatformAvailable()) {
      assertThat(Native.getCPU()).isNotEmpty();
    }
  }
}

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

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

public class NativeTest {

  /** Verifies that {@link Native#getCPU()} returns non-empty cpu architecture */
  @Test
  public void should_return_cpu_if_call_is_available() {
    if (Native.isPlatformAvailable()) {
      assertThat(Native.getCPU()).isNotEmpty();
    }
  }
}

Remove references to deprecated Java6Assertions class


package org.apache.pig.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.pig.ExecType;
import org.apache.pig.backend.hadoop.executionengine.spark.SparkExecType;

public class SparkMiniCluster extends MiniGenericCluster {
    private static final File CONF_DIR = new File("build/classes");
    private static final File CONF_FILE = new File(CONF_DIR, "hadoop-site.xml");
    private ExecType spark = new SparkExecType();
    SparkMiniCluster() {

    }

    @Override
    public ExecType getExecType() {
        return spark;
    }

    @Override
    protected void setupMiniDfsAndMrClusters() {
        try {
            CONF_DIR.mkdirs();
            if (CONF_FILE.exists()) {
                CONF_FILE.delete();
            }
            m_conf = new Configuration();
            m_conf.set("io.sort.mb", "1");
            m_conf.writeXml(new FileOutputStream(CONF_FILE));
            int dataNodes = 4;
            m_dfs = new MiniDFSCluster(m_conf, dataNodes, true, null);
            m_fileSys = m_dfs.getFileSystem();
        } catch (IOException e) {
            throw new RuntimeException(e);

        }

    }

    @Override
    protected void shutdownMiniMrClusters() {
        if (CONF_FILE.exists()) {
            CONF_FILE.delete();
        }
    }

}

package org.apache.pig.test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.pig.ExecType;
import org.apache.pig.backend.hadoop.executionengine.spark.SparkExecType;

public class SparkMiniCluster extends MiniGenericCluster {
    private static final File CONF_DIR = new File("build/classes");
    private static final File CONF_FILE = new File(CONF_DIR, "hadoop-site.xml");
    private ExecType spark = new SparkExecType();
    SparkMiniCluster() {

    }

    @Override
    public ExecType getExecType() {
        return spark;
    }

    @Override
    protected void setupMiniDfsAndMrClusters() {
        try {
            CONF_DIR.mkdirs();
            if (CONF_FILE.exists()) {
                CONF_FILE.delete();
            }
            m_conf = new Configuration();
            m_conf.set("io.sort.mb", "1");
            m_conf.writeXml(new FileOutputStream(CONF_FILE));
            int dataNodes = 4;
            m_dfs = new MiniDFSCluster(m_conf, dataNodes, true, null);
            m_fileSys = m_dfs.getFileSystem();
            m_fileSys.mkdirs(m_fileSys.getWorkingDirectory());
        } catch (IOException e) {
            throw new RuntimeException(e);

        }

    }

    @Override
    protected void shutdownMiniMrClusters() {
        if (CONF_FILE.exists()) {
            CONF_FILE.delete();
        }
    }

}

PIG-4268: Enable unit test "TestStreamingUDF" in spark (liyunzhang via praveen)

git-svn-id: d317905e1b1233abb7022f5914f79c3119e04b87@1645891 13f79535-47bb-0310-9956-ffa450edef68


import codeu.chat.ServerMain;
import codeu.chat.common.User;
import models.DBUtility;
import models.Models;
import play.GlobalSettings;
import play.Application;

import java.sql.DriverManager;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Play's Global class, which runs custom code when the application starts / ends.
 */
public class Global extends GlobalSettings {

  /**
   * Setting up the application when it starts by adding default user and chatrooms to the database.
   * @param app this application.
   */
  public void onStart(Application app) {

    // run "sh run_server.sh" in background
    ExecutorService service = Executors.newFixedThreadPool(4);
    service.submit(new Runnable() {
      public void run() {
        ServerMain.runServer();
      }
    });

    // connect to the database
    try {
      String url = "jdbc:sqlite:chatapp.db";
      String driver = "org.sqlite.JDBC";
      Class.forName(driver);

      // set up initial database if it's empty
      boolean adminExists = DBUtility.checkDuplicateField(DriverManager.getConnection(url), "users", "name", "admin");
      if (!adminExists) {
        // create a default admin account
        User admin = Models.newUser("admin");
        DBUtility.addUser(DriverManager.getConnection(url), "admin", "123456", admin.id.toString());
      }

      // create a default public room
      DBUtility.addConversation(DriverManager.getConnection(url), "public", "admin");

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

import codeu.chat.ServerMain;
import codeu.chat.common.User;
import models.DBUtility;
import models.Models;
import play.GlobalSettings;
import play.Application;

import java.sql.DriverManager;

/**
 * Play's Global class, which runs custom code when the application starts / ends.
 */
public class Global extends GlobalSettings {

  /**
   * Setting up the application when it starts by adding default user and chatrooms to the database.
   * @param app this application.
   */
  public void onStart(Application app) {

    // connect to the database
    try {
      String url = "jdbc:sqlite:chatapp.db";
      String driver = "org.sqlite.JDBC";
      Class.forName(driver);

      // set up initial database if it's empty
      boolean adminExists = DBUtility.checkDuplicateField(DriverManager.getConnection(url), "users", "name", "admin");
      if (!adminExists) {
        // create a default admin account
        User admin = Models.newUser("admin");
        DBUtility.addUser(DriverManager.getConnection(url), "admin", "123456", admin.id.toString());
      }

      // create a default public room
      DBUtility.addConversation(DriverManager.getConnection(url), "public", "admin");
      DBUtility.makeRoomPublic(DriverManager.getConnection(url), "public");

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

Remove code to run server (it should be run on a separate terminal tab).


package org.conjugates.analyzer.endpoints.info;

import org.conjugates.analyzer.services.properties.AnalyzerProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/v1/info")
@RestController
public class InfoController {

  private final AnalyzerProperties properties;

  @Autowired
  public InfoController(AnalyzerProperties properties) {
    this.properties = properties;
  }

  @RequestMapping("/")
  public String name() {
    return properties.getName();
  }

}

package org.conjugates.analyzer.endpoints.info;

import org.conjugates.analyzer.services.properties.AnalyzerProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/v1/info")
@RestController
public class InfoController {

  private static final Logger LOG = LoggerFactory.getLogger(InfoController.class);

  private final AnalyzerProperties properties;

  @Autowired
  public InfoController(AnalyzerProperties properties) {
    this.properties = properties;
  }

  @RequestMapping("/")
  public String name() {
    LOG.debug("Call to info made");
    return properties.getName();
  }

}

Validate logging works through slf4j

Validate logging works through slf4j


package com.google.samples.button;

import android.os.Build;

@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
    private static final String DEVICE_EDISON = "edison";
    private static final String DEVICE_RPI3 = "rpi3";
    private static final String DEVICE_NXP = "nxp";

    /**
     * Return the GPIO pin that the LED is connected on.
     * For example, on Intel Edison Arduino breakout, pin "IO13" is connected to an onboard LED
     * that turns on when the GPIO pin is HIGH, and off when low.
     */
    public static String getGPIOForLED() {
        // TODO: confirm DEVICE and preferred port for RPI3 and NXP
        switch (Build.DEVICE) {
            case DEVICE_EDISON:
                return "IO13";
            case DEVICE_RPI3:
                return "BCM25";
            case DEVICE_NXP:
                return "??";
            default:
                throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
        }
    }

    /**
     * Return the GPIO pin that the Button is connected on.
     */
    public static String getGPIOForButton() {
        // TODO: confirm DEVICE and preferred port for RPI3 and NXP
        switch (Build.DEVICE) {
            case DEVICE_EDISON:
                return "IO12";
            case DEVICE_RPI3:
                return "BCM22";
            case DEVICE_NXP:
                return "??";
            default:
                throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
        }
    }
}

package com.google.samples.button;

import android.os.Build;

@SuppressWarnings("WeakerAccess")
public class BoardDefaults {
    private static final String DEVICE_EDISON = "edison";
    private static final String DEVICE_RPI3 = "rpi3";
    private static final String DEVICE_NXP = "imx6ul";

    /**
     * Return the GPIO pin that the LED is connected on.
     * For example, on Intel Edison Arduino breakout, pin "IO13" is connected to an onboard LED
     * that turns on when the GPIO pin is HIGH, and off when low.
     */
    public static String getGPIOForLED() {
        // TODO: confirm DEVICE and preferred port for RPI3 and NXP
        switch (Build.DEVICE) {
            case DEVICE_EDISON:
                return "IO13";
            case DEVICE_RPI3:
                return "BCM25";
            case DEVICE_NXP:
                return "??";
            default:
                throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
        }
    }

    /**
     * Return the GPIO pin that the Button is connected on.
     */
    public static String getGPIOForButton() {
        // TODO: confirm DEVICE and preferred port for RPI3 and NXP
        switch (Build.DEVICE) {
            case DEVICE_EDISON:
                return "IO12";
            case DEVICE_RPI3:
                return "BCM22";
            case DEVICE_NXP:
                return "??";
            default:
                throw new IllegalStateException("Unknown Build.DEVICE " + Build.DEVICE);
        }
    }
}

Fix references of nxp to imx6ul

Fix references of nxp to imx6ul

Bug: 32830902
Change-Id: Ib24db99577b2b11de3500c1e63840563c2321c05


/*
 * Copyright 2020, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.code.gen.java;

import com.squareup.javapoet.TypeSpec;
import io.spine.code.java.PackageName;

import javax.lang.model.element.Modifier;

/**
 * A JavaPoet-based spec of a generated type.
 */
public interface GeneratedTypeSpec {

    /**
     * The package under which the type will be generated.
     */
    PackageName packageName();

    /**
     * A JavaPoet spec of the type.
     */
    // TODO:2019-12-20:dmytro.kuzmin:WIP: Consolidate singular/plural name usage after varargs.
    TypeSpec typeSpec(Modifier... modifiers);
}

/*
 * Copyright 2020, TeamDev. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package io.spine.code.gen.java;

import com.squareup.javapoet.TypeSpec;
import io.spine.code.java.PackageName;

import javax.lang.model.element.Modifier;

/**
 * A JavaPoet-based spec of a generated type.
 */
public interface GeneratedTypeSpec {

    /**
     * The package under which the type will be generated.
     */
    PackageName packageName();

    /**
     * A JavaPoet spec of the type.
     */
    TypeSpec typeSpec(Modifier... modifiers);
}

Remove a todo which is already resolved

Remove a todo which is already resolved


package konstructs.api.messages;

/**
 * GlobalConfig is a message that informs the plugin of the current values of
 * the global server config. These values are used by the server to manage
 * overall behaviour of plugins and is informal.
 */
public class GlobalConfig {
    public final float DEFAULT_SIMULATION_SPEED = 1.0f;

    private final float simulationSpeed;

    /**
     * Construct an immutable GlobalConfig message
     * @param simulationSpeed The speed multiplier currently in use. 1.0 is normal speed.
     */
    public GlobalConfig(float simulationSpeed) {
        this.simulationSpeed = simulationSpeed;
    }

    /**
     * Get the simulation speed multiplier currently in use. 1.0 is normal speed.
     * @return The simulation speed multiplier
     */
    public float getSimulationSpeed() {
        return simulationSpeed;
    }

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

        GlobalConfig that = (GlobalConfig) o;

        return Float.compare(that.simulationSpeed, simulationSpeed) == 0;

    }

    @Override
    public int hashCode() {
        return (simulationSpeed != +0.0f ? Float.floatToIntBits(simulationSpeed) : 0);
    }

    @Override
    public String toString() {
        return "GlobalConfig(" +
                "simulationSpeed=" + simulationSpeed +
                ')';
    }
}

package konstructs.api.messages;

/**
 * GlobalConfig is a message that informs the plugin of the current values of
 * the global server config. These values are used by the server to manage
 * overall behaviour of plugins and is informal.
 */
public class GlobalConfig {
    public final static float DEFAULT_SIMULATION_SPEED = 1.0f;

    private final float simulationSpeed;

    /**
     * Construct an immutable GlobalConfig message
     * @param simulationSpeed The speed multiplier currently in use. 1.0 is normal speed.
     */
    public GlobalConfig(float simulationSpeed) {
        this.simulationSpeed = simulationSpeed;
    }

    /**
     * Get the simulation speed multiplier currently in use. 1.0 is normal speed.
     * @return The simulation speed multiplier
     */
    public float getSimulationSpeed() {
        return simulationSpeed;
    }

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

        GlobalConfig that = (GlobalConfig) o;

        return Float.compare(that.simulationSpeed, simulationSpeed) == 0;

    }

    @Override
    public int hashCode() {
        return (simulationSpeed != +0.0f ? Float.floatToIntBits(simulationSpeed) : 0);
    }

    @Override
    public String toString() {
        return "GlobalConfig(" +
                "simulationSpeed=" + simulationSpeed +
                ')';
    }
}

Fix constant to be static

Fix constant to be static


package roycurtis.signshopexport.json;

import org.bukkit.inventory.ItemStack;

/** Represents a JSON record for Gson serialization */
public class Record
{
    // Location
    public String locWorld;
    public int    locX;
    public int    locY;
    public int    locZ;

    // Owner
    public String ownerName;
    public String ownerUuid;

    // Sign data
    public String[] signText;
    public String   signType;
    public double   signPrice;

    // Inventory data
    public ItemStack[] invItems;
    public boolean     invInStock;
}

package roycurtis.signshopexport.json;

import org.bukkit.inventory.ItemStack;

/** Represents a JSON record for Gson serialization */
public class Record
{
    // Location
    public String locWorld;
    public int    locX;
    public int    locY;
    public int    locZ;

    // Owner
    public String ownerName;
    public String ownerUuid;

    // Sign data
    public String[] signText;
    public String   signType;
    public double   signPrice;

    // Inventory data
    public ItemStack[] invItems;
    public boolean     invInStock;

    @Override
    public String toString()
    {
        return String.format(
            "Record: %s sign at %d,%d,%d @ %s by %s (%s)",
            signType,
            locX, locY, locZ, locWorld,
            ownerName, ownerUuid
        );
    }
}

Add toString override for records

Add toString override for records


package spark.staticfiles;

import static spark.utils.StringUtils.removeLeadingAndTrailingSlashesFrom;

/**
 * Protecting against Directory traversal
 */
public class DirectoryTraversal {

    public static void protectAgainstInClassPath(String path) {
        if (!removeLeadingAndTrailingSlashesFrom(path).startsWith(StaticFilesFolder.local())) {
            throw new DirectoryTraversalDetection("classpath");
        }
    }

    public static void protectAgainstForExternal(String path) {
        if (!removeLeadingAndTrailingSlashesFrom(path).startsWith(StaticFilesFolder.external())) {
            throw new DirectoryTraversalDetection("external");
        }
    }

    public static final class DirectoryTraversalDetection extends RuntimeException {

        public DirectoryTraversalDetection(String msg) {
            super(msg);
        }

    }

}

package spark.staticfiles;

import static spark.utils.StringUtils.removeLeadingAndTrailingSlashesFrom;
import java.nio.file.Paths;

/**
 * Protecting against Directory traversal
 */
public class DirectoryTraversal {

    public static void protectAgainstInClassPath(String path) {
        if (!removeLeadingAndTrailingSlashesFrom(path).startsWith(StaticFilesFolder.local())) {
            throw new DirectoryTraversalDetection("classpath");
        }
    }

    public static void protectAgainstForExternal(String path) {
        String nixLikePath = Paths.get(path).toAbsolutePath().toString().replace("\\", "/");
        if (!removeLeadingAndTrailingSlashesFrom(nixLikePath).startsWith(StaticFilesFolder.external())) {
            throw new DirectoryTraversalDetection("external");
        }
    }

    public static final class DirectoryTraversalDetection extends RuntimeException {

        public DirectoryTraversalDetection(String msg) {
            super(msg);
        }

    }

}

Add Windows to *nix path conversion

Add Windows to *nix path conversion

Make external traversal detection comply with external static folder as *nix path


package com.ezardlabs.lostsector.missions;

import com.ezardlabs.lostsector.objects.enemies.Enemy;

public abstract class Mission {
	protected int enemiesKilled = 0;
	private long missionStart = 0;
	private EnemyStatusListener enemyStatusListener;

	public void startMission() {
		missionStart = System.currentTimeMillis();
	}

	public long getMissionTime() {
		return System.currentTimeMillis() - missionStart;
	}

	public abstract void load();

	public final void notifyEnemySpawn(Enemy enemy) {
		if (enemyStatusListener != null) {
			enemyStatusListener.onEnemySpawned(enemy);
		}
	}

	public final void notifyEnemyDeath(Enemy enemy) {
		enemiesKilled++;
		if (enemyStatusListener != null) {
			enemyStatusListener.onEnemyKilled(enemy);
		}
	}

	void setEnemyStatusListener(EnemyStatusListener enemyStatusListener) {
		this.enemyStatusListener = enemyStatusListener;
	}

	protected interface EnemyStatusListener {
		void onEnemySpawned(Enemy enemy);

		void onEnemyKilled(Enemy enemy);
	}
}

package com.ezardlabs.lostsector.missions;

import com.ezardlabs.lostsector.objects.enemies.Enemy;

public abstract class Mission {
	protected int enemiesKilled = 0;
	private long missionStart = 0;
	private boolean completed = false;
	private EnemyStatusListener enemyStatusListener;
	private MissionStatusListener missionStatusListener;

	public void startMission() {
		missionStart = System.currentTimeMillis();
	}

	public long getMissionTime() {
		return System.currentTimeMillis() - missionStart;
	}

	public abstract void load();

	protected final void completedMission() {
		completed = true;
		if (missionStatusListener != null) {
			missionStatusListener.onMissionCompleted();
		}
	}

	public final void notifyEnemySpawn(Enemy enemy) {
		if (enemyStatusListener != null) {
			enemyStatusListener.onEnemySpawned(enemy);
		}
	}

	public final void notifyEnemyDeath(Enemy enemy) {
		enemiesKilled++;
		if (enemyStatusListener != null) {
			enemyStatusListener.onEnemyKilled(enemy);
		}
	}

	void setEnemyStatusListener(EnemyStatusListener enemyStatusListener) {
		this.enemyStatusListener = enemyStatusListener;
	}

	void setMissionStatusListener(MissionStatusListener listener) {
		this.missionStatusListener = listener;
	}

	protected interface EnemyStatusListener {
		void onEnemySpawned(Enemy enemy);

		void onEnemyKilled(Enemy enemy);
	}

	protected interface MissionStatusListener {
		void onMissionCompleted();
	}
}

Add listener for mission status

Add listener for mission status


package com.sleekbyte.tailor.utils;

/**
 * TODO!!!
 */
public class CharFormatUtil {

    private static final String ALPHANUMERIC_REGEX = "^[a-zA-Z0-9]*$";

    public static boolean isUpperCamelCase(String word) {
        return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isUpperCase(word.charAt(0));
    }

    public static boolean isLowerCamelCase(String word) {
        return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isLowerCase(word.charAt(0));
    }

}

package com.sleekbyte.tailor.utils;

/**
 * Util class for character formatting
 */
public class CharFormatUtil {

    private static final String ALPHANUMERIC_REGEX = "^[a-zA-Z0-9]*$";

    public static boolean isUpperCamelCase(String word) {
        return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isUpperCase(word.charAt(0));
    }

    public static boolean isLowerCamelCase(String word) {
        return !word.isEmpty() && word.matches(ALPHANUMERIC_REGEX) && Character.isLowerCase(word.charAt(0));
    }

}

Add Javadoc for one more class

Add Javadoc for one more class