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 |
|---|---|---|---|---|---|---|
ra4king/LWJGL-OpenGL-Tutorials | src/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example2/Example8_2.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.math.Matrix4;
import com.ra4king.opengl.util.math.M... | package com.ra4king.opengl.arcsynthesis.gl33.chapter8.example2;
public class Example8_2 extends GLProgram {
public static void main(String[] args) {
new Example8_2().run(true);
}
private ShaderProgram program;
private int modelToClipMatrixUniform;
private int cameraToClipMatrixUniform;
pri... | private Quaternion orientation;
| 5 |
aponom84/MetrizedSmallWorld | src/main/java/org/latna/msw/evaluation/DimensionalityTest.java | [
"public abstract class MetricElement {\n private final List<MetricElement> friends;\n\n public MetricElement() {\n friends = Collections.synchronizedList(new ArrayList());\n }\n \n /**\n * Calculate metric between current object and another.\n * @param gme any element for whose metric ... | import org.latna.msw.MetricElement;
import org.latna.msw.SearchResult;
import org.latna.msw.TestLib;
import org.latna.msw.EvaluatedElement;
import org.latna.msw.MetrizedSmallWorld;
import org.latna.msw.AbstractMetricStructure;
import org.latna.msw.TestResult;
import org.latna.msw.euclidian.EuclidianFactory;
import java... | package org.latna.msw.evaluation;
/**
*
* @author Alexander Ponomarenko aponom84@gmail.com
*/
public class DimensionalityTest {
public static final int NUMBER_OF_THREADS = 12;
public static final String outFileName = "dimText.txt";
/**
* Scans input string and runs the test
* @param args the... | EuclidianFactory ef = new EuclidianFactory(dimensionality, checkPoints[stageNumber]-db.getSize()); | 7 |
matrixcloud/SimpleReader | src/com/dreamteam/app/adapter/CategoryDetailAdapter.java | [
"public class SectionHelper\r\n{\r\n\t\r\n\tpublic static void removeRecord(SQLiteDatabase db, String url)\r\n\t{\r\n\t\tdb.delete(DbConstant.SECTION_TABLE_NAME, \"url=?\", new String[]{url});\r\n\t\tdb.close();\r\n\t}\r\n\t\r\n\tpublic static void insert(SQLiteDatabase db, String tableName, String title, String ur... | import java.util.ArrayList;
import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import andro... | package com.dreamteam.app.adapter;
/**
* @description TODO
* @author zcloud
* @date 2013/11/14
*/
public class CategoryDetailAdapter extends BaseAdapter
{
public static final String tag = "CategoryDetailAdapter";
private LayoutInflater inflater;
private Context context;
private ArrayList<Feed> feeds;
priva... | intent.setAction(Main.ACTION_DELETE_SECTION); | 4 |
nikkiii/java-webserver | src/org/nikki/http/fastcgi/FastCGIRequest.java | [
"public static final int FCGI_BEGIN_REQUEST = 1;",
"public static final int FCGI_KEEP_CONN = 1;",
"public static final int FCGI_PARAMS = 4;",
"public static final int FCGI_RESPONDER = 1;",
"public static final int FCGI_STDIN = 5;",
"public static final int FCGI_VERSION = 1;",
"public class HttpServer {\... | import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.nikki.http.HttpServer;
import org.nikki.http.net.HttpSession;
import static org.nikki.http.fastcgi.FastCGIConstants.FCGI_BEGIN_REQUEST;
import static org... | /**
* JavaHttpd, the flexible Java webserver
* Copyright (C) 2012 Nikki <nikki@nikkii.us>
*
* 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
* (at your ... | buffer.writeByte(FCGI_KEEP_CONN); | 1 |
Hevelian/hevelian-olastic | olastic-core/src/test/java/com/hevelian/olastic/core/api/uri/queryoption/expression/ElasticSearchExpressionRelationsTest.java | [
"public static void checkFilterGrandChildEqualsQuery(String query, String field, String value,\n String child, String grandChild) {\n JSONObject childObj = new JSONObject(query).getJSONObject(\"has_child\");\n String childType = (String) childObj.get(\"type\");\n assertEquals(child, childType);\n ... | import static com.hevelian.olastic.core.TestUtils.checkFilterGrandChildEqualsQuery;
import static com.hevelian.olastic.core.TestUtils.checkFilterGrandParentEqualsQuery;
import static com.hevelian.olastic.core.TestUtils.checkFilterParentEqualsQuery;
import static org.junit.Assert.assertEquals;
import static org.junit.As... | String rawODataPath = "/book";
String rawQueryPath = "$filter=info/pages/any(p:p/words/any(w:w eq 'w') and p/pageName eq 'page name')";
UriInfo uriInfo = buildUriInfo(defaultMetadata, defaultOData, rawODataPath, rawQueryPath);
ExpressionMember result = uriInfo.getFilterOption().getExpres... | checkFilterGrandParentEqualsQuery(query, field, value, "book", "author", "term", "value"); | 1 |
jenkinsci/github-plugin | src/test/java/org/jenkinsci/plugins/github/migration/MigratorTest.java | [
"@Deprecated\npublic class Credential {\n @SuppressWarnings(\"visibilitymodifier\")\n public final transient String username;\n @SuppressWarnings(\"visibilitymodifier\")\n public final transient String apiUrl;\n @SuppressWarnings(\"visibilitymodifier\")\n public final transient String oauthAccessT... | import com.cloudbees.jenkins.Credential;
import com.cloudbees.jenkins.GitHubPushTrigger;
import com.cloudbees.jenkins.GitHubWebHook;
import hudson.model.FreeStyleProject;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.github.GitHubPlugin;
import org.jenkinsci.plugins.github.config.GitHubServerConfig;
import... | package org.jenkinsci.plugins.github.migration;
/**
* @author lanwen (Merkushev Kirill)
*/
public class MigratorTest {
@Rule
public JenkinsRule jenkins = new JenkinsRule();
public static final String HOOK_FROM_LOCAL_DATA = "http://some.proxy.example.com/webhook";
public static final String CUSTO... | GitHubPushTrigger trigger = new GitHubPushTrigger(); | 1 |
Gikkman/Java-Twirk | src/test/java/com/gikk/twirk/types/usernotice/TestUsernotice.java | [
"public class TestBiConsumer<T, U> {\n private BiFunction<T,U, Boolean> test;\n private TestResult res;\n\n public TestResult assign(BiFunction<T, U, Boolean> test){\n this.test = test;\n return res = new TestResult();\n }\n\n public void consume(T t, U u){\n if(test != null) {\n... | import com.gikk.twirk.TestBiConsumer;
import com.gikk.twirk.TestResult;
import com.gikk.twirk.enums.USER_TYPE;
import com.gikk.twirk.types.usernotice.subtype.Raid;
import com.gikk.twirk.types.usernotice.subtype.Ritual;
import com.gikk.twirk.types.usernotice.subtype.Subscription;
import com.gikk.twirk.types.usernotice.s... | package com.gikk.twirk.types.usernotice;
public class TestUsernotice {
//***********************************************************
// VARIABLES
//***********************************************************
private static final String SUB = "@badges=subscriber/0;color=#FF69B4;display-name=Gikkman;emotes=;... | assertEquals(SubscriptionPlan.SUB_MID, s.getSubscriptionPlan()); | 7 |
mjedynak/builder-generator-idea-plugin | src/test/java/pl/mjedynak/idea/plugins/builder/action/handler/GenerateBuilderActionHandlerTest.java | [
"public class GoToBuilderAdditionalAction extends AbstractBuilderAdditionalAction {\r\n\r\n private static final String TEXT = \"Go to builder...\";\r\n private static final Icon ICON = IconLoader.getIcon(\"/actions/intentionBulb.png\");\r\n\r\n @NotNull\r\n @Override\r\n public String getText() {\r\... | import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
impo... | package pl.mjedynak.idea.plugins.builder.action.handler;
@RunWith(MockitoJUnitRunner.class)
public class GenerateBuilderActionHandlerTest {
@InjectMocks private GenerateBuilderActionHandler builderActionHandler;
@Mock private BuilderVerifier builderVerifier;
@Mock private BuilderFinder builde... | @Mock private GenerateBuilderPopupListFactory popupListFactory;
| 2 |
dpr-odoo/trainee-om-shop | app/src/main/java/com/odoo/core/orm/OSQLite.java | [
"public class BaseModels {\n public static final String TAG = BaseModels.class.getSimpleName();\n\n public static List<OModel> baseModels(Context context, OUser user) {\n List<OModel> models = new ArrayList<>();\n models.add(new IrModel(context));\n models.add(new ResPartner(context));\n ... | import com.odoo.core.support.addons.OAddon;
import com.odoo.core.support.addons.fragment.IBaseFragment;
import com.odoo.core.utils.OPreferenceManager;
import com.odoo.datas.OConstants;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
impor... | /**
* Odoo, Open Source Management Solution
* Copyright (C) 2012-today Odoo SA (<http:www.odoo.com>)
* <p/>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
... | private OUser mUser = null; | 2 |
Rai220/Telephoto | app/src/main/java/com/rai220/securityalarmbot/prefs/Prefs.java | [
"public enum MdSwitchType implements ICommand {\n ON(\"On\"),\n OFF(\"Off\"),\n AUTO(\"Auto\");\n\n private String name;\n\n MdSwitchType(String name) {\n this.name = name;\n }\n\n @Override\n public String getCommand() {\n return \"/\" + getName().toLowerCase();\n }\n\n ... | import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.pengrad.telegrambot.model.User;
import com.rai220.securityalarmbot.commands.types.MdSwitchType;
import com.rai220.securityalarmbot.commands.types.SensitivityType;
import com.rai220.securityalarmbot.model.TimeStats;
import com.rai220.securityala... | package com.rai220.securityalarmbot.prefs;
/**
* Created by rai220 on 10/14/16.
*/
public class Prefs {
public static final Gson prefsGson = registerDateTime(new GsonBuilder()).create();
/** Пары user-id, user-data */
private Map<Integer, UserPrefs> usersDataById = new HashMap<>();
private Map<I... | public SensitivityType sensitivity = SensitivityType.MEDIUM; | 1 |
witwall/sfntly-java | src/main/java/com/google/typography/font/tools/fontinfo/FontUtils.java | [
"public class Font {\n\n private static final Logger logger =\n Logger.getLogger(Font.class.getCanonicalName());\n\n /**\n * Offsets to specific elements in the underlying data. These offsets are relative to the\n * start of the table or the start of sub-blocks within the table.\n */\n private enum Offs... | import com.google.typography.font.sfntly.Font;
import com.google.typography.font.sfntly.FontFactory;
import com.google.typography.font.sfntly.Tag;
import com.google.typography.font.sfntly.table.Table;
import com.google.typography.font.sfntly.table.core.CMap;
import com.google.typography.font.sfntly.table.core.CMapTable... | /*
* Copyright 2011 Google Inc. 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 of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | public static CMap getUCSCMap(Font font) { | 4 |
awvalenti/bauhinia | coronata/coronata-demos/src/main/java/com/github/awvalenti/bauhinia/coronata/demo1console/ConsoleWithSeparatedObservers.java | [
"public class CoronataBuilder {\n\n\tprivate final CoronataConfig config = new CoronataConfig();\n\n\tprivate CoronataBuilder() {\n\t}\n\n\tpublic static CoronataBuilder beginConfig() {\n\t\treturn new CoronataBuilder();\n\t}\n\n\tpublic CoronataBuilder wiiRemotesExpected(int count) {\n\t\tconfig.setNumberOfWiiRemo... | import com.github.awvalenti.bauhinia.coronata.CoronataBuilder;
import com.github.awvalenti.bauhinia.coronata.CoronataException;
import com.github.awvalenti.bauhinia.coronata.CoronataWiiRemote;
import com.github.awvalenti.bauhinia.coronata.CoronataWiiRemoteButton;
import com.github.awvalenti.bauhinia.coronata.observers.... | package com.github.awvalenti.bauhinia.coronata.demo1console;
public class ConsoleWithSeparatedObservers {
public static void main(String[] args) {
CoronataBuilder.beginConfig()
.onError(new CoronataErrorObserver() {
@Override | public void errorOccurred(CoronataException e) { | 1 |
PioBeat/GravSupport | src/main/java/net/offbeatpioneer/intellij/plugins/grav/editor/strategy/FileEditorStrategy.java | [
"public class GravLangFileEditor implements FileEditor, TableModelListener, BulkFileListener {\n final static String NAME = \"Grav Language Editor\";\n private GravLanguageEditorForm myEditorUI;\n\n private TranslationTableModel model;\n FileEditorStrategy editorStrategy;\n MessageBusConnection conne... | import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.EditorFactory;
import com.intellij.openapi.editor.event.EditorFactoryListener;
import com.inte... | package net.offbeatpioneer.intellij.plugins.grav.editor.strategy;
/**
* This class provides different strategies for handling translations:
* <ul>
* <li>File-based</li>
* <li>Directory-based</li>
* </ul>
* <p>
* Grav supports these two mechanisms for translation management.
* The concrete implementations imp... | List<String> qualifiedKey = GravYAMLUtils.splitKeyAsList(key); | 5 |
msoute/vertx-deploy-tools | vertx-deploy-maven-plugin/src/main/java/nl/jpoint/maven/vertx/utils/DeployUtils.java | [
"public class DeployConfiguration {\n\n /**\n * The maven project version as String (groupId:artifactId:version)\n */\n private String projectVersion;\n /**\n * The configuration target id\n **/\n private String target;\n /**\n * List of hosts to deploy to\n **/\n private f... | import nl.jpoint.maven.vertx.mojo.DeployConfiguration;
import nl.jpoint.maven.vertx.request.DeployApplicationRequest;
import nl.jpoint.maven.vertx.request.DeployArtifactRequest;
import nl.jpoint.maven.vertx.request.DeployConfigRequest;
import nl.jpoint.maven.vertx.request.Request;
import org.apache.maven.artifact.Artif... | package nl.jpoint.maven.vertx.utils;
public class DeployUtils {
public static final String APPLICATION_TYPE = "jar";
public static final String ARTIFACT_TYPE_ZIP = "zip";
public static final String ARTIFACT_TYPE_GZIP = "tar.gz";
public static final String CONFIG_TYPE = "config";
private final Lo... | List<Request> result = createDeployListByType(activeConfiguration, ARTIFACT_TYPE_ZIP).stream().map(dependency -> new DeployArtifactRequest(dependency.getGroupId(), dependency.getArtifactId(), dependency.getVersion(), dependency.getClassifier(), dependency.getType())).collect(Collectors.toList()); | 2 |
sciabarra/AgileSites | api/src/main/java/wcs/java/Template.java | [
"public static AttributeDataImpl attrArray(String name, Object... value) {\n\tAttributeTypeEnum type = AttributeTypeEnum.ARRAY;\n\treturn new AttributeDataImpl(def(name, type), name, type,\n\t\t\t(Object) array2list(value));\n\n}",
"public static AttributeDataImpl attrBlob(String name, BlobObject value) {\n\tAttr... | import static wcs.java.util.Util.attrArray;
import static wcs.java.util.Util.attrBlob;
import static wcs.java.util.Util.attrString;
import static wcs.java.util.Util.attrStruct;
import static wcs.java.util.Util.attrStructKV;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import wcs.java.u... | package wcs.java;
public class Template extends AssetSetup {
public final static char UNSPECIFIED = '\0';
public final static char INTERNAL = 'b';
public final static char STREAMED = 'r';
public final static char EXTERNAL = 'x';
public final static char LAYOUT = 'l';
// private final static Log log = new L... | attrArray( | 0 |
RCasatta/EternityWallAndroid | src/main/java/it/eternitywall/eternitywall/activity/HiddenActivity.java | [
"public class EWApplication extends MultiDexApplication {\n private static final String TAG = \"EWApplication\";\n private EWWalletService ewWalletService;\n private WalletObservable walletObservable;\n private WalletObserver walletObserver;\n private final int SHUTDOWN_AFTER = 30 * 60 * 1000;\n\n ... | import android.app.AlertDialog;
import android.app.DatePickerDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.text.... | AsyncTask t = new AsyncTask() {
boolean success=false;
@Override
protected void onPreExecute() {
super.onPreExecute();
progress.setVisibility(View.VISIBLE);
// 1. Create Transaction
createTx(message);
... | final EWWalletService ewWalletService = ((EWApplication) getApplication()).getEwWalletService(); | 6 |
dumptruckman/ChestRestock | src/main/java/com/dumptruckman/chestrestock/DefaultCRChest.java | [
"public interface CRChest extends Config, CRChestOptions {\n\n /**\n * Constants related to CRChest.\n */\n class Constants {\n\n /**\n * The minimum for max inventory size.\n */\n public static final int MIN_MAX_INVENTORY_SIZE = 54;\n\n private static int MAX_INVE... | import com.dumptruckman.chestrestock.api.CRChest;
import com.dumptruckman.chestrestock.api.CRChestOpenEvent;
import com.dumptruckman.chestrestock.api.CRChestRestockEvent;
import com.dumptruckman.chestrestock.api.CRPlayer;
import com.dumptruckman.chestrestock.api.ChestRestock;
import com.dumptruckman.chestrestock.api.Lo... | package com.dumptruckman.chestrestock;
class DefaultCRChest extends AbstractYamlConfig<CRChest> implements CRChest {
private ChestRestock plugin;
private BlockLocation location;
private Map<String, Inventory> playerInventories = new HashMap<String, Inventory>();
DefaultCRChest(ChestRestock... | ItemStack[] items = InventoryTools.fillWithAir(new ItemStack[CRChest.Constants.getMaxInventorySize()]); | 7 |
serialx/kkma | src/org/snu/ids/ha/ma/MorphemeAnalyzer.java | [
"public class Condition\n\textends Hangul\n{\n\tpublic static final String[] COND_ARR = { \n\t\t\t\"ㅣ겹\", \t\t// 01 ㅣ겹모음 'ㅑ,ㅕ,ㅛ,ㅠ,ㅒ,ㅖ'\n\t\t\t\"모음\", \t\t// 02 마지막 음절이 종성을 가지지 않음\n\t\t\t\"자음\", \t\t// 03 마지막 음절이 종성을 가짐\n\t\t\t\"양성\", \t\t// 04 마지막 음절이 양성 모음\n\t\t\t\"음성\", \t\t// 05 마지막 음절이 음성 모음\n\t\t\t\"사오\", \t\t... | import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import org.snu.ids.ha.constants.Condition;
import org.snu.ids.ha.constants.POSTag;
import org.snu.ids.ha.dic.Dictionary;
import org.snu.ids.ha.dic.SpacingPDDictionary;
import org.snu.ids... | }
tailCutPos = tailStr.length();
// offset 정보를 증가시켜준다.
firstOffset += strHead.length();
}
}
}
// 마지막 결과 저장
if( tailCutPos > 1 ) ret.add(meArr[meArr.length - 1]);
// 마지막 결과가 완결어가 아닌 경우 미등록어도 추가하여 반환
for( int i = 0, stop = ret.size(); i < stop; i++ ) {
MExpression me = ... | if( (mc.cclEnc != Condition.ENG && mc.cclEnc != 0) | 0 |
ibek/issue-keeper | issue-keeper-base/src/main/java/qa/tools/ikeeper/test/IKeeperConnector.java | [
"public class DoNothing implements IAction {\n\n @Override\n public void perform(String testName, List<IssueDetails> details) {\n // Do nothing\n }\n\n}",
"public interface IAction {\n\n void perform(String testName, List<IssueDetails> details);\n\n}",
"public class CacheClient implements ITr... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import qa.tools.ikeeper.action.DoNothing;
import qa.tools.ikeeper.action.IAction;
import qa.tools.ikeeper.client.CacheClient;
import qa.tools.ikeeper.client.ITrackerClient;
import qa.tools.ikeeper.interceptor.DefaultInterceptor;
import qa.tools.ikeeper.intercepto... | package qa.tools.ikeeper.test;
public class IKeeperConnector {
private static final Logger LOG = LoggerFactory.getLogger(IKeeperConnector.class);
protected static final String confPropFileName = "ikeeperConfiguration.properties";
protected static final String envPropFileName = "ikeeperEnvironment.prope... | this(new DefaultInterceptor(loadProjectStates(Arrays.asList(clients))), clients); | 4 |
bafomdad/uniquecrops | com/bafomdad/uniquecrops/crops/Cinderbella.java | [
"public abstract class BlockCropsBase extends BlockCrops {\n\t\n\tprivate EnumCrops type;\n\tprotected boolean extra;\n\tprotected boolean canPlant;\n\tprotected boolean clickHarvest;\n\n\tpublic BlockCropsBase(EnumCrops type, boolean extra, boolean canPlant) {\n\t\t\n\t\tthis.type = type;\n\t\tthis.extra = extra;\... | import java.util.Random;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import n... | package com.bafomdad.uniquecrops.crops;
public class Cinderbella extends BlockCropsBase implements ITileEntityProvider {
public Cinderbella() {
super(EnumCrops.CINDERBELLA, true, UCConfig.cropCinderbella); | GameRegistry.registerTileEntity(TileCinderbella.class, "TileCinderbella"); | 1 |
gen2brain/bukanir | android/src/main/java/com/bukanir/android/activities/MovieActivity.java | [
"public class BukanirClient {\n\n static {\n if(BuildConfig.DEBUG) {\n Bukanir.setVerbose(true);\n }\n }\n\n public static ArrayList<Movie> getTopResults(int category, int limit, int refresh, String cacheDir, int cacheDays, String tpbHost) {\n String result = null;\n ... | import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import andr... | package com.bukanir.android.activities;
public class MovieActivity extends AppCompatActivity {
public static final String TAG = "MovieActivity";
private Movie movie;
private MovieTask movieTask;
private ProgressBar progressBar;
Summary summary;
@Override
protected void onCreate(Bundle... | Tracker tracker = Utils.getTracker(this); | 6 |
google/safe-html-types | types/src/test/java/com/google/common/html/types/UncheckedConversionsTest.java | [
"public static SafeHtml safeHtmlFromStringKnownToSatisfyTypeContract(String html) {\n return new SafeHtml(html);\n}",
"public static SafeScript safeScriptFromStringKnownToSatisfyTypeContract(String script) {\n return new SafeScript(script);\n}",
"public static SafeStyle safeStyleFromStringKnownToSatisfyTypeCo... | import static com.google.common.html.types.UncheckedConversions.safeHtmlFromStringKnownToSatisfyTypeContract;
import static com.google.common.html.types.UncheckedConversions.safeScriptFromStringKnownToSatisfyTypeContract;
import static com.google.common.html.types.UncheckedConversions.safeStyleFromStringKnownToSatisfyT... | /*
* Copyright 2016 Google Inc. 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 of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | safeScriptFromStringKnownToSatisfyTypeContract(script).getSafeScriptString()); | 1 |
nolequen/vertx-prometheus-metrics | src/main/java/io/vertx/ext/prometheus/metrics/TCPPrometheusMetrics.java | [
"public final class BytesCounter {\n private final @NotNull Counter counter;\n private final @NotNull Supplier<String> localAddress;\n\n public BytesCounter(@NotNull String name, @NotNull String localAddress, @NotNull CounterFactory counters) {\n this(name, () -> localAddress, counters);\n }\n\n public Byte... | import io.prometheus.client.CollectorRegistry;
import io.vertx.core.net.SocketAddress;
import io.vertx.core.spi.metrics.TCPMetrics;
import io.vertx.ext.prometheus.metrics.counters.BytesCounter;
import io.vertx.ext.prometheus.metrics.counters.ConnectionGauge;
import io.vertx.ext.prometheus.metrics.counters.ErrorCounter;... | package io.vertx.ext.prometheus.metrics;
public abstract class TCPPrometheusMetrics extends PrometheusMetrics implements TCPMetrics<Void> {
private final @NotNull ConnectionGauge connections;
private final @NotNull BytesCounter bytes;
private final @NotNull ErrorCounter errors;
| protected TCPPrometheusMetrics(@NotNull CollectorRegistry registry, @NotNull String name, @NotNull String localAddress, @NotNull GaugeFactory gauges, @NotNull CounterFactory counters) { | 4 |
hazelcast/spring-data-hazelcast | src/test/java/org/springframework/data/hazelcast/repository/custom/CustomRepoIT.java | [
"public class TestConstants {\n\n public static final String CLIENT_INSTANCE_NAME = \"hazelcast-instance-client\";\n public static final String SERVER_INSTANCE_NAME = \"hazelcast-instance-server\";\n\n public static final String SPRING_TEST_PROFILE_CLIENT_SERVER = \"client-server\";\n public static fina... | import org.junit.Test;
import org.springframework.test.context.ActiveProfiles;
import test.utils.TestConstants;
import test.utils.TestDataHelper;
import test.utils.domain.Movie;
import test.utils.domain.Song;
import test.utils.repository.custom.MovieRepository;
import test.utils.repository.custom.MyTitleRepositoryFacto... | /*
* Copyright (c) 2008-2018, Hazelcast, Inc. 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 of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | private SongRepository songRepository; | 6 |
PvdBerg1998/PNet | src/test/java/nl/pvdberg/pnet/client/util/AutoClientTest.java | [
"public interface Client\n{\n /**\n * Sets the event listener\n * @param clientListener Nullable event listener\n */\n void setClientListener(final PNetListener clientListener);\n\n /**\n * Connects to given host:port\n * @throws IllegalStateException when Client is not closed\n * @... | import nl.pvdberg.pnet.server.util.PlainServer;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import static org.junit.Assert.*;
import nl.pvdberg.pnet.client.Client;
import nl.pvdberg.pnet.event.PNetListener;
import nl.pvd... | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | server = new PlainServer(); | 6 |
qiujuer/OkHttpPacker | sample/src/main/java/net/qiujuer/sample/okhttp/MainActivity.java | [
"public class Http extends HttpCore {\n private static Http mInstance;\n\n private Http() {\n super(new DefaultResolver(), new DefaultRequestBuilder());\n\n OkHttpClient.Builder builder = mOkHttpClient.newBuilder();\n // ConnectTimeOut\n builder.connectTimeout(20 * 1000, TimeUnit.M... | import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.ProgressBar;
import android.widget.Toast;
import net.qiujuer.common.okhttp.Http;
import net.qiujuer.common.okhttp.Util;
import net.qiujuer.common.okhttp.core.HttpCallb... | package net.qiujuer.sample.okhttp;
public class MainActivity extends AppCompatActivity {
private ProgressBar mUpload;
private ProgressBar mDownload;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_... | new StrParam("value1", value1), | 5 |
jklingsporn/vertx-jooq-async | vertx-jooq-async-generate/src/test/java/generated/future/async/vertx/Keys.java | [
"@Generated(\n value = {\n \"http://www.jooq.org\",\n \"jOOQ version:3.10.1\"\n },\n comments = \"This class is generated by jOOQ\"\n)\n@SuppressWarnings({ \"all\", \"unchecked\", \"rawtypes\" })\npublic class Something extends TableImpl<SomethingRecord> {\n\n private static final long ser... | import generated.future.async.vertx.tables.Something;
import generated.future.async.vertx.tables.Somethingcomposite;
import generated.future.async.vertx.tables.Somethingwithoutjson;
import generated.future.async.vertx.tables.records.SomethingRecord;
import generated.future.async.vertx.tables.records.SomethingcompositeR... | /*
* This file is generated by jOOQ.
*/
package generated.future.async.vertx;
/**
* A class modelling foreign key relationships and constraints of tables of
* the <code></code> schema.
*/
@Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.10.1"
},
comments = "This class ... | public static Identity<SomethingRecord, Integer> IDENTITY_SOMETHING = createIdentity(Something.SOMETHING, Something.SOMETHING.SOMEID); | 0 |
Nedelosk/OreRegistry | src/main/java/oreregistry/config/Config.java | [
"@Mod(modid = Constants.MOD_ID, name = Constants.NAME, version = Constants.VERSION, acceptedMinecraftVersions = \"[1.11]\")\npublic class OreRegistry {\n\n\t@Nullable\n\t@Mod.Instance(Constants.MOD_ID)\n\tpublic static OreRegistry instance;\n\n\tpublic static final ResourceRegistry registry;\n\tpublic static final ... | import javax.annotation.Nullable;
import java.io.File;
import java.util.List;
import java.util.Map;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecr... | /*
* Copyright (c) 2017 Nedelosk, Mezz
*
* This work (the MOD) is licensed under the "MIT" License, see LICENSE for details.
*/
package oreregistry.config;
public class Config {
@Nullable
public static Configuration config;
public static boolean unifyItems = true;
public static void load(Sid... | registry.setState(OreRegistryState.CHOOSE); | 3 |
mouton5000/DSTAlgoEvaluation | src/graphTheory/algorithms/steinerProblems/steinerArborescenceApproximation/RoosAlgorithm.java | [
"public class ArcDijkstraOneDestinationAlgorithm extends Algorithm<ArcShortestPathOneDestinationInstance> {\n\n\t/**\n\t * If true, do not compute the shortest paths, but only the costs of the\n\t * shortest paths\n\t */\n\tprotected boolean computeOnlyCosts;\n\n\t/**\n\t * For each node v, this map contains the sh... | import graphTheory.algorithms.shortestDistance.arcCost.ArcDijkstraOneDestinationAlgorithm;
import graphTheory.algorithms.shortestDistance.arcCost.ArcDijkstraOneSourceAlgorithm;
import graphTheory.graph.Arc;
import graphTheory.instances.shortestPath.ArcShortestPathOneDestinationInstance;
import graphTheory.instances.sho... | package graphTheory.algorithms.steinerProblems.steinerArborescenceApproximation;
/**
*
* Implementation of the Roos modified algorithm. Source :
* "FasterDSP: A faster approximation algorithm for directed Steiner tree problem"
* ; by Hsieh, Ming-I et Al.
* <p>
* It is a faster implementation for the Charikar ... | Couple<HashSet<Arc>, HashSet<Integer>> tree = applyCH2(req); | 5 |
PuffOpenSource/Puff-Android | app/src/main/java/sun/bob/leela/ui/activities/DetailActivity.java | [
"public class Account {\r\n\r\n private Long id;\r\n /** Not-null value. */\r\n private String name;\r\n private long type;\r\n private String account;\r\n private String masked_account;\r\n private Boolean hide_name;\r\n private String account_salt;\r\n /** Not-null value. */\r\n priv... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widge... | package sun.bob.leela.ui.activities;
public class DetailActivity extends AppCompatActivity {
private String acct, passwd, addt;
private Account account;
private AppCompatTextView tvTitle, tvAccount, tvPasswd, tvAdditional, tvWebSite, tvLastAccess,
tvWebSiteTitle;
private AppCompatImag... | if (StringUtil.isNullOrEmpty(account.getWebsite())) { | 4 |
marcohc/android-clean-architecture | app/src/main/java/com/marcohc/architecture/app/data/cache/UserCache.java | [
"public class UserEntity implements Entity {\n\n // ************************************************************************************************************************************************************************\n // * Attributes\n // ***************************************************************... | import com.marcohc.architecture.app.BuildConfig;
import com.marcohc.architecture.app.domain.entity.UserEntity;
import com.marcohc.architecture.app.internal.di.ApplicationInjector;
import com.marcohc.architecture.cache.DataCache;
import com.marcohc.architecture.cache.JsonSerializer;
import com.marcohc.architecture.commo... | package com.marcohc.architecture.app.data.cache;
/**
* User mCache which keeps the response from data sources in the android mCache using {@link DualCache}.
*
* @author Marco Hernaiz
* @since 08/08/16
*/
public final class UserCache implements DataCache<List<UserEntity>> {
private static final long CACHE_... | return Parser.parseCollection(jsonStored, new GenericCollection<>(List.class, UserEntity.class)); | 6 |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/network/server/ProxyServerUDPRelay.java | [
"public class IncorrectHeaderException extends Exception {\n\n public IncorrectHeaderException(final String msg) {\n super(msg);\n }\n\n}",
"public enum AddressType {\n IPv4((byte) 0),\n IPv6((byte) 1),\n DOMAIN((byte) 2);\n\n private final byte value;\n\n AddressType(final byte value)... | import com.vecsight.dragonite.proxy.exception.IncorrectHeaderException;
import com.vecsight.dragonite.proxy.header.AddressType;
import com.vecsight.dragonite.proxy.header.udp.ProxyUDPRelayHeader;
import com.vecsight.dragonite.proxy.misc.ProxyGlobalConstants;
import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
impo... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.network.server;
public class ProxyServerUDPRelay {
private static final int PACKET_BUFFER_SIZE = 65536;
private final String clientName;... | remoteAddress = InetAddress.getByName(new String(relayHeader.getAddr(), ProxyGlobalConstants.HEADER_ADDRESS_CHARSET)); | 3 |
MyGrades/mygrades-app | app/src/main/java/de/mygrades/main/MainService.java | [
"public class GradeEntry implements android.os.Parcelable {\n\n /** Not-null value. */\n private String name;\n private Double grade;\n private String examId;\n private String semester;\n private String state;\n private Double creditPoints;\n private String annotation;\n private String at... | import android.content.Intent;
import android.util.Log;
import java.util.HashSet;
import java.util.Set;
import de.mygrades.database.dao.GradeEntry;
import de.mygrades.main.alarm.AlarmReceiver;
import de.mygrades.main.processor.ErrorProcessor;
import de.mygrades.main.processor.GradesProcessor;
import de.mygrades.main.pr... | package de.mygrades.main;
/**
* This service is used to handle ongoing operations in the background.
* It is mostly used for network operations.
*
* The incoming intent must specify two extra integers (PROCESSOR_KEY, METHOD_KEY),
* so the service can decide which processor to create and which method to call.
... | AlarmReceiver.completeWakefulIntent(intent); | 1 |
frekele/elasticsearch-mapping-builder | src/main/java/org/frekele/elasticsearch/mapping/MappingBuilderImpl.java | [
"public enum FieldType {\n\n //###################################################################\n //# [Core datatypes]\n //## String datatypes - (https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html)\n //## - (https://www.elastic.co/guide/en/elasticsearch/referen... | import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.frekele.elasticsearch.mapping.annotations.ElasticBinaryField;
import org.frekele.elasticsearch.mapping.annotations.ElasticBooleanField;
im... | elasticField.boost(), elasticField.includeInAll(), elasticField.index(), elasticField.store());
this.processElasticField(vo, subField);
}
public void processElasticField(DateFieldValue vo, boolean subField) throws IOException {
this.startSuffixName(subField, vo.getSuffixName());
... | throw new MaxRecursiveLevelClassException("Max json level has reached " + MAX_RECURSIVE_LEVEL); | 4 |
vclub/A-Native-TesterHome | app/src/main/java/com/testerhome/nativeandroid/views/MainActivity.java | [
"public class Config {\n\n// recent - 最新\n// popular - 热门的话题(回帖和喜欢超过一定的数量\n// no_reply - 还没有任何回帖的\n// excellent - 精华帖\n// last_actived - 最近活跃的\n\n public static final String TOPICS_TYPE_RECENT = \"recent\";\n public static final String TOPICS_TYPE_POPULAR = \"popular\";\n public static final... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.GravityCompat;
im... | package com.testerhome.nativeandroid.views;
public class MainActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener {
private Fragment homeFragment;
private Fragment jobFragment;
private Fragment topicFragment;
private Fragment myFragment;
@Override
protect... | myFragment = new MyFragment(); | 3 |
daniel-sc/rocketchat-modern-client | src/test/java/com/github/daniel_sc/rocketchat/modern_client/RocketChatClientIT.java | [
"public class Attachment {\n\t\n\t/**\n\t * The color you want the order on the left side to be, any value background-css supports.\n\t */\n\tpublic String color;\n\t\n\t/**\n\t * The text to display for this attachment, it is different than the message’s text.\n\t */\n\tpublic String text;\n\t\n\t/**\n\t * Display... | import com.github.daniel_sc.rocketchat.modern_client.request.Attachment;
import com.github.daniel_sc.rocketchat.modern_client.request.AttachmentField;
import com.github.daniel_sc.rocketchat.modern_client.request.LoginParam;
import com.github.daniel_sc.rocketchat.modern_client.response.ChatMessage;
import com.github.dan... | assertEquals(msgTextModified, receivedModifiedMsg.msg);
assertNotNull(receivedModifiedMsg.editedBy);
assertNotNull(receivedModifiedMsg.editedAt);
assertTrue(receivedModifiedMsg.isModified());
streamDispose.dispose();
assertEquals(Collections.emptyMap(), client.subscripti... | attachment.fields = Collections.singletonList(new AttachmentField("test-field-title", "test-field-value")); | 1 |
flixel-gdx/flixel-gdx-box2d | flixel-gdx-box2d-examples/src/org/flxbox2d/examples/TestGravity.java | [
"public class B2FlxB\n{\n\t/** \n\t * The ratio from meters to pixels. \n\t */\n\tpublic static final float RATIO = 32f;\n\t/**\n\t * The world where the object lives.\n\t */\n\tpublic static World world;\n\t/**\n\t * The contact manager.\n\t */\n\tpublic static B2FlxContactManager contact;\n\t/**\n\t * Let the wor... | import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxText;
import org.flixel.event.IFlxButton;
import org.flxbox2d.B2FlxB;
import org.flxbox2d.collision.shapes.B2FlxBox;
import org.flxbox2d.collision.shapes.B2FlxCircle;
import org.flxbox2d.collision.shapes.B2FlxPolygon;
import org.flxbox2d.controll... | package org.flxbox2d.examples;
/**
*
* @author Ka Wing Chin
*/
public class TestGravity extends PlayState
{
@Override
public void create()
{
super.create();
title.setText("Gravity");
info.setText("Circles aren't affected by the gravity changes.");
B2FlxB.setGravity(0, 0);
final Vector2 gravity = n... | final B2GravityController gc = new B2GravityController(gravity); | 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/internal/SAMLSSOAuthenticatorServiceComponent.java | [
"public class SAMLSSOAuthenticator extends AbstractApplicationAuthenticator\n implements FederatedApplicationAuthenticator {\n\n private static final long serialVersionUID = -8097512332218044859L;\n public static final String AS_REQUEST = \"AS_REQUEST\";\n public static final String AUTHENTICATION_C... | import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.o... | /*
* Copyright (c) 2014, 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.o... | SAMLSSOAuthenticator samlSSOAuthenticator = new SAMLSSOAuthenticator(); | 0 |
ggeorgovassilis/spring-rest-invoker | src/test/java/com/github/ggeorgovassilis/springjsonmapper/integrationtests/AbstractGoogleBooksApiTest.java | [
"public interface BookService {\n\n\tQueryResult findBooksByTitle(String q);\n\n\tItem findBookById(String id);\n\n}",
"@JsonIgnoreProperties(ignoreUnknown = true)\npublic class Item implements Serializable {\n\n\tprivate static final long serialVersionUID = -6854695261165137027L;\n\tString id;\n\tString selfLink... | import com.github.ggeorgovassilis.springjsonmapper.services.BookService;
import com.github.ggeorgovassilis.springjsonmapper.services.Item;
import com.github.ggeorgovassilis.springjsonmapper.services.QueryResult;
import com.github.ggeorgovassilis.springjsonmapper.services.VolumeInfo;
import com.github.ggeorgovassilis.sp... | package com.github.ggeorgovassilis.springjsonmapper.integrationtests;
/**
* Integration test with the google books API using the
* {@link SpringRestInvokerProxyFactoryBean}
*
* @author george georgovassilis
*/
@ExtendWith(SpringExtension.class)
public abstract class AbstractGoogleBooksApiTest {
@Autowired
... | Item item = bookService.findBookById("3h9_GY8v-hgC"); | 1 |
DataAgg/DAFramework | core-service/src/main/java/com/dataagg/commons/controller/FileController.java | [
"@Table(\"sys_file\")\npublic class EFile {\n\t@Id\n\t@Comment(\"主键\")\n\tprivate Long id;\n\n\t@Column(\"name\")\n\t@Comment(\"名称\")\n\t@ColDefine(type = ColType.VARCHAR, width = 100, notNull = true)\n\tprivate String name;\n\n\t@Column(\"path\")\n\t@Comment(\"路径\")\n\t@ColDefine(type = ColType.VARCHAR, width = 20... | import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servl... | package com.dataagg.commons.controller;
/**
* Created by carlos on 2017/3/29.
* 附件管理 controller
*/
@RestController
@RequestMapping("/file")
public class FileController {
private Logger LOG = LoggerFactory.getLogger(FileController.class);
@Autowired
public FileService fileService;
@Autowired
public FileD... | WMap query = queryJs.getQuery(); | 6 |
sTorro/triviazo | src/com/torrosoft/triviazo/core/data/Database.java | [
"public class Question {\n public static final int MAX_ANSWERS = 4;\n\n private String pkid;\n private String statement;\n private String[] answers = new String[MAX_ANSWERS];\n private Integer right; // < MAX_ANSWERS\n private Language lang = Language.es_ES;\n private Difficulty difficulty;\n ... | import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Gdx;
import com.torrosoft.triviazo.core.data.wrappers.Question;
import com.torrosoft.triviazo.core.enums.Difficulty;
import com.torrosoft.triviazo.core.enums.Discipline;
import com.torrosoft.triviazo.core.enums.GameMode;
import com.torrosoft.tri... | execute("INSERT INTO 'ans_que' ('answer', 'question', 'right') VALUES (386, 97, 0);");
execute("INSERT INTO 'ans_que' ('answer', 'question', 'right') VALUES (387, 97, 0);");
execute("INSERT INTO 'ans_que' ('answer', 'question', 'right') VALUES (388, 97, 0);");
execute("INSERT INTO 'quest... | public final List<Question> getQuestions(final Language lang, | 0 |
porscheinformatik/selenium-components | src/main/java/at/porscheinformatik/seleniumcomponents/clarity/ClarityWizardComponent.java | [
"public interface WebElementSelector\n{\n\n /**\n * Creates a selector that always uses the specified element. This selector ignores the {@link SearchContext}.\n *\n * @param description a description for toString, to make it easier to find the specified element. Most-often the\n * des... | import static at.porscheinformatik.seleniumcomponents.WebElementSelector.*;
import at.porscheinformatik.seleniumcomponents.AbstractSeleniumComponent;
import at.porscheinformatik.seleniumcomponents.AnimatedSeleniumComponent;
import at.porscheinformatik.seleniumcomponents.SeleniumComponent;
import at.porscheinformatik.se... | /**
*
*/
package at.porscheinformatik.seleniumcomponents.clarity;
/**
* Implementation of the clarity wizard component. This class is abstract because you create a subclass of it and define
* the concrete implementations of the pages in your subclass.
*
* @author Daniel Furtlehner
*/
public abstract class Cla... | public SeleniumComponentList<ClarityWizardStepnavEntry> getStepNavItems() | 4 |
vbauer/caesar | src/test/java/com/github/vbauer/caesar/basic/BasicRunnerTest.java | [
"public interface CallbackAsync {\n\n void hello(AsyncCallback<String> callback, String name1, String name2);\n\n void hello(AsyncCallback<String> callback, String name);\n\n void emptyHello(AsyncCallback<Void> callback, String name);\n\n void empty(AsyncCallback<Void> callback);\n\n void exception(A... | import com.github.vbauer.caesar.bean.CallbackAsync;
import com.github.vbauer.caesar.bean.FutureAsync;
import com.github.vbauer.caesar.bean.FutureCallbackAsync;
import com.github.vbauer.caesar.bean.ListenableFutureAsync;
import com.github.vbauer.caesar.bean.ObservableAsync;
import com.github.vbauer.caesar.bean.Sync;
imp... | package com.github.vbauer.caesar.basic;
/**
* @author Vladislav Bauer
*/
public abstract class BasicRunnerTest extends BasicTest {
protected static final String PARAMETER = "World";
private final ThreadLocal<ExecutorService> executorServiceHolder = new ThreadLocal<>();
private final ThreadLocal<Sync... | final CallbackAsync callbackAsync = AsyncProxyCreator.create(sync, CallbackAsync.class, executor, false); | 6 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/listeners/Consumes.java | [
"public class ItemHandler {\n\t\n /**\n * Adds a list of lores to the specified ItemStack.\n * \n * @param item - The ItemStack to be modified.\n * @param lores - The list of lores to be added to the item.\n * @return The ItemStack with its newly added lores.\n */\n\tpublic static ItemStack addL... | import me.RockinChaos.itemjoin.item.ItemUtilities;
import me.RockinChaos.itemjoin.utils.SchedulerUtils;
import me.RockinChaos.itemjoin.utils.ServerUtils;
import me.RockinChaos.itemjoin.utils.StringUtils;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit... | /*
* ItemJoin
* Copyright (C) CraftationGaming <https://www.craftationgaming.com/>
*
* This program 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, either version 3 of the License, or
* (at your ... | ItemMap itemMap = ItemUtilities.getUtilities().getItemMap(item, null, player.getWorld()); | 3 |
sandokandias/spring-boot-ddd | src/main/java/com/github/sandokandias/payments/domain/entity/Payment.java | [
"@Value(staticConstructor = \"commandOf\")\npublic class AuthorizePayment implements PaymentCommand {\n private final PaymentId paymentId;\n private final CustomerId customerId;\n private final PaymentMethod paymentMethod;\n private final Transaction transaction;\n private final LocalDateTime timesta... | import com.github.sandokandias.payments.domain.command.AuthorizePayment;
import com.github.sandokandias.payments.domain.command.ConfirmPayment;
import com.github.sandokandias.payments.domain.command.PerformPayment;
import com.github.sandokandias.payments.domain.command.handler.AuthorizePaymentHandler;
import com.github... | package com.github.sandokandias.payments.domain.entity;
public class Payment extends AggregateRoot<Payment, PaymentId> {
public Payment(ApplicationContext applicationContext) {
super(applicationContext, new PaymentId());
}
public Payment(ApplicationContext applicationContext, PaymentId paymentId... | behaviorBuilder.setCommandHandler(ConfirmPayment.class, getHandler(ConfirmPaymentHandler.class)); | 4 |
isel-leic-mpd/mpd-2017-i41d | aula13-json/src/main/java/weather/data/WeatherWebApi.java | [
"public interface IRequest extends AutoCloseable{\n CompletableFuture<Stream<String>> getContent(String path);\n\n @Override\n public default void close() {\n }\n}",
"public class LocationDto {\n private final ContainerDto[] country;\n private final ContainerDto[] region;\n private final doub... | import java.util.Arrays;
import java.util.function.Predicate;
import static java.util.Arrays.asList;
import static util.queries.LazyQueries.*;
import com.google.gson.Gson;
import util.IRequest;
import weather.data.dto.LocationDto;
import weather.data.dto.SearchDto;
import weather.data.dto.WeatherInfoDto;
import java.io... | /*
* Copyright (c) 2017, Miguel Gamboa
*
* 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
* (at your option) any later version.
*
* This program is dis... | private final IRequest req; | 0 |
SWE-4103-Group-3/Project | src/main/java/com/unb/tracker/web/SeatController.java | [
"@ResponseStatus(value = HttpStatus.BAD_REQUEST)\npublic class BadRequestException extends RuntimeException {\n public BadRequestException(String s) {\n super(s);\n }\n\n public BadRequestException() {\n\n }\n}",
"@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)\npublic class InternalS... | import com.unb.tracker.exception.BadRequestException;
import com.unb.tracker.exception.InternalServerErrorException;
import com.unb.tracker.exception.NotFoundException;
import com.unb.tracker.model.Course;
import com.unb.tracker.model.Seat;
import com.unb.tracker.model.User;
import com.unb.tracker.repository.CourseRepo... | package com.unb.tracker.web;
@Controller
@EnableAutoConfiguration
public class SeatController {
private static final Logger LOG = LoggerFactory.getLogger(SeatController.class);
@Autowired
private SeatRepository seatRepository;
@Autowired
private CourseRepository courseRepository;
@Autowire... | User user = userRepository.findByUsername(principal.getName()); | 5 |
egetman/ibm-bpm-rest-client | src/main/ru/bpmink/bpm/api/impl/simple/SimpleBpmClient.java | [
"public interface BpmClient extends Closeable {\n\n /**\n * Client for actions on exposed bpm api.\n *\n * @return {@link ru.bpmink.bpm.api.client.ExposedClient}\n */\n ExposedClient getExposedClient();\n\n /**\n * Client for actions on process bpm api.\n *\n * @return {@link ru... | import com.google.common.io.Closeables;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.protocol.HttpClientContext;
i... | package ru.bpmink.bpm.api.impl.simple;
/**
* Simple implementation of {@link ru.bpmink.bpm.api.client.BpmClient} which supports
* {@link org.apache.http.impl.auth.BasicScheme} authentication.
*/
@Immutable
@SuppressFBWarnings("JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS")
public final class SimpleBpmClient impleme... | private QueryClient taskQueryClient; | 4 |
valdasraps/esj | client/src/main/java/lt/emasina/esj/model/RequestResponseOperation.java | [
"public interface ResponseReceiver {\r\n\r\n\tpublic void onResponseReturn(Message msg);\r\n\t\r\n\tpublic void onErrorReturn(Exception ex);\r\n\t\r\n}\r",
"public class ExceptionMessage extends Exception {\n\n private final TcpCommand command;\n private final String message;\n\n /**\n * Constructor ... | import lt.emasina.esj.ResponseReceiver;
import lt.emasina.esj.message.ExceptionMessage;
import lt.emasina.esj.tcp.TcpCommand;
import lt.emasina.esj.tcp.TcpConnection;
import lt.emasina.esj.tcp.TcpPackage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package lt.emasina.esj.model;
/**
* Operation
*
* @author Stasys
* @param <F> Forward (to send) message
* @param <B> Backward (to receive on success) message
*/
public abstract class RequestResponseOperation<F extends Message, B extends Message> extends RequestOperation<F> {
private static final Logger lo... | private final ResponseReceiver receiver; | 0 |
samuelhehe/androidpn_enhanced_client | src/org/androidpn/client/XmppManager.java | [
"public class ConnectionConfiguration implements Cloneable {\n\n /**\n * Hostname of the XMPP server. Usually servers use the same service name as the name\n * of the server. However, there are some servers like google where host would be\n * talk.google.com and the serviceName would be gmail.com.\n ... | import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.Future;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.ji... | public void reregisterAccount() {
removeAccount();
submitLoginTask();
runTask();
}
public List<Runnable> getTaskList() {
return taskList;
}
public Future<?> getFutureTask() {
return futureTask;
}
public void runTask() {
Log.d(LOGTAG, "runTask()...");
synchronized (taskList) {
running = false;... | ConnectionConfiguration connConfig = new ConnectionConfiguration( | 0 |
mathisdt/sdb2 | src/main/java/org/zephyrsoft/sdb2/presenter/SongView.java | [
"public class AddressableLine implements Addressable {\n\t\n\tprivate String text;\n\tprivate int indentation;\n\tprivate Integer position;\n\t\n\tpublic AddressableLine(SongElement element, Integer position) {\n\t\tthis.text = element == null || element.getContent() == null\n\t\t\t? \"\"\n\t\t\t: element.getConten... | import static org.zephyrsoft.sdb2.model.SongElementEnum.CHORDS;
import static org.zephyrsoft.sdb2.model.SongElementEnum.COPYRIGHT;
import static org.zephyrsoft.sdb2.model.SongElementEnum.LYRICS;
import static org.zephyrsoft.sdb2.model.SongElementEnum.NEW_LINE;
import static org.zephyrsoft.sdb2.model.SongElementEnum.TIT... | /*
* This file is part of the Song Database (SDB).
*
* SDB 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.
*
* SDB is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; wit... | private List<AddressablePart> parts; | 1 |
eHarmony/pho | src/main/java/com/eharmony/pho/hbase/query/PhoenixHBaseQueryExecutor.java | [
"public class DataStoreException extends RuntimeException {\n\n private static final long serialVersionUID = -1363433871972493184L;\n\n public DataStoreException() {\n super();\n }\n\n public DataStoreException(String message) {\n super(message);\n }\n\n public DataStoreException(Thr... | import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.eharmo... | package com.eharmony.pho.hbase.query;
/**
* Executes the query on hbase through phoenix query server after translation using query translator. Select query
* results will be mapped back to result object using result mapper.
*
* @author vvangapandu
*
*/
public class PhoenixHBaseQueryExecutor {
private st... | private final PhoenixHBaseQueryTranslator queryTranslator; | 2 |
sharedstreets/sharedstreets-builder | src/main/java/io/sharedstreets/data/SharedStreetsReference.java | [
"public final class SharedStreetsProto {\n private SharedStreetsProto() {}\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistryLite registry) {\n }\n\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistry registry) {\n registerAllE... | import com.esri.core.geometry.Point;
import com.esri.core.geometry.Polyline;
import com.google.protobuf.ByteString;
import com.google.protobuf.Int32Value;
import com.jsoniter.annotation.JsonIgnore;
import io.sharedstreets.data.output.proto.SharedStreetsProto;
import io.sharedstreets.tools.builder.osm.model.Way;
import ... | package io.sharedstreets.data;
public class SharedStreetsReference extends TilableData implements Serializable {
public static double MAX_LPR_SEGMENT_LENGTH = 15000.0d; // meters
public static double LPR_BEARING_OFFSET = 20.0d; // meters
public enum FORM_OF_WAY {
Undefined(0),
Motor... | public UniqueId id; | 5 |
scriptkitty/SNC | unikl/disco/calculator/symbolic_math/functions/BFunction.java | [
"public abstract interface SymbolicFunction extends Serializable {\r\n\r\n\t//Methods\r\n\t\r\n\t/**\r\n\t * Returns the value of the theta-dependent function at theta \r\n\t * (theta must be the first of the parameters).\r\n * @param theta\r\n\t * @param parameters the set of parameters, including theta and \r... | import unikl.disco.calculator.symbolic_math.SymbolicFunction;
import unikl.disco.calculator.symbolic_math.ServerOverloadException;
import unikl.disco.calculator.symbolic_math.ParameterMismatchException;
import unikl.disco.calculator.symbolic_math.ThetaOutOfBoundException;
import unikl.disco.calculator.symbolic_math... | /*
* (c) 2017 Michael A. Beck, Sebastian Henningsen
* disco | Distributed Computer Systems Lab
* University of Kaiserslautern, Germany
* All Rights Reserved.
*
* This software is work in progress and is released in the hope that it will
* be useful to the scientific community. It is provided "as i... | private Map<Integer, Hoelder> parameters;
| 4 |
reines/httptunnel | src/test/java/com/yammer/httptunnel/client/HttpTunnelClientSendHandlerTest.java | [
"public class FakeChannelSink extends AbstractChannelSink {\n\n\tpublic final Queue<ChannelEvent> events;\n\n\tpublic FakeChannelSink() {\n\t\tevents = new LinkedList<ChannelEvent>();\n\t}\n\n\t@Override\n\tpublic void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws Exception {\n\t\tevents.add(e);\n\t}\n... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelEve... | /*
* Copyright 2009 Red Hat, Inc.
*
* Red Hat licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | private FakeChannelSink sink; | 0 |
mojohaus/mrm | mrm-servlet/src/test/java/org/codehaus/mojo/mrm/impl/maven/ArtifactStoreFileSystemTest.java | [
"public interface Entry\n extends Serializable\n{\n\n /**\n * Returns the repository that this entry belongs to.\n *\n * @return the repository that this entry belongs to.\n * @since 1.0\n */\n FileSystem getFileSystem();\n\n /**\n * Returns the parent of this entry (or <code>nul... | import org.codehaus.mojo.mrm.api.maven.Artifact;
import org.codehaus.mojo.mrm.api.maven.ArtifactNotFoundException;
import org.codehaus.mojo.mrm.api.maven.ArtifactStore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNu... | assertFalse( matcher.matches() );
matcher = ArtifactStoreFileSystem.ARTIFACT.matcher( "/commons/commons/1.0/commons-1.0.pom" );
assertTrue( matcher.matches() );
assertEquals( "commons/", matcher.group( 1 ) );
assertEquals( "commons", matcher.group( 2 ) );
assertEquals( "1... | Entry entry = system.get( "/archetype-catalog.xml" ); | 0 |
spearal/spearal-java | src/main/java/org/spearal/impl/instantiator/ProxyInstantiator.java | [
"public interface SpearalContext {\n\n\tvoid configure(Configurable configurable);\n\tvoid configure(Configurable configurable, boolean append);\n\t\n\tSecurizer getSecurizer();\n\t\n\tString alias(Class<?> cls);\n\tString unalias(String aliasedClassName);\n\t\n\tClass<?> loadClass(String classNames, Type target)\n... | import org.spearal.configuration.PropertyInstantiatorProvider.PropertyInstantiator;
import org.spearal.configuration.TypeInstantiatorProvider;
import org.spearal.configuration.TypeInstantiatorProvider.TypeInstantiator;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.re... | /**
* == @Spearal ==>
*
* Copyright (C) 2014 Franck WOLFF & William DRAI (http://www.spearal.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/... | PropertyInstantiatorProvider, PropertyInstantiator { | 4 |
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.addRestAction(RestListRiversAction.class); | 7 |
jhy/jsoup | src/main/java/org/jsoup/parser/HtmlTreeBuilderState.java | [
"public final class StringUtil {\n // memoised padding up to 21 (blocks 0 to 20 spaces)\n static final String[] padding = {\"\", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \",\n \" \", \" \", \" \", \" \", \" \", \" ... | import org.jsoup.internal.StringUtil;
import org.jsoup.nodes.Attribute;
import org.jsoup.nodes.Attributes;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.DocumentType;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import java.util.ArrayList;
import static org.jsoup.internal.StringUtil.inSorted;
... | } else {
tb.framesetOk(false);
Element body = stack.get(1);
if (startTag.hasAttributes()) {
for (Attribute attribute : startTag.attributes) {
if (!body.hasAttr(attribut... | Attributes inputAttribs = new Attributes(); | 2 |
aleven/jpec-server | src/main/java/it/attocchi/jpec/server/bl/RegolaPecBL.java | [
"@Entity\r\n@Table(schema = \"\", name = \"pec01_messaggi\")\r\npublic class MessaggioPec extends AbstractEntityMarksWithIdLong<MessaggioPec> {\r\n\r\n\tpublic enum Folder {\r\n\t\tIN,\r\n\t\tOUT\r\n\t}\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t@Id\r\n\t@Generated... | import groovy.lang.Binding;
import groovy.lang.GroovyShell;
import it.attocchi.jpa2.JpaController;
import it.attocchi.jpec.server.entities.MessaggioPec;
import it.attocchi.jpec.server.entities.RegolaPec;
import it.attocchi.jpec.server.entities.filters.RegolaPecFilter;
import it.attocchi.jpec.server.protocollo.AzioneCon... | package it.attocchi.jpec.server.bl;
public class RegolaPecBL {
protected static final Logger logger = LoggerFactory.getLogger(RegolaPecBL.class);
public static synchronized List<RegolaPec> regole(EntityManagerFactory emf, RegolaPecEventoEnum evento) throws Exception {
RegolaPecFilter filtro = new RegolaPecFi... | AzioneGenerica istanzaAzione = null; | 6 |
ApplETS/applets-java-api | src/main/java/applets/etsmtl/ca/news/jobs/NewsJob.java | [
"public class SourceDAO extends DAO<Source> {\n\n @Override\n public Source find(String key) {\n Source source = new Source();\n try {\n String findByKey = \"SELECT * FROM sources WHERE key = ?\";\n PreparedStatement st = this.connection.prepareStatement(findByKey,ResultSet... | import applets.etsmtl.ca.news.db.SourceDAO;
import applets.etsmtl.ca.news.jobs.strategy.FacebookNewsFetcher;
import applets.etsmtl.ca.news.jobs.strategy.IFetchNewsStrategy;
import applets.etsmtl.ca.news.jobs.strategy.RssNewsFetcher;
import applets.etsmtl.ca.news.jobs.strategy.TwitterNewsFetcher;
import applets.etsmtl.c... | package applets.etsmtl.ca.news.jobs;
public class NewsJob implements Job {
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
Map<String, IFetchNewsStrategy> mapFetchers = new HashMap<>();
try { | SourceDAO sourceDao = new SourceDAO(); | 0 |
heribender/SocialDataImporter | SDI-core/src/main/java/ch/sdi/core/impl/target/TargetExecutor.java | [
"public class SdiDuplicatePersonException extends SdiSkipPersonException\n{\n private static final long serialVersionUID = 1L;\n\n /**\n * Constructor\n *\n * @param aExitCode\n */\n public SdiDuplicatePersonException( Person<?> aPerson )\n {\n super( aPerson );\n }\n\n /**\... | import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log... | /**
* Copyright (c) 2014 by the original author or authors.
*
* This code 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; either
* version 2.1 of the License, or (at your option) any later version.
... | myLog.info( new ReportMsg( ReportMsg.ReportType.TARGET, "ProcessedPersons", myProcessedPersons ) ); | 8 |
Daskiworks/ghwatch | app/src/main/java/com/daskiworks/ghwatch/WatchedRepositoriesActivity.java | [
"public class PreferencesUtils {\n\n private static final String TAG = PreferencesUtils.class.getSimpleName();\n\n /*\n * Names of user edited preferences.\n */\n public static final String PREF_SERVER_CHECK_PERIOD = \"pref_serverCheckPeriod\";\n public static final String PREF_SERVER_CHECK_WIFI_ONLY = \"pr... | import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout.OnRefreshListener;
import android.util.Log;
import android.view.Menu;
import ... | Toast.makeText(WatchedRepositoriesActivity.this, R.string.message_err_action_no_thread_available, Toast.LENGTH_SHORT).show();
}
}
private final class RepositoriesListItemMenuClickListener implements WatchedRepositoryListAdapter.OnItemMenuClickedListener {
@Override
public boolean onMenuItemClick(... | private final class UnwatchRepositoryTask extends AsyncTask<Long, String, BaseViewData> { | 3 |
larusba/doc2graph | neo4j-json/src/test/java/org/neo4j/helpers/json/config/JsonHelperConfigurationTest.java | [
"public interface DocumentRelationBuilder {\n\n\t/**\n\t * Create or update relationship between parent and child node\n\t * @param parent\n\t * @param child\n\t * @param context\n\t * @return\n\t */\n\tRelationship buildRelation(Node parent, Node child, DocumentRelationContext context);\n\t\n\t/**\n\t * Remove all... | import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import java.util.HashMap;
import java.util.Map;
import org.easymock.EasyMockRunner;
import org.easymock.Mock;
import org.easymock.MockType;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.ru... | /**
* Copyright (c) 2017 LARUS Business Automation [http://www.larus-ba.it]
* <p>
* This file is part of the "LARUS Integration Framework for Neo4j".
* <p>
* The "LARUS Integration Framework for Neo4j" is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this file except in comp... | DocumentGrapherExecutionContext ctx1 = JsonHelperConfiguration.newContext(db, log); | 1 |
mahadirz/UnitenInfo | app/src/main/java/my/madet/uniteninfo/ResultFragment.java | [
"public class ExamResultListAdapter extends ArrayAdapter<String>{\n\t\n\tprivate final Context context;\n\tprivate HashMap<String, String[]> values;\n\tprivate String[] val;\n\n\t/**\n\t * \n\t * @param context\n\t * @param values\n\t * the values of String[] in format\n\t * 0 - gpa\n\t * 1 - cgpa\n\t * 2 - image n... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import my.madet.adapter.ExamResultListAdapter;
import my.madet.function.DatabaseHandler;
import my.madet.function.HttpParser;
import my.madet.function.MyPre... | /*
* The MIT License (MIT)
* Copyright (c) 2014 Mahadir Ahmad
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, ... | ExamResultListAdapter lvadapter = new ExamResultListAdapter( | 0 |
jchampemont/WTFDYUM | src/test/java/com/jeanchampemont/wtfdyum/service/UserServiceTest.java | [
"@SpringBootApplication\n@EnableScheduling\npublic class WTFDYUMApplication {\n\n @Bean\n public Clock clock() {\n return Clock.systemDefaultZone();\n }\n\n public static void main(final String[] args) {\n SpringApplication.run(WTFDYUMApplication.class, args);\n }\n}",
"public class E... | import com.jeanchampemont.wtfdyum.WTFDYUMApplication;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.type.EventType;
import com.jeanchampemont.wtfdyum.dto.type.UserLimitType;
import com.jeanchampemont.wtfdyum.service.impl.UserServiceImpl... | /*
* Copyright (C) 2015, 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... | private RedisTemplate<String, Feature> featureRedisTemplate; | 2 |
codecentric/spring-boot-starter-batch-web | batch-web-spring-boot-autoconfigure/src/test/java/de/codecentric/batch/metrics/item/MetricsTestItemReadListener.java | [
"public enum Action {\n\tFAIL_ON_READ, //\n\tFAIL_ON_AFTER_READ, //\n\tFAIL_ON_READ_ERROR, //\n\tFAIL_ON_BEFORE_PROCESS, //\n\tFAIL_ON_PROCESS, //\n\tFAIL_ON_AFTER_PROCESS, //\n\tFAIL_ON_PROCESS_ERROR, //\n\tFAIL_ON_BEFORE_WRITE, //\n\tFAIL_ON_WRITE, //\n\tFAIL_ON_AFTER_WRITE, //\n\tFAIL_ON_WRITE_ERROR, //\n\tFAIL_... | import org.springframework.batch.core.ItemReadListener;
import de.codecentric.batch.metrics.Action;
import de.codecentric.batch.metrics.BatchMetrics;
import de.codecentric.batch.metrics.Item;
import de.codecentric.batch.metrics.MetricNames;
import de.codecentric.batch.metrics.MetricsTestException; | /*
* Copyright 2018 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 applica... | if (item != null && item.getActions().contains(Action.FAIL_ON_AFTER_READ)) { | 0 |
kbase/kb_sdk | src/java/us/kbase/mobu/renamer/ModuleRenamer.java | [
"public class KbService {\n\tprivate String name;\n\tprivate List<KbModule> modules;\n\t\n\tpublic KbService(String name) {\n\t\tthis.name = name;\n\t}\n\t\t\n\tpublic void loadFromList(List<?> data) throws KidlParseException {\n\t\tList<KbModule> modules = new ArrayList<KbModule>();\n\t\tfor (Object item : data) {... | import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.P... | package us.kbase.mobu.renamer;
public class ModuleRenamer {
private final File moduleDir;
private final Map<String,Object> kbaseYmlConfig;
private final String oldModuleName;
private final String language;
public ModuleRenamer() throws Exception {
this(null);
}
public Modul... | JavaData origParsingData = JavaTypeGenerator.parseSpec(origSpecFile); | 3 |
Pivopil/spring-boot-oauth2-rest-service-password-encoding | share/src/main/java/io/github/pivopil/share/builders/impl/UserBuilder.java | [
"public interface EntityBuilder<T extends BasicEntity, K extends EntityBuilder, V extends ViewModel<T>> {\n\n K newInstance();\n\n V buildViewModel();\n\n K newInstance(T entity);\n\n K id(Long val);\n\n K created(Date val);\n\n K updated(Date val);\n\n T build();\n\n K withOvalValidator(Val... | import io.github.pivopil.share.builders.EntityBuilder;
import io.github.pivopil.share.builders.REGEX;
import io.github.pivopil.share.entities.impl.Role;
import io.github.pivopil.share.entities.impl.User;
import io.github.pivopil.share.viewmodels.impl.UserViewModel;
import net.sf.oval.Validator;
import net.sf.oval.const... | package io.github.pivopil.share.builders.impl;
/**
* Created on 06.05.16.
*/
public class UserBuilder implements EntityBuilder<User, UserBuilder, UserViewModel> {
private Long id;
private Date created;
private Date updated;
@NotNull
@NotEmpty
@Length(min = 1, max = 100)
private Stri... | private Set<Role> roles; | 2 |
evant/redux | sample-android/src/main/java/com/example/sample_android/MainActivity.java | [
"public interface Action {\n}",
"@AutoValue\npublic abstract class Check implements UpdateItem {\n \n public static Check create(int id, boolean checked) {\n return new AutoValue_Check(id, checked);\n }\n \n public abstract int id();\n \n public abstract boolean checked();\n}",
"publ... | import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;
import androidx.lifecycle.LifecycleRegistryOwner;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import android.os.Bundle;
import com.google.android.material.flo... | package com.example.sample_android;
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, LifecycleRegistryOwner {
private final LifecycleRegistry registry = new LifecycleRegistry(this);
MainStore store; | ReplayMiddleware<TodoList, Action, Action> replayMiddleware; | 7 |
zsoltk/GameOfLife | app/src/test/java/hu/supercluster/gameoflife/game/rule/ConwaysRuleTest.java | [
"public interface Cell {\n public static final int STATE_ALIVE = 1;\n public static final int STATE_DEAD = 0;\n\n void reset(int state);\n long getId();\n int getY();\n int getX();\n void setState(int state);\n int getState();\n boolean isAlive();\n boolean isDead();\n void onNeighb... | import org.junit.Before;
import org.junit.Test;
import hu.supercluster.gameoflife.game.cell.Cell;
import hu.supercluster.gameoflife.game.cell.CellFactory;
import hu.supercluster.gameoflife.game.cell.SimpleCell;
import hu.supercluster.gameoflife.game.cell.SimpleCellFactory;
import hu.supercluster.gameoflife.game.grid.En... | package hu.supercluster.gameoflife.game.rule;
public class ConwaysRuleTest extends RobolectricTest {
CellFactory<SimpleCell> cellFactory; | GridTransformer<SimpleCell> transformer; | 6 |
aleven/jpec-server | src/main/java/it/attocchi/jpec/server/api/rest/ResourceAllegati.java | [
"@XmlRootElement\npublic class UploadAllegatoRequest {\n\n\tprivate String fileName;\n\tprivate String contentType;\n\tprivate long size;\n\n\tprivate long idMessaggio;\n\n\t// private byte[] fileBytes;\n\t// private String fileBase64;\n\t// private String filePath;\n\t// private String fileUrl;\n\n\tpublic String ... | import it.attocchi.jpec.server.api.rest.data.UploadAllegatoRequest;
import it.attocchi.jpec.server.api.rest.data.UploadAllegatoResponse;
import it.attocchi.jpec.server.bl.MessaggioPecBL;
import it.attocchi.jpec.server.entities.AllegatoPec;
import it.attocchi.jpec.server.exceptions.PecException;
import it.webappcommon.r... | package it.attocchi.jpec.server.api.rest;
@Api(value = "Allegati")
@Path("/allegati")
public class ResourceAllegati extends RestBaseJpa2 {
protected static final Logger logger = LoggerFactory.getLogger(ResourceAllegati.class);
// @GET
// @Path("/{id}/")
// @Produces(MediaType.APPLICATION_JSON)
// public R... | UploadAllegatoResponse responseData = new UploadAllegatoResponse(); | 1 |
larusba/doc2graph | neo4j-json/src/test/java/org/neo4j/helpers/json/config/JsonHelperConfigurationDefaultTest.java | [
"public interface DocumentRelationBuilder {\n\n\t/**\n\t * Create or update relationship between parent and child node\n\t * @param parent\n\t * @param child\n\t * @param context\n\t * @return\n\t */\n\tRelationship buildRelation(Node parent, Node child, DocumentRelationContext context);\n\t\n\t/**\n\t * Remove all... | import org.neo4j.helpers.json.document.DocumentRelationBuilder;
import org.neo4j.helpers.json.document.context.DocumentGrapherExecutionContext;
import org.neo4j.helpers.json.document.impl.DocumentIdBuilderTypeId;
import org.neo4j.helpers.json.document.impl.DocumentLabelBuilderByType;
import org.neo4j.helpers.json.docum... | /**
* Copyright (c) 2017 LARUS Business Automation [http://www.larus-ba.it]
* <p>
* This file is part of the "LARUS Integration Framework for Neo4j".
* <p>
* The "LARUS Integration Framework for Neo4j" is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this file except in comp... | DocumentRelationBuilder ctx1 = JsonHelperConfiguration.newContext(db, log).getDocumentRelationBuilder(); | 0 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/course/adapter/CourseDetailInnerRecyclerViewAdapter.java | [
"public abstract class BaseRecyclerViewAdapter<T extends BaseViewHolder> extends RecyclerView.Adapter<T> {\n\n @Override\n public void onBindViewHolder(T holder, int position) {\n initialize(holder, position);\n }\n\n @Override\n public int getItemCount() {\n return findList().size();\n... | import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mgilangjanuar.dev.goscele.R;
import com.mgilangjanuar.dev.goscele.base.BaseRecyclerViewAdapter;
import com.mgilangjanuar.d... | package com.mgilangjanuar.dev.goscele.modules.course.adapter;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class CourseDetailInnerRecyclerViewAdapter extends BaseRecyclerViewAdapter<CourseDetailInnerRecyclerViewAdapter.ViewHolder> {
List<CourseDetailInnerModel> list... | Intent intent = new Intent(v.getContext(), BrowserActivity.class); | 2 |
romainmoreau/e-paper | e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/table/Text.java | [
"public enum Color {\n\tBLACK, DARK_GRAY, LIGHT_GRAY, WHITE;\n}",
"public enum FontSize {\n\tDOTS_32(32, 1), DOTS_48(48, 1), DOTS_64(64, 1);\n\n\tprivate final int height;\n\n\tprivate final int letterSpacing;\n\n\tprivate FontSize(int height, int letterSpacing) {\n\t\tthis.height = height;\n\t\tthis.letterSpacin... | import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlValue;
import fr.romainmoreau.epaper.client.api.Color;
import fr.romainmoreau.epaper.client.api.FontSize;
import fr.romainmoreau.epaper.client.api.HorizontalAlignment;
import fr.romainmoreau.epaper.client.api.VerticalAlignment;
import fr... | package fr.romainmoreau.epaper.jaxb.api.table;
public class Text implements CellContent {
private Color textColor;
private Color backgroundColor;
private FontSize fontSize;
private int lineSpacing;
private HorizontalAlignment horizontalAlignment;
private VerticalAlignment verticalAlignment;
private Stri... | return new TextCellContent(textColor, backgroundColor, fontSize, lineSpacing, horizontalAlignment, | 4 |
enasequence/cramtools | src/main/java/htsjdk/samtools/CRAMContainerStreamWriter.java | [
"public class CramContext {\n\tprivate static final int RECORDS_PER_SLICE = 10000;\n\tpublic SAMFileHeader samFileHeader;\n\tpublic ReferenceSource referenceSource;\n\tpublic Map<Integer, ReferenceTracks> tracks = new HashMap<Integer, ReferenceTracks>();\n\tpublic CramLossyOptions lossyOptions;\n\tpublic long recor... | import htsjdk.samtools.SAMFileHeader.SortOrder;
import htsjdk.samtools.cram.CramContext;
import htsjdk.samtools.cram.CramLossyOptions;
import htsjdk.samtools.cram.CramSerilization;
import htsjdk.samtools.cram.build.CramIO;
import htsjdk.samtools.cram.common.CramVersions;
import htsjdk.samtools.cram.common.Version;
impo... | /*
* Copyright 2012 - 2018 EMBL - European Bioinformatics Institute
* 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... | protected ReferenceSource source; | 4 |
senseobservationsystems/sense-android-library | sense-android-library/src/nl/sense_os/service/phonestate/AppsSensor.java | [
"public class SensePrefs {\r\n /**\r\n * Keys for the authentication-related preferences of the Sense Platform\r\n */\r\n public static class Auth {\r\n /**\r\n * Key for login preference for session cookie.\r\n * \r\n * @see SensePrefs#AUTH_PREFS\r\n */\r\n ... | import java.util.ArrayList;
import java.util.List;
import nl.sense_os.service.R;
import nl.sense_os.service.constants.SenseDataTypes;
import nl.sense_os.service.constants.SensePrefs;
import nl.sense_os.service.constants.SensePrefs.Main.PhoneState;
import nl.sense_os.service.constants.SensorData.DataPoint;
import... | package nl.sense_os.service.phonestate;
public class AppsSensor extends BaseDataProducer implements PeriodicPollingSensor {
private static final String TAG = "Sense Apps Sensor";
private static AppsSensor instance;
public static AppsSensor getInstance(Context context) {
if (null == instance) {
... | SensorDataPoint dataPoint = new SensorDataPoint(value);
| 7 |
mikelewis0/easyccg | src/uk/ac/ed/easyccg/syntax/ParsePrinter.java | [
"public class MorphaStemmer {\n private static final Pattern whitespace = Pattern.compile(\"\\\\s+\");\n\n /***\n * Stem the supplied text, splitting on whitespace to break it into words. \n **/\n public static String stem(String text) {\n return morpha(cleanText(text), false);\n }\n\n ... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import uk.ac.ed.easyccg.lemmatizer.MorphaStemmer;
import uk.ac.ed.easyccg.syntax.Combinator.RuleType;
import uk.ac.ed.easyccg.syntax.SyntaxTreeNode.SyntaxTreeNodeBinary;
import uk.ac.ed.easyccg.syntax.SyntaxTreeNode.SyntaxTreeNodeLeaf;
import u... | package uk.ac.ed.easyccg.syntax;
public abstract class ParsePrinter
{
public final static ParsePrinter CCGBANK_PRINTER = new CCGBankPrinter();
public final static ParsePrinter HTML_PRINTER = new HTMLPrinter();
public final static ParsePrinter PROLOG_PRINTER = new PrologPrinter();
public final static ParsePr... | abstract static class ParsePrinterVisitor implements SyntaxTreeNodeVisitor { | 5 |
yholkamp/jadmin | src/main/java/net/nextpulse/jadmin/CrudController.java | [
"public class DataAccessException extends Exception {\n public DataAccessException(Exception cause) {\n super(cause);\n }\n\n public DataAccessException(String message) {\n super(message);\n }\n\n public DataAccessException(String message, Exception cause) {\n super(message, cause);\n }\n}",
"publi... | import net.nextpulse.jadmin.dao.DataAccessException;
import net.nextpulse.jadmin.dao.DatabaseEntry;
import net.nextpulse.jadmin.dsl.InputTransformer;
import net.nextpulse.jadmin.dsl.InvalidInputException;
import net.nextpulse.jadmin.exceptions.NotFoundException;
import net.nextpulse.jadmin.helpers.DataPresentationHelpe... | package net.nextpulse.jadmin;
/**
* The main class of the JAdmin library when it comes to handling the different HTTP endpoints that are supported.
* Implements all CRUD actions (create, read, update, delete).
*
* @author yholkamp
*/
public class CrudController {
private static final Logger logger = LogManage... | } catch(InvalidInputException e) { | 3 |
WorldSEnder/MCAnm | src/main/java/com/github/worldsender/mcanm/common/skeleton/LegacyModelAsSkeleton.java | [
"public class RawData implements IModelVisitable {\n\tpublic static final long MAGIC_NUMBER = Utils.asciiToMagicNumber(\"MHFC MDL\");\n\n\tpublic static final RawData MISSING_DATA;\n\n\tstatic {\n\t\tMISSING_DATA = new RawData();\n\t\tMISSING_DATA.artist = \"<unknown>\";\n\t\tMISSING_DATA.modelUUID = new UUID(0, 0)... | import com.github.worldsender.mcanm.client.mcanmmodel.stored.RawData;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;
import com.github.worldsender.mcanm.common.resource.IResource;
import com.github.worldsender.mcanm.common.resource.IResourceLocation;
import com.github.worldsender.mcanm.comm... | package com.github.worldsender.mcanm.common.skeleton;
@Deprecated
public class LegacyModelAsSkeleton extends AbstractSkeleton {
private static ISkeletonVisitable load(IResource resource) {
try { | return RawData.retrieveFrom(resource).getLegacySkeletonData(); | 0 |
tsteinholz/SpaceShooter | core/src/com/laststandstudio/space/Levels/SplashScreen.java | [
"public class MainMenu extends Level {\n\n private static final float PADDING = (Gdx.graphics.getWidth() / 120);\n private MainMenu instance = this;\n\n private SpriteBatch batch;\n\n private BitmapFont titleFont;\n private BitmapFont menuFont;\n private Pixmap pixmap;\n private Skin skin;\n ... | import com.laststandstudio.space.Addons.SpaceShooterAddon;
import com.laststandstudio.space.engine.Level;
import java.util.ArrayList;
import java.util.List;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx... | /******************************************************************************
* Space Shooter Software License
* Version 0.0.2-alpha
*
* Copyright (C) 2015 Last Stand Studio
*
* SpaceShooter is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publ... | SpaceShooter.logger.logDebug("Loading Splash Screen"); | 1 |
zaproxy/zap-api-java | subprojects/zap-clientapi/src/examples/java/org/zaproxy/clientapi/examples/authentication/FormBasedAuthentication.java | [
"public abstract class ApiResponse {\n\n private String name = null;\n\n public ApiResponse(String name) {\n super();\n this.name = name;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import org.zaproxy.clientapi.core.ApiResponse;
import org.zaproxy.clientapi.core.ApiResponseElement;
import org.zaproxy.clientapi.core.ApiResponseList;
import org.zaproxy.clientapi.core.ApiRespons... | /*
* Zed Attack Proxy (ZAP) and its related class files.
*
* ZAP is an HTTP/HTTPS proxy for assessing web application security.
*
* Copyright 2014 The ZAP Development Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | for (ApiResponse authMethod : authMethodsList.getItems()) { | 0 |
TangXiaoLv/TelegramGallery | telegramgallery/src/main/java/com/tangxiaolv/telegramgallery/Utils/ImageLoader.java | [
"public class AnimatedFileDrawable extends BitmapDrawable implements Animatable {\n\n static {\n System.loadLibrary(\"gly\");\n }\n\n private static native int createDecoder(String src, int[] params);\n private static native void destroyDecoder(int ptr);\n private static native int getVideoFra... | import android.app.ActivityManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.BitmapDrawable;
import android.media.ExifInterface;
import android.media.ThumbnailUtils;
import android.net.Uri;
imp... | package com.tangxiaolv.telegramgallery.Utils;
public class ImageLoader {
private HashMap<String, Integer> bitmapUseCounts = new HashMap<>();
private LruCache memCache;
private HashMap<String, CacheImage> imageLoadingByUrl = new HashMap<>();
private HashMap<String, CacheImage> imageLoadingByKeys = n... | private DispatchQueue cacheOutQueue = new DispatchQueue("cacheOutQueue"); | 1 |
OvercastNetwork/Tracker | src/main/java/tc/oc/tracker/damage/resolvers/OwnedMobDamageResolver.java | [
"public interface DamageInfo {\n /**\n * Gets the living entity most responsible for this damage.\n *\n * @return Resolved damager or null if none exists\n */\n @Nullable LivingEntity getResolvedDamager();\n}",
"public interface DamageResolver {\n @Nullable DamageInfo resolve(@Nonnull Liv... | import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import tc.oc.tracker.DamageInfo;
imp... | package tc.oc.tracker.damage.resolvers;
public class OwnedMobDamageResolver implements DamageResolver {
private final OwnedMobTracker ownedMobTracker;
public OwnedMobDamageResolver(OwnedMobTracker ownedMobTracker) {
this.ownedMobTracker = ownedMobTracker;
}
| public @Nullable DamageInfo resolve(@Nonnull LivingEntity entity, @Nonnull Lifetime lifetime, @Nonnull EntityDamageEvent damageEvent) { | 0 |
castle/castle-java | src/main/java/io/castle/client/Castle.java | [
"public interface CastleApi {\n\n /**\n * Merges an additional context object with the context object associated with this {@code CastleApi} instance.\n * <p>\n * When the additional context is null, then the returned context is an empty JSON object.\n *\n * @param additionalContext client de... | import com.google.common.collect.ImmutableMap;
import com.google.common.hash.HashFunction;
import io.castle.client.api.CastleApi;
import io.castle.client.internal.CastleApiImpl;
import io.castle.client.internal.config.CastleConfiguration;
import io.castle.client.internal.config.CastleConfigurationBuilder;
import io.cas... | package io.castle.client;
/**
* Creates an instance of the Castle SDK
*
* This also provides methods for initialization of the SDK.
* {@code this#initialize()} must be called once per instance of the SDK
*
* Static method {@code this#setSingletonInstance()} can be called to set a global instance of the SDK.
*... | private final CastleSdkInternalConfiguration internalConfiguration; | 4 |
SumoLogic/sumologic-jenkins-plugin | src/main/java/com/sumologic/jenkins/jenkinssumologicplugin/sender/LogSenderHelper.java | [
"@Extension\npublic final class PluginDescriptorImpl extends BuildStepDescriptor<Publisher> {\n\n private Secret url;\n private transient SumoMetricDataPublisher sumoMetricDataPublisher;\n private static LogSenderHelper logSenderHelper = null;\n private String queryPortal;\n private String sourceCate... | import com.google.gson.Gson;
import com.sumologic.jenkins.jenkinssumologicplugin.PluginDescriptorImpl;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.LogTypeEnum;
import com.sumologic.jenkins.jenkinssumologicplugin.model.BuildModel;
import com.sumologic.jenkins.jenkinssumologicplugin.model.PipelineStageM... | package com.sumologic.jenkins.jenkinssumologicplugin.sender;
/**
* Sumo Logic plugin for Jenkins model.
* <p>
* Log Sender Helper
* <p>
* Created by Sourabh Jain on 5/2019.
*/
@SuppressFBWarnings("DM_DEFAULT_ENCODING")
public class LogSenderHelper {
public final static Logger LOG = Logger.getLogger(LogSe... | List<TestCaseResultModel> testResults = testCaseModel.getTestResults(); | 5 |
NICTA/nicta-ner | nicta-ner/src/main/java/org/t3as/ner/classifier/feature/ExistingCleanPhraseFeature.java | [
"public class Phrase {\n // TODO: getters and setters for these\n /** phrase text array */\n public final List<Token> phrase;\n /** corresponding name type */\n public EntityClass phraseType;\n /** the start position of the phase in a sentence */\n public final int phrasePosition;\n /** the ... | import java.util.List;
import java.util.Set;
import static org.t3as.ner.util.Strings.clean;
import static org.t3as.ner.util.Strings.toEngLowerCase;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableSet;
import org.t3as.ner.Phrase;
import org.t3as.ner.util.IO;
import org.t3a... | /*
* #%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 ... | s.addAll(IO.cleanLowercaseLines(getClass(), resource)); | 1 |
policeman-tools/forbidden-apis | src/main/java/de/thetaphi/forbiddenapis/cli/CliMain.java | [
"public static enum Option {\n FAIL_ON_MISSING_CLASSES,\n FAIL_ON_VIOLATION,\n FAIL_ON_UNRESOLVABLE_SIGNATURES,\n IGNORE_SIGNATURES_OF_MISSING_CLASSES,\n DISABLE_CLASSLOADING_CACHE\n}",
"public final class AsmUtils {\n\n private AsmUtils() {}\n \n private static final String REGEX_META_CHARS = \".^$+{}[]|... | import static de.thetaphi.forbiddenapis.Checker.Option.*;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.net.JarURLConnection;
import java.net.URLConnection;
import java.net.URLClassLoader;
import j... | /*
* (C) Copyright Uwe Schindler (Generics Policeman) and others.
*
* 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... | final URLConnection conn = getClass().getClassLoader().getResource(AsmUtils.getClassResourceName(clazzName)).openConnection(); | 1 |
NicolaasWeideman/RegexStaticAnalysis | src/main/java/preprocessor/WildCardExpansionRule.java | [
"static class GroupFactor extends RegexFactor<List<RegexToken>> {\n\t\t\n\t\t\n\tprivate int level;\n\tpublic int getLevel() {\n\t\treturn level;\n\t}\n\n\tpublic GroupFactor(List<RegexToken> factorContent, GroupType groupType) {\n\t\tsuper(factorContent);\n\t\tthis.groupType = groupType;\n\t}\n\n\tpublic GroupFact... | import java.util.List;
import preprocessor.ParsingPreprocessor.GroupFactor;
import preprocessor.ParsingPreprocessor.GroupFactor.GroupType;
import preprocessor.ParsingPreprocessor.RegexFactor;
import preprocessor.ParsingPreprocessor.RegexFactor.FactorType;
import preprocessor.ParsingPreprocessor.RegexToken;
import prepr... | package preprocessor;
public class WildCardExpansionRule implements PreprocessorRule {
private final boolean MATCH_NEWLINE = true;
@Override
public String process(List<RegexToken> tokenStream) {
StringBuilder regexBuilder = new StringBuilder();
RegexToken tokens[] = new RegexToken[tokenStream.size()];
t... | GroupFactor groupFactorToken = (GroupFactor) factorToken; | 0 |
copygirl/BetterStorage | src/main/java/net/mcft/copy/betterstorage/inventory/InventoryCraftingStation.java | [
"public final class BetterStorageCrafting {\n\t\n\tpublic static final List<IStationRecipe> recipes = new ArrayList<IStationRecipe>();\n\t\n\tprivate BetterStorageCrafting() { }\n\t\n\t/** Adds a station recipe to the recipe list. */\n\tpublic static void addStationRecipe(IStationRecipe recipe) { recipes.add(recip... | import java.util.Arrays;
import net.mcft.copy.betterstorage.api.crafting.BetterStorageCrafting;
import net.mcft.copy.betterstorage.api.crafting.ContainerInfo;
import net.mcft.copy.betterstorage.api.crafting.CraftingSourceTileEntity;
import net.mcft.copy.betterstorage.api.crafting.ICraftingSource;
import net.mcft.copy.b... | package net.mcft.copy.betterstorage.inventory;
public class InventoryCraftingStation extends InventoryBetterStorage {
public TileEntityCraftingStation entity = null;
public final ItemStack[] crafting;
public final ItemStack[] output;
public final ItemStack[] contents;
public StationCrafting currentCraftin... | ICraftingSource source = new CraftingSourceTileEntity(entity, player); | 2 |
koen-serneels/HomeAutomation | src/main/java/be/error/rpi/heating/RoomTemperatureCollector.java | [
"public static RunConfig getInstance() {\n\tif (runConfig == null) {\n\t\tthrow new IllegalStateException(\"Initialize first\");\n\t}\n\treturn runConfig;\n}",
"public abstract class AbstractDimmerProcessListener extends ProcessListenerEx {\n\n\tprotected Dimmer dimmer;\n\n\tvoid setDimmer(Dimmer dimmer) {\n\t\tt... | import be.error.rpi.dac.dimmer.builder.AbstractDimmerProcessListener;
import be.error.rpi.knx.UdpChannel.UdpChannelCallback;
import be.error.rpi.knx.UdpChannelCommand;
import be.error.types.LocationId;
import static be.error.rpi.config.RunConfig.getInstance;
import static be.error.rpi.knx.UdpChannelCommand.Constants.TE... | /*-
* #%L
* Home Automation
* %%
* Copyright (C) 2016 - 2017 Koen Serneels
* %%
* 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
*... | getInstance().getKnxConnectionFactory().addProcessListener(new AbstractDimmerProcessListener() { | 1 |
vsilaev/tascalate-concurrent | src/main/java/net/tascalate/concurrent/CompletablePromise.java | [
"static void iif(boolean v) {}",
"static Throwable unwrapCompletionException(Throwable ex) {\n Throwable nested = ex;\n while (nested instanceof CompletionException) {\n nested = nested.getCause();\n }\n return null == nested ? ex : nested;\n}",
"static CompletionException wrapCompletionExcep... | import static net.tascalate.concurrent.SharedFunctions.iif;
import static net.tascalate.concurrent.SharedFunctions.unwrapCompletionException;
import static net.tascalate.concurrent.SharedFunctions.wrapCompletionException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
im... | /**
* Copyright 2015-2021 Valery Silaev (http://vsilaev.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... | result.completeExceptionally(wrapCompletionException(ex)); | 2 |
utapyngo/owl2vcs | src/main/java/owl2vcs/changeset/FullChangeSet.java | [
"public class AddPrefixData extends PrefixChangeData {\r\n\r\n private static final long serialVersionUID = 2801228470061214801L;\r\n\r\n public AddPrefixData(String prefixName, String prefix) {\r\n super(prefixName, prefix);\r\n }\r\n\r\n @Override\r\n public <R, E extends Exception> R accept... | import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxOntologyFormat;
import org.semanticweb.owlapi.change.AddAxiomData;
... | }
}
}
// Annotations
setAnnotationChanges(findAnnotationChanges(modifiedParent, child));
// Axioms
setAxiomChanges(findAxiomChanges(modifiedParent, child));
} else {
// Annotations
se... | prefixChanges.add(new RenamePrefixData(parentPrefixName, parentPrefixValue,
| 4 |
huyongli/TigerVideo | TigerVideoPlayer/src/main/java/cn/ittiger/player/PlayerManager.java | [
"public class BackPressedMessage extends Message {\n private int mScreenState;\n\n public BackPressedMessage(int screenState, int hash, String videoUrl) {\n\n super(hash, videoUrl);\n mScreenState = screenState;\n }\n\n public int getScreenState() {\n\n return mScreenState;\n }\n... | import android.text.TextUtils;
import android.util.Log;
import android.view.TextureView;
import android.view.ViewGroup;
import cn.ittiger.player.message.BackPressedMessage;
import cn.ittiger.player.message.DurationMessage;
import cn.ittiger.player.message.Message;
import cn.ittiger.player.message.UIStateMessage;
import... | Utils.log(String.format("stop video, hash=%d, url=%s", mObserverHash, mVideoUrl));
onPlayStateChanged(PlayState.STATE_NORMAL);
mPlayer.stop();
removeTextureView();
mObserverHash = -1;
mVideoUrl = null;
mScreenState = ScreenState.SCREEN_STATE_NORMAL;
}
pub... | mPlayStateObservable.notify(new UIStateMessage(mObserverHash, mVideoUrl, state)); | 3 |
PinaeOS/rafiki | src/example/java/org/pinae/rafiki/Demo.java | [
"public interface Job {\n\n\t/**\n\t * 获得作业名称\n\t * \n\t * @return 作业名称\n\t */\n\tpublic String getName();\n\n\t/**\n\t * 作业执行内容\n\t * \n\t * @return 作业是否执行成功 true: 作业执行成功; false: 作业执行失败\n\t * \n\t * @throws JobException 作业执行异常\n\t */\n\tpublic boolean execute() throws JobException;\n\n}",
"public class JobExcept... | import java.util.Date;
import org.pinae.rafiki.job.Job;
import org.pinae.rafiki.job.JobException;
import org.pinae.rafiki.task.Task;
import org.pinae.rafiki.task.TaskContainer;
import org.pinae.rafiki.trigger.impl.CronTrigger; | package org.pinae.rafiki;
public class Demo {
public static void main(String arg[]) throws Exception {
Task task = new Task();
Job job = new Job() {
public String getName() {
return "DelayJob";
}
| public boolean execute() throws JobException { | 1 |
Nilhcem/devoxxfr-2016 | app/src/main/java/com/nilhcem/devoxxfr/ui/schedule/day/ScheduleDayFragment.java | [
"@DebugLog\npublic class DevoxxApp extends Application {\n\n private AppComponent component;\n\n public static DevoxxApp get(Context context) {\n return (DevoxxApp) context.getApplicationContext();\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n AndroidThreeTen... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.hannesdorfmann.fragmentargs.annotation.Arg;
i... | package com.nilhcem.devoxxfr.ui.schedule.day;
@FragmentWithArgs
public class ScheduleDayFragment extends BaseFragment<ScheduleDayPresenter> implements ScheduleDayView, ScheduleDayEntry.OnSessionClickListener {
@Arg boolean allSessions;
@Arg ScheduleDay scheduleDay;
@Inject Picasso picasso;
@Inje... | public void initSlotsList(List<ScheduleSlot> slots) { | 3 |
ceefour/webdav-servlet | src/main/java/net/sf/webdav/methods/DoLock.java | [
"public interface ITransaction {\n\n Principal getPrincipal();\n\n}",
"public interface IWebdavStore {\n\n /**\n * Life cycle method, called by WebdavServlet's destroy() method. Should be used to clean up resources.\n */\n void destroy();\n\n /**\n * Indicates that a new request or transac... | import java.io.IOException;
import java.util.HashMap;
import java.util.Hashtable;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilder;
import net.sf.webdav.ITransaction;
import net.sf.webdav.IWebdavS... | /*
* Copyright 1999,2004 The Apache Software Foundation.
*
* 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... | private IWebdavStore _store; | 1 |
BlochsTech/BitcoinCardTerminal | src/com/blochstech/bitcoincardterminal/ViewModel/ChargePageVM.java | [
"public enum Currency {\n\tMicroBitcoins(0),\n\tApples(1),\n\tYuans(2),\n\tDollars(3),\n\tEuros(4),\n\tBitcoins(5);\n\t\n\tprivate int value;\n\tprivate Currency(int value) {\n\t this.value = value;\n\t}\n\tpublic int getValue() {\n return value;\n\t}\n\tpublic static Currency Convert(int value){\n\t\tif(0 <=... | import com.blochstech.bitcoincardterminal.Interfaces.Currency;
import com.blochstech.bitcoincardterminal.Model.Model;
import com.blochstech.bitcoincardterminal.Model.Communication.CurrencyApiConnector;
import com.blochstech.bitcoincardterminal.Utils.Event;
import com.blochstech.bitcoincardterminal.Utils.EventListener;
... | package com.blochstech.bitcoincardterminal.ViewModel;
public class ChargePageVM {
public Event<Object> UpdateEvent;
private Object fireKey = new Object(); | private EventListener<Object> modelListener = new ModelListener(); | 4 |
ysmintor/Retrofit2RxjavaDemo | app/src/main/java/york/com/retrofit2rxjavademo/activity/MainActivity.java | [
"public class MockBean {\n /**\n * address : 北京市海淀区清华大学\n * website : www.tsinghua.edu.cn\n * email : zsb@mail.tsinghua.edu.cn\n * parent : 教育部\n * type : 211 985\n * phone : 010-62770334;010-62782051\n * info : 院士:68人 博士点:198个 硕士点:181个\n * city : 北京\n * name : 清华大学\n * p... | import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import java.util.List;
import javax.inject.Inject;
import butterknife.B... | package york.com.retrofit2rxjavademo.activity;
public class MainActivity extends AppCompatActivity {
private static String TAG = "MainActivity";
@Bind(R.id.tv_result_one)
TextView resultOne;
@Bind(R.id.tv_result_two)
TextView resultTwo;
@Bind(R.id.btn_rxsubscriber)
Button mBtnRxsubscrib... | .compose(new DefaultTransformer<List<MockBean>>()) | 0 |
onyxbits/TradeTrax | src/main/java/de/onyxbits/tradetrax/pages/tools/Importer.java | [
"public class IdentUtil {\n\n\t/**\n\t * For autocompletion using the name table\n\t * \n\t * @param session\n\t * database session to use\n\t * @param partial\n\t * what the user entered so far\n\t * @return list of matching labels\n\t */\n\t@SuppressWarnings(\"unchecked\")\n\tpublic static <T> L... | import java.io.StringReader;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Vector;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.apa... | package de.onyxbits.tradetrax.pages.tools;
/**
* Simple tool for batch importing CSV assets.
*
* @author patrick
*
*/
public class Importer {
@Inject
private AlertManager alertManager;
@Inject
private SettingsStore settingsStore;
@Inject
private BeanModelSource ledgerSource;
@Inject
private Messa... | Name name = new Name(); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.