package som.langserv.som;

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

import trufflesom.compiler.Lexer;

public class SomLexer extends Lexer {
  private List<Integer> commentTokens = new ArrayList<Integer>();

  protected SomLexer(final String content) {
    super(content);
  }

  @Override
  protected void skipComment() {
    if (currentChar() == '"') {
      int length = 0;
      int col = state.ptr - state.lastLineEnd;
      do {
        length++;
        if (currentChar() == '\n') {
          addCoordsToTokens(state.lineNumber - 1, 0, length);
          state.lineNumber += 1;
          state.lastLineEnd = state.ptr;
          length = 0;
        }
        state.incPtr();
      } while (currentChar() != '"');
      addCoordsToTokens(state.lineNumber - 1, col - 1, length + 1);
      state.incPtr();
    }
  }

  private void addCoordsToTokens(final int line, final int col, final int length) {
    commentTokens.add(line);
    commentTokens.add(col);
    commentTokens.add(length);
    commentTokens.add(5);
    commentTokens.add(0);
  }

  public List<Integer> getCommentsPositions() {
    return commentTokens;
  }
}

package som.langserv.som;

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

import som.langserv.SemanticTokenType;
import trufflesom.compiler.Lexer;

public class SomLexer extends Lexer {
  private List<Integer> commentTokens = new ArrayList<Integer>();

  protected SomLexer(final String content) {
    super(content);
  }

  @Override
  protected void skipComment() {
    if (currentChar() == '"') {
      int length = 0;
      int col = state.ptr - state.lastLineEnd;
      do {
        length++;
        if (currentChar() == '\n') {
          addCoordsToTokens(state.lineNumber - 1, 0, length);
          state.lineNumber += 1;
          state.lastLineEnd = state.ptr;
          length = 0;
        }
        state.incPtr();
      } while (currentChar() != '"');
      addCoordsToTokens(state.lineNumber - 1, col - 1, length + 1);
      state.incPtr();
    }
  }

  private void addCoordsToTokens(final int line, final int col, final int length) {
    commentTokens.add(line);
    commentTokens.add(col);
    commentTokens.add(length);
    commentTokens.add(SemanticTokenType.COMMENT.ordinal()); // token type
    commentTokens.add(0); // token modifiers
  }

  public List<Integer> getCommentsPositions() {
    return commentTokens;
  }
}

Fix token types for comments in SOM


/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.service;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class UselessBeanTest {

    @InjectMocks
    private UselessBean uselessBean;

    @Mock
    private ABeanIWantToMock aBeanIWantToMock;

    @Test
    public void testMyMockReturnFalseInTest() {
        Mockito.when(aBeanIWantToMock.iAlwaysReturnFalse()).thenReturn(true);
        Assert.assertTrue(uselessBean.iWantToMockThisMethod());
    }
}

/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.service;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class UselessBeanTest {

    private UselessBean uselessBean;

    @Mock
    private ABeanIWantToMock aBeanIWantToMock;

    @Before
    public void setUp() {
        uselessBean = new UselessBean(aBeanIWantToMock);
    }

    @Test
    public void testMyMockReturnFalseInTest() {
        Mockito.when(aBeanIWantToMock.iAlwaysReturnFalse()).thenReturn(true);
        Assert.assertTrue(uselessBean.iWantToMockThisMethod());
    }
}

Initialize object under test in setup


package com.csforge.reader;

import org.apache.cassandra.db.rows.Unfiltered;

import java.util.stream.Stream;

/**
 */
public interface Partition {

    /**
     * A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which
     * data should be considered deleted. If set to Long.MIN_VALUE, this implies that the data has not been marked
     * for deletion at all.
     */
    public long markedForDeleteAt();

    /**
     * The local server timestamp, in seconds since the unix epoch, at which this tombstone was created. This is
     * only used for purposes of purging the tombstone after gc_grace_seconds have elapsed.
     */
    public int localDeletionTime();

    public Unfiltered staticRow();

    public Stream<Unfiltered> rows();
}

package com.csforge.reader;

import org.apache.cassandra.db.rows.Row;
import org.apache.cassandra.db.rows.Unfiltered;

import java.util.stream.Stream;

/**
 */
public interface Partition {

    /**
     * A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which
     * data should be considered deleted. If set to Long.MIN_VALUE, this implies that the data has not been marked
     * for deletion at all.
     */
    public long markedForDeleteAt();

    /**
     * The local server timestamp, in seconds since the unix epoch, at which this tombstone was created. This is
     * only used for purposes of purging the tombstone after gc_grace_seconds have elapsed.
     */
    public int localDeletionTime();

    public Row staticRow();

    public Stream<Unfiltered> rows();
}

Change staticRow() to return Row.


package io.github.droidkaigi.confsched2017.debug;

import com.tomoima.debot.strategy.DebotStrategy;

import android.app.Activity;
import android.support.annotation.NonNull;

public class ClearCache extends DebotStrategy {

    @Override
    public void startAction(@NonNull Activity activity) {
        // Do nothing
    }
}

package io.github.droidkaigi.confsched2017.debug;

import com.tomoima.debot.strategy.DebotStrategy;

import android.app.Activity;
import android.support.annotation.NonNull;

import javax.inject.Inject;

public class ClearCache extends DebotStrategy {

    @Inject
    public ClearCache() {
    }

    @Override
    public void startAction(@NonNull Activity activity) {
        // Do nothing
    }
}

Add inject annotation for release build


package com.twu.biblioteca;
import java.util.List;
import java.util.ArrayList;

public class BibliotecaApp {

    private static List<Book> bookList = initBookList();

    public static void main(String[] args) {
        System.out.println("Welcome to Biblioteca!");
        printBookList();
    }

    private static void printBookList() {
        System.out.println("Book list:");
        for (Book book : bookList) {
            System.out.println(book.toString());
        }
    }

    private static List<Book> initBookList() {
        List<Book> newBookList = new ArrayList<Book>();
        newBookList.add(createNewBook("Test-Driven Development By Example", "Kent Beck", 2003));
        newBookList.add(createNewBook("The Agile Samurai", "Jonathan Rasmusson", 2010));
        newBookList.add(createNewBook("Head First Java", "Kathy Sierra & Bert Bates", 2005));
        newBookList.add(createNewBook("Don't Make Me Think, Revisited: A Common Sense Approach to Web Usability", "Steve Krug", 2014));
        return newBookList;
    }

    private static Book createNewBook(String title, String author, int yearPublished) {
        return new Book(title, author, yearPublished);
    }
}

package com.twu.biblioteca;
import java.util.List;
import java.util.ArrayList;

public class BibliotecaApp {

    private static List<Book> bookList = initBookList();

    public static void main(String[] args) {
        System.out.println("Welcome to Biblioteca!");
        printBookList();
    }

    private static void printBookList() {
        System.out.println("Book List");
        System.out.print(String.format("%-42s | %-32s | %-12s\n", "Title", "Author", "Year Published"));
        String leftAlignFormat = "%-42s | %-32s | %-4d\n";
        for (Book book : bookList) {
            System.out.print(String.format(leftAlignFormat, book.getTitle(), book.getAuthor(), book.getYearPublished()));
        }
    }

    private static List<Book> initBookList() {
        List<Book> newBookList = new ArrayList<Book>();
        newBookList.add(createNewBook("Test-Driven Development By Example", "Kent Beck", 2003));
        newBookList.add(createNewBook("The Agile Samurai", "Jonathan Rasmusson", 2010));
        newBookList.add(createNewBook("Head First Java", "Kathy Sierra & Bert Bates", 2005));
        newBookList.add(createNewBook("Don't Make Me Think, Revisited", "Steve Krug", 2014));
        return newBookList;
    }

    private static Book createNewBook(String title, String author, int yearPublished) {
        return new Book(title, author, yearPublished);
    }
}

Print book list with author and year published details


package org.codehaus.modello.plugin;

/*
 * LICENSE
 */

import java.io.Reader;
import java.util.Properties;

import org.codehaus.modello.Model;
import org.codehaus.modello.ModelloException;

/**
 * @author Trygve Laugstøl
 * @version $Id$
 */
public interface ModelloTranslator
{
    Model translate( Reader reader, Properties parameters )
        throws ModelloException;
}

package org.codehaus.modello.plugin;

/*
 * LICENSE
 */

import java.io.Reader;
import java.util.Properties;

import org.codehaus.modello.Model;
import org.codehaus.modello.ModelloException;

/**
 * @author Trygve Laugstøl
 * @version $Id$
 */
public interface ModelloTranslator
{
    Model translate( Reader reader, Properties parameters )
        throws ModelloException;

    void translate( Model model, Properties parameters )
        throws ModelloException;
}

Add translator method from Model


package bibifi;

import junit.framework.TestCase;

public class App1Test extends TestCase {

	public void testCtor() {
		App1 app = new App1();
		App1 app2 = new App1();
	}

}

package bibifi;

import junit.framework.TestCase;

public class App1Test extends TestCase {

	public void testCtor() {
		App1 app = new App1();
		App1 app3 = new App1();
	}

}

Test Commitment without addition files


package io.ifar.goodies;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import com.codahale.metrics.MetricRegistry;
import io.dropwizard.jackson.Jackson;
import io.dropwizard.setup.Environment;
import org.slf4j.LoggerFactory;

import javax.security.auth.login.Configuration;
import javax.validation.Validation;

/**
 *
 */
public class CliConveniences {

    public static void quietLogging(String... packages) {
        for (String pkg : packages) {
            ((Logger) LoggerFactory.getLogger(pkg)).setLevel(Level.OFF);
        }
    }

    public static Environment fabricateEnvironment(String name, Configuration configuration) {
        return new Environment(name, Jackson.newObjectMapper(), Validation.buildDefaultValidatorFactory().getValidator(),
                               new MetricRegistry(),ClassLoader.getSystemClassLoader());
    }

}

package io.ifar.goodies;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import com.codahale.metrics.MetricRegistry;
import io.dropwizard.Configuration;
import io.dropwizard.jackson.Jackson;
import io.dropwizard.setup.Environment;
import org.slf4j.LoggerFactory;

import javax.validation.Validation;

/**
 *
 */
public class CliConveniences {

    public static void quietLogging(String... packages) {
        for (String pkg : packages) {
            ((Logger) LoggerFactory.getLogger(pkg)).setLevel(Level.OFF);
        }
    }

    public static Environment fabricateEnvironment(String name, Configuration configuration) {
        return new Environment(name, Jackson.newObjectMapper(), Validation.buildDefaultValidatorFactory().getValidator(),
                               new MetricRegistry(),ClassLoader.getSystemClassLoader());
    }

}

Clean up errant import of non-DW class.


/**
 * Tests some evaluation order / side effects with && and ||.
 *
 * @author Elvis Stansvik <elvstone@gmail.com>
 */

//EXT:IWE
//EXT:BDJ

class SideEffects {
    public static void main(String[] args) {
        IncredibleMachine m;
        m = new IncredibleMachine();
        System.out.println(m.run()); // Should print 329.
    }
}

class IncredibleMachine {
    int result;
    public int run() {
        result = 2;
        if (a(3, false) && a(5, true)                        /* r = 2 + 3 */
            || (m(7, false) || s(11, true) && m(13, false))  /* r = ((2 + 3) * 7 - 11) * 13 */
            || a(17, true) || m(19, true))                   /* r = ((2 + 3) * 7 - 11) * 13 + 17 = 329 */
            result = result;
        return result;
    }
    public boolean m(int value, boolean ret) {
        result = result * value;
        return ret;
    }
    public boolean a(int value, boolean ret) {
        result = result + value;
        return ret;
    }
    public boolean s(int value, boolean ret) {
        result = result - value;
        return ret;
    }
}

/**
 * Tests some evaluation order / side effects with && and ||.
 *
 * @author Elvis Stansvik <elvstone@gmail.com>
 */

//EXT:BDJ

class SideEffects {
    public static void main(String[] args) {
        IncredibleMachine m;
        m = new IncredibleMachine();
        System.out.println(m.run()); // Should print 329.
    }
}

class IncredibleMachine {
    int result;
    public int run() {
        result = 2;
        if (a(3, false) && a(5, true)                        /* r = 2 + 3 */
            || (m(7, false) || s(11, true) && m(13, false))  /* r = ((2 + 3) * 7 - 11) * 13 */
            || a(17, true) || m(19, true))                   /* r = ((2 + 3) * 7 - 11) * 13 + 17 = 329 */
            result = result;
        else
            result = 42;
        return result;
    }
    public boolean m(int value, boolean ret) {
        result = result * value;
        return ret;
    }
    public boolean a(int value, boolean ret) {
        result = result + value;
        return ret;
    }
    public boolean s(int value, boolean ret) {
        result = result - value;
        return ret;
    }
}

Remove EXT:IWE from side effects test case.


package server.game;

public enum Team {
    Red,
    Blue;
}

package server.game;

public enum Team {
    Undefined(""),
    Spectator("Spectator"),
    Red("Red"),
    Blue("Blue");

    private String name;

    Team(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }
}

Add a string in the team enum


import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class MathUtilsTest {

    @Test
    void testAdd() {
        MathUtils math = new MathUtils();
        assertEquals(5, math.add(3,2), "The add method should add two numbers");
    }

    @Test
    void testDivide(){
        MathUtils math = new MathUtils();
        assertEquals(3,math.divide(6,2), "Divide method should divide two numbers");
        assertThrows(ArithmeticException.class, () -> math.divide(1,0), "Divide by zero should throw");
    }

    @Test
    void testComputeArea() {
        MathUtils math = new MathUtils();
        assertEquals(78,math.computeArea(5),"Compute area method should return circle area");
    }
}

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.*;

class MathUtilsTest {
    MathUtils mathUtils;

    @BeforeEach
    void init(){
        mathUtils = new MathUtils();
    }

    @Test
    void testAdd() {
        assertEquals(5, mathUtils.add(3,2), "The add method should add two numbers");
    }

    @Test
    void testDivide(){
        assertEquals(3,mathUtils.divide(6,2), "Divide method should divide two numbers");
        assertThrows(ArithmeticException.class, () -> mathUtils.divide(1,0), "Divide by zero should throw");
    }

    @Test
    void testComputeArea() {
        assertEquals(78,mathUtils.computeArea(5),"Compute area method should return circle area");
    }
}

Refactor test to use BeforeEach to initialize


package org.xdi.service.cdi.event;

import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Yuriy Movchan Date: 04/13/2017
 */
@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
@Documented
public @interface ApplicationInitialized {

    public static final class Literal extends AnnotationLiteral<ApplicationInitialized> implements ApplicationInitialized {

        private static final long serialVersionUID = 4891987789146132930L;

        public static final Literal INSTANCE = new Literal();
    }

}

package org.xdi.service.cdi.event;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.Initialized.Literal;
import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Annotation;

/**
 * @author Yuriy Movchan Date: 04/13/2017
 */
@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
@Documented
public @interface ApplicationInitialized {

    /**
     * The scope for which to observe initialization
     */
    Class<? extends Annotation> value();

    public static final class Literal extends AnnotationLiteral<ApplicationInitialized> implements ApplicationInitialized {

        public static final Literal APPLICATION = of(ApplicationScoped.class);

        private static final long serialVersionUID = 1L;

        private final Class<? extends Annotation> value;

        public static Literal of(Class<? extends Annotation> value) {
            return new Literal(value);
        }

        private Literal(Class<? extends Annotation> value) {
            this.value = value;
        }

        @Override
        public Class<? extends Annotation> value() {
            // TODO Auto-generated method stub
            return null;
        }
    }

}

Add event to notify plugins about finish application initialization


package org.zanata.rest.client;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import org.jboss.resteasy.client.ClientResponse;
import org.zanata.common.LocaleId;
import org.zanata.rest.MediaTypes;
import org.zanata.rest.dto.Glossary;
import org.zanata.rest.service.GlossaryResource;

@Produces({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })
@Consumes({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })
public interface IGlossaryResource extends GlossaryResource
{
   public static final String SERVICE_PATH = "/glossary";

   @Override
   @GET
   public ClientResponse<Glossary> getEntries();

   @Override
   @GET
   @Path("{locale}")
   public ClientResponse<Glossary> get(@PathParam("locale") LocaleId locale);

   @Override
   @PUT
   public ClientResponse<Glossary> put(Glossary glossary);

   @Override
   @DELETE
   @Path("{locale}")
   public ClientResponse<String> deleteGlossary(@PathParam("locale") LocaleId locale);

   @Override
   @DELETE
   public ClientResponse<String> deleteGlossaries();

}

package org.zanata.rest.client;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

import org.jboss.resteasy.client.ClientResponse;
import org.zanata.common.LocaleId;
import org.zanata.rest.MediaTypes;
import org.zanata.rest.dto.Glossary;
import org.zanata.rest.service.GlossaryResource;

@Produces({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })
@Consumes({ MediaTypes.APPLICATION_ZANATA_GLOSSARY_XML, MediaTypes.APPLICATION_ZANATA_GLOSSARY_JSON })
public interface IGlossaryResource extends GlossaryResource
{
   public static final String SERVICE_PATH = "/glossary";

   @Override
   @GET
   public ClientResponse<Glossary> getEntries();

   @Override
   @GET
   @Path("{locale}")
   public ClientResponse<Glossary> get(@PathParam("locale") LocaleId locale);

   @Override
   @PUT
   public ClientResponse<String> put(Glossary glossary);

   @Override
   @DELETE
   @Path("{locale}")
   public ClientResponse<String> deleteGlossary(@PathParam("locale") LocaleId locale);

   @Override
   @DELETE
   public ClientResponse<String> deleteGlossaries();

}

Fix GlossaryTerm with TermComment relationship and test


package com.michaldabski.panoramio.requests;

import com.android.volley.Response;

/**
 * Created by Michal on 10/08/2014.
 */
public class NearbyPhotosRequest extends PanoramioRequest
{
    public static final int NUM_PHOTOS = 30;
    private static final float
            LAT_MULTIPLIER = 0.4f,
            LON_MULTIPLIER = 1f;
    private final float userLat, userLong;

    public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, int to, float distance)
    {
        super(listener, longitude-(distance* LON_MULTIPLIER), latitude-(distance* LAT_MULTIPLIER), longitude+(distance*LON_MULTIPLIER), latitude+(distance*LAT_MULTIPLIER), from, to);
        userLat = latitude;
        userLong = longitude;
    }

    public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, float distance)
    {
        this(listener, latitude, longitude, from, from+NUM_PHOTOS, distance);
    }

}

package com.michaldabski.panoramio.requests;

import com.android.volley.Response;

/**
 * Created by Michal on 10/08/2014.
 */
public class NearbyPhotosRequest extends PanoramioRequest
{
    public static final int NUM_PHOTOS = 50;
    private static final float
            LAT_MULTIPLIER = 0.4f,
            LON_MULTIPLIER = 1f;
    private final float userLat, userLong;

    public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, int to, float distance)
    {
        super(listener, longitude-(distance* LON_MULTIPLIER), latitude-(distance* LAT_MULTIPLIER), longitude+(distance*LON_MULTIPLIER), latitude+(distance*LAT_MULTIPLIER), from, to);
        userLat = latitude;
        userLong = longitude;
    }

    public NearbyPhotosRequest(Response.ErrorListener listener, float latitude, float longitude, int from, float distance)
    {
        this(listener, latitude, longitude, from, from+NUM_PHOTOS, distance);
    }

}

Increase number of photos downloaded to 50 at once


/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

package com.facebook.react.uimanager;

import javax.annotation.Nullable;

import android.view.View;
import android.view.ViewGroup;

import com.facebook.react.bridge.UiThreadUtil;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class ViewHierarchyDumper {

  public static @Nullable JSONObject toJSON(@Nullable View view) {
    UiThreadUtil.assertOnUiThread();
    if (view == null) {
      return null;
    }
    JSONObject result = new JSONObject();
    try {
      result.put("class", view.getClass().getSimpleName());
      Object tag = view.getTag();
      if (tag != null && tag instanceof String) {
        result.put("id", tag);
      }
      if (view instanceof ViewGroup) {
        ViewGroup viewGroup = (ViewGroup) view;
        if (viewGroup.getChildCount() > 0) {
          JSONArray children = new JSONArray();
          for (int i = 0; i < viewGroup.getChildCount(); i++) {
            children.put(i, toJSON(viewGroup.getChildAt(i)));
          }
          result.put("children", children);
        }
      }
    } catch (JSONException ex) {
      return null;
    }
    return result;
  }
}

/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

package com.facebook.react.uimanager;

import android.view.View;
import android.view.ViewGroup;

import com.facebook.react.bridge.UiThreadUtil;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class ViewHierarchyDumper {

  public static JSONObject toJSON(View view) throws JSONException {
    UiThreadUtil.assertOnUiThread();

    JSONObject result = new JSONObject();
    result.put("n", view.getClass().getName());
    result.put("i", System.identityHashCode(view));
    Object tag = view.getTag();
    if (tag != null && tag instanceof String) {
      result.put("t", tag);
    }

    if (view instanceof ViewGroup) {
      ViewGroup viewGroup = (ViewGroup) view;
      if (viewGroup.getChildCount() > 0) {
        JSONArray children = new JSONArray();
        for (int i = 0; i < viewGroup.getChildCount(); i++) {
          children.put(i, toJSON(viewGroup.getChildAt(i)));
        }
        result.put("c", children);
      }
    }

    return result;
  }
}

Add custom error reporter in Groups


package com.camelinaction;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.apache.camel.Endpoint;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.Uri;

/**
 * Camel routes that uses undertow to expose a HTTP service
 */
@Singleton
public class HelloRoute extends RouteBuilder {

    @Inject @Uri("undertow:http://0.0.0.0:8080")
    private Endpoint undertow;

    @Inject
    private HelloBean hello;

    @Override
    public void configure() throws Exception {
        from(undertow).bean(hello);
    }
}

package com.camelinaction;

import javax.inject.Inject;
import javax.inject.Singleton;

import org.apache.camel.Endpoint;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.Uri;

/**
 * Camel routes that uses undertow to expose a HTTP service
 */
@Singleton
public class HelloRoute extends RouteBuilder {

    @Inject @Uri("undertow:http://0.0.0.0:8080/")
    private Endpoint undertow;

    @Inject
    private HelloBean hello;

    @Override
    public void configure() throws Exception {
        from(undertow).bean(hello);
    }
}

Add slash as workaround until swarm is upgraded to camel 2.19 onwards


package com.infinityraider.infinitylib.modules.keyboard;

import com.google.common.collect.ImmutableList;
import com.infinityraider.infinitylib.modules.Module;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.List;

public class ModuleKeyboard extends Module {
    private static final ModuleKeyboard INSTANCE = new ModuleKeyboard();

    public static ModuleKeyboard getInstance() {
        return INSTANCE;
    }

    private ModuleKeyboard() {}

    @OnlyIn(Dist.CLIENT)
    public void registerKeyListener(IKeyListener listener) {
        KeyEventHandler.getInstance().registerListener(listener);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyPressed(int key) {
        return KeyEventHandler.getInstance().isKeyPressed(key);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyRepeated(int key) {
        return KeyEventHandler.getInstance().isKeyRepeated(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyHoldDownTime(int key) {
        return KeyEventHandler.getInstance().getKeyHoldDownTime(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyModifier(int key) {
        return KeyEventHandler.getInstance().getKeyModifier(key);
    }

    @Override
    @OnlyIn(Dist.CLIENT)
    public List<Object> getClientEventHandlers() {
        return ImmutableList.of(KeyEventHandler.getInstance());
    }
}

package com.infinityraider.infinitylib.modules.keyboard;

import com.google.common.collect.ImmutableList;
import com.infinityraider.infinitylib.modules.Module;
import net.minecraft.client.settings.KeyBinding;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.List;

public class ModuleKeyboard extends Module {
    private static final ModuleKeyboard INSTANCE = new ModuleKeyboard();

    public static ModuleKeyboard getInstance() {
        return INSTANCE;
    }

    private ModuleKeyboard() {}

    @OnlyIn(Dist.CLIENT)
    public void registerKeyListener(IKeyListener listener) {
        KeyEventHandler.getInstance().registerListener(listener);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyPressed(KeyBinding key) {
        return this.isKeyPressed(key.getKey().getKeyCode());
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyPressed(int key) {
        return KeyEventHandler.getInstance().isKeyPressed(key);
    }

    @OnlyIn(Dist.CLIENT)
    public boolean isKeyRepeated(int key) {
        return KeyEventHandler.getInstance().isKeyRepeated(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyHoldDownTime(int key) {
        return KeyEventHandler.getInstance().getKeyHoldDownTime(key);
    }

    @OnlyIn(Dist.CLIENT)
    public int getKeyModifier(int key) {
        return KeyEventHandler.getInstance().getKeyModifier(key);
    }

    @Override
    @OnlyIn(Dist.CLIENT)
    public List<Object> getClientEventHandlers() {
        return ImmutableList.of(KeyEventHandler.getInstance());
    }
}

Add method to Keyboard Module to fetch KeyBinding state


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ames.frc.robot;

/* List of buttons/toggles needed
 * Manual pivot toggle: 2
 * Speed boost button: Active joystick push
 * Force shoot button: 4
 * Force Realign button: 7
 * Stop auto-target toggle: 10
 * Activate frisbee grab button: 8
 * Launch climb procedure: 9 (We need to make it nesscesary to hold, or double/triple tap the button so as to aviod accidentally starting the climb)
 *
 */
public class InputManager {

}

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ames.frc.robot;

/* List of buttons/toggles needed
 * Manual pivot toggle: 2
 * Speed boost button: Active joystick push
 * Force shoot button: 4
 * Force Realign button: 7
 * Stop auto-target toggle: 10
 * Activate frisbee grab button: 8
 * Launch climb procedure: 9 (We need to make it nesscesary to hold, or double/triple tap the button so as to aviod accidentally starting the climb)
 * Test Gitttttt
 */
public class InputManager {

}

Test of the Git system


import vtk.*;

public class Regression
{
  public static void main (String []args)
    {
    vtkTesting.Initialize(args);

    vtkRenderWindow renWin = new vtkRenderWindow();
    vtkRenderer ren1 = new vtkRenderer();
    renWin.AddRenderer(ren1);
    vtkConeSource cone = new vtkConeSource();
    cone.SetResolution(8);
    vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
    coneMapper.SetInput(cone.GetOutput());

    vtkActor coneActor = new vtkActor();
    coneActor.SetMapper(coneMapper);

    ren1.AddActor(coneActor);
    renWin.Render();

    vtkTesting.RegressionTestImage(renWin, args);
    }
}

/*=========================================================================

  Program:   Visualization Toolkit
  Module:    Regression.java
  Language:  C++
  Date:      $Date$
  Version:   $Revision$

  Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
import vtk.*;

public class Regression
{
  public static void main (String []args)
    {
    vtkTesting.Initialize(args);

    vtkRenderWindow renWin = new vtkRenderWindow();
    vtkRenderer ren1 = new vtkRenderer();
    renWin.AddRenderer(ren1);
    vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor();
    iren.SetRenderWindow(renWin);
    vtkConeSource cone = new vtkConeSource();
    cone.SetResolution(8);
    vtkPolyDataMapper coneMapper = new vtkPolyDataMapper();
    coneMapper.SetInput(cone.GetOutput());

    vtkActor coneActor = new vtkActor();
    coneActor.SetMapper(coneMapper);

    ren1.AddActor(coneActor);
    renWin.Render();

    int retVal = vtkTesting.RegressionTestImage(renWin, args, 10);
    if ( retVal == vtkTesting.DO_INTERACTOR )
      {
      iren.Start();
      }
    System.exit(retVal);
    }
}

Send threshold to vtkTesting, add interaction support, and return what vtktesting returns


package com.sakamichi46.model;

import java.util.Date;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author kikuta
 */
@Getter @Setter
public class Member {
    private String name;
    private Date birthday;
    private String bloodType;
    private String constellation;
    private String profilePhotoUri;
    private String blogUri;
}

package com.sakamichi46.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author kikuta
 */
@Getter @Setter
public class Member {
    private String name;
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private Date birthday;
    private String bloodType;
    private String constellation;
    private String profilePhotoUri;
    private String blogUri;
}

Modify date format of json


package org.yi.happy.metric;

/**
 * I am a simple timer.
 */
public class SimpleTimer {

    /**
     * create started.
     */
    public SimpleTimer() {
        startTime = System.currentTimeMillis();
        stopTime = startTime - 1;
    }

    /**
     * when the timer started.
     */
    private long startTime;

    /**
     * when the timer was stopped. (initially: startTime - 1)
     */
    private long stopTime;

    /**
     * stop the timer. A timer may only be stopped once.
     */
    public void stop() {
        if (stopTime >= startTime) {
            throw new IllegalStateException("stop may only be called once");
        }
        stopTime = System.currentTimeMillis();
    }

    /**
     * get the time on the timer. if the timer has not been stopped get the time
     * from when it was started to now. if the timer has been stopped get the
     * time between when it was started and when it was stopped.
     *
     * @return the elapsed time in ms
     */
    public long getTime() {
        if (stopTime < startTime) {
            return System.currentTimeMillis() - startTime;
        }
        return stopTime - startTime;
    }
}

package org.yi.happy.metric;

/**
 * I am a simple timer.
 */
public class SimpleTimer {

    /**
     * create started.
     */
    public SimpleTimer() {
        startTime = System.currentTimeMillis();
        stopTime = startTime - 1;
    }

    /**
     * when the timer started.
     */
    private long startTime;

    /**
     * when the timer was stopped. (initially: startTime - 1)
     */
    private long stopTime;

    /**
     * stop the timer. A timer may only be stopped once.
     */
    public void stop() {
        if (stopTime >= startTime) {
            throw new IllegalStateException("stop may only be called once");
        }
        stopTime = System.currentTimeMillis();
    }

    /**
     * get the time on the timer. if the timer has not been stopped get the time
     * from when it was started to now. if the timer has been stopped get the
     * time between when it was started and when it was stopped.
     *
     * @return the elapsed time in ms
     */
    public long getTime() {
        if (stopTime < startTime) {
            return System.currentTimeMillis() - startTime;
        }
        return stopTime - startTime;
    }

    @Override
    public String toString() {
        return "[" + getClass().getName() + ": time=" + getTime() + " ms]";
    }
}

Format simple timers when they are printed.


package io.github.duckasteroid.progress.utils;

import io.github.duckasteroid.progress.ProgressMonitor;
import java.io.IOException;
import java.io.InputStream;

/**
 * Wraps an input stream to report 1 unit of work for every byte {@link #read()}.
 * Clients should set the {@link ProgressMonitor#setSize(long)} prior to invoking for this
 * to report correctly.
 * When the stream is {@link #close() closed} the monitor is marked done
 */
public class InputStreamProgress extends InputStream {
  private final transient  InputStream delegate;
  private final transient ProgressMonitor monitor;

  public InputStreamProgress(InputStream delegate, ProgressMonitor monitor) {
    this.delegate = delegate;
    this.monitor = monitor;
  }

  @Override
  public int read() throws IOException {
    monitor.worked(1);
    return delegate.read();
  }

  @Override
  public void close() throws IOException {
    monitor.done();
    super.close();
  }
}

package io.github.duckasteroid.progress.utils;

import io.github.duckasteroid.progress.ProgressMonitor;
import java.io.IOException;
import java.io.InputStream;

/**
 * Wraps an input stream to report 1 unit of work for every byte {@link #read()}.
 * Clients should set the {@link ProgressMonitor#setSize(long)} prior to invoking for this
 * to report correctly.
 * When the stream is {@link #close() closed} the monitor is marked done
 */
public class InputStreamProgress extends InputStream {
  private final transient  InputStream delegate;
  private final transient ProgressMonitor monitor;

  public InputStreamProgress(InputStream delegate, ProgressMonitor monitor) {
    this.delegate = delegate;
    this.monitor = monitor;
  }

  @Override
  public int read() throws IOException {
    if (monitor.isCancelled()) {
      throw new IOException("Read operation cancelled by monitor");
    }
    monitor.worked(1);
    return delegate.read();
  }

  @Override
  public void close() throws IOException {
    monitor.done();
    super.close();
  }
}

Throw Ex in stream if monitor cancelled


package io.generators.core;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
import java.util.Random;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.copyOf;

/**
 * Generates randomly selected element from collection/array
 *
 * @param <T> type of the collection's elements
 *
 * @author Tomas Klubal
 */
public class RandomFromCollectionGenerator<T> implements Generator<T> {
    private final List<T> items;
    private final Random random = new Random();

    /**
     * Creates generator that selects values from items passed in
     *
     * @param items to select from
     * @throws NullPointerException when collection passed in is null
     */
    public RandomFromCollectionGenerator(@Nonnull Collection<T> items) {
        this.items = copyOf(checkNotNull(items, "Collection for generation can't be null"));
    }

    /**
     * Creates generator that selects values from items passed in
     *
     * @param items to select from
     * @throws NullPointerException when array passed in is null
     */
    @SafeVarargs
    public RandomFromCollectionGenerator(T... items) {
        this.items = copyOf(checkNotNull(items, "Collection for generation can't be null"));
    }

    @Override
    public T next() {
        int maximumIndex = items.size() - 1;
        return maximumIndex > 0
                ? items.get(random.nextInt(maximumIndex))
                : maximumIndex == 0 ? items.get(0) : null;
    }
}

package io.generators.core;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
import java.util.Random;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableList.copyOf;

/**
 * Generates randomly selected element from collection/array
 *
 * @param <T> type of the collection's elements
 * @author Tomas Klubal
 */
public class RandomFromCollectionGenerator<T> implements Generator<T> {
    private final List<T> items;
    private final Random random = new Random();

    /**
     * Creates generator that selects values from items passed in
     *
     * @param items to select from
     * @throws NullPointerException when collection passed in is null
     */
    public RandomFromCollectionGenerator(@Nonnull Collection<T> items) {
        this.items = copyOf(checkNotNull(items, "Collection for generation can't be null"));
    }

    /**
     * Creates generator that selects values from items passed in
     *
     * @param items to select from
     * @throws NullPointerException when array passed in is null
     */
    @SafeVarargs
    public RandomFromCollectionGenerator(T... items) {
        this.items = copyOf(checkNotNull(items, "Collection for generation can't be null"));
    }

    @Override
    public T next() {
        int maximumIndex = items.size() - 1;
        if (maximumIndex > 0) {
            return items.get(random.nextInt(maximumIndex));
        } else if (maximumIndex == 0) {
            return items.get(0);
        } else {
            return null;
        }
    }
}

Remove insane double ternary operator


package com.vimeo.networking.utils;

import com.vimeo.networking.Vimeo;
import com.vimeo.networking.model.Privacy;

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

/**
 * Builder for setting privacy params for a video.
 *
 * Created by Mohit Sarveiya on 3/20/18.
 */
public final class PrivacySettingsParams {

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

    public PrivacySettingsParams comments(final Privacy.PrivacyCommentValue privacyCommentValue) {
        params.put(Vimeo.PARAMETER_VIDEO_COMMENTS, privacyCommentValue);
        return this;
    }

    public PrivacySettingsParams download(final boolean download) {
        params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, download);
        return this;
    }

    public PrivacySettingsParams addToCollections(final boolean add) {
        params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, add);
        return this;
    }

    public PrivacySettingsParams embed(final Privacy.PrivacyEmbedValue privacyEmbedType) {
        params.put(Vimeo.PARAMETER_VIDEO_EMBED, privacyEmbedType);
        return this;
    }

    public PrivacySettingsParams view(final Privacy.PrivacyViewValue privacyViewType) {
        params.put(Vimeo.PARAMETER_VIDEO_VIEW, privacyViewType);
        return this;
    }

    public Map<String, Object> getParams() {
        return params;
    }

}

package com.vimeo.networking.utils;

import com.vimeo.networking.Vimeo;
import com.vimeo.networking.model.Privacy;

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

/**
 * Builder for setting privacy params for a video.
 *
 * Created by Mohit Sarveiya on 3/20/18.
 */
public final class PrivacySettingsParams {

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

    public PrivacySettingsParams comments(final Privacy.PrivacyCommentValue privacyCommentValue) {
        params.put(Vimeo.PARAMETER_VIDEO_COMMENTS, privacyCommentValue);
        return this;
    }

    public PrivacySettingsParams download(final boolean download) {
        params.put(Vimeo.PARAMETER_VIDEO_DOWNLOAD, download);
        return this;
    }

    public PrivacySettingsParams addToCollections(final boolean add) {
        params.put(Vimeo.PARAMETER_VIDEO_ADD, add);
        return this;
    }

    public PrivacySettingsParams embed(final Privacy.PrivacyEmbedValue privacyEmbedType) {
        params.put(Vimeo.PARAMETER_VIDEO_EMBED, privacyEmbedType);
        return this;
    }

    public PrivacySettingsParams view(final Privacy.PrivacyViewValue privacyViewType) {
        params.put(Vimeo.PARAMETER_VIDEO_VIEW, privacyViewType);
        return this;
    }

    public Map<String, Object> getParams() {
        return params;
    }

}

Fix add to collections bug


package com.aayaffe.sailingracecoursemanager.communication;

import java.io.Serializable;

/**
 * Created by aayaffe on 30/09/2015.
 */
public enum ObjectTypes {
    RaceManager(0),
    WorkerBoat(1),
    Buoy(2),
    FlagBuoy(3),
    TomatoBuoy(4),
    TriangleBuoy(5),
    StartLine(6),
    FinishLine(7),
    StartFinishLine(8),
    Gate(9),
    ReferencePoint(10),
    Other(11);

    private int value;

    ObjectTypes(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }
}

package com.aayaffe.sailingracecoursemanager.communication;

import java.io.Serializable;

/**
 * Created by aayaffe on 30/09/2015.
 */
public enum ObjectTypes {
    WorkerBoat,
    FlagBuoy,
    TomatoBuoy,
    TriangleBuoy,
    StartLine,
    FinishLine,
    StartFinishLine,

    RaceManager,  //from here, the relevant ObjectTypes:
    Buoy,
    Gate,
    Satellite,
    ReferencePoint,
    Other
}

Revert "Updated object types in Dev"


/*
 * Copyright (c) Mattia Barbon <mattia@barbon.org>
 * distributed under the terms of the MIT license
 */

package org.barbon.acash;

import android.app.Dialog;

import android.content.Context;
import android.content.SharedPreferences;

import android.text.method.LinkMovementMethod;

import android.widget.TextView;

public class AboutDialog extends Dialog {
    public AboutDialog(Context context) {
        super(context);
        setTitle(R.string.about_title);
        setContentView(R.layout.about_dialog);

        TextView click1 = (TextView) findViewById(R.id.about_clickable_1);
        TextView click2 = (TextView) findViewById(R.id.about_clickable_2);

        click1.setMovementMethod(LinkMovementMethod.getInstance());
        click2.setMovementMethod(LinkMovementMethod.getInstance());
    }

    public void onBackPressed() {
        // saves "displayed_about" more oft than needed, but it should
        // not be a problem
        SharedPreferences prefs =
            getContext().getSharedPreferences("global", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = prefs.edit();

        editor.putBoolean("displayed_about", true);
        editor.commit();

        super.onBackPressed();
    }

    /* returns true if the dialog has not been shown yet */
    public static boolean showFirstTime(Context context) {
        SharedPreferences prefs =
            context.getSharedPreferences("global", Context.MODE_PRIVATE);

        return !prefs.getBoolean("displayed_about", false);
    }
}

/*
 * Copyright (c) Mattia Barbon <mattia@barbon.org>
 * distributed under the terms of the MIT license
 */

package org.barbon.acash;

import android.app.Dialog;

import android.content.Context;
import android.content.SharedPreferences;

import android.text.method.LinkMovementMethod;

import android.widget.TextView;

public class AboutDialog extends Dialog {
    public AboutDialog(Context context) {
        super(context);
        setTitle(R.string.about_title);
        setContentView(R.layout.about_dialog);

        TextView click1 = (TextView) findViewById(R.id.about_clickable_1);
        TextView click2 = (TextView) findViewById(R.id.about_clickable_2);

        click1.setMovementMethod(LinkMovementMethod.getInstance());
        click2.setMovementMethod(LinkMovementMethod.getInstance());
    }

    @Override
    public void onBackPressed() {
        // saves "displayed_about" more oft than needed, but it should
        // not be a problem
        SharedPreferences prefs =
            getContext().getSharedPreferences("global", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = prefs.edit();

        editor.putBoolean("displayed_about", true);
        editor.commit();

        super.onBackPressed();
    }

    /* returns true if the dialog has not been shown yet */
    public static boolean showFirstTime(Context context) {
        SharedPreferences prefs =
            context.getSharedPreferences("global", Context.MODE_PRIVATE);

        return !prefs.getBoolean("displayed_about", false);
    }
}

Add the @Override decorator to onBackPressed().


/*
 * Copyright (C) 2012 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.android.phone;

import com.android.internal.telephony.DebugService;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import java.io.FileDescriptor;
import java.io.PrintWriter;

/**
 * A debug service for telephony.
 */
public class TelephonyDebugService extends Service {
    private static String TAG = "TelephonyDebugService";
    private DebugService mDebugService = new DebugService();

    /** Constructor */
    public TelephonyDebugService() {
        Log.d(TAG, "TelephonyDebugService()");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        enforceCallingOrSelfPermission(android.Manifest.permission.DUMP,
                                       "Requires DUMP");
        mDebugService.dump(fd, pw, args);
    }
}

/*
 * Copyright (C) 2012 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.android.phone;

import com.android.internal.telephony.DebugService;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import java.io.FileDescriptor;
import java.io.PrintWriter;

/**
 * A debug service for telephony.
 */
public class TelephonyDebugService extends Service {
    private static String TAG = "TelephonyDebugService";
    private DebugService mDebugService = new DebugService();

    /** Constructor */
    public TelephonyDebugService() {
        Log.d(TAG, "TelephonyDebugService()");
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        mDebugService.dump(fd, pw, args);
    }
}

Revert "enforce dump permission on dump()"


// WikiPathways Java library,
// Copyright 2014-2015 WikiPathways
//
// 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.wikipathways.client.test.utils;

import java.net.URL;

import org.wikipathways.client.WikiPathwaysClient;

public class ConnectionSettings {

	public static WikiPathwaysClient createClient() throws Exception {
//		URL url = new URL("http://webservice.wikipathways.org");
		URL url = new URL("https://rcbranch.wikipathways.org/wpi/webservicetest");
		return new WikiPathwaysClient(url);
	}
}

// WikiPathways Java library,
// Copyright 2014-2015 WikiPathways
//
// 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.wikipathways.client.test.utils;

import java.net.URL;

import org.wikipathways.client.WikiPathwaysClient;

public class ConnectionSettings {

	public static WikiPathwaysClient createClient() throws Exception {
		String urlStr = System.getProperty("url", "https://rcbranch.wikipathways.org/wpi/webservicetest");
//		URL url = new URL("http://webservice.wikipathways.org");
		URL url = new URL(urlStr);
		return new WikiPathwaysClient(url);
	}
}

Make the tested service configurable


package org.mkonrad.fizzbuzz;

import java.io.PrintStream;
import java.util.stream.IntStream;

/**
 * @author Markus Konrad
 */
public final class FizzBuzz {

	private final PrintStream printStream;

	public FizzBuzz(PrintStream printStream) {
		this.printStream = printStream;
	}

	public final void run(int numberOfRounds){
		if (numberOfRounds < 1) {
			printStream.println("Please specify a positive value for the parameter \"numberOfRounds\"");
			return;
		}
    IntStream.range(1, numberOfRounds + 1).mapToObj(i ->	{
      if (i % 3 == 0) {
        if (i % 5 == 0) {
          return "FizzBuzz";
        }
        return "Fizz";
      }
      if (i % 5 == 0) {
        return "Buzz";
      }
      return String.valueOf(i);
    }).forEach(printStream::println);
	}

	public static void main(String[] args) {
		new FizzBuzz(System.out).run(100);
	}
}

package org.mkonrad.fizzbuzz;

import java.io.PrintStream;
import java.util.stream.IntStream;

/**
 * @author Markus Konrad
 */
public final class FizzBuzz {

	private final PrintStream printStream;

	public FizzBuzz(PrintStream printStream) {
		this.printStream = printStream;
	}

	public final void run(int numberOfRounds){
		if (numberOfRounds < 1) {
			printStream.println("Please specify a positive value for the parameter \"numberOfRounds\"");
			return;
		}
    IntStream.range(1, numberOfRounds + 1)
      .mapToObj(i ->	{
        if (i % 3 == 0) {
          if (i % 5 == 0) {
            return "FizzBuzz";
          }
          return "Fizz";
        }
        if (i % 5 == 0) {
          return "Buzz";
        }
        return String.valueOf(i);
      })
      .forEach(printStream::println);
	}

	public static void main(String[] args) {
		new FizzBuzz(System.out).run(100);
	}
}

Migrate implementation to Java 8


package invtweaks.forge.asm;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

import java.util.Map;

@IFMLLoadingPlugin.TransformerExclusions({"invtweaks.forge.asm", "invtweaks.forge.asm.compatibility"})
public class FMLPlugin implements IFMLLoadingPlugin {
    public static boolean runtimeDeobfEnabled = false;

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

    @Override
    public String[] getASMTransformerClass() {
        return new String[]{/*"invtweaks.forge.asm.ITAccessTransformer", */"invtweaks.forge.asm.ContainerTransformer"};
    }

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

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

    @Override
    public void injectData(Map<String, Object> data) {
        runtimeDeobfEnabled = (Boolean)data.get("runtimeDeobfuscationEnabled");
    }
}

package invtweaks.forge.asm;

import cpw.mods.fml.relauncher.IFMLLoadingPlugin;

import java.util.Map;

@IFMLLoadingPlugin.TransformerExclusions({"invtweaks.forge.asm", "invtweaks.forge.asm.compatibility"})
@IFMLLoadingPlugin.MCVersion("") // We're using runtime debof integration, so no point in being specific about version
public class FMLPlugin implements IFMLLoadingPlugin {
    public static boolean runtimeDeobfEnabled = false;

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

    @Override
    public String[] getASMTransformerClass() {
        return new String[]{/*"invtweaks.forge.asm.ITAccessTransformer", */"invtweaks.forge.asm.ContainerTransformer"};
    }

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

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

    @Override
    public void injectData(Map<String, Object> data) {
        runtimeDeobfEnabled = (Boolean)data.get("runtimeDeobfuscationEnabled");
    }
}

Add blank MCVersion annotation to shut up the FML complant.


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

package io.spine.query.given;

import io.spine.query.CustomColumn;

/**
 * Custom columns that define entity lifecycle.
 *
 * <p>Used in the smoke testing of entity query builders.
 */
public enum Lifecycle {

    ARCHIVED(new ArchivedColumn()),

    DELETED(new ArchivedColumn());

    private final CustomColumn<?, Boolean> column;

    Lifecycle(CustomColumn<?, Boolean> column) {
        this.column = column;
    }

    /** Returns the column declaration. */
    public CustomColumn<?, Boolean> column() {
        return column;
    }
}

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

package io.spine.query.given;

import io.spine.query.CustomColumn;

/**
 * Custom columns that define entity lifecycle.
 *
 * <p>Used in the smoke testing of entity query builders.
 */
public enum Lifecycle {

    ARCHIVED(new ArchivedColumn()),

    DELETED(new DeletedColumn());

    private final CustomColumn<?, Boolean> column;

    Lifecycle(CustomColumn<?, Boolean> column) {
        this.column = column;
    }

    /** Returns the column declaration. */
    public CustomColumn<?, Boolean> column() {
        return column;
    }
}

Use the proper column implementation.


/*
 * Copyright 2013 Prateek Srivastava (@f2prateek)
 *
 * 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.f2prateek.couchpotato.tests;

import android.test.suitebuilder.annotation.SmallTest;
import com.f2prateek.couchpotato.ui.activities.MainActivity;
import com.squareup.spoon.Spoon;

public class MainActivityTest extends ActivityTest<MainActivity> {

  public MainActivityTest() {
    super(MainActivity.class);
  }

  @Override
  protected void setUp() throws Exception {
    super.setUp();
  }

  @SmallTest
  public void testUI() {
    Spoon.screenshot(activity, "Initial_State");
  }
}

/*
 * Copyright 2013 Prateek Srivastava (@f2prateek)
 *
 * 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.f2prateek.couchpotato.tests;

import android.app.Instrumentation;
import android.content.IntentFilter;
import android.test.suitebuilder.annotation.SmallTest;
import com.f2prateek.couchpotato.ui.activities.MainActivity;
import com.squareup.spoon.Spoon;

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

public class MainActivityTest extends ActivityTest<MainActivity> {

  public MainActivityTest() {
    super(MainActivity.class);
  }

  @Override
  protected void setUp() throws Exception {
    super.setUp();
  }

  @SmallTest
  public void testStartsActivityWhenNotLoggedIn() {
    IntentFilter filter = new IntentFilter();
    Instrumentation.ActivityMonitor monitor = instrumentation.addMonitor(filter, null, false);
    // Verify new activity was shown.
    assertThat(monitor).hasHits(1);
    Spoon.screenshot(monitor.getLastActivity(), "next_activity_shown");
  }
}

Test to verify setup activity is shown if not logged in


package tv.rocketbeans.supermafiosi;

public interface Config {

	String APP_NAME = "Super Mafiosi (#beansjam edition)";
	float MUSIC_VOLUME = 1.0f;
	boolean DEBUG = true;
	int MAXIMUM_POINTS = 10;
}

package tv.rocketbeans.supermafiosi;

public interface Config {

	String APP_NAME = "Super Mafiosi (#beansjam edition)";
	float MUSIC_VOLUME = 1.0f;
	boolean DEBUG = false;
	int MAXIMUM_POINTS = 10;
}

Set debug to false again


package semantics.model;

import com.google.gson.JsonElement;
import java.util.Arrays;
import semantics.KnowBase;
import semantics.Util;

public abstract class Binary extends Conceptual implements Cloneable {
  private final Conceptual[] cs;

  public Binary(Conceptual[] cs) {
    this.cs = cs;
  }

  protected abstract Binary construct(Conceptual[] cs);

  protected abstract String getTag();
  protected abstract String getOperator();

  public void checkSignature(KnowBase kb) {
    for (Conceptual c : cs) {
      c.checkSignature(kb);
    }
  }

  public JsonElement toJson() {
    return Util.toTaggedArray(getTag(), Util.allToJson(cs));
  }

  @Override
  public boolean containsUnknown() {
    for (Conceptual c : cs) {
      if (c.containsUnknown()) {
        return true;
      }
    }
    return false;
  }

  @Override
  public Conceptual stripUnknown() {
    if (!containsUnknown()) {
      return this;
    }

    Conceptual[] stripped = new Conceptual[cs.length];

    for (int i = 0; i < cs.length; ++i) {
      stripped[i] = cs[i].stripUnknown();
    }

    return construct(stripped);
  }

  @Override
  public String toString() {
    return String.format("[%s]", Util.join(" " + getOperator() + " ", cs));
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof Binary) {
      return Arrays.equals(cs, ((Binary) o).cs);
    }
    return false;
  }
}

package semantics.model;

import com.google.gson.JsonElement;
import java.util.Arrays;
import semantics.KnowBase;
import semantics.Util;

public abstract class Binary extends Conceptual {
  private final Conceptual[] cs;

  public Binary(Conceptual[] cs) {
    this.cs = cs;
  }

  protected abstract Binary construct(Conceptual[] cs);

  protected abstract String getTag();
  protected abstract String getOperator();

  public void checkSignature(KnowBase kb) {
    for (Conceptual c : cs) {
      c.checkSignature(kb);
    }
  }

  public JsonElement toJson() {
    return Util.toTaggedArray(getTag(), Util.allToJson(cs));
  }

  @Override
  public boolean containsUnknown() {
    for (Conceptual c : cs) {
      if (c.containsUnknown()) {
        return true;
      }
    }
    return false;
  }

  @Override
  public Conceptual stripUnknown() {
    if (!containsUnknown()) {
      return this;
    }

    Conceptual[] stripped = new Conceptual[cs.length];

    for (int i = 0; i < cs.length; ++i) {
      stripped[i] = cs[i].stripUnknown();
    }

    return construct(stripped);
  }

  @Override
  public String toString() {
    return String.format("[%s]", Util.join(" " + getOperator() + " ", cs));
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof Binary) {
      return Arrays.equals(cs, ((Binary) o).cs);
    }
    return false;
  }
}

Remove rogue Cloneable interface implementation


package edu.northwestern.bioinformatics.studycalendar.domain;

import javax.persistence.Entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Transient;

/**
 * @author Nataliya Shurupova
 */

@Entity
@DiscriminatorValue(value="2")
public class DayOfTheWeek extends Holiday {
    private String dayOfTheWeek;

    @Transient
    public String getDisplayName() {
        return getDayOfTheWeek();
    }

    @Transient
    public int getDayOfTheWeekInteger() {
        return mapDayNameToInteger(getDayOfTheWeek());
    }

    public String getDayOfTheWeek() {
        return this.dayOfTheWeek;
    }

    public void setDayOfTheWeek(String dayOfTheWeek) {
        this.dayOfTheWeek = dayOfTheWeek;
    }

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

        DayOfTheWeek that = (DayOfTheWeek) o;

        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)
            return false;

        return true;
    }

    @Override
    public String toString(){
        StringBuffer sb = new StringBuffer();
        sb.append("Id = ");
        sb.append(getId());
        sb.append(" DayOfTheWeek = ");
        sb.append(getDayOfTheWeek());
        sb.append(super.toString());
        return sb.toString();
    }
}

package edu.northwestern.bioinformatics.studycalendar.domain;

import javax.persistence.Entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Transient;

/**
 * @author Nataliya Shurupova
 */

@Entity
@DiscriminatorValue(value="2")
public class DayOfTheWeek extends Holiday {
    // TODO: This ought to be the java.util.Calendar constant for the day, or a custom enum
    private String dayOfTheWeek;

    @Transient
    public String getDisplayName() {
        return getDayOfTheWeek();
    }

    @Transient
    public int getDayOfTheWeekInteger() {
        return mapDayNameToInteger(getDayOfTheWeek());
    }

    public String getDayOfTheWeek() {
        return this.dayOfTheWeek;
    }

    public void setDayOfTheWeek(String dayOfTheWeek) {
        this.dayOfTheWeek = dayOfTheWeek;
    }

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

        DayOfTheWeek that = (DayOfTheWeek) o;

        if (dayOfTheWeek != null ? !dayOfTheWeek.equals(that.dayOfTheWeek) : that.dayOfTheWeek != null)
            return false;

        return true;
    }

    @Override
    public String toString(){
        StringBuffer sb = new StringBuffer();
        sb.append("Id = ");
        sb.append(getId());
        sb.append(" DayOfTheWeek = ");
        sb.append(getDayOfTheWeek());
        sb.append(super.toString());
        return sb.toString();
    }
}

Add TODO about using an enum instead of an unconstrained string


package org.codehaus.modello.plugin;

/*
 * LICENSE
 */

import java.io.Reader;
import java.util.Properties;

import org.codehaus.modello.Model;
import org.codehaus.modello.ModelloException;

/**
 * @author Trygve Laugstøl
 * @version $Id$
 */
public interface ModelloTranslator
{
    Model translate( Reader reader, Properties parameters )
        throws ModelloException;
}

package org.codehaus.modello.plugin;

/*
 * LICENSE
 */

import java.io.Reader;
import java.util.Properties;

import org.codehaus.modello.Model;
import org.codehaus.modello.ModelloException;

/**
 * @author Trygve Laugstøl
 * @version $Id$
 */
public interface ModelloTranslator
{
    Model translate( Reader reader, Properties parameters )
        throws ModelloException;

    void translate( Model model, Properties parameters )
        throws ModelloException;
}

Add translator method from Model


package com.veyndan.hermes.database;

import android.database.sqlite.SQLiteDatabase;

import com.squareup.sqlbrite.BriteDatabase;
import com.veyndan.hermes.home.model.Comic;

import java.util.List;

public class Db {

    public static void insert(BriteDatabase db, List<Comic> comics) {
        BriteDatabase.Transaction transaction = db.newTransaction();
        try {
            for (Comic comic: comics) {
                db.insert(Comic.TABLE, comic.toContentValues(), SQLiteDatabase.CONFLICT_IGNORE);
            }
            transaction.markSuccessful();
        } finally {
            transaction.end();
        }
    }

}

package com.veyndan.hermes.database;

import com.squareup.sqlbrite.BriteDatabase;
import com.veyndan.hermes.home.model.Comic;

import java.util.List;

public class Db {

    public static void insert(BriteDatabase db, List<Comic> comics) {
        BriteDatabase.Transaction transaction = db.newTransaction();
        try {
            for (Comic comic: comics) {
                db.insert(Comic.TABLE, comic.toContentValues());
            }
            transaction.markSuccessful();
        } finally {
            transaction.end();
        }
    }

}

Throw error on insertion conflict instead of ignoring it


package net.tropicraft.core.common.dimension.layer;

import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.layer.traits.IC0Transformer;

public final class TropicraftAddSubBiomesLayer implements IC0Transformer {
	final int baseID;
	final int[] subBiomeIDs;

	TropicraftAddSubBiomesLayer(final int baseID, final int[] subBiomeIDs) {
		this.baseID = baseID;
		this.subBiomeIDs = subBiomeIDs;
	}

	public static TropicraftAddSubBiomesLayer rainforest(TropicraftBiomeIds biomeIds) {
		return new TropicraftAddSubBiomesLayer(biomeIds.rainforestPlains, new int[] { biomeIds.rainforestHills, biomeIds.rainforestMountains });
	}

	@Override
	public int apply(INoiseRandom random, int center) {
		if (center == baseID) {
			return subBiomeIDs[random.random(subBiomeIDs.length)];
		} else {
			return center;
		}
	}
}

package net.tropicraft.core.common.dimension.layer;

import net.minecraft.world.gen.INoiseRandom;
import net.minecraft.world.gen.layer.traits.IC0Transformer;

public final class TropicraftAddSubBiomesLayer implements IC0Transformer {
	final int baseID;
	final int[] subBiomeIDs;

	TropicraftAddSubBiomesLayer(final int baseID, final int[] subBiomeIDs) {
		this.baseID = baseID;
		this.subBiomeIDs = subBiomeIDs;
	}

	public static TropicraftAddSubBiomesLayer rainforest(TropicraftBiomeIds biomeIds) {
		return new TropicraftAddSubBiomesLayer(biomeIds.rainforestPlains, new int[] { biomeIds.rainforestPlains, biomeIds.rainforestHills, biomeIds.rainforestMountains });
	}

	@Override
	public int apply(INoiseRandom random, int center) {
		if (center == baseID) {
			return subBiomeIDs[random.random(subBiomeIDs.length)];
		} else {
			return center;
		}
	}
}

Fix Rainforest Plains not being generated


/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.bootstrap.model.system;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import lombok.Getter;
import lombok.Setter;

/**
 * System configuration. The name property corresponds to the key.
 */
@Entity
@Table(name = "S_CONFIGURATION", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
@Getter
@Setter
public class SystemConfiguration extends AbstractNamedValue<Integer> {

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

	// Nothing

}

/*
 * Licensed under MIT (https://github.com/ligoj/ligoj/blob/master/LICENSE)
 */
package org.ligoj.bootstrap.model.system;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.ligoj.bootstrap.core.model.AbstractNamedAuditedEntity;

import lombok.Getter;
import lombok.Setter;

/**
 * System configuration. The name property corresponds to the key.
 */
@Entity
@Table(name = "S_CONFIGURATION", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
@Getter
@Setter
public class SystemConfiguration extends AbstractNamedAuditedEntity<Integer> {

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

	/**
	 * Value as string.
	 */
	@NotBlank
	@NotNull
	@Size(max = 8192)
	private String value;

}

Update configuration value size to 8K


package edu.agh.tunev.ui.plot;

import java.beans.PropertyVetoException;

import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;

public abstract class AbstractPlot extends JInternalFrame {

	private static final long serialVersionUID = 1L;

	/**
	 * Nazwa wykresu w UI.
	 */
	public static String PLOT_NAME;

	public AbstractPlot(int modelNumber, String modelName, int plotNumber,
			Class<? extends AbstractPlot> subclass) {
		String name = null;
		try {
			name = (String) subclass.getDeclaredField("PLOT_NAME").get(this);
		} catch (IllegalArgumentException | IllegalAccessException
				| NoSuchFieldException | SecurityException e1) {
		}

		setTitle(modelNumber + ": " + modelName + " - " + plotNumber + ": "
				+ name);
		setSize(400, 300);
		setLocation(modelNumber * 20 + 400 + (plotNumber - 1) * 20, modelNumber
				* 20 + (plotNumber - 1) * 20);
		setFrameIcon(null);
		setResizable(true);
		setClosable(true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setVisible(true);

		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					AbstractPlot.this.setSelected(true);
				} catch (PropertyVetoException e) {
					AbstractPlot.this.toFront();
				}
			}
		});
	}

}

package edu.agh.tunev.ui.plot;

import java.beans.PropertyVetoException;

import javax.swing.JInternalFrame;
import javax.swing.SwingUtilities;

public abstract class AbstractPlot extends JInternalFrame {

	private static final long serialVersionUID = 1L;

	/**
	 * Nazwa wykresu w UI.
	 */
	public static String PLOT_NAME;

	public AbstractPlot(int modelNumber, String modelName, int plotNumber,
			Class<? extends AbstractPlot> subclass) {
		String name = null;
		try {
			name = (String) subclass.getDeclaredField("PLOT_NAME").get(this);
		} catch (IllegalArgumentException | IllegalAccessException
				| NoSuchFieldException | SecurityException e1) {
		}

		setTitle(modelNumber + ": " + modelName + " - " + plotNumber + ": "
				+ name);
		setSize(400, 300);
		setLocation(modelNumber * 20 + 400 + 20 + plotNumber * 20, modelNumber
				* 20 + 20 + plotNumber * 20);
		setFrameIcon(null);
		setResizable(true);
		setClosable(true);
		setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		setVisible(true);

		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					AbstractPlot.this.setSelected(true);
				} catch (PropertyVetoException e) {
					AbstractPlot.this.toFront();
				}
			}
		});
	}

}

Move default position of plot slightly (would cover visualization)


package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.address.logic.commands.UndoCommand;
import seedu.address.testutil.TestTask;
import seedu.address.logic.commands.DeleteCommand;

public class UndoCommandTest extends TaskManagerGuiTest {

    private TestTask[] expectedList = td.getTypicalTasks();

    /**
     * Tries to undo an add command
     */
    @Test
    public void undoAdd() {
        TestTask taskToAdd = td.alice;
        commandBox.runCommand(taskToAdd.getAddCommand());
        assertUndoSuccess(expectedList);
    }

    /**
     * Tries to undo a delete command
     */
    @Test
    public void undoDelete() {
        int targetIndex = 1;
        commandBox.runCommand(DeleteCommand.COMMAND_WORD + " " + targetIndex);

        assertUndoSuccess(expectedList);
    }

    private void assertUndoSuccess(TestTask[] expectedList) {
        commandBox.runCommand(UndoCommand.COMMAND_WORD);
        assertTrue(taskListPanel.isListMatching(expectedList));
        assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS));

    }

}

package guitests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import seedu.address.logic.commands.ClearCommand;
import seedu.address.logic.commands.DeleteCommand;
import seedu.address.logic.commands.UndoCommand;
import seedu.address.testutil.TestTask;
import seedu.address.logic.commands.DeleteCommand;

public class UndoCommandTest extends TaskManagerGuiTest {

    private TestTask[] expectedList = td.getTypicalTasks();

    /**
     * Tries to undo an add command
     */
    @Test
    public void undoAdd() {
        TestTask taskToAdd = td.alice;
        commandBox.runCommand(taskToAdd.getAddCommand());
        assertUndoSuccess(expectedList);
    }

    /**
     * Tries to undo a delete command
     */
    @Test
    public void undoDelete() {
        int targetIndex = 1;
        commandBox.runCommand(DeleteCommand.COMMAND_WORD + " " + targetIndex);

        assertUndoSuccess(expectedList);
    }

    /**
     * Tries to undo a clear command
     */
    @Test
    public void undoClear() {
        commandBox.runCommand("mark 1");
        commandBox.runCommand("mark 2");
        commandBox.runCommand(ClearCommand.COMMAND_WORD + " done");

        expectedList[0].setStatus("done");
        expectedList[0].setStatus("done");
        assertUndoSuccess(expectedList);
    }

    private void assertUndoSuccess(TestTask[] expectedList) {
        commandBox.runCommand(UndoCommand.COMMAND_WORD);
        assertTrue(taskListPanel.isListMatching(expectedList));
        assertResultMessage(String.format(UndoCommand.MESSAGE_SUCCESS));

    }

}

Add test case for undo clear command


package assignment3;

public class LinkedList {

	private Nodes root = null;

	public boolean findNode(Nodes node){
        if(node==null) return false;
        Nodes currentNode = root;
        while(currentNode.getName()!= node.getName())
        {
            currentNode = currentNode.getNext();
            if(currentNode == null)
                return false;
        }
        return true;
    }
    public void iterate(){
    	System.out.println("Iterate forward...");
       Nodes temp = root;
       while(temp!=null){
    	   System.out.println(temp.toString());
    	   temp = temp.getNext();
       }

    }
}

package assignment3;

public class LinkedList {

	private Nodes root = null;

	public boolean findNode(Nodes node){
        if(node==null) return false;
        Nodes currentNode = root;
        while(currentNode.getName()!= node.getName())
        {
            currentNode = currentNode.getNext();
            if(currentNode == null)
                return false;
        }
        return true;
    }
    public void iterate(){
    	System.out.println("Iterate forward...");
       Nodes temp = root;
       while(temp!=null){
    	   System.out.println(temp.toString());
    	   temp = temp.getNext();
       }

    }
    public boolean remove(Nodes node){
    	return false;
    }
}

Add delete a node option


package net.sourceforge.javydreamercsw.mysql.driver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import org.netbeans.api.db.explorer.DatabaseException;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.db.explorer.JDBCDriverManager;
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.windows.WindowManager;

public class Installer extends ModuleInstall {

    public static final String mysqlDriverClass = "com.mysql.jdbc.Driver";
    private static final Logger LOG =
            Logger.getLogger(Installer.class.getCanonicalName());

    @Override
    public void restored() {
        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
            @Override
            public void run() {
                //Check drivers
                if (JDBCDriverManager.getDefault().getDrivers(mysqlDriverClass).length == 0) {
                    try {
                        LOG.fine("Registering MySQL driver!");
                        JDBCDriverManager.getDefault().addDriver(
                                JDBCDriver.create("mysql", "MySQL",
                                mysqlDriverClass,
                                new URL[]{new URL(
                            "nbinst:/modules/ext/com.validation.manager.mysql/1/mysql/mysql-connector-java.jar")}));
                    } catch (DatabaseException ex) {
                        Exceptions.printStackTrace(ex);
                    } catch (MalformedURLException ex) {
                        Exceptions.printStackTrace(ex);
                    }
                }
            }
        });
    }
}

package net.sourceforge.javydreamercsw.mysql.driver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Logger;
import org.netbeans.api.db.explorer.DatabaseException;
import org.netbeans.api.db.explorer.JDBCDriver;
import org.netbeans.api.db.explorer.JDBCDriverManager;
import org.openide.modules.ModuleInstall;
import org.openide.util.Exceptions;
import org.openide.windows.WindowManager;

public class Installer extends ModuleInstall {

    public static final String DRIVER = "com.mysql.cj.jdbc.Driver";
    private static final Logger LOG
            = Logger.getLogger(Installer.class.getCanonicalName());

    @Override
    public void restored() {
        WindowManager.getDefault().invokeWhenUIReady(() -> {
            //Check drivers
            if (JDBCDriverManager.getDefault().getDrivers(DRIVER).length == 0) {
                try {
                    LOG.fine("Registering MySQL driver!");
                    JDBCDriverManager.getDefault().addDriver(
                            JDBCDriver.create("mysql", "MySQL",
                                    DRIVER,
                                    new URL[]{new URL(
                                                "nbinst:/modules/ext/com.validation.manager.mysql/1/mysql/mysql-connector-java.jar")}));
                } catch (DatabaseException | MalformedURLException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        });
    }
}

Use correct driver class as the old one is being deprecated.


package com.jmonad.seq;

import org.junit.Test;

public class SeqDropTest {

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

  @Test public void dropListElementsTest() {
    assert elements.drop(5).toArrayList().toString().equals("[6, 7, 8, 9, 10]");
  }

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

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

  @Test public void dropElementsWithAmountHigherThanListSizeTest() {
    assert elements.drop(20).toArrayList().toString().equals("[]");
  }
}

package com.jmonad.seq;

import org.junit.Test;

public class SeqDropTest {

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

  @Test public void dropListElementsTest() {
    assert elements.drop(5).toArrayList().toString().equals("[6, 7, 8, 9, 10]");
  }

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

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

  @Test public void dropElementsWithAmountHigherThanListSizeTest() {
    assert elements.drop(20).toArrayList().toString().equals("[]");
  }
}

Initialize seq without type in drop test class


/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch 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 org.elasticsearch.cloud.aws;

import com.amazonaws.auth.AWSCredentialsProvider;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;

public class SyspropCredentialsTests extends ESTestCase {
    public void test() {
        AWSCredentialsProvider provider =
            InternalAwsS3Service.buildCredentials(logger, deprecationLogger, Settings.EMPTY, Settings.EMPTY, "default");
        // NOTE: sys props are setup by the test runner in gradle
        assertEquals("sysprop_access", provider.getCredentials().getAWSAccessKeyId());
        assertEquals("sysprop_secret", provider.getCredentials().getAWSSecretKey());
        assertWarnings("Supplying S3 credentials through system properties is deprecated");
    }
}

/*
 * Licensed to Elasticsearch under one or more contributor
 * license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright
 * ownership. Elasticsearch 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 org.elasticsearch.cloud.aws;

import com.amazonaws.auth.AWSCredentialsProvider;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;

public class SyspropCredentialsTests extends ESTestCase {
    public void test() {
        AWSCredentialsProvider provider =
            InternalAwsS3Service.buildCredentials(logger, deprecationLogger, Settings.EMPTY, Settings.EMPTY, "default");
        // NOTE: sys props are setup by the test runner in gradle
        assertEquals("sysprop_access", provider.getCredentials().getAWSAccessKeyId());
        assertEquals("sysprop_secret", provider.getCredentials().getAWSSecretKey());
        assertWarnings("Supplying S3 credentials through system properties is deprecated. " +
                "See the breaking changes lists in the documentation for details.");
    }
}

Fix another warning assertion in credentials test


/*
 * Copyright 2018 ImpactDevelopment
 *
 * 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 clientapi;

/**
 * Used to track the version of the API. An API version
 * consists of a Major, Minor, and Patch version.
 *
 * @author Brady
 * @since 8/16/2017 7:11 PM
 */
public final class Version {

    private Version() {}

    /**
     * Incremented when a new version of Minecraft is released, never reset
     */
    public static final int MAJOR = 3;

    /**
     * Incremented when API-breaking changes are made, reset when major version is modified
     */
    public static final int MINOR = 0;

    /**
     * Incremented every release, reset when the minor version is modified
     */
    public static final int PATCH = 0;

    /**
     * @return The version formatted as {@code MAJOR.MINOR.PATCH}
     */
    public static String getVersion() {
        return String.format("%d.%d.%d", MAJOR, MINOR, PATCH);
    }
}

/*
 * Copyright 2018 ImpactDevelopment
 *
 * 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 clientapi;

/**
 * Used to track the version of the API. An API version
 * consists of a Major, Minor, and Patch version.
 *
 * @author Brady
 * @since 8/16/2017 7:11 PM
 */
public final class Version {

    private Version() {}

    /**
     * Incremented when a new version of Minecraft is released, never reset
     */
    public static final int MAJOR = 3;

    /**
     * Incremented when API-breaking changes are made, reset when major version is modified
     */
    public static final int MINOR = 0;

    /**
     * Incremented every release, reset when the minor version is modified
     */
    public static final int PATCH = 1;

    /**
     * @return The version formatted as {@code MAJOR.MINOR.PATCH}
     */
    public static String getVersion() {
        return String.format("%d.%d.%d", MAJOR, MINOR, PATCH);
    }
}

Update the version to 3.0.1


package de.fhdw.wipbank.server.model;

import java.math.BigDecimal;
import java.util.Date;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

import com.sun.jmx.snmp.Timestamp;

@XmlRootElement
public class Transaction {
    private int id;
    private Account sender;
    private Account receiver;
    private BigDecimal amount;
    private String reference;
    private Timestamp transactionDate; // siehe Schnittstellen/Aufrufbeispiele -> Timestamp: "transactionDate" : "2016-03-11T17:08:14+0100"

    @XmlTransient
    public int getId() {
        return id;
    }

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

    public Account getSender() {
        return sender;
    }

    public void setSender(Account sender) {
        this.sender = sender;
    }

    public Account getReceiver() {
        return receiver;
    }

    public void setReceiver(Account receiver) {
        this.receiver = receiver;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public Timestamp getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Timestamp transactionDate) {
        this.transactionDate = transactionDate;
    }

}

package de.fhdw.wipbank.server.model;

import java.math.BigDecimal;
import java.util.Date;

import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@XmlRootElement
public class Transaction {
    private int id;
    private Account sender;
    private Account receiver;
    private BigDecimal amount;
    private String reference;
    private Date transactionDate;

    @XmlTransient
    public int getId() {
        return id;
    }

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

    public Account getSender() {
        return sender;
    }

    public void setSender(Account sender) {
        this.sender = sender;
    }

    public Account getReceiver() {
        return receiver;
    }

    public void setReceiver(Account receiver) {
        this.receiver = receiver;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public Date getTransactionDate() {
        return transactionDate;
    }

    public void setTransactionDate(Date transactionDate) {
        this.transactionDate = transactionDate;
    }

}

Revert "transactionDate : Date -> Timestamp"


package de.diesner.ehzlogger;

import java.io.IOException;
import java.util.List;

import gnu.io.PortInUseException;
import gnu.io.UnsupportedCommOperationException;
import org.openmuc.jsml.structures.*;
import org.openmuc.jsml.tl.SML_SerialReceiver;

public class EhzLogger {

    public static void main(String[] args) throws IOException, PortInUseException, UnsupportedCommOperationException {
        System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyUSB0");
        final SML_SerialReceiver receiver = new SML_SerialReceiver();
        receiver.setupComPort("/dev/ttyUSB0");

        Runtime.getRuntime().addShutdownHook(new Thread()
        {
            public void run()
            {
                try {
                    receiver.close();

                } catch (IOException e) {
                    System.err.println("Error while trying to close serial port: " + e.getMessage());
                }
            }
        });

        CmdLinePrint cmdLinePrint = new CmdLinePrint();

        while (true) {

            SML_File smlFile = receiver.getSMLFile();
            System.out.println("Got SML_File");

            cmdLinePrint.messageReceived(smlFile.getMessages());
        }
    }

}

package de.diesner.ehzlogger;

import java.io.IOException;
import java.util.List;

import gnu.io.PortInUseException;
import gnu.io.UnsupportedCommOperationException;
import org.openmuc.jsml.structures.*;
import org.openmuc.jsml.tl.SML_SerialReceiver;

public class EhzLogger {

    public static void main(String[] args) throws IOException, PortInUseException, UnsupportedCommOperationException {
        System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyUSB0");
        final SML_SerialReceiver receiver = new SML_SerialReceiver();
        receiver.setupComPort("/dev/ttyUSB0");

        Runtime.getRuntime().addShutdownHook(new Thread()
        {
            public void run()
            {
                try {
                    receiver.close();

                } catch (IOException e) {
                    System.err.println("Error while trying to close serial port: " + e.getMessage());
                }
            }
        });

        SmlForwarder forwarder = new CmdLinePrint();

        while (true) {

            SML_File smlFile = receiver.getSMLFile();
            System.out.println("Got SML_File");

            forwarder.messageReceived(smlFile.getMessages());
        }
    }

}

Use interface in main to access SmlForwarder