repo_name stringlengths 7 104 | file_path stringlengths 11 238 | context list | import_statement stringlengths 103 6.85k | code stringlengths 60 38.4k | next_line stringlengths 10 824 | gold_snippet_index int32 0 8 |
|---|---|---|---|---|---|---|
thiloplanz/jmockmongo | src/main/java/jmockmongo/wire/ReplyHandler.java | [
"public interface CommandHandler {\n\n\tpublic BSONObject handleCommand(String database, BSONObject command);\n\n}",
"public interface DeleteHandler {\n\n\tpublic Result handleDelete(String database, String collection,\n\t\t\tboolean singleRemove, BSONObject selector);\n}",
"public interface InsertHandler {\n\n... | import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import java.util.HashMap;
import java.util.Map;
import jmockmongo.CommandHandler;
import jmockmongo.DeleteHandler... | /**
* Copyright (c) 2012, Thilo Planz. All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Apache License, Version 2.0
* as published by the Apache Software Foundation (the "License").
*
* Unless required by applicable law or agreed to in writ... | private Result lastError; | 4 |
google/google-authenticator | mobile/blackberry/src/com/google/authenticator/blackberry/AuthenticatorScreen.java | [
"public interface Mac\n{\n /**\n * Initialise the MAC.\n *\n * @param params the key and other data required by the MAC.\n * @exception IllegalArgumentException if the params argument is\n * inappropriate.\n */\n public void init(CipherParameters params)\n throws IllegalArgument... | import net.rim.blackberry.api.browser.Browser;
import net.rim.blackberry.api.browser.BrowserSession;
import net.rim.device.api.i18n.ResourceBundle;
import net.rim.device.api.system.Alert;
import net.rim.device.api.system.Application;
import net.rim.device.api.system.ApplicationDescriptor;
import net.rim.device.api.ui.M... | /*-
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | Mac mac = new HMac(new SHA1Digest()); | 2 |
ypresto/miniguava | miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableList.java | [
"public static int checkElementIndex(int index, int size) {\n return checkElementIndex(index, size, \"index\");\n}",
"public static void checkPositionIndexes(int start, int end, int size) {\n // Carefully optimized for execution by hotspot (explanatory comment above)\n if (start < 0 || end < start || end > siz... | import java.util.Collections;
import java.util.List;
import java.util.RandomAccess;
import javax.annotation.Nullable;
import static net.ypresto.miniguava.base.Preconditions.checkElementIndex;
import static net.ypresto.miniguava.base.Preconditions.checkPositionIndexes;
import static net.ypresto.miniguava.collect.immutab... | /*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | public UnmodifiableIterator<E> iterator() { | 5 |
gfk-ba/senbot | SenBotDemo/src/test/java/com/gfk/senbotdemo/cucumber/stepdefinitions/MySeleniumStepDefinitions.java | [
"public class SeleniumManager {\n\n private static Logger log = LoggerFactory.getLogger(SeleniumManager.class);\n\n private String defaultDomain = null;\n private URL seleniumHub = null;\n private ... | import static org.junit.Assert.*;
import java.io.IOException;
import java.util.List;
import com.gfk.senbot.framework.context.SeleniumManager;
import com.gfk.senbot.framework.context.SenBotContext;
import com.gfk.senbot.framework.cucumber.stepdefinitions.BaseStepDefinition;
import com.gfk.senbot.framework.data.GenericUs... | package com.gfk.senbotdemo.cucumber.stepdefinitions;
@StepDefAnnotation
public class MySeleniumStepDefinitions extends BaseStepDefinition {
/*
* Given
*/
@Given("^I am logged in as a \"(.*)\" user$")
public void I_am_logged_in_as_a_x_user(String userType) {
GenericUser genericUser = getReferenceServ... | TestPage1 viewRepresentation = seleniumManager.getViewRepresentation(TestPage1.class); | 4 |
makemyownlife/newdda-client | src/main/java/com/elong/pb/newdda/client/router/parser/visitor/basic/mysql/AbstractMySqlVisitor.java | [
"public enum DatabaseType {\n\n H2, MySQL, Oracle, SQLServer, DB2;\n\n public static DatabaseType valueFrom(final String databaseName) {\n try {\n return DatabaseType.valueOf(databaseName);\n } catch (final IllegalArgumentException ex) {\n throw new DatabaseTypeUnsupportedE... | import com.alibaba.druid.sql.ast.SQLHint;
import com.alibaba.druid.sql.ast.expr.*;
import com.alibaba.druid.sql.ast.statement.*;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlOutputVisitor;
import com.elong.pb.newdda.client.constants.DatabaseType;
import com.elong.pb.newdda.client.router.parser.SqlParserConte... | package com.elong.pb.newdda.client.router.parser.visitor.basic.mysql;
public abstract class AbstractMySqlVisitor extends MySqlOutputVisitor implements SqlVisitor {
private SqlParserContext sqlParserContext;
protected AbstractMySqlVisitor() {
super(new SqlAppender());
super.setPrettyFormat(f... | getSqlAppender().appendToken(SqlUtil.getExactlyValue(token)); | 6 |
Zerokyuuni/Ex-Aliquo | exaliquo/bridges/crossmod/ExtraTic_Metallurgy.java | [
"public static Block getBlock(Info info)\n{\n\tBlock block = findBlock(info.mod, info.sname);\n\treturn (block != null) ? block : debugBlockInfo(info);\n}",
"public static int getIDs(Info info)\n{\n\tif (info.type == \"block\")\n\t{\n\t\tBlock id = findBlock(info.mod, info.sname);\n\t\treturn (id != null) ? id.bl... | import static exaliquo.data.ModIDs.getBlock;
import static exaliquo.data.ModIDs.getIDs;
import static exaliquo.data.ModIDs.getItem;
import static exaliquo.data.MoltenMetals.*;
import static net.minecraftforge.fluids.FluidRegistry.getFluid;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import ne... | package exaliquo.bridges.crossmod;
public class ExtraTic_Metallurgy
{
protected static void SmeltMetallurgy()
{
for (int i = 0; i < 3; i++)
{ | Smeltery.addMelting(Registries.adamantineOreBlock, i, 550, new FluidStack(getFluid("molten.adamantine"), ingotCostSmeltery)); | 4 |
riddlesio/hack-man-engine | src/java/io/riddles/bookinggame/engine/BookingGameEngine.java | [
"public class BookingGameBoard extends Board {\n\n private ArrayList<BookingGamePlayer> players;\n private ArrayList<BookingGameEnemy> enemies;\n private ArrayList<Point> enemySpawnPoints;\n private ArrayList<Point> playerInaccessablePoints;\n private int enemyIdCounter;\n\n public BookingGameBoar... | import io.riddles.bookinggame.game.player.BookingGamePlayer;
import io.riddles.javainterface.engine.AbstractEngine;
import io.riddles.bookinggame.game.BookingGameSerializer;
import io.riddles.javainterface.exception.TerminalException;
import java.awt.Point;
import java.security.NoSuchAlgorithmException;
import java.sec... | /*
* Copyright 2016 riddles.io (developers@riddles.io)
*
* 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
*
* Unle... | private EnemyAIInterface enemyAI; | 2 |
searchisko/elasticsearch-river-sysinfo | src/main/java/org/jboss/elasticsearch/river/sysinfo/SysinfoRiverPlugin.java | [
"public class JRLifecycleAction extends\n\t\tClusterAction<JRLifecycleRequest, JRLifecycleResponse, JRLifecycleRequestBuilder> {\n\n\tpublic static final JRLifecycleAction INSTANCE = new JRLifecycleAction();\n\tpublic static final String NAME = \"sysinfo_river/lifecycle\";\n\n\tprotected JRLifecycleAction() {\n\t\t... | import org.elasticsearch.action.ActionModule;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;
import org.elasticsearch.river.RiversModule;
import org.jboss.elasticsearch.river.sysinfo.mgm.lifecycle.JRLifecycleAction;
import org.jb... | /*
* JBoss, Home of Professional Open Source
* Copyright 2012 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
*/
package org.jboss.elasticsearch.river.sysinfo;
/**
* System Info River ElasticSearch Plugin class.
*
* @author Vlastimil Elias (ve... | module.registerAction(JRLifecycleAction.INSTANCE, TransportJRLifecycleAction.class); | 0 |
roscrazy/Android-RealtimeUpdate-CleanArchitecture | mvp/src/test/java/com/mike/feed/presenter/MainPresenterTest.java | [
"public class Deleted {\n}",
"public class DeleteFeedUseCase extends UseCase {\n\n @NonNull\n FeedRepository mRepository;\n\n @NonNull\n String mFeedKey;\n\n @Inject\n public DeleteFeedUseCase(String feed, FeedRepository repository, ThreadExecutor threadExecutor, PostExecutionThread postExecuti... | import com.mike.feed.domain.Deleted;
import com.mike.feed.domain.interactor.DeleteFeedUseCase;
import com.mike.feed.domain.interactor.DeleteFeedUseCaseFactory;
import com.mike.feed.domain.interactor.FeedChangedUseCase;
import com.mike.feed.mapper.FeedModelMapper;
import com.mike.feed.model.FeedChangedInfoModel;
import ... | package com.mike.feed.presenter;
/**
* Created by MinhNguyen on 8/25/16.
*/
public class MainPresenterTest {
private static String FAKE_KEY = "key";
private static String FAKE_PREVIOUS_KEY = "PREVIOUS_KEY";
@Mock | FeedChangedUseCase feedChangedUseCase; | 3 |
OpherV/gitflow4idea | src/main/java/gitflow/actions/InitRepoAction.java | [
"public class GitflowBranchUtil {\n\n Project myProject;\n GitRepository myRepo;\n\n private String currentBranchName;\n private String branchnameMaster;\n private String branchnameDevelop;\n private String prefixFeature;\n private String prefixRelease;\n private String prefixHotfix;\n pr... | import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.util.Key;
import git4idea.commands.GitCommandResult;
import git4idea.repo.GitRepository;
import gitflow.GitflowBranchUtil;
import gitflow... | package gitflow.actions;
public class InitRepoAction extends GitflowAction {
InitRepoAction() {
this( "Init Repo");
}
InitRepoAction(String actionName) {
this(null, "Init Repo");
}
InitRepoAction(GitRepository repo) {
this(repo,"Init Repo");
}
InitRepoAction(Git... | GitflowInitOptionsDialog optionsDialog = new GitflowInitOptionsDialog(myProject, branchUtil.getLocalBranchNames()); | 3 |
EyeTribe/tet-java-client | sdk/src/test/java/com/theeyetribe/test/TestApiClient.java | [
"public class Point2D\n{\n public float x;\n public float y;\n\n public static final float EPSILON = 1e-005f;\n\n public static final Point2D ZERO = new Point2D();\n\n public Point2D()\n {\n }\n\n public Point2D(float x, float y)\n {\n this.x = x;\n this.y = y;\n }\n\n ... | import com.google.gson.Gson;
import com.theeyetribe.clientsdk.*;
import com.theeyetribe.clientsdk.data.CalibrationResult;
import com.theeyetribe.clientsdk.data.CalibrationResult.CalibrationPoint;
import com.theeyetribe.clientsdk.data.GazeData;
import com.theeyetribe.clientsdk.data.Point2D;
import com.theeyetribe.client... | Assert.assertFalse(future.get(5, TimeUnit.SECONDS));
deactivateServer();
}
@Test
public void testCalibrationStart() throws Exception
{
activateServer();
GazeManager.getInstance().calibrationAbort();
Assert.assertTrue(GazeManager.getInstance().calibrationStart(... | List<Point2D> calibPoints = CalibUtils.initCalibrationPoints(3, 3, 1980, 1200, 30, 30, true); | 4 |
mast-group/codemining-core | src/main/java/codemining/java/codeutils/binding/JavaExactVariableBindingsExtractor.java | [
"public class JavaASTExtractor {\n\n\tprivate static final class TopMethodRetriever extends ASTVisitor {\n\t\tpublic MethodDeclaration topDcl;\n\n\t\t@Override\n\t\tpublic boolean visit(final MethodDeclaration node) {\n\t\t\ttopDcl = node;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Remembers if the given Extra... | import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.jdt.core.dom.*;
import codemining.java.codeutils.JavaASTExtractor;
import codemining.java.codeutils.binding.Java... | /**
*
*/
package codemining.java.codeutils.binding;
/**
* Retrieve the variable bindings, given an ASTNode. This finds exact bindings
* to the detriment of recall. Partial code snippets are not supported.
*
* @author Miltos Allamanis <m.allamanis@ed.ac.uk>
*
*/
public class JavaExactVariableBindingsExtrac... | super(new JavaTokenizer()); | 2 |
gtri/typesafeconfig-extensions | factory/src/main/java/edu/gatech/gtri/typesafeconfigextensions/factory/ConfigFactory.java | [
"public interface Function<A, B> {\n\n B apply(A a);\n}",
"public static <A> A checkNotNull(A x) {\n\n if (x == null) {\n throw new NullPointerException();\n }\n\n return x;\n}",
"public static <A, C extends Iterable<A>> C\ncheckNotNullCollectionElements(C xs) {\n\n if (xs == null) {\n ... | import com.typesafe.config.Config;
import com.typesafe.config.ConfigParseOptions;
import com.typesafe.config.ConfigResolveOptions;
import edu.gatech.gtri.typesafeconfigextensions.internal.Function;
import java.util.HashMap;
import java.util.List;
import static edu.gatech.gtri.typesafeconfigextensions.internal.Check.che... | /*
* Copyright 2013 Georgia Tech Applied Research Corporation
*
* 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 b... | return withSources(listOfTwoOrMore( | 5 |
BeYkeRYkt/LightAPI | bukkit-common/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/internal/handler/CompatibilityHandler.java | [
"public class BukkitPlatformImpl implements IPlatformImpl, IBukkitExtension {\n\n private static final String DEFAULT_IMPL_NAME = \"craftbukkit\";\n /**\n * CONFIG\n */\n private final String CONFIG_TITLE = \"general\";\n private final String CONFIG_DEBUG = CONFIG_TITLE + \".debug\";\n privat... | import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.data.Levelled;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldUnloadEvent;
import java.util.ArrayList;
import java.ut... | /*
* The MIT License (MIT)
*
* Copyright 2021 Vladimir Mikhailov <beykerykt@gmail.com>
*
* 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 limitati... | public LightEngineVersion getLightEngineVersion() { | 7 |
pfstrack/eldamo | src/test/java/xdb/control/ControllerTest.java | [
"public class Controller {\n\n private final String description;\n private final RequestParser requestParser;\n private final Query query;\n private final Map<String, Renderer> renderers;\n\n /**\n * Constructor.\n * \n * @param description\n * A description documenting the... | import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import junit.framework.TestCase;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
im... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package xdb.control;
/**
*
* @author ps142237
*/
public class ControllerTest extends TestCase {
public static final String DESCRIPTION = "Description";
| RequestParser requestParser = new SimpleRequestParser(new HashMap<String, String[]>()); | 3 |
SilentChaos512/ScalingHealth | src/main/java/net/silentchaos512/scalinghealth/item/HeartCrystal.java | [
"@Mod(ScalingHealth.MOD_ID)\npublic class ScalingHealth {\n public static final String MOD_ID = \"scalinghealth\";\n public static final String MOD_NAME = \"Scaling Health\";\n public static final String VERSION = \"2.5.3\";\n\n public static final Random random = new Random();\n\n public static fina... | import net.minecraft.entity.player.PlayerEntity;
import net.silentchaos512.lib.util.EntityHelper;
import net.silentchaos512.scalinghealth.ScalingHealth;
import net.silentchaos512.scalinghealth.client.particles.ModParticles;
import net.silentchaos512.scalinghealth.init.ModSounds;
import net.silentchaos512.scalinghealth.... | /*
* Scaling Health
* Copyright (C) 2018 SilentChaos512
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 3
* of the License.
*
* This library is distributed in the hope t... | ScalingHealth.LOGGER.warn("Another mod seems to have canceled healing from a heart container (player {})", player.getName()); | 0 |
BaoBaoJianqiang/CustomListView | TestListViewNew/app/src/main/java/com/example/jianqiang/testlistview/utils/Utils.java | [
"public class ImageEntity {\n public String smallImageUrl;\n public String largeImageUrl;\n\n public ImageEntity(String smallImageUrl, String largeImageUrl) {\n this.smallImageUrl = smallImageUrl;\n this.largeImageUrl = largeImageUrl;\n }\n}",
"public class Article {\n public String t... | import android.graphics.Canvas;
import android.support.annotation.NonNull;
import android.text.Layout.Alignment;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.util.Base64;
import com.example.jianqiang.testlistview.entitiy.ImageEntity;
import com.example.jianqiang.testlistview.entitiy.A... | package com.example.jianqiang.testlistview.utils;
public class Utils {
private static String server = "http://177z140e88.iask.in:29223";
public static List<News> generateData() {
List<News> newsList = new ArrayList<News>();
newsList.add(genNew1(0));
newsList.add(genNew2(0));
... | Article article = new Article("写给Android App开发人员看的Android底层知识(6)", | 1 |
hobbe/OpenKarotz-Android | src/com/github/hobbe/android/openkarotz/fragment/SystemFragment.java | [
"public class MainActivity extends FragmentActivity {\r\n\r\n @Override\r\n public void onBackPressed() {\r\n FragmentManager fragmentManager = getSupportFragmentManager();\r\n\r\n if (fragmentManager != null) {\r\n int count = fragmentManager.getBackStackEntryCount();\r\n\r\n ... | import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import com.github.hobbe.... | /*
* OpenKarotz-Android
* http://github.com/hobbe/OpenKarotz-Android
*
* Copyright (c) 2014 Olivier Bagot (http://github.com/hobbe)
*
* 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 So... | private class GetStatusTask extends GetStatusAsyncTask {
| 2 |
scaliby/ceidg-captcha | ceidg-captcha-downloader/src/main/java/net/scaliby/ceidgcaptcha/downloader/service/impl/CaptchaDownloaderServiceImpl.java | [
"public interface CEIDGClient {\n CEIDGCaptchaSessionResource generateSession();\n\n BufferedImage getCaptchaImage(CEIDGCaptchaSessionResource ceidgCaptchaSessionResource);\n}",
"public interface CaptchaLabeler {\n Optional<String> getLabel(BufferedImage bufferedImage);\n}",
"public interface StoreChoo... | import lombok.extern.log4j.Log4j;
import net.scaliby.ceidgcaptcha.downloader.common.CEIDGClient;
import net.scaliby.ceidgcaptcha.downloader.common.CaptchaLabeler;
import net.scaliby.ceidgcaptcha.common.common.StoreChooser;
import net.scaliby.ceidgcaptcha.downloader.common.ImageWriter;
import net.scaliby.ceidgcaptcha.do... | package net.scaliby.ceidgcaptcha.downloader.service.impl;
@Log4j
public class CaptchaDownloaderServiceImpl implements CaptchaDownloaderService {
private final CaptchaLabeler captchaLabeler;
private final StoreChooser storeChooser;
private final CEIDGClient ceidgClient;
private final ImageStoreFactor... | private final ImageWriter imageWriter; | 3 |
sathipal/lwm2m_over_mqtt | src/leshan/server/mqtt/impl/MQTTLwM2mRequestSender.java | [
"public abstract class AbstractRequestObserver {\n protected Request mqttRequest;\n\n public AbstractRequestObserver(final Request mqttRequest) {\n this.mqttRequest = mqttRequest;\n }\n\n public abstract void onResponse(final Response mqttResponse);\n public abstract void onError(final Respons... | import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import leshan.core.response.ClientResponse;
import leshan.core.response.ExceptionConsumer;
import leshan.core.response.ResponseConsumer;... | package leshan.server.mqtt.impl;
//import leshan.client.response.OperationResponse;
public class MQTTLwM2mRequestSender implements LwM2mRequestSender {
private static final Logger LOG = LoggerFactory.getLogger(MQTTLwM2mRequestSender.class);
private static final int REQUEST_TIMEOUT_MILLIS = 5000;
priv... | final Request mqttRequest = MQTTRequestBuilder.getRequest(); | 3 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/RestEndpoints.java | [
"public class RestEndpointInvocationHandler implements InvocationHandler {\n\n public static final HttpClientRestEndpoint.BodyTransformer<Object> BODY_TRANSFORMER = new HttpClientRestEndpoint.BodyTransformer<Object>();\n private final Map<Method, RestMethodInfo> restMethods;\n\n private final RestEndpoint ... | import com.github.avarabyeu.restendpoint.http.proxy.RestEndpointInvocationHandler;
import com.github.avarabyeu.restendpoint.serializer.ByteArraySerializer;
import com.github.avarabyeu.restendpoint.serializer.Serializer;
import com.github.avarabyeu.restendpoint.serializer.TextSerializer;
import com.github.avarabyeu.rest... | /*
* Copyright (C) 2014 Andrei Varabyeu
*
* 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... | new TextSerializer(), | 3 |
RestComm/camelgateway | core/slee/sbbs/src/main/java/org/restcomm/camelgateway/slee/CamelGatewaySbb.java | [
"public class CamelPropertiesManagement implements CamelPropertiesManagementMBean {\n\n\tprivate static final Logger logger = Logger.getLogger(CamelPropertiesManagement.class);\n\n\tprotected static final String ROUTE = \"route\";\n\tprotected static final String NO_ACTIVITY_TIMEOUT_SEC = \"noactivitytimeoutsec\";\... | import java.io.ByteArrayInputStream;
import java.util.Iterator;
import java.util.Map;
import javax.slee.ActivityContextInterface;
import javax.slee.Sbb;
import javax.slee.facilities.TimerEvent;
import javax.slee.facilities.TimerID;
import javax.slee.facilities.TimerOptions;
import javolution.util.FastList;
import net.j... | /*
* TeleStax, Open Source Cloud Communications
* Copyright 2012, Telestax Inc and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of t... | private static final NetworkRoutingRuleManagement networkRoutingRuleManagement = NetworkRoutingRuleManagement | 2 |
SynBioDex/SBOLDesigner | src/main/java/edu/utah/ece/async/sboldesigner/sbol/editor/dialog/InputDialog.java | [
"public class Registries implements Iterable<Registry> {\n\tprivate static Registries INSTANCE;\n\n\tpublic static Registries get() {\n\t\tif (INSTANCE == null) {\n\t\t\tINSTANCE = new Registries();\n\t\t}\n\n\t\treturn INSTANCE;\n\t}\n\n\tprivate final List<Registry> registries;\n\tprivate int partRegistryIndex;\n... | import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BorderFactory;
import javax.swing... | package edu.utah.ece.async.sboldesigner.sbol.editor.dialog;
/**
*
* @author Michael Zhang
*/
public abstract class InputDialog<T> extends JDialog {
protected final ActionListener actionListener = new DialogActionListener();
protected JComboBox<Registry> registrySelection = null;
protected J... | Registries.get().save();
| 0 |
Expugn/S-argo | src/main/java/io/github/spugn/Sargo/Functions/Reset.java | [
"public class CommandManager\n{\n private final CommandLine COMMAND_LINE;\n private final Message MESSAGE;\n private final String userDiscordID;\n\n public CommandManager(Message message)\n {\n this.MESSAGE = message;\n\n if (message.getAuthor().isPresent())\n {\n user... | import discord4j.core.object.entity.Member;
import discord4j.core.object.entity.Message;
import discord4j.core.object.entity.TextChannel;
import discord4j.core.object.util.Snowflake;
import discord4j.core.spec.EmbedCreateSpec;
import io.github.spugn.Sargo.Managers.CommandManager;
import io.github.spugn.Sargo.Objects.Ba... | package io.github.spugn.Sargo.Functions;
/**
* RESET
* <p>
* This class modifies a user's file to remove data and provide a clean
* slate.
* </p>
*
* @author S'pugn
* @version 1.1
* @since v1.0
*/
public class Reset
{
public Reset(Message message)
{
Sargo.replyToMessage_Warning(mess... | List<Banner> banners = BannerParser.getBanners(); | 1 |
noctarius/castmapr | src/test/java/com/noctarius/castmapr/DistributedMapperClientMapReduceTest.java | [
"public interface MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n extends ExecutableMapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n{\n\n /**\n * Defines the mapper for this task. This method is not idempotent and is callable only one time. If called further\n * times an {@link IllegalStateExceptio... | import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Semaphore;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit... | m1.put( i, i );
}
final Map<String, Integer> listenerResults = new HashMap<String, Integer>();
final Semaphore semaphore = new Semaphore( 1 );
semaphore.acquire();
MapReduceTaskFactory factory = MapReduceTaskFactory.newInstance( client );
MapReduceTask<Integ... | .submitAsync( new TestCollator(), new MapReduceCollatorListener<Integer>() | 5 |
GuntherDW/TweakcraftUtils | src/com/guntherdw/bukkit/tweakcraft/Commands/CommandHandler.java | [
"public class CommandException extends Exception {\n public CommandException(String e) {\n super(e);\n }\n}",
"public class CommandSenderException extends Exception {\n public CommandSenderException(String e) {\n super(e);\n }\n}",
"public class CommandUsageException extends Exception ... | import com.guntherdw.bukkit.tweakcraft.Commands.Commands.*;
import com.guntherdw.bukkit.tweakcraft.Exceptions.CommandException;
import com.guntherdw.bukkit.tweakcraft.Exceptions.CommandSenderException;
import com.guntherdw.bukkit.tweakcraft.Exceptions.CommandUsageException;
import com.guntherdw.bukkit.tweakcraft.Except... | /*
* Copyright (c) 2011 GuntherDW
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distribu... | }*/ catch (PermissionsException e) { | 3 |
contentful/contentful.java | src/test/java/com/contentful/java/cda/integration/IntegrationWithStagingEnvironment.java | [
"public class CDAArray extends ArrayResource {\n private static final long serialVersionUID = 6596224363025698245L;\n int total;\n\n int skip;\n\n int limit;\n\n Includes includes;\n\n private List<CDAError> errors;\n\n CDAMetadata metadata;\n\n /**\n * @return total number of resources (linked excluded).... | import com.contentful.java.cda.CDAArray;
import com.contentful.java.cda.CDAClient;
import com.contentful.java.cda.CDAEntry;
import com.contentful.java.cda.CDAHttpException;
import com.contentful.java.cda.SynchronizedSpace;
import org.junit.Test;
import static com.contentful.java.cda.QueryOperation.Exists;
import static... | package com.contentful.java.cda.integration;
public class IntegrationWithStagingEnvironment extends IntegrationWithMasterEnvironment {
public void setUp() {
client = CDAClient.builder()
.setSpace("5s4tdjmyjfpl")
.setToken("16bc99120b1e0b33cc16323324baab4dbe9350c0d7a2b222ed8d7d5328e95bf3")
... | @Test(expected = CDAHttpException.class) | 3 |
MKergall/osmbonuspack | NooTous/src/main/java/com/nootous/Map.java | [
"public class RadiusMarkerClusterer extends MarkerClusterer {\n\n protected int mMaxClusteringZoomLevel = 17;\n protected int mRadiusInPixels = 100;\n protected double mRadiusInMeters;\n protected Paint mTextPaint;\n private ArrayList<Marker> mClonedMarkers;\n protected boolean mAnimated;\n int... | import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import com.nootous.databi... | package com.nootous;
public class Map extends Fragment {
private MapBinding mBinding;
private MainActivity mActivity;
MapView mMap; | Friends mFriends; | 4 |
WeDevelopTeam/HeroVideo-master | app/src/main/java/com/github/bigexcalibur/herovideo/mvp/test/ui/TestFragment.java | [
"public class MediaPlayerActivity extends Activity {\n\n MediaPlayer player;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n super.onCreate(savedInstanceState);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTA... | import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.bili... | package com.github.bigexcalibur.herovideo.mvp.test.ui;
/**
* Created by Xie.Zhou on 2017/1/4.
*/
public class TestFragment extends RxLazyFragment {
@BindView(R.id.tv_test)
TextView mTvTest;
@BindView(R.id.btn_test1)
Button mBtnTest1;
@BindView(R.id.btn_test2)
Button mBtnTest2;
@Bin... | String sign = Md5.strToMd5Low32("cid="+cid+"&from=miniplay&player=1"+SECRETKEY_MINILOADER); | 8 |
mathisdt/trackworktime | app/src/main/java/org/zephyrsoft/trackworktime/util/BackupUtil.java | [
"public static boolean exists(Context context, Type type, String filename) {\n DocumentFile grantedDirectory = DocumentFile.fromTreeUri(context, Basics.getOrCreateInstance(context).getDocumentTree());\n if (grantedDirectory != null) {\n DocumentFile subDirectory = find(grantedDirectory, true, type.getS... | import java.io.Writer;
import static org.zephyrsoft.trackworktime.DocumentTreeStorage.exists;
import android.content.Context;
import android.content.SharedPreferences;
import org.pmw.tinylog.Logger;
import org.zephyrsoft.trackworktime.Basics;
import org.zephyrsoft.trackworktime.DocumentTreeStorage;
import org.zephyrsof... | /*
* This file is part of TrackWorkTime (TWT).
*
* TWT is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation.
*
* TWT is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without... | if (exists(context, info.getType(), info.getPreferencesBackupFile())) { | 0 |
antag99/aquarria | aquarria/src/com/github/antag99/aquarria/world/World.java | [
"public enum Direction {\n\t// Note that the order is important\n\tNORTH(0, 1),\n\tNORTHEAST(1, 1),\n\tEAST(1, 0),\n\tSOUTHEAST(1, -1),\n\tSOUTH(0, -1),\n\tSOUTHWEST(-1, -1),\n\tWEST(-1, 0),\n\tNORTHWEST(-1, 1);\n\n\tprivate static Direction[] values = values();\n\n\tprivate final int horizontal;\n\tprivate final i... | import java.util.BitSet;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntArray;
import com.github.antag99.aquarria.Direction;
import com.github.antag99.aquarria.GameRegistry;
import com.github.antag99.aquarria.Item;
import com.github.antag99.aquarria.TileTyp... | /*******************************************************************************
* Copyright (c) 2014-2015, Anton Gustafsson
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistri... | public boolean isTileAttached(int x, int y, Direction direction) { | 0 |
tdunning/log-synth | src/main/java/com/mapr/synth/samplers/DnsSampler.java | [
"public class FancyTimeFormatter {\n private static String[] defaultFormats = {\"yyyy-MM-dd HH:mm:ss.SSS\", \"yyyy-MM-dd HH:mm:ss\", \"yyyy-MM-dd\"};\n private static String isoFormat = \"yyyy-MM-dd'T'HH:mm:ss'Z'\";\n\n private List<String> formats = Lists.newArrayList();\n private List<SimpleDateFormat... | import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.BooleanNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.LongNode;
import com.fasterxml.jackson.databind.node.Object... | nextQuery = getNextQueryTime();
return Event.QUERY;
}
}
private Event flipActivation() {
if (isActive) {
isActive = false;
nextQuery = getNextQueryTime();
nextTransition = getNextTransition();
return Event.DEACTIVATE;
... | if (this.getName() == null || this.getName() == SchemaSampler.FLAT_SEQUENCE_MARKER) { | 6 |
ailab-uniud/distiller-CORE | src/main/java/it/uniud/ailab/dcore/annotation/annotators/SimpleAnnotationFilterAnnotator.java | [
"public class Blackboard {\r\n\r\n /**\r\n * The default document identifier.\r\n */\r\n private static final String DEFAULT_DOCUMENT_ID = \"DocumentRoot\";\r\n\r\n /**\r\n * The full raw text of the document.\r\n */\r\n private String rawText;\r\n\r\n /**\r\n * The root block of ... | import it.uniud.ailab.dcore.Blackboard;
import it.uniud.ailab.dcore.annotation.Annotation;
import it.uniud.ailab.dcore.annotation.Annotator;
import it.uniud.ailab.dcore.annotation.annotations.ScoredAnnotation;
import it.uniud.ailab.dcore.persistence.DocumentComponent;
import java.util.Collection;
import java.util.Colle... | /*
* Copyright (C) 2015 Artificial Intelligence
* Laboratory @ University of Udine.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option... | Collection<Annotation> annotations = blackboard.getAnnotations(annotation); | 1 |
Orange-OpenSource/android-trail-drawing | demo/JavaFxTest/src/main/java/com/orange/dgil/trail/app/fxdrawertest/curves/Curves.java | [
"@Getter\n@NoArgsConstructor\npublic class TrailPoint {\n private int x = -1;\n private int y = -1;\n\n public TrailPoint(int x, int y) {\n set(x, y);\n }\n\n public void set(int x, int y) {\n this.x = x;\n this.y = y;\n }\n\n public boolean isSameAs(TrailPoint point) {\n return x == point.x && y... | import com.orange.dgil.trail.core.common.TrailPoint;
import com.orange.dgil.trail.core.quad.QuadCurve;
import com.orange.dgil.trail.core.quad.QuadCurveArray;
import com.orange.dgil.trail.core.vecto.linearwindowfilter.LinearWindowFilter;
import com.orange.dgil.trail.core.vecto.linearwindowfilter.LinearWindowFilterListen... | /**
* Trail drawing library
* Copyright (C) 2014 Orange
* Authors: christophe.maldivi@orange.com, eric.petit@orange.com
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MP... | private final VectoFilter vectoFilter = new VectoFilter(this); | 4 |
msteindorfer/criterion | src/main/java/io/usethesource/criterion/JmhSetMultimapBenchmarks.java | [
"public static enum DataType {\n MAP, SET_MULTIMAP, SET\n}",
"public static enum SampleDataSelection {\n MATCH, RANDOM\n}",
"public enum ValueFactoryFactory {\n VF_CLOJURE {\n @Override\n public JmhValueFactory getInstance() {\n return new io.usethesource.criterion.impl.persistent.clojure.ClojureV... | import java.util.Arrays;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import io.usethesource.criterion.BenchmarkUtils.DataType;
import io.usethesource.criterion.BenchmarkUtils.SampleDataSelection;
import io.usethesource.criterion.BenchmarkUtils.ValueFactoryFactory;
import io... | /**
* Copyright (c) Michael Steindorfer <Centrum Wiskunde & Informatica> and Contributors.
* All rights reserved.
*
* This file is licensed under the BSD 2-Clause License, which accompanies this project
* and is available under https://opensource.org/licenses/BSD-2-Clause.
*/
package io.usethesource.criterion;
... | private java.util.Set<JmhValue> cachedKeySet; | 5 |
ra4king/LWJGL-OpenGL-Tutorials | src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example3/Example8_3.java | [
"public abstract class GLProgram {\r\n\tprivate int fps;\r\n\t\r\n\t/**\r\n\t * Initializes the application in fullscreen mode.\r\n\t * \r\n\t * @param vsync Enables/disables the vertical-sync feature, where the rendering is in sync with the monitor's refresh rate.\r\n\t * With v-sync off, there is no framer... | import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL20.*;
import org.lwjgl.input.Keyboard;
import com.ra4king.opengl.GLProgram;
import com.ra4king.opengl.util.Mesh;
import com.ra4king.opengl.util.ShaderProgram;
import com.ra4king.opengl.util.Utils;
import com.ra4king.opengl.util.math.Matrix4;... | package com.ra4king.opengl.arcsynthesis.gl33.chapter8.example3;
public class Example8_3 extends GLProgram {
public static void main(String[] args) {
new Example8_3().run(true);
}
private enum OffsetRelative {
MODEL_RELATIVE,
WORLD_RELATIVE,
CAMERA_RELATIVE
}
private ShaderProgram pr... | private Quaternion orientation;
| 6 |
DigitasLbiMobile/AndroidTextExtensions | AndroidTextExtensionsPlugin/src/digitaslbi/ext/plugin/AssetsWatcher.java | [
"public interface Constants {\n\n String ASSETS_FOLDER = \"assets\";\n\n String RESOURCE_FOLDER = \"res\";\n\n String VALUES_FOLDER = \"values\";\n\n String BOOTSTRAP_PACKAGE_NAME = \"digitaslbi.ext.fonts\";\n\n String BOOTSTRAP_CLASS_NAME = \"FontFamilies\";\n}",
"public class Dialogs {\n\n pub... | import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.vfs.VirtualFileVisitor;
import com.intellij.openapi.vfs.newvfs.BulkFileListener;
import com.intellij.open... | /*
* Copyright (c) 2015 DigitasLBi.
* 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 writin... | Log.d(getClass(), "Not an Android module/project.", project); | 2 |
NICTA/nicta-ner | nicta-ner/src/main/java/org/t3as/ner/util/Tokenizer.java | [
"@Immutable\npublic class Token {\n\n /** 0-indexed position of the first character of this token from the original text being analysed. */\n public final int startIndex;\n /** The text that this token is representing. */\n public final String text;\n\n @JsonCreator\n public Token(@JsonProperty(\"... | import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableList;
import org.t3as.ner.Token;
import java.io.IOException;
import java.text.BreakIterator;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import static java.lang.Ch... | /*
* #%L
* NICTA t3as Named-Entity Recognition library
* %%
* Copyright (C) 2010 - 2014 NICTA
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or ... | if (canBreakSentence && equalss(trimmedWord, ".", ";", "?", "!")) { | 2 |
davidandrzej/LogicLDA | src/main/java/logiclda/infer/CollapsedGibbs.java | [
"public class EvalLDA \n{\n\t\t\n\t/**\n\t * Calc uncollapsed LDA log-likelihood \n\t * @param nw\n\t * @param nd\n\t * @param phi\n\t * @param theta\n\t * @param beta\n\t * @param alpha\n\t * @return\n\t */\n\tpublic static double ldaLoglike(long[][] nw, long[][] nd, \n\t\t\tdouble[][] phi, double[][] theta,\n\t\t... | import java.util.Random;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
import logiclda.EvalLDA;
import logiclda.infer.MirrorDescent;
import logiclda.rules.GroundableRule;
import logiclda.rules.LogicRule;
import logiclda.infer.GroundRules;
import logiclda.Corpus;
import logiclda.LDAParameters;... | package logiclda.infer;
/**
*
* Collapsed Gibbs Sampling inference for Latent Dirichlet Allocation
* (Griffiths & Steyvers PNAS 2004)
*
* @author david
*
*/
public class CollapsedGibbs {
/**
* Do a single Collapsed Gibbs sample, but with topic-words Phi fixed
*
* @param c Contains words, documen... | DiscreteSample s, List<LogicRule> rules, int numsamp) | 3 |
javadelight/delight-metrics | src/main/java/de/mxro/metrics/MetricsCommon.java | [
"public class MetricRegistry implements MetricSet {\n /**\n * Concatenates elements to form a dotted name, eliding any null values or empty strings.\n *\n * @param name the first element of the name\n * @param names the remaining elements of the name\n * @return {@code name} and {@code names... | import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Snapshot;
import de.mxro.metrics.internal.MetricsFactory;
import de.mxro.metrics.internal.operations.CounterEvent;
import de.mxro.metrics.internal.operations.HistrogramEvent;
import de.mxro.metrics.internal.operations.MarkEvent;
import de.mxro.metr... | package de.mxro.metrics;
/**
* <p>
* List of operations which are compatible with Java JRE and GWT environments.
*
* @author <a href="http://www.mxro.de">Max Rohde</a>
*
*/
public class MetricsCommon extends PropertiesCommon {
/**
* <p>
* Creates a metric node, which is not thread safe. Only use in sing... | return new RetrieveHistrogramEvent().setId(id); | 4 |
hprange/woinject | src/test/java/com/webobjects/foundation/TestInstantiationInterceptor.java | [
"public abstract class AbstractInjectableTestCase {\n /**\n * We have to cheat here in order to make the Application initialization\n * work.\n */\n @BeforeClass\n public static void initMainBundle() throws Exception {\n NSBundle mockBundle = mock(NSBundle.class);\n\n when(mockBun... | import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import java.lang.reflect.Constructor;
import java.... | /**
* Copyright (C) 2010 hprange <hprange@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | Constructor<StubEnterpriseObject> constructor = StubEnterpriseObject.class.getConstructor(); | 5 |
dariober/ASCIIGenome | src/test/java/tracks/IntervalFeatureTest.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.comm... | package tracks;
public class IntervalFeatureTest {
private String ideogramToString(List<FeatureChar> fchars, boolean noFormat) throws InvalidColourException{
StringBuilder sb= new StringBuilder();
for(FeatureChar x : fchars){
sb.append(x.format(noFormat));
}
return sb.toString();
}
@Before | public void setConfig() throws IOException, InvalidConfigException{ | 2 |
mguetlein/CheS-Mapper | src/main/java/org/chesmapper/view/gui/CompoundListPanel.java | [
"public class Cluster extends ZoomableCompoundGroup implements CompoundGroupWithProperties, DoubleNameElement,\r\n\t\tComparable<Cluster>\r\n{\r\n\tprivate ClusterData clusterData;\r\n\r\n\tHashMap<String, List<Compound>> compoundsOrderedByPropterty = new HashMap<String, List<Compound>>();\r\n\r\n\tprivate boolean ... | import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.Prope... | });
filterButton.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
{
clusterControler.applyCompoundFilter(ArrayUtil.toList(clustering.getActiveCompounds()), true);
}
});
clearSelectedButton.addActionListener(new ActionListener()
{
... | JPanel listWrapped = new TransparentViewPanel(new BorderLayout());
| 7 |
Kaysoro/KaellyBot | src/main/java/finders/TwitterFinder.java | [
"public enum Language {\n\n FR(\"Français\", \"FR\"), EN(\"English\", \"EN\"), ES(\"Español\", \"ES\");\n\n private String name;\n private String abrev;\n\n Language(String name, String abrev){\n this.name = name;\n this.abrev = abrev;\n }\n\n public String getName() {\n retur... | import enums.Language;
import listeners.TwitterListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import twitter4j.FilterQuery;
import util.ClientConfig;
import util.Connexion;
import util.Reporter;
import util.Translator;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Re... | package finders;
/**
* Created by steve on 12/01/2017.
*/
public class TwitterFinder{
private final static Logger LOG = LoggerFactory.getLogger(TwitterFinder.class);
private static boolean isReady = false;
private static Map<Long, TwitterFinder> twitterChannels;
private long guildId;
private lo... | long[] twitterIDs = new long[Language.values().length]; | 0 |
wzgiceman/RxjavaRetrofitDemo-master | rxretrofitlibrary/src/main/java/com/wzgiceman/rxretrofitlibrary/retrofit_rx/download/HttpDownManager.java | [
"public class DownloadInterceptor implements Interceptor {\n\n private DownloadProgressListener listener;\n\n public DownloadInterceptor(DownloadProgressListener listener) {\n this.listener = listener;\n }\n\n @Override\n public Response intercept(Chain chain) throws IOException {\n Res... | import android.os.Handler;
import android.os.Looper;
import com.wzgiceman.rxretrofitlibrary.retrofit_rx.download.DownLoadListener.DownloadInterceptor;
import com.wzgiceman.rxretrofitlibrary.retrofit_rx.exception.HttpTimeException;
import com.wzgiceman.rxretrofitlibrary.retrofit_rx.exception.RetryWhenNetworkException;
i... | package com.wzgiceman.rxretrofitlibrary.retrofit_rx.download;
/**
* http下载处理类
* Created by WZG on 2016/7/16.
*/
public class HttpDownManager {
/*记录下载数据*/
private Set<DownInfo> downInfos;
/*回调sub队列*/
private HashMap<String, ProgressDownSubscriber> subMap;
/*单利对象*/
private volatile static ... | DownloadInterceptor interceptor = new DownloadInterceptor(subscriber); | 0 |
turn/sorcerer | src/main/java/com/turn/sorcerer/config/impl/YamlConfigReader.java | [
"public interface ConfigReader {\n\n\t// returns addPackages to search for annotations parsed from config\n\tCollection<String> read(Collection<File> configFiles) throws SorcererException;\n\n\tFilenameFilter getFileFilter();\n}",
"public class SorcererException extends Exception {\n\n\tpublic SorcererException()... | import com.turn.sorcerer.config.ConfigReader;
import com.turn.sorcerer.exception.SorcererException;
import com.turn.sorcerer.module.ModuleType;
import com.turn.sorcerer.pipeline.type.PipelineType;
import com.turn.sorcerer.status.type.impl.HDFSStatusStorageType;
import com.turn.sorcerer.status.type.impl.MemoryStatusStor... | /*
* Copyright (c) 2015, Turn Inc. All Rights Reserved.
* Use of this source code is governed by a BSD-style license that can be found
* in the LICENSE file.
*/
package com.turn.sorcerer.config.impl;
/**
* Class Description Here
*
* @author tshiou
*/
public class YamlConfigReader implements ConfigReader {
... | YAML_CONFIG.setClassTag(HDFS_STATUS_TAG, HDFSStatusStorageType.class); | 4 |
albfernandez/javadbf | src/test/java/com/linuxense/javadbf/bug34_char_encoding/Bug34CharacterEncodingTest.java | [
"public enum DBFDataType {\n\t/**\n\t * Default unknown type\n\t */\n\tUNKNOWN ((byte) 0),\n\t/**\n\t * Character data, padded with whitespaces.\n\t */\n\tCHARACTER ('C', 1, 254, 0, true),\n\t/**\n\t * Character data, not padded\n\t */\n\tVARCHAR ('V', 1, 254, 0, false),\n\t/**\n\t * Binary... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.li... | package com.linuxense.javadbf.bug34_char_encoding;
public class Bug34CharacterEncodingTest {
public Bug34CharacterEncodingTest() {
super();
}
@Test
public void testBug34EncodingStream() throws DBFException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DBFReader reader = null;
DBFWrit... | fields[0].setType(DBFDataType.CHARACTER); | 0 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/controller/CategoryController.java | [
"public abstract class BenihController<P extends BenihController.Presenter>\n{\n protected P presenter;\n\n public BenihController(P presenter)\n {\n this.presenter = presenter;\n Timber.tag(getClass().getSimpleName());\n }\n\n public abstract void saveState(Bundle bundle);\n\n publi... | import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import id.zelory.benih.controller.BenihController;
import id.zelory.benih.util.BenihScheduler;
import id.zelory.codepolitan.R;
import id.zelory.codepolitan.controller.event.ErrorEvent;
import id.zelory.codepolitan.data.model.Category;
import i... | /*
* Copyright (c) 2015 Zelory.
*
* 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 agre... | category.setFollowed(DataBaseHelper.pluck().isFollowed(category)); | 5 |
mbolt35/coffee-graph | src/test/java/bolt/web/coffee/AssertingExporter.java | [
"public class CoffeeIdentifier implements NamedDependency {\n\n private final String name;\n private final File file;\n private final int depth;\n\n public CoffeeIdentifier(String name, File file, int depth) {\n this.name = name;\n this.file = file;\n this.depth = depth;\n }\n\n ... | import java.util.List;
import bolt.web.coffee.dependency.CoffeeIdentifier;
import bolt.web.coffee.dependency.graph.CyclicDependencyException;
import bolt.web.coffee.dependency.graph.DependencyGraph;
import bolt.web.coffee.dependency.graph.GraphUtils;
import bolt.web.coffee.io.exporters.AbstractExporter;
| ////////////////////////////////////////////////////////////////////////////////
//
// Coffee-Graph
// Copyright(C) 2012 Matt Bolt
//
// 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 Sof... | public void export(DependencyGraph<CoffeeIdentifier> graph) {
| 2 |
PedroGomes/TPCw-benchmark | TPCW_DOCM_Implementation/src/org/uminho/gsd/benchmarks/TPCW_CassandraOM/database_executor/TPCW_RDBMS_DatanucleusExecutorFactory.java | [
"public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ... | import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor;
import org.uminho.gsd.benchmarks.generic.helpers.NodeKeyGenerator;
import org.uminho.gsd.benchmarks.helpers.TPM_counter;
import org.uminho.gsd.benchmarks.interfaces.KeyGenerator;
import org.uminho.gsd.benchmarks.interfaces.executor.AbstractDatabaseExecutorFa... | /*
* *********************************************************************
* Copyright (c) 2010 Pedro Gomes and Universidade do Minho.
* All rights reserved.
* 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... | TPM_counter tpm_counter = new TPM_counter(); | 2 |
pravinkmrr/PanoramaGL-Android | src/com/android/panoramagl/PLViewEventListener.java | [
"public abstract class PLViewBase extends Activity implements SensorEventListener, OnDoubleTapListener\r\n{\r\n\tprotected PLRenderer renderer;\r\n\tprotected PLScene scene;\r\n\t\r\n\tprotected NSTimer animationTimer;\r\n\tprotected float animationInterval;\r\n\t\r\n\tprotected CGPoint startPoint, endPoint;\r\n\t\... | import com.android.panoramagl.iphone.enumeration.UIDeviceOrientation;
import com.android.panoramagl.iphone.structs.CGPoint;
import com.android.panoramagl.iphone.structs.UIAcceleration;
import java.util.List;
import android.hardware.SensorEvent;
import android.view.MotionEvent;
import com.android.panoramagl.PLViewBase;
... | /*
* This file is part of the PanoramaGL library for Android.
*
* Authors: Javier Baez <javbaezga@gmail.com> and Miguel auay <mg_naunay@hotmail.com>
*
* $Id$
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the ... | boolean onShouldBeginInertia(PLViewBase plView, CGPoint starPoint, CGPoint endPoint); | 3 |
ProxyPrint/proxyprint-kitchen | src/main/java/io/github/proxyprint/kitchen/controllers/printshops/ManagerController.java | [
"@Entity\n@Table(name = \"employees\")\npublic class Employee extends User {\n\n @Column(name = \"name\", nullable = false)\n private String name;\n @OneToOne(cascade = CascadeType.DETACH)\n @JoinColumn(name = \"printshop_id\")\n private PrintShop printShop;\n\n public Employee() {\n super.... | import com.google.gson.Gson;
import com.google.gson.JsonObject;
import io.github.proxyprint.kitchen.models.consumer.printrequest.PrintRequest;
import io.github.proxyprint.kitchen.models.printshops.Employee;
import io.github.proxyprint.kitchen.models.printshops.Manager;
import io.github.proxyprint.kitchen.models.printsh... | package io.github.proxyprint.kitchen.controllers.printshops;
/**
* Created by daniel on 27-04-2016.
*/
@RestController
@Transactional
public class ManagerController {
@Autowired
PrintShopDAO printshops;
@Autowired
EmployeeDAO employees;
@Autowired
PrintRequestDAO printRequests;
@Autow... | ManagerDAO managers; | 3 |
BeYkeRYkt/LightAPI | craftbukkit-nms-v1_15_R1/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/internal/handler/craftbukkit/nms/v1_15_R1/VanillaNMSHandler.java | [
"public class BukkitPlatformImpl implements IPlatformImpl, IBukkitExtension {\n\n private static final String DEFAULT_IMPL_NAME = \"craftbukkit\";\n /**\n * CONFIG\n */\n private final String CONFIG_TITLE = \"general\";\n private final String CONFIG_DEBUG = CONFIG_TITLE + \".debug\";\n privat... | import com.google.common.collect.Lists;
import net.minecraft.server.v1_15_R1.BlockPosition;
import net.minecraft.server.v1_15_R1.Chunk;
import net.minecraft.server.v1_15_R1.ChunkCoordIntPair;
import net.minecraft.server.v1_15_R1.EntityPlayer;
import net.minecraft.server.v1_15_R1.EnumSkyBlock;
import net.minecraft.serve... | /*
* The MIT License (MIT)
*
* Copyright 2021 Vladimir Mikhailov <beykerykt@gmail.com>
*
* 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 limitati... | public LightEngineVersion getLightEngineVersion() { | 7 |
mokszr/ultimate-geojson | ugeojson-parser/src/test/java/org/ugeojson/parser/deserializer/FeatureCollectionDeserializerShould.java | [
"public class PositionDto implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tprivate double[] numbers;\n\n\t/**\n\t * This constructor initializes numbers field to hold two double numbers. Do\n\t * not use this constructor if you need the third elevation parameter.\n\t */\n\tpublic... | import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import org.junit.Test;
import org.ugeojson.model.PositionDto;
import org.ugeojson.model.feature.FeatureCollectionDto;
import org.ugeojson.model.feature.FeatureDto;
import org.ugeojson.model.geometry.GeometryDto;
import org.ugeoj... | package org.ugeojson.parser.deserializer;
public class FeatureCollectionDeserializerShould {
@Test public void
deserialize_featurecollection(){
GsonBuilder gsonBuilder = new GsonBuilder();
gsonBuilder.registerTypeAdapter(PositionDto.class, new PositionDeserializer());
gsonBuilder.registerTypeAdapter(PointD... | gsonBuilder.registerTypeAdapter(FeatureDto.class, new FeatureDeserializer()); | 2 |
MaLeLabTs/RegexGenerator | Random Regex Turtle/src/it/units/inginf/male/postprocessing/BasicPostprocessor.java | [
"public class Configuration {\n\n private static final Logger LOG = Logger.getLogger(Configuration.class.getName()); \n \n /**\n * Initializes with default values, parameters and operators.\n */\n public Configuration() {\n this.evolutionParameters = new EvolutionParameters();\n t... | import it.units.inginf.male.configuration.Configuration;
import it.units.inginf.male.evaluators.TreeEvaluationException;
import it.units.inginf.male.evaluators.TreeEvaluator;
import it.units.inginf.male.inputs.Context;
import it.units.inginf.male.inputs.DataSet;
import it.units.inginf.male.inputs.DataSet.Bounds;
import... | /*
* Copyright (C) 2015 Machine Learning Lab - University of Trieste,
* Italy (http://machinelearning.inginf.units.it/)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version ... | Node bestIndividualReplica = new Constant(solution); | 5 |
damingerdai/web-qq | src/main/java/org/aming/web/qq/service/impl/UserServiceImpl.java | [
"public class Relationship implements Serializable {\n private int id;\n private String userId1;\n private String userId2;\n\n public int getId() {\n return id;\n }\n\n public Relationship setId(int id) {\n this.id = id;\n return this;\n }\n\n public String getUserId1() ... | import org.aming.web.qq.domain.Relationship;
import org.aming.web.qq.domain.User;
import org.aming.web.qq.exceptions.WebQQDaoException;
import org.aming.web.qq.exceptions.WebQQServiceException;
import org.aming.web.qq.repository.jdbc.UserDao;
import org.aming.web.qq.service.UserService;
import org.aming.web.qq.utils.Nu... | package org.aming.web.qq.service.impl;
/**
* @author daming
* @version 2017/10/2.
*/
@Service
@Transactional | public class UserServiceImpl implements UserService { | 5 |
ppicas/android-clean-architecture-mvp | app/src/main/java/cat/ppicas/cleanarch/app/DefaultServiceContainer.java | [
"public class OWMCurrentWeatherRepository implements CurrentWeatherRepository {\n\n private OWMService mService;\n\n public OWMCurrentWeatherRepository(OWMService service) {\n mService = service;\n }\n\n @Override\n public CurrentWeather getCityCurrentWeather(String cityId) {\n OWMCurre... | import cat.ppicas.cleanarch.repository.CurrentWeatherRepository;
import cat.ppicas.cleanarch.repository.DailyForecastRepository;
import cat.ppicas.cleanarch.util.AsyncTaskExecutor;
import cat.ppicas.framework.task.TaskExecutor;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
import com.squareup.okhttp.Cac... | /*
* Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | public CityRepository getCityRepository() { | 2 |
rahulsom/grooves | grooves-api/src/main/java/com/github/rahulsom/grooves/queries/TemporalQuerySupport.java | [
"public interface BaseQuery<\n AggregateT,\n EventIdT,\n EventT extends BaseEvent<AggregateT, EventIdT, EventT>,\n SnapshotIdT,\n SnapshotT extends BaseSnapshot<AggregateT, SnapshotIdT, EventIdT, EventT>\n > {\n\n /**\n * When no snapshot is found in the database, th... | import com.github.rahulsom.grooves.api.events.BaseEvent;
import com.github.rahulsom.grooves.api.events.RevertEvent;
import com.github.rahulsom.grooves.api.snapshots.TemporalSnapshot;
import com.github.rahulsom.grooves.queries.internal.BaseQuery;
import com.github.rahulsom.grooves.queries.internal.Pair;
import com.githu... | package com.github.rahulsom.grooves.queries;
/**
* Default interface to help in building temporal snapshots.
*
* @param <AggregateT> The aggregate over which the query executes
* @param <EventIdT> The type of the EventT's id field
* @param <EventT> The type of the Event
* @param <SnapshotIdT> The typ... | BaseQuery<AggregateT, EventIdT, EventT, SnapshotIdT, SnapshotT>, | 0 |
ThexXTURBOXx/BlockHelper | de/thexxturboxx/blockhelper/integration/MeteorsIntegration.java | [
"public class BlockHelperCommonProxy {\n\n protected static Configuration cfg;\n\n public static boolean showHealth;\n public static boolean advMachinesIntegration;\n public static boolean appEngIntegration;\n public static boolean bcIntegration;\n public static boolean ccIntegration;\n public ... | import de.thexxturboxx.blockhelper.BlockHelperCommonProxy;
import de.thexxturboxx.blockhelper.api.BlockHelperBlockState;
import de.thexxturboxx.blockhelper.api.BlockHelperInfoProvider;
import de.thexxturboxx.blockhelper.api.InfoHolder;
import de.thexxturboxx.blockhelper.i18n.I18n;
import net.meteor.common.MeteorsMod;
i... | package de.thexxturboxx.blockhelper.integration;
public class MeteorsIntegration extends BlockHelperInfoProvider {
@Override | public void addInformation(BlockHelperBlockState state, InfoHolder info) { | 3 |
urgrue/Java-Twitch-Api-Wrapper | src/main/java/com/mb3364/twitch/api/resources/StreamsResource.java | [
"public enum Scopes {\n\n /**\n * Read access to non-public user information, such as email address.\n */\n USER_READ(\"user_read\"),\n\n /**\n * Ability to ignore or unignore on behalf of a user.\n */\n USER_BLOCKS_EDIT(\"user_blocks_edit\"),\n\n /**\n * Read access to a user's l... | import com.mb3364.http.RequestParams;
import com.mb3364.twitch.api.auth.Scopes;
import com.mb3364.twitch.api.handlers.FeaturedStreamResponseHandler;
import com.mb3364.twitch.api.handlers.StreamResponseHandler;
import com.mb3364.twitch.api.handlers.StreamsResponseHandler;
import com.mb3364.twitch.api.handlers.StreamsSum... | package com.mb3364.twitch.api.resources;
/**
* The {@link StreamsResource} provides the functionality
* to access the <code>/streams</code> endpoints of the Twitch API.
*
* @author Matthew Bell
*/
public class StreamsResource extends AbstractResource {
/**
* Construct the resource using the Twitch API... | StreamsSummary value = objectMapper.readValue(content, StreamsSummary.class); | 8 |
chanjarster/artemis-disruptor-miaosha | jms-server/src/main/java/me/chanjar/jms/server/config/ItemAmountUpdateProcessorConfiguration.java | [
"public class DisruptorLifeCycleContainer implements SmartLifecycle {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(DisruptorLifeCycleContainer.class);\n\n private volatile boolean running = false;\n\n private final String disruptorName;\n private final Disruptor disruptor;\n private final i... | import com.lmax.disruptor.dsl.Disruptor;
import me.chanjar.jms.base.lifecycle.DisruptorLifeCycleContainer;
import me.chanjar.jms.server.StartupOrderConstants;
import me.chanjar.jms.server.command.infras.CommandDispatcher;
import me.chanjar.jms.server.command.infras.disruptor.*;
import me.chanjar.jms.server.command.item... | package me.chanjar.jms.server.config;
@Configuration
@EnableConfigurationProperties(ItemAmountUpdateProcessorConfiguration.Conf.class)
public class ItemAmountUpdateProcessorConfiguration implements ApplicationContextAware {
@Autowired
private Conf conf;
@Autowired
private CommandDispatcher commandDispatche... | ItemAmountUpdateCommandExecutor cmdExecutor = new ItemAmountUpdateCommandExecutor(jdbcTemplate); | 5 |
DDoS/JICI | src/main/java/ca/sapon/jici/lexer/literal/number/IntLiteral.java | [
"public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ... | import ca.sapon.jici.lexer.TokenID;
import ca.sapon.jici.util.StringUtil;
import ca.sapon.jici.evaluator.Environment;
import ca.sapon.jici.evaluator.EvaluatorException;
import ca.sapon.jici.evaluator.type.PrimitiveType;
import ca.sapon.jici.evaluator.type.Type;
import ca.sapon.jici.evaluator.value.Value;
import ca.sapo... | /*
* This file is part of JICI, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/>
*
* 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... | public Type getType(Environment environment) { | 3 |
fabioz/eclipse.spellchecker | src/eclipse/spellchecker/engine/AbstractSpellDictionary.java | [
"public class Activator extends AbstractUIPlugin {\r\n\r\n\tpublic static final String ID_PLUGIN = \"eclipse.spellchecker\";\r\n\tprivate static Activator plugin; // The shared instance.\r\n\r\n\t/**\r\n\t * The constructor.\r\n\t */\r\n\tpublic Activator() {\r\n\t\tsuper();\r\n\t\tplugin = this;\r\n\t}\r\n\r\n\t@O... | import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.Charset;
import java.nio.charset... | final BufferedReader reader= new BufferedReader(new InputStreamReader(stream, decoder));
boolean doRead= true;
while (doRead) {
try {
word= reader.readLine();
} catch (MalformedInputException ex) {
// Tell the decoder to replace malformed input in order to read the line.
... | String encoding= Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.SPELLING_USER_DICTIONARY_ENCODING); | 2 |
dbasedow/prospecter | src/main/java/de/danielbasedow/prospecter/core/analysis/LuceneAnalyzer.java | [
"public interface BloomFilter<T> {\n public void add(T element);\n\n public void add(byte[] element);\n\n public boolean contains(T element);\n\n public boolean contains(byte[] element);\n}",
"public class BloomFilterImpl<E> implements Serializable, BloomFilter<E> {\n private BitSet bitset;\n pr... | import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.JsonNodeType;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.inject.Inject;
import com.skjegstad.utils.BloomFilter;
import com.skjegstad.utils.BloomFilterImpl;
import com.skjegstad.utils.FakeBloomFilter;... | package de.danielbasedow.prospecter.core.analysis;
/**
* Thin wrapper around Lucene's org.apache.lucene.analysis.Analyzer
*/
public abstract class LuceneAnalyzer implements Analyzer {
private static final Logger LOGGER = LoggerFactory.getLogger(LuceneAnalyzer.class);
protected final TokenMapper tokenMapper... | return new BloomFilterImpl<String>(falsePositiveProbability, expectedNumberOfElements); | 1 |
davidmoten/rxjava2-jdbc | rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/Database.java | [
"public final class FlowableSingleDeferUntilRequest<T> extends Flowable<T> {\n\n private final Single<T> single;\n\n public FlowableSingleDeferUntilRequest(Single<T> single) {\n this.single = single;\n }\n\n @Override\n protected void subscribeActual(Subscriber<? super T> s) {\n SingleS... | import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Types;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.Atomic... | package org.davidmoten.rx.jdbc;
public final class Database implements AutoCloseable {
private final Pool<Connection> pool;
private final Single<Connection> connection;
private final Action onClose;
private Database(@Nonnull Pool<Connection> pool, @Nonnull Action onClose) {
this.pool = ... | return Database.from(new ConnectionProviderBlockingPool(cp)); | 4 |
legobmw99/Allomancy | src/main/java/com/legobmw99/allomancy/modules/combat/CombatSetup.java | [
"@Mod(Allomancy.MODID)\npublic class Allomancy {\n\n public static final String MODID = \"allomancy\";\n public static final CreativeModeTab allomancy_group = new CreativeModeTab(MODID) {\n @Override\n public ItemStack makeIcon() {\n return new ItemStack(CombatSetup.MISTCLOAK.get());\... | import com.legobmw99.allomancy.Allomancy;
import com.legobmw99.allomancy.modules.combat.entity.ProjectileNuggetEntity;
import com.legobmw99.allomancy.modules.combat.item.CoinBagItem;
import com.legobmw99.allomancy.modules.combat.item.KolossBladeItem;
import com.legobmw99.allomancy.modules.combat.item.MistcloakItem;
imp... | package com.legobmw99.allomancy.modules.combat;
public class CombatSetup {
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, Allomancy.MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Alloma... | public static final RegistryObject<KolossBladeItem> KOLOSS_BLADE = ITEMS.register("koloss_blade", KolossBladeItem::new); | 3 |
Spade-Editor/Spade | src/heroesgrave/spade/image/change/doc/FloatLayer.java | [
"public class Document\n{\n\tpublic static int MAX_DIMENSION = 4096;\n\t\n\tprivate LinkedList<IDocChange> changes = new LinkedList<IDocChange>();\n\tprivate LinkedList<IDocChange> reverted = new LinkedList<IDocChange>();\n\t\n\tprivate int width, height;\n\tprivate File file;\n\tprivate Metadata info;\n\tprivate L... | import heroesgrave.spade.image.Document;
import heroesgrave.spade.image.Layer;
import heroesgrave.spade.image.RawImage;
import heroesgrave.spade.image.change.IDocChange;
import heroesgrave.spade.image.change.edit.ClearMaskChange;
import heroesgrave.spade.image.change.edit.FillImageChange;
import heroesgrave.spade.main.... | // {LICENSE}
/*
* Copyright 2013-2015 HeroesGrave and other Spade developers.
*
* This file is part of Spade
*
* Spade is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, ... | RawImage image = new RawImage(doc.getWidth(), doc.getHeight()); | 2 |
scp504677840/ExcellentWiFi | src/com/jzlg/excellentwifi/activity/MainActivity.java | [
"public class RadarFragment extends Fragment {\n\tprivate View view;\n\tprivate RadarView radarView;\n\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tview = inflater.inflate(R.layout.layout_radar, container, false);\n\t\tinitView();\n\... | import com.jzlg.excellentwifi.R;
import com.jzlg.excellentwifi.fragment.RadarFragment;
import com.jzlg.excellentwifi.fragment.MapFragment;
import com.jzlg.excellentwifi.fragment.MoreFragment;
import com.jzlg.excellentwifi.fragment.WifiFragment;
import com.jzlg.excellentwifi.menu.SlidingMenu;
import android.content.Inte... | // ³õʼ»¯Ê¼þ
private void initEvent() {
mTabWifi.setOnClickListener(this);
mTabMap.setOnClickListener(this);
mTabRadar.setOnClickListener(this);
mTabMore.setOnClickListener(this);
mLayoutLevels.setOnClickListener(this);
mLayoutWifilocation.setOnClickListener(this);
mLayoutPwd.setOnClickListener(this);
... | mFMMore = new MoreFragment(); | 2 |
Aleksey-Terzi/MerchantsTFC | src/com/aleksey/merchants/Helpers/WarehouseManager.java | [
"public class WarehouseBookInfo\n{\n public int X;\n public int Y;\n public int Z;\n public int Key;\n \n public static WarehouseBookInfo readFromNBT(NBTTagCompound nbt)\n {\n if(nbt == null)\n return null;\n \n WarehouseBookInfo info = new WarehouseBookInfo();\n... | import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map.Entry;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import ... | package com.aleksey.merchants.Helpers;
public class WarehouseManager
{
private static final int _searchContainerRadius = 3;
private static final int _searchWarehouseDistance = 10;
private ArrayList<Point> _containerLocations;
private Hashtable<String, Integer> _quantities;
private ItemStack _go... | WarehouseContainerList.addContainer(new ChestContainer()); | 7 |
ppicas/android-clean-architecture-mvp | app/src/main/java/cat/ppicas/cleanarch/ui/presenter/CityDailyForecastPresenter.java | [
"public class DailyForecast {\n\n private String mCityId;\n private Date mDate;\n private String mDescription;\n private double mDayTemp;\n private double mMinTemp;\n private double mMaxTemp;\n private double mHumidity;\n private double mWindSpeed;\n\n public DailyForecast(String cityId, ... | import java.util.List;
import cat.ppicas.cleanarch.R;
import cat.ppicas.cleanarch.model.DailyForecast;
import cat.ppicas.cleanarch.repository.DailyForecastRepository;
import cat.ppicas.cleanarch.task.GetDailyForecastsTask;
import cat.ppicas.cleanarch.text.NumberFormat;
import cat.ppicas.cleanarch.ui.vista.CityDailyFore... | /*
* Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | private DailyForecast mLastDailyForecast; | 0 |
fabioCollini/mv2m | demo/src/test/java/it/cosenonjaviste/demomv2m/core/list/NoteListViewModelTest.java | [
"public class TestData {\n\n public static final String ID_1 = \"1\";\n public static final String ID_2 = \"2\";\n public static final String ID_A = \"a\";\n public static final String TITLE_A = \"xyz\";\n public static final String TEXT_A = \"jkl\";\n public static final String NEW_TITLE = \"newT... | import android.databinding.Observable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.concurrent.Executo... | /*
* Copyright 2015 Fabio Collini.
*
* 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 agre... | viewModel.onResult(Navigator.OPEN_DETAIL, new ActivityResult(true, TestData.note1("abc"))); | 6 |
cattaka/AdapterToolbox | example/src/main/java/net/cattaka/android/adaptertoolbox/example/NestedScrambleAdapterExampleActivity.java | [
"public class ScrambleAdapter<T> extends AbsScrambleAdapter<\n ScrambleAdapter<T>,\n ScrambleAdapter<?>,\n RecyclerView.ViewHolder,\n ForwardingListener<ScrambleAdapter<?>, RecyclerView.ViewHolder>,\n T\n > {\n private Context mContext;\n private List<T> mItems;\n\n ... | import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import net.cattaka.android.a... | package net.cattaka.android.adaptertoolbox.example;
/**
* Created by cattaka on 16/05/02.
*/
public class NestedScrambleAdapterExampleActivity extends AppCompatActivity {
ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder> mListenerRelay = new ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder>... | NestedScrambleInfo item = new NestedScrambleInfo( | 6 |
narrowtux/Showcase | src/main/java/com/narrowtux/showcase/types/InfiniteShowcaseExtra.java | [
"public class Metrics {\n\n /**\n * The current revision number\n */\n private final static int REVISION = 5;\n\n /**\n * The base url of the metrics domain\n */\n private static final String BASE_URL = \"http://metrics.griefcraft.com\";\n\n /**\n * The url used to report a server... | import com.narrowtux.showcase.Metrics;
import com.narrowtux.showcase.Showcase;
import com.narrowtux.showcase.ShowcaseExtra;
import com.narrowtux.showcase.ShowcaseItem;
import com.narrowtux.showcase.ShowcasePlayer; | /*
* Copyright (C) 2011 Moritz Schmale <narrow.m@gmail.com>
*
* Showcase is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... | private ShowcaseItem showcase = null; | 3 |
baloise/egitblit | com.baloise.egitblit.plugin/src/com/baloise/egitblit/view/StyledLabelProvider.java | [
"public class GitBlitRepository{\n\tpublic static final String\tGROUP_MAIN\t\t\t\t= \"main\";\n\n\t// --- Gitblit repository attriburtes\n\tpublic String\t\t\t\tname;\n\tpublic String\t\t\t\tdescription;\n\tpublic List<String>\t\t\towners\t\t\t\t\t= new ArrayList<String>();\n\tpublic Date\t\t\t\t\tlastChange;\n\tpu... | import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.jface.viewers.StyledCellLabelProvider;
import org.eclipse.jface.viewers.StyledStri... | package com.baloise.egitblit.view;
/**
* Preparing ofe repo true/table labels and its decorations
*
* @author MicBag
*
*/
public class StyledLabelProvider extends StyledCellLabelProvider implements RepoLabelProvider{
private TreeViewer viewer;
private boolean decorateLabels = false;
p... | if(element instanceof GitBlitViewModel == true){
| 3 |
hhaslam11/Text-Fighter | src/com/hotmail/kalebmarc/textfighter/item/Chest.java | [
"public class Food {\n\n //Food List\n public static final ArrayList<Food> arrayFood = new ArrayList<>();\n public static int totalEaten;\n private String name;\n private String desc;\n private int quantity = 1;//TODO change to not have a default value once done testing\n private StatusEffect.t... | import com.hotmail.kalebmarc.textfighter.main.Food;
import com.hotmail.kalebmarc.textfighter.main.Ui;
import com.hotmail.kalebmarc.textfighter.main.Weapon;
import com.hotmail.kalebmarc.textfighter.player.Coins;
import com.hotmail.kalebmarc.textfighter.player.Potion; | package com.hotmail.kalebmarc.textfighter.item;
public class Chest {
private Chest() {
}
public static void view() {
Ui.cls();
Ui.println("------------------------------");
Ui.println(" Item Chest ");
Ui.println();
Ui.println("First-Aid kits: " +... | Ui.println(" Survival: " + Potion.get("survival")); | 4 |
hnakagawa/proton | Proton/src/main/java/proton/inject/Proton.java | [
"public static <T> T checkNotNull(T obj, String msg) {\n if (obj == null)\n throw new IllegalStateException(msg);\n return obj;\n}",
"public static void checkState(boolean state, String msg) {\n if (!state)\n throw new IllegalStateException(msg);\n}",
"public class Bindings {\n private... | import static proton.inject.util.Validator.checkNotNull;
import static proton.inject.util.Validator.checkState;
import java.util.Map;
import java.util.WeakHashMap;
import proton.inject.binding.Bindings;
import proton.inject.internal.InjectorImpl;
import proton.inject.listener.FieldListeners;
import proton.inject.listen... | package proton.inject;
public final class Proton {
private static Map<Context, InjectorImpl> sInjectors; | private static Bindings sBindings; | 2 |
florent37/OCiney | app/src/main/java/com/bdc/ociney/fragment/ListMoviesFragment.java | [
"public class AppFragmentActivity extends BaseActivity implements View.OnClickListener, ActionBar.OnNavigationListener, LoadListStarTask.LoadListStarTaskCallBack {\n\n private static final int POSITION_NOW_SHOWING = 0;\n private static final int POSITION_COMMING_SOON = 1;\n\n public static String actionBar... | import android.app.ActivityOptions;
import android.content.Intent;
import android.graphics.Rect;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.... | package com.bdc.ociney.fragment;
public class ListMoviesFragment extends BaseFragment implements AbsListView.OnScrollListener, LoadMoviesFavorisTask.LoadMoviesFavorisTaskCallBack, AdapterView.OnItemClickListener, ObjectAdapter.ObjectAdapterLoadMore, SearchMoviesTask.SearchMoviesTaskCallBack, LoadMoviesTask.LoadMov... | Intent intent = new Intent(getActivity(), MovieActivity.class); | 1 |
apache/commons-cli | src/test/java/org/apache/commons/cli/bug/BugCLI133Test.java | [
"public class CommandLine implements Serializable {\n /**\n * A nested builder class to create {@code CommandLine} instance using descriptive methods.\n *\n * @since 1.4\n */\n public static final class Builder {\n /**\n * CommandLine that is being build by this Builder.\n ... | import static org.junit.Assert.assertFalse;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.junit.Test; | /*
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 u... | final Option optionA = new Option("a", "first"); | 1 |
CyclopsMC/ColossalChests | src/main/java/org/cyclops/colossalchests/tileentity/TileColossalChest.java | [
"public class GeneralConfig extends DummyConfig {\n\n @ConfigurableProperty(category = \"core\", comment = \"If the recipe loader should crash when finding invalid recipes.\", requiresMcRestart = true, configLocation = ModConfig.Type.SERVER)\n public static boolean crashOnInvalidRecipe = false;\n\n @Config... | import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import lombok.experimental.Delegate;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.IName... | public void closeInventory(PlayerEntity entityPlayer) {
if (!entityPlayer.isSpectator()) {
super.closeInventory(entityPlayer);
triggerPlayerUsageChange(-1);
}
}
} : new LargeInventory(calculateInventorySize(), 64);
... | if (player.openContainer instanceof ContainerColossalChest) { | 4 |
gwidgets/gwty-leaflet | src/test/java/com/gwidgets/leaflet/test/PathTest.java | [
"@JsType(isNative = true)\npublic class Circle extends CircleMarker {\n\t\n\t\n\t\n\n\t/**\n\t * <p>Constructor for Circle.</p>\n\t */\n\tprotected Circle() {\n\t\tsuper();\n\t\t\n\t\t\n\t}\n\n\n\t\n\n}",
"@JsType(isNative = true, namespace = JsPackage.GLOBAL)\npublic class L {\n\t\n\t\n\t\n\n\n\tprivate L() {\n... | import java.util.ArrayList;
import java.util.List;
import com.gwidgets.api.leaflet.Circle;
import com.gwidgets.api.leaflet.L;
import com.gwidgets.api.leaflet.LatLng;
import com.gwidgets.api.leaflet.Polygon;
import com.gwidgets.api.leaflet.Polyline;
import com.gwidgets.api.leaflet.Rectangle;
import com.gwidgets.api.leaf... | package com.gwidgets.leaflet.test;
public class PathTest extends GwtyLeafletTestCase {
public void testPolyline(){
InjectedLeafletResources.whenReady((e) -> {
List<LatLng> coordinates = new ArrayList<LatLng>();
coordinates.add(L.latLng(52.51, 13.37));
coordinates.add(L.latLng(52.5095, 13.... | Rectangle rect = L.rectangle(L.latLngBounds(L.latLng(52.5139, 13.34), L.latLng(54.51, -3.045)), null); | 5 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/gui/resources/ResourceManager.java | [
"public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}",
"@Mod(\n modid = MineDroid.MODID,\n version = MineDroid.VERSION,\n guiFactory = \"com.onkiup.minedroid.config.GuiFactory\"\n)\npublic class MineDroid extends Modification {\n public static... | import com.onkiup.minedroid.Context;
import com.onkiup.minedroid.MineDroid;
import com.onkiup.minedroid.Modification;
import com.onkiup.minedroid.gui.GuiManager;
import com.onkiup.minedroid.gui.XmlHelper;
import com.onkiup.minedroid.gui.drawables.BitmapDrawable;
import com.onkiup.minedroid.gui.drawables.Drawable;
impor... | package com.onkiup.minedroid.gui.resources;
public class ResourceManager {
@SidedProxy(clientSide = "com.onkiup.minedroid.gui.resources.ClientEnvResolver", serverSide = "com.onkiup.minedroid.gui.resources.ServerEnvResolver")
protected static EnvResolver envResolver;
public static Object get(Context ctx... | public static View inflateLayout(Context context, ResourceLocation source, Style theme) { | 8 |
bitstorm/Wicket-rest-annotations | restannotations/src/test/java/org/wicketstuff/rest/resource/MultiFormatRestResource.java | [
"public class Person{\n\tprivate String name;\n\tprivate String surname;\n\tprivate String email;\n\t\n\tpublic Person(){}\n\t\n\tpublic Person(String name, String surname, String email) {\n\t\tthis.name = name;\n\t\tthis.surname = surname;\n\t\tthis.email = email;\n\t}\n\t\n\tpublic String getName() {\n\t\treturn ... | import org.apache.wicket.authroles.authorization.strategies.role.IRoleCheckingStrategy;
import org.wicketstuff.rest.Person;
import org.wicketstuff.rest.annotations.MethodMapping;
import org.wicketstuff.rest.contenthandling.RestMimeTypes;
import org.wicketstuff.rest.contenthandling.serialdeserial.MultiFormatSerialDeseri... | /**
* 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"); yo... | @MethodMapping(value = "/person", produces = RestMimeTypes.APPLICATION_XML) | 1 |
operator1/op1 | op1/src/main/java/com/op1/aiff/ApplicationChunk.java | [
"public interface Chunk {\n\n /**\n * Returns the ID of this chunk.\n */\n ID getChunkID();\n\n /**\n * Returns the size in bytes of the data portion of the chunk. The count does not include the 8 bytes used by the\n * chunk ID and chunk size. Also, please note, when the data portion of a c... | import com.op1.iff.Chunk;
import com.op1.iff.IffReader;
import com.op1.iff.types.ID;
import com.op1.iff.types.OSType;
import com.op1.iff.types.SignedChar;
import com.op1.iff.types.SignedLong;
import com.op1.util.Check;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Lis... | package com.op1.aiff;
public class ApplicationChunk implements Chunk {
private final ID chunkId = ChunkType.APPLICATION.getChunkId(); // 4 bytes
private SignedLong chunkSize; // 4 bytes | private OSType applicationSignature; // 4 bytes | 3 |
ordina-jworks/microservices-dashboard | microservices-dashboard-server-core/src/test/java/be/ordina/msdashboard/api/CatalogControllerTests.java | [
"public final class ApplicationInstance {\n\n\tprivate List<ApplicationEvent> changes = new ArrayList<>();\n\n\tprivate final String id;\n\tprivate final String application;\n\tprivate final URI baseUri;\n\tprivate State state;\n\tprivate Status healthStatus = Status.UNKNOWN;\n\tprivate Links actuatorEndpoints = ne... | import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.verify;
import static org.mockito.BDDMockito.when;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMoc... | /*
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | Catalog catalog = CatalogMother.catalogWith(Collections.singletonList(applicationInstance)); | 2 |
arquillian/arquillian-algeron | pact/provider/core/src/main/java/org/arquillian/algeron/pact/provider/core/httptarget/HttpTarget.java | [
"public class SystemPropertyResolver {\n public String resolveValue(final String property) {\n PropertyValueTuple tuple = new PropertyValueTuple(property).invoke();\n String propertyValue = System.getProperty(tuple.getPropertyName());\n if (propertyValue == null) {\n propertyValue... | import au.com.dius.pact.model.RequestResponseInteraction;
import au.com.dius.pact.provider.ConsumerInfo;
import au.com.dius.pact.provider.HttpClientFactory;
import au.com.dius.pact.provider.ProviderClient;
import au.com.dius.pact.provider.ProviderInfo;
import au.com.dius.pact.provider.ProviderVerifier;
import au.com.di... | * @param url
* url of the tested service
* @param insecure
* true if certificates should be ignored
*/
public HttpTarget(final URL url, final boolean insecure) {
this(url.getProtocol() == null ? "http" : url.getProtocol(),
url.getHost(),
url.getPort()... | return injector.inject(new ArquillianVerifierReporter()); | 1 |
Archistar/archistar-smc | src/main/java/at/archistar/crypto/ShamirEngine.java | [
"public class ReconstructionResult {\n\n private final byte[] data;\n private final boolean okay;\n private final List<String> errors;\n\n @SuppressFBWarnings(\"EI_EXPOSE_REP2\")\n public ReconstructionResult(byte[] data) {\n this.data = data;\n this.okay = true;\n this.errors = ... | import at.archistar.crypto.data.ReconstructionResult;
import at.archistar.crypto.data.Share;
import at.archistar.crypto.decode.DecoderFactory;
import at.archistar.crypto.decode.ErasureDecoderFactory;
import at.archistar.crypto.random.BCDigestRandomSource;
import at.archistar.crypto.random.RandomSource;
import at.archis... | package at.archistar.crypto;
public class ShamirEngine implements CryptoEngine {
private final int n;
private final int k;
private final ShamirPSS engine;
public ShamirEngine(int n, int k) throws WeakSecurityException { | this(n, k, new BCDigestRandomSource()); | 3 |
sing-group/bicycle | src/test/java/es/cnio/bioinfo/bicycle/testsimulated/SimulatedNonDirectionalPairedDataAnalysisTest.java | [
"public class Project {\n\n\tprivate static final Logger logger = Logger.getLogger(Project.class.getSimpleName());\n\n\tpublic static final String WORKING_DIRECTORY = \"workingDirectory\" + File.separator;\n\tpublic static final String OUTPUT_DIRECTORY = \"output\" + File.separator;\n\tpublic static final String CO... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.P... | /*
Copyright 2012 Daniel Gonzalez Peña, Osvaldo Graña
This file is part of the bicycle Project.
bicycle Project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | BowtieAlignment ba = new BowtieAlignment(p); | 3 |
Trolldad/Reddit-Headlines | Reddit Headlines for DashClock/src/main/java/net/trolldad/dashclock/redditheadlines/fragment/PrefsFragment.java | [
"@EApplication\npublic class RedditHeadlinesApplication extends Application {\n public static final String TAG = \"RedditHeadlinesApplication\";\n private static RedditHeadlinesApplication mInstance;\n\n @Override\n public void onCreate() {\n super.onCreate();\n EasyTracker.getInstance(thi... | import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceManager;
import android.util.Log;
import android.view.View;
import com.squareup.otto.Subscribe;
import net.trolldad.dashclock.reddit... | package net.trolldad.dashclock.redditheadlines.fragment;
/**
* Created by jacob-tabak on 1/25/14.
*/
@EFragment
public class PrefsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Pref
MyPrefs_ mPrefs;
@Bean | RedditClient mRedditClient; | 4 |
johanneslerch/FlowTwist | FlowTwist/test/flow/twist/test/unit/ForwardsFromCallablesPathTests.java | [
"public static UnitSelector unitByLabel(final String label) {\n\treturn new UnitSelector() {\n\t\t@Override\n\t\tpublic boolean matches(SootMethod method, Unit unit) {\n\t\t\treturn unit.toString().contains(label);\n\t\t}\n\n\t\t@Override\n\t\tpublic String toString() {\n\t\t\treturn label;\n\t\t}\n\t};\n}",
"pub... | import static flow.twist.config.AnalysisConfigurationBuilder.forwardsFromAllParametersDefaults;
import static flow.twist.test.util.selectors.UnitSelectorFactory.unitByLabel;
import static flow.twist.test.util.selectors.UnitSelectorFactory.unitInMethod;
import java.util.Set;
import org.junit.Test;
import flow.twist.Solv... | package flow.twist.test.unit;
public class ForwardsFromCallablesPathTests extends AbstractPathTests {
@Override | protected AnalysisGraphVerifier executeTaintAnalysis(String[] classNames) { | 4 |
wso2-extensions/identity-outbound-auth-samlsso | components/org.wso2.carbon.identity.application.authenticator.samlsso/src/main/java/org/wso2/carbon/identity/application/authenticator/samlsso/logout/validators/LogoutRequestValidator.java | [
"public class SAMLMessageContext<T1 extends Serializable, T2 extends Serializable> extends IdentityMessageContext {\n\n private String acsUrl;\n private String response;\n private String sessionID;\n private String idpSessionID;\n private String tenantDomain;\n private Boolean validStatus;\n pr... | import java.util.List;
import java.util.function.Consumer;
import static org.wso2.carbon.identity.application.authenticator.samlsso.util.SSOConstants.ISSUER_FORMAT;
import static org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants.Authenticator.
SAML2SSO.IS_LOGOUT_REQ_SIGNED;
import or... | /*
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. 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/li... | !(ISSUER_FORMAT.equals(logoutRequest.getIssuer().getFormat()))) { | 5 |
JessYanCoding/MVPArt | art/src/main/java/me/jessyan/art/di/module/AppModule.java | [
"@Singleton\n@Component(modules = {AppModule.class, ClientModule.class, GlobalConfigModule.class})\npublic interface AppComponent {\n Application application();\n\n /**\n * 用于管理所有 {@link Activity}\n * 之前 {@link AppManager} 使用 Dagger 保证单例, 只能使用 {@link AppComponent#appManager()} 访问\n * 现在直接将 AppMana... | import android.app.Application;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.ArrayList;
import java.util.List;
import... | /*
* Copyright 2017 JessYan
*
* 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 ... | static AppManager provideAppManager(Application application) { | 2 |
mthli/Tweetin | Tweetin/src/io/github/mthli/Tweetin/Fragment/TweetList/MentionFragment.java | [
"public class FlagUnit {\n public static final int COLOR_BLUE = 0;\n public static final int COLOR_ORANGE = 1;\n public static final int COLOR_PINK = 2;\n public static final int COLOR_PURPLE = 3;\n public static final int COLOR_TEAL = 4;\n\n public static final int IN_TIMELINE_FRAGMENT = 0;\n ... | import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AdapterView;
import io.github.mthli.Tweetin.Flag.FlagUnit;
import io.github.mthli.Tweetin.Fragment.Base.ListFragment;
import io.g... | package io.github.mthli.Tweetin.Fragment.TweetList;
public class MentionFragment extends ListFragment {
private TweetAdapter tweetAdapter;
public TweetAdapter getTweetAdapter() {
return tweetAdapter;
}
private List<Tweet> tweetList = new ArrayList<Tweet>();
public List<Tweet> getTweetLis... | private MentionMoreTask mentionMoreTask; | 3 |
jfschaefer/layeredgraphlayout | src/main/java/de/jfschaefer/layeredgraphlayout/lgraph/LGraph.java | [
"public class Node<V, E> {\n protected V originalNode;\n protected double width, height;\n protected Set<Edge<V, E>> outgoingEdges;\n protected Set<Edge<V, E>> ingoingEdges;\n\n public Node(V original, double width, double height) {\n originalNode = original;\n this.width = width;\n ... | import de.jfschaefer.layeredgraphlayout.Node;
import de.jfschaefer.layeredgraphlayout.Edge;
import de.jfschaefer.layeredgraphlayout.layout.Layout;
import de.jfschaefer.layeredgraphlayout.layout.LayoutConfig;
import de.jfschaefer.layeredgraphlayout.layout.Point;
import de.jfschaefer.layeredgraphlayout.util.Pair;
import ... | package de.jfschaefer.layeredgraphlayout.lgraph;
/**
* Created by jfschaefer on 7/31/15.
*/
public class LGraph<V, E> {
protected int numberOfLayers;
protected ArrayList<Layer> layers;
protected Map<Node<V, E>, LNode> nodeMap; | protected Map<Edge<V, E>, ArrayList<LNode>> edgeMap; | 1 |
legobmw99/Allomancy | src/main/java/com/legobmw99/allomancy/datagen/BlockStates.java | [
"@Mod(Allomancy.MODID)\npublic class Allomancy {\n\n public static final String MODID = \"allomancy\";\n public static final CreativeModeTab allomancy_group = new CreativeModeTab(MODID) {\n @Override\n public ItemStack makeIcon() {\n return new ItemStack(CombatSetup.MISTCLOAK.get());\... | import com.legobmw99.allomancy.Allomancy;
import com.legobmw99.allomancy.modules.extras.ExtrasSetup;
import com.legobmw99.allomancy.modules.extras.block.IronButtonBlock;
import com.legobmw99.allomancy.modules.extras.block.IronLeverBlock;
import com.legobmw99.allomancy.modules.materials.MaterialsSetup;
import net.minecr... | package com.legobmw99.allomancy.datagen;
public class BlockStates extends BlockStateProvider {
public BlockStates(DataGenerator gen, String modid, ExistingFileHelper exFileHelper) {
super(gen, modid, exFileHelper);
}
@Override
protected void registerStatesAndModels() {
for (var rblo... | for (Boolean powered : IronButtonBlock.POWERED.getPossibleValues()) { | 2 |
kkung/kakao-android-sdk-standalone | templates/loginbase-template/src/com/kakao/template/loginbase/SampleSignupActivity.java | [
"public class APIErrorResult {\n /**\n * 에러를 일으킨 요청 URL\n */\n private String requestURL;\n // {@link com.kakao.helper.ServerProtocol.ERROR_CODE_KEY}와 같은 변수 이름 유지. for jackson parsing\n /**\n * 숫자로 구성된 에러 코드\n */\n protected int errorCode;\n\n //{@link com.kakao.helper.ServerProtoc... | import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import com.kakao.APIErrorResult;
import com.kakao.MeResponseCallback;
import com.kakao.UserManagement;
import com.kakao.UserProfile;
import com.kakao.helper.Logger; | /**
* Copyright 2014 Kakao Corp.
*
* Redistribution and modification in source or binary forms are not permitted without specific prior written permission.
*
* 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 co... | protected void onSessionClosedFailure(final APIErrorResult errorResult) { | 0 |
RepreZen/KaiZen-OpenAPI-Editor | com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/assist/JsonReferenceProposalProvider.java | [
"public class ContextTypeCollection {\n\n private final Iterable<ContextType> contextTypes;\n\n protected ContextTypeCollection(Iterable<ContextType> contextTypes) {\n this.contextTypes = contextTypes;\n }\n\n public ContextType get(Model model, JsonPointer pointer) {\n for (ContextType ne... | import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import com.fasterxml.jackson.core.JsonPointer;
import com.reprezen.swagedit.core.assist.contexts.ContextType;
import com.reprezen.swagedit.core.assist.contexts.... | /*******************************************************************************
* Copyright (c) 2016 ModelSolv, Inc. 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 a... | final SwaggerFileFinder fileFinder = new SwaggerFileFinder(fileContentType); | 5 |
chenzj-king/RvHelper | demo/src/main/java/com/dreamliner/lib/rvhelper/sample/ui/activity/customempty/CustomEmptyActivity.java | [
"public class AppContext extends Application {\n\n private static AppContext mInstance;\n\n private boolean isDebug;\n\n public static AppContext getInstance() {\n return mInstance;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n mInstance = this;\n i... | import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.dreamliner.lib.rvhelper.sample.AppContext;
import com.dreamliner.lib.rvhelper.sample.R;
import com.dreamliner.lib.rvhelper.sample.ui.adapter.TextAdapter;
import com.dreamliner.lib.rvhelper.sample.ui.base.BaseActivity;
import co... | package com.dreamliner.lib.rvhelper.sample.ui.activity.customempty;
/**
* @author chenzj
* @Title: CustomEmptyActivity
* @Description: 类的描述 -
* @date 2016/10/11 9:42
* @email admin@chenzhongjin.cn
*/
public class CustomEmptyActivity extends BaseActivity implements OnRefreshListener, View.OnClickListener {
... | mOptimumRecyclerView.addItemDecoration(DividerUtil.getDefalutDivider(AppContext.getInstance())); | 3 |
hprose/hprose-j2me | cldc/1.1ext/src/hprose/client/HproseClient.java | [
"public interface HproseCallback {\r\n void handler(Object result, Object[] arguments);\r\n}\r",
"public interface HproseInvoker {\r\n void invoke(String functionName, HproseCallback callback);\r\n void invoke(String functionName, HproseCallback callback, HproseErrorEvent errorEvent);\r\n void invoke(... | import java.io.OutputStream;
import hprose.common.HproseErrorEvent;
import hprose.common.HproseCallback;
import hprose.common.HproseInvoker;
import hprose.common.HproseException;
import hprose.common.HproseResultMode;
import hprose.common.HproseFilter;
import hprose.io.HproseWriter;
import hprose.io.HproseReade... | invoke(functionName, nullArgs, callback, errorEvent, returnType, false, HproseResultMode.Normal);
}
public final void invoke(String functionName, Object[] arguments, HproseCallback callback, Class returnType) {
invoke(functionName, arguments, callback, null, returnType, false, HproseResultMod... | (char) HproseTags.TagResult + "" +
| 7 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/Simplest_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import org.apache.jena.rdf.model.ModelFactory;
import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.ap... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* 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... | Iterator<PredicateMap> pmit=pom.getPredicateMaps().iterator();
| 4 |
eurohlam/rss2kindle | rss-2-kindle-web-test/src/test/java/org/roag/web/SubscriberDetailsPageTest.java | [
"public class LifecycleTestExtension implements BeforeAllCallback, BeforeEachCallback, AfterEachCallback, AfterAllCallback {\n\n @Override\n public void beforeAll(ExtensionContext extensionContext) throws Exception {\n //we ignore error message here that such user already exists\n to(SignUpPage.... | import com.codeborne.selenide.Condition;
import com.github.javafaker.Faker;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.roag.junit.LifecycleTestExtension;
import org.roag.pages.ProfilePage;
i... | package org.roag.web;
@ExtendWith(LifecycleTestExtension.class)
@DisplayName("Subscriptions operations tests")
@Tag("SUBSCRIBERS")
@Tag("SUBSCRIPTIONS")
public class SubscriberDetailsPageTest {
private Faker faker = new Faker();
@Test
@DisplayName("Test operations with subscriptions: activate, deactiva... | at(SubscribersPage.class) | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.