package org.apereo.cas.token.config;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * This is {@link TokenCoreConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
@Configuration("tokenAuthenticationConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class TokenCoreConfiguration {
}

package org.apereo.cas.token.config;

import org.apereo.cas.configuration.CasConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * This is {@link TokenCoreConfiguration}.
 *
 * @author Misagh Moayyed
 * @since 5.0.0
 */
@Configuration("tokenCoreConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class TokenCoreConfiguration {
}

Fix issue with config wiring

Fix issue with config wiring


package org.yakindu.sct.commons;

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

import org.eclipse.emf.ecore.EClass;

public class EMFHelper {
	public static List<EClass> getAllSuperClasses(EClass eClass) {
		List<List<EClass>> superClasses = new ArrayList<>();

		getSuperClassTree(superClasses, eClass, 0);

		List<EClass> result = new ArrayList<>();
		for (List<EClass> list : superClasses) {
			result.addAll(list);
		}

		return result;
	}

	protected static void getSuperClassTree(List<List<EClass>> superClasses, EClass eClass, int depth) {
		if (superClasses.size() <= depth) {
			superClasses.add(depth, new ArrayList<>());
		}

		List<EClass> superTypes = eClass.getESuperTypes();

		superClasses.get(depth).add(eClass);

		for (EClass superType : superTypes) {
			getSuperClassTree(superClasses, superType, depth + 1);
		}
	}
}

/**
 * Copyright (c) 2018 committers of YAKINDU and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * Contributors:
 * 	committers of YAKINDU - initial API and implementation
 *
 */
package org.yakindu.sct.commons;

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;

public class EMFHelper {
	public static List<EClass> getAllSuperClasses(EClass eClass) {
		List<List<EClass>> superClasses = new ArrayList<>();

		getSuperClassTree(superClasses, eClass, 0);

		List<EClass> result = new ArrayList<>();
		for (List<EClass> list : superClasses) {
			result.addAll(list);
		}

		return result;
	}

	protected static void getSuperClassTree(List<List<EClass>> superClasses, EClass eClass, int depth) {
		if (superClasses.size() <= depth) {
			superClasses.add(depth, new ArrayList<>());
		}

		List<EClass> superTypes = eClass.getESuperTypes();

		superClasses.get(depth).add(eClass);

		for (EClass superType : superTypes) {
			getSuperClassTree(superClasses, superType, depth + 1);
		}
	}

	public static IFile getIFileFromEMFUri(URI uri) {
		return ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true)));
	}
}

Add copyright header and URI helper func


package com.github.semres;

import org.eclipse.rdf4j.repository.Repository;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

public class Database {
    private List<SynsetSerializer> synsetSerializers;
    private Repository repository;
    private String baseIri = "http://example.org/";

    public Database(List<Class> serializerClasses, Repository repository) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        List<SynsetSerializer> synsetSerializers = new ArrayList<>();
        for (Class serializerClass: serializerClasses) {
            SynsetSerializer loadedSynsetSerializer = (SynsetSerializer) serializerClass.getConstructor(Repository.class, String.class).newInstance(repository, baseIri);
            synsetSerializers.add(loadedSynsetSerializer);
        }
        this.synsetSerializers = synsetSerializers;
        this.repository = repository;
    }
}

package com.github.semres;

import org.eclipse.rdf4j.repository.Repository;

import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;

public class Database {
    private List<SynsetSerializer> synsetSerializers;
    private Repository repository;
    private String baseIri = "http://example.org/";

    public Database(List<Class> serializerClasses, Repository repository) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {
        List<SynsetSerializer> synsetSerializers = new ArrayList<>();
        for (Class serializerClass: serializerClasses) {
            SynsetSerializer loadedSynsetSerializer = (SynsetSerializer) serializerClass.getConstructor(Repository.class, String.class).newInstance(repository, baseIri);
            synsetSerializers.add(loadedSynsetSerializer);
        }
        this.synsetSerializers = synsetSerializers;
        this.repository = repository;
    }

    public void addSynset(Synset synset) {

    }

    public Synset getSynset(String id) {
        return null;
    }

    private String getSynsetClass(String synsetId) {
        return null;
    }
}

Add 'addSynset' and 'getSynset' method declarations.


package io.tracee.contextlogger.jaxws.container;

import io.tracee.Tracee;
import io.tracee.TraceeBackend;
import io.tracee.TraceeLogger;
import io.tracee.jaxws.container.TraceeServerHandler;

import javax.xml.ws.handler.soap.SOAPMessageContext;

/**
 * JaxWs client side handler that detects uncaught exceptions and outputs contextual information.
 */
public class TraceeClientErrorLoggingHandler extends AbstractTraceeErrorLoggingHandler {

    private final TraceeLogger traceeLogger = this.getTraceeBackend().getLoggerFactory().getLogger(
            TraceeServerHandler.class);

    TraceeClientErrorLoggingHandler(TraceeBackend traceeBackend) {
        super(traceeBackend);
    }

    public TraceeClientErrorLoggingHandler() {
        this(Tracee.getBackend());
    }

    @Override
    protected final void handleIncoming(SOAPMessageContext context) {
        // Do nothing
    }

    @Override
    protected final void handleOutgoing(SOAPMessageContext context) {
        storeMessageInThreadLocal(context);
    }

}

package io.tracee.contextlogger.jaxws.container;

import io.tracee.Tracee;
import io.tracee.TraceeBackend;
import io.tracee.TraceeLogger;
import io.tracee.jaxws.container.TraceeServerHandler;

import javax.xml.ws.handler.soap.SOAPMessageContext;

/**
 * JaxWs client side handler that detects uncaught exceptions and outputs contextual information.
 */
public class TraceeClientErrorLoggingHandler extends AbstractTraceeErrorLoggingHandler {

    TraceeClientErrorLoggingHandler(TraceeBackend traceeBackend) {
        super(traceeBackend);
    }

    public TraceeClientErrorLoggingHandler() {
        this(Tracee.getBackend());
    }

    @Override
    protected final void handleIncoming(SOAPMessageContext context) {
        // Do nothing
    }

    @Override
    protected final void handleOutgoing(SOAPMessageContext context) {
        storeMessageInThreadLocal(context);
    }

}

Remove unused variables and fields

Remove unused variables and fields


/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * 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.jetbrains.python.newProject;

import com.intellij.ide.util.projectWizard.AbstractNewProjectDialog;
import com.jetbrains.python.newProject.steps.PyCharmNewProjectStep;

public class PyCharmNewProjectDialog extends AbstractNewProjectDialog {
  @Override
  protected PyCharmNewProjectStep createRootStep() {
    return new PyCharmNewProjectStep();
  }
}

/*
 * Copyright 2000-2014 JetBrains s.r.o.
 *
 * 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.jetbrains.python.newProject;

import com.intellij.ide.util.projectWizard.AbstractNewProjectDialog;
import com.jetbrains.python.newProject.steps.PyCharmNewProjectStep;

public class PyCharmNewProjectDialog extends AbstractNewProjectDialog {
  @Override
  protected PyCharmNewProjectStep createRootStep() {
    return new PyCharmNewProjectStep();
  }

  @Override
  protected String getHelpId() {
    return "concepts.project";
  }
}

Fix help topic for `File - New Project` dialog (PY-28831)


package ca.uhnresearch.pughlab.tracker.restlets;

import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.data.Status;
import org.restlet.routing.Filter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DefaultingFilter extends Filter {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	private String defaultPath = "/index.html";

	public DefaultingFilter(Context context, Restlet next) {
		super(context, next);
	}

	@Override
	protected int doHandle (Request request, Response response) {
		logger.debug("doHandle FILTER: " + request.getResourceRef().getPath());
		int result = super.doHandle(request, response);
		if (response.getStatus().equals(Status.CLIENT_ERROR_NOT_FOUND)) {
			response.setStatus(Status.SUCCESS_OK);
			String path = request.getResourceRef().getPath();

			if (! defaultPath.equals(path)) {
				request.getResourceRef().setPath(defaultPath);
				result = super.doHandle(request, response);
			}
		}
		return result;
	}

	/**
	 * @return the defaultPath
	 */
	public String getDefaultPath() {
		return defaultPath;
	}

	/**
	 * @param rewrites the defaultPath to set
	 */
	public void setDefaultPath(String defaultPath) {
		this.defaultPath = defaultPath;
	}
}

package ca.uhnresearch.pughlab.tracker.restlets;

import org.restlet.Context;
import org.restlet.Request;
import org.restlet.Response;
import org.restlet.Restlet;
import org.restlet.data.Status;
import org.restlet.routing.Filter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DefaultingFilter extends Filter {

	private final Logger logger = LoggerFactory.getLogger(getClass());

	private String defaultPath = "/index.html";

	public DefaultingFilter(Context context, Restlet next) {
		super(context, next);
	}

	@Override
	protected int doHandle (Request request, Response response) {
		logger.debug("doHandle FILTER: " + request.getResourceRef().getPath());
		int result = super.doHandle(request, response);
		if (response.getStatus().equals(Status.CLIENT_ERROR_NOT_FOUND)) {
			response.setStatus(Status.SUCCESS_OK);
			String path = request.getResourceRef().getPath();

			if (! getDefaultPath().equals(path)) {
				request.getResourceRef().setPath(getDefaultPath());
				result = super.doHandle(request, response);
			}
		}
		return result;
	}

	/**
	 * @return the defaultPath
	 */
	public String getDefaultPath() {
		return defaultPath;
	}

	/**
	 * @param rewrites the defaultPath to set
	 */
	public void setDefaultPath(String defaultPath) {
		this.defaultPath = defaultPath;
	}
}

Make sure we use an accessor rather than a private var for overriding


package org.synyx.urlaubsverwaltung.security;

import org.junit.Before;
import org.junit.Test;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;

public class LoginControllerTest {

    private LoginController sut;

    private static final String APPLICATION_VERSION = "1.1.1";

    @Before
    public void setUp() {

        sut = new LoginController(APPLICATION_VERSION);
    }

    @Test
    public void ensureLoginHasCorrectVersionAndView() throws Exception {

        perform(get("/login"))
            .andExpect(model().attribute("version", equalTo(APPLICATION_VERSION)))
            .andExpect(view().name("login/login"));
        ;
    }

    private ResultActions perform(MockHttpServletRequestBuilder builder) throws Exception {

        return standaloneSetup(sut).build().perform(builder);
    }
}

package org.synyx.urlaubsverwaltung.security;

import org.junit.Before;
import org.junit.Test;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view;
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.standaloneSetup;

public class LoginControllerTest {

    private LoginController sut;

    private static final String APPLICATION_VERSION = "1.1.1";

    @Before
    public void setUp() {

        sut = new LoginController(APPLICATION_VERSION);
    }

    @Test
    public void ensureLoginHasCorrectVersionAndView() throws Exception {

        perform(get("/login"))
            .andExpect(model().attribute("version", equalTo(APPLICATION_VERSION)))
            .andExpect(view().name("login/login"));
    }

    private ResultActions perform(MockHttpServletRequestBuilder builder) throws Exception {

        return standaloneSetup(sut).build().perform(builder);
    }
}

Remove not needed double semicolon

Remove not needed double semicolon


package com.elmakers.mine.bukkit.utility.help;

public class SearchFactors {
    // HelpTopicMatch
    public static double CONTENT_FACTOR = 1.5;
    public static double TAG_FACTOR = 0.1;
    public static double TITLE_FACTOR = 1.2;
    public static double CONTENT_WEIGHT = 1;
    public static double TAG_WEIGHT = 0.5;
    public static double TITLE_WEIGHT = 1.3;

    // HelpTopicWord
    public static double RARITY_FACTOR = 0.4;
    public static double TOPIC_RARITY_FACTOR = 1.5;
    public static double LENGTH_FACTOR = 0.1;
    public static double RARITY_WEIGHT = 5;
    public static double TOPIC_RARITY_WEIGHT = 1.0;
    public static double LENGTH_WEIGHT = 1.5;

    // HelpTopicKeywordMatch
    public static double COUNT_FACTOR = 0.4;
    public static double WORD_FACTOR = 0.5;
    public static double SIMILARITY_FACTOR = 0.1;
    public static double COUNT_WEIGHT = 1;
    public static double WORD_WEIGHT = 0.8;
    public static double COUNT_MAX = 5;
    public static double MIN_SIMILARITY = 0.6;
}

package com.elmakers.mine.bukkit.utility.help;

public class SearchFactors {
    // HelpTopicMatch
    public static double CONTENT_FACTOR = 1.5;
    public static double TAG_FACTOR = 0.75;
    public static double TITLE_FACTOR = 1.2;
    public static double CONTENT_WEIGHT = 1;
    public static double TAG_WEIGHT = 1.1;
    public static double TITLE_WEIGHT = 1.3;

    // HelpTopicWord
    public static double RARITY_FACTOR = 0.4;
    public static double TOPIC_RARITY_FACTOR = 1.5;
    public static double LENGTH_FACTOR = 0.5;
    public static double RARITY_WEIGHT = 1.2;
    public static double TOPIC_RARITY_WEIGHT = 1.0;
    public static double LENGTH_WEIGHT = 1.1;

    // HelpTopicKeywordMatch
    public static double COUNT_FACTOR = 0.4;
    public static double WORD_FACTOR = 0.5;
    public static double SIMILARITY_FACTOR = 1.2;
    public static double COUNT_WEIGHT = 1;
    public static double WORD_WEIGHT = 0.8;
    public static double COUNT_MAX = 3;
    public static double MIN_SIMILARITY = 0.6;
}

Tweak some search factors by hand (sorry, ML)


package org.cafebabepy.runtime.object;

import org.cafebabepy.runtime.Python;

/**
 * Created by yotchang4s on 2017/06/19.
 */
public class PyIntObject extends AbstractPyObjectObject {

    // FIXME CPythonのsys.maxsizeに対応する
    private final int value;

    public PyIntObject(Python runtime, int value) {
        super(runtime, runtime.typeOrThrow("builtins.int"));

        this.value = value;
    }

    public int getIntValue() {
        return this.value;
    }

    public PyIntObject add(PyIntObject other) {
        return this.runtime.number(this.value + other.value);
    }

    public PyIntObject sub(PyIntObject other) {
        return this.runtime.number(this.value - other.value);
    }

    @Override
    public String asJavaString() {
        return String.valueOf(this.value);
    }
}

package org.cafebabepy.runtime.object;

import org.cafebabepy.runtime.Python;

/**
 * Created by yotchang4s on 2017/06/19.
 */
public class PyIntObject extends AbstractPyObjectObject {

    // FIXME CPythonのsys.maxsizeに対応する
    private final int value;

    public PyIntObject(Python runtime, int value) {
        super(runtime, runtime.typeOrThrow("builtins.int"));

        this.value = value;
    }

    public int getIntValue() {
        return this.value;
    }

    public PyIntObject add(PyIntObject other) {
        return this.runtime.number(this.value + other.value);
    }

    public PyIntObject sub(PyIntObject other) {
        return this.runtime.number(this.value - other.value);
    }

    public PyBoolObject lt(PyIntObject other) {
        return this.runtime.bool(this.value < other.value);
    }

    public PyBoolObject gt(PyIntObject other) {
        return this.runtime.bool(this.value > other.value);
    }

    @Override
    public String asJavaString() {
        return String.valueOf(this.value);
    }
}

Add lt and gt method to int object

Add lt and gt method to int object


package org.webbitserver.netty;

import java.util.Set;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class NettyWebServerTest {
    @Test
    public void stopsServerCleanlyNotLeavingResourcesHanging() throws Exception {
        int threadCountStart = getCurrentThreadCount();

        // Build, start, wait and stop the Netty Web Server
        new NettyWebServer(8080).start().stop();

        assertEquals(threadCountStart, getCurrentThreadCount());
    }

    private int getCurrentThreadCount() {
        Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
        Thread[] threadArray = threadSet.toArray(new Thread[threadSet.size()]);
        return threadArray.length;
    }

}

package org.webbitserver.netty;

import java.util.Set;
import java.util.concurrent.Executors;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class NettyWebServerTest {
    @Test
    public void stopsServerCleanlyNotLeavingResourcesHanging() throws Exception {
        int threadCountStart = getCurrentThreadCount();
        NettyWebServer server = new NettyWebServer(Executors.newSingleThreadScheduledExecutor(), 8080).start();
        assertEquals(threadCountStart+1, getCurrentThreadCount());
        server.stop();
        assertEquals(threadCountStart, getCurrentThreadCount());
    }

    private int getCurrentThreadCount() {
        Set<Thread> threadSet = Thread.getAllStackTraces().keySet();
        Thread[] threadArray = threadSet.toArray(new Thread[threadSet.size()]);
        return threadArray.length;
    }

}

Add another assertion to verify that thread count is incremented by one


package com.campmongoose.serversaturday.spigot.command.sscommand.submit;

import com.campmongoose.serversaturday.common.Reference.Commands;
import com.campmongoose.serversaturday.common.Reference.Messages;
import com.campmongoose.serversaturday.spigot.command.AbstractSpigotCommand;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

public class SSGetRewards extends AbstractSpigotCommand {

    public SSGetRewards() {
        super(Commands.GET_REWARDS_NAME, Commands.GET_REWARDS_DESC);
        executor = (sender, args) -> {
            getPluginInstance().getRewardGiver().givePlayerReward((Player) sender);
            sender.sendMessage(ChatColor.GOLD + Messages.REWARDS_GIVEN);
            return true;
        };
    }
}

package com.campmongoose.serversaturday.spigot.command.sscommand.submit;

import com.campmongoose.serversaturday.common.Reference.Commands;
import com.campmongoose.serversaturday.common.Reference.Messages;
import com.campmongoose.serversaturday.common.Reference.Permissions;
import com.campmongoose.serversaturday.spigot.command.AbstractSpigotCommand;
import com.campmongoose.serversaturday.spigot.command.SpigotCommandArgument;
import com.campmongoose.serversaturday.spigot.command.SpigotCommandPermissions;
import com.campmongoose.serversaturday.spigot.command.SpigotCommandUsage;
import java.util.Collections;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;

public class SSGetRewards extends AbstractSpigotCommand {

    public SSGetRewards() {
        super(Commands.GET_REWARDS_NAME, Commands.GET_REWARDS_DESC);
        usage = new SpigotCommandUsage(Collections.singletonList(new SpigotCommandArgument(Commands.SS_CMD + Commands.GOTO_NAME)));
        permissions = new SpigotCommandPermissions(Permissions.VIEW_GOTO, false);
        executor = (sender, args) -> {
            getPluginInstance().getRewardGiver().givePlayerReward((Player) sender);
            sender.sendMessage(ChatColor.GOLD + Messages.REWARDS_GIVEN);
            return true;
        };
    }
}

Add missing usage and permissions assignments.


package bamboo.task;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import java.util.regex.Pattern;

public class HeadingContentHandler extends DefaultHandler {
    private static Pattern WHITESPACE_RE = Pattern.compile("\\s+");
    private StringBuilder text = new StringBuilder();
    private int depth = 0;

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        if (depth > 0 || localName.equals("h1")) {
            depth++;
            if (text.length() != 0) {
                text.append(" ");
            }
        }
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (depth > 0) {
            depth--;
        }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        if (depth > 0) {
            text.append(ch, start, length);
        }
    }

    @Override
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        if (depth > 0) {
            text.append(ch, start, length);
        }
    }

    public String getText() {
        return WHITESPACE_RE.matcher(text).replaceAll(" ");
    }
}

package bamboo.task;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

import java.util.regex.Pattern;

public class HeadingContentHandler extends DefaultHandler {
    private static Pattern WHITESPACE_RE = Pattern.compile("\\s+");
    private StringBuilder text = new StringBuilder();
    private int depth = 0;
    private boolean sawAnyHeadings = false;

    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
        if (depth > 0 || localName.equals("h1")) {
            depth++;
            sawAnyHeadings = true;
            if (text.length() != 0) {
                text.append(" ");
            }
        }
    }

    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        if (depth > 0) {
            depth--;
        }
    }

    @Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        if (depth > 0) {
            text.append(ch, start, length);
        }
    }

    @Override
    public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
        if (depth > 0) {
            text.append(ch, start, length);
        }
    }

    public String getText() {
        if (sawAnyHeadings) {
            return WHITESPACE_RE.matcher(text).replaceAll(" ");
        } else {
            return null;
        }
    }
}

Set h1 to null if no headings are present


public class DatabaseApp {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}

public class DatabaseApp {

	public static void main(String[] args) {
		DatabaseApp app = new DatabaseApp();
		try {
			app.setup();
			app.run();
		} finally {
			app.cleanup();
		}
	}

	public void setup() {

	}
	public void run() {

	}
	public void cleanup() {

	}

}

Add methods to make main class non-static :)


package org.dspace.workflow.actions;

import org.dspace.workflow.actions.userassignment.UserSelectionAction;

/**
 * Created by IntelliJ IDEA.
 * User: bram
 * Date: 6-aug-2010
 * Time: 14:57:17
 * To change this template use File | Settings | File Templates.
 */
public class UserSelectionActionConfig extends WorkflowActionConfig{

    public UserSelectionActionConfig(String id) {
        super(id);
    }

    public UserSelectionAction getProcessingAction(){
        return (UserSelectionAction) processingAction;
    }
}

package org.dspace.workflow.actions;

import org.dspace.workflow.actions.userassignment.UserSelectionAction;

/**
 * Created by IntelliJ IDEA.
 * User: bram
 * Date: 6-aug-2010
 * Time: 14:57:17
 * To change this template use File | Settings | File Templates.
 */
public class UserSelectionActionConfig extends WorkflowActionConfig{

    public UserSelectionActionConfig(String id) {
        super(id);
    }

    public UserSelectionAction getProcessingAction(){
        return (UserSelectionAction) processingAction;
    }

    // Spring requires getter/setter types to match, so even though
    // we don't need a custom setter, we must have a setter that takes the same
    // parameter type as the above getter.
    public void setProcessingAction(UserSelectionAction processingAction) {
        super.setProcessingAction(processingAction);
    }
}

Fix bean getter/setter type mismatch

Fix bean getter/setter type mismatch

Mismatch was causing failures on Travis CI because the getter and setter types did not match:

    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'noUserSelectionAction' defined in URL [file:/opt/dryad-test//config/workflow-actions.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'processingAction' of bean class [org.dspace.workflow.actions.UserSelectionActionConfig]: Bean property 'processingAction' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?"


package com.codenvy.ide.ext.datasource.client.sqllauncher;

import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
import com.google.gwt.i18n.client.Messages;

@DefaultLocale("en")
public interface SqlRequestLauncherConstants extends Messages {

    @DefaultMessage("Open SQL editor")
    String menuEntryOpenSqlEditor();

    @DefaultMessage("SQL editor")
    String sqlEditorWindowTitle();

    @DefaultMessage("Select datasource")
    String selectDatasourceLabel();

    @DefaultMessage("Result limit")
    String resultLimitLabel();

    @DefaultMessage("Execute")
    String executeButtonLabel();

    @DefaultMessage("{0} rows.")
    @AlternateMessage({"one", "{0} row."})
    String updateCountMessage(@PluralCount int count);

    @DefaultMessage("Export")
    String exportCsvLabel();

    @DefaultMessage("Execution mode")
    String executionModeLabel();

    @DefaultMessage("Execute all - ignore and report errors")
    String executeAllModeItem();

    @DefaultMessage("First error - stop on first error")
    String stopOnErrorModeitem();

    @DefaultMessage("Transaction - rollback on first error")
    String transactionModeItem();
}

package com.codenvy.ide.ext.datasource.client.sqllauncher;

import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
import com.google.gwt.i18n.client.Messages;

@DefaultLocale("en")
public interface SqlRequestLauncherConstants extends Messages {

    @DefaultMessage("Open SQL editor")
    String menuEntryOpenSqlEditor();

    @DefaultMessage("SQL editor")
    String sqlEditorWindowTitle();

    @DefaultMessage("Select datasource")
    String selectDatasourceLabel();

    @DefaultMessage("Result limit")
    String resultLimitLabel();

    @DefaultMessage("Execute")
    String executeButtonLabel();

    @DefaultMessage("{0} rows.")
    @AlternateMessage({"one", "{0} row."})
    String updateCountMessage(@PluralCount int count);

    @DefaultMessage("Export")
    String exportCsvLabel();

    @DefaultMessage("Execution mode")
    String executionModeLabel();

    @DefaultMessage("Execute all - ignore and report errors")
    String executeAllModeItem();

    @DefaultMessage("First error - stop on first error")
    String stopOnErrorModeitem();

    @DefaultMessage("Transaction - rollback on first error")
    String transactionModeItem();

    @DefaultMessage("Query Results")
    String queryResultsTitle();
}

Add constant fo result block title

Add constant fo result block title


package mariculture.core.handlers;

import mariculture.core.Core;
import mariculture.core.blocks.base.BlockFluid;
import mariculture.core.items.ItemBuckets;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class BucketHandler {
    @SubscribeEvent
    public void onFillBucket(FillBucketEvent event) {
        Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ);
        if (block instanceof BlockFluid) if (event.current.getItem() == Items.bucket) {
            ItemStack ret = ((ItemBuckets) Core.buckets).getBucket(block);
            if (ret != null) {
                event.result = ret;
                event.setResult(Result.ALLOW);
            }
        }
    }
}

package mariculture.core.handlers;

import mariculture.core.Core;
import mariculture.core.blocks.base.BlockFluid;
import mariculture.core.items.ItemBuckets;
import net.minecraft.block.Block;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class BucketHandler {
    @SubscribeEvent
    public void onFillBucket(FillBucketEvent event) {
        Block block = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ);
        if (block instanceof BlockFluid) if (event.current.getItem() == Items.bucket) {
            ItemStack ret = ((ItemBuckets) Core.buckets).getBucket(block);
            if (ret != null) {
                event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ);
                event.result = ret;
                event.setResult(Result.ALLOW);
            }
        }
    }
}

Set block to air after picking up fluids


package com.emc.example.client;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

import com.emc.example.client.dummy.SensorData;
import com.emc.example.client.dummy.SensorEvent;
import com.emc.nautilus.streaming.Producer;
import com.emc.nautilus.streaming.ProducerConfig;
import com.emc.nautilus.streaming.Serializer;
import com.emc.nautilus.streaming.Stream;
import com.emc.nautilus.streaming.StreamManager;

public class StreamProducerSink {

	public StreamProducerSink(StreamManager streamManager, Socket clientSocket, Serializer<SensorEvent> serializer) {
		this.streamManager = streamManager;
		this.clientSocket = clientSocket;
		this.serializer = serializer;
	}

	StreamManager streamManager;
	private Socket clientSocket;
	private Serializer<SensorEvent> serializer;
	private boolean isRunning = true;

	//...
	public void run() throws IOException {
		DataInputStream rawTCP = new DataInputStream(clientSocket.getInputStream());
		Stream stream = streamManager.getStream("rawSensorStream");
		Producer<SensorEvent> producer = stream.createProducer(serializer, new ProducerConfig());

		while (isRunning ) {
			SensorData sd = SensorData.fromTCP(rawTCP);
			String routingKey = sd.sensor_id;
			SensorEvent e = new SensorEvent(sd);
			producer.publish(routingKey, e);
		}

	}
	//...
}

package com.emc.example.client;

import java.io.DataInputStream;
import java.io.IOException;
import java.net.Socket;

import com.emc.example.client.dummy.SensorData;
import com.emc.example.client.dummy.SensorEvent;
import com.emc.nautilus.streaming.Producer;
import com.emc.nautilus.streaming.ProducerConfig;
import com.emc.nautilus.streaming.Serializer;
import com.emc.nautilus.streaming.Stream;
import com.emc.nautilus.streaming.StreamManager;

public class StreamProducerSink {

	public StreamProducerSink(StreamManager streamManager, Socket clientSocket, Serializer<SensorEvent> serializer) {
		this.streamManager = streamManager;
		this.clientSocket = clientSocket;
		this.serializer = serializer;
	}

	StreamManager streamManager;
	private Socket clientSocket;
	private Serializer<SensorEvent> serializer;
	private boolean isRunning = true;

	//...
	public void run() throws IOException {
		DataInputStream rawTCP = new DataInputStream(clientSocket.getInputStream());
		Stream stream = streamManager.getStream("rawSensorStream");
		Producer<SensorEvent> producer = stream.createProducer(serializer, new ProducerConfig(null));

		while (isRunning ) {
			SensorData sd = SensorData.fromTCP(rawTCP);
			String routingKey = sd.sensor_id;
			SensorEvent e = new SensorEvent(sd);
			producer.publish(routingKey, e);
		}

	}
	//...
}

Fix compile error in example

Fix compile error in example


/*
 * 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.jmeter.visualizers.backend;

import java.io.Serializable;

/**
 * Identifies Backend components
 * @since 3.2
 */
public interface Backend extends Serializable {
    // NOOP
}

Add License header + svn:eol

Add License header + svn:eol

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1781739 13f79535-47bb-0310-9956-ffa450edef68

Former-commit-id: 2c92560095e395108900d859cb353be44605aa5b


package org.panda_lang.pandomium.wrapper;

import org.cef.browser.CefBrowser;

import javax.swing.*;
import java.awt.*;

public class PandomiumBrowser {

    private final CefBrowser cefBrowser;

    public PandomiumBrowser(CefBrowser cefBrowser) {
        this.cefBrowser = cefBrowser;
    }

    public JPanel toSwingComponent() {
        JPanel panel = new JPanel();
        panel.add(toAWTComponent());
        return panel;
    }

    public Component toAWTComponent() {
        return cefBrowser.getUIComponent();
    }

    public CefBrowser getCefBrowser() {
        return cefBrowser;
    }

}

package org.panda_lang.pandomium.wrapper;

import org.cef.browser.CefBrowser;

import javax.swing.*;
import java.awt.*;

public class PandomiumBrowser {

    private final CefBrowser cefBrowser;

    public PandomiumBrowser(CefBrowser cefBrowser) {
        this.cefBrowser = cefBrowser;
    }

    public JPanel toSwingComponent() {
        BorderLayout borderLayout = new BorderLayout();
        JPanel panel = new JPanel(borderLayout);

        panel.add(toAWTComponent(), BorderLayout.CENTER);
        return panel;
    }

    public Component toAWTComponent() {
        return cefBrowser.getUIComponent();
    }

    public CefBrowser getCefBrowser() {
        return cefBrowser;
    }

}

Change a swing container layout to the border layout


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tw.edu.npu.mis;

/**
 * The model class of the calculator application.
 */
public class Calculator {

    /**
     * The available operators of the calculator.
     */
    public enum Operator {
        EQUAL,       // =
        PLUS,        // +
        MINUS,       // -
        TIMES,       // ×
        OVER,        // ⁄
        PLUS_MINUS,  // ±
        RECIPROCAL,  // 1/x
        PERCENT,     // %
        SQRT,        // √
        BACKSPACE,   // ⌫
        CLEAR,       // C
        CLEAR_ENTRY, // CE
        MEM_SET,     // MS
        MEM_PLUS,    // M+
        MEM_MINUS,   // M-
        MEM_RECALL,  // MR
        MEM_CLEAR    // MC
    }

    public void appendDigit(int digit) {
        // TODO code application logic here
    }

    public void appendDot() {
        // TODO code application logic here
    }

    public void performOperation(Operator operator) {
        // TODO code application logic here
    }

    public String getDisplay() {
        // TODO code application logic here
        return null;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }

}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tw.edu.npu.mis;

/**
 * The model class of the calculator application.
 */
public class Calculator {

    /**
     * The available operators of the calculator.
     */
    public enum Operator {
        CLEAR,       // C
        CLEAR_ENTRY, // CE
        BACKSPACE,   // ⌫
        EQUAL,       // =
        PLUS,        // +
        MINUS,       // -
        TIMES,       // ×
        OVER,        // ⁄
        PLUS_MINUS,  // ±
        RECIPROCAL,  // 1/x
        PERCENT,     // %
        SQRT,        // √
        MEM_CLEAR,   // MC
        MEM_SET,     // MS
        MEM_PLUS,    // M+
        MEM_MINUS,   // M-
        MEM_RECALL   // MR
    }

    public void appendDigit(int digit) {
        // TODO code application logic here
    }

    public void appendDot() {
        // TODO code application logic here
    }

    public void performOperation(Operator operator) {
        // TODO code application logic here
    }

    public String getDisplay() {
        // TODO code application logic here
        return null;
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }

}

Revert "Revert "Revert "Revert "Reorder operator""""

This reverts commit b24a074dde5c29efee87896bd74183330fea1948.


package nl.tudelft.dnainator;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import nl.tudelft.dnainator.ui.Window;

/**
 * DNAinator's entry point. This class merely sets the UI's look and feel
 * and then creates a window.
 */
public final class DNAinator {

	private DNAinator() {
		super();
	}

	/**
	 * DNAinator entry point.
	 * @param args Command-line arguments, unused for now.
	 */
	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			e.printStackTrace();
		}

		/* Be thread-safe. */
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				new Window();
			}
		});
	}
}

package nl.tudelft.dnainator;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import nl.tudelft.dnainator.ui.Window;

/**
 * DNAinator's entry point. This class merely sets the UI's look and feel
 * and then creates a window.
 */
public final class DNAinator {

	private DNAinator() {
		super();
	}

	/**
	 * DNAinator entry point.
	 *
	 * @param args Command-line arguments, unused for now.
	 */
	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
			if (System.getProperty("os.name").equals("Mac OS X")) {
				System.setProperty("apple.laf.useScreenMenuBar", "true");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}

		/* Be thread-safe. */
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				new Window();
			}
		});
	}
}

Use native menubar when using OS X

Use native menubar when using OS X


package com.smartdevicelink;

/**
 * This is a sample of how to get Java EE Bean to work with an SDL application
 * The code can be uncommented out with the proper gradle dependencies added
 */

//    @ServerEndpoint("/")
 //   @Stateful(name = "SDLSessionEJB")
    public class Main {

  /*      Session session;
        static Thread thread = null, mainThread;
        static Object LOCK;

        static com.smartdevicelink.SdlService sdlService;
        CustomTransport websocket;

        @OnOpen
        public void onOpen (Session session, EndpointConfig config) {
            websocket = new CustomTransport("http://localhost") {
                @Override
                public void onWrite(byte[] bytes, int offset, int length) {
                    try {
                        session.getBasicRemote().sendBinary(ByteBuffer.wrap(bytes));
                    }
                    catch (IOException e) {

                    }
                }
            };
            this.session = session;
            sdlService = new com.smartdevicelink.SdlService(websocket, sdlServiceCallback);
            sdlService.start();
        }

        @OnMessage
        public void onMessage (ByteBuffer message, Session session) {
            websocket.onByteBufferReceived(message);
        }

        static final com.smartdevicelink.SdlService.SdlServiceCallback sdlServiceCallback = new com.smartdevicelink.SdlService.SdlServiceCallback() {
            @Override
            public void onEnd() {

            }
        };
        */
    }

package com.smartdevicelink;

/**
 * This is a sample of how to get Java EE Bean to work with an SDL application
 * The code can be uncommented out with the proper gradle dependencies added
 */

//    @ServerEndpoint("/")
 //   @Stateful(name = "SDLSessionEJB")
    public class Main {

  /*      Session session;
        static Thread thread = null, mainThread;
        static Object LOCK;

        static com.smartdevicelink.SdlService sdlService;
        CustomTransport websocket;

        @OnOpen
        public void onOpen (Session session, EndpointConfig config) {
            websocket = new CustomTransport("http://localhost") {
                @Override
                public void onWrite(byte[] bytes, int offset, int length) {
                    try {
                        session.getBasicRemote().sendBinary(ByteBuffer.wrap(bytes));
                    }
                    catch (IOException e) {

                    }
                }
            };
            this.session = session;
            sdlService = new com.smartdevicelink.SdlService(new CustomTransportConfig(websocket), sdlServiceCallback);
            sdlService.start();
        }

        @OnMessage
        public void onMessage (ByteBuffer message, Session session) {
            websocket.onByteBufferReceived(message);
        }

        static final com.smartdevicelink.SdlService.SdlServiceCallback sdlServiceCallback = new com.smartdevicelink.SdlService.SdlServiceCallback() {
            @Override
            public void onEnd() {

            }
        };
        */
    }

Fix issue in SdlService constructor in hello_sdl_java_ee sample


package servers;

import com.onyx.application.WebDatabaseServer;
import entities.SimpleEntity;

/**
 * Created by timothy.osborn on 4/1/15.
 */
public class SampleDatabaseServer extends WebDatabaseServer
{
    public SampleDatabaseServer()
    {

    }

    /**
     * Run Database Server
     *
     * ex:  executable /Database/Location/On/Disk 8080 admin admin
     *
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception
    {
        SampleDatabaseServer server1 = new SampleDatabaseServer();
        server1.setPort(8080);
        server1.setWebServicePort(8082);
        server1.setDatabaseLocation("C:/Sandbox/Onyx/Tests/server.oxd");
        server1.start();

        SimpleEntity simpleEntity = new SimpleEntity();
        simpleEntity.setName("Test Name");
        simpleEntity.setSimpleId("ASDF");

        server1.join();
        System.out.println("Started");
    }

}

package servers;

import com.onyx.application.WebDatabaseServer;
import entities.SimpleEntity;

/**
 * Created by timothy.osborn on 4/1/15.
 */
public class SampleDatabaseServer extends WebDatabaseServer
{
    public SampleDatabaseServer()
    {

    }

    /**
     * Run Database Server
     *
     * ex:  executable /Database/Location/On/Disk 8080 admin admin
     *
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception
    {
        SampleDatabaseServer server1 = new SampleDatabaseServer();
        server1.setPort(8080);
        server1.setWebServicePort(8082);
        server1.setDatabaseLocation("C:/Sandbox/Onyx/Tests/server.oxd");
        server1.start();

        SimpleEntity simpleEntity = new SimpleEntity();
        simpleEntity.setName("Test Name");
        simpleEntity.setSimpleId("ASDF");
        server1.getPersistenceManager().saveEntity(simpleEntity);

        server1.join();
        System.out.println("Started");
    }

}

Add line to save an entity in test

Add line to save an entity in test


/**
 *
 */
package authoring.panel;

import engine.Entity;
import javafx.beans.property.SimpleStringProperty;

/**
 * @author Elliott Bolzan
 *
 */
public class EntityWrapper {

	private SimpleStringProperty name;
	private SimpleStringProperty imagePath;
	private Entity entity;

	/**
	 * PROERTIES ARE SET BUT NOT ENTITIES
	 */
	public EntityWrapper(Entity entity) {
		this.entity = entity;
		name = new SimpleStringProperty(entity.getName());
		imagePath = new SimpleStringProperty(entity.getImagePath());
	}

	public SimpleStringProperty getName() {
		return name;
	}

	public void setName(SimpleStringProperty name) {
		this.name = name;
		//entity.setName(name.get());
	}

	public SimpleStringProperty getImagePath() {
		return imagePath;
	}

	public void setImagePath(SimpleStringProperty imagePath) {
		this.imagePath = imagePath;
		//entity.setImagePath(imagePath.get());
	}

	public Entity getEntity() {
		return entity;
	}

	public void setEntity(Entity entity) {
		this.entity = entity;
	}

}

/**
 *
 */
package authoring.panel;

import engine.Entity;
import javafx.beans.property.SimpleStringProperty;

/**
 * @author Elliott Bolzan
 *
 */
public class EntityWrapper {

	private SimpleStringProperty name;
	private SimpleStringProperty imagePath;
	private Entity entity;

	/**
	 *
	 */
	public EntityWrapper(Entity entity) {
		this.entity = entity;
		name = new SimpleStringProperty(entity.getName());
		imagePath = new SimpleStringProperty(entity.getImagePath());
		name.addListener((observable, oldValue, newValue) -> this.entity.setName(newValue));
		imagePath.addListener((observable, oldValue, newValue) -> this.entity.setImagePath(newValue));
	}

	public SimpleStringProperty getName() {
		return name;
	}

	public SimpleStringProperty getImagePath() {
		return imagePath;
	}

	public Entity getEntity() {
		return entity;
	}

}

Update the Entity when it's Wrapper is updated.


package cl.fatman.capital.fund;

import static org.hamcrest.Matchers.*;

import static org.junit.Assert.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

public class ControllerTest {

	private static Controller control;
	private static PersistenceData persistence;

	@BeforeClass
	public static void setUp() {
		control = Controller.getInstance();
		control.setUp();
		List<FundType> ftList = new ArrayList<FundType>();
		FundType type = new FundType(1, "Deuda < 90 días");
		ftList.add(type);
		persistence = PersistenceData.getInstance();
		persistence.insertObjectList(ftList);
	}

	@AfterClass
	public static void tearDown() {
		control.tearDown();
	}

	@Test
	public void storeFundDataTest() {
		LocalDate endDate = LocalDate.now();
		LocalDate startDate = endDate.minusDays(3);
		control.storeFundData(startDate, endDate);
		List<?> rList = persistence.selectAllObjects("from FundRate", FundRate.class);
		assertThat("Fund rate list should be greater than 0.", rList.size(), greaterThan(0));
	}
}

package cl.fatman.capital.fund;

import static org.hamcrest.Matchers.*;

import static org.junit.Assert.*;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

public class ControllerTest {

	private static Controller control;
	private static PersistenceData persistence;

	@BeforeClass
	public static void setUp() {
		control = Controller.getInstance();
		control.setUp();
		List<FundType> ftList = new ArrayList<FundType>();
		FundType type = new FundType(1, "Deuda < 90 días");
		ftList.add(type);
		persistence = PersistenceData.getInstance();
		persistence.insertObjectList(ftList);
	}

	@AfterClass
	public static void tearDown() {
		control.tearDown();
	}

	@Test
	public void storeFundDataTest() {
		LocalDate endDate = LocalDate.now();
		LocalDate startDate = endDate.minusDays(2);
		control.storeFundData(startDate, endDate);
		List<?> rList = persistence.selectAllObjects("from FundRate", FundRate.class);
		assertThat("Fund rate list should be greater than 0.", rList.size(), greaterThan(0));
	}
}

Reduce to 3 the number of days for the method test.


package com.google.sps.data;

import com.google.sps.data.ChromeOSDevice;
import java.util.ArrayList;
import java.util.List;

/*
 * Class representing response to `list Chrome OS Devices` request.
 * See https://developers.google.com/admin-sdk/directory/v1/reference/chromeosdevices/list
 */
public final class ListDeviceResponse {

  private final String kind;
  private final List<ChromeOSDevice> chromeosdevices;
  private final String nextPageToken;
  private final String etag;

  public ListDeviceResponse(String kind, List<ChromeOSDevice> chromeosdevices, String nextPageToken, String etag) {
    this.kind = kind;
    this.chromeosdevices = getDeviceListCopy(chromeosdevices);
    this.nextPageToken = nextPageToken;
    this.etag = etag;
  }

  public boolean hasNextPageToken() {
      return nextPageToken != null;
  }

  public String getNextPageToken() {
      return nextPageToken;
  }

  public List<ChromeOSDevice> getDeviceListCopy(List<ChromeOSDevice> original) {
    final List<ChromeOSDevice> devices = new ArrayList<>();
    for (final ChromeOSDevice device : original) {
      devices.add(device.copy());
    }
    return devices;
  }

  public List<ChromeOSDevice> getDevices() {
    return getDeviceListCopy(chromeosdevices);
  }
}

package com.google.sps.data;

import com.google.sps.data.ChromeOSDevice;
import java.util.ArrayList;
import java.util.List;

/*
 * Class representing response to `list Chrome OS Devices` request.
 * See https://developers.google.com/admin-sdk/directory/v1/reference/chromeosdevices/list
 */
public final class ListDeviceResponse {

  private final String kind;
  private final List<ChromeOSDevice> chromeosdevices;
  private final String nextPageToken;
  private final String etag;

  public ListDeviceResponse(String kind, List<ChromeOSDevice> chromeosdevices, String nextPageToken, String etag) {
    this.kind = kind;
    this.chromeosdevices = getDeviceListCopy(chromeosdevices);
    this.nextPageToken = nextPageToken;
    this.etag = etag;
  }

  public boolean hasNextPageToken() {
      return nextPageToken != null;
  }

  public String getNextPageToken() {
      return nextPageToken;
  }

  public List<ChromeOSDevice> getDeviceListCopy(List<ChromeOSDevice> original) {
    final List<ChromeOSDevice> devices = new ArrayList<>();
    if (original == null) {
      return devices;
    }
    for (final ChromeOSDevice device : original) {
      devices.add(device.copy());
    }
    return devices;
  }

  public List<ChromeOSDevice> getDevices() {
    return getDeviceListCopy(chromeosdevices);
  }
}

Fix null pointer exception when user has 0 devices associated with account


package nl.dykam.dev.reutil.data;

import nl.dykam.dev.reutil.data.annotations.ApplicableTo;
import nl.dykam.dev.reutil.data.annotations.Defaults;
import nl.dykam.dev.reutil.data.annotations.ObjectType;
import nl.dykam.dev.reutil.data.annotations.Require;

class ComponentInfo {
    public static <T extends Component> Defaults getDefaults(Class<T> type) {
        return type.getAnnotation(Defaults.class);
    }

    private static <T extends Component>  ComponentBuilder<T> getBuilder(Class<T> type) {
        return ComponentBuilder.getBuilder(type);
    }

    public static <T extends Component> ObjectType[] getApplicables(Class<T> type) {
        return type.getAnnotation(ApplicableTo.class).value();
    }
    public static <T extends Component> Class<? extends Component>[] getRequired(Class<T> type) {
        return type.getAnnotation(Require.class).value();
    }
}

package nl.dykam.dev.reutil.data;

import nl.dykam.dev.reutil.data.annotations.ApplicableTo;
import nl.dykam.dev.reutil.data.annotations.Defaults;
import nl.dykam.dev.reutil.data.annotations.ObjectType;
import nl.dykam.dev.reutil.data.annotations.Require;

import java.lang.reflect.Array;

class ComponentInfo {

    public static final ObjectType[] OBJECT_TYPES = new ObjectType[0];
    @SuppressWarnings("unchecked")
    public static final Class<? extends Component>[] CLASSES = (Class<? extends Component>[]) Array.newInstance(Class.class, 0);

    public static <T extends Component> Defaults getDefaults(Class<T> type) {
        return type.getAnnotation(Defaults.class);
    }

    private static <T extends Component>  ComponentBuilder<T> getBuilder(Class<T> type) {
        return ComponentBuilder.getBuilder(type);
    }

    public static <T extends Component> ObjectType[] getApplicables(Class<T> type) {
        ApplicableTo annotation = type.getAnnotation(ApplicableTo.class);
        return annotation == null ? OBJECT_TYPES : annotation.value();
    }

    @SuppressWarnings("unchecked")
    public static <T extends Component> Class<? extends Component>[] getRequired(Class<T> type) {
        Require annotation = type.getAnnotation(Require.class);
        return annotation == null ? CLASSES : annotation.value();
    }
}

Return Empty array when annotations are missing


package technology.tabula.json;

import java.lang.reflect.Type;
import java.util.List;

import technology.tabula.RectangularTextContainer;
import technology.tabula.Table;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

public final class TableSerializer implements JsonSerializer<Table> {

	public static final TableSerializer INSTANCE = new TableSerializer();

	private TableSerializer() {
		// singleton
	}

	@Override
	public JsonElement serialize(Table src, Type typeOfSrc, JsonSerializationContext context) {

		JsonObject result = new JsonObject();

		result.addProperty("extraction_method", src.getExtractionMethod());
		result.addProperty("top",    src.getTop());
		result.addProperty("left",   src.getLeft());
		result.addProperty("width",  src.getWidth());
		result.addProperty("height", src.getHeight());

		JsonArray data;
		result.add("data", data = new JsonArray());

		for (List<RectangularTextContainer> srcRow : src.getRows()) {
			JsonArray row = new JsonArray();
			for (RectangularTextContainer textChunk : srcRow) row.add(context.serialize(textChunk));
			data.add(row);
		}

		return result;
	}

}

package technology.tabula.json;

import java.lang.reflect.Type;
import java.util.List;

import technology.tabula.RectangularTextContainer;
import technology.tabula.Table;

import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

public final class TableSerializer implements JsonSerializer<Table> {

	public static final TableSerializer INSTANCE = new TableSerializer();

	private TableSerializer() {
		// singleton
	}

	@Override
	public JsonElement serialize(Table src, Type typeOfSrc, JsonSerializationContext context) {

		JsonObject result = new JsonObject();

		result.addProperty("extraction_method", src.getExtractionMethod());
		result.addProperty("top",    src.getTop());
		result.addProperty("left",   src.getLeft());
		result.addProperty("width",  src.getWidth());
		result.addProperty("height", src.getHeight());
		result.addProperty("right",  src.getRight());
		result.addProperty("bottom", src.getBottom());

		JsonArray data;
		result.add("data", data = new JsonArray());

		for (List<RectangularTextContainer> srcRow : src.getRows()) {
			JsonArray row = new JsonArray();
			for (RectangularTextContainer textChunk : srcRow) row.add(context.serialize(textChunk));
			data.add(row);
		}

		return result;
	}

}

Add right and bottom of area to JSON output


package ch.tkuhn.nanopub.server;

public class NanopubServerUtils extends org.nanopub.extra.server.NanopubServerUtils {

	// Version numbers have the form MAJOR.MINOR (for example, 0.12 is a newer version than 0.9!)

	public static final String protocolVersion = "0.4";
	public static final int protocolVersionValue = getVersionValue(protocolVersion);

	public static final String journalVersion = "0.3";
	public static final int journalVersionValue = getVersionValue(journalVersion);

}

package ch.tkuhn.nanopub.server;

public class NanopubServerUtils extends org.nanopub.extra.server.NanopubServerUtils {

	// Version numbers have the form MAJOR.MINOR (for example, 0.12 is a newer version than 0.9!)

	public static final String protocolVersion = "0.5";
	public static final int protocolVersionValue = getVersionValue(protocolVersion);

	public static final String journalVersion = "0.3";
	public static final int journalVersionValue = getVersionValue(journalVersion);

}

Make this protocol version 0.5

Make this protocol version 0.5


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

import org.terasology.entitySystem.Component;
import org.terasology.entitySystem.entity.EntityRef;

/**
 * Used to find the character "Gooey".
 */
public class GooeyComponent implements Component {
    EntityRef offeredQuest = EntityRef.NULL;
}

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

import org.terasology.entitySystem.Component;
import org.terasology.entitySystem.entity.EntityRef;

/**
 * Used to find the character "Gooey".
 */
public class GooeyComponent implements Component {
    public EntityRef offeredQuest = EntityRef.NULL;
}

Make the offered quests field public.

Make the offered quests field public.


package magic.compiler;

import magic.lang.Context;

/**
 * Class for a combined context + value result
 * @author Mike
 *
 * @param <T>
 */
public class Result<T> {

	private Context context;
	private T value;

	public Result(Context c, T value) {
		this.context=c;
		this.value=value;
	}

	public Context getContext() {
		return context;
	}

	public T getValue() {
		return value;
	}

	@Override
	public String toString() {
		return "(Result "+context+" : "+value+")";
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static <T> Result<T> create(Context c, T value) {
		return new Result(c,value);
	}
}

package magic.compiler;

import magic.lang.Context;

/**
 * Class for a combined context + value result
 * @author Mike
 *
 * @param <T>
 */
public final class Result<T> {

	private Context context;
	private T value;

	public Result(Context c, T value) {
		this.context=c;
		this.value=value;
	}

	public Context getContext() {
		return context;
	}

	public T getValue() {
		return value;
	}

	@Override
	public String toString() {
		return "(Result "+context+" : "+value+")";
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static <T> Result<T> create(Context c, T value) {
		return new Result(c,value);
	}
}

Make result final. Perhaps helps with EA?


package guitests;

import guitests.guihandles.HelpWindowHandle;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class HelpWindowTest extends TaskManagerGuiTest {
/*
    @Test
    public void openHelpWindow() {

        taskListPanel.clickOnListView();

        assertHelpWindowOpen(mainMenu.openHelpWindowUsingAccelerator());

        assertHelpWindowOpen(mainMenu.openHelpWindowUsingMenu());

        assertHelpWindowOpen(commandBox.runHelpCommand());

    }

    private void assertHelpWindowOpen(HelpWindowHandle helpWindowHandle) {
        assertTrue(helpWindowHandle.isWindowOpen());
        helpWindowHandle.closeWindow();
    }*/
}

package guitests;

import guitests.guihandles.HelpWindowHandle;
import seedu.taskitty.model.task.Task;

import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class HelpWindowTest extends TaskManagerGuiTest {

    @Test
    public void openHelpWindow() {

        //click anywhere on the app
        taskListPanel.clickOnListView(Task.TASK_COMPONENT_COUNT);

        assertHelpWindowOpen(mainMenu.openHelpWindowUsingAccelerator());

        assertHelpWindowOpen(mainMenu.openHelpWindowUsingMenu());

        assertHelpWindowOpen(commandBox.runHelpCommand());

    }

    private void assertHelpWindowOpen(HelpWindowHandle helpWindowHandle) {
        assertTrue(helpWindowHandle.isWindowOpen());
        helpWindowHandle.closeWindow();
    }
}

Fix tests for Help window

Fix tests for Help window


/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/25/15
 * Time: 12:12 PM
 * To change this template use File | Settings | File Templates.
 */
package steps.hooks;

import cucumber.api.Scenario;
import cucumber.api.java.After;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriverException;

import static framework.BrowserManager.getInstance;

public class GlobalHooks {
    @After
    public void embedScreenShot(Scenario scenario) {
        if (scenario.isFailed()) {
            try {
                System.out.println("#########################Take a snapshot#######################");
                byte[] screenshot = ((TakesScreenshot)getInstance().getDriver()).getScreenshotAs(OutputType.BYTES);
                scenario.embed(screenshot, "image/png");
                System.out.println("#######SCENARIO: "+scenario.getName());
            } catch (WebDriverException somePlatformsDontSupportScreenshots) {
                System.err.println(somePlatformsDontSupportScreenshots.getMessage());
            }
        }

        //if (scenario.getName().equalsIgnoreCase(""))
    }
}

/**
 * Created with IntelliJ IDEA.
 * User: jhasmanyquiroz
 * Date: 11/25/15
 * Time: 12:12 PM
 * To change this template use File | Settings | File Templates.
 */
package steps.hooks;

import cucumber.api.Scenario;
import cucumber.api.java.After;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriverException;

import static framework.BrowserManager.getInstance;

public class GlobalHooks {
    @After
    public void embedScreenShot(Scenario scenario) {
        if (scenario.isFailed()) {
            try {
                byte[] screenshot = ((TakesScreenshot)getInstance().getDriver()).getScreenshotAs(OutputType.BYTES);
                scenario.embed(screenshot, "image/png");
            } catch (WebDriverException somePlatformsDontSupportScreenshots) {
                System.err.println(somePlatformsDontSupportScreenshots.getMessage());
            }
        }

        //if (scenario.getName().equalsIgnoreCase(""))
    }
}

Refactor the Global hooks file

Refactor the Global hooks file


package com.hida.configuration;

import org.springframework.context.annotation.ComponentScan;
import org.h2.server.web.WebServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Acting as a dispatcher.xml, this class resolves requests into view names.
 *
 * @author lruffin
 */
@Configuration
@ComponentScan(basePackages = "com.hida")
public class AppConfig {

    @Bean
    ServletRegistrationBean h2servletRegistration(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
        registrationBean.addUrlMappings("/console/*");
        return registrationBean;
    }
}

package com.hida.configuration;

import org.springframework.context.annotation.ComponentScan;
import org.h2.server.web.WebServlet;
import org.springframework.boot.context.embedded.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Acting as a dispatcher.xml, this class resolves requests into view names.
 *
 * @author lruffin
 */
@Configuration
@ComponentScan(basePackages = "com.hida")
public class AppConfig {

    @Bean
    ServletRegistrationBean h2servletRegistration(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
        registrationBean.addUrlMappings("/Minter/console/*");
        return registrationBean;
    }
}

Change the path of "/console" to "Minter/console"

Done so that it can be more descriptive of what program is accessing
the console.


package nallar.patched.forge;

import java.util.concurrent.ConcurrentHashMap;

import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.Event;

public abstract class PatchEvent extends Event {
	private static final ConcurrentHashMap<Class, Boolean> annotationMap = new ConcurrentHashMap<Class, Boolean>();

	@Override
	protected boolean hasAnnotation(Class annotation) {
		Class cls = this.getClass();
		Boolean cachedResult = annotationMap.get(cls);
		if (cachedResult != null) {
			return cachedResult;
		}
		Class searchClass = cls;
		while (searchClass != Event.class) {
			if (searchClass.isAnnotationPresent(Cancelable.class)) // Forge bug, not fixed. Buggy behaviour may be required for some mods.
			{
				annotationMap.put(cls, true);
				return true;
			}
			searchClass = searchClass.getSuperclass();
		}
		annotationMap.put(cls, false);
		return false;
	}
}

package nallar.patched.forge;

import nallar.collections.PartiallySynchronizedMap;
import net.minecraftforge.event.Cancelable;
import net.minecraftforge.event.Event;

public abstract class PatchEvent extends Event {
	private static final PartiallySynchronizedMap<Class, Boolean> annotationMap = new PartiallySynchronizedMap<Class, Boolean>();

	@Override
	protected boolean hasAnnotation(Class annotation) {
		Class cls = this.getClass();
		Boolean cachedResult = annotationMap.get(cls);
		if (cachedResult != null) {
			return cachedResult;
		}
		Class searchClass = cls;
		while (searchClass != Event.class) {
			if (searchClass.isAnnotationPresent(Cancelable.class)) // TODO: Forge bug, not fixed. Buggy behaviour may be required for some mods.
			{
				annotationMap.put(cls, true);
				return true;
			}
			searchClass = searchClass.getSuperclass();
		}
		annotationMap.put(cls, false);
		return false;
	}
}

Use partially synchronized map in Event hasAnnotation cache.

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


package abra;

import abra.SemiGlobalAligner.Result;

public class NativeSemiGlobalAligner {

	private native String align(String seq1, String seq2, int match, int mismatch, int gapOpen, int gapExtend);

	private int match = 8;
	private int mismatch = -32;
	private int gapOpen = -48;
	private int gapExtend = -1;

	public NativeSemiGlobalAligner(int match, int mismatch, int gapOpen, int gapExtend) {
		this.match = match;
		this.mismatch = mismatch;
		this.gapOpen = gapOpen;
		this.gapExtend = gapExtend;
	}

	public Result align(String seq1, String seq2) {

		// Result returned in format score:secondBest:pos:endPos:cigar
		// 789:741:611:734:52M108I71M
		String res = align(seq1, seq2, match, mismatch, gapOpen, gapExtend);

		String[] results = res.split(":");
		Result result = new Result(Integer.valueOf(results[0]), Integer.valueOf(results[1]),
				Integer.valueOf(results[2]), Integer.valueOf(results[3]), results[4]);

		return result;
	}
}

package abra;

import abra.SemiGlobalAligner.Result;

public class NativeSemiGlobalAligner {

	private native String align(String seq1, String seq2, int match, int mismatch, int gapOpen, int gapExtend);

	private int match = 8;
	private int mismatch = -32;
	private int gapOpen = -48;
	private int gapExtend = -1;

	private static final int MAX_CONTIG_LEN = 1998;
	private static final int MAX_REF_LEN = 4998;

	public NativeSemiGlobalAligner(int match, int mismatch, int gapOpen, int gapExtend) {
		this.match = match;
		this.mismatch = mismatch;
		this.gapOpen = gapOpen;
		this.gapExtend = gapExtend;
	}

	public Result align(String seq1, String seq2) {

		if (seq1.length() > MAX_CONTIG_LEN) {
			throw new IllegalArgumentException("Contig too long");
		}

		if (seq2.length() > MAX_REF_LEN) {
			throw new IllegalArgumentException("Ref too long");
		}

		// Result returned in format score:secondBest:pos:endPos:cigar
		// 789:741:611:734:52M108I71M
		String res = align(seq1, seq2, match, mismatch, gapOpen, gapExtend);

		String[] results = res.split(":");
		Result result = new Result(Integer.valueOf(results[0]), Integer.valueOf(results[1]),
				Integer.valueOf(results[2]), Integer.valueOf(results[3]), results[4]);

		return result;
	}
}

Add length guard around native SG aligner input.


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

import java.util.List;

import com.elmakers.mine.bukkit.api.entity.EntityData;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;

import com.elmakers.mine.bukkit.api.magic.Mage;

public interface UndoList extends BlockList, Comparable<UndoList> {
    public void commit();
    public void undo();
    public void undo(boolean blocking);
    public void undoScheduled();
    public void undoScheduled(boolean blocking);

    public void setEntityUndo(boolean undoEntityEffects);

    public void setScheduleUndo(int ttl);
    public int getScheduledUndo();
    public boolean bypass();
    public long getCreatedTime();
    public long getModifiedTime();
    public long getScheduledTime();
    public boolean isScheduled();

    public void prune();

    public void add(Entity entity);
    public void remove(Entity entity);
    public EntityData modify(Entity entity);
    public void add(Runnable runnable);

    public void convert(Entity entity, Block block);
    public void fall(Entity entity, Block block);
    public void explode(Entity entity, List<Block> explodedBlocks);
    public void cancelExplosion(Entity entity);

    public boolean contains(Location location, int threshold);

    public String getName();
    public Mage getOwner();
}

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

import java.util.List;

import com.elmakers.mine.bukkit.api.entity.EntityData;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;

import com.elmakers.mine.bukkit.api.magic.Mage;

public interface UndoList extends BlockList, Comparable<UndoList> {
    public void commit();
    public void undo();
    public void undo(boolean blocking);
    public void undoScheduled();
    public void undoScheduled(boolean blocking);

    public void setEntityUndo(boolean undoEntityEffects);

    public void setScheduleUndo(int ttl);
    public int getScheduledUndo();
    public boolean bypass();
    public long getCreatedTime();
    public long getModifiedTime();
    public long getScheduledTime();
    public boolean isScheduled();

    public void prune();

    public void add(Entity entity);
    public void remove(Entity entity);
    public EntityData modify(Entity entity);
    public void add(Runnable runnable);

    public void convert(Entity entity, Block block);
    public void fall(Entity entity, Block block);
    public void explode(Entity entity, List<Block> explodedBlocks);
    public void finalizeExplosion(Entity entity, List<Block> explodedBlocks);
    public void cancelExplosion(Entity entity);

    public boolean contains(Location location, int threshold);

    public String getName();
    public Mage getOwner();
}

Modify explosion undo API to work better with PreciousStones


package com.letscode.lcg;

import java.util.Random;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;

public class MainActivity extends AndroidApplication {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
        cfg.useGL20 = false;
        String nickname = "Player " + (new Random().nextInt(12415124));

        initialize(new LcgApp("localhost", nickname), cfg);
    }
}

package com.letscode.lcg;

import java.util.Random;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;

public class MainActivity extends AndroidApplication {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
        cfg.useGL20 = false;
        String nickname = "Player " + (new Random().nextInt(12415124));

        initialize(new LcgApp("localhost", 80, nickname), cfg);
    }
}

Set default port for Android device.

Set default port for Android device.


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

import edu.wpi.first.wpilibj.Timer;

/**
 *
 * @author admin
 */
public class BallLightUpdate extends CommandBase {
    private int BLINK_FREQUENCY_HZ = 5;
    private double lastTime = 0;

    public BallLightUpdate() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        requires(ballLight);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        double time = Timer.getFPGATimestamp();
        if (conveyor.ballAtTop()) {
            if (time - lastTime > (1.0 / BLINK_FREQUENCY_HZ)) {
                ballLight.setLight(!ballLight.isOn()); // Invert ball light every 1/frequency (period) seconds
                lastTime = time;
            }
        }
        else if (conveyor.ballAtBottom()) {
            ballLight.setLight(true);
        }
        else {
            ballLight.setLight(false);
        }
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}

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

import edu.wpi.first.wpilibj.Timer;

/**
 *
 * @author admin
 */
public class BallLightUpdate extends CommandBase {
    private int BLINK_FREQUENCY_HZ = 10;
    private double lastTime = 0;

    public BallLightUpdate() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        requires(ballLight);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        double time = Timer.getFPGATimestamp();
        if (conveyor.ballAtTop()) {
            if (time - lastTime > (1.0 / BLINK_FREQUENCY_HZ)) {
                ballLight.setLight(!ballLight.isOn()); // Invert ball light every 1/frequency (period) seconds
                lastTime = time;
            }
        }
        else if (conveyor.ballAtBottom()) {
            ballLight.setLight(true);
        }
        else {
            ballLight.setLight(false);
        }
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return false;
    }

    // Called once after isFinished returns true
    protected void end() {
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}

Make ball light blink at 10Hz instead of 5Hz when a ball is at top


package io.gavinhungry.xposed.noplaymusicfor;

import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;

public class NoPlayMusicFor implements IXposedHookLoadPackage {
  public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
    if (lpparam.packageName.equals("com.google.android.music")) {
      try {

        XposedHelpers.findAndHookMethod("com.google.android.music.utils.ConfigUtils", lpparam.classLoader,
          "isConciergeListenNowEnabled", new XC_MethodHook() {

          @Override
          protected void afterHookedMethod(MethodHookParam param) throws Throwable {
            param.setResult(false);
          }
        });

      } catch(Throwable t) {
        XposedBridge.log(t);
      }
    }
  }
}

package io.gavinhungry.xposed.noplaymusicfor;

import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import de.robv.android.xposed.XC_MethodReplacement;

public class NoPlayMusicFor implements IXposedHookLoadPackage {
  public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
    if (lpparam.packageName.equals("com.google.android.music")) {
      try {

        XposedHelpers.findAndHookMethod("com.google.android.music.utils.ConfigUtils", lpparam.classLoader,
          "isConciergeListenNowEnabled", new XC_MethodReplacement() {

          @Override
          protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
            return false;
          }
        });

      } catch(Throwable t) {
        XposedBridge.log(t);
      }
    }
  }
}

Replace method instead of replacing return value

Closes #1


package com.alexrnl.commons.utils;

import java.util.Iterator;
import java.util.Objects;
import java.util.logging.Logger;

/**
 * Utilities on collections.

 * @author Alex
 */
public final class CollectionUtils {
	/** Logger */
	private static Logger	lg	= Logger.getLogger(CollectionUtils.class.getName());

	/**
	 * Constructor #1.

	 * Default private constructor.
	 */
	private CollectionUtils () {
		super();
	}

	/**
	 * Check if a collection is sorted.

	 * @param collection
	 *        the collection to check.
	 * @return true if the collection is sorted.
	 */
	public static <T extends Comparable<? super T>> boolean isSorted (final Iterable<T> collection) {
		Objects.requireNonNull(collection);
		final Iterator<T> it = collection.iterator();

		while (it.hasNext()) {
			final T current = it.next();
			if (it.hasNext() && current.compareTo(it.next()) > 0) {
				return false;
			}
		}

		return true;
	}
}

package com.alexrnl.commons.utils;

import java.util.Iterator;
import java.util.Objects;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * Utilities on collections.

 * @author Alex
 */
public final class CollectionUtils {
	/** Logger */
	private static Logger	lg	= Logger.getLogger(CollectionUtils.class.getName());

	/**
	 * Constructor #1.

	 * Default private constructor.
	 */
	private CollectionUtils () {
		super();
	}

	/**
	 * Check if a collection is sorted.

	 * @param collection
	 *        the collection to check.
	 * @return true if the collection is sorted.
	 */
	public static <T extends Comparable<? super T>> boolean isSorted (final Iterable<T> collection) {
		Objects.requireNonNull(collection);
		final Iterator<T> it = collection.iterator();

		while (it.hasNext()) {
			final T current = it.next();
			if (it.hasNext() && current.compareTo(it.next()) > 0) {
				if (lg.isLoggable(Level.INFO)) {
					lg.info("Collection is unordered at element " + current);
				}
				return false;
			}
		}

		return true;
	}
}

Use logger is method isSorted

Use logger is method isSorted


package uk.gov.register.filters;

import uk.gov.register.core.RegisterContext;
import uk.gov.register.core.RegisterName;
import uk.gov.register.exceptions.InconsistencyException;

import javax.inject.Inject;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
public class ConsistencyFilter implements ContainerRequestFilter {

    private final javax.inject.Provider<RegisterName> registerPrimaryKey;
    private final UriInfo uriInfo;
    private final javax.inject.Provider<RegisterContext> registerContext;

    @Inject
    public ConsistencyFilter(final javax.inject.Provider<RegisterName> registerPrimaryKey,
                             final UriInfo uriInfo,
                             javax.inject.Provider<RegisterContext> registerContext) {
        this.registerPrimaryKey = registerPrimaryKey;
        this.uriInfo = uriInfo;
        this.registerContext = registerContext;
    }

    @Override
    public void filter(final ContainerRequestContext requestContext) throws IOException {
        final String path = uriInfo.getPath();

        if (skipFilter(path)) {
            return;
        }

        if (!registerContext.get().hasConsistentState()) {
            throw new InconsistencyException(
                    String.format("Register %s doesn't match with specification.", registerPrimaryKey.get().value()));
        }
    }

    private boolean skipFilter(final String path) {
        return path.contains("delete-register-data");
    }
}

package uk.gov.register.filters;

import uk.gov.register.core.RegisterContext;
import uk.gov.register.core.RegisterName;
import uk.gov.register.exceptions.InconsistencyException;

import javax.inject.Inject;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerRequestFilter;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.ext.Provider;
import java.io.IOException;

@Provider
public class ConsistencyFilter implements ContainerRequestFilter {

    private final javax.inject.Provider<RegisterName> registerPrimaryKey;
    private final UriInfo uriInfo;
    private final javax.inject.Provider<RegisterContext> registerContext;

    @Inject
    public ConsistencyFilter(final javax.inject.Provider<RegisterName> registerPrimaryKey,
                             final UriInfo uriInfo,
                             javax.inject.Provider<RegisterContext> registerContext) {
        this.registerPrimaryKey = registerPrimaryKey;
        this.uriInfo = uriInfo;
        this.registerContext = registerContext;
    }

    @Override
    public void filter(final ContainerRequestContext requestContext) throws IOException {
        final String path = uriInfo.getPath();

        if (skipFilter(path)) {
            return;
        }

        if (!registerContext.get().hasConsistentState()) {
            throw new InconsistencyException(
                    String.format("Register %s doesn't match with specification.", registerPrimaryKey.get().value()));
        }
    }

    private boolean skipFilter(final String path) {
        return path.contains("delete-register-data") || path.contains("load-rsf");
    }
}

Load RSF should bypass consistency filter

This commit updates the `ConsistencyFilter` to allow a call to `load-rsf` to bypass it. This is necessary if we need to update the metadata for a register to make it consistent with the environment, as otherwise we are blocked by all requests to an inconsistent register throwing an exception.


package mil.nga.mapcache.ogc.wms;

/**
 * The layer object within the getCapabilities xml
 */
public class Layer {

    /**
     * The layer's title.
     */
    private String title;

    /**
     * Gets the layer's title.
     *
     * @return The layer's title.
     */
    public String getTitle() {
        return title;
    }

    /**
     * Sets the layer's title.
     *
     * @param title The layer's title.
     */
    public void setTitle(String title) {
        this.title = title;
    }
}

package mil.nga.mapcache.ogc.wms;

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

/**
 * The layer object within the getCapabilities xml
 */
public class Layer {

    /**
     * The layer's title.
     */
    private String title;

    /**
     * The child layers.
     */
    private List<Layer> layers = new ArrayList<>();

    /**
     * Gets the layer's title.
     *
     * @return The layer's title.
     */
    public String getTitle() {
        return title;
    }

    /**
     * Sets the layer's title.
     *
     * @param title The layer's title.
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Gets the child layers.
     * @return The child layers.
     */
    public List<Layer> getLayers() {
        return layers;
    }
}

Add child layers to layer.

Add child layers to layer.


package ch.hevs.aislab.magpie.debs.retrofit;

import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.POST;

public interface UserSvcApi {

    String CLIENT_ID = "mobile";

    String SERVICE_URL = "https://10.0.2.2:8443";
    String TOKEN_PATH = "/oauth/token";

    String USER_SVC = "/user";
    String USER_GET_SVC = USER_SVC + "/getUser";

    @POST(USER_GET_SVC)
    MobileClient getUser(@Body String gcmToken);

}

package ch.hevs.aislab.magpie.debs.retrofit;

import java.util.Collection;

import ch.hevs.aislab.magpie.debs.model.MobileClient;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
import retrofit.http.Path;

public interface UserSvcApi {

    String CLIENT_ID = "mobile";

    String SERVICE_URL = "https://10.0.2.2:8443";
    String TOKEN_PATH = "/oauth/token";

    String USER_ID = "userId";

    String USER_SVC = "/user";
    String USER_GET_SVC = USER_SVC + "/getUser";
    String USER_GET_CONTACTS_ACCEPTED_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsAccepted";
    String USER_GET_CONTACTS_PENDING_SVC = USER_SVC + "/{" + USER_ID + "}" + "/getContactsPending";

    @POST(USER_GET_SVC)
    MobileClient getUser(@Body String gcmToken);

    @GET(USER_GET_CONTACTS_ACCEPTED_SVC)
    Collection<MobileClient> getContactsAccepted(@Path(USER_ID) long userId);

    @GET(USER_GET_CONTACTS_PENDING_SVC)
    public Collection<MobileClient> getContactsPending(@Path(USER_ID) long userId);

}

Add methods to get contacts by their subscription status


package roart.common.filesystem;

import java.util.Map;

import roart.common.inmemory.model.InmemoryMessage;
import roart.common.model.FileObject;

public class FileSystemMessageResult extends FileSystemResult {
    public Map<FileObject, InmemoryMessage> message;
}

package roart.common.filesystem;

import java.util.Map;

import roart.common.inmemory.model.InmemoryMessage;
import roart.common.model.FileObject;

public class FileSystemMessageResult extends FileSystemResult {
    public Map<String, InmemoryMessage> message;
}

Read file batch transfer (I38).

Read file batch transfer (I38).


package jannotate.domain;

import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Annotation {
	@Id
	int id;
	String name;
	String api;
	String use;

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getApi() {
		return api;
	}
	public void setApi(String api) {
		this.api = api;
	}
	public String getUse() {
		return use;
	}
	public void setUse(String use) {
		this.use = use;
	}
}

package jannotate.domain;

import java.lang.annotation.RetentionPolicy;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;

@Entity
public class Annotation {
	@Id
	int id;
	String api;
	String name;
	RetentionPolicy retention;
	String use;

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getApi() {
		return api;
	}
	public void setApi(String api) {
		this.api = api;
	}

	@Enumerated(EnumType.ORDINAL)
	public RetentionPolicy getRetention() {
		return retention;
	}
	public void setRetention(RetentionPolicy retention) {
		this.retention = retention;
	}
	public String getUse() {
		return use;
	}
	public void setUse(String use) {
		this.use = use;
	}
}

Add field for retention policy.

Add field for retention policy.


/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2019 Vladimir
 *
 * 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 com.devproserv.courses.model;

/**
 * Deals with admins.
 *
 * @since 0.5.0
 */
public final class NestAdmins implements Nest {
    @Override
    public Responsible makeUser() {
        return null;
    }
}

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2019 Vladimir
 *
 * 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 com.devproserv.courses.model;

/**
 * Deals with admins.
 *
 * @since 0.5.0
 */
public final class NestAdmins implements Nest {
    @Override
    public Responsible makeUser() {
        return new Admin(new User(-1, "no login", "no pass"));
    }
}

Fix null in admin account

Fix null in admin account


package org.jenkinsci.plugins.p4.scm;

import jenkins.scm.api.SCMRevision;
import org.jenkinsci.plugins.p4.changes.P4Ref;

import java.util.Objects;

public class P4Revision extends SCMRevision {
	private final P4Ref ref;

	P4Revision(P4Head branch, P4Ref ref) {
		super(branch);
		this.ref = ref;
	}

	public P4Ref getRef() {
		return ref;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		P4Revision that = (P4Revision) o;
		boolean c = ref == that.ref;
		boolean h = getHead().equals(that.getHead());
		return c && h;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		return Objects.hashCode(ref);
	}

	@Override
	public String toString() {
		return ref.toString();
	}
}

package org.jenkinsci.plugins.p4.scm;

import jenkins.scm.api.SCMRevision;
import org.jenkinsci.plugins.p4.changes.P4Ref;

import java.util.Objects;

public class P4Revision extends SCMRevision {
	private final P4Ref ref;

	P4Revision(P4Head branch, P4Ref ref) {
		super(branch);
		this.ref = ref;
	}

	public P4Ref getRef() {
		return ref;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object o) {
		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		P4Revision that = (P4Revision) o;
		boolean c = ref.equals(that.ref);
		boolean h = getHead().equals(that.getHead());
		return c && h;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		return Objects.hashCode(ref);
	}

	@Override
	public String toString() {
		if (ref == null) {
			return "undefined";
		}
		return ref.toString();
	}
}

Fix equals used in comparable check and null check.