package com.satsumasoftware.timetable.db;

public final class ClassesSchema {

    public static final String TABLE_NAME = "classes";
    public static final String COL_ID = "id";
    public static final String COL_SUBJECT_ID = "subject_id";
    public static final String COL_DAY = "day";
    public static final String COL_START_TIME = "start_time";
    public static final String COL_END_TIME = "end_time";
    public static final String COL_ROOM = "room";
    public static final String COL_TEACHER = "teacher";

    protected static final String SQL_CREATE = "CREATE TABLE " + TABLE_NAME + "( " +
            COL_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_SUBJECT_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_DAY + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_START_TIME + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_END_TIME + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_ROOM + SchemaUtilsKt.TEXT_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_TEACHER + SchemaUtilsKt.TEXT_TYPE +
            " )";

    protected static final String SQL_DELETE =
            "DROP TABLE IF EXISTS " + TABLE_NAME;
}

package com.satsumasoftware.timetable.db;

public final class ClassesSchema {

    public static final String TABLE_NAME = "classes";
    public static final String COL_ID = "id";
    public static final String COL_SUBJECT_ID = "subject_id";
    public static final String COL_DAY = "day";
    public static final String COL_START_TIME_HRS = "start_time_hrs";
    public static final String COL_START_TIME_MINS = "start_time_mins";
    public static final String COL_END_TIME_HRS = "end_time_hrs";
    public static final String COL_END_TIME_MINS = "end_time_mins";
    public static final String COL_ROOM = "room";
    public static final String COL_TEACHER = "teacher";

    protected static final String SQL_CREATE = "CREATE TABLE " + TABLE_NAME + "( " +
            COL_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_SUBJECT_ID + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_DAY + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_START_TIME_HRS + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_START_TIME_MINS + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_END_TIME_HRS + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_END_TIME_MINS + SchemaUtilsKt.INTEGER_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_ROOM + SchemaUtilsKt.TEXT_TYPE + SchemaUtilsKt.COMMA_SEP +
            COL_TEACHER + SchemaUtilsKt.TEXT_TYPE +
            " )";

    protected static final String SQL_DELETE =
            "DROP TABLE IF EXISTS " + TABLE_NAME;
}

Improve the schema for classes to store hours and minutes separately


package org.xblackcat.sjpu.builder;

import org.xblackcat.sjpu.storage.IFunctionalAH;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

/**
 * Functional builder allows only one abstract method per class/interface.
 *
 * @author xBlackCat
 */
public class FunctionalClassBuilder<Base> extends ClassBuilder<Base> {
    public FunctionalClassBuilder(IDefiner definerF, IMethodBuilder... builders) {
        super(definerF, builders);
    }

    @Override
    public <T extends Base> Class<? extends T> build(
            Class<T> target
    ) throws GeneratorException {
        int abstractCount = 0;
        for (Method m : target.getMethods()) {
            if (Modifier.isAbstract(m.getModifiers())) {
                abstractCount++;
            }
        }
        for (Method m : target.getDeclaredMethods()) {
            if (!Modifier.isPublic(m.getModifiers()) && Modifier.isAbstract(m.getModifiers())) {
                abstractCount++;
            }
        }

        if (abstractCount != 1) {
            throw new GeneratorException(
                    "Only single abstract method is allowed for implementation of " +
                            BuilderUtils.getName(IFunctionalAH.class) + ". " + BuilderUtils.getName(target) + " has " +
                            abstractCount
            );
        }

        return super.build(target);
    }
}

package org.xblackcat.sjpu.builder;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

/**
 * Functional builder allows only one abstract method per class/interface.
 *
 * @author xBlackCat
 */
public class FunctionalClassBuilder<Base> extends ClassBuilder<Base> {
    public FunctionalClassBuilder(IDefiner definerF, IMethodBuilder... builders) {
        super(definerF, builders);
    }

    @Override
    public <T extends Base> Class<? extends T> build(
            Class<T> target
    ) throws GeneratorException {
        int abstractCount = 0;
        for (Method m : target.getMethods()) {
            if (Modifier.isAbstract(m.getModifiers())) {
                abstractCount++;
            }
        }
        for (Method m : target.getDeclaredMethods()) {
            if (!Modifier.isPublic(m.getModifiers()) && Modifier.isAbstract(m.getModifiers())) {
                abstractCount++;
            }
        }

        if (abstractCount != 1) {
            throw new GeneratorException(
                    "Only single abstract method is allowed for implementation of functional interface/class. "
                            + BuilderUtils.getName(target) + " has " + abstractCount
            );
        }

        return super.build(target);
    }
}

Remove extra dependency for class builder


package com.alexrnl.gameoflife.service;

import com.alexrnl.gameoflife.world.World;

/**
 * Interface for listeners on a world in the game of life.
 * @author barfety_a
 */
public interface WorldListener {

	/**
	 * Called when a new generation has been generated.
	 * @param word
	 *        the world generated.
	 */
	void newGeneration (World word);

	/**
	 * Called when a world that was previously generated is generated again.
	 * @param world
	 *        the world generated.
	 * @param previousOccurence
	 *        the number of the generation is has occurred before.
	 */
	void loopGeneration (World world, int previousOccurence);
}

package com.alexrnl.gameoflife.service;

import com.alexrnl.gameoflife.world.World;

/**
 * Interface for listeners on a world in the game of life.
 * @author barfety_a
 */
public interface WorldListener {

	/**
	 * Called when a new generation has been generated.
	 * @param world
	 *        the world generated.
	 */
	void newGeneration (World world);

	/**
	 * Called when a world that was previously generated is generated again.
	 * @param world
	 *        the world generated.
	 * @param previousOccurence
	 *        the number of the generation is has occurred before.
	 */
	void loopGeneration (World world, int previousOccurence);
}

Fix spelling error in parameter

Fix spelling error in parameter


package org.browsermob.proxy;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.Provider;

import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

@Singleton
public class ProxyManager {
    private AtomicInteger portCounter = new AtomicInteger(9090);
    private Provider<ProxyServer> proxyServerProvider;
    private Map<Integer, ProxyServer> proxies = new ConcurrentHashMap<Integer, ProxyServer>();

    @Inject
    public ProxyManager(Provider<ProxyServer> proxyServerProvider) {
        this.proxyServerProvider = proxyServerProvider;
    }

    public ProxyServer create(Map<String, String> options) throws Exception {
        int port = portCounter.incrementAndGet();
        ProxyServer proxy = proxyServerProvider.get();

        proxy.setPort(port);
        proxy.start();
        proxy.setOptions(options);

        proxies.put(port, proxy);

        return proxy;
    }

    public ProxyServer get(int port) {
        return proxies.get(port);
    }

    public void delete(int port) throws Exception {
        ProxyServer proxy = proxies.remove(port);
        proxy.stop();
    }
}

package org.browsermob.proxy;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.inject.Provider;

import java.util.Hashtable;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

@Singleton
public class ProxyManager {
    private AtomicInteger portCounter = new AtomicInteger(9090);
    private Provider<ProxyServer> proxyServerProvider;
    private Map<Integer, ProxyServer> proxies = new ConcurrentHashMap<Integer, ProxyServer>();

    @Inject
    public ProxyManager(Provider<ProxyServer> proxyServerProvider) {
        this.proxyServerProvider = proxyServerProvider;
    }

    public ProxyServer create(Map<String, String> options, int port) throws Exception {
        ProxyServer proxy = proxyServerProvider.get();
        proxy.setPort(port);
        proxy.start();
        proxy.setOptions(options);
        proxies.put(port, proxy);
        return proxy;
    }

    public ProxyServer create(Map<String, String> options) throws Exception {
        int port = portCounter.incrementAndGet();
        ProxyServer proxy = proxyServerProvider.get();

        proxy.setPort(port);
        proxy.start();
        proxy.setOptions(options);

        proxies.put(port, proxy);

        return proxy;
    }

    public ProxyServer get(int port) {
        return proxies.get(port);
    }

    public void delete(int port) throws Exception {
        ProxyServer proxy = proxies.remove(port);
        proxy.stop();
    }
}

Add constructor for proxy on specific port Create a proxy on a specific port rather than just increment the count


package br.com.MDSGPP.ChamadaParlamentar.exception;

/*esta exception é para verificar se a data foi inserida *
 * corretamente pelo usuario *
 */
public class DataFormatoErradoException extends Exception {

	private static final long serialVersionUID = 1L;

	public DataFormatoErradoException() {
		super();
	}

}

package br.com.MDSGPP.ChamadaParlamentar.exception;

/*esta exception é para verificar se a data foi inserida *
 * corretamente pelo usuario *
 */
public class DataFormatoErradoException extends Exception {

	private static final long serialVersionUID = 1L;

	/**
	 * This exception is to check whether the date was entered correctly by
	 * User.
	 */

	public DataFormatoErradoException() {
		super();
	}

}

Comment the method of class DataFormatoErradoExce


/*
 * Copyright 2019 DiffPlug
 *
 * 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
 *
 *     https://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.diffplug.gradle.oomph.thirdparty;

import com.diffplug.gradle.oomph.IUs;
import com.diffplug.gradle.oomph.OomphIdeExtension;

/**
 * Adds the [minimalist gradle editor](https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.enide.editors.gradle).
 */
public class ConventionMinimalistGradleEditor extends WithRepoConvention {
	public static final String REPO = "https://www.nodeclipse.org/updates/gradle-ide-pack/";
	public static final String FEATURE = "org.nodeclipse.enide.editors.gradle.feature";

	ConventionMinimalistGradleEditor(OomphIdeExtension extension) {
		super(extension, REPO);
		requireIUs(IUs.featureGroup(FEATURE));
	}
}

/*
 * Copyright 2019 DiffPlug
 *
 * 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
 *
 *     https://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.diffplug.gradle.oomph.thirdparty;

import com.diffplug.gradle.oomph.IUs;
import com.diffplug.gradle.oomph.OomphIdeExtension;

/**
 * Adds the [minimalist gradle editor](https://github.com/Nodeclipse/nodeclipse-1/tree/master/org.nodeclipse.enide.editors.gradle).
 */
public class ConventionMinimalistGradleEditor extends WithRepoConvention {
	public static final String REPO = "https://nodeclipse.github.io/updates/gradle-ide-pack/";
	public static final String FEATURE = "org.nodeclipse.enide.editors.gradle.feature";

	ConventionMinimalistGradleEditor(OomphIdeExtension extension) {
		super(extension, REPO);
		requireIUs(IUs.featureGroup(FEATURE));
	}
}

Update URL for the minimalistGradleEditor update-site.


package cn.six.uav.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by songzhw on 2016/3/10.
 */
public class CommandRunner {

    private List<String> outputs;

    public void run(List<String> cmds) throws Exception {
        outputs = new ArrayList<>();
        ProcessBuilder procBuilder = new ProcessBuilder(cmds)
                                            .redirectErrorStream(true);
        final Process proc = procBuilder.start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                String line;
                outputs.clear();
                try {
                    InputStream is = proc.getInputStream();
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    while( (line = reader.readLine()) != null){
                        outputs.add(line);
                    }

                    for(String aline : outputs){
                        System.out.println("szw line = "+aline);
                    }

                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }) .start();

    }
}

package cn.six.uav.util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by songzhw on 2016/3/10.
 */
public class CommandRunner {

    private List<String> outputs;

    public int run(List<String> cmds) throws Exception {
        outputs = new ArrayList<>();
        ProcessBuilder procBuilder = new ProcessBuilder(cmds)
                                            .redirectErrorStream(true);
        final Process proc = procBuilder.start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                String line;
                outputs.clear();
                try {
                    InputStream is = proc.getInputStream();
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    while( (line = reader.readLine()) != null){
                        outputs.add(line);
                    }

                    for(String aline : outputs){
                        System.out.println("szw line = "+aline);
                    }

                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }) .start();

        return proc.waitFor();
    }
}

Fix the bug : the running of two processes are not synchronous


/*
 * Created on 28-Jan-2006
 */
package uk.org.ponder.htmlutil;

public class HTMLConstants {

  public static final String JS_BLOCK_START = "\n//<![CDATA[\n";
  public static final String JS_BLOCK_END = "\n//]]>\n";

  public static String[][] tagtoURL = {
    {"href", "<a ", "<link "},
    {"src", "<img ", "<frame ", "<script ", "<iframe ", "<style ", "<input ", "<embed "},
    {"action", "<form "}
  };
// Every tag may have a "background" attribute holding a URL
  public static String[] ubiquitousURL = {"background"};
}

/*
 * Created on 28-Jan-2006
 */
package uk.org.ponder.htmlutil;

public class HTMLConstants {

  public static final String JS_BLOCK_START = "\n//<![CDATA[\n";
  public static final String JS_BLOCK_END = "\n//]]>\n";

  public static String[][] tagtoURL = {
    {"href", "<a ", "<link "},
    {"src", "<img ", "<frame ", "<script ", "<iframe ", "<style ", "<input ", "<embed ", },
    {"action", "<form "},
    {"codebase", "<applet ", "<object "}
  };
// Every tag may have a "background" attribute holding a URL
  public static String[] ubiquitousURL = {"background"};
}

Support for applet and object codebase

Support for applet and object codebase


/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Ivan Maslov
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * 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 info.maslowis.twitterripper.command;

import twitter4j.Twitter;

/**
 * The superclass for any twitter command
 *
 * @author Ivan Maslov
 */
public abstract class TwitterCommand extends Command {
    protected Twitter twitter;

    protected TwitterCommand(Twitter twitter) {
        super();
        this.twitter = twitter;
    }
}

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Ivan Maslov
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * 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 info.maslowis.twitterripper.command;

import twitter4j.Twitter;
import twitter4j.TwitterFactory;

/**
 * The superclass for any twitter command
 *
 * @author Ivan Maslov
 */
public abstract class TwitterCommand extends Command {
    protected Twitter twitter;

    protected TwitterCommand() {
        super();
        this.twitter = TwitterFactory.getSingleton();
    }
}

Change reference on the twitter's singleton


package com.newsblur.activity;

import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.newsblur.R;
import com.newsblur.util.PrefConstants;

import android.os.Bundle;

public class Settings extends SherlockPreferenceActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.getPreferenceManager().setSharedPreferencesName(PrefConstants.PREFERENCES);
        addPreferencesFromResource(R.layout.activity_settings);
    }

}

package com.newsblur.activity;

import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.actionbarsherlock.view.MenuItem;
import com.newsblur.R;
import com.newsblur.util.PrefConstants;

import android.os.Bundle;

public class Settings extends SherlockPreferenceActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        super.getPreferenceManager().setSharedPreferencesName(PrefConstants.PREFERENCES);
        addPreferencesFromResource(R.layout.activity_settings);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            finish();
            return true;
        default:
            return super.onOptionsItemSelected(item);
        }
    }
}

Support navigating back to home page from action bar in Preferences


package main.managepdf;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;

/**
 * Define funes para gerenciar em um PDF.
 * @author Alex
 *
 * @param <T> - Tipo da informao a ser gerenciada.
 */
public interface ManageBasePDF<T>{

	/**
	 * Cria um PDF com anotaes.
	 * @param infos - lista de anotaes a serem adicionadas a um PDF
	 * @param pdfFile - O pdf sem as anotaes
	 * @return pdf com anotaes
	 * @throws FileNotFoundException - Pdf nao foi encontrado
	 */
	public File createPDFWithInfo(List<T> objects, File pdfFile) throws FileNotFoundException;

}

package main.managepdf;

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

/**
 * Define funes para gerenciar em um PDF.
 * @author Alex
 *
 * @param <T> - Tipo da informao a ser gerenciada.
 */
public interface ManageBasePDF<T>{

	/**
	 * Cria um PDF com anotaes.
	 * @param infos - lista de anotaes a serem adicionadas a um PDF
	 * @param pdfFile - O pdf sem as anotaes
	 * @return pdf com anotaes
	 * @throws FileNotFoundException - Pdf nao foi encontrado
	 * @throws IOException - Erro ao tentar salvar PDF com anotaes
	 */
	public File createPDFWithInfo(List<T> objects, File pdfFile) throws FileNotFoundException, IOException;

}

Add de execessao ao tentar salvar PDF com anotações


package org.pdxfinder.dao;

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

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

    @GraphId
    Long id;

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

    public QualityAssurance() {
    }

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

        this.passages = passages;
    }

    public String getTechnology() {
        return technology;
    }

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

    public String getDescription() {
        return description;
    }

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

    public String getPassages() {
        return passages;
    }

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

package org.pdxfinder.dao;

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

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

    @GraphId
    Long id;

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

    public QualityAssurance() {
    }

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

        this.passages = passages;
    }

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

    public String getTechnology() {
        return technology;
    }

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

    public String getDescription() {
        return description;
    }

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

    public String getPassages() {
        return passages;
    }

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

    public String getValidationHostStrain() {
        return validationHostStrain;
    }

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

Add host strain to validation

Add host strain to validation


package org.wikipedia.dataclient.mwapi;

import android.support.annotation.Nullable;

import com.google.gson.annotations.SerializedName;

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

@SuppressWarnings("unused")
public class EditorTaskCounts {
    @Nullable private Counts counts;
    @Nullable private Targets targetsPassed;

    @Nullable
    public Map<String, Integer> getDescriptionEditsPerLanguage() {
        return counts != null && counts.appDescriptionEdits != null ? counts.appDescriptionEdits : null;
    }

    @Nullable
    public List<Integer> getDescriptionEditTargetsPassed() {
        return targetsPassed != null && targetsPassed.appDescriptionEdits != null ? targetsPassed.appDescriptionEdits : null;
    }

    public class Counts {
        @Nullable @SerializedName("app_description_edits") private Map<String, Integer> appDescriptionEdits;
    }

    public class Targets {
        @Nullable @SerializedName("app_description_edits") private List<Integer> appDescriptionEdits;
    }
}

package org.wikipedia.dataclient.mwapi;

import android.support.annotation.Nullable;

import com.google.gson.annotations.SerializedName;

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

@SuppressWarnings("unused")
public class EditorTaskCounts {
    @Nullable private Counts counts;
    @Nullable @SerializedName("targets_passed") private Targets targetsPassed;

    @Nullable
    public Map<String, Integer> getDescriptionEditsPerLanguage() {
        return counts != null && counts.appDescriptionEdits != null ? counts.appDescriptionEdits : null;
    }

    @Nullable
    public List<Integer> getDescriptionEditTargetsPassed() {
        return targetsPassed != null && targetsPassed.appDescriptionEdits != null ? targetsPassed.appDescriptionEdits : null;
    }

    public class Counts {
        @Nullable @SerializedName("app_description_edits") private Map<String, Integer> appDescriptionEdits;
    }

    public class Targets {
        @Nullable @SerializedName("app_description_edits") private List<Integer> appDescriptionEdits;
    }
}

Update field name from API response.

Update field name from API response.

Change-Id: I32cea531a3074c81d5da230f4862ecca03ac70ff


package cucumber.runtime.java;

import cucumber.api.java.ObjectFactory;
import cucumber.runtime.CucumberException;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;

/**
 * This class has package scope so it doesn't get loaded by reflection,
 * thereby colliding with other DI implementations.
 */
class DefaultJavaObjectFactory implements ObjectFactory {
    private final Map<Class<?>, Object> instances = new HashMap<Class<?>, Object>();

    public void start() {
        // No-op
    }

    public void stop() {
        instances.clear();
    }

    public boolean addClass(Class<?> clazz) {
        return true;
    }

    public <T> T getInstance(Class<T> type) {
        T instance = type.cast(instances.get(type));
        if (instance == null) {
            instance = cacheNewInstance(type);
        }
        return instance;
    }

    private <T> T cacheNewInstance(Class<T> type) {
        try {
            Constructor<T> constructor = type.getConstructor();
            T instance = constructor.newInstance();
            instances.put(type, instance);
            return instance;
        } catch (NoSuchMethodException e) {
            throw new CucumberException(String.format("%s doesn't have an empty constructor. If you need DI, put cucumber-picocontainer on the classpath", type), e);
        } catch (Exception e) {
            throw new CucumberException(String.format("Failed to instantiate %s", type), e);
        }
    }
}

package cucumber.runtime.java;

import cucumber.api.java.ObjectFactory;
import cucumber.runtime.CucumberException;

import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;

/**
 * This class has package scope so it doesn't get loaded by reflection,
 * thereby colliding with other DI implementations.
 */
class DefaultJavaObjectFactory implements ObjectFactory {
    private final Map<Class<?>, Object> instances = new HashMap<Class<?>, Object>();

    public void start() {
        // No-op
    }

    public void stop() {
        instances.clear();
    }

    public boolean addClass(Class<?> clazz) {
        return true;
    }

    public <T> T getInstance(Class<T> type) {
        T instance = type.cast(instances.get(type));
        if (instance == null) {
            instance = cacheNewInstance(type);
        }
        return instance;
    }

    private <T> T cacheNewInstance(Class<T> type) {
        try {
            Constructor<T> constructor = type.getConstructor();
            T instance = constructor.newInstance();
            instances.put(type, instance);
            return instance;
        } catch (NoSuchMethodException e) {
            throw new CucumberException(String.format("%s doesn't have an empty constructor. If you need DI, put cucumber-picocontainer on the classpath", type), e);
        } catch (Exception e) {
            throw new CucumberException(String.format("Failed to instantiate %s", type), e);
        }
    }
}

Use service loader for ObjectFactory

[Java] Use service loader for ObjectFactory


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

package bisq.network.p2p.storage;

import bisq.network.p2p.storage.payload.ProtectedStorageEntry;

import java.util.Collection;

public interface HashMapChangedListener {
    void onAdded(Collection<ProtectedStorageEntry> protectedStorageEntries);

    @SuppressWarnings("UnusedParameters")
    void onRemoved(Collection<ProtectedStorageEntry> protectedStorageEntries);
}

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

package bisq.network.p2p.storage;

import bisq.network.p2p.storage.payload.ProtectedStorageEntry;

import java.util.Collection;

public interface HashMapChangedListener {
    void onAdded(Collection<ProtectedStorageEntry> protectedStorageEntries);

    default void onRemoved(Collection<ProtectedStorageEntry> protectedStorageEntries) {
        // Often we are only interested in added data as there is no use case for remove
    }
}

Make onRemoved default in interface

Make onRemoved default in interface


package com.cisco.oss.foundation.logging.transactions;

import org.slf4j.Logger;

/**
 * Created by Nuna on 10/01/2016.
 */
public class ReportLogger extends SchedulerLogger {

    public static void start(final Logger logger, final Logger auditor, final String reportName) {
        if(!createLoggingAction(logger, auditor, new ReportLogger())) {
            return;
        }

        ReportLogger reportLogger = (ReportLogger) getInstance();
        if (reportLogger == null) {
            return;
        }

        reportLogger.startInstance(reportName);
    }

    @Override
    protected void addPropertiesStart(String reportName) {
        super.addPropertiesStart("Report", "ReportName", reportName);
    }

    public static void success(String reportBody) {
        ReportLogger logger = (ReportLogger) getInstance();
        if (logger == null) {
            return;
        }

        addProperty("ReportBody", reportBody);

        logger.successInstance();

    }
}

package com.cisco.oss.foundation.logging.transactions;

import org.slf4j.Logger;

/**
 * Created by Nuna on 10/01/2016.
 */
public class ReportLogger extends SchedulerLogger {

    static private String reportNameFieldName = "ReportName";
    static private String reportBodyFieldName = "ReportBody";

    static public void  setIvpFieldNames(String reportNameFieldName, String reportBodyFieldName) {
        ReportLogger.reportNameFieldName = reportNameFieldName;
        ReportLogger.reportBodyFieldName = reportBodyFieldName;
    }

    public static void start(final Logger logger, final Logger auditor, final String reportName) {
        if(!createLoggingAction(logger, auditor, new ReportLogger())) {
            return;
        }

        ReportLogger reportLogger = (ReportLogger) getInstance();
        if (reportLogger == null) {
            return;
        }

        reportLogger.startInstance(reportName);
    }

    @Override
    protected void addPropertiesStart(String reportName) {
        super.addPropertiesStart("Report", reportNameFieldName, reportName);
    }

    public static void success(String reportBody) {
        ReportLogger logger = (ReportLogger) getInstance();
        if (logger == null) {
            return;
        }

        addProperty(reportBodyFieldName, reportBody);

        logger.successInstance();

    }
}

Allow chaning report field names

Allow chaning report field names


package seedu.scheduler.model.entry;

import seedu.scheduler.commons.exceptions.IllegalValueException;

/**
 * Represents an Entry's name in the scheduler.
 * Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
 */
public class Name {

    public static final String MESSAGE_NAME_CONSTRAINTS = "Entry names should be spaces or alphanumeric characters";
    public static final String NAME_VALIDATION_REGEX = "[\\p{Alnum} ]+";

    public final String fullName;

    /**
     * Validates given name.
     *
     * @throws IllegalValueException if given name string is invalid.
     */
    public Name(String name) throws IllegalValueException {
        assert name != null;
        name = name.trim();
        if (!isValidName(name)) {
            throw new IllegalValueException(MESSAGE_NAME_CONSTRAINTS);
        }
        this.fullName = name;
    }

    /**
     * Returns true if a given string is a valid entry name.
     */
    public static boolean isValidName(String test) {
        return test.matches(NAME_VALIDATION_REGEX);
    }

    @Override
    public String toString() {
        return fullName;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Name // instanceof handles nulls
                && this.fullName.equals(((Name) other).fullName)); // state check
    }

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

}

package seedu.scheduler.model.entry;

import seedu.scheduler.commons.exceptions.IllegalValueException;

/**
 * Represents an Entry's name in the scheduler.
 * Guarantees: immutable; is valid as declared in {@link #isValidName(String)}
 */
public class Name {

    public static final String MESSAGE_NAME_CONSTRAINTS = "Entry names should be spaces or alphanumeric characters";
    //@@author A0126090N
    public static final String NAME_VALIDATION_REGEX = "[\\p{Alnum}\' ]+";
    //@@author

    public final String fullName;

    /**
     * Validates given name.
     *
     * @throws IllegalValueException if given name string is invalid.
     */
    public Name(String name) throws IllegalValueException {
        assert name != null;
        name = name.trim();
        if (!isValidName(name)) {
            throw new IllegalValueException(MESSAGE_NAME_CONSTRAINTS);
        }
        this.fullName = name;
    }

    /**
     * Returns true if a given string is a valid entry name.
     */
    public static boolean isValidName(String test) {
        return test.matches(NAME_VALIDATION_REGEX);
    }

    @Override
    public String toString() {
        return fullName;
    }

    @Override
    public boolean equals(Object other) {
        return other == this // short circuit if same object
                || (other instanceof Name // instanceof handles nulls
                && this.fullName.equals(((Name) other).fullName)); // state check
    }

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

}

Add function can now have the ' character


package net.sf.jabref.logic.formatter;

import net.sf.jabref.logic.formatter.bibtexfields.*;

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

public class BibtexFieldFormatters {
    public static final PageNumbersFormatter PAGE_NUMBERS = new PageNumbersFormatter();
    public static final SuperscriptFormatter SUPERSCRIPTS = new SuperscriptFormatter();
    public static final DateFormatter DATE = new DateFormatter();
    public static final MonthFormatter MONTH_FORMATTER = new MonthFormatter();
    public static final AuthorsFormatter AUTHORS_FORMATTER = new AuthorsFormatter();
    public static final LatexFormatter LATEX_FORMATTER = new LatexFormatter();
    public static final UnitFormatter UNIT_FORMATTER = new UnitFormatter();

    public static final List<Formatter> ALL = Arrays.asList(PAGE_NUMBERS, SUPERSCRIPTS, DATE, AUTHORS_FORMATTER, LATEX_FORMATTER, MONTH_FORMATTER, UNIT_FORMATTER);
}

package net.sf.jabref.logic.formatter;

import net.sf.jabref.logic.formatter.bibtexfields.*;

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

public class BibtexFieldFormatters {
    public static final PageNumbersFormatter PAGE_NUMBERS = new PageNumbersFormatter();
    public static final SuperscriptFormatter SUPERSCRIPTS = new SuperscriptFormatter();
    public static final DateFormatter DATE = new DateFormatter();
    public static final MonthFormatter MONTH_FORMATTER = new MonthFormatter();
    public static final AuthorsFormatter AUTHORS_FORMATTER = new AuthorsFormatter();
    public static final LatexFormatter LATEX_FORMATTER = new LatexFormatter();
    public static final UnitFormatter UNIT_FORMATTER = new UnitFormatter();
    public static final TrimFormatter TRIM_FORMATTER = new TrimFormatter();
    public static final RemoveBracesFormatter REMOVE_BRACES_FORMATTER = new RemoveBracesFormatter();

    public static final List<Formatter> ALL = Arrays.asList(PAGE_NUMBERS, SUPERSCRIPTS, DATE, AUTHORS_FORMATTER, LATEX_FORMATTER, MONTH_FORMATTER, UNIT_FORMATTER, TRIM_FORMATTER, REMOVE_BRACES_FORMATTER);
}

Add TrimFormatter and RemoveBracesFormatter to save actions


package net.md_5.bungee.command;

import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;

public class CommandAlert extends Command
{

    @Override
    public void execute(CommandSender sender, String[] args)
    {
        if (getPermission(sender) != Permission.ADMIN)
        {
            sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
            return;
        }
        if (args.length == 0)
        {
            sender.sendMessage(ChatColor.RED + "You must supply a message.");
        } else
        {
            StringBuilder builder = new StringBuilder();
            if (!args[0].contains("&h")) //They want to hide the alert prefix
            {
                builder.append(ChatColor.DARK_PURPLE);
                builder.append("[Alert] "); //No space at start.
            } else
            {
                args[0].replaceAll("&h", ""); //Remove hide control code from message
            }

            for (String s : args)
            {

                builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
                builder.append(" ");
            }
            String message = builder.substring(0, builder.length() - 1);
            for (UserConnection con : BungeeCord.instance.connections.values())
            {
                con.sendMessage(message);
            }
        }
    }
}

package net.md_5.bungee.command;

import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.ChatColor;
import net.md_5.bungee.Permission;
import net.md_5.bungee.UserConnection;

public class CommandAlert extends Command
{

    @Override
    public void execute(CommandSender sender, String[] args)
    {
        if (getPermission(sender) != Permission.ADMIN)
        {
            sender.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
            return;
        }
        if (args.length == 0)
        {
            sender.sendMessage(ChatColor.RED + "You must supply a message.");
        } else
        {
            StringBuilder builder = new StringBuilder();
            if (!args[0].contains("&h")) //They want to hide the alert prefix
            {
            builder.append(ChatColor.DARK_PURPLE);
            builder.append("[Alert] "); //No space at start.
            }

            for (String s : args)
            {
                s = s.replaceAll("&h", ""); //Fix replace
                builder.append(ChatColor.translateAlternateColorCodes('&', s)); //Allow custom colours
                builder.append(" ");
            }

            String message = builder.substring(0, builder.length() - 1);
            for (UserConnection con : BungeeCord.instance.connections.values())
            {
                con.sendMessage(message);
            }
        }
    }
}

Fix &h not being removed from the message properly


package chap3CoreJavaAPIs;

import java.util.Calendar;
import java.time.Month;
import java.time.*;

class Dates{
	public static void main(String... args){
		// Be careful, old API Calendar starts at 0, new Month starts at 1
		System.out.println(Calendar.APRIL);
		System.out.println(Month.APRIL);
		System.out.println(LocalDate.of(2015, Month.APRIL, 1));
		System.out.println(LocalDate.of(2015, Calendar.APRIL, 1));
		System.out.println(LocalDate.of(2015, Calendar.MAY, 1).equals(LocalDate.of(2015, Month.APRIL, 1)));

		System.out.println(Period.ofMonths(1));
		System.out.println(Period.ofMonths(1).ofDays(2));
		System.out.println(Period.ofDays(2));
	}
}

package chap3CoreJavaAPIs;

import java.util.Calendar;
import java.time.Month;
import java.time.*;

class Dates {

	public void createDateFromString() {
		Date date = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").parse("2012-05-20T09:00:00.000Z");
		String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HHmmss").format(date);
		System.out.println(formattedDate);
	}

	public static void main(String... args) {
		// Be careful, old API Calendar starts at 0, new Month starts at 1
		System.out.println(Calendar.APRIL);
		System.out.println(Month.APRIL);
		System.out.println(LocalDate.of(2015, Month.APRIL, 1));
		System.out.println(LocalDate.of(2015, Calendar.APRIL, 1));
		System.out.println(LocalDate.of(2015, Calendar.MAY, 1).equals(LocalDate.of(2015, Month.APRIL, 1)));

		System.out.println(Period.ofMonths(1));
		System.out.println(Period.ofMonths(1).ofDays(2));
		System.out.println(Period.ofDays(2));
	}
}

Create a date object from a string representing a date


package com.github.rmsy.bukkitpotdebug;

import org.bukkit.Bukkit;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.util.Collection;

public class PotDebugPlugin extends JavaPlugin implements Listener {
    @Override
    public void onDisable() {
        HandlerList.unregisterAll((JavaPlugin) this);
    }

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onPotionSplash(final PotionSplashEvent event) {
        ThrownPotion potion = event.getPotion();
        Collection<PotionEffect> effects = potion.getEffects();
        Bukkit.broadcastMessage("A " + event.getEntity().getType().getName() + " splashed a potion with " + effects.size() + " effects attached:");
        for (PotionEffect effect : effects) {
            Bukkit.broadcastMessage("Type: " + effect.getType().getName() + ", Level: " + (effect.getAmplifier() + 1) + ", Duration: " + effect.getDuration());
        }
    }
}

package com.github.rmsy.bukkitpotdebug;

import org.bukkit.Bukkit;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.util.Collection;

public class PotDebugPlugin extends JavaPlugin implements Listener {
    @Override
    public void onDisable() {
        HandlerList.unregisterAll((JavaPlugin) this);
    }

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onPotionSplash(final PotionSplashEvent event) {
        ThrownPotion potion = event.getPotion();
        Collection<PotionEffect> effects = ((PotionMeta) potion.getItem().getItemMeta()).getCustomEffects();
        Bukkit.broadcastMessage("A " + event.getEntity().getType().getName() + " splashed a potion with " + effects.size() + " effects attached:");
        for (PotionEffect effect : effects) {
            Bukkit.broadcastMessage("Type: " + effect.getType().getName() + ", Level: " + (effect.getAmplifier() + 1) + ", Duration: " + effect.getDuration());
        }
    }
}

Use PotionMeta instead of ThrownPotion

Use PotionMeta instead of ThrownPotion


package io.github.achtern.AchternEngine.core.rendering.generator;

import io.github.achtern.AchternEngine.core.math.Vector2f;
import io.github.achtern.AchternEngine.core.rendering.Color;

import java.awt.*;
import java.awt.image.BufferedImage;

public class ImageGenerator {

    public static BufferedImage fromColor(Color color) {
        return fromColor(new Vector2f(1, 1), color);
    }

    public static BufferedImage fromColor(Vector2f dimensions, Color color) {
        BufferedImage image = new BufferedImage((int) dimensions.getX(), (int) dimensions.getY(), BufferedImage.TYPE_INT_RGB);

        Graphics2D g = image.createGraphics();

        g.setPaint(color.toAwt());
        g.fillRect(0, 0, (int) dimensions.getX(), (int) dimensions.getY());

        g.dispose();

        return image;
    }

}

package io.github.achtern.AchternEngine.core.rendering.generator;

import io.github.achtern.AchternEngine.core.math.Vector2f;
import io.github.achtern.AchternEngine.core.rendering.Color;
import io.github.achtern.AchternEngine.core.util.UBuffer;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.nio.ByteBuffer;

public class ImageGenerator {

    public static BufferedImage fromColor(Color color) {
        return fromColor(new Vector2f(1, 1), color);
    }

    public static BufferedImage fromColor(Vector2f dimensions, Color color) {
        BufferedImage image = new BufferedImage((int) dimensions.getX(), (int) dimensions.getY(), BufferedImage.TYPE_INT_RGB);

        Graphics2D g = image.createGraphics();

        g.setPaint(color.toAwt());
        g.fillRect(0, 0, (int) dimensions.getX(), (int) dimensions.getY());

        g.dispose();

        return image;
    }

    public static ByteBuffer bytesFromColor(Color color) {
        return bytesFromColor(new Vector2f(1, 1), color);
    }

    public static ByteBuffer bytesFromColor(Vector2f dimensions, Color color) {
        ByteBuffer buffer = UBuffer.createByteBuffer((int) (dimensions.getX() * dimensions.getY() * 4));

        for(int y = 0; y < dimensions.getY(); y++) {
            for(int x = 0; x < dimensions.getX(); x++) {

                int pixel = color.toInt();

                buffer.put((byte)((pixel) & 0xFF)); // R
                buffer.put((byte)((pixel >> 8) & 0xFF)); // G
                buffer.put((byte)((pixel >> 16) & 0xFF)); // B
                buffer.put((byte)((pixel >> 24) & 0xFF)); // Alpha

            }
        }

        buffer.flip();

        return buffer;
    }

}

Create ByteBuffers for Textures from Color


import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;

/**
 * Displays all knowledge base (KB) articles and a search bar
 */
public class KB_IndexController extends BaseController {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doGet(request, response);

        Issue_DBWrapper issueWrapper = this.getPortalBean().getIssues();

        issueWrapper.reset();

        List<Issue> issues = Arrays.asList(issueWrapper.getIssues());

        request.setAttribute("issues", issues);

        request.getRequestDispatcher("/WEB-INF/jsp/kb/index.jsp").forward(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doPost(request, response);
    }
}

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;

/**
 * Displays all knowledge base (KB) articles and a search bar
 */
public class KB_IndexController extends BaseController {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doGet(request, response);

        Category_DBWrapper categoryWrapper = this.getPortalBean().getCategories();

        categoryWrapper.reset();

        List<Category> categories = Arrays.asList(categoryWrapper.getCategories());

        request.setAttribute("categories", categories);

        request.getRequestDispatcher("/WEB-INF/jsp/kb/index.jsp").forward(request, response);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doPost(request, response);
    }
}

Change issues to sending categories

Change issues to sending categories


package durianhln.polymorph;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import durianhln.polymorph.Polymorph;

public class AndroidLauncher extends AndroidApplication {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
        initialize(new Polymorph(), config);
    }
}

package durianhln.polymorph;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import durianhln.polymorph.Polymorph;

public class AndroidLauncher extends AndroidApplication {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
        config.useImmersiveMode = true;
        initialize(new Polymorph(), config);
    }
}

Change Android to immersive mode

Change Android to immersive mode


package org.keycloak.admin.client.resource;

import org.keycloak.representations.idm.UserRepresentation;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;

public interface UsersResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<UserRepresentation> search(@QueryParam("username") String username,
                                           @QueryParam("firstName") String firstName,
                                           @QueryParam("lastName") String lastName,
                                           @QueryParam("email") String email,
                                           @QueryParam("first") Integer firstResult,
                                           @QueryParam("max") Integer maxResults);

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public List<UserRepresentation> search(@QueryParam("search") String search,
                                           @QueryParam("first") Integer firstResult,
                                           @QueryParam("max") Integer maxResults);

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    Response create(UserRepresentation userRepresentation);

    @Path("{username}")
    public UserResource get(@PathParam("username") String username);

}

package org.keycloak.admin.client.resource;

import org.keycloak.representations.idm.UserRepresentation;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;

public interface UsersResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    List<UserRepresentation> search(@QueryParam("username") String username,
                                           @QueryParam("firstName") String firstName,
                                           @QueryParam("lastName") String lastName,
                                           @QueryParam("email") String email,
                                           @QueryParam("first") Integer firstResult,
                                           @QueryParam("max") Integer maxResults);

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    List<UserRepresentation> search(@QueryParam("search") String search,
                                           @QueryParam("first") Integer firstResult,
                                           @QueryParam("max") Integer maxResults);

    @POST
    @Consumes(MediaType.APPLICATION_JSON)
    Response create(UserRepresentation userRepresentation);

    @Path("{id}")
    UserResource get(@PathParam("id") String id);

}

Fix admin-api to show that users are retrieved by ip, not username


package de.christinecoenen.code.zapp.app.mediathek.controller;

import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class DownloadReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();

		if (DownloadManager.ACTION_NOTIFICATION_CLICKED.equals(action)) {
			context.startActivity(new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS));
		}
	}
}

package de.christinecoenen.code.zapp.app.mediathek.controller;

import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class DownloadReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		String action = intent.getAction();

		if (DownloadManager.ACTION_NOTIFICATION_CLICKED.equals(action)) {
			Intent downloadManagerIntent = new Intent(DownloadManager.ACTION_VIEW_DOWNLOADS);
			downloadManagerIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(downloadManagerIntent);
		}
	}
}

Fix crash on api level 23 when clicking download notification


// Copyright 2019 Google LLC
//
// 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
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

import com.google.common.collect.ImmutableList;

/** Wrapper class for infromation sent on a search servlet doGet request. */
public class SearchServletResponse {
  private final ImmutableList<Receipt> matchingReceipts;
  private final String encodedCursor;

  public SearchServletResponse(ImmutableList<Receipt> matchingReceipts, String encodedCursor) {
    this.matchingReceipts = ImmutableList.copyOf(matchingReceipts);
    this.encodedCursor = encodedCursor;
  }
}

// Copyright 2019 Google LLC
//
// 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
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

import com.google.common.collect.ImmutableList;

/** Wrapper class for information sent on a search servlet doGet response. */
public class SearchServletResponse {
  private final ImmutableList<Receipt> matchingReceipts;
  private final String encodedCursor;

  public SearchServletResponse(ImmutableList<Receipt> matchingReceipts, String encodedCursor) {
    this.matchingReceipts = ImmutableList.copyOf(matchingReceipts);
    this.encodedCursor = encodedCursor;
  }
}

Fix comment for response class

Fix comment for response class


package com.opera.core.systems.scope.services;

public interface ISelftest {
	/**
	 * Run the selftest for the specified modules
	 *
	 * @param modules The names of the modules to test
	 * @return The test output
	 */
	/* XXX: Might be a better idea to return some kind of structured object
	 * here, instead of a bare string. First order of business is getting this
	 * damn thing working though.
	 */
	public void runSelftests(String... modules);
}

package com.opera.core.systems.scope.services;

public interface ISelftest {
	/**
	 * Run the selftests for the specified modules.
	 *
	 * @param modules The names of the modules to test
	 * @return The test output
	 */
	public void runSelftests(String... modules);
}

Remove obsolete comment, minor doc tweak.


//
// $Id: SceneService.java,v 1.6 2002/04/15 16:28:03 shaper Exp $

package com.threerings.whirled.client;

import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationDirector;

import com.threerings.whirled.Log;
import com.threerings.whirled.data.SceneCodes;

/**
 * The scene service class provides the client interface to the scene
 * related invocation services (e.g. moving from scene to scene).
 */
public class SceneService implements SceneCodes
{
    /**
     * Requests that that this client's body be moved to the specified
     * scene.
     *
     * @param sceneId the scene id to which we want to move.
     * @param sceneVers the version number of the scene object that we
     * have in our local repository.
     */
    public static void moveTo (Client client, int sceneId,
                               int sceneVers, SceneDirector rsptarget)
    {
        InvocationDirector invdir = client.getInvocationDirector();
        Object[] args = new Object[] {
            new Integer(sceneId), new Integer(sceneVers) };
        invdir.invoke(MODULE_NAME, MOVE_TO_REQUEST, args, rsptarget);
        Log.info("Sent moveTo request [scene=" + sceneId +
                 ", version=" + sceneVers + "].");
    }
}

//
// $Id: SceneService.java,v 1.7 2002/04/26 00:07:05 ray Exp $

package com.threerings.whirled.client;

import com.threerings.presents.client.Client;
import com.threerings.presents.client.InvocationDirector;

import com.threerings.whirled.Log;
import com.threerings.whirled.data.SceneCodes;

/**
 * The scene service class provides the client interface to the scene
 * related invocation services (e.g. moving from scene to scene).
 */
public class SceneService implements SceneCodes
{
    /**
     * Requests that that this client's body be moved to the specified
     * scene.
     *
     * @param sceneId the scene id to which we want to move.
     * @param sceneVers the version number of the scene object that we
     * have in our local repository.
     */
    public static void moveTo (Client client, int sceneId,
                               int sceneVers, Object rsptarget)
    {
        InvocationDirector invdir = client.getInvocationDirector();
        Object[] args = new Object[] {
            new Integer(sceneId), new Integer(sceneVers) };
        invdir.invoke(MODULE_NAME, MOVE_TO_REQUEST, args, rsptarget);
        Log.info("Sent moveTo request [scene=" + sceneId +
                 ", version=" + sceneVers + "].");
    }
}

Allow any object to be used as the response target for a moveTo request.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@1293 542714f4-19e9-0310-aa3c-eee0fc999fb1


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.apache.jorphan.test;

/**
 * Implement this interface to work with the AllTests class. This interface
 * allows AllTests to pass a configuration file to your application before
 * running the junit unit tests.
 *
 * @see AllTests
 * @author Michael Stover (mstover at apache.org)
 * @version $Revision$
 */
public interface UnitTestManager {
	/**
	 * Your implementation will be handed the filename that was provided to
	 * AllTests as a configuration file. It can hold whatever properties you
	 * need to configure your system prior to the unit tests running.
	 *
	 * @param filename
	 */
	public void initializeProperties(String filename);
}

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package org.apache.jorphan.test;

/**
 * Implement this interface to work with the AllTests class. This interface
 * allows AllTests to pass a configuration file to your application before
 * running the junit unit tests.
 *
 * @see AllTests
 *
 * N.B. This must be in the main src/ tree (not test/) because it is
 * implemented by JMeterUtils
 */
public interface UnitTestManager {
	/**
	 * Your implementation will be handed the filename that was provided to
	 * AllTests as a configuration file. It can hold whatever properties you
	 * need to configure your system prior to the unit tests running.
	 *
	 * @param filename
	 */
	public void initializeProperties(String filename);
}

Document that this part of the unit test code must remain in src/

git-svn-id: 7c053b8fbd1fb5868f764c6f9536fc6a9bbe7da9@602096 13f79535-47bb-0310-9956-ffa450edef68


package com.evollu.react.fa;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class FIRAnalyticsPackage implements ReactPackage {

    public FIRAnalyticsPackage() {
    }

    @Override
    public List<NativeModule> createNativeModules(
            ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new FIRAnalyticsModule(reactContext));
        return modules;
    }

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

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

package com.evollu.react.fa;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.JavaScriptModule;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class FIRAnalyticsPackage implements ReactPackage {

    public FIRAnalyticsPackage() {
    }

    @Override
    public List<NativeModule> createNativeModules(
            ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new FIRAnalyticsModule(reactContext));
        return modules;
    }

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

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

Remove depreciated createJSModules @ovveride marker


package com.enot.cmd.core;

import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.ProcessResult;
import org.zeroturnaround.exec.StartedProcess;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

final class BaseCommand implements Command {
    private final ProcessExecutor processExecutor;

    BaseCommand(ProcessExecutor processExecutor) {
        this.processExecutor = processExecutor;
    }

    /**
     * See {@link ProcessExecutor#execute()}
     */
    @Override
    public ProcessResult execute() throws IOException, TimeoutException, InterruptedException {
        return processExecutor.execute();
    }

    /**
     * See {@link ProcessExecutor#executeNoTimeout()}
     */
    @Override
    public ProcessResult executeNoTimeout() throws IOException, InterruptedException {
        return processExecutor.executeNoTimeout();
    }

    /**
     * See {@link ProcessExecutor#start()}
     */
    @Override
    public StartedProcess start() throws IOException {
        return processExecutor.start();
    }

    /**
     * Get the command line as a string
     * @return
     */
    @Override
    public String toString() {
        return String.join(" ", processExecutor.getCommand());
    }
}

package com.enot.cmd.core;

import org.zeroturnaround.exec.ProcessExecutor;
import org.zeroturnaround.exec.ProcessResult;
import org.zeroturnaround.exec.StartedProcess;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

final class BaseCommand implements Command {
    private final ProcessExecutor processExecutor;

    BaseCommand(ProcessExecutor processExecutor) {
        this.processExecutor = processExecutor;
    }

    /**
     * See {@link ProcessExecutor#execute()}
     */
    @Override
    public ProcessResult execute() throws IOException, TimeoutException, InterruptedException {
        return processExecutor.execute();
    }

    /**
     * See {@link ProcessExecutor#executeNoTimeout()}
     */
    @Override
    public ProcessResult executeNoTimeout() throws IOException, InterruptedException {
        return processExecutor.executeNoTimeout();
    }

    /**
     * See {@link ProcessExecutor#start()}
     */
    @Override
    public StartedProcess start() throws IOException {
        return processExecutor.start();
    }
}

Revert "Get the command line as a string"

This reverts commit 1f1400b9f9d3e76ab6b2242400a7fa9d1e2fdff9.


package org.codefx.demo.junit5;

import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.runner.SelectPackages;
import org.junit.runner.RunWith;

@RunWith(JUnitPlatform.class)
@SelectPackages({ "org.codefx.demo.junit5" })
public class TestWithJUnit5 { }

package org.codefx.demo.junit5;

import org.junit.platform.runner.IncludeClassNamePattern;
import org.junit.platform.runner.IncludeEngines;
import org.junit.platform.runner.JUnitPlatform;
import org.junit.platform.runner.SelectPackages;
import org.junit.runner.RunWith;

@RunWith(JUnitPlatform.class)
@SelectPackages({ "org.codefx.demo.junit5" })
@IncludeClassNamePattern(".*Tests?")
@IncludeEngines("junit-jupiter")
public class TestWithJUnit5 { }

Add more stuff to JUnit-5-in-4-test suite


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jena.sparql.exec;

import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.update.UpdateProcessor;

public interface UpdateExec extends UpdateProcessor
{
    public static UpdateExecBuilder dataset(DatasetGraph dataset) {
        return UpdateExecDatasetBuilder.create().dataset(dataset);
    }

    public static UpdateExecDatasetBuilder newBuilder() {
        return UpdateExecDatasetBuilder.create();
    }

    /** Execute */
    @Override
    public void execute();
}

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.jena.sparql.exec;

import org.apache.jena.sparql.core.DatasetGraph;
import org.apache.jena.sparql.exec.http.UpdateExecHTTP;
import org.apache.jena.update.UpdateProcessor;

public interface UpdateExec extends UpdateProcessor
{
    /** Create a {@link UpdateExecBuilder} for a dataset. */
    public static UpdateExecBuilder dataset(DatasetGraph dataset) {
        return UpdateExecDatasetBuilder.create().dataset(dataset);
    }

    /** Create a {@link UpdateExecBuilder} for a remote endpoint. */
    public static UpdateExecBuilder service(String serviceURL) {
        return UpdateExecHTTP.newBuilder().endpoint(serviceURL);
    }

    public static UpdateExecDatasetBuilder newBuilder() {
        return UpdateExecDatasetBuilder.create();
    }

    /** Execute */
    @Override
    public void execute();
}

Add update builder starting point 'service(URL)'


package roart.common.util;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public class IOUtil {
    public static byte[] toByteArray(InputStream is) throws IOException {
        return IOUtils.toByteArray(is, Integer.MAX_VALUE);
    }
}

package roart.common.util;

import java.io.IOException;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

public class IOUtil {
    public static byte[] toByteArray(InputStream is) throws IOException {
        return is.readNBytes(Integer.MAX_VALUE - 8);
    }
}

Fix for big string limit (I47).

Fix for big string limit (I47).


package net.simpvp.Portals;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;

public class Portals extends JavaPlugin {

	public static JavaPlugin instance;

	public static List<UUID> justTeleportedEntities = new ArrayList<UUID>();

	public void onEnable() {
		instance = this;

		/* Check if this plugin's directory exists, if not create it */
		File dir = new File("plugins/Portals");
		if ( !dir.exists() ) {
			dir.mkdir();
		}

		getServer().getPluginManager().registerEvents(new BlockBreak(), this);
		getServer().getPluginManager().registerEvents(new BlockPlace(), this);
		getServer().getPluginManager().registerEvents(new PlayerDeath(), this);
		getServer().getPluginManager().registerEvents(new PlayerToggleSneak(), this);

		/* Remove comment to enable minecart detection through portals */
		/* getServer().getPluginManager().registerEvents(new BlockRedstone(), this); */

		SQLite.connect();
	}

	public void onDisable() {
		SQLite.close();
	}

}

package net.simpvp.Portals;

import java.io.File;
import java.util.UUID;
import java.util.HashSet;

import org.bukkit.entity.Entity;
import org.bukkit.plugin.java.JavaPlugin;

public class Portals extends JavaPlugin {

	public static JavaPlugin instance;

	public static HashSet<UUID> justTeleportedEntities = new HashSet<UUID>();

	public void onEnable() {
		instance = this;

		/* Check if this plugin's directory exists, if not create it */
		File dir = new File("plugins/Portals");
		if ( !dir.exists() ) {
			dir.mkdir();
		}

		getServer().getPluginManager().registerEvents(new BlockBreak(), this);
		getServer().getPluginManager().registerEvents(new BlockPlace(), this);
		getServer().getPluginManager().registerEvents(new PlayerDeath(), this);
		getServer().getPluginManager().registerEvents(new PlayerToggleSneak(), this);

		/* Remove comment to enable minecart detection through portals */
		/* getServer().getPluginManager().registerEvents(new BlockRedstone(), this); */

		SQLite.connect();
	}

	public void onDisable() {
		SQLite.close();
	}

}

Make justTeleportedEntities a HashSet instead of ArrayList


/*
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */package org.xdi.model.custom.script.type.client;

import java.util.Map;

import org.xdi.model.SimpleCustomProperty;

/**
 * Dummy implementation of interface ClientRegistrationType
 *
 * @author Yuriy Movchan Date: 11/11/2014
 */
public class DummyClientRegistrationType implements ClientRegistrationType {

    @Override
    public boolean init(Map<String, SimpleCustomProperty> configurationAttributes) {
        return true;
    }

    @Override
    public boolean destroy(Map<String, SimpleCustomProperty> configurationAttributes) {
        return true;
    }

    @Override
    public int getApiVersion() {
        return 1;
    }

    @Override
    public boolean updateClient(Object registerRequest, Object client, Map<String, SimpleCustomProperty> configurationAttributes) {
        return false;
    }

}

/*
 * oxCore is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
 *
 * Copyright (c) 2014, Gluu
 */package org.xdi.model.custom.script.type.client;

import java.util.Map;

import org.xdi.model.SimpleCustomProperty;

/**
 * Dummy implementation of interface ClientRegistrationType
 *
 * @author Yuriy Movchan Date: 11/11/2014
 */
public class DummyClientRegistrationType implements ClientRegistrationType {

	@Override
	public boolean init(Map<String, SimpleCustomProperty> configurationAttributes) {
		return true;
	}

	@Override
	public boolean destroy(Map<String, SimpleCustomProperty> configurationAttributes) {
		return true;
	}

	@Override
	public int getApiVersion() {
		return 1;
	}

	@Override
	public boolean createClient(Object registerRequest, Object client, Map<String, SimpleCustomProperty> configurationAttributes) {
		return false;
	}

	@Override
	public boolean updateClient(Object registerRequest, Object client, Map<String, SimpleCustomProperty> configurationAttributes) {
		return false;
	}

}

Update default client registration implementation


package org.azavea.otm.filters;

import org.azavea.otm.R;

import android.view.View;
import android.widget.ToggleButton;

public class BooleanFilter extends MapFilter {
	public boolean active;

	public BooleanFilter(String key, String label) {
		initialize(key, label, false);
	}

	public BooleanFilter(String key, String label, boolean active) {
		initialize(key, label, active);
	}

	private void initialize(String key, String label, boolean active) {
		this.key = key;
		this.active = active;
		this.label = label;
	}

	@Override
	public String toQueryStringParam() {
		return key + "=" + Boolean.toString(active);
	}

	@Override
	public void updateFromView(View view) {
		this.active = ((ToggleButton)view.findViewById(R.id.active)).isChecked();
	}

	@Override
	public boolean isActive() {
		return this.active;
	}
}

package org.azavea.otm.filters;

import org.azavea.otm.R;

import android.view.View;
import android.widget.ToggleButton;

public class BooleanFilter extends BaseFilter {
	public boolean active;

	public BooleanFilter(String key, String label) {
		initialize(key, label, false);
	}

	public BooleanFilter(String key, String label, boolean active) {
		initialize(key, label, active);
	}

	private void initialize(String key, String label, boolean active) {
		this.key = key;
		this.active = active;
		this.label = label;
	}

	@Override
	public String toQueryStringParam() {
		return key + "=" + Boolean.toString(active);
	}

	@Override
	public void updateFromView(View view) {
		this.active = ((ToggleButton)view.findViewById(R.id.active)).isChecked();
	}

	@Override
	public boolean isActive() {
		return this.active;
	}

	@Override
	public void clear() {
		active = false;
	}
}

Update base filter name and implment overrides

The abstract class changed names and now implements a clear method.
Remove the active state of the boolean filter on clear.


package com.edinarobotics.zephyr.autonomous;

import com.edinarobotics.utils.autonomous.*;
import com.edinarobotics.zephyr.Zephyr;

/**
 *
 */
public class AutonomousStepFactory {
    private Zephyr robot;

    public AutonomousStepFactory(Zephyr robot){
        this.robot = robot;
    }

    public AutonomousStep getShooterFireStep(double shooterSpeed, int numShots){
        final double PISTON_SET_DELAY = 0.5;
        //Steps to bring the piston up and down
        AutonomousStep[] fireSteps = new AutonomousStep[4];
        fireSteps[0] = new ShooterPistonControlStep(true, robot);
        fireSteps[1] = new IdleWaitStep(PISTON_SET_DELAY, robot);
        fireSteps[2] = new ShooterPistonControlStep(false, robot);
        fireSteps[3] = new IdleWaitStep(PISTON_SET_DELAY, robot);

        AutonomousStep[] steps = new AutonomousStep[3];
        //Start the shooter
        steps[0] = new SetShooterSpeedStep(shooterSpeed, robot);
        //Fire the piston several times
        steps[1] = new ForLoopStep(new SequentialAutonomousStepGroup(fireSteps), numShots);
        //Stop the shooter
        steps[2] = new SetShooterSpeedStep(0, robot);

        return new SequentialAutonomousStepGroup(steps);
    }
}

package com.edinarobotics.zephyr.autonomous;

import com.edinarobotics.utils.autonomous.*;
import com.edinarobotics.zephyr.Zephyr;

/**
 *
 */
public class AutonomousStepFactory {
    private Zephyr robot;

    public AutonomousStepFactory(Zephyr robot){
        this.robot = robot;
    }

    public AutonomousStep getShooterFireStep(double shooterSpeed, int numShots){
        final double PISTON_SET_DELAY = 0.5;
        final double BALL_LOAD_DELAY = 1;
        //Steps to bring the piston up and down
        AutonomousStep[] fireSteps = new AutonomousStep[7];
        fireSteps[0] = new ShooterPistonControlStep(true, robot);
        fireSteps[1] = new IdleWaitStep(PISTON_SET_DELAY, robot);
        fireSteps[2] = new ShooterPistonControlStep(false, robot);
        fireSteps[3] = new IdleWaitStep(PISTON_SET_DELAY, robot);
        fireSteps[4] = new SetConveyorStep(true, robot);
        fireSteps[5] = new IdleWaitStep(BALL_LOAD_DELAY, robot);
        fireSteps[6] = new SetConveyorStep(false, robot);

        AutonomousStep[] steps = new AutonomousStep[3];
        //Start the shooter
        steps[0] = new SetShooterSpeedStep(shooterSpeed, robot);
        //Fire the piston several times
        steps[1] = new ForLoopStep(new SequentialAutonomousStepGroup(fireSteps), numShots);
        //Stop the shooter
        steps[2] = new SetShooterSpeedStep(0, robot);

        return new SequentialAutonomousStepGroup(steps);
    }
}

Add ball loading in Autonomous.

Add ball loading in Autonomous.

The step returned by AutonomousStepFactory.getShooterFireStep() now
returns an AutonomousStep that loads the next ball onto the piston
after firing.


package com.consol.citrus.admin.websocket;

import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Martin.Maher@consol.de on 19/06/15.
 */
public class LoggingWebSocketCreator implements WebSocketCreator {

    @Autowired
    private LoggingWebSocket loggingWebSocket;

    @Override
    public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {
        return loggingWebSocket;
    }

}

/*
 * Copyright 2006-2015 the original author or authors.
 *
 * 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.consol.citrus.admin.websocket;

import org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest;
import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author Martin Maher
 * @since 2.2.1
 */
public class LoggingWebSocketCreator implements WebSocketCreator {

    @Autowired
    private LoggingWebSocket loggingWebSocket;

    @Override
    public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {
        return loggingWebSocket;
    }

}

Update copyright Apache license for file


/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.wicket.core.request.handler;

import org.apache.wicket.core.request.handler.StatelessPageWithQueuedComponents.CustomLabel;
import org.apache.wicket.util.tester.WicketTestCase;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

public class PageAndComponentProviderTest extends WicketTestCase
{

	@Test
	public void statelessComponentQueued() throws Exception
	{
		PageAndComponentProvider provider = new PageAndComponentProvider(StatelessPageWithQueuedComponents.class, "container:label");

		CustomLabel component = (CustomLabel)provider.getComponent();

		assertFalse(component.hasBeenConfigured());

	}
}

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.wicket.core.request.handler;

import org.apache.wicket.core.request.handler.StatelessPageWithQueuedComponents.CustomLabel;
import org.apache.wicket.util.tester.WicketTestCase;
import org.junit.Test;

public class PageAndComponentProviderTest extends WicketTestCase
{

	@Test
	public void statelessComponentQueued() throws Exception
	{
		PageAndComponentProvider provider = new PageAndComponentProvider(StatelessPageWithQueuedComponents.class, "container:label");

		CustomLabel component = (CustomLabel)provider.getComponent();

		assertFalse(component.hasBeenConfigured());

	}
}

Revert "Fixed unit test package problem"

This reverts commit ba98e8800f3112aef2f9e2f21cfb6127c23fbbe5.


package org.ovirt.engine.core.dao;

import static org.mockito.Mockito.mock;

import org.junit.Before;
import org.junit.Test;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.compat.NotImplementedException;

/**
 * A sparse test case for {@link NetworkDAOHibernateImpl}
 * intended to fail once we start implementing actual methods
 */
public class NetworkDAOHibernateImplTest {
    /** The DAO to test */
    private NetworkDAOHibernateImpl dao;

    @Before
    public void setUp() {
        dao = new NetworkDAOHibernateImpl();
    }

    @Test(expected = NotImplementedException.class)
    public void testUnimplementedMethods() {
        dao.getAllForCluster(mock(Guid.class), mock(Guid.class), true);
    }
}

package org.ovirt.engine.core.dao;

import static org.mockito.Mockito.mock;

import org.apache.commons.lang.NotImplementedException;
import org.junit.Before;
import org.junit.Test;
import org.ovirt.engine.core.compat.Guid;

/**
 * A sparse test case for {@link NetworkDAOHibernateImpl}
 * intended to fail once we start implementing actual methods
 */
public class NetworkDAOHibernateImplTest {
    /** The DAO to test */
    private NetworkDAOHibernateImpl dao;

    @Before
    public void setUp() {
        dao = new NetworkDAOHibernateImpl();
    }

    @Test(expected = NotImplementedException.class)
    public void testUnimplementedMethods() {
        dao.getAllForCluster(mock(Guid.class), mock(Guid.class), true);
    }
}

Modify excepted exception to match impl

engine: Modify excepted exception to match impl

The patch modifies the expected exception to the
correct package so test could pass successfully.

Change-Id: I016ced1da2d86e27497149fac82fea832ce01a1e
Signed-off-by: Moti Asayag <da1debb83a8e12b6e8822edf2c275f55cc51b720@redhat.com>


/*
 * Copyright (C) 2014 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.example.android.bluetoothchat;

/**
 * Defines several constants used between {@link BluetoothChatService} and the UI.
 */
public interface Constants {

    // Message types sent from the BluetoothChatService Handler
    public static final int MESSAGE_STATE_CHANGE = 1;
    public static final int MESSAGE_READ = 2;
    public static final int MESSAGE_WRITE = 3;
    public static final int MESSAGE_DEVICE_NAME = 4;
    public static final int MESSAGE_TOAST = 5;

    // Key names received from the BluetoothChatService Handler
    public static final String DEVICE_NAME = "device_name";
    public static final String TOAST = "toast";

}

/*
 * Copyright (C) 2014 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.example.android.bluetoothchat;

/**
 * Defines several constants used between {@link BluetoothChatService} and the UI.
 */
public interface Constants {

    // Message types sent from the BluetoothChatService Handler
    public static final int MESSAGE_STATE_CHANGE = 1;
    public static final int MESSAGE_READ = 2;
    public static final int MESSAGE_WRITE = 3;
    public static final int MESSAGE_DEVICE_NAME = 4;
    public static final int MESSAGE_TOAST = 5;

    // Key names received from the BluetoothChatService Handler
    public static final String DEVICE_NAME = "device_name";
    public static final String TOAST = "toast";
	//check this code for bluetooth chat application, which is very easy and don't need any network as such

}

Revert "Revert "Testing git commit""

Revert "Revert "Testing git commit""

This reverts commit ea3742010d0936fe0053a466064941b7015ac43e.


import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URL;

public class CourseCodeTableCrawler {
    public static Elements get(String courseCode) {
        String url = "https://stars.bilkent.edu.tr/homepage/ajax/plainOfferings.php?SEMESTER=20142&COURSE_CODE=" + courseCode.toUpperCase();

        try {
            Document doc = Jsoup.parse(new URL(url), 10000);
            Element table = doc.getElementById("poTable");
            Elements rows = table.getElementsByTag("tr");
            return rows;
        } catch (Exception e) {
            e.printStackTrace();
            return new Elements();
        }
    }
}

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import java.net.URL;

public class CourseCodeTableCrawler {
    public static Elements get(String courseCode) {
        String url = "https://stars.bilkent.edu.tr/homepage/ajax/plainOfferings.php?SEMESTER=20151&COURSE_CODE=" + courseCode.toUpperCase();

        try {
            Document doc = Jsoup.parse(new URL(url), 10000);
            Element table = doc.getElementById("poTable");
            Elements rows = table.getElementsByTag("tr");
            return rows;
        } catch (Exception e) {
            e.printStackTrace();
            return new Elements();
        }
    }
}

Update for Fall 2015-16 semester

Update for Fall 2015-16 semester


package de.linkvt.bachelor.features.annotations.ontology.owl;

import de.linkvt.bachelor.features.Feature;
import de.linkvt.bachelor.features.FeatureCategory;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotation;
import org.semanticweb.owlapi.model.OWLAnnotationProperty;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLLiteral;
import org.springframework.stereotype.Component;

@Component
public class OwlAnnotationPropertyFeature extends Feature {

  @Override
  public void addToOntology() {
    OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(IRI.create("customAnnotationProperty"));
    addAxiomToOntology(factory.getOWLDeclarationAxiom(annotationProperty));

    OWLLiteral annotationValue = factory.getOWLLiteral("Custom Annotation Value");
    OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, annotationValue);

    OWLClass owlClass = featurePool.getReusableClass();
    addAxiomToOntology(factory.getOWLDeclarationAxiom(owlClass));
    addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(owlClass.getIRI(), annotation));
  }

  @Override
  public String getName() {
    return "owl:AnnotationProperty";
  }

  @Override
  public String getToken() {
    return "annotationproperty";
  }

  @Override
  public FeatureCategory getCategory() {
    return FeatureCategory.ANNOTATIONS;
  }
}

package de.linkvt.bachelor.features.annotations.ontology.owl;

import de.linkvt.bachelor.features.Feature;
import de.linkvt.bachelor.features.FeatureCategory;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLAnnotation;
import org.semanticweb.owlapi.model.OWLAnnotationProperty;
import org.semanticweb.owlapi.model.OWLClass;
import org.semanticweb.owlapi.model.OWLLiteral;
import org.springframework.stereotype.Component;

@Component
public class OwlAnnotationPropertyFeature extends Feature {

  @Override
  public void addToOntology() {
    String ontologyIri = ontology.getOntologyID().getOntologyIRI().get().toString();
    OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(IRI.create(ontologyIri + "customAnnotationProperty"));
    addAxiomToOntology(factory.getOWLDeclarationAxiom(annotationProperty));

    OWLLiteral annotationValue = factory.getOWLLiteral("Custom Annotation Value");
    OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, annotationValue);

    OWLClass owlClass = featurePool.getReusableClass();
    addAxiomToOntology(factory.getOWLDeclarationAxiom(owlClass));
    addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(owlClass.getIRI(), annotation));
  }

  @Override
  public String getName() {
    return "owl:AnnotationProperty";
  }

  @Override
  public String getToken() {
    return "annotationproperty";
  }

  @Override
  public FeatureCategory getCategory() {
    return FeatureCategory.ANNOTATIONS;
  }
}

Use complete iri for annotation property declaration