package objective.taskboard.it;

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

import org.junit.Before;

public abstract class AuthenticatedIntegrationTest extends AbstractUIWithCoverageIntegrationTest {

    @Before
    public final void doLogin() {
        LoginPage loginPage = LoginPage.to(webDriver);
        loginPage.login("foo", "bar");

        MainPage mainPage = MainPage.produce(webDriver);
        mainPage.waitUserLabelToBe("Foo");
        mainPage.lane("Demand").boardStep("Open").assertIssueList("TASKB-20");
    }
}

package objective.taskboard.it;

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

import org.junit.Before;

public abstract class AuthenticatedIntegrationTest extends AbstractUIWithCoverageIntegrationTest {

    @Before
    public final void doLogin() {
        LoginPage loginPage = LoginPage.to(webDriver);
        loginPage.login("foo", "bar");

        MainPage mainPage = MainPage.produce(webDriver);
        mainPage.waitUserLabelToBe("Foo");
        mainPage.lane("Operational")
        	.boardStep("Done")
        	.assertIssueList(
        			"TASKB-638",
        			"TASKB-656",
        			"TASKB-657",
        			"TASKB-658",
        			"TASKB-660",
        			"TASKB-662",
        			"TASKB-678",
        			"TASKB-679");
    }
}

[TOOLS-1091] Fix tests intermittent due to board render not ready


package com.github.hisaichi5518.kise;

import android.support.annotation.NonNull;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.remoteconfig.FirebaseRemoteConfig;

public abstract class Unit<ActionParam> implements UnitActions<ActionParam> {
    private long cacheExpiration = 43200L; // 12 hours

    public void invoke(final ActionParam actionParam) {
        final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
        config.fetch(cacheExpiration)
                .addOnSuccessListener(new OnSuccessListener<Void>() {
                    @Override
                    public void onSuccess(Void aVoid) {
                        config.activateFetched();
                    }
                })
                .addOnFailureListener(new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception e) {
                        // Ignore Exception
                    }
                })
                .addOnCompleteListener(new OnCompleteListener<Void>() {
                    @Override
                    public void onComplete(@NonNull Task<Void> task) {
                        if (config.getBoolean(key())) {
                            try {
                                customAction(actionParam);
                            } catch (Exception e) {
                                defaultAction(actionParam);
                            }
                        } else {
                            defaultAction(actionParam);
                        }
                    }
                });

        // TODO: Callback methods does not execute if Google play service is out date.
    }

    private String key() {
        return this.getClass().getSimpleName();
    }
}

package com.github.hisaichi5518.kise;

import com.google.firebase.remoteconfig.FirebaseRemoteConfig;

public abstract class Unit<ActionParam> implements UnitActions<ActionParam> {

    public void invoke(final ActionParam actionParam) {
        final FirebaseRemoteConfig config = FirebaseRemoteConfig.getInstance();
        if (config.getBoolean(key())) {
            try {
                customAction(actionParam);
            } catch (Exception e) {
                defaultAction(actionParam);
            }
        } else {
            defaultAction(actionParam);
        }
        // TODO: Callback methods does not execute if Google play service is out date.
    }

    private String key() {
        return this.getClass().getSimpleName();
    }
}

Remove fetch logic from invoke method.

Remove fetch logic from invoke method.


package me.tdjones.main.model;

/**
 * Created by Tyler on 6/30/2016.
 */
public class Feed {
}

package me.tdjones.main.model;

import com.sun.xml.internal.txw2.annotation.XmlNamespace;
import me.tdjones.main.Main;

import javax.xml.bind.annotation.*;
import java.net.URL;
import java.util.List;

/**
 * Created by Tyler on 6/30/2016.
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class Feed {
    @XmlElement(name = "title")
    private String title;
    @XmlElement(name = "link")
    private String link;
    @XmlElement(name = "description")
    private String description;
    @XmlElement(name = "language")
    private String language;
    @XmlElement(name = "pubDate")
    private String pubDate;
    @XmlElement(namespace = Main.itunesNamespace, name = "author")
    private String author;
    @XmlElement(namespace = Main.itunesNamespace, name = "category")
    private List<String> categories;
    @XmlAttribute(namespace = Main.itunesNamespace, name = "href")
    private String thumbnail;
    @XmlElement(name = "item")
    private List<Episode> episodeList;

    public String getThumbnail(){
        return thumbnail;
    }

    public String getTitle(){
        return title;
    }
}

Add jaxb support to feed model

Add jaxb support to feed model


package com.matt.forgehax.mods.services;

import com.matt.forgehax.events.LocalPlayerUpdateEvent;
import com.matt.forgehax.util.mod.ServiceMod;
import com.matt.forgehax.util.mod.loader.RegisterMod;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

/** Created on 6/14/2017 by fr1kin */
@RegisterMod
public class LocalPlayerUpdateEventService extends ServiceMod {
  public LocalPlayerUpdateEventService() {
    super("LocalPlayerUpdateEventService");
  }

  @SubscribeEvent
  public void onUpdate(LivingEvent.LivingUpdateEvent event) {
    if (MC.world != null && event.getEntityLiving().equals(MC.player)) {
      Event ev = new LocalPlayerUpdateEvent(event.getEntityLiving());
      MinecraftForge.EVENT_BUS.post(ev);
      event.setCanceled(ev.isCanceled());
    }
  }
}

package com.matt.forgehax.mods.services;

import static com.matt.forgehax.Helper.getLocalPlayer;
import static com.matt.forgehax.Helper.getWorld;

import com.matt.forgehax.events.LocalPlayerUpdateEvent;
import com.matt.forgehax.util.mod.ServiceMod;
import com.matt.forgehax.util.mod.loader.RegisterMod;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

/** Created on 6/14/2017 by fr1kin */
@RegisterMod
public class LocalPlayerUpdateEventService extends ServiceMod {
  public LocalPlayerUpdateEventService() {
    super("LocalPlayerUpdateEventService");
  }

  @SubscribeEvent
  public void onUpdate(LivingEvent.LivingUpdateEvent event) {
    if (getWorld() != null
        && !getWorld().isRemote
        && event.getEntityLiving().equals(getLocalPlayer())) {
      Event ev = new LocalPlayerUpdateEvent(event.getEntityLiving());
      MinecraftForge.EVENT_BUS.post(ev);
      event.setCanceled(ev.isCanceled());
    }
  }
}

Check if world is remote so event isn't fired for single player entity tick


/*
 * Copyright (C) 2016 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.api.tools.framework.aspects.control.model;

/**
 * Public constants and util methods related to ControlConfigAspect.
 */
public class ControlConfigUtil {

  public static final String ENDPOINTS_SERVICE_CONTROL =
      "endpoints-servicecontrol.sandbox.googleapis.com";

}

/*
 * Copyright (C) 2016 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.api.tools.framework.aspects.control.model;

/**
 * Public constants and utility methods related to ControlConfigAspect.
 */
public class ControlConfigUtil {

  public static final String ENDPOINTS_SERVICE_CONTROL =
      "endpoints-servicecontrol.sandbox.googleapis.com";

}

Add whitelist mechanism in tools for allowing use of UsageManager as control environment with config_version 3 and above.

Also added validation to ensure if usage manager, use monarch feature is not set.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126238038


package com.simperium.test;

import com.simperium.client.AuthException;
import com.simperium.client.AuthResponseListener;
import com.simperium.client.User;

public class MockAuthResponseListener implements AuthResponseListener {
    public AuthException exception;
    public User user;
    public boolean success = false, failure = false;

    @Override
    public void onSuccess(User user, String userId, String token){
        success = true;
        this.user = user;
    }

    @Override
    public void onFailure(User user, AuthException exception){
        failure = true;
        this.user = user;
        this.exception = exception;
    }
}

package com.simperium.test;

import com.simperium.client.AuthException;
import com.simperium.client.AuthProvider;
import com.simperium.client.AuthResponseListener;
import com.simperium.client.User;

public class MockAuthResponseListener implements AuthResponseListener {
    public AuthException exception;
    public User user;
    public boolean success = false, failure = false;

    @Override
    public void onSuccess(User user, String userId, String token, AuthProvider provider){
        success = true;
        this.user = user;
    }

    @Override
    public void onFailure(User user, AuthException exception){
        failure = true;
        this.user = user;
        this.exception = exception;
    }
}

Add auth provider parameter to on success callback in mock auth response listener


package com.elmakers.mine.bukkit.api.action;

import com.elmakers.mine.bukkit.api.spell.Spell;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Collection;

public interface SpellAction
{
    public void load(Spell spell, ConfigurationSection parameters);
    public ConfigurationSection getParameters(ConfigurationSection baseParameters);
    public void getParameterNames(Collection<String> parameters);
    public boolean usesBrush();
    public boolean isUndoable();
}

package com.elmakers.mine.bukkit.api.action;

import com.elmakers.mine.bukkit.api.spell.Spell;
import org.bukkit.configuration.ConfigurationSection;

import java.util.Collection;

public interface SpellAction
{
    public void load(Spell spell, ConfigurationSection parameters);
    public ConfigurationSection getParameters(ConfigurationSection baseParameters);
    public void getParameterNames(Collection<String> parameters);
    public void getParameterOptions(Collection<String> examples, String parameterKey);
    public boolean usesBrush();
    public boolean isUndoable();
}

Add parameter value suggestion to ActionSpell tab-completion


package reborncore.common.powerSystem;

import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.tesla.TeslaManager;

public class PowerSystem
{
	public static String getLocaliszedPower(double eu)
	{
		return getLocaliszedPower((int) eu);
	}

	public static String getLocaliszedPower(int eu)
	{
		if (RebornCoreConfig.getRebornPower().eu())
		{
			return getRoundedString(eu, "EU");
		} else if (TeslaManager.isTeslaEnabled())
		{
			return TeslaManager.manager.getDisplayableTeslaCount(eu);
		}else
		{
			return getRoundedString(eu / RebornCoreConfig.euPerRF, "RF");
		}
	}

	private static String getRoundedString(double euValue, String units)
	{
		if (euValue >= 1000000)
		{
			double tenX = Math.round(euValue / 100000);
			return Double.toString(tenX / 10.0).concat(" m " + units);
		} else if (euValue >= 1000)
		{
			double tenX = Math.round(euValue / 100);
			return Double.toString(tenX / 10.0).concat(" k " + units);
		} else
		{
			return Double.toString(Math.floor(euValue)).concat(" " + units);
		}
	}

}

package reborncore.common.powerSystem;

import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.tesla.TeslaManager;

public class PowerSystem
{
	public static String getLocaliszedPower(double eu)
	{
		return getLocaliszedPower((int) eu);
	}

	public static String getLocaliszedPower(int eu)
	{
		if (RebornCoreConfig.getRebornPower().eu())
		{
			return getRoundedString(eu, "EU");
		} else if (TeslaManager.isTeslaEnabled(RebornCoreConfig.getRebornPower()))
		{
			return TeslaManager.manager.getDisplayableTeslaCount(eu);
		}else
		{
			return getRoundedString(eu / RebornCoreConfig.euPerRF, "RF");
		}
	}

	private static String getRoundedString(double euValue, String units)
	{
		if (euValue >= 1000000)
		{
			double tenX = Math.round(euValue / 100000);
			return Double.toString(tenX / 10.0).concat(" m " + units);
		} else if (euValue >= 1000)
		{
			double tenX = Math.round(euValue / 100);
			return Double.toString(tenX / 10.0).concat(" k " + units);
		} else
		{
			return Double.toString(Math.floor(euValue)).concat(" " + units);
		}
	}

}

Fix build from github web

Fix build from github web


package pl.mg6.testsupport;

import junit.framework.TestCase;

import java.util.List;

import pl.mg6.testsupport.data.Simple;
import pl.mg6.testsupport.factory.SimpleFactory;

public class FactoryReparcelerTestCase extends TestCase {

    private final FactoryReparceler reparceler = new FactoryReparceler();

    public void testSimpleParcelableShouldBeEqual() {
        List<ReparcelingResult<Simple>> resultList = reparceler.reparcel(SimpleFactory.class, Simple.class);
        for (ReparcelingResult<Simple> result : resultList) {
            assertNotNull(result.getOriginal());
            assertNotNull(result.getReparceled());
            assertNotSame(result.getOriginal(), result.getReparceled());
            assertTrue(result.areEqual());
            assertNull(result.getError());
        }
    }
}

package pl.mg6.testsupport;

import junit.framework.TestCase;

import java.util.List;

import pl.mg6.testsupport.data.Simple;
import pl.mg6.testsupport.factory.SimpleFactory;

public class FactoryReparcelerTestCase extends TestCase {

    private final FactoryReparceler reparceler = new FactoryReparceler();

    public void testSimpleParcelableShouldBeEqual() {
        List<ReparcelingResult<Simple>> resultList = reparceler.reparcel(SimpleFactory.class, Simple.class);
        for (ReparcelingResult<Simple> result : resultList) {
            assertNotNull(result.getOriginal());
            assertNotNull(result.getReparceled());
            assertNotSame(result.getOriginal(), result.getReparceled());
            assertTrue(result.areEqual());
            assertNull(result.getError());
        }
    }

    public void testFactoryReparcelerShouldFindAllMethods() {
        List<ReparcelingResult<Simple>> resultList = reparceler.reparcel(SimpleFactory.class, Simple.class);
        assertEquals(3, resultList.size());
        assertEquals("withZero", resultList.get(2).getMethodName());
        assertEquals("withPerfectNumber", resultList.get(1).getMethodName());
        assertEquals("withMaxValue", resultList.get(0).getMethodName());
    }
}

Test all methods are found by factory reparceler.


/**
 * @file TreeStory.java
 * @author Valery Samovich
 * @version 1
 * @date 2015/05/11
 */

package com.samovich.basics.concepts.strings.treehouse;

import java.io.Console;
import java.util.Scanner;

public class TreeStory {

    public static void main(String[] args) {

        // Console console = System.console();
        // String name = console.readLine("Enter your name: ");
        // String adjective = console.readLine("Enter an adjective: ");
        // console.printf("%s is very %s", name, adjective);

        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter your name: ");
        String name = scanner.nextLine();
        System.out.println("Enter an adjective: ");
        String adjective = scanner.nextLine();
        System.out.println(name + " is very " + adjective + "!");

        // __Name is a __adjective__ __noun__.
        // They are always __adverb__ __verb__.
        String name = console.readLine("Enter a name:  ");
        String adjective = console.readLine("Enter an adjective:  ");
        String noun = console.readLine("Enter a noun:  ");
        String adverb = console.readLine("Enter an adverb:  ");
        String verb = console.readLine("Enter a verb ending with -ing:  ");
        console.printf("Your TreeStory:\n----------------\n");
        console.printf("%s is a $s %s", name, adjective, noun);
        conosle.printf("They are always")
    }
}

/**
 * @file TreeStory.java
 * @author Valery Samovich
 * @version 1
 * @date 2015/05/11
 */

package com.samovich.basics.concepts.strings.treehouse;

import java.io.Console;
import java.util.Scanner;

public class TreeStory {

    public static void main(String[] args) {

        // Console console = System.console();
        // __Name is a __adjective__ __noun__.
        // They are always __adverb__ __verb__.
        String name = console.readLine("Enter a name:  ");
        String adjective = console.readLine("Enter an adjective:  ");
        String noun = console.readLine("Enter a noun:  ");
        String adverb = console.readLine("Enter an adverb:  ");
        String verb = console.readLine("Enter a verb ending with -ing:  ");
        console.printf("Your TreeStory:\n----------------\n");
        console.printf("%s is a $s %s. ", name, adjective, noun);
        console.printf("They are always %s %s.\n", adverb, verb);

        Scanner scanner = new Scanner(System.in);
        System.out.println("Enter your name: ");
        String name = scanner.nextLine();
        System.out.println("Enter an adjective: ");
        String adjective = scanner.nextLine();
        System.out.println(name + " is very " + adjective + "!");

    }
}

Update Multiple Strings Example for Console and Scanner prototype


package jp.ac.nii.prl.mape.plan.service;

import java.util.Optional;

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

import jp.ac.nii.prl.mape.plan.model.Adaptation;
import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

public class AdaptationServiceImpl implements AdaptationService {

	@Autowired
	private AdaptationRepository adaptationRepository;

	@Override
	public Adaptation save(Adaptation adaptation) {
		return adaptationRepository.save(adaptation);
	}

	@Override
	public Optional<Adaptation> findByDeploymentId(Integer deploymentId) {
		return adaptationRepository.findByDeploymentId(deploymentId);
	}

}

package jp.ac.nii.prl.mape.plan.service;

import java.util.Optional;

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

import jp.ac.nii.prl.mape.plan.model.Adaptation;
import jp.ac.nii.prl.mape.plan.repository.AdaptationRepository;

@Service("adaptationService")
public class AdaptationServiceImpl implements AdaptationService {

	@Autowired
	private AdaptationRepository adaptationRepository;

	@Override
	public Adaptation save(Adaptation adaptation) {
		return adaptationRepository.save(adaptation);
	}

	@Override
	public Optional<Adaptation> findByDeploymentId(Integer deploymentId) {
		return adaptationRepository.findByDeploymentId(deploymentId);
	}

}

Fix adaptation service Bean issue

Fix adaptation service Bean issue


package org.perl6.nqp.sixmodel.reprs;

import java.lang.System;

import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.ThreadContext;
import org.perl6.nqp.sixmodel.SixModelObject;

public class VMArrayInstanceBase extends SixModelObject {
    public long[] dimensions(ThreadContext tc) {
        return new long[] { this.elems(tc) };
    }

    public void set_dimensions(ThreadContext tc, long[] dims) {
        if (dims.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only have a single dimension");
        this.set_elems(tc, dims[0]);
    }
}

package org.perl6.nqp.sixmodel.reprs;

import java.lang.System;

import org.perl6.nqp.runtime.ExceptionHandling;
import org.perl6.nqp.runtime.ThreadContext;
import org.perl6.nqp.sixmodel.SixModelObject;

public class VMArrayInstanceBase extends SixModelObject {
    public long[] dimensions(ThreadContext tc) {
        return new long[] { this.elems(tc) };
    }

    public void set_dimensions(ThreadContext tc, long[] dims) {
        if (dims.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only have a single dimension");
        this.set_elems(tc, dims[0]);
    }

    public SixModelObject at_pos_multidim_boxed(ThreadContext tc, long[] indices) {
        if (indices.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only be indexed with a single dimension");
        return this.at_pos_boxed(tc, indices[0]);
    }

    public void at_pos_multidim_native(ThreadContext tc, long[] indices) {
        if (indices.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only be indexed with a single dimension");
        this.at_pos_native(tc, indices[0]);
    }

    public void bind_pos_multidim_boxed(ThreadContext tc, long[] indices, SixModelObject value) {
        if (indices.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only be indexed with a single dimension");
        this.bind_pos_boxed(tc, indices[0], value);
    }

    public void bind_pos_multidim_native(ThreadContext tc, long[] indices) {
        if (indices.length != 1)
            throw ExceptionHandling.dieInternal(tc, "A dynamic array can only be indexed with a single dimension");
        this.bind_pos_native(tc, indices[0]);
    }
}

Implement multi-dim access funcs in VMArray.


package com.arondor.common.reflection.bean.java;

import java.util.List;

import com.arondor.common.reflection.model.java.AccessibleConstructor;

public class AccessibleConstructorBean implements AccessibleConstructor
{

    /**
     *
     */
    private static final long serialVersionUID = -3238305306015874730L;

    private List<String> argumentTypes;

    public List<String> getArgumentTypes()
    {
        return argumentTypes;
    }

    public void setArgumentTypes(List<String> argumentTypes)
    {
        this.argumentTypes = argumentTypes;
    }

}

package com.arondor.common.reflection.bean.java;

import java.util.List;

import com.arondor.common.reflection.model.java.AccessibleConstructor;

public class AccessibleConstructorBean implements AccessibleConstructor
{

    /**
     *
     */
    private static final long serialVersionUID = -3238305306015874730L;

    public AccessibleConstructorBean()
    {

    }

    private List<String> argumentTypes;

    public List<String> getArgumentTypes()
    {
        return argumentTypes;
    }

    public void setArgumentTypes(List<String> argumentTypes)
    {
        this.argumentTypes = argumentTypes;
    }

}

Add empty constructor for GWT

Add empty constructor for GWT

git-svn-id: 7e8def7d4256e953abb468098d8cb9b4faff0c63@5826 12255794-1b5b-4525-b599-b0510597569d


package net.zero918nobita.smilepp.frontend;

public class AssignStm extends Stm {
  private Variable variable;
  private Expression expression;

  public AssignStm(Variable variable, Expression expression) {
    this.variable = variable;
    this.expression = expression;
  }

  public String toString() {
    return variable + " = " + expression;
  }
}

package net.zero918nobita.smilepp.frontend;

public class AssignStm extends Stm {
  private Variable variable;
  private Expression expression;

  public AssignStm() {}

  public AssignStm(Variable variable, Expression expression) {
    this.variable = variable;
    this.expression = expression;
  }

  public void setVariable(Variable variable) {
    this.variable = variable;
  }

  public void setExpression(Expression expression) {
    this.expression = expression;
  }

  public String toString() {
    return variable + " = " + expression;
  }
}

Add setVariable & setExpression method

Add setVariable & setExpression method


package com.freshplanet.ane.AirAACPlayer.functions;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.freshplanet.ane.AirAACPlayer.Extension;
import com.freshplanet.ane.AirAACPlayer.ExtensionContext;

public class CloseFunction implements FREFunction
{

    @Override
    public FREObject call(FREContext context, FREObject[] arg1)
    {
        try
        {
            ExtensionContext extensionContext = (ExtensionContext) context;

            extensionContext.getPlayer().stop();
            extensionContext.getPlayer().release();
            extensionContext.setPlayer(null);
        }
        catch (Exception e)
        {
            Extension.context.dispatchStatusEventAsync("LOGGING", "[Error] Error on close");
            e.printStackTrace();
        }

        return null;
    }

}

package com.freshplanet.ane.AirAACPlayer.functions;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREObject;
import com.freshplanet.ane.AirAACPlayer.Extension;
import com.freshplanet.ane.AirAACPlayer.ExtensionContext;

public class CloseFunction implements FREFunction
{

    @Override
    public FREObject call(FREContext context, FREObject[] arg1)
    {
        try
        {
            ExtensionContext extensionContext = (ExtensionContext) context;

            extensionContext.getPlayer().stop();
            extensionContext.getPlayer().release();
            extensionContext.setMediaUrl(null);
            extensionContext.setPlayer(null);
        }
        catch (Exception e)
        {
            Extension.context.dispatchStatusEventAsync("LOGGING", "[Error] Error on close");
            e.printStackTrace();
        }

        return null;
    }

}

Set URL to null on close

Set URL to null on close


package net.safedata.springboot.training.d01.s03.service;

import net.safedata.springboot.training.d01.s03.repository.ProductRepository;

import java.util.Optional;

/**
 * A simple product service, which uses a {@link ProductRepository} as a collaborator
 *
 * @author bogdan.solga
 */
public class ProductService {

    private final ProductRepository productRepository;
    private final String identifier;

    public ProductService(final ProductRepository productRepository, final String identifier) {
        this.productRepository = productRepository; this.identifier = identifier;
    }

    public void displayProducts() {
        System.out.println("Using the '" + identifier + "' service");
        Optional.ofNullable(productRepository).ifPresent(ProductRepository::displayProducts);
    }
}

package net.safedata.springboot.training.d01.s03.service;

import net.safedata.springboot.training.d01.s03.repository.ProductRepository;

import java.util.Optional;

/**
 * A simple product service, which uses a {@link ProductRepository} as a collaborator
 *
 * @author bogdan.solga
 */
public class ProductService {

    private final ProductRepository productRepository;
    private final String identifier;

    public ProductService(final ProductRepository productRepository, final String identifier) {
        this.productRepository = productRepository; this.identifier = identifier;
    }

    public void displayProducts() {
        System.out.println("Using the '" + identifier + "' service");
        Optional.ofNullable(productRepository)
                .ifPresent(ProductRepository::displayProducts);
    }
}

Split the Optional call on a new line

[improve] Split the Optional call on a new line


package com.vinnypalumbo.popularmovies;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

/**
 * Created by Vincent on 2015-11-19.
 */
public class ReviewAdapter extends ArrayAdapter<Review> {

    public ReviewAdapter(Activity context, List<Review> reviews){
        super(context, 0, reviews);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        Review review = getItem(position);
        View rootView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_review, parent, false);

        TextView authorView = (TextView) rootView.findViewById(R.id.list_item_review_author);
        String formattedAuthor = String.format(getContext().getString(R.string.format_author),review.author);
        authorView.setText(formattedAuthor);

        TextView contentView = (TextView) rootView.findViewById(R.id.list_item_review_content);
        contentView.setText(review.content);

        return rootView;
    }

}

package com.vinnypalumbo.popularmovies;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

/**
 * Created by Vincent on 2015-11-19.
 */
public class ReviewAdapter extends ArrayAdapter<Review> {

    public ReviewAdapter(Activity context, List<Review> reviews){
        super(context, 0, reviews);
    }

    @Override
    public boolean isEnabled(int position) {
        return false;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent){
        Review review = getItem(position);
        View rootView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_review, parent, false);

        TextView authorView = (TextView) rootView.findViewById(R.id.list_item_review_author);
        String formattedAuthor = String.format(getContext().getString(R.string.format_author),review.author);
        authorView.setText(formattedAuthor);

        TextView contentView = (TextView) rootView.findViewById(R.id.list_item_review_content);
        contentView.setText(review.content);

        return rootView;
    }

}

Disable clicks on the Reviews ListView

Disable clicks on the Reviews ListView


/**
 *
 */
/**
 * @author roart
 *
 */
module mldao {
    exports roart.ml.dao;

    requires common.config;
    requires ml.common;
    requires ml.spark;
    requires ml.tensorflow;
    requires pipeline.model;
    requires slf4j.api;
    requires org.apache.commons.lang3;
}

/**
 *
 */
/**
 * @author roart
 *
 */
module mldao {
    exports roart.ml.dao;

    requires common.config;
    requires ml.common;
    requires ml.spark;
    requires ml.tensorflow;
    requires pipeline.model;
    requires slf4j.api;
    requires org.apache.commons.lang3;
    requires ml.pytorch;
    requires ml.gem;
}

Add pytorch (I99). Neural net continual learning (I100).


package com.ca.apm.swat.epaplugins.asm.har;

import org.json.Cookie;

public interface Response {
    public int getStatus();
    public String getStatusText();
    public String getHttpVersion();
    @IterableClass(type = Cookie.class)
    public Iterable<Cookie> getCookies();
    @IterableClass(type = Header.class)
    public Iterable<Header> getHeaders();
    public Content getContent();
    public String getRedirectURL();
    public int getHeadersSize();
    public int getBodySize();
    @OptionalItem
    public String getComment();
}

package com.ca.apm.swat.epaplugins.asm.har;

public interface Response {
    public int getStatus();
    public String getStatusText();
    public String getHttpVersion();
    @IterableClass(type = Cookie.class)
    public Iterable<Cookie> getCookies();
    @IterableClass(type = Header.class)
    public Iterable<Header> getHeaders();
    public Content getContent();
    public String getRedirectURL();
    public int getHeadersSize();
    public int getBodySize();
    @OptionalItem
    public String getComment();
}

Remove Cookie import to use Cookie from this package


/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.benchmarks;

public class ImmutableProvidedOtherClassIsImmutable {

	public final ThisHasToBeImmutable assigned;

	public ImmutableProvidedOtherClassIsImmutable(ThisHasToBeImmutable assigned) {
		this.assigned = assigned;
	}

	public static interface ThisHasToBeImmutable { }
}

/*
 * Mutability Detector
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * Further licensing information for this project can be found in
 * 		license/LICENSE.txt
 */

package org.mutabilitydetector.benchmarks;

public final class ImmutableProvidedOtherClassIsImmutable {

	public final ThisHasToBeImmutable assigned;

	public ImmutableProvidedOtherClassIsImmutable(ThisHasToBeImmutable assigned) {
		this.assigned = assigned;
	}

	public static interface ThisHasToBeImmutable { }
}

Make class final to pass a certain check.

git-svn-id: ed609ce04ec9e3c0bc25e071e87814dd6d976548@187 c7a0535c-eda6-11de-83d8-6d5adf01d787