/*
 * (C) Copyright IBM Corporation 2016
 *
 * 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.ibm.ws.microprofile.sample.conference.vote.api;

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

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/")
public class VoteApplication extends Application {

	@Override
    public Set<Class<?>> getClasses() {
        Set<Class<?>> classes = new HashSet<Class<?>>();

        classes.add(AttendeeProvider.class);
        classes.add(AttendeeListProvider.class);
        classes.add(SessionRatingProvider.class);
        classes.add(SessionRatingListProvider.class);
        return classes;
    }

	@Override
	public Set<Object> getSingletons() {
		Set<Object> singletons = new HashSet<Object>();
		singletons.add(new SessionVote());
		return singletons;
	}
}

/*
 * (C) Copyright IBM Corporation 2016
 *
 * 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.ibm.ws.microprofile.sample.conference.vote.api;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;

@ApplicationPath("/")
public class VoteApplication extends Application {

}

Remove custom getClasses and getSingletons methods

Signed-off-by: pavittr <d0bf7a2cad222deb9ae2c588e240de3d87c6e782@uk.ibm.com>


package org.innovateuk.ifs.application.creation.form;

import org.innovateuk.ifs.controller.BaseBindingResultTarget;
import javax.validation.constraints.NotNull;

public class ApplicationCreationAuthenticatedForm extends BaseBindingResultTarget {

    @NotNull(message = "{validation.field.confirm.new.application}")
    private Boolean createNewApplication;

    public Boolean getCreateNewApplication() {
        return createNewApplication;
    }

    public void setCreateNewApplication(Boolean createNewApplication) {
        this.createNewApplication = createNewApplication;
    }
}

package org.innovateuk.ifs.application.creation.form;

import org.innovateuk.ifs.controller.BaseBindingResultTarget;
import javax.validation.constraints.NotNull;

/**
 * Form field model for the screen asking whether the user wishes to continue with an existing application.
 */

public class ApplicationCreationAuthenticatedForm extends BaseBindingResultTarget {

    @NotNull(message = "{validation.field.confirm.new.application}")
    private Boolean createNewApplication;

    public Boolean getCreateNewApplication() {
        return createNewApplication;
    }

    public void setCreateNewApplication(Boolean createNewApplication) {
        this.createNewApplication = createNewApplication;
    }
}

Comment added on form file.

IFS-1963: Comment added on form file.


package com.ezardlabs.dethsquare;

import java.util.HashMap;

public class LevelManager {
	private static HashMap<String, Level> levels = new HashMap<>();

	public static void registerLevel(String name, Level level) {
		levels.put(name, level);
	}

	public static void loadLevel(String name) {
		Level level = levels.get(name);
		level.onLoad();

		GameObject.startAll();
		Renderer.init();
		Collider.init();
	}
}

package com.ezardlabs.dethsquare;

import java.util.HashMap;

public class LevelManager {
	private static HashMap<String, Level> levels = new HashMap<>();
	private static String currentLevelName;

	public static void registerLevel(String name, Level level) {
		levels.put(name, level);
	}

	public static void loadLevel(String name) {
		currentLevelName = name;

		Level level = levels.get(name);
		level.onLoad();

		GameObject.startAll();
		Renderer.init();
		Collider.init();
	}

	public static Level getCurrentLevel() {
		if (currentLevelName == null) return null;
		else return levels.get(currentLevelName);
	}

	public static String getCurrentLevelName() {
		return currentLevelName;
	}
}

Add ability to get the current level and current level's name


package com.firebase.ui.auth.provider;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.LayoutRes;

import com.firebase.ui.auth.R;
import com.firebase.ui.auth.ResultCodes;
import com.firebase.ui.auth.ui.BaseHelper;
import com.firebase.ui.auth.ui.email.RegisterEmailActivity;
import com.google.firebase.auth.EmailAuthProvider;

public class EmailProvider implements Provider {
    private static final int RC_EMAIL_FLOW = 2;

    private Activity mActivity;
    private BaseHelper mHelper;

    public EmailProvider(Activity activity, BaseHelper helper) {
        mActivity = activity;
        mHelper = helper;
    }

    @Override
    public String getName(Context context) {
        return context.getString(R.string.provider_name_email);
    }

    @Override
    public String getProviderId() {
        return EmailAuthProvider.PROVIDER_ID;
    }

    @Override
    @LayoutRes
    public int getButtonLayout() {
        return R.layout.provider_button_email;
    }

    @Override
    public void startLogin(Activity activity) {
        activity.startActivityForResult(
                RegisterEmailActivity.createIntent(activity, mHelper.getFlowParams()),
                RC_EMAIL_FLOW);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == ResultCodes.OK) {
            mHelper.finishActivity(mActivity, ResultCodes.OK, data);
        }
    }
}

package com.firebase.ui.auth.provider;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.LayoutRes;

import com.firebase.ui.auth.R;
import com.firebase.ui.auth.ResultCodes;
import com.firebase.ui.auth.ui.BaseHelper;
import com.firebase.ui.auth.ui.email.RegisterEmailActivity;
import com.google.firebase.auth.EmailAuthProvider;

public class EmailProvider implements Provider {
    private static final int RC_EMAIL_FLOW = 2;

    private Activity mActivity;
    private BaseHelper mHelper;

    public EmailProvider(Activity activity, BaseHelper helper) {
        mActivity = activity;
        mHelper = helper;
    }

    @Override
    public String getName(Context context) {
        return context.getString(R.string.provider_name_email);
    }

    @Override
    public String getProviderId() {
        return EmailAuthProvider.PROVIDER_ID;
    }

    @Override
    @LayoutRes
    public int getButtonLayout() {
        return R.layout.provider_button_email;
    }

    @Override
    public void startLogin(Activity activity) {
        activity.startActivityForResult(
                RegisterEmailActivity.createIntent(activity, mHelper.getFlowParams()),
                RC_EMAIL_FLOW);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == RC_EMAIL_FLOW && resultCode == ResultCodes.OK) {
            mHelper.finishActivity(mActivity, ResultCodes.OK, data);
        }
    }
}

Fix NPE when saving smart lock

Fix NPE when saving smart lock


package com.cloudycrew.cloudycar;

import android.app.Fragment;

/**
 * Created by George on 2016-11-05.
 */

public class BaseFragment extends Fragment {
    public CloudyCarApplication getCloudyCarApplication() {
        return (CloudyCarApplication) getActivity().getApplication();
    }
}

package com.cloudycrew.cloudycar;

import android.support.v4.app.Fragment;

/**
 * Created by George on 2016-11-05.
 */

public class BaseFragment extends Fragment {
    public CloudyCarApplication getCloudyCarApplication() {
        return (CloudyCarApplication) getActivity().getApplication();
    }
}

Use support fragment for base fragment

Use support fragment for base fragment


package org.mtransit.android.commons;

import org.mtransit.android.commons.api.SupportFactory;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.TypedValue;

public final class ThemeUtils {

	public static int resolveColorAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return SupportFactory.get().getColor(context.getResources(), tv.resourceId, null);
	}

	public static float resolveDimensionAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return context.getResources().getDimension(tv.resourceId);
	}

	public static Drawable resolveDrawableAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return SupportFactory.get().getResourcesDrawable(context.getResources(), tv.resourceId, null);
	}

	private static TypedValue resolveAttribute(Context context, int attrId) {
		TypedValue tv = new TypedValue();
		context.getTheme().resolveAttribute(attrId, tv, true);
		return tv;
	}

	public static Drawable obtainStyledDrawable(Context themedContext, int attrId) {
		int[] attrs = new int[] { attrId };
		TypedArray ta = themedContext.obtainStyledAttributes(attrs);
		Drawable drawableFromTheme = ta.getDrawable(0);
		ta.recycle();
		return drawableFromTheme;
	}
}

package org.mtransit.android.commons;

import org.mtransit.android.commons.api.SupportFactory;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.util.TypedValue;

public final class ThemeUtils {

	public static int resolveColorAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return SupportFactory.get().getColor(context.getResources(), tv.resourceId, context.getTheme());
	}

	public static float resolveDimensionAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return context.getResources().getDimension(tv.resourceId);
	}

	public static Drawable resolveDrawableAttribute(Context context, int attrId) {
		TypedValue tv = resolveAttribute(context, attrId);
		return SupportFactory.get().getResourcesDrawable(context.getResources(), tv.resourceId, context.getTheme());
	}

	private static TypedValue resolveAttribute(Context context, int attrId) {
		TypedValue tv = new TypedValue();
		context.getTheme().resolveAttribute(attrId, tv, true);
		return tv;
	}

	public static Drawable obtainStyledDrawable(Context themedContext, int attrId) {
		int[] attrs = new int[] { attrId };
		TypedArray ta = themedContext.obtainStyledAttributes(attrs);
		Drawable drawableFromTheme = ta.getDrawable(0);
		ta.recycle();
		return drawableFromTheme;
	}
}

Fix theme colors & drawable on Android 8 Oreo


package com.faforever.client.api.dto;

public enum Validity {
  // Order is crucial
  VALID,
  TOO_MANY_DESYNCS,
  WRONG_VICTORY_CONDITION,
  NO_FOG_OF_WAR,
  CHEATS_ENABLED,
  PREBUILT_ENABLED,
  NORUSH_ENABLED,
  BAD_UNIT_RESTRICTIONS,
  BAD_MAP,
  TOO_SHORT,
  BAD_MOD,
  COOP_NOT_RANKED,
  MUTUAL_DRAW,
  SINGLE_PLAYER,
  FFA_NOT_RANKED,
  UNEVEN_TEAMS_NOT_RANKED,
  UNKNOWN_RESULT,
  TEAMS_UNLOCKED,
  MULTIPLE_TEAMS,
  HAS_AI
}

package com.faforever.client.api.dto;

public enum Validity {
  // Order is crucial
  VALID,
  TOO_MANY_DESYNCS,
  WRONG_VICTORY_CONDITION,
  NO_FOG_OF_WAR,
  CHEATS_ENABLED,
  PREBUILT_ENABLED,
  NORUSH_ENABLED,
  BAD_UNIT_RESTRICTIONS,
  BAD_MAP,
  TOO_SHORT,
  BAD_MOD,
  COOP_NOT_RANKED,
  MUTUAL_DRAW,
  SINGLE_PLAYER,
  FFA_NOT_RANKED,
  UNEVEN_TEAMS_NOT_RANKED,
  UNKNOWN_RESULT,
  TEAMS_UNLOCKED,
  MULTIPLE_TEAMS,
  HAS_AI,
  CIVILIANS_REVEALED,
  WRONG_DIFFICULTY,
  EXPANSION_DISABLED,
  SPAWN_NOT_FIXED
}

Add more validity states required for some coop leaderboard checks

https://github.com/FAForever/db/pull/187


package org.traccar.protocol;

import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.traccar.model.Command;

public class Gps103ProtocolEncoderTest {

    @Test
    public void testDecode() throws Exception {

        Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();

        Command command = new Command();
        command.setDeviceId(1);
        command.setType(Command.TYPE_POSITION_FIX);

        Map<String, Object> other = new HashMap<>();
        other.put(Command.KEY_FREQUENCY, 300l);

        command.setOther(other);

        Assert.assertEquals("**,123456789012345,C,05m;", encoder.encodeCommand(command));

    }

}

package org.traccar.protocol;

import java.util.HashMap;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.traccar.model.Command;

public class Gps103ProtocolEncoderTest {

    @Test
    public void testDecode() throws Exception {

        Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();

        Command command = new Command();
        command.setDeviceId(1);
        command.setType(Command.TYPE_POSITION_FIX);

        Map<String, Object> other = new HashMap<>();
        other.put(Command.KEY_FREQUENCY, 300l);

        command.setOther(other);

        Assert.assertEquals("**,imei:123456789012345,C,05m;", encoder.encodeCommand(command));

    }

}

Fix GPS103 command unit test

Fix GPS103 command unit test


package org.parboiled.examples.indenting;

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

public class IndentNode {

	private final String name;
	private final List<IndentNode> children = new ArrayList<>();

	public IndentNode(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public boolean addChild(IndentNode child) {
		children.add(child);
		return true;
	}

	List<IndentNode> getChildren() {
		return children;
	}

	@Override
	public String toString() {
		return "IndentNode [name=" + name + ", children=" + children + "]";
	}
}

package org.parboiled.examples.indenting;

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

public class IndentNode {

	private final String name;
	private final List<IndentNode> children = new ArrayList<IndentNode>();

	public IndentNode(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public boolean addChild(IndentNode child) {
		children.add(child);
		return true;
	}

	List<IndentNode> getChildren() {
		return children;
	}

	@Override
	public String toString() {
		return "IndentNode [name=" + name + ", children=" + children + "]";
	}
}

Fix compiler error in example

Fix compiler error in example


package com.haxademic.core.image.filters.shaders;

import processing.core.PApplet;

public class ChromaColorFilter
extends BaseFilter {

	public static ChromaColorFilter instance;

	public ChromaColorFilter(PApplet p) {
		super(p, "shaders/filters/chroma-color.glsl");
		setThresholdSensitivity(0.1f);
		setSmoothing(0.7f);
		setColorToReplace(0, 0, 0);
	}

	public static ChromaColorFilter instance(PApplet p) {
		if(instance != null) return instance;
		instance = new ChromaColorFilter(p);
		return instance;
	}

	public void setThresholdSensitivity(float thresholdSensitivity) {
		shader.set("thresholdSensitivity", thresholdSensitivity);
	}

	public void setSmoothing(float smoothing) {
		shader.set("smoothing", smoothing);
	}

	public void setColorToReplace(float colorToReplaceR, float colorToReplaceG, float colorToReplaceB) {
		shader.set("colorToReplace", colorToReplaceR, colorToReplaceG, colorToReplaceB);
	}

}

package com.haxademic.core.image.filters.shaders;

import processing.core.PApplet;

public class ChromaColorFilter
extends BaseFilter {

	public static ChromaColorFilter instance;

	public ChromaColorFilter(PApplet p) {
		super(p, "shaders/filters/chroma-color.glsl");
		setThresholdSensitivity(0.1f);
		setSmoothing(0.7f);
		setColorToReplace(0, 0, 0);
	}

	public static ChromaColorFilter instance(PApplet p) {
		if(instance != null) return instance;
		instance = new ChromaColorFilter(p);
		return instance;
	}

	public void setThresholdSensitivity(float thresholdSensitivity) {
		shader.set("thresholdSensitivity", thresholdSensitivity);
	}

	public void setSmoothing(float smoothing) {
		shader.set("smoothing", smoothing);
	}

	public void setColorToReplace(float colorToReplaceR, float colorToReplaceG, float colorToReplaceB) {
		shader.set("colorToReplace", colorToReplaceR, colorToReplaceG, colorToReplaceB);
	}

	public void presetGreenScreen() {
		setThresholdSensitivity(0.73f);
		setSmoothing(0.08f);
		setColorToReplace(0.71f, 0.99f, 0.02f);
	}

	public void presetBlackKnockout() {
		setThresholdSensitivity(0.2f);
		setSmoothing(0.1f);
		setColorToReplace(0.0f, 0.0f, 0.0f);
	}
}

Add a couple of chrome presets

Add a couple of chrome presets


package test.java;

/**
 * Created by ben on 7/3/17.
 */
public class TestC1X {
}

package test.java;

import com.xrtb.common.HttpPostGet;
import com.xrtb.pojo.BidRequest;
import com.xrtb.pojo.WinObject;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertTrue;

/**
 * Created by ben on 7/3/17.
 */
public class TestC1X {

    String price = null;
    String adId = null;
    String creativeId = null;

    @BeforeClass
    public static void setup() {
        try {
            Config.setup();
            System.out.println("******************  TestCampaignProcessor");
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    @AfterClass
    public static void stop() {
        Config.teardown();
    }

    @Test
    public void testPiggyBackedWins() throws Exception {

        HttpPostGet http = new HttpPostGet();
        final CountDownLatch latch = new CountDownLatch(1);
        com.xrtb.jmq.RTopic channel = new com.xrtb.jmq.RTopic("tcp://*:5572&wins");
        channel.subscribe("wins");

        channel.addListener(new com.xrtb.jmq.MessageListener<WinObject>() {
            @Override
            public void onMessage(String channel, WinObject win) {
                price = win.price;
                adId = win.adId;
                creativeId = win.cridId;
                latch.countDown();
            }
        });

        String pixel = "http://localhost:8080/pixel/exchange=c1x/ad_id=thead/creative_id=thecreative/bid_id=123456/price=0.23";
        http.sendPost(pixel, "",300000,300000);
        latch.await(5, TimeUnit.SECONDS);

        List<Map> maps = BidRequest.getExchangeCounts();
        Map x = (Map)maps.get(0);

        System.out.println("=================>" + x);
        long test = (Long)x.get("wins");

        assertTrue(price.equals("0.23"));
        assertTrue(creativeId .equals("thecreative"));
        assertTrue(adId.equals("thead"));
    }

}

Add a new file to handle C1X specific qa issues.


package io.github.vyo.hellojersey.filter;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

/**
 * Simple filter to apply some headers to HTML incoming requests.
 * <p/>
 * Created by manuel.weidmann on 03.03.2015
 */
@Provider
public class CORSResponseFilter
        implements ContainerResponseFilter {

    @Override
    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
            throws IOException {

        MultivaluedMap<String, Object> headers = responseContext.getHeaders();

        headers.add("Access-Control-Allow-Origin", "localhost");
        headers.add("Access-Control-Allow-Methods", "GET, POST, DELETE, QUERY, UPDATE");
        headers.add("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");
    }

}

package io.github.vyo.hellojersey.filter;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

/**
 * Simple filter to apply some headers to HTML incoming requests.
 * <p/>
 * Created by manuel.weidmann on 03.03.2015
 */
@Provider
public class CORSResponseFilter
        implements ContainerResponseFilter {

    @Override
    public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext)
            throws IOException {

        MultivaluedMap<String, Object> headers = responseContext.getHeaders();

        headers.add("Access-Control-Allow-Origin", "*");
        headers.add("Access-Control-Allow-Methods", "OPTIONS, GET, POST, PUT, DELETE, QUERY, UPDATE");
        headers.add("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");
    }

}

Expand CORS filter to allow all the things


package mcjty.rftools.blocks.ores;

import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;

public class DimensionalShardItemBlock extends ItemBlock {
    public DimensionalShardItemBlock(Block block) {
        super(block);
    }

    @Override
    public int getMetadata(int damage) {
        return damage;
    }
}

package mcjty.rftools.blocks.ores;

import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;

public class DimensionalShardItemBlock extends ItemBlock {
    public DimensionalShardItemBlock(Block block) {
        super(block);
        setHasSubtypes(true);
    }

    @Override
    public int getMetadata(int damage) {
        return damage;
    }
}

Call setHasSubtypes(true) on dimensional shard ore

This fixes the nether and end variants of dimensional shard ore dropping as
the overworld variant when silk touched.


package ceylon;

public final class Boolean extends Object {
    private final boolean value;

    private Boolean(boolean b) {
        value = b;
    }

    public static ceylon.Boolean instance(boolean b) {
        return new ceylon.Boolean(b);
    }

    @Extension
    public ceylon.String string() {
        return ceylon.String.instance(java.lang.Boolean.toString(value));
    }
}

package ceylon;

public final class Boolean extends Object {
    private final boolean value;

    private Boolean(boolean b) {
        value = b;
    }

    public static ceylon.Boolean instance(boolean b) {
        return new ceylon.Boolean(b);
    }

    @Extension
    public ceylon.String string() {
        return ceylon.String.instance(java.lang.Boolean.toString(value));
    }

    public boolean booleanValue() {
        return value;
    }
}

Tidy up ClassVisitor. While statement.

Tidy up ClassVisitor.  While statement.


import process.Conf;
import process.training.Classifier;

public class Main {
    public static void main(String[] args) {

        // TODO : TO CONSTANTS
        float overallTargetDetectionRate = 0.80f;
        float overallTargetFalsePositiveRate = 0.000001f;
        float targetDetectionRate = 0.995f;
        float targetFalsePositiveRate = 0.5f;

        if (Conf.USE_CUDA)
            Conf.haarExtractor.setUp(19, 19);

        if (Conf.haarExtractor != null)
            Conf.haarExtractor.freeCuda();

        Classifier classifier = new Classifier("data/trainset", "data/testset", 19, 19);
        classifier.train(overallTargetDetectionRate, overallTargetFalsePositiveRate, targetDetectionRate, targetFalsePositiveRate);
    }
}

import process.Conf;
import process.training.Classifier;

public class Main {
    public static void main(String[] args) {

        // TODO : TO CONSTANTS
        float overallTargetDetectionRate = 0.80f;
        float overallTargetFalsePositiveRate = 0.000001f;
        float targetDetectionRate = 0.995f;
        float targetFalsePositiveRate = 0.5f;

        if (Conf.USE_CUDA)
            Conf.haarExtractor.setUp(19, 19);

        Classifier classifier = new Classifier("data/trainset", "data/testset", 19, 19);
        classifier.train(overallTargetDetectionRate, overallTargetFalsePositiveRate, targetDetectionRate, targetFalsePositiveRate);

        if (Conf.haarExtractor != null)
            Conf.haarExtractor.freeCuda();

    }
}

FIX free cuda after we use it and not before


package sizebay.catalog.client.model;

import java.io.Serializable;
import java.util.Map;
import lombok.*;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@NoArgsConstructor
public class ProductBasicInformation implements Serializable {

	long id;
	@NonNull String name;
	@NonNull String permalink;
	String genderTheWearWasDesignedFor;
	String coverImage;
	String szbSeparator = null;
	String szbCategory = null;
	String categoryName;
	String modelingName;
	@Deprecated boolean bottomOnly;
	ClothesType clothesType;
	String sizeType;
	Boolean status;
	Product.AgeGroupEnum ageGroup = null;
	Map<String, ModelingSizeMeasures> measures;
	Boolean accessory;
}

package sizebay.catalog.client.model;

import java.io.Serializable;
import java.util.Map;
import lombok.*;
import lombok.experimental.Accessors;

@Data
@Accessors(chain = true)
@NoArgsConstructor
public class ProductBasicInformation implements Serializable {

	long id;
	@NonNull String name;
	@NonNull String permalink;
	String genderTheWearWasDesignedFor;
	String coverImage;
	int isShoe;
	int szbMainCategoryId;
	int szbSubCategoryId;
	String szbMainCategoryName = null;
	String szbSubCategoryName = null;
	String categoryName;
	String modelingName;
	@Deprecated boolean bottomOnly;
	ClothesType clothesType;
	String sizeType;
	Boolean status;
	Product.AgeGroupEnum ageGroup = null;
	Map<String, ModelingSizeMeasures> measures;
	Boolean accessory;
}

Add attribute referring to the name and id of the Sizebay category and add attribute that informs if the product is shoe


/*
 * Copyright 2019 Google 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.google.template.soy.error;

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

import com.google.common.collect.ImmutableList;

/**
 * An unrecoverable exception in the Soy compiler. Reports parse errors found before the the
 * compiler failed.
 */
public final class SoyInternalCompilerException extends RuntimeException {
  private final ImmutableList<SoyError> errors;

  public SoyInternalCompilerException(Iterable<SoyError> errors, Throwable cause) {
    super(cause);
    this.errors = ImmutableList.sortedCopyOf(errors);
    checkArgument(!this.errors.isEmpty());
  }

  @Override
  public String getMessage() {
    return "Unrecoverable internal Soy error. Prior to failure found "
        + SoyErrors.formatErrors(errors);
  }
}

/*
 * Copyright 2019 Google 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.google.template.soy.error;

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

import com.google.common.collect.ImmutableList;

/**
 * An unrecoverable exception in the Soy compiler. Reports parse errors found before the compiler
 * failed.
 */
public final class SoyInternalCompilerException extends RuntimeException {
  private final ImmutableList<SoyError> errors;

  public SoyInternalCompilerException(Iterable<SoyError> errors, Throwable cause) {
    super(cause);
    this.errors = ImmutableList.sortedCopyOf(errors);
    checkArgument(!this.errors.isEmpty());
  }

  @Override
  public String getMessage() {
    return "Unrecoverable internal Soy error. Prior to failure found "
        + SoyErrors.formatErrors(errors);
  }
}

Fix typo in new class comment.

Fix typo in new class comment.

GITHUB_BREAKING_CHANGES=n/a

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


package com.github.hotchpotch.fontengine;

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

/**
 * Created by yuichi-tateno on 2015/02/28.
 */
public class IconicFontMap {
    private HashMap<String, Character> fontMap;

    public IconicFontMap() {
        super();
        fontMap = new HashMap<>();
    }

    public IconicFontMap put(String key, Character value) {
        fontMap.put(key, value);
        return this;
    }

    public Character get(String key) {
        return fontMap.get(key);
    }

    public List<String> allNames() {
        return new ArrayList<>(fontMap.keySet());
    }
}

package com.github.hotchpotch.fontengine;

import java.util.HashMap;
import java.util.SortedSet;
import java.util.TreeSet;

/**
 * Created by yuichi-tateno on 2015/02/28.
 */
public class IconicFontMap {
    private HashMap<String, Character> fontMap;

    public IconicFontMap() {
        super();
        fontMap = new HashMap<>();
    }

    public IconicFontMap put(String key, Character value) {
        fontMap.put(key, value);
        return this;
    }

    public Character get(String key) {
        return fontMap.get(key);
    }

    public SortedSet<String> allNames() {
        return new TreeSet<>(fontMap.keySet());
    }
}

Change return type, List to SortedSet

Change return type, List to SortedSet


/**
 *
 */
package com.github.ansell.dwca.schemas;

import org.eclipse.rdf4j.model.IRI;

import com.github.ansell.rdf4j.schemagenerator.Schema;

/**
 * A container for schemas used in the process of generating and validating DWCA
 * archives.
 *
 * @author Peter Ansell p_ansell@yahoo.com
 */
public interface DarwinCoreArchiveSchema extends Schema {

	/**
	 *
	 * @return The IRI used as the base for this schema.
	 */
	IRI getIRI();

}

/**
 *
 */
package com.github.ansell.dwca.schemas;

import com.github.ansell.rdf4j.schemagenerator.Schema;

/**
 * A container for schemas used in the process of generating and validating DWCA
 * archives.
 *
 * @author Peter Ansell p_ansell@yahoo.com
 */
public interface DarwinCoreArchiveSchema extends Schema {

}

Move getIRI up to super interface

Move getIRI up to super interface

Signed-off-by: Peter Ansell <aaf1ec639befe0a570b950d5d6cbd0c6638a063e@yahoo.com>


package me.nallar.javatransformer.internal.util;

import lombok.experimental.UtilityClass;

import java.util.*;
import java.util.stream.*;

@UtilityClass
public class CollectionUtil {
	@SafeVarargs
	@SuppressWarnings("varargs")
	public static <T> Stream<T> union(Collection<T>... collections) {
		return union(Arrays.asList(collections));
	}

	public static <T> Stream<T> union(Collection<Collection<T>> collections) {
		return collections.stream().flatMap(Collection::stream);
	}
}

package me.nallar.javatransformer.internal.util;

import lombok.experimental.UtilityClass;

import java.util.*;
import java.util.stream.*;

@UtilityClass
public class CollectionUtil {
	@SafeVarargs
	@SuppressWarnings("varargs")
	public static <T> Stream<T> union(Collection<T>... collections) {
		return union(Arrays.asList(collections));
	}

	public static <T> Stream<T> union(Collection<Collection<T>> collections) {
		return collections.stream().flatMap(x -> x == null ? Stream.empty() : x.stream());
	}
}

Handle null collections as empty in union(Collection)


package org.owntracks.android.support;

import org.owntracks.android.injection.scopes.PerApplication;
import org.owntracks.android.services.BackgroundService;

import java.lang.ref.WeakReference;

import javax.inject.Inject;

import androidx.annotation.NonNull;

@PerApplication
public class ServiceBridge {
    private WeakReference<ServiceBridgeInterface> serviceWeakReference;

    public interface ServiceBridgeInterface {
        void requestOnDemandLocationUpdate();
    }

    @Inject
    ServiceBridge() {
    }

    public void bind(@NonNull ServiceBridgeInterface service) {
        this.serviceWeakReference = new WeakReference<ServiceBridgeInterface>(service);
    }

    public void requestOnDemandLocationFix() {
        ServiceBridgeInterface service = serviceWeakReference.get();
        if(service != null) {
            service.requestOnDemandLocationUpdate();
        }
    }

}

package org.owntracks.android.support;

import org.owntracks.android.injection.scopes.PerApplication;

import java.lang.ref.WeakReference;

import javax.inject.Inject;

import androidx.annotation.NonNull;

@PerApplication
public class ServiceBridge {
    private WeakReference<ServiceBridgeInterface> serviceWeakReference = new WeakReference<ServiceBridgeInterface>(null);

    public interface ServiceBridgeInterface {
        void requestOnDemandLocationUpdate();
    }

    @Inject
    ServiceBridge() {
    }

    public void bind(@NonNull ServiceBridgeInterface service) {
        this.serviceWeakReference = new WeakReference<ServiceBridgeInterface>(service);
    }

    public void requestOnDemandLocationFix() {
        ServiceBridgeInterface service = serviceWeakReference.get();
        if(service != null) {
            service.requestOnDemandLocationUpdate();
        }
    }

}

Fix crash when receiving reportLocation command before service is bound


@API(apiVersion = "28.0.0", owner = "JEI", provides = "JustEnoughItemsAPI")
package mezz.jei.api;

import net.minecraftforge.fml.common.API;

@API(apiVersion = "0.28.0", owner = "JEI", provides = "JustEnoughItemsAPI")
package mezz.jei.api;

import net.minecraftforge.fml.common.API;

Use Major version zero for the JEI API version, according to semver


package com.novoda.downloadmanager;

final class InternalFileSizeCreator {

    private static final int ZERO_BYTES = 0;
    private static final InternalFileSize UNKNOWN = new LiteFileSize(ZERO_BYTES, ZERO_BYTES);

    private InternalFileSizeCreator() {
        // Uses static factory methods.
    }

    static InternalFileSize unknownFileSize() {
        return UNKNOWN;
    }

    static InternalFileSize createFromCurrentAndTotalSize(long currentSize, long totalSize) {
        return new LiteFileSize(currentSize, totalSize);
    }
}

package com.novoda.downloadmanager;

final class InternalFileSizeCreator {

    private static final int ZERO_BYTES = 0;
    private static final InternalFileSize UNKNOWN = new LiteFileSize(ZERO_BYTES, ZERO_BYTES);

    private InternalFileSizeCreator() {
        // Uses static factory methods.
    }

    static InternalFileSize unknownFileSize() {
        return UNKNOWN.copy();
    }

    static InternalFileSize createFromCurrentAndTotalSize(long currentSize, long totalSize) {
        return new LiteFileSize(currentSize, totalSize);
    }
}

Create copy of internal file size when initialising unknown one


package seedu.address.commons.events.model;

import seedu.address.commons.events.BaseEvent;
import seedu.address.model.ReadOnlyAddressBook;

/** Indicates the AddressBook in the model has changed*/
public class AddressBookChangedEvent extends BaseEvent {

    public final ReadOnlyAddressBook data;

    public AddressBookChangedEvent(ReadOnlyAddressBook data){
        this.data = data;
    }

    @Override
    public String toString() {
        return "number of persons " + data.getPersonList().size() + ", number of tags " + data.getTagList().size();
    }
}

package seedu.address.commons.events.model;

import seedu.address.commons.events.BaseEvent;
import seedu.address.model.ReadOnlyAddressBook;

/** Indicates the AddressBook in the model has changed*/
public class AddressBookChangedEvent extends BaseEvent {

    public final ReadOnlyAddressBook data;

    public AddressBookChangedEvent(ReadOnlyAddressBook data){
        this.data = data;
    }

    @Override
    public String toString() {
        return "number of persons " + data.getListActivity().size() + ", number of tags " + data.getTagList().size();
    }
}

Update address book change event to activity


/*
 * Copyright 2013 MovingBlocks
 *
 * 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.terasology.world.block.regions;

import org.terasology.entitySystem.Component;
import org.terasology.math.Region3i;

/**
 * @author Immortius
 */
public class BlockRegionComponent implements Component {
    public Region3i region = Region3i.EMPTY;
    public boolean overrideBlockEntities = true;

    public BlockRegionComponent() {
    }

    public BlockRegionComponent(Region3i region) {
        this.region = region;
    }
}

/*
 * Copyright 2013 MovingBlocks
 *
 * 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.terasology.world.block.regions;

import org.terasology.entitySystem.Component;
import org.terasology.math.Region3i;
import org.terasology.network.Replicate;

/**
 * @author Immortius
 */
public class BlockRegionComponent implements Component {
    @Replicate
    public Region3i region = Region3i.EMPTY;
    public boolean overrideBlockEntities = true;

    public BlockRegionComponent() {
    }

    public BlockRegionComponent(Region3i region) {
        this.region = region;
    }
}

Fix interaction with door by replicating the BlockReginoComponent.


package cvut.arenaq.mashup.AlchemyApi;

import retrofit.Call;
import retrofit.http.GET;
import retrofit.http.Path;

public interface AlchemyApiService {
    @GET("/calls/url/URLGetRankedKeywords?apikey=e9b2175fdaa36af4febe23ec32b3b9ad47154727&outputMode=json&url={url}")
    Call<GetRankedKeywords> getRankedKeywords(@Path("url") String url);

    @GET("/calls/url/URLGetRankedConcepts?apikey=e9b2175fdaa36af4febe23ec32b3b9ad47154727&outputMode=json&url={url}")
    Call<GetRankedConcepts> getRankedConcepts(@Path("url") String url);
}

package cvut.arenaq.mashup.AlchemyApi;

import retrofit.Call;
import retrofit.http.GET;
import retrofit.http.Path;
import retrofit.http.Query;

public interface AlchemyApiService {
    @GET("/calls/url/URLGetRankedKeywords")
    Call<GetRankedKeywords> getRankedKeywords(
            @Query("apikey") String apikey,
            @Query("outputMode") String outputMode,
            @Query("url") String url);

    @GET("/calls/url/URLGetRankedConcepts")
    Call<GetRankedConcepts> getRankedConcepts(
            @Query("apikey") String apikey,
            @Query("outputMode") String outputMode,
            @Query("url") String url);
}

Fix inappropriate annotation usage in service interface


// Copyright (C) 2014 Tom <tw201207@gmail.com>
//
// 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.gitblit.utils;
package com.gitblit.utils;

import java.io.ByteArrayOutputStream;

/**
 * A {@link ByteArrayOutputStream} that can be reset to a specified position.
 *
 * @author Tom <tw201207@gmail.com>
 */
public class ResettableByteArrayOutputStream extends ByteArrayOutputStream {

	/**
	 * Reset the stream to the given position. If {@code mark} is <= 0, see {@link #reset()}.
	 * A no-op if the stream contains less than {@code mark} bytes. Otherwise, resets the
	 * current writing position to {@code mark}. Previously allocated buffer space will be
	 * reused in subsequent writes.
	 *
	 * @param mark
	 *            to set the current writing position to.
	 */
	public synchronized void resetTo(int mark) {
		if (mark <= 0) {
			reset();
		} else if (mark < count) {
			count = mark;
		}
	}

}

// Copyright (C) 2014 Tom <tw201207@gmail.com>
//
// 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.gitblit.utils;

import java.io.ByteArrayOutputStream;

/**
 * A {@link ByteArrayOutputStream} that can be reset to a specified position.
 *
 * @author Tom <tw201207@gmail.com>
 */
public class ResettableByteArrayOutputStream extends ByteArrayOutputStream {

	/**
	 * Reset the stream to the given position. If {@code mark} is <= 0, see {@link #reset()}.
	 * A no-op if the stream contains less than {@code mark} bytes. Otherwise, resets the
	 * current writing position to {@code mark}. Previously allocated buffer space will be
	 * reused in subsequent writes.
	 *
	 * @param mark
	 *            to set the current writing position to.
	 */
	public synchronized void resetTo(int mark) {
		if (mark <= 0) {
			reset();
		} else if (mark < count) {
			count = mark;
		}
	}

}

Fix a copy/paste error in a comment.

Fix a copy/paste error in a comment.


package nl.sikken.bertrik.hab.ttn;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * Representation of a message received from the TTN MQTT stream.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public final class TtnMessage {

    @JsonProperty("app_id")
    private String appId;

    @JsonProperty("dev_id")
    private String devId;

    @JsonProperty("hardware_serial")
    private String hardwareSerial;

    @JsonProperty("port")
    private int port;

    @JsonProperty("counter")
    private int counter;

    @JsonProperty("payload_raw")
    private byte[] payloadRaw;

    @JsonProperty("payload_fields")
    private ObjectNode payloadFields;

    @JsonProperty("metadata")
    private TtnMessageMetaData metaData;

    public String getAppId() {
        return appId;
    }

    public String getDevId() {
        return devId;
    }

    public String getHardwareSerial() {
        return hardwareSerial;
    }

    public int getPort() {
        return port;
    }

    public int getCounter() {
        return counter;
    }

    public byte[] getPayloadRaw() {
        return payloadRaw;
    }

    public ObjectNode getPayloadFields() {
        return payloadFields;
    }

    public TtnMessageMetaData getMetaData() {
        return metaData;
    }

}

package nl.sikken.bertrik.hab.ttn;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * Representation of a message received from the TTN MQTT stream.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public final class TtnMessage {

    @JsonProperty("app_id")
    private String appId;

    @JsonProperty("dev_id")
    private String devId;

    @JsonProperty("hardware_serial")
    private String hardwareSerial;

    @JsonProperty("port")
    private int port;

    @JsonProperty("counter")
    private int counter;

    @JsonProperty("payload_raw")
    private byte[] payloadRaw;

    @JsonProperty("payload_fields")
    private ObjectNode payloadFields;

    @JsonProperty("metadata")
    private TtnMessageMetaData metaData;

    public String getAppId() {
        return appId;
    }

    public String getDevId() {
        return devId;
    }

    public String getHardwareSerial() {
        return hardwareSerial;
    }

    public int getPort() {
        return port;
    }

    public int getCounter() {
        return counter;
    }

    public byte[] getPayloadRaw() {
        return payloadRaw.clone();
    }

    public ObjectNode getPayloadFields() {
        return payloadFields;
    }

    public TtnMessageMetaData getMetaData() {
        return metaData;
    }

}

Fix spotbugs warning about modifiable byte[].


package org.opennms.web.svclayer;

import java.util.Date;

public interface DistributedStatusService {
    public SimpleWebTable createStatusTable(String locationName, String applicationLabel);

    public SimpleWebTable createFacilityStatusTable(Date startDate, Date endDate);
}

package org.opennms.web.svclayer;

import java.util.Date;

import org.springframework.transaction.annotation.Transactional;

@Transactional(readOnly=true)
public interface DistributedStatusService {
    public SimpleWebTable createStatusTable(String locationName, String applicationLabel);

    public SimpleWebTable createFacilityStatusTable(Date startDate, Date endDate);
}

Make the service layer transactional (and read-only)


package org.helianto.message.sender;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;

import org.helianto.message.AbstractMessageAdapter;
import org.springframework.core.io.Resource;
import org.springframework.mail.javamail.MimeMessageHelper;

/**
 * Java mail message (not thread safe).
 *
 * @author mauriciofernandesdecastro
 */
public class JavaMailMessageAdapter extends AbstractMessageAdapter<MimeMessage> {

	/**
	 * Java mail message constructor.
	 *
	 * @param mimeMessage
	 */
	public JavaMailMessageAdapter() {
		super();
	}

	/**
	 * Adapter method.
	 */
	protected String[] getToAsStringArray() {
		String[] toArray = new String[getTo().size()];
		return toArray;
	}

	public MimeMessage getMessage() {
		try {
			MimeMessageHelper helper = new MimeMessageHelper(getMessage(), true);
			helper.setTo(getToAsStringArray());
			helper.setFrom(getFrom().getPrincipal());
			helper.setSubject(getSubject());
			helper.setText(getHtml(), true);
			for (Resource file: getAttachments()) {
				helper.addAttachment(file.getFilename(), file);
			}
			return getMessage();
		} catch (MessagingException e) {
			throw new IllegalArgumentException();
		}
	}

}

package org.helianto.message.sender;

import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;

import org.helianto.message.AbstractMessageAdapter;
import org.springframework.core.io.Resource;
import org.springframework.mail.javamail.MimeMessageHelper;

/**
 * Java mail message (not thread safe).
 *
 * @author mauriciofernandesdecastro
 */
public class JavaMailMessageAdapter extends AbstractMessageAdapter<MimeMessage> {

	/**
	 * Java mail message constructor.
	 *
	 * @param mimeMessage
	 */
	public JavaMailMessageAdapter() {
		super();
	}

	/**
	 * Adapter method.
	 */
	protected String[] getToAsStringArray() {
		String[] toArray = new String[getTo().size()];
		return toArray;
	}

	public MimeMessage getMessage() {
		try {
			MimeMessageHelper helper = new MimeMessageHelper(super.getMessage(), true);
			helper.setTo(getToAsStringArray());
			helper.setFrom(getFrom().getPrincipal());
			helper.setSubject(getSubject());
			helper.setText(getHtml(), true);
			for (Resource file: getAttachments()) {
				helper.addAttachment(file.getFilename(), file);
			}
			return getMessage();
		} catch (MessagingException e) {
			throw new IllegalArgumentException();
		}
	}

}

Update java mail message adapter.

Update java mail message adapter.


package io.bisq.gui.components;

import javafx.scene.control.Labeled;
import javafx.scene.control.SkinBase;
import javafx.scene.control.Tooltip;
import javafx.scene.text.Text;

public class TooltipUtil {

    public static void showTooltipIfTruncated(SkinBase skinBase, Labeled labeled) {
        for (Object node : skinBase.getChildren()) {
            if (node instanceof Text) {
                String displayedText = ((Text) node).getText();
                if (displayedText.equals(labeled.getText())) {
                    if (labeled.getTooltip() != null) {
                        labeled.setTooltip(null);
                    }
                } else if (labeled.getText() != null){
                    labeled.setTooltip(new Tooltip(labeled.getText()));
                }
            }
        }
    }
}

package io.bisq.gui.components;

import javafx.scene.control.Labeled;
import javafx.scene.control.SkinBase;
import javafx.scene.control.Tooltip;
import javafx.scene.text.Text;

public class TooltipUtil {

    public static void showTooltipIfTruncated(SkinBase skinBase, Labeled labeled) {
        for (Object node : skinBase.getChildren()) {
            if (node instanceof Text) {
                String displayedText = ((Text) node).getText();
                String untruncatedText = labeled.getText();
                if (displayedText.equals(untruncatedText)) {
                    if (labeled.getTooltip() != null) {
                        labeled.setTooltip(null);
                    }
                } else if (untruncatedText != null && !untruncatedText.trim().isEmpty()){
                    labeled.setTooltip(new Tooltip(untruncatedText));
                }
            }
        }
    }
}

Add empty string check to prevent tooltip creation for empty strings


/**
 * generated by Xtext
 */
package cl.uchile.pleiad.scoping;

import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;

/**
 * This class contains custom scoping description.
 *
 * see : http://www.eclipse.org/Xtext/documentation.html#scoping
 * on how and when to use it
 */
@SuppressWarnings("all")
public class TextRAMScopeProvider extends AbstractDeclarativeScopeProvider {
}

/**
 * generated by Xtext
 */
package cl.uchile.pleiad.scoping;

import ca.mcgill.cs.sel.ram.StructuralView;
import ca.mcgill.cs.sel.ram.Type;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.Scopes;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;

/**
 * This class contains custom scoping description.
 *
 * see : http://www.eclipse.org/Xtext/documentation.html#scoping
 * on how and when to use it
 */
@SuppressWarnings("all")
public class TextRAMScopeProvider extends AbstractDeclarativeScopeProvider {
  public IScope scope_Operation_returnType(final StructuralView ctx, final EReference reference) {
    EList<Type> _types = ctx.getTypes();
    IScope _scopeFor = Scopes.scopeFor(_types);
    return _scopeFor;
  }
}

Support for types using declarative scoping


/*
 * generated by Xtext
 */
package eu.indenica.config.runtime.scoping;

import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.Scopes;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;

import eu.indenica.config.runtime.runtime.EventEmissionDeclaration;

/**
 * This class contains custom scoping description.
 *
 * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping on
 * how and when to use it
 *
 */
public class RuntimeScopeProvider extends AbstractDeclarativeScopeProvider {
	IScope scope_EventAttribute(EventEmissionDeclaration ctx, EReference ref) {
		return Scopes.scopeFor(ctx.getEvent().getAttributes());
	}
}

/*
 * generated by Xtext
 */
package eu.indenica.config.runtime.scoping;

import java.util.Collection;

import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.xtext.scoping.IScope;
import org.eclipse.xtext.scoping.Scopes;
import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider;

import com.google.common.collect.Lists;

import eu.indenica.config.runtime.runtime.Event;
import eu.indenica.config.runtime.runtime.EventEmissionDeclaration;
import eu.indenica.config.runtime.runtime.EventSource;
import eu.indenica.config.runtime.runtime.EventSourceDeclaration;
import eu.indenica.config.runtime.runtime.MonitoringRule;

/**
 * This class contains custom scoping description.
 *
 * see : http://www.eclipse.org/Xtext/documentation/latest/xtext.html#scoping on
 * how and when to use it
 *
 */
public class RuntimeScopeProvider extends AbstractDeclarativeScopeProvider {
	IScope scope_EventAttribute(EventEmissionDeclaration ctx, EReference ref) {
		return Scopes.scopeFor(ctx.getEvent().getAttributes());
	}

	IScope scope_JvmIdentifiableElement(MonitoringRule ctx, EReference ref) {
		Collection<EObject> elements = Lists.newArrayList();
		Collection<EventSource> sources = Lists.newArrayList();

		for(EventSourceDeclaration source : ctx.getSources())
			sources.addAll(source.getSources());

		for(EventSource source : sources) {
			elements.add(source);
			for(Event event : source.getEvents()) {
				elements.add(event);
				elements.addAll(event.getAttributes());
			}
		}

		return Scopes.scopeFor(elements);
	}
}

Add proper scoping inside rules.

Add proper scoping inside rules.


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

import java.lang.annotation.*;
import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * Annotation that allows a list of strings, separated by commas to be validated as Gene Product IDs
 * @author Tony Wardell
 * Date: 14/06/2016
 * Time: 12:03
 * Created with IntelliJ IDEA.
 */

@Constraint(validatedBy = ReferenceValuesValidation.class)
@Documented
@Target({ElementType.METHOD,
        ElementType.FIELD,
        ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR,
        ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ReferenceValidator {

    String message() default "The reference value is invalid";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

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

import java.lang.annotation.*;
import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * Annotation that allows a list of strings, separated by commas to be validated as Reference Ids (full or partial).
 * @author Tony Wardell
 * Date: 14/06/2016
 * Time: 12:03
 * Created with IntelliJ IDEA.
 */

@Constraint(validatedBy = ReferenceValuesValidation.class)
@Documented
@Target({ElementType.METHOD,
        ElementType.FIELD,
        ElementType.ANNOTATION_TYPE,
        ElementType.CONSTRUCTOR,
        ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface ReferenceValidator {

    String message() default "The reference value is invalid";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}

Fix copy and paste error in javadoc.

Fix copy and paste error in javadoc.


package retrofit.http;

import retrofit.http.client.Response;

/**
 * A wrapper that holds the {@link Response} and {@link Converter} response to be used by the
 * {@link CallbackRunnable} for success method calls on {@link Callback}.
 *
 * @author JJ Ford (jj.n.ford@gmail.com)
 */
final class ResponseWrapper {

  Response response;
  Object responseBody;

  public ResponseWrapper(Response response, Object responseBody) {
    this.response = response;
    this.responseBody = responseBody;
  }
}

package retrofit.http;

import retrofit.http.client.Response;

/**
 * A wrapper that holds the {@link Response} and {@link Converter} response to be used by the
 * {@link CallbackRunnable} for success method calls on {@link Callback}.
 *
 * @author JJ Ford (jj.n.ford@gmail.com)
 */
final class ResponseWrapper {

  final Response response;
  final Object responseBody;

  public ResponseWrapper(Response response, Object responseBody) {
    this.response = response;
    this.responseBody = responseBody;
  }
}

Make response wrapper members final.

Make response wrapper members final.


package com.youcruit.onfido.api.webhook;

import java.net.URL;
import java.util.Date;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class EventObject {
    @Expose
    @SerializedName("id")
    private String id;
    @Expose
    @SerializedName("status")
    private Status status;
    @Expose
    @SerializedName("completed_at")
    private Date completedAt;
    @Expose
    @SerializedName("href")
    private URL resourceUrl;

    public String getId() {
	return id;
    }

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

    public Status getStatus() {
	return status;
    }

    public void setStatus(Status status) {
	this.status = status;
    }

    public Date getCompletedAt() {
	return completedAt;
    }

    public void setCompletedAt(Date completedAt) {
	this.completedAt = completedAt;
    }

    public URL getResourceUrl() {
	return resourceUrl;
    }

    public void setResourceUrl(URL resourceUrl) {
	this.resourceUrl = resourceUrl;
    }

    @Override
    public String toString() {
	return "EventObject{" +
		"id='" + id + '\'' +
		", status=" + status +
		", completedAt=" + completedAt +
		", resourceUrl=" + resourceUrl +
		'}';
    }
}

package com.youcruit.onfido.api.webhook;

import java.net.URI;
import java.util.Date;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

public class EventObject {
    @Expose
    @SerializedName("id")
    private String id;
    @Expose
    @SerializedName("status")
    private Status status;
    @Expose
    @SerializedName("completed_at")
    private Date completedAt;
    @Expose
    @SerializedName("href")
    private URI resourceUrl;

    public String getId() {
	return id;
    }

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

    public Status getStatus() {
	return status;
    }

    public void setStatus(Status status) {
	this.status = status;
    }

    public Date getCompletedAt() {
	return completedAt;
    }

    public void setCompletedAt(Date completedAt) {
	this.completedAt = completedAt;
    }

    public URI getResourceUrl() {
	return resourceUrl;
    }

    public void setResourceUrl(URI resourceUrl) {
	this.resourceUrl = resourceUrl;
    }

    @Override
    public String toString() {
	return "EventObject{" +
		"id='" + id + '\'' +
		", status=" + status +
		", completedAt=" + completedAt +
		", resourceUrl=" + resourceUrl +
		'}';
    }
}

Use URI instead of URL

Use URI instead of URL


/*
 * Copyright 2016 Timothy Brooks
 *
 * 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.uncontended.precipice;

public interface Precipice<Result extends Enum<Result> & Failable, Rejected extends Enum<Rejected>> {

    GuardRail<Result, Rejected> guardRail();
}

/*
 * Copyright 2016 Timothy Brooks
 *
 * 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.uncontended.precipice;

/**
 * A Precipice is a class that has an associated GuardRail. This interface
 * should be implemented by classes that combined the usage of a GuardRail with specialized
 * execution logic. The only method {@link #guardRail()} should return the GuardRail associated
 * with the implemented class. The {@link CallService} is an example of an implementation.
 */
public interface Precipice<Result extends Enum<Result> & Failable, Rejected extends Enum<Rejected>> {

    /**
     * Return the GuardRail associated with this class.
     *
     * @return the GuardRail
     */
    GuardRail<Result, Rejected> guardRail();
}

Add documentaiton to guard rail

Add documentaiton to guard rail


package com.lukekorth.screennotifications;

public class ScreenNotificationsService extends BaseAccessibilityService {

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

}

package com.lukekorth.screennotifications;

import android.accessibilityservice.AccessibilityServiceInfo;
import android.view.accessibility.AccessibilityEvent;

public class ScreenNotificationsService extends BaseAccessibilityService {

    public void onServiceConnected() {
        super.onServiceConnected();

        AccessibilityServiceInfo localAccessibilityServiceInfo = new AccessibilityServiceInfo();
        localAccessibilityServiceInfo.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
        localAccessibilityServiceInfo.feedbackType = 16;
        localAccessibilityServiceInfo.notificationTimeout = 0L;
        setServiceInfo(localAccessibilityServiceInfo);
    }

}

Fix missing configuration for Accessibility listener on pre-Jelly Bean devices


/*
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
 */

package __ID__;

import android.os.Bundle;
import org.apache.cordova.*;

public class __ACTIVITY__ extends DroidGap
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        Config.init(this);
        super.loadUrl("file:///android_asset/www/index.html");
    }
}

/*
       Licensed to the Apache Software Foundation (ASF) under one
       or more contributor license agreements.  See the NOTICE file
       distributed with this work for additional information
       regarding copyright ownership.  The ASF licenses this file
       to you under the Apache License, Version 2.0 (the
       "License"); you may not use this file except in compliance
       with the License.  You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

       Unless required by applicable law or agreed to in writing,
       software distributed under the License is distributed on an
       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
       KIND, either express or implied.  See the License for the
       specific language governing permissions and limitations
       under the License.
 */

package __ID__;

import android.os.Bundle;
import org.apache.cordova.*;

public class __ACTIVITY__ extends DroidGap
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        Config.init(this);
        super.loadUrl(Config.getStartUrl());
        //super.loadUrl("file:///android_asset/www/index.html")
    }
}

Add configurable start location to config.xml and template

Still possible to hardcode, there's a comment in the template showing
how that can be done.


package codechicken.lib.model;

import codechicken.lib.util.TransformUtils;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.resources.model.BakedModel;
import org.jetbrains.annotations.Nullable;

/**
 * A simple {@link BakedModel} implementation, with automatic handling of
 * {@link PerspectiveModelState}s.
 * <p>
 * Created by covers1624 on 9/7/22.
 *
 * @see TransformUtils
 */
public interface PerspectiveModel extends BakedModel {

    /**
     * The {@link PerspectiveModelState} for this model.
     *
     * @return The state or {@code null} for vanilla behaviour.
     */
    @Nullable
    PerspectiveModelState getModelState();

    @Override
    default BakedModel applyTransform(ItemTransforms.TransformType transformType, PoseStack pStack, boolean leftFlip) {
        PerspectiveModelState modelState = getModelState();
        if (modelState != null) {
            getModelState().getTransform(transformType).push(pStack);
            if (leftFlip) {
                TransformUtils.applyLeftyFlip(pStack);
            }
            return this;
        }
        return BakedModel.super.applyTransform(transformType, pStack, leftFlip);
    }
}

package codechicken.lib.model;

import codechicken.lib.util.TransformUtils;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Transformation;
import com.mojang.math.Vector3f;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.resources.model.BakedModel;
import org.jetbrains.annotations.Nullable;

/**
 * A simple {@link BakedModel} implementation, with automatic handling of
 * {@link PerspectiveModelState}s.
 * <p>
 * Created by covers1624 on 9/7/22.
 *
 * @see TransformUtils
 */
public interface PerspectiveModel extends BakedModel {

    /**
     * The {@link PerspectiveModelState} for this model.
     *
     * @return The state or {@code null} for vanilla behaviour.
     */
    @Nullable
    PerspectiveModelState getModelState();

    @Override
    default BakedModel applyTransform(ItemTransforms.TransformType transformType, PoseStack pStack, boolean leftFlip) {
        PerspectiveModelState modelState = getModelState();
        if (modelState != null) {
            Transformation transform = getModelState().getTransform(transformType);

            Vector3f trans = transform.getTranslation();
            pStack.translate(trans.x(), trans.y(), trans.z());

            pStack.mulPose(transform.getLeftRotation());

            Vector3f scale = transform.getScale();
            pStack.scale(scale.x(), scale.y(), scale.z());

            pStack.mulPose(transform.getRightRotation());

            if (leftFlip) {
                TransformUtils.applyLeftyFlip(pStack);
            }
            return this;
        }
        return BakedModel.super.applyTransform(transformType, pStack, leftFlip);
    }
}

Fix issues with uneven pose stack push-pop in IItemRenderer


package ceylon;

public final class Integer
{
    private final long value;
    private Integer(long l) {
        value = l;
    }

    public static ceylon.Integer instance(long l) {
        return new ceylon.Integer(l);
    }

    public ceylon.Integer operatorAdd(ceylon.Integer op) {
        return instance(value + op.value);
    }

    public ceylon.Integer operatorSubtract(ceylon.Integer op) {
        return instance(value - op.value);
    }

    public ceylon.Integer operatorMultiply(ceylon.Integer op) {
        return instance(value * op.value);
    }

    public ceylon.Integer operatorPower(ceylon.Integer op) {
        return instance((long) Math.pow(value, op.value)); // FIXME: ugly
    }

    public ceylon.Integer operatorDivide(ceylon.Integer op) {
        return instance(value / op.value);
    }

    public ceylon.Integer operatorModulo(ceylon.Integer op) {
        return instance(value % op.value);
    }

    public ceylon.Integer operatorBitwiseAnd(ceylon.Integer op) {
        return instance(value & op.value);
    }

    public ceylon.Integer operatorBitwiseOr(ceylon.Integer op) {
        return instance(value | op.value);
    }

    public ceylon.Integer operatorBitwiseXor(ceylon.Integer op) {
        return instance(value ^ op.value);
    }

    public ceylon.String asString() {
        return ceylon.String.instance(java.lang.Long.toString(value));
    }
}

package ceylon;

public final class Integer
{
    private final long value;
    private Integer(long l) {
        value = l;
    }

    public static ceylon.Integer instance(long l) {
        return new ceylon.Integer(l);
    }

    public ceylon.Integer plus(ceylon.Integer op) {
        return instance(value + op.value);
    }

    public ceylon.Integer minus(ceylon.Integer op) {
        return instance(value - op.value);
    }

    public ceylon.Integer times(ceylon.Integer op) {
        return instance(value * op.value);
    }

    public ceylon.Integer divided(ceylon.Integer op) {
        return instance(value / op.value);
    }

    public ceylon.Integer remainder(ceylon.Integer op) {
        return instance(value % op.value);
    }

    public ceylon.Integer power(ceylon.Integer op) {
        return instance((long) Math.pow(value, op.value)); // FIXME: ugly
    }

    public ceylon.Integer and(ceylon.Integer op) {
        return instance(value & op.value);
    }

    public ceylon.Integer or(ceylon.Integer op) {
        return instance(value | op.value);
    }

    public ceylon.Integer xor(ceylon.Integer op) {
        return instance(value ^ op.value);
    }

    public ceylon.String asString() {
        return ceylon.String.instance(java.lang.Long.toString(value));
    }
}

Change method names to match the spec

Change method names to match the spec


package protocolsupport.listeners.emulation;

import org.bukkit.SoundCategory;
import org.bukkit.SoundGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;

import protocolsupport.api.Connection;
import protocolsupport.api.ProtocolSupportAPI;
import protocolsupport.api.ProtocolType;
import protocolsupport.api.ProtocolVersion;

public class BlockPlaceSelfSoundEmulation implements Listener {

	@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
	public void onBlockPlace(BlockPlaceEvent event) {
		Player player = event.getPlayer();
		Connection connection = ProtocolSupportAPI.getConnection(player);
		if (connection == null) {
			return;
		}
		ProtocolVersion version = connection.getVersion();
		if ((version.getProtocolType() == ProtocolType.PC) && version.isBeforeOrEq(ProtocolVersion.MINECRAFT_1_8)) {
			SoundGroup soundgroup = event.getBlock().getBlockData().getSoundGroup();
			player.playSound(
				event.getBlock().getLocation(),
				soundgroup.getStepSound(),
				SoundCategory.BLOCKS,
				(soundgroup.getVolume() + 1.0F) / 2.0F,
				soundgroup.getPitch() * 0.8F
			);
		}
	}

}

package protocolsupport.listeners.emulation;

import org.bukkit.SoundCategory;
import org.bukkit.SoundGroup;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;

import protocolsupport.api.Connection;
import protocolsupport.api.ProtocolSupportAPI;
import protocolsupport.api.ProtocolType;
import protocolsupport.api.ProtocolVersion;

public class BlockPlaceSelfSoundEmulation implements Listener {

	@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
	public void onBlockPlace(BlockPlaceEvent event) {
		Player player = event.getPlayer();
		Connection connection = ProtocolSupportAPI.getConnection(player);
		if (connection == null) {
			return;
		}
		ProtocolVersion version = connection.getVersion();
		if ((version.getProtocolType() == ProtocolType.PC) && version.isBeforeOrEq(ProtocolVersion.MINECRAFT_1_8)) {
			SoundGroup soundgroup = event.getBlock().getBlockData().getSoundGroup();
			player.playSound(
				event.getBlock().getLocation(),
				soundgroup.getPlaceSound(),
				SoundCategory.BLOCKS,
				(soundgroup.getVolume() + 1.0F) / 2.0F,
				soundgroup.getPitch() * 0.8F
			);
		}
	}

}

Use correct sound type for block place sound emulation

This however has one major drawback - many place sounds aren't mapped
correctly in PS, so it's worse than using step sound.


package io.fundrequest.platform.admin;

import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
import io.fundrequest.core.FundRequestCore;
import io.fundrequest.platform.github.FundRequestGithub;
import io.fundrequest.platform.keycloak.FundRequestKeycloak;
import io.fundrequest.platform.profile.ProfileApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
        basePackageClasses = {
                AdminApplication.class,
                FundRequestKeycloak.class,
                FundRequestGithub.class,
                FundRequestCore.class,
                ProfileApplication.class,
        },
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class),
                @ComponentScan.Filter(IgnoreDuringComponentScan.class)})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

}

package io.fundrequest.platform.admin;

import io.fundrequest.common.FundRequestCommon;
import io.fundrequest.common.infrastructure.IgnoreDuringComponentScan;
import io.fundrequest.core.FundRequestCore;
import io.fundrequest.platform.github.FundRequestGithub;
import io.fundrequest.platform.keycloak.FundRequestKeycloak;
import io.fundrequest.platform.profile.ProfileApplication;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigurationExcludeFilter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.TypeExcludeFilter;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

@SpringBootConfiguration
@EnableAutoConfiguration
@ComponentScan(
        basePackageClasses = {
                AdminApplication.class,
                FundRequestKeycloak.class,
                FundRequestGithub.class,
                FundRequestCommon.class,
                FundRequestCore.class,
                ProfileApplication.class,
        },
        excludeFilters = {
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = TypeExcludeFilter.class),
                @ComponentScan.Filter(type = FilterType.CUSTOM, classes = AutoConfigurationExcludeFilter.class),
                @ComponentScan.Filter(IgnoreDuringComponentScan.class)})
public class AdminApplication {

    public static void main(String[] args) {
        SpringApplication.run(AdminApplication.class, args);
    }

}

Fix issue with startup of admin-web

Fix issue with startup of admin-web


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

import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
import org.junit.Test;
import org.junit.runner.RunWith;

/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
@RunWith(AndroidJUnit4.class)
public final class DefaultRenderersFactoryTest {

  @Test
  public void createRenderers_instantiatesOpusRenderer() {
    DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
        LibopusAudioRenderer.class, C.TRACK_TYPE_AUDIO);
  }
}

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

import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.DefaultRenderersFactoryAsserts;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.annotation.internal.DoNotInstrument;

/** Unit test for {@link DefaultRenderersFactoryTest} with {@link LibopusAudioRenderer}. */
@RunWith(AndroidJUnit4.class)
@DoNotInstrument
public final class DefaultRenderersFactoryTest {

  @Test
  public void createRenderers_instantiatesOpusRenderer() {
    DefaultRenderersFactoryAsserts.assertExtensionRendererCreated(
        LibopusAudioRenderer.class, C.TRACK_TYPE_AUDIO);
  }
}

Add @DoNotInstrument to Opus extension test

PiperOrigin-RevId: 370740311


package com.jvm_bloggers.frontend.public_area.common_layout;

import com.jvm_bloggers.domain.query.newsletter_issue_for_listing.NewsletterIssueForListing;
import com.jvm_bloggers.domain.query.newsletter_issue_for_listing.NewsletterIssueForListingQuery;

import javaslang.collection.Seq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RightFrontendSidebarBackingBean {

    private final NewsletterIssueForListingQuery query;

    @Autowired
    public RightFrontendSidebarBackingBean(NewsletterIssueForListingQuery query) {
        this.query = query;
    }

    public Seq<NewsletterIssueForListing> getLatestIssues(int numberOfListedIssues) {
        return query.findLatestIssues(numberOfListedIssues);
    }
}

package com.jvm_bloggers.frontend.public_area.common_layout;

import com.jvm_bloggers.domain.query.newsletter_issue_for_listing.NewsletterIssueForListing;
import com.jvm_bloggers.domain.query.newsletter_issue_for_listing.NewsletterIssueForListingQuery;

import javaslang.collection.Seq;

import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@NoArgsConstructor
public class RightFrontendSidebarBackingBean {

    private NewsletterIssueForListingQuery query;

    @Autowired
    public RightFrontendSidebarBackingBean(NewsletterIssueForListingQuery query) {
        this.query = query;
    }

    public Seq<NewsletterIssueForListing> getLatestIssues(int numberOfListedIssues) {
        return query.findLatestIssues(numberOfListedIssues);
    }
}

Add no-args constructor to avoid NPE during page de-serialization


// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.rankingexpression.integration.ml;

import com.yahoo.searchlib.rankingexpression.RankingExpression;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * @author lesters
 */
public class BatchNormImportTestCase {

    @Test
    public void testBatchNormImport() {
        TestableTensorFlowModel model = new TestableTensorFlowModel("test", "src/test/files/integration/tensorflow/batch_norm/saved");
        ImportedModel.Signature signature = model.get().signature("serving_default");

        assertEquals("Has skipped outputs",
                     0, model.get().signature("serving_default").skippedOutputs().size());

        RankingExpression output = signature.outputExpression("y");
        assertNotNull(output);
        assertEquals("dnn/batch_normalization_3/batchnorm/add_1", output.getName());
//        model.assertEqualResult("X", output.getName());

        model.assertEqualResult("X", "dnn/outputs/BiasAdd");
    }

}

// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.rankingexpression.integration.ml;

import com.yahoo.searchlib.rankingexpression.RankingExpression;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
 * @author lesters
 */
public class BatchNormImportTestCase {

    @Test
    public void testBatchNormImport() {
        TestableTensorFlowModel model = new TestableTensorFlowModel("test", "src/test/files/integration/tensorflow/batch_norm/saved");
        ImportedModel.Signature signature = model.get().signature("serving_default");

        assertEquals("Has skipped outputs",
                     0, model.get().signature("serving_default").skippedOutputs().size());

        RankingExpression output = signature.outputExpression("y");
        assertNotNull(output);
        assertEquals("dnn/batch_normalization_3/batchnorm/add_1", output.getName());
        model.assertEqualResult("X", output.getName());
    }

}

Test correct output in batch norm case

Test correct output in batch norm case


// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.noderepository;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Wire class for node-repository representation of the history of a node
 *
 * @author smorgrav
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NodeHistory {
    @JsonProperty("at")
    public Long at;
    @JsonProperty("agent")
    public Agent agent;
    @JsonProperty("event")
    public String event;

    public Long getAt() {
        return at;
    }

    public Agent getAgent() {
        return agent;
    }

    public String getEvent() {
        return event;
    }

    public enum Agent {
        operator,
        application,
        system,
        DirtyExpirer,
        DynamicProvisioningMaintainer,
        FailedExpirer,
        InactiveExpirer,
        NodeFailer,
        ProvisionedExpirer,
        Rebalancer,
        ReservationExpirer,
        RetiringUpgrader,
        SpareCapacityMaintainer
    }

}

// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.api.integration.noderepository;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Wire class for node-repository representation of the history of a node
 *
 * @author smorgrav
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class NodeHistory {
    @JsonProperty("at")
    public Long at;
    @JsonProperty("agent")
    public Agent agent;
    @JsonProperty("event")
    public String event;

    public Long getAt() {
        return at;
    }

    public Agent getAgent() {
        return agent;
    }

    public String getEvent() {
        return event;
    }

    public enum Agent {
        operator,
        application,
        system,
        DirtyExpirer,
        DynamicProvisioningMaintainer,
        FailedExpirer,
        InactiveExpirer,
        NodeFailer,
        ProvisionedExpirer,
        Rebalancer,
        ReservationExpirer,
        RetiringUpgrader,
        SpareCapacityMaintainer,
        SwitchRebalancer,
    }

}

Add agent to wire class

Add agent to wire class


package com.jmonad.seq;

import org.junit.Test;

public class SeqTakeTest {

  private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  private Seq<Integer> elements = new Seq<Integer>(numbers);

  @Test public void takeListElementsTest() {
    assert elements.take(5).toArrayList().toString().equals("[1, 2, 3, 4, 5]");
  }

  @Test public void takeElementsWithNoAmountTest() {
    assert elements.take(0).toArrayList().toString().equals("[]");
  }

  @Test public void takeElementsWithNegativeAmountTest() {
    assert elements.take(-1).toArrayList().toString().equals("[]");
  }

  @Test public void takeElementsWithAmountHigherThanListSizeTest() {
    assert elements.take(20).toArrayList().toString().equals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
  }
}

package com.jmonad.seq;

import org.junit.Test;

public class SeqTakeTest {

  private Integer[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  private Seq<Integer> elements = new Seq<>(numbers);

  @Test public void takeListElementsTest() {
    assert elements.take(5).toArrayList().toString().equals("[1, 2, 3, 4, 5]");
  }

  @Test public void takeElementsWithNoAmountTest() {
    assert elements.take(0).toArrayList().toString().equals("[]");
  }

  @Test public void takeElementsWithNegativeAmountTest() {
    assert elements.take(-1).toArrayList().toString().equals("[]");
  }

  @Test public void takeElementsWithAmountHigherThanListSizeTest() {
    assert elements.take(20).toArrayList().toString().equals("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]");
  }
}

Initialize seq without type in take test class


package drive.change.model;

/**
 * JDrive
 * Created by David Maignan <davidmaignan@gmail.com> on 15-08-21.
 */
public enum ChangeTypes {
    DELETE, MOVE, VERSION, NULL, FILE_UPDATE, FOLDER_UPDATE, DOCUMENT, TRASHED;
}

package drive.change.model;

/**
 * JDrive
 * Created by David Maignan <davidmaignan@gmail.com> on 15-08-21.
 */
public enum ChangeTypes {
    DELETE, MOVE, VERSION, NULL, FILE_UPDATE, FOLDER_UPDATE,
    DOCUMENT, TRASHED, NEW_FILE, NEW_FOLDER, UNTRASHED;
}

Add new change types: NEW_FILE, NEW_FOLDER, UNTRASHED


package gov.samhsa.c2s.c2suiapi.service;

import com.netflix.hystrix.exception.HystrixRuntimeException;
import feign.FeignException;
import gov.samhsa.c2s.c2suiapi.infrastructure.PhrClient;
import gov.samhsa.c2s.c2suiapi.service.exception.NoDocumentsFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhrServiceImpl implements PhrService{

    private final PhrClient phrClient;

    @Autowired
    public PhrServiceImpl(PhrClient phrClient) {
        this.phrClient = phrClient;
    }

    @Override
    public List<Object> getAllDocumentTypeCodesList(){
        return phrClient.getAllDocumentTypeCodesList();
    }

    @Override
    public List<Object> getPatientDocumentInfoList(String patientMrn){
        try{
            return phrClient.getPatientDocumentInfoList(patientMrn);
        }catch(HystrixRuntimeException err) {
            Throwable t = err.getCause();
            if(t instanceof FeignException && ((FeignException) t).status() == 404){
                throw new NoDocumentsFoundException(t.getMessage());
            }
        }
        return null;
    }

}

package gov.samhsa.c2s.c2suiapi.service;

import com.netflix.hystrix.exception.HystrixRuntimeException;
import feign.FeignException;
import gov.samhsa.c2s.c2suiapi.infrastructure.PhrClient;
import gov.samhsa.c2s.c2suiapi.service.exception.NoDocumentsFoundException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhrServiceImpl implements PhrService{

    private final PhrClient phrClient;

    @Autowired
    public PhrServiceImpl(PhrClient phrClient) {
        this.phrClient = phrClient;
    }

    @Override
    public List<Object> getAllDocumentTypeCodesList(){
        return phrClient.getAllDocumentTypeCodesList();
    }

    @Override
    public List<Object> getPatientDocumentInfoList(String patientMrn){
        List<Object> uploadedDocuments = null;
        try{
            uploadedDocuments = phrClient.getPatientDocumentInfoList(patientMrn);
        }catch(HystrixRuntimeException err) {
            Throwable t = err.getCause();
            if(t instanceof FeignException && ((FeignException) t).status() == 404){
                throw new NoDocumentsFoundException(t.getMessage());
            }
        }
        return uploadedDocuments;
    }

}

Split into declaration and assignment

Split into declaration and assignment

#13763:As a developer, I will have implemented the Try My Policy UI and integrated with backend [v3.0]


// Project Euler problem 33
public class Problem033 {
    public static void main(String[] args) {
        System.out.println();
    }
}

import java.util.ArrayList;
import java.util.HashSet;

// Project Euler problem 33
// Solved on 12/16/2016
public class Problem033 {
    public static void main(String[] args) {
        // numerator and denominator products of the valid fractions
        int nCombined = 1;
        int dCombined = 1;

        // loop through valid fractions
        for (int n = 11; n < 100; n++) {
            for (int d = n; d < 100; d++) {
                if (n % 10 == 0 || d % 10 == 0 || n == d) {
                    continue;
                }
                // create character array of the digits so they can be compared
                char[] nArray = Integer.toString(n).toCharArray();
                char[] dArray = Integer.toString(d).toCharArray();

                Check:
                // loop through digits and check for matches
                for (int i = 0; i < 2; i++) {
                    for (int j = 0; j < 2; j++) {
                        if (nArray[i] == dArray[j]) {
                            // cancel the matches and compare the fraction vale with the original value
                            int nRemaining = Character.getNumericValue(nArray[(i + 1) % 2]);
                            int dRemaining = Character.getNumericValue(dArray[(j + 1) % 2]);
                            if ((double)nRemaining / dRemaining == (double)n / d) {
                                nCombined *= n;
                                dCombined *= d;
                                break Check;
                            }
                        }
                    }
                }
            }
        }

        // use the Sieve of Eratosthenes to find primes
        HashSet<Integer> sieve = new HashSet<>();
        ArrayList<Integer> primes = new ArrayList<>();
        for (int i = 2; i <= nCombined; i++) {
            if (!sieve.contains(i)) {
                primes.add(i);
                int j = 1;
                while (i * j <= nCombined) {
                    sieve.add(i * j);
                    j++;
                }
            }
        }

        // check for primes that reduce the fraction
        for (int i = 0; i < primes.size(); i++) {
            int tempPrime = primes.get(i);
            if (nCombined % tempPrime == 0 && dCombined % tempPrime == 0) {
                nCombined /= tempPrime;
                dCombined /= tempPrime;
                i--;
            }
        }
        System.out.println(dCombined);
    }
}

Add solution to problem 33

Add solution to problem 33


package oasis.services.authn;

import javax.inject.Inject;

import oasis.model.authn.ClientType;
import oasis.model.authn.Credentials;
import oasis.model.authn.CredentialsRepository;
import oasis.services.authn.login.PasswordHasher;
import oasis.services.authn.login.SShaPasswordHasher;

public class CredentialsService {
  private final CredentialsRepository credentialsRepository;
  private final PasswordHasher passwordHasher;

  @Inject
  CredentialsService(CredentialsRepository credentialsRepository, SShaPasswordHasher passwordHasher) {
    this.credentialsRepository = credentialsRepository;
    this.passwordHasher = passwordHasher;
  }

  public void setPassword(ClientType type, String id, String password) {
    byte[] salt = passwordHasher.createSalt();
    byte[] hash = passwordHasher.hashPassword(password, salt);
    credentialsRepository.saveCredentials(type, id, hash, salt);
  }

  public boolean checkPassword(ClientType type, String id, String password) {
    Credentials credentials = credentialsRepository.getCredentials(type, id);
    if (credentials == null) {
      return false;
    }
    return passwordHasher.checkPassword(password, credentials.getHash(), credentials.getSalt());
  }
}

package oasis.services.authn;

import javax.inject.Inject;

import oasis.model.authn.ClientType;
import oasis.model.authn.Credentials;
import oasis.model.authn.CredentialsRepository;
import oasis.services.authn.login.PasswordHasher;
import oasis.services.authn.login.SCryptPasswordHasher;

public class CredentialsService {
  private final CredentialsRepository credentialsRepository;
  private final PasswordHasher passwordHasher;

  @Inject
  CredentialsService(CredentialsRepository credentialsRepository, SCryptPasswordHasher passwordHasher) {
    this.credentialsRepository = credentialsRepository;
    this.passwordHasher = passwordHasher;
  }

  public void setPassword(ClientType type, String id, String password) {
    byte[] salt = passwordHasher.createSalt();
    byte[] hash = passwordHasher.hashPassword(password, salt);
    credentialsRepository.saveCredentials(type, id, hash, salt);
  }

  public boolean checkPassword(ClientType type, String id, String password) {
    Credentials credentials = credentialsRepository.getCredentials(type, id);
    if (credentials == null) {
      return false;
    }
    return passwordHasher.checkPassword(password, credentials.getHash(), credentials.getSalt());
  }
}

Fix : Use SCryptPasswordHaser instead of SShaPasswordHasher

Change-Id: I03faaf863d0034a45dde318b877c02e7e4acb00a


package eu.programit;

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

import eu.programit.domain.Person;
import eu.programit.domain.Raymond;
import eu.programit.domain.Rik;
import eu.programit.domain.Jeffrey;

public class Main {

	public static void main(String[] args) {

		List<Person> people = new ArrayList<>();

		// feature 1.  add your person class

		Person raymond = new Raymond();
		Person jeffrey = new Jeffrey();
		Person rik = new Rik();
		Person remond = new Remond();

		// feature 2. add your own Person here
		people.add(raymond);
		people.add(jeffrey);
		people.add(rik);
		people.add(remond);

		for (Person p : people) {
			System.out.println("Person with firstName " + p.getFirstName() + " has hobbies " + p.getHobbies());
		}
	}

	// feature 3. somebody (who?) whould make this jar runnable with this main class

}

package eu.programit;

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

import eu.programit.domain.Person;
import eu.programit.domain.Raymond;
import eu.programit.domain.Rik;
import eu.programit.domain.Jeffrey;

public class Main {

	public static void main(String[] args) {

		List<Person> people = new ArrayList<>();

		// feature 1.  add your person class

		Person raymond = new Raymond();
		Person jeffrey = new Jeffrey();
		Person rik = new Rik();
//		Person remond = new Remond();

		// feature 2. add your own Person here
		people.add(raymond);
		people.add(jeffrey);
		people.add(rik);
//		people.add(remond);

		for (Person p : people) {
			System.out.println("Person with firstName " + p.getFirstName() + " has hobbies " + p.getHobbies());
		}
	}

	// feature 3. somebody (who?) whould make this jar runnable with this main class

}

Fix compile errors in main

Fix compile errors in main