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 |
|---|---|---|---|---|---|---|
michel-kraemer/vertx-lang-typescript | src/test/java/de/undercouch/vertx/lang/typescript/TestExamplesRunner.java | [
"public class InMemoryCache implements Cache {\r\n // TODO use soft keys\r\n private Map<Source, String> cache = new HashMap<>();\r\n \r\n @Override\r\n public String get(Source src) {\r\n return cache.get(src);\r\n }\r\n\r\n @Override\r\n public void put(Source src, String value) {\r\n cache.put(src,... | import de.undercouch.vertx.lang.typescript.compiler.Source;
import de.undercouch.vertx.lang.typescript.compiler.SourceFactory;
import de.undercouch.vertx.lang.typescript.compiler.TypeScriptCompiler;
import de.undercouch.vertx.lang.typescript.compiler.V8Compiler;
import java.io.File;
import java.io.IOException;
im... | private TypeScriptCompiler getV8Compiler() {
if (v8Compiler == null) {
v8Compiler = new V8Compiler();
}
return v8Compiler;
}
private boolean containsEndsWith(Set<String> haystack, String needle) {
for (String s : haystack) {
if (needle.endsWith(s)) {
return true;
... | getClass().getClassLoader(), compiler, new InMemoryCache());
| 0 |
OTBProject/OTBProject | src/main/java/com/github/otbproject/otbproject/gui/GuiController.java | [
"public class Control {\n private static volatile boolean firstStart = true;\n private static volatile boolean running = false;\n private static volatile Bot bot = NullBot.INSTANCE;\n\n private Control() {}\n\n public static Bot bot() {\n return bot;\n }\n\n /**\n * Sets the bot to t... | import com.github.otbproject.otbproject.bot.Bot;
import com.github.otbproject.otbproject.bot.Control;
import com.github.otbproject.otbproject.channel.Channel;
import com.github.otbproject.otbproject.channel.ChannelProxy;
import com.github.otbproject.otbproject.cli.commands.CmdParser;
import com.github.otbproject.otbpro... | package com.github.otbproject.otbproject.gui;
public class GuiController {
@FXML
public TextArea logOutput;
@FXML
public TextArea commandsOutput;
@FXML
public TextField commandsInput;
@FXML
public TextArea cliOutput;
@FXML
public MenuItem openBaseDir;
@FXML
public Me... | CmdParser.processLineAndThen(input, InternalMessageSender.CLI, | 1 |
cash1981/civilization-boardgame-rest | src/main/java/no/asgari/civilization/server/action/BaseAction.java | [
"public class MessageDTO {\n\n private final String message;\n\n @JsonCreator\n public MessageDTO(@JsonProperty(\"msg\") String message) {\n this.message = message;\n }\n\n @JsonProperty(\"msg\")\n public String getMessage() {\n return message;\n }\n\n}",
"@NoArgsConstructor\n@J... | import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import com.google.common.base.Preconditions;
import com.mongodb.DB;
import lombok.extern.log4j.Log4j;
import no.asgari.civilization.server.dto.MessageDTO;
import no.asgari.civilization.server.model.Draw;
import no.asgari.civilization.server.model.GameL... | /*
* Copyright (c) 2015 Shervin Asgari
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | protected GameLog createLog(Item item, String pbfId, GameLog.LogType logType, String playerId) { | 3 |
ollipekka/gdx-soundboard | core/src/com/gdx/musicevents/MusicState.java | [
"public interface Effect {\n public void update(float dt);\n public boolean isDone();\n}",
"public class Play implements StartEffect {\n\n \n private MusicState nextState;\n \n public Play() {\n }\n\n @Override\n public void beginStart() {\n nextState.play();\n nextState.s... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Music.OnCompletionListener;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.gdx.musicevents.effects.Effect;
import com.gdx.musicevents.effects.... | package com.gdx.musicevents;
public class MusicState implements OnCompletionListener{
private final String name;
private final Array<Track> tracks = new Array<Track>();
private final ObjectMap<String, StartEffect> enterTransitions = new ObjectMap<String, StartEffect>();
private final ObjectMap<... | effect = new Play(); | 1 |
oosthuizenr/Livingstone | app/src/main/java/com/livingstoneapp/fragments/RequestedFeaturesFragment.java | [
"public class DividerItemDecoration extends RecyclerView.ItemDecoration {\n\n private static final int[] ATTRS = new int[]{\n android.R.attr.listDivider\n };\n\n public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;\n\n public static final int VERTICAL_LIST = LinearLayoutM... | import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
... | package com.livingstoneapp.fragments;
/**
* Created by renier on 2/18/2016.
*/
public class RequestedFeaturesFragment extends Fragment implements IRequestedFeaturesFragmentView {
private static final String ARG_PACKAGE_NAME = "package_name_param";
@Inject
IRequestedFeaturesFragmentPresenter mPresent... | MainApplication.from(getActivity()).getGraph().inject(this); | 1 |
MatejTymes/JavaFixes | src/test/java/javafixes/object/LazyTest.java | [
"public class Runner extends MonitoringTaskSubmitter implements ShutdownInfo, AutoCloseable {\n\n private final AtomicBoolean wasShutdownTriggered = new AtomicBoolean(false);\n private final AtomicInteger failedToStart = new AtomicInteger(0);\n\n /**\n * Constructs a runner with specific number of exec... | import javafixes.concurrency.Runner;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent... | package javafixes.object;
@RunWith(MockitoJUnitRunner.class)
public class LazyTest {
@Mock
private Callable<UUID> valueInitializer;
@Test(expected = IllegalArgumentException.class)
public void shouldFailToInitializeLazyWithNullValueProvider() {
new Lazy<String>(null);
}
@Test
... | List<Future<UUID>> results = newList(); | 1 |
recoilme/freemp | app/src/main/java/org/freemp/droid/playlist/albums/FragmentAlbums.java | [
"public class ClsTrack implements Serializable {\n\n private static final long serialVersionUID = 1L;\n private String artist;\n private String title;\n private String album;\n private String composer;\n private int year;\n private int track;\n private int duration;\n private String path;... | import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.L... | package org.freemp.droid.playlist.albums;
/**
* Created by recoil on 02.06.14.
*/
public class FragmentAlbums extends Fragment implements TaskGetAlbums.OnTaskGetAlbums, TaskGetAlbums.OnProgressUpdateMy {
public AdpArtworks adapter;
private Activity activity;
private AQuery aq;
//UI
private G... | ClsTrack track = (ClsTrack) adapter.getItem(position); | 0 |
jenkinsci/promoted-builds-plugin | src/test/java/hudson/plugins/promoted_builds/conditions/inheritance/DownstreamPassConditionInheritanceTest.java | [
"public final class JobPropertyImpl extends JobProperty<AbstractProject<?,?>> implements ItemGroup<PromotionProcess> {\n /**\n * These are loaded from the disk in a different way.\n */\n private transient /*final*/ List<PromotionProcess> processes = new ArrayList<PromotionProcess>();\n\n /**\n ... | import hudson.plugins.promoted_builds.JobPropertyImpl;
import hudson.plugins.promoted_builds.PromotedBuildAction;
import hudson.plugins.promoted_builds.PromotionProcess;
import hudson.plugins.promoted_builds.Status;
import hudson.plugins.promoted_builds.conditions.DownstreamPassCondition;
import hudson.plugins.promoted... | /*
* The MIT License
*
* Copyright 2015 Franta Mejta
*
* 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, mod... | final Status promotion = action.getPromotion("promotion"); | 3 |
sylvainhalle/Bullwinkle | Source/Examples/src/BuildExamplePop.java | [
"public class BnfParser implements Serializable\n{\n\t/**\n\t * Dummy UID\n\t */\n\tprivate static final transient long serialVersionUID = 1L;\n\n\t/**\n\t * The list of parsing rules\n\t */\n\tprivate LinkedList<BnfRule> m_rules;\n\n\t/**\n\t * The start rule to be used for the parsing\n\t */\n\tprivate BnfRule m_... | import java.io.IOException;
import ca.uqac.lif.bullwinkle.BnfParser;
import ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException;
import ca.uqac.lif.bullwinkle.BnfParser.ParseException;
import ca.uqac.lif.bullwinkle.Builds;
import ca.uqac.lif.bullwinkle.ParseNode;
import ca.uqac.lif.bullwinkle.ParseTreeObjectBuilde... | /* MIT License
*
* Copyright 2014-2021 Sylvain Hallé
*
* Laboratoire d'informatique formelle
* Université du Québec à Chicoutimi, Canada
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the So... | ParseNode tree = parser.parse("(10 ÷ (2 × 3)) + (6 - 4)"); | 3 |
futurice/meeting-room-tablet | app/src/main/java/com/futurice/android/reservator/view/LobbyReservationRowView.java | [
"public class ReservatorApplication extends Application {\n private final long ADDRESS_CACHE_CLEAR_INTERVAL = 6 * 60 * 60 * 1000; // Once every six hours\n Runnable clearAddressCache = new Runnable() {\n @Override\n public void run() {\n getAddressBook().refetchEntries();\n ... | import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.graphics.Typeface;
import android.os.AsyncTask;
import android.util.AttributeSet;
import android.view.Vi... | package com.futurice.android.reservator.view;
public class LobbyReservationRowView extends FrameLayout implements
OnClickListener, OnItemClickListener {
@BindView(R.id.cancelButton)
ImageButton cancelButton;
@BindView(R.id.bookNowButton)
Button bookNowButton;
@BindView(R.id.titleLayout... | ReservatorApplication application; | 0 |
Rai220/Telephoto | app/src/main/java/com/rai220/securityalarmbot/photo/Observer.java | [
"public class BotService extends Service implements MotionDetectorController.MotionDetectorListener, IStartService {\n public static final String TELEPHOTO_SERVICE_STOPPED = \"TELEPHOTO_SERVICE_STOPPED\";\n\n private TelegramService telegramService;\n private BatteryReceiver batteryReceiver;\n private S... | import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import com.rai220.securityalarmbot.BotService;
import com.rai220.securityalarmbot.prefs.Prefs;
import com.rai220.securityalarmbot.prefs.PrefsController;
import com.rai220.securityalarmbot.telegram.ISenderService;
import com.rai220.securityalarmbot.u... | package com.rai220.securityalarmbot.photo;
/**
*
*/
public class Observer {
private ScheduledExecutorService es = Executors.newScheduledThreadPool(1);
private ScheduledFuture future;
private HiddenCamera2 hiddenCamera2;
private ISenderService senderService;
private final LinkedList<ImageShot... | Prefs prefs = PrefsController.instance.getPrefs(); | 1 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/tasks/StartupProvider.java | [
"public class MoePlugin extends AbstractMoePlugin {\n\n private static final Logger LOG = Logging.getLogger(MoePlugin.class);\n\n private static final String MOE_ARCHS_PROPERTY = \"moe.archs\";\n\n @NotNull\n private MoeExtension extension;\n\n @NotNull\n @Override\n public MoeExtension getExte... | import org.gradle.api.GradleException;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.SourceSet;
import org.moe.gradle.MoePlugin;
import org.moe.gradle.anns.IgnoreUnu... | /*
Copyright (C) 2016 Migeran
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | final Path out = Paths.get(MoePlugin.MOE, sourceSet.getName(), "startup-provider", mode.name); | 0 |
material-motion/material-motion-android | library/src/main/java/com/google/android/material/motion/interactions/MaterialSpring.java | [
"public class ConstraintApplicator<T> {\n\n private final Operation<T, T>[] constraints;\n\n public ConstraintApplicator(Operation<T, T>[] constraints) {\n this.constraints = constraints;\n }\n\n public MotionObservable<T> apply(MotionObservable<T> stream) {\n for (Operation<T, T> constraint : constraints... | import android.util.Property;
import com.google.android.material.motion.ConstraintApplicator;
import com.google.android.material.motion.Interaction;
import com.google.android.material.motion.MotionObservable;
import com.google.android.material.motion.MotionRuntime;
import com.google.android.material.motion.ReactiveProp... | /*
* Copyright 2017-present The Material Motion Authors. 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
*
* ... | public void apply(MotionRuntime runtime, O target, ConstraintApplicator<T> constraints) { | 0 |
dkzwm/SmoothRefreshLayout | app/src/main/java/me/dkzwm/widget/srl/sample/ui/WithViewPagerActivity.java | [
"public abstract class RefreshingListenerAdapter implements SmoothRefreshLayout.OnRefreshListener {\n @Override\n public void onRefreshing() {}\n\n @Override\n public void onLoadingMore() {}\n}",
"public class SmoothRefreshLayout extends ViewGroup\n implements NestedScrollingParent3, NestedScro... | import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;
import com.Toxic... | package me.dkzwm.widget.srl.sample.ui;
/**
* Created by dkzwm on 2017/6/1.
*
* @author dkzwm
*/
public class WithViewPagerActivity extends AppCompatActivity {
private static final int[] sColors =
new int[] {Color.WHITE, Color.GREEN, Color.YELLOW, Color.BLUE, Color.RED, Color.BLACK}; | private SmoothRefreshLayout mRefreshLayout; | 1 |
eckig/graph-editor | core/src/main/java/de/tesis/dynaware/grapheditor/core/ModelEditingManager.java | [
"public interface SkinLookup {\n\n /**\n * Gets the skin for the given node.\n *\n * @param node a {@link GNode} instance\n *\n * @return the associated {@link GNodeSkin} instance\n */\n GNodeSkin lookupNode(final GNode node);\n\n /**\n * Gets the skin for the given connector.\n... | import java.util.Collection;
import java.util.function.BiFunction;
import java.util.function.Function;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.ecore.EObject;
import de.tesis.dynaware.grapheditor.SkinLookup;
import de.tesis.dynaware.grapheditor.model.GConnection;
import de.tesis.dyna... | /*
* Copyright (C) 2005 - 2014 by TESIS DYNAware GmbH
*/
package de.tesis.dynaware.grapheditor.core;
/**
* Provides utility methods to edit the graph model via EMF commands.
*/
public interface ModelEditingManager
{
/**
* Initializes the model editing manager for the given model insta... | void initialize(final GModel model);
| 2 |
MADEAPPS/AdFlake-Client-Android | AdFlake-SDK/src/com/adflake/AdFlakeLayout.java | [
"public abstract class AdFlakeAdapter\n{\n\t/**\n\t * Instantiates a new ad flake adapter.\n\t * \n\t * @param adFlakeLayout\n\t * the ad flake layout\n\t * @param ration\n\t * the ration\n\t */\n\tpublic AdFlakeAdapter(AdFlakeLayout adFlakeLayout, Ration ration)\n\t{\n\t\t_adFlakeLayoutRefere... | import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import org.apache.http.client.ClientProtocolException;
import org.apache.h... |
if (!this.isInEditMode())
{
scheduler.schedule(new UpdateAdFlakeConfigurationRunnable(this, adFlakeKey), 0, TimeUnit.SECONDS);
}
setHorizontalScrollBarEnabled(false);
setVerticalScrollBarEnabled(false);
this._maximumWidth = 0;
this._maximumHeight = 0;
}
/**
* On measure.
*
* @param widthMea... | this._currentAdapter = AdFlakeAdapter.getAdapterForRation(this, nextRation, true); | 0 |
programingjd/okserver | src/test/java/info/jdavid/ok/server/handler/DigestAuthHandlerTest.java | [
"@SuppressWarnings({ \"WeakerAccess\" })\npublic class HttpServer {\n\n final AtomicBoolean started = new AtomicBoolean();\n final AtomicBoolean setup = new AtomicBoolean();\n int port = 8080; // 80\n int securePort = 8181; // 443\n String hostname = null;\n long maxRequestSize = 65536;\n Dispatcher dispatch... | import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.DefaultCredentialsProvider;
impo... | package info.jdavid.ok.server.handler;
@SuppressWarnings("ConstantConditions")
public class DigestAuthHandlerTest {
| private static final HttpServer SERVER = new HttpServer(); //.dispatcher(new Dispatcher.Logged()); | 0 |
ihongs/HongsCORE | hongs-serv-search/src/main/java/io/github/ihongs/dh/lucene/LuceneRecord.java | [
"public final class Cnst {\n\n //** 默认取值 **/\n\n public static final String LANG_DEF = \"zh_CN\"; // 默认语言\n\n public static final String ZONE_DEF = \"GMT+8\"; // 默认时区\n\n public static final int RN_DEF = 20 ; // 默认每页行数\n\n //** 查询参数 **/\n\n public static final String ID_KEY = \"id\"; // 编号\n... | import io.github.ihongs.Cnst;
import io.github.ihongs.Core;
import io.github.ihongs.CoreConfig;
import io.github.ihongs.CoreLogger;
import io.github.ihongs.HongsException;
import io.github.ihongs.HongsExemption;
import io.github.ihongs.action.FormSet;
import io.github.ihongs.dh.IEntity;
import io.github.ihongs.dh.JFigu... | package io.github.ihongs.dh.lucene;
/**
* Lucene 记录模型
*
* 可选字段配置参数:
* lucene-tokenizer Lucene 分词器类
* lucene-char-filter 存储时使用的 CharFilter 类
* lucene-token-filter 存储时使用的 TokenFilter 类
* lucene-find-filter 查询时使用的 CharFilter 类
* lucene-query-filter 查询时使用的 TokenFilter 类
* lucene-smart-parse 为 tru... | path = Syno.inject(path, m); | 3 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner18.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.util.Comparator;
import org.metacsp.multi.spatioTemporal.paths.PoseSteering;
import com.vividsolutions.jts.geom.Coordinate;
import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel;
import se.oru.coordination.coordination_oru.CriticalSection;
import se.oru.coordination.coordination_oru.M... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "One-shot navigation of 3 robots coordinating on static paths that overlap in a straight portion.")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner18 {
public static void main(String[] args) throws InterruptedException {... | PoseSteering[] path1 = Missions.loadPathFromFile("paths/debug1.path"); | 7 |
PLNech/BactMan-Adventures | app/src/main/java/fr/plnech/igem/game/bins/Item.java | [
"public class BinGame extends PortraitGame {\r\n\r\n private final ArrayList<Item> items = new ArrayList<>();\r\n private final ArrayList<Integer> deadItems = new ArrayList<>();\r\n private final ArrayList<Bin> bins = new ArrayList<>();\r\n private final HashMap<Bin.Type, Bin> binMap = new HashMap<>();\... | import android.util.Log;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.BodyDef;
import fr.plnech.igem.game.BinGame;
import fr.plnech.igem.game.PortraitGameActivity;
import fr.plnech.igem.game.model.PhysicalWorldObject;
import fr.plnech.igem.game.model.TouchableAnimatedSprite;
import... | private static final float BODY_DENSITY = 1;
private static final float BODY_ELASTICITY = 0.5f;
private static final float BODY_FRICTION = 0.125f;
private static short ID = 0;
private final BinGame game;
private final int id;
private int value = 1;
private final Type type;
... | if (x < 0 || y < 0 || x > PortraitGameActivity.CAMERA_WIDTH || y > PortraitGameActivity.CAMERA_HEIGHT) {
| 1 |
WSDOT/Archetypes | archetypes/mgwt-basic/src/main/java/gov/wa/wsdot/apps/mgwtbasic/client/PhoneActivityMapper.java | [
"public class AboutActivity extends MGWTAbstractActivity implements\n\t\tAboutView.Presenter {\n\n\tprivate final ClientFactory clientFactory;\n\tprivate AboutView view;\n\tprivate EventBus eventBus;\n\n\tpublic AboutActivity(ClientFactory clientFactory) {\n\t\tthis.clientFactory = clientFactory;\n\t}\n\n\t@Overrid... | import gov.wa.wsdot.apps.mgwtbasic.client.activities.about.AboutActivity;
import gov.wa.wsdot.apps.mgwtbasic.client.activities.about.AboutPlace;
import gov.wa.wsdot.apps.mgwtbasic.client.activities.home.HomeActivity;
import gov.wa.wsdot.apps.mgwtbasic.client.activities.home.HomePlace;
import gov.wa.wsdot.apps.mgwtbasic... | package gov.wa.wsdot.apps.mgwtbasic.client;
public class PhoneActivityMapper implements ActivityMapper {
private final ClientFactory clientFactory;
public PhoneActivityMapper(ClientFactory clientFactory) {
this.clientFactory = clientFactory;
}
@Override
public Activity getActivity(Place place) {
if (plac... | return new HomeActivity(clientFactory); | 2 |
ivoa/lyonetia | src/adql-validator/test/cds/adql/validation/report/MarkdownReportTest.java | [
"public class ValidationException extends Exception {\n\n public ValidationException() {\n super();\n }\n\n public ValidationException(String s) {\n super(s);\n }\n\n public ValidationException(String s, Throwable throwable) {\n super(s, throwable);\n }\n\n public Validatio... | import adql.parser.ADQLParser;
import cds.adql.validation.ValidationException;
import cds.adql.validation.query.Contact;
import cds.adql.validation.query.Publisher;
import cds.adql.validation.query.ValidationQuery;
import cds.adql.validation.query.ValidationSet;
import org.junit.jupiter.api.AfterEach;
import org.junit.... | package cds.adql.validation.report;
class MarkdownReportTest {
private final static String LINE_SEP = System.lineSeparator();
private MarkdownReport report = null;
private ByteArrayOutputStream out = null;
private ByteArrayOutputStream err = null;
@BeforeEach
void setUp() {
out = ... | final ValidationSet validationSet = new ValidationSet(); | 4 |
Wondersoft/olaper | src/main/java/org/olap/server/driver/metadata/ServerDimension.java | [
"public class AttributeDefinition extends NamedElement{\n\tpublic boolean auto_hierarchy = true;\n}",
"public class HierarchyDefinition extends NamedElement{\n\tpublic List<String> levels;\n}",
"public abstract class NamedElement {\n\tpublic String name, caption;\n}",
"public class SharedDimensionDefinition e... | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.olap.server.database.AttributeDefinition;
import org.olap.server.database.HierarchyDefinition;
import org.olap.server.database.NamedElement;
import org.olap.server.database.SharedD... | package org.olap.server.driver.metadata;
public class ServerDimension implements Dimension{
private SharedDimensionDefinition definition;
private NamedList<Hierarchy> hierarchies;
private ServerSchema serverSchema;
public ServerDimension( SharedDimensionDefinition def, ServerSchema serverSchema) throws OlapEx... | hierarchies.add(new ServerHierarchy(this, cdef, Collections.singletonList((NamedElement)cdef))); | 2 |
annefried/sitent | de.uni-saarland.coli.sitent/src/main/java/sitent/syntSemFeatures/segment/SpeechModeFeaturesAnnotator.java | [
"public class Segment extends ClassificationAnnotation {\n /** @generated\n * @ordered \n */\n @SuppressWarnings (\"hiding\")\n public final static int typeIndexID = JCasRegistry.register(Segment.class);\n /** @generated\n * @ordered \n */\n @SuppressWarnings (\"hiding\")\n public final static int typ... | import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import o... | package sitent.syntSemFeatures.segment;
/**
* Selection of features which I hope to be useful for the identification of
* QUESTIONS and IMPERATIVES.
*
* TODO: contains some additional new features: split into different files.
*
* @author afried
*
*/
public class SpeechModeFeaturesAnnotator extends JCasA... | Collection<Segment> segments = JCasUtil.select(jCas, Segment.class); | 0 |
cm-heclouds/JAVA-HTTP-SDK | javaSDK/src/main/java/cmcc/iot/onenet/javasdk/api/datapoints/GetDatapointsListApi.java | [
"public abstract class AbstractAPI<T> {\n public String key;\n public String url;\n public Method method;\n public ObjectMapper mapper = initObjectMapper();\n\n private ObjectMapper initObjectMapper() {\n ObjectMapper objectMapper = new ObjectMapper();\n //关闭字段不识别报错\n objectMappe... | import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import cmcc.io... | package cmcc.iot.onenet.javasdk.api.datapoints;
public class GetDatapointsListApi extends AbstractAPI{
private HttpGetMethod HttpMethod;
private String datastreamIds;
private String start;
private String end;
private String devId;
private Integer duration;
private Integer limit;
private String cursor;
pri... | public BasicResponse<DatapointsList> executeApi() { | 5 |
taoneill/war | war/src/main/java/com/tommytony/war/job/RestoreYmlWarhubJob.java | [
"public class War extends JavaPlugin {\n\tstatic final boolean HIDE_BLANK_MESSAGES = true;\n\tpublic static War war;\n\tprivate static ResourceBundle messages = ResourceBundle.getBundle(\"messages\");\n\tprivate final List<OfflinePlayer> zoneMakerNames = new ArrayList<>();\n\tprivate final List<String> commandWhite... | import com.tommytony.war.War;
import com.tommytony.war.Warzone;
import com.tommytony.war.mapper.VolumeMapper;
import com.tommytony.war.structure.WarHub;
import com.tommytony.war.volume.Volume;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection;
import java.sql.SQLE... | package com.tommytony.war.job;
public class RestoreYmlWarhubJob implements Runnable {
private final ConfigurationSection warhubConfig;
public RestoreYmlWarhubJob(ConfigurationSection warhubConfig) {
this.warhubConfig = warhubConfig;
}
public void run() {
int hubX = warhubConfig.getInt("x");
int hubY = w... | Volume vol; | 4 |
stackify/stackify-api-java | src/main/java/com/stackify/api/common/log/LogAppender.java | [
"@AllArgsConstructor\n@NoArgsConstructor\n@Builder(builderClassName = \"Builder\", builderMethodName = \"newBuilder\", toBuilder = true)\n@Data\n@JsonInclude(JsonInclude.Include.NON_NULL)\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class LogMsg {\n\n /**\n * The log message\n */\n @Setter\n ... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.stackify.api.LogMsg;
import com.stackify.api.StackifyError;
import com.stackify.api.common.ApiConfiguration;
import com.stackify.api.common.AppIdentityService;
import com.stackify.api.common.error.ErrorGovernor;
import com.stackify.api.common.mask.Masker;
i... | /*
* Copyright 2014 Stackify
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... | private final ErrorGovernor errorGovernor = new ErrorGovernor(); | 4 |
skuzzle/restrict-imports-enforcer-rule | src/main/java/org/apache/maven/plugins/enforcer/RestrictImports.java | [
"public static void checkArgument(boolean condition) {\n checkArgument(condition, \"Unexpected argument\");\n}",
"public final class AnalyzeResult {\n\n private final List<MatchedFile> srcMatches;\n private final List<MatchedFile> testMatches;\n private final Duration duration;\n private final int ... | import static de.skuzzle.enforcer.restrictimports.util.Preconditions.checkArgument;
import java.io.File;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.... | package org.apache.maven.plugins.enforcer;
/**
* Enforcer rule which restricts the usage of certain packages or classes within a Java
* code base.
*/
public class RestrictImports extends BannedImportGroupDefinition implements EnforcerRule, EnforcerRule2 {
private static final Logger LOGGER = LoggerFactory.... | final BannedImportGroups groups = createGroupsFromPluginConfiguration(); | 5 |
mcxiaoke/Android-Next | samples/src/main/java/com/mcxiaoke/next/samples/ListViewExtendSamples.java | [
"public class SimpleTaskCallback<Result> implements TaskCallback<Result> {\n\n @Override\n public void onTaskStarted(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskFinished(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskCancelled(String name, Bun... | import android.annotation.TargetApi;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.mcxiaoke.next.task.SimpleTaskCallback;
import com.mcxiaoke.next.task.TaskCallback;
import com.mcxiaoke.next.task.TaskQueue;
import com.mcxiaoke.ne... | package com.mcxiaoke.next.samples;
/**
* EndlessListView使用示例
* User: mcxiaoke
* Date: 13-10-25
* Time: 下午4:44
*/
@TargetApi(VERSION_CODES.HONEYCOMB)
public class ListViewExtendSamples extends BaseActivity {
public static final String TAG = ListViewExtendSamples.class.getSimpleName();
@BindView(android.... | ListViewExtend mListView; | 3 |
SkaceKamen/sqflint | src/cz/zipek/sqflint/sqf/operators/ForEachOperator.java | [
"public class Linter extends SQFParser {\n\tpublic static final int CODE_OK = 0;\n\tpublic static final int CODE_ERR = 1;\n\t\n\tprivate final List<SQFParseException> errors = new ArrayList<>();\n\tprivate final List<Warning> warnings = new ArrayList<>();\n\t\n\tprivate final List<SQFInclude> includes = new ArrayLi... | import cz.zipek.sqflint.linter.Linter;
import cz.zipek.sqflint.linter.SQFParseException;
import cz.zipek.sqflint.sqf.SQFBlock;
import cz.zipek.sqflint.sqf.SQFContext;
import cz.zipek.sqflint.sqf.SQFExpression; | /*
* The MIT License
*
* Copyright 2016 Jan Zípek (jan at zipek.cz).
*
* 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
* t... | public void analyze(Linter source, SQFContext context, SQFExpression expression) { | 0 |
galan/jalita | src/main/java/net/sf/jalita/ui/forms/OptionForm.java | [
"public class TerminalEvent extends EventObject {\n\n\t//--------------------------------------------------------------------------\n\t// constants\n\t//--------------------------------------------------------------------------\n\n\t/** represents key F1 */\n\tpublic final static int KEY_F01 = -1;\n\n\t/** represen... | import net.sf.jalita.io.TerminalEvent;
import net.sf.jalita.io.TerminalIOInterface;
import net.sf.jalita.ui.automation.FormAutomationSet;
import net.sf.jalita.ui.widgets.ButtonListener;
import net.sf.jalita.ui.widgets.KeyLabelWidget;
import net.sf.jalita.ui.widgets.LabelWidget;
import net.sf.jalita.ui.widgets.LineWidge... | /***********************************************************************
* This software is published under the terms of the LGPL
* version 2.1, a copy of which has been included with this
* distribution in the 'lgpl.txt' file.
* Copyright (C) 2004 Daniel Galán y Martins
* Author: Daniel Galán y Martins
* Creatio... | keyOk = new KeyLabelWidget(this, "Ok..", TerminalEvent.KEY_ENTER, 15, 2, 18); | 0 |
jksiezni/xpra-client | xpra-client-android/src/main/java/com/github/jksiezni/xpra/client/AndroidXpraWindow.java | [
"public abstract class XpraWindow {\n\n\tprivate final int id;\n\tprivate final int parentId;\n\n\tprivate final boolean overrideRedirect;\n\n\tprivate int x;\n\tprivate int y;\n\tprivate int width;\n\tprivate int height;\n\tprivate int minimumWidth = 0;\n\tprivate int minimumHeight = 0;\n\n\tprivate boolean mapped... | import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import com.github.jksiezni.xpra.... | /*
* Copyright (C) 2020 Jakub Ksiezniak
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* ... | protected void onIconUpdate(WindowIcon windowIcon) { | 3 |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/PFASQLiteHelper.java | [
"@Entity(tableName = \"CITIES\", indices = {@Index(value = {\"city_name\", \"cities_id\"})})\npublic class City {\n\n private static final String UNKNOWN_POSTAL_CODE_VALUE = \"-\";\n\n @PrimaryKey @ColumnInfo(name = \"cities_id\") private int cityId;\n @ColumnInfo(name = \"city_name\") @NonNull private Str... | import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.readystatesoftware.... | private static final String CURRENT_WEATHER_CITY_ID = "city_id";
private static final String COLUMN_TIME_MEASUREMENT = "time_of_measurement";
private static final String COLUMN_WEATHER_ID = "weather_id";
private static final String COLUMN_TEMPERATURE_CURRENT = "temperature_current";
private static f... | final List<City> cities = fileReader.readCitiesFromFile(inputStream); | 0 |
Crab2died/Excel4J | src/test/java/base/Module2Excel.java | [
"public final class ExcelUtils {\n\n /**\n * 单例模式\n * 通过{@link ExcelUtils#getInstance()}获取对象实例\n */\n private static volatile ExcelUtils excelUtils;\n\n private ExcelUtils() {\n }\n\n /**\n * 双检锁保证单例\n */\n public static ExcelUtils getInstance() {\n if (null == excelUtil... | import com.github.crab2died.ExcelUtils;
import com.github.crab2died.exceptions.Excel4JException;
import com.github.crab2died.sheet.wrapper.MapSheetWrapper;
import com.github.crab2died.sheet.wrapper.NoTemplateSheetWrapper;
import com.github.crab2died.sheet.wrapper.NormalSheetWrapper;
import com.github.crab2died.sheet.wr... | classes.put("class_one", Arrays.asList(
new Student1("1010009", "李四", "一年级一班"),
new Student1("1010002", "古尔丹", "一年级三班")
));
classes.put("class_two", Collections.singletonList(
new Student1("1010008", "战三", "二年级一班")
));
classes.put("... | List<SimpleSheetWrapper> list = new ArrayList<>(); | 5 |
infovillasimius/amr2Fred | amr2Fred/src/amr2fred/Node.java | [
"public static final int ENDLESS = 1000;",
"public static final String RECURSIVE_ERROR = \" recursive error! \";",
"public enum NodeStatus {\n OK, AMR, ERROR, REMOVE\n}",
"public enum NodeType {\n NOUN, VERB, OTHER, AMR2FRED, FRED, COMMON\n}",
"public static final String AMR_INVERSE = \":+.+-of\";"
] | import static amr2fred.Glossary.ENDLESS;
import static amr2fred.Glossary.RECURSIVE_ERROR;
import amr2fred.Glossary.NodeStatus;
import static amr2fred.Glossary.NodeStatus.AMR;
import amr2fred.Glossary.NodeType;
import static amr2fred.Glossary.NodeType.OTHER;
import java.util.ArrayList;
import java.util.Objects;
import s... | /*
* Copyright (C) 2016 anto
*
* 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 distributed i... | private NodeType type; | 3 |
ypresto/miniguava | miniguava-collect-immutables/src/test/java/net/ypresto/miniguava/collect/immutables/ImmutableListTest.java | [
"public static class BuilderAddAllListGenerator\n extends TestStringListGenerator {\n @Override protected List<String> create(String[] elements) {\n return ImmutableList.<String>builder()\n .addAll(asList(elements))\n .build();\n }\n}",
"public static class BuilderReversedListGenerator\n ... | import static com.google.common.collect.Iterables.getOnlyElement;
import static com.google.common.collect.testing.features.CollectionFeature.ALLOWS_NULL_QUERIES;
import static com.google.common.collect.testing.features.CollectionFeature.SERIALIZABLE;
import static java.lang.reflect.Proxy.newProxyInstance;
import static... | /*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | suite.addTest(ListTestSuiteBuilder.using(new BuilderAddAllListGenerator()) | 0 |
ppicas/android-clean-architecture-mvp | core/src/main/java/cat/ppicas/cleanarch/owm/OWMCityRepository.java | [
"public class City {\n\n private String mId;\n private String mName;\n private String mCountry;\n private CurrentWeatherPreview mCurrentWeatherPreview;\n\n public City(String id, String name, String country) {\n mId = id;\n mName = name;\n mCountry = country;\n }\n\n public... | import java.util.ArrayList;
import java.util.List;
import cat.ppicas.cleanarch.model.City;
import cat.ppicas.cleanarch.model.CurrentWeatherPreview;
import cat.ppicas.cleanarch.owm.model.OWMCurrentWeather;
import cat.ppicas.cleanarch.owm.model.OWMCurrentWeatherList;
import cat.ppicas.cleanarch.repository.CityRepository; | /*
* Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | OWMCurrentWeather cw = mService.getCurrentWeatherByCityId(cityId); | 2 |
aeshell/aesh-extensions | aesh/src/main/java/org/aesh/extensions/highlight/scanner/SQLScanner.java | [
"public interface Encoder {\n\n void textToken(String text, TokenType type);\n\n void beginGroup(TokenType type);\n\n void endGroup(TokenType type);\n\n void beginLine(TokenType type);\n\n void endLine(TokenType type);\n\n public enum Type {\n TERMINAL, DEBUG\n }\n\n public abstract s... | import org.aesh.extensions.highlight.Encoder;
import org.aesh.extensions.highlight.Scanner;
import org.aesh.extensions.highlight.StringScanner;
import org.aesh.extensions.highlight.TokenType;
import org.aesh.extensions.highlight.WordList;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.MatchResul... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | public void scan(StringScanner source, Encoder encoder, Map<String, Object> options) { | 0 |
eurohlam/rss2kindle | rss-2-kindle-camel/src/main/java/org/roag/camel/polling/PollingResultHandler.java | [
"public class PollingException extends Exception {\n\n public PollingException(String message) {\n super(message);\n }\n\n public PollingException(String message, Throwable cause) {\n super(message, cause);\n }\n}",
"public interface SubscriberRepository {\n\n UserRepository getUserRe... | import org.roag.camel.PollingException;
import org.roag.ds.SubscriberRepository;
import org.roag.model.Rss;
import org.roag.model.RssStatus;
import org.roag.model.Subscriber;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.concurrent.Ti... | package org.roag.camel.polling;
/**
* Created by eurohlam on 9/08/2019.
*/
public class PollingResultHandler implements Runnable {
private final Logger logger = LoggerFactory.getLogger(PollingResultHandler.class);
private SubscriberRepository subscriberRepository;
private final String username;
p... | rss.setStatus(RssStatus.ACTIVE.toString()); | 3 |
flanglet/kanzi | java/src/main/java/kanzi/transform/ROLZCodec.java | [
"public interface ByteTransform\n{\n // Read src.length bytes from src.array[src.index], process them and\n // write them to dst.array[dst.index]. The index of each slice is updated\n // with the number of bytes respectively read from and written to.\n public boolean forward(SliceByteArray src, SliceByteArr... | import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.Map;
import kanzi.ByteTransform;
import kanzi.InputBitStream;
import kanzi.Memory;
import kanzi.OutputBitStream;
import kanzi.SliceByteArray;
import kanzi.bitstream.DefaultInputBitStream;
import kanzi.bitstream.DefaultOutputBitS... | {
final int count = input.length;
if (output.length - output.index < this.getMaxEncodedLength(count))
return false;
int srcIdx = input.index;
int dstIdx = output.index;
final byte[] src = input.array;
final byte[] dst = output.array;
fin... | ANSRangeEncoder litEnc = new ANSRangeEncoder(obs, litOrder); | 8 |
mreutegg/laszip4j | src/main/java/com/github/mreutegg/laszip4j/laszip/LASreadItemCompressed_POINT10_v2.java | [
"public static byte[] memcpy(byte[] dest, byte[] src, int num) {\n System.arraycopy(src, 0, dest, 0, num);\n return dest;\n}",
"static final byte[][] number_return_level =\n{\n { 0, 1, 2, 3, 4, 5, 6, 7 },\n { 1, 0, 1, 2, 3, 4, 5, 6 },\n { 2, 1, 0, 1, 2, 3, 4, 5 },\n { 3,... | import java.nio.ByteBuffer;
import static com.github.mreutegg.laszip4j.clib.Cstring.memcpy;
import static com.github.mreutegg.laszip4j.laszip.Common_v2.number_return_level;
import static com.github.mreutegg.laszip4j.laszip.Common_v2.number_return_map;
import static com.github.mreutegg.laszip4j.laszip.MyDefs.U32_ZERO_BI... | /*
* Copyright 2007-2012, martin isenburg, rapidlasso - fast tools to catch reality
*
* This is free software; you can redistribute and/or modify it under the
* terms of the GNU Lesser General Licence as published by the Free Software
* Foundation. See the LICENSE.txt file for more information.
*
* This software... | diff = ic_dy.decompress(median, (n==1 ? 1 : 0) + ( k_bits < 20 ? U32_ZERO_BIT_0(k_bits) : 20 )); | 3 |
DDoS/JICI | src/main/java/ca/sapon/jici/parser/name/ArrayTypeName.java | [
"public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ... | import ca.sapon.jici.evaluator.Environment;
import ca.sapon.jici.evaluator.EvaluatorException;
import ca.sapon.jici.evaluator.type.LiteralReferenceType;
import ca.sapon.jici.evaluator.type.LiteralType;
import ca.sapon.jici.util.StringUtil; | /*
* This file is part of JICI, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software... | final LiteralReferenceType arrayType = componentType.asArray(dimensions); | 2 |
jojenki/Concordia | lang/java/src/name/jenkins/paul/john/concordia/Concordia.java | [
"public class ConcordiaException extends Exception {\n\t/**\n\t * The version of this exception class.\n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n\t/**\n\t * Creates an exception with a reason why this exception was thrown.\n\t * \n\t * @param reason\n\t * The user-friendly reason this exc... | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.util.List;
import name.jenkins.paul.john.concordia.exception.ConcordiaException;
import name.jenkins.paul.john.concordia.jackson.ConcordiaDeserializer;
import name.jenkins.paul.john.conc... | package name.jenkins.paul.john.concordia;
/**
* <p>
* The driver class for Concordia.
* </p>
*
* <p>
* This class is immutable.
* </p>
*
* @author John Jenkins
*/
@JsonDeserialize(using = ConcordiaDeserializer.class)
public class Concordia implements Serializable {
/**
* The internal reader that conver... | ConcordiaException { | 0 |
SergioDim3nsions/RealmContactsForAndroid | presentation/src/main/java/sergio/vasco/androidforexample/presentation/sections/profile/ProfilePresenter.java | [
"public interface Bus {\n void post(Object object);\n void postInmediate(Object object);\n void register(Object object);\n void unregister(Object object);\n}",
"public interface InteractorInvoker {\n void execute(Interactor interactor);\n void execute(Interactor interactor, InteractorPriority priority);\n}"... | import sergio.vasco.androidforexample.domain.abstractions.Bus;
import sergio.vasco.androidforexample.domain.interactors.InteractorInvoker;
import sergio.vasco.androidforexample.domain.interactors.main.InsertContactsIntoDataBaseInteractor;
import sergio.vasco.androidforexample.presentation.Presenter;
import sergio.vasco... | package sergio.vasco.androidforexample.presentation.sections.profile;
/**
* Name: Sergio Vasco
* Date: 29/1/16.
*/
public class ProfilePresenter extends Presenter {
private ProfileView view; | private Bus bus; | 0 |
sksamuel/camelwatch | camelwatch-api/src/main/java/org/camelwatch/api/CamelJmxConnection.java | [
"public interface ConsumerOperations {\r\n\r\n\tvoid setInitialDelay(long initialDelay);\r\n\r\n\tObject start() throws Exception;\r\n\r\n\tObject stop() throws Exception;\r\n\r\n\tObject resume() throws Exception;\r\n\r\n\tObject suspend() throws Exception;\r\n}\r",
"public class ConsumerOperationsJmxImpl implem... | import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import org.camelwatch.api.consumer.ConsumerOperations;
import org.camelwatch.api.consumer.ConsumerOperationsJmxImpl;
import org.camelwatch.api.endpoint.EndpointOperations;
import org.cam... | package org.camelwatch.api;
/**
* @author Stephen K Samuel samspade79@gmail.com 29 Jun 2012 00:26:13
*
*/
public class CamelJmxConnection implements CamelConnection {
private final MBeanServerConnection conn;
private final Map<ObjectName, MBeanInfo> beanInfoCache;
public CamelJmxConnection(Str... | public RouteOperations getRouteOperations(String routeId) throws Exception {
| 4 |
sensorstorm/StormCV | stormcv-examples/src/nl/tno/stormcv/example/E1_GrayScaledTopology.java | [
"public class StormCVConfig extends Config{\n\n\tprivate static final long serialVersionUID = 6290659199719921212L;\n\n\t/**\n\t * <b>Boolean (default = false)</b> configuration parameter indicating if the spout must cache emitted tuples so they can be replayed\n\t */\n\tpublic static final String STORMCV_SPOUT_FAU... | import java.util.ArrayList;
import java.util.List;
import nl.tno.stormcv.StormCVConfig;
import nl.tno.stormcv.batcher.SlidingWindowBatcher;
import nl.tno.stormcv.bolt.BatchInputBolt;
import nl.tno.stormcv.bolt.SingleInputBolt;
import nl.tno.stormcv.fetcher.StreamFrameFetcher;
import nl.tno.stormcv.model.Frame;
import n... | package nl.tno.stormcv.example;
public class E1_GrayScaledTopology {
public static void main(String[] args){
// first some global (topology configuration)
StormCVConfig conf = new StormCVConfig();
conf.setNumWorkers(4); // number of workers in the topology
conf.setMaxSpoutPending(32); // maximum un-acked/u... | builder.setBolt("scale", new SingleInputBolt( new ScaleImageOp(0.66f)), 1) | 3 |
Esri/vehicle-commander-java | source/VehicleCommander/src/com/esri/vehiclecommander/view/MainMenuJPanel.java | [
"public class AdvancedSymbolController extends com.esri.militaryapps.controller.AdvancedSymbolController implements MessageControllerListener {\n \n public static final String SPOT_REPORT_LAYER_NAME = \"Spot Reports\";\n\n private final MapController mapController;\n private final MessageGroupLayer grou... | import com.esri.core.geometry.Point;
import com.esri.core.gps.Satellite;
import com.esri.core.map.Graphic;
import com.esri.core.symbol.advanced.SymbolProperties;
import com.esri.map.Layer;
import com.esri.map.LayerInitializeCompleteEvent;
import com.esri.map.LayerInitializeCompleteListener;
import com.esri.milit... | /*******************************************************************************
* Copyright 2012-2015 Esri
*
* 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.... | private final MapController mapController;
| 3 |
guiying712/AndroidModulePattern | module_main/src/main/java/com/guiying/module/main/BottomNavigationActivity.java | [
"@Keep\npublic abstract class BaseActivity extends AppCompatActivity {\n\n\n /**\n * 封装的findViewByID方法\n */\n @SuppressWarnings(\"unchecked\")\n protected <T extends View> T $(@IdRes int id) {\n return (T) super.findViewById(id);\n }\n\n\n @Override\n protected void onCreate(Bundle ... | import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomNavigationView;
import android.view.MenuItem;
import com.guiying.module.common.base.BaseActivity;
import com.guiying.module.common.base.BaseFragment;
import com.gui... | package com.guiying.module.main;
/**
* <p> </p>
*
* @author 张华洋 2017/9/27 10:23
* @version V1.1
* @name BottomNavigationActivity
*/
public class BottomNavigationActivity extends BaseActivity {
private NoScrollViewPager mPager;
private List<BaseFragment> mFragments;
private FragmentAdapter mAdapte... | List<IViewDelegate> viewDelegates = ClassUtils.getObjectsWithInterface(this, IViewDelegate.class, "com.guiying.module.news"); | 3 |
mlaccetti/JavaPNS | src/test/java/javapns/test/SpecificNotificationTests.java | [
"public class Push {\n\n private static final Logger logger = LoggerFactory.getLogger(Push.class);\n\n private Push() {\n // empty\n }\n\n /**\n * Push a simple alert to one or more devices.\n *\n * @param message the alert message to push.\n * @param keystore a keystore containing your private ... | import javapns.Push;
import javapns.communication.exceptions.CommunicationException;
import javapns.communication.exceptions.KeystoreException;
import javapns.devices.Device;
import javapns.devices.implementations.basic.BasicDevice;
import javapns.notification.*;
import javapns.notification.transmission.NotificationThr... | package javapns.test;
/**
* Specific test cases intended for the project's developers.
*
* @author Sylvain Pedneault
*/
class SpecificNotificationTests extends TestFoundation {
private SpecificNotificationTests() {
// empty
}
/**
* Execute this class from the command line to run tests.
*
* @p... | deviceList.add(new BasicDevice(tokenToUse)); | 4 |
biafra23/EtherWallet | app/src/main/java/com/jaeckel/etherwallet/MainActivity.java | [
"interface Callback<T> {\n\n void onResult(T t);\n\n void onError(JSONRPC2Error error);\n}",
"public class EthAccountsResponse {\n\n public List<String> result;\n\n @Override\n public String toString() {\n return \"EthAccountsResponse{\" +\n// \"id='\" + id + '\\'' +\n// ... | import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.os.SystemClock;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActio... | sub.onNext(ethSyncingResult);
// sub.onCompleted();
}
@Override
public void onError(JSONRPC2Error error) {
Timber.d("onError(): %s", error.getMessage());
... | Observable<PersonalNewAccountResponse> personalNewAccountObservable = Observable.create( | 8 |
PROSRESEARCHCENTER/junitcontest | src/benchmarktool/src/main/java/sbst/benchmark/TestSuite.java | [
"public class JaCoCoLauncher {\n\n\tprivate String temp_folder;\n\tprivate String targetClass;\n\tprivate List<String> testCases;\n\tprivate String testFolder;\n\n\tprivate LinkedList<String> required_libraries; // it has to contain the CP required to run the tests\n\n\tprivate List<File> jar_to_instrument;\n\tpriv... | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
impor... | // if the test fail at this stage, then it should be ignored
if (result.getFailures().size() > 0) {
for (Failure fail : result.getFailures()){
String header = fail.getTestHeader();
if (header.contains("(")){
String testMethod = header.substring(0, header.indexOf('('));
String testClass ... | MutationsEvaluator evaluator = new MutationsEvaluator(cp, cut, fixedTestClasses, this.flakyTests); | 4 |
KostyaSha/github-integration-plugin | github-pullrequest-plugin/src/main/java/com/github/kostyasha/github/integration/multibranch/handler/GitHubBranchHandler.java | [
"public class GitHubBranchCause extends AbstractGitHubBranchCause<GitHubBranchCause> {\n private static final Logger LOG = LoggerFactory.getLogger(GitHubBranchCause.class);\n\n private final String branchName;\n\n public GitHubBranchCause(@NonNull GitHubBranch localBranch, @NonNull GitHubBranchRepository l... | import com.github.kostyasha.github.integration.branch.GitHubBranchCause;
import com.github.kostyasha.github.integration.branch.GitHubBranchRepository;
import com.github.kostyasha.github.integration.branch.events.GitHubBranchEvent;
import com.github.kostyasha.github.integration.branch.webhook.BranchInfo;
import com.gith... | package com.github.kostyasha.github.integration.multibranch.handler;
/**
* @author Kanstantsin Shautsou
*/
public class GitHubBranchHandler extends GitHubHandler {
private List<GitHubBranchEvent> events = new ArrayList<>();
@DataBoundConstructor
public GitHubBranchHandler() {
}
public List<G... | GitHubSCMSource source = context.getSource(); | 3 |
carrotsearch/smartsprites | src/main/java/org/carrot2/labs/smartsprites/SpriteImageRenderer.java | [
"public enum PngDepth\n{\n AUTO, INDEXED, DIRECT;\n}",
"public enum Ie6Mode\n{\n /** No IE6-friendly image will be created for this sprite, even if needed */\n NONE,\n\n /** IE6-friendly image will be generated for this sprite if needed */\n AUTO;\n\n private String value;\n\n private Ie6Mode... | import java.awt.Color;
import java.awt.image.BufferedImage;
import org.carrot2.labs.smartsprites.SmartSpritesParameters.PngDepth;
import org.carrot2.labs.smartsprites.SpriteImageDirective.Ie6Mode;
import org.carrot2.labs.smartsprites.SpriteImageDirective.SpriteImageFormat;
import org.carrot2.labs.smartsprites.message.M... | package org.carrot2.labs.smartsprites;
/**
* Applies color quantization to the merged sprite image if required.
*/
public class SpriteImageRenderer
{
/** This builder's configuration */
public final SmartSpritesParameters parameters;
/** This builder's message log */
private final MessageLog messa... | final ColorReductionInfo colorReductionInfo = ColorQuantizer | 7 |
bit-man/SwissArmyJavaGit | javagit/src/main/java/edu/nyu/cs/javagit/api/commands/GitCheckout.java | [
"public class Ref {\n\n /*\n * TODO (jhl388): add the field \"isCurrentBranch\" to indicate if the ref is the current working\n * branch. Refs of the current working branch and all HEAD refs should have the value \"true\". All\n * other refs should have the value \"false\".\n */\n\n /**\n * An enumerati... | import java.io.File;
import java.io.IOException;
import java.util.List;
import edu.nyu.cs.javagit.api.JavaGitException;
import edu.nyu.cs.javagit.api.Ref;
import edu.nyu.cs.javagit.api.Ref.RefType;
import edu.nyu.cs.javagit.client.ClientManager;
import edu.nyu.cs.javagit.client.IClient;
import edu.nyu.cs.javagit.client... | /*
* ====================================================================
* Copyright (c) 2008 JavaGit Project. All rights reserved.
*
* This software is licensed using the GNU LGPL v2.1 license. A copy
* of the license is included with the distribution of this source
* code in the LICENSE.txt file. The text o... | throw new JavaGitException(100000, ExceptionMessageMap.getMessage("100000") | 5 |
rust-keylock/rust-keylock-android | java/src/main/java/org/astonbitecode/rustkeylock/fragments/ListEntries.java | [
"public class MainActivity extends Activity implements BackButtonHandlable {\n private static MainActivity ACTIVE_ACTIVITY;\n\n public static MainActivity getActiveActivity() {\n return ACTIVE_ACTIVITY;\n }\n\n private final String TAG = getClass().getName();\n private Thread rustThread = null... | import android.app.ListFragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.wi... | // Copyright 2017 astonbitecode
// This file is part of rust-keylock password manager.
//
// rust-keylock 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 optio... | private List<JavaEntry> entries; | 3 |
wso2/jaggery | components/hostobjects/org.jaggeryjs.hostobjects.file/src/main/java/org/jaggeryjs/hostobjects/file/FileHostObject.java | [
"public class StreamHostObject extends ScriptableObject {\n\n private static final Log log = LogFactory.getLog(StreamHostObject.class);\n\n private static final String hostObjectName = \"Stream\";\n private InputStream stream = null;\n\n public StreamHostObject() {\n\n }\n\n @Override\n public ... | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jaggeryjs.hostobjects.stream.StreamHostObject;
import org.jaggeryjs.scriptengine.... | package org.jaggeryjs.hostobjects.file;
public class FileHostObject extends ScriptableObject {
private static final Log log = LogFactory.getLog(FileHostObject.class);
private static final String hostObjectName = "File";
public static final String JAVASCRIPT_FILE_MANAGER = "hostobjects.file.filemanager... | JaggeryContext context = (JaggeryContext) RhinoEngine.getContextProperty(EngineConstants.JAGGERY_CONTEXT); | 2 |
Vrael/eManga | app/src/main/java/com/emanga/emanga/app/fragments/MangaListFragment.java | [
"public class MainActivity extends ActionBarActivity\n\timplements ActionBar.TabListener, MangaListFragment.Callbacks {\n\t\n\tpublic static final String TAG = MainActivity.class.getName();\n\tpublic static final String ACTION_TASK_ENDED = TAG + \".TASKENDED\";\n public static final String ACTION_OPEN_MANGA = TA... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.widget.SimpleC... | package com.emanga.emanga.app.fragments;
/**
* A list fragment representing a list of Mangas. This fragment also supports
* tablet devices by allowing list items to be given an 'activated' state upon
* selection. This helps indicate which item is currently being viewed in a
* {@link MangaDetailFragment}.
* <p>... | new String[]{Manga.TITLE_COLUMN_NAME, Genre.NAME_COLUMN_NAME}, | 5 |
SilenceDut/NBAPlus | app/src/main/java/com/me/silencedut/nbaplus/rxmethod/RxStats.java | [
"public class GreenStat {\n\n private Long id;\n private String statentity;\n private String statkind;\n\n public GreenStat() {\n }\n\n public GreenStat(Long id) {\n this.id = id;\n }\n\n public GreenStat(Long id, String statentity, String statkind) {\n this.id = id;\n t... | import android.util.Log;
import com.me.silencedut.greendao.GreenStat;
import com.me.silencedut.greendao.GreenStatDao;
import com.me.silencedut.nbaplus.app.AppService;
import com.me.silencedut.nbaplus.data.Constant;
import com.me.silencedut.nbaplus.event.StatEvent;
import com.me.silencedut.nbaplus.model.Statistics;
impo... | package com.me.silencedut.nbaplus.rxmethod;
/**
* Created by SlienceDut on 2015/12/15.
*/
public class RxStats {
public static Subscription getPerStat(String ...statKinds) {
Subscription subscription = Observable.from(statKinds)
.flatMap(new Func1<String, Observable<Statistics>>() {
... | AppService.getBus().post(new StatEvent(statistics.getDailyStat().get(0).getStatkind(), labels,statValues,playerUrls)); | 4 |
taichi/siden | siden-core/src/test/java/ninja/siden/internal/FiltersHandlerTest.java | [
"@FunctionalInterface\npublic interface Filter {\n\n\tvoid filter(Request req, Response res, FilterChain chain) throws Exception;\n}",
"@FunctionalInterface\npublic interface FilterChain {\n\n\tObject next() throws Exception;\n}",
"public interface Request extends AttributeContainer {\n\n\tHttpMethod method();\... | import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertTrue;
import io.undertow.predicate.Predicates;
import io.undertow.server.HttpServerExchange;
import mockit.Mock;
import mockit.MockUp;
import mockit.Mocked;
import mockit.integration.junit4.JMockit;
import ninja.siden.Filter;
i... | /*
* Copyright 2014 SATO taichi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | Request request; | 2 |
mesosphere/mesos-rxjava | mesos-rxjava-example/mesos-rxjava-example-framework/src/test/java/com/mesosphere/mesos/rx/java/example/framework/sleepy/SleepySimulationTest.java | [
"public final class ProtobufMessageCodecs {\n\n private ProtobufMessageCodecs() {}\n\n /** A {@link MessageCodec} for {@link org.apache.mesos.v1.scheduler.Protos.Call Call}. */\n public static final MessageCodec<Protos.Call> SCHEDULER_CALL = new ProtoCodec<>(\n Protos.Call::parseFrom, Protos.Call::p... | import com.google.protobuf.ByteString;
import com.mesosphere.mesos.rx.java.protobuf.ProtobufMessageCodecs;
import com.mesosphere.mesos.rx.java.protobuf.SchedulerCalls;
import com.mesosphere.mesos.rx.java.test.Async;
import com.mesosphere.mesos.rx.java.test.simulation.MesosServerSimulation;
import org.apache.mesos.v1.sc... | /*
* Copyright (C) 2016 Mesosphere, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | public Async async = new Async(); | 2 |
hitherejoe/Pickr | app/src/main/java/com/hitherejoe/pickr/ui/activity/MainActivity.java | [
"public class PickrApplication extends Application {\n\n ApplicationComponent mApplicationComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree());\n\n mApplicationComponent = DaggerApplicationComponent.builde... | import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolba... | package com.hitherejoe.pickr.ui.activity;
public class MainActivity extends BaseActivity {
@Bind(R.id.layout_main)
CoordinatorLayout mLayoutRoot;
@Bind(R.id.progress_indicator)
ProgressBar mProgressBar;
@Bind(R.id.recycler_places)
RecyclerView mPoiRecycler;
@Bind(R.id.text_no_places... | mDataManager = PickrApplication.get(this).getComponent().dataManager(); | 0 |
groupon/Message-Bus | mbus-java/src/main/java/com/groupon/messagebus/client/examples/ProducerQueueExample_test.java | [
"public enum DestinationType{\n QUEUE,\n TOPIC\n}",
"public class HostParams {\n private String host;\n private int port;\n\n public HostParams(String aHost, int aPort) {\n host = aHost;\n port = aPort;\n }\n\n public String getHost() {\n return host;\n }\n\n ... | import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import com.groupon.messagebus.client.*;
import com.groupon.messagebus.api.DestinationType;
im... | package com.groupon.messagebus.client.examples;
/*
* Copyright (c) 2013, Groupon, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the... | config.setDestinationType(DestinationType.TOPIC); // chose between topic (one to many) or queue (one to one) | 0 |
lumag/JBookReader | src/org/jbookreader/renderingengine/RenderEngineTest.java | [
"public class FB2FilesTestFilter implements FilenameFilter {\n\tpublic boolean accept(File dir, String name) {\n\t\tif (name.endsWith(\".fb2\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (name.endsWith(\".xml\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t\n}",
"public class TestConfig implements ITestCon... | import org.jbookreader.formatengine.IBookPainter;
import org.jbookreader.formatengine.impl.FormatEngine;
import org.jbookreader.renderingengine.RenderingEngine;
import org.jbookreader.util.TextPainter;
import org.lumag.filetest.FileTestCase;
import org.lumag.filetest.FileTestUtil;
import java.io.BufferedOutputStream;
i... | /*
* JBookReader - Java FictionBook Reader
* Copyright (C) 2006 Dmitry Baryshkov
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your o... | IBookPainter painter = new TextPainter(pwr, 80); | 4 |
nebula-plugins/gradle-metrics-plugin | src/main/java/nebula/plugin/metrics/AbstractMetricsPlugin.java | [
"public final class GradleBuildMetricsCollector extends BuildAdapter implements ProjectEvaluationListener, TaskExecutionListener, DependencyResolutionListener {\n\n private static final long TIMEOUT_MS = 5000;\n\n private final Logger logger = MetricsLoggerFactory.getLogger(GradleBuildMetricsCollector.class);... | import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Supplier;
import groovy.lang.Closure;
import nebula.plugin.metrics.collector.GradleBuildMetricsCollector;
import nebula.plugin.metrics.collector.GradleTestSuiteCollector;
import nebula.plugin.metrics.dispatcher.*;
import nebula.plugin... | /*
* Copyright 2020 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | GradleTestSuiteCollector suiteCollector = new GradleTestSuiteCollector(dispatcherSupplier, test); | 1 |
afpdev/alpheusafpparser | src/main/java/com/mgz/afp/ioca/IPD_Segment.java | [
"public enum AFPColorSpace {\n RGB(0x01),\n YCrCb(0x02),\n CMYK(0x04),\n Highlight(0x06),\n CIELAB(0x08),\n YCbCr(0x12),\n StandardOCA(0x40);\n int code;\n\n AFPColorSpace(int code) {\n this.code = code;\n }\n\n public static AFPColorSpace valueOf(byte code) {\n for (AFPColorSpace cs : values()) {\... | import java.io.OutputStream;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import com.mgz.afp.enums.AFPColorSpace;
import com.mgz.afp.enums.AFPUnitBase;
import com.mgz.afp.enums.IMutualExclusiveGroupedFlag;
import com.mgz.afp.enums.MutualExclusiveGroupedFlagHandler;
import com.mgz.afp.exc... | result.add(Additive);
} else {
result.add(Subtractive);
}
if ((flagByte & 0x40) == 0) {
result.add(GrayCodingOff);
} else {
result.add(GrayCodingOn);
}
return result;
}
public static int toByte(EnumSet<IDEStructure.IDES... | AlgorithmSpecificationCompression.CompressionAlgorithmID compressionAlgorithmID; | 2 |
PaulNoth/saral | src/main/java/com/pidanic/saral/visitor/ExpressionVisitor.java | [
"public class Function extends CallableStatement {\n private String name;\n private List<Argument> arguments;\n private List<Statement> statements;\n private ReturnStatement retStatement;\n private Type returnType;\n\n public Function(Scope scope, String name, List<Argument> arguments, List<Statem... | import com.pidanic.saral.domain.*;
import com.pidanic.saral.domain.block.Function;
import com.pidanic.saral.domain.expression.*;
import com.pidanic.saral.domain.expression.logic.*;
import com.pidanic.saral.domain.expression.math.*;
import com.pidanic.saral.domain.expression.string.Concatenation;
import com.pidanic.sara... | package com.pidanic.saral.visitor;
public class ExpressionVisitor extends SaralBaseVisitor<Expression> {
private Scope scope;
public ExpressionVisitor(Scope scope) {
this.scope = new Scope(scope);
}
@Override
public Expression visitFunc_call(SaralParser.Func_callContext ctx) {
S... | return new Value(BuiltInType.LONG, value); | 8 |
tomtom-international/configuration-service | src/main/java/com/tomtom/services/configuration/deployment/DeploymentModule.java | [
"@SuppressWarnings(\"squid:S2637\")\npublic class ConfigurationServiceProperties implements HasProperties {\n\n @Nonnull\n private final String startupConfigurationURI;\n\n @Inject\n public ConfigurationServiceProperties(\n @Named(\"ConfigurationService.startupConfigurationURI\") @Nonnull fin... | import javax.annotation.Nonnull;
import javax.inject.Singleton;
import javax.ws.rs.core.Response.Status;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.inject.Binder;
import com.tomto... | /*
* Copyright (C) 2012-2021, TomTom (http://tomtom.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 ap... | binder.bind(TreeResource.class).to(TreeResourceImpl.class).in(Singleton.class); | 2 |
AURIN/online-whatif | src/main/java/au/org/aurin/wif/impl/AsyncProjectServiceImpl.java | [
"@ResponseStatus(value = HttpStatus.SERVICE_UNAVAILABLE, \nreason = \"Spatial DataStore creation failed!\")\npublic class DataStoreCreationException extends Exception {\n\n /** The Constant serialVersionUID. */\n private static final long serialVersionUID = 1124576769564144835L;\n\n /**\n * Instantiates a new ... | import java.io.IOException;
import java.util.HashSet;
import java.util.concurrent.Future;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import org.geotools.feature.FeatureCollection;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.r... | package au.org.aurin.wif.impl;
/**
* The Class AsyncProjectServiceImpl.
*/
@Service
@Qualifier("asyncProjectService")
public class AsyncProjectServiceImpl implements AsyncProjectService {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 213432423433L;
/** The Constant LO... | private AllocationLUService allocationLUService; | 3 |
stefanhaustein/nativehtml | shared/src/main/java/org/kobjects/nativehtml/io/HtmlParser.java | [
"public class CssStyleSheet {\n private static final char SELECT_ATTRIBUTE_NAME = 7;\n private static final char SELECT_ATTRIBUTE_VALUE = 8;\n private static final char SELECT_ATTRIBUTE_INCLUDES = 9;\n private static final char SELECT_ATTRIBUTE_DASHMATCH = 10;\n\n private static final float[] HEADING_SIZES = {... | import org.kobjects.nativehtml.css.CssStyleSheet;
import org.kobjects.nativehtml.dom.Document;
import org.kobjects.nativehtml.dom.Element;
import org.kobjects.nativehtml.dom.Platform;
import org.kobjects.nativehtml.dom.ElementType;
import org.kobjects.nativehtml.layout.WebSettings;
import org.xmlpull.v1.XmlPullParser;
... | package org.kobjects.nativehtml.io;
/**
* Uses a HtmlParser to generate a widget tree that corresponds to the HTML code.
*
* Can be re-used, but is not thread safe.
*/
public class HtmlParser {
private final HtmlNormalizer input; | private final Platform elementFactory; | 3 |
FIRST-Team-2557-The-SOTABots/FRC_Robot | Robot/src/main/java/org/usfirst/frc/team2557/robot/commands/autonomous/Auto_LowbarCenter.java | [
"public class MoveArmToAngleCommand extends Command {\n\n private PIDController _controller;\n\n private double _value;\n\n public MoveArmToAngleCommand(double potentiometerValue) {\n this._value = potentiometerValue;\n requires(Robot.arm);\n\n this._controller = new PIDController(0.3,... | import edu.wpi.first.wpilibj.command.CommandGroup;
import org.usfirst.frc.team2557.robot.commands.arm.MoveArmToAngleCommand;
import org.usfirst.frc.team2557.robot.commands.automation.Auto_LoadBall;
import org.usfirst.frc.team2557.robot.commands.catapult.CatapultRetractCommand;
import org.usfirst.frc.team2557.robot.comm... | package org.usfirst.frc.team2557.robot.commands.autonomous;
public class Auto_LowbarCenter extends Auto_Lowbar {
public Auto_LowbarCenter() {
| this.addParallel(new Auto_LoadBall()); | 1 |
BudgetFreak/BudgetFreak | server/budgeting/src/test/java/de/budgetfreak/budgeting/specification/CategorySpecificationsTest.java | [
"@SpringBootApplication\npublic class BudgetingIntegrationTestApplication {\n}",
"@Entity(name = \"BF_CATEGORY\")\npublic class Category {\n\n @Id\n @GeneratedValue(strategy = GenerationType.IDENTITY)\n @Column(name = \"ID\")\n private Long id;\n\n @Column(name = \"NAME\")\n private String name;... | import de.budgetfreak.BudgetingIntegrationTestApplication;
import de.budgetfreak.budgeting.domain.Category;
import de.budgetfreak.budgeting.domain.CategoryRepository;
import de.budgetfreak.budgeting.domain.MasterCategory;
import de.budgetfreak.budgeting.domain.MasterCategoryRepository;
import de.budgetfreak.usermanagem... | package de.budgetfreak.budgeting.specification;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BudgetingIntegrationTestApplication.class)
@AutoConfigureTestDatabase(connection = EmbeddedDatabaseConnection.H2)
public class CategorySpecificationsTest {
... | MasterCategory mcMonthly = masterCategoryRepository.save(new MasterCategory().setName("Monthly").setUser(user)); | 3 |
chickling/kmanager | src/main/java/com/chickling/kmanager/utils/elasticsearch/javaapi/ElasticsearchJavaUtil.java | [
"public class WorkerThreadFactory implements ThreadFactory {\n\tprivate AtomicInteger counter = new AtomicInteger(0);\n\tprivate String prefix = \"\";\n\n\tpublic WorkerThreadFactory(String prefix) {\n\t\tthis.prefix = prefix;\n\t}\n\n\t@Override\n\tpublic Thread newThread(Runnable r) {\n\t\tThread t = new Thread(r... | import java.net.InetSocketAddress;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
impo... | package com.chickling.kmanager.utils.elasticsearch.javaapi;
/**
* @author Hulva Luva.H
*
*/
public class ElasticsearchJavaUtil implements Ielasticsearch{
private static final Logger LOG = LoggerFactory.getLogger(ElasticsearchJavaUtil.class);
static TransportClient client = null;
public ElasticsearchJavaUtil(... | public List<OffsetPoints> scrollsSearcher(OffsetHistoryQueryParams params, String docType, String indexPrefix) { | 2 |
knishiura-lab/AjaxMutator | src/test/java/jp/gr/java_conf/daisy/ajax_mutator/mutator/RequestMutatorTest.java | [
"public class MutateVisitor implements NodeVisitor {\n private final ImmutableSet<EventAttacherDetector> eventAttacherDetectors;\n private final ImmutableSet<TimerEventDetector> timerEventDetectors;\n private final ImmutableSet<? extends AbstractDetector<DOMCreation>> domCreationDetectors;\n private fin... | import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import jp.gr.java_conf.daisy.ajax_mutator.MutateVisitor;
import jp.gr.java_conf.daisy.ajax_mutator.MutateVisitorBuilder;
import jp.gr.java_conf.daisy.ajax_mutator.detector.jquery.JQueryReque... | package jp.gr.java_conf.daisy.ajax_mutator.mutator;
public class RequestMutatorTest extends MutatorTestBase {
private String[] urls;
private String[] callbacks;
private Collection<Request> requests;
@Override
public void prepare() {
urls = new String[] { "'hoge.php'", "url" };
c... | Mutator mutator = new RequestUrlRAMutator(requests); | 5 |
pfstrack/eldamo | src/main/java/xdb/dom/DomManager.java | [
"@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\npublic final class CacheManager {\n private static final Map<String, Map> MASTER_CACHE = new HashMap<String, Map>();\n\n private CacheManager() {\n }\n\n /**\n * Get a named cache.\n * \n * @param cacheId\n * The cache id.\n... | import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logge... | package xdb.dom;
/**
* Manager for XML data model singleton.
*
* @author Paul Strack
*/
public final class DomManager {
private DomManager() {
}
private static final String PATH = "/eldarin/data/eldamo-data.xml"; | private static String dataRoot = FileUtil.findDirectoryFromClasspath(DomManager.class, PATH); | 4 |
paspiz85/nanobot | src/main/java/it/paspiz85/nanobot/logic/StateManageTroops.java | [
"public abstract class Attack {\n\n private static AttackScreen attackScreenParser = Screen.getInstance(AttackScreen.class);\n\n private static List<Attack> attacks;\n\n protected static final Point BOTTOM_LEFT = new Point(300, 536);\n\n protected static final Point BOTTOM_RIGHT = new Point(537, 538);\n... | import it.paspiz85.nanobot.attack.Attack;
import it.paspiz85.nanobot.game.ManageTroopsScreen;
import it.paspiz85.nanobot.game.Screen;
import it.paspiz85.nanobot.game.Troop;
import it.paspiz85.nanobot.game.TroopsInfo;
import it.paspiz85.nanobot.util.Settings;
import it.paspiz85.nanobot.util.Utils;
import java.util.loggi... | package it.paspiz85.nanobot.logic;
/**
* This state is when training troops.
*
* @author paspiz85
*
*/
public final class StateManageTroops extends State<ManageTroopsScreen> {
public static StateManageTroops instance() {
return Utils.singleton(StateManageTroops.class, () -> new StateManageTroops())... | super(Screen.getInstance(ManageTroopsScreen.class)); | 2 |
justyoyo/Contrast | core/src/main/java/com/justyoyo/contrast/OneDimensionalCodeWriter.java | [
"public enum BarcodeFormat {\n\n /** Aztec 2D barcode format. */\n AZTEC,\n\n /** CODABAR 1D format. */\n CODABAR,\n\n /** Code 39 1D format. */\n CODE_39,\n\n /** Code 93 1D format. */\n CODE_93,\n\n /** Code 128 1D format. */\n CODE_128,\n\n /** Data Matrix 2D barcode format. */\n DATA_MATRIX,\n\n /*... | import com.justyoyo.contrast.BarcodeFormat;
import com.justyoyo.contrast.EncodeHintType;
import com.justyoyo.contrast.Writer;
import com.justyoyo.contrast.WriterException;
import com.justyoyo.contrast.common.BitMatrix;
import java.util.Map; | package com.justyoyo.contrast;
/**
* Created by tiberiugolaes on 08/11/2016.
*/
public abstract class OneDimensionalCodeWriter implements Writer {
@Override
public final BitMatrix encode(String contents, BarcodeFormat format, int width, int height) | throws WriterException { | 3 |
dubboclub/reloud | reloud-client/src/main/java/net/dubboclub/reloud/cluster/ReloudShard.java | [
"public class Constants {\n\n public static final String ZK_ROOT=\"reloud\";\n\n\n public static final String PORT_SPLIT=\":\";\n\n\n public static final String NONE=\"NONE\";\n\n\n public static final String SPLIT_FLAG=\"-\";\n\n}",
"public interface RefreshingHandler {\n\n void refreshing();\n}",... | import net.dubboclub.reloud.Constants;
import net.dubboclub.reloud.cluster.synchronizer.RefreshingHandler;
import net.dubboclub.reloud.cluster.synchronizer.Synchronizer;
import net.dubboclub.reloud.cluster.synchronizer.UsingHandler;
import net.dubboclub.reloud.notify.ReloudNotify;
import net.dubboclub.reloud.util.HashA... | /*
* Apache License
* Version 2.0, January 2004
* http://www.apache.org/licenses/
*
* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
*
* 1. Definitions.
*
* "License" shall mean the terms and conditions for use, reproduction,
* ... | return using(new UsingHandler<JedisPool>() { | 3 |
winterstein/elasticsearch-java-client | test/com/winterwell/es/client/UpdateRequestBuilderTest.java | [
"public final class ESPath<T> {\n\n\t@Override\n\tpublic int hashCode() {\n\t\tfinal int prime = 31;\n\t\tint result = 1;\n\t\tresult = prime * result + ((id == null) ? 0 : id.hashCode());\n\t\tresult = prime * result + Arrays.hashCode(indices);\n//\t\tresult = prime * result + ((type == null) ? 0 : type.hashCode()... | import java.util.List;
import java.util.Map;
import org.junit.Test;
import com.winterwell.es.ESPath;
import com.winterwell.es.ESTest;
import com.winterwell.es.ESType;
import com.winterwell.es.UtilsForESTests;
import com.winterwell.es.client.admin.CreateIndexRequest;
import com.winterwell.es.client.admin.PutMappingReque... | package com.winterwell.es.client;
public class UpdateRequestBuilderTest extends ESTest {
@Test
public void testPutUpdate() {
ESHttpClient esjc = getESJC();
esjc.debug = true;
// make an index
String v = Utils.getRandomString(3);
String idx = "test_put_"+v;
CreateIndexRequest cir = esjc.admin().indic... | ESPath path = new ESPath(idx, "test_id_1"); | 0 |
google/archive-patcher | generator/src/test/java/com/google/archivepatcher/generator/PreDiffPlannerTest.java | [
"public enum JreDeflateParameters {\n LEVEL1_STRATEGY0_NOWRAP(1, 0, true),\n LEVEL2_STRATEGY0_NOWRAP(2, 0, true),\n LEVEL3_STRATEGY0_NOWRAP(3, 0, true),\n LEVEL4_STRATEGY0_NOWRAP(4, 0, true),\n LEVEL5_STRATEGY0_NOWRAP(5, 0, true),\n LEVEL6_STRATEGY0_NOWRAP(6, 0, true), // Default for almost all zip tools.\n ... | import com.google.archivepatcher.generator.DefaultDeflateCompressionDiviner.DivinationResult;
import com.google.archivepatcher.shared.DefaultDeflateCompatibilityWindow;
import com.google.archivepatcher.shared.JreDeflateParameters;
import com.google.archivepatcher.shared.RandomAccessFileInputStream;
import com.google.ar... | // 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 applicable... | try (RandomAccessFileInputStream rafis = new RandomAccessFileInputStream(tempFile)) { | 1 |
mpsonic/Evolve-Workout-Logger | app/src/main/java/edu/umn/paull011/evolveworkoutlogger/activities/ViewExercise.java | [
"public class DatabaseHelper extends SQLiteAssetHelper {\n\n // TODO: Implement way to store and sort exercises by category\n\n public static synchronized DatabaseHelper getInstance(Context context) {\n Log.d(TAG,\"getInstance\");\n if (mInstance == null) {\n if (context != null) {\n ... | import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
im... | package edu.umn.paull011.evolveworkoutlogger.activities;
public class ViewExercise extends AppCompatActivity
implements ExerciseStatsFragment.OnFragmentInteractionListener,
ExerciseHistoryFragment.OnFragmentInteractionListener {
private static final String TAG = ViewExercise.class.getSimpleName... | ExerciseStats exerciseStats = db.getExerciseStats(exercise); | 2 |
kkrugler/yalder | core/src/main/java/org/krugler/yalder/ModelBuilder.java | [
"public class HashLanguageModel extends BaseLanguageModel {\n\n // Map from ngram hash to count\n private IntIntMap _normalizedCounts;\n \n /**\n * No-arg construct for deserialization\n */\n public HashLanguageModel() {\n super();\n }\n \n public HashLanguageModel(LanguageLoc... | import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.krugler.yalder.hash.HashLanguageModel;
import org.krugler.yalder.hash.HashTo... | package org.krugler.yalder;
public class ModelBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(ModelBuilder.class);
public static final int DEFAULT_MAX_NGRAM_LENGTH = 4;
// Minimum frequency for ngram
public static final double DEFAULT_MIN_NGRAM_FREQUENCY = 0.00002;
... | TextLanguageModel model = new TextLanguageModel(language, _maxNGramLength, ngramCounts); | 3 |
novarto-oss/sane-dbc | sane-dbc-examples/src/test/java/com/novarto/sanedbc/examples/BindExample.java | [
"public class SyncDbInterpreter\n{\n private final Try0<Connection, SQLException> ds;\n\n /**\n * Construct an interpreter, given a piece of code which knows how to spawn connections, e.g. a Data Source, Connection Pool,\n * Driver Manager, etc.\n * @param ds - the data source, which can spawn con... | import com.novarto.sanedbc.core.interpreter.SyncDbInterpreter;
import com.novarto.sanedbc.core.ops.BatchInsertGenKeysOp;
import com.novarto.sanedbc.core.ops.EffectOp;
import com.novarto.sanedbc.core.ops.SelectOp;
import fj.Unit;
import fj.control.db.DB;
import fj.data.Either;
import fj.data.List;
import org.junit.Test;... | package com.novarto.sanedbc.examples;
public class BindExample
{
public static final class OrderDb
{
public static final DB<Unit> CREATE_TABLE = new EffectOp(
"CREATE TABLE ORDERS ( USER_EMAIL VARCHAR(200) NOT NULL, ORDER_ID INTEGER PRIMARY KEY IDENTITY," +
"... | return new SelectOp.FjList<>( | 3 |
UBOdin/jsqlparser | testsrc/net/sf/jsqlparser/test/create/CreateTableTest.java | [
"public class JSQLParserException extends Exception {\r\n\tprivate Throwable cause = null;\r\n\r\n\tpublic JSQLParserException() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic JSQLParserException(String arg0) {\r\n\t\tsuper(arg0);\r\n\t}\r\n\r\n\tpublic JSQLParserException(Throwable arg0) {\r\n\t\tthis.cause = arg0;\r\n\... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import junit.framework.TestCase;
import net.sf.jsqlparser.JSQLParserException;
import net.... | package net.sf.jsqlparser.test.create;
public class CreateTableTest extends TestCase {
CCJSqlParserManager parserManager = new CCJSqlParserManager();
public CreateTableTest(String arg0) {
super(arg0);
}
| public void testCreateTable() throws JSQLParserException {
| 0 |
assemblits/eru | Eru/src/main/java/org/assemblits/eru/gui/Application.java | [
"public class StartUpWizard extends Wizard {\n\n private static final String WELCOME_MESSAGE = \"Welcome and thanks for using Eru.\\n\\n\" +\n \"Before start using the application\\n \" +\n \"we need to set up a couple of things.\\n\\n\" +\n \"Click Next to continue.\";\n priv... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import static com.sun.javafx.application.LauncherImpl.la... | /******************************************************************************
* Copyright (c) 2017 Assemblits contributors *
* *
* This file is part of Eru The open JavaFX SCADA by Assemblits Organization.... | ApplicationLoader applicationLoader = new ApplicationLoader(this, getClass(), getApplicationParameters());
| 4 |
DDTH/ddth-commons | ddth-commons-core/src/test/java/com/github/ddth/commons/qnd/serialization/QndSerialization.java | [
"public class RocksDbException extends RuntimeException {\n\n private static final long serialVersionUID = \"0.8.0\".hashCode();\n\n public RocksDbException() {\n }\n\n public RocksDbException(String message) {\n super(message);\n }\n\n public RocksDbException(Throwable cause) {\n su... | import java.io.IOException;
import com.github.ddth.commons.rocksdb.RocksDbException;
import com.github.ddth.commons.serialization.FstSerDeser;
import com.github.ddth.commons.serialization.ISerDeser;
import com.github.ddth.commons.serialization.JsonSerDeser;
import com.github.ddth.commons.serialization.KryoSerDeser; | package com.github.ddth.commons.qnd.serialization;
public class QndSerialization {
static class ClassA {
public String fieldString = "a string";
public int fieldInt = 19;
public ClassA() {
}
public ClassA(String valString, int valInt) {
fieldString = valStri... | qndSerDeser(new JsonSerDeser()); | 3 |
x-hansong/EasyChat | Server/src/test/java/com/easychat/test/webserver/UserControllerTest.java | [
"@SpringBootApplication\npublic class Server {\n public static void main(String[] args) {\n SpringApplication.run(Server.class, args);\n }\n}",
"public class BadRequestException extends BasicException{\n public BadRequestException(String error, String description) {\n super(error, descripti... | import com.easychat.Server;
import com.easychat.exception.BadRequestException;
import com.easychat.model.entity.User;
import com.easychat.model.error.ErrorType;
import com.easychat.repository.UserRepository;
import com.easychat.utils.CommonUtils;
import com.easychat.utils.JsonUtils;
import org.junit.Test;
import org.ju... | package com.easychat.test.webserver;
/**
* Created by yonah on 15-12-8.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = Server.class)
@WebIntegrationTest
public class UserControllerTest {
private static final String URL = "http://localhost:8080/v1/users";
private stat... | assertEquals(ErrorType.DUPLICATE_UNIQUE_PROPERTY_EXISTS, responseBody.get("error")); | 3 |
cloudendpoints/endpoints-management-java | endpoints-control/src/test/java/com/google/api/control/ClientTest.java | [
"public class CheckAggregationOptions {\n /**\n * The default aggregation cache size.\n */\n public static final int DEFAULT_NUM_ENTRIES = 1000;\n\n /**\n * The default response expiration interval.\n */\n public static final int DEFAULT_RESPONSE_EXPIRATION_MILLIS = 4000;\n\n /**\n * The default flus... | import static org.junit.Assert.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito... | /*
* 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... | private Check checkStub; | 6 |
witwall/sfntly-java | src/main/java/com/google/typography/font/tools/subsetter/CMapTableBuilder.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.Tag;
import com.google.typography.font.sfntly.data.FontData;
import com.google.typography.font.sfntly.table.core.CMap.CMapFormat;
import com.google.typography.font.sfntly.table.core.CMapFormat4;
import com.google.typography.font.sfn... | /*
* 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 ... | CMapTable.Builder cmapTableBuilder = (CMapTable.Builder) fontBuilder.newTableBuilder(Tag.cmap); | 5 |
thedathoudarya/AndroidDBvieweR | netbeans-project/AndroidDBvieweR/src/com/clough/android/adbv/Launcher.java | [
"public class ADBManagerException extends Exception {\n \n public ADBManagerException(String message){\n super(message);\n }\n \n public ADBManagerException(Exception ex){\n super(ex);\n }\n \n}",
"public class HistoryManagerException extends Exception{\n \n public History... | import com.clough.android.adbv.exception.ADBManagerException;
import com.clough.android.adbv.exception.HistoryManagerException;
import com.clough.android.adbv.manager.ADBManager;
import com.clough.android.adbv.manager.HistoryManager;
import com.clough.android.adbv.manager.IOManager;
import com.clough.android.adbv.view.... | /*
* Copyright (C) 2016 thedathoudarya
*
* 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... | } catch (HistoryManagerException ex) { | 1 |
andraus/BluetoothHidEmu | src/andraus/bluetoothhidemu/sock/SocketManager.java | [
"public class BluetoothHidEmuActivity extends Activity {\n\t\n\tpublic static String TAG = \"BluetoothHidEmu\";\n\t\n private static final int HANDLER_MONITOR_SOCKET = 0;\n private static final int HANDLER_CONNECT = 1;\n private static final int HANDLER_BLUETOOTH_ENABLED = 2;\n\n\tprivate boolean mDisableB... | import java.io.IOException;
import andraus.bluetoothhidemu.BluetoothHidEmuActivity;
import andraus.bluetoothhidemu.sock.payload.HidPayload;
import andraus.bluetoothhidemu.spoof.BluetoothAdapterSpoofer;
import andraus.bluetoothhidemu.util.DoLog;
import andraus.bluetoothhidemu.view.BluetoothDeviceView;
import android.blu... | package andraus.bluetoothhidemu.sock;
/**
* Singleton
*
*/
public class SocketManager {
private String TAG = BluetoothHidEmuActivity.TAG;
private static SocketManager mInstance = null;
public static final int STATE_NONE = BluetoothSocketThread.STATE_NONE;
public static final int ST... | private BluetoothAdapterSpoofer mSpoofer = null; | 2 |
jjhesk/slideSelectionList | SmartSelectionList/slideselection/src/main/java/com/hkm/slideselection/app/HbSelectionFragment.java | [
"public class SearchBar implements TextView.OnEditorActionListener, TextWatcher {\n private RelativeLayout container;\n private EditText mEditText;\n private onEnterQuery enter;\n private ImageButton searchButton;\n private TextView mPlaceHolder;\n private onEnterQuery mQuery;\n private Context... | import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Progres... | package com.hkm.slideselection.app;
/**
* HB Filter by Heskeyo Kam
* Created by hesk on 16/9/15.
*/
public class HbSelectionFragment extends selectionBody {
private ImageButton back, apply, reset;
private ProgressBar mProgress;
private TextView title_navigation;
private boolean initialize = false,... | protected TwoLevelPagerAdapter adapter; | 3 |
tkrajina/10000sentences | 10000sentencesapp/src/main/java/info/puzz/a10000sentences/activities/CollectionActivity.java | [
"public class Application extends android.app.Application {\n\n public static DiComponent COMPONENT;\n\n @Override\n public void onCreate() {\n super.onCreate();\n initIconify();\n initActiveAndroid();\n initDagger();\n }\n\n private void initDagger() {\n COMPONENT ... | import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import an... | package info.puzz.a10000sentences.activities;
public class CollectionActivity extends BaseActivity implements ImporterAsyncTask.CollectionReloadedListener {
private static final String TAG = CollectionActivity.class.getSimpleName();
private static final String ARG_COLLECTION_ID = "arg_collection_id";
... | final SentenceCollection collection = dao.getCollection(collectionId); | 4 |
Keridos/FloodLights | src/main/java/de/keridos/floodlights/block/BlockFLColorableMachine.java | [
"@SuppressWarnings(\"unused\")\n@Mod.EventBusSubscriber\n@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES)\npublic class FloodLights {\n @Mod.Instance(Reference.MOD_ID)\n public static FloodLights instance;\n\n @SidedProxy(clientSi... | import de.keridos.floodlights.FloodLights;
import de.keridos.floodlights.compatability.ModCompatibility;
import de.keridos.floodlights.reference.Names;
import de.keridos.floodlights.tileentity.TileEntityMetaFloodlight;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.ma... | package de.keridos.floodlights.block;
/**
* Created by Keridos on 02/02/2016.
* This Class
*/
@SuppressWarnings({"deprecation", "NullableProblems", "WeakerAccess"})
public class BlockFLColorableMachine extends BlockFL {
public static final PropertyDirection FACING = PropertyDirection.create("facing");
pu... | String invert = safeLocalize(tileEntity.getInverted() ? Names.Localizations.TRUE : Names.Localizations.FALSE); | 2 |
WindFromFarEast/SmartButler | app/src/main/java/com/studio/smartbutler/fragment/WechatFragment.java | [
"public class WechatAdapter extends BaseAdapter\r\n{\r\n //数据源\r\n private List<WechatNews> wechatNewsList;\r\n\r\n //适配器构造方法\r\n public WechatAdapter(List<WechatNews> wechatNewsList)\r\n {\r\n this.wechatNewsList=wechatNewsList;\r\n }\r\n\r\n @Override\r\n public int getCount()\r\n ... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
i... | package com.studio.smartbutler.fragment;
/**
* project name: SmartButler
* package name: com.studio.smartbutler.fragment
* file name: WechatFragment
* creator: WindFromFarEast
* created time: 2017/7/11 12:02
* description: 智能管家
*/
public class WechatFragment extends Fragment
{
//ListVi... | private WechatAdapter adapter;
| 0 |
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... | this.rootUri = new SafeUriBuilder(serverUri).addPath(ROOT_ENDPOINT).build(); | 7 |
raduciobanu/mobemu | src/mobemu/algorithms/SocialTrust.java | [
"public class Context {\n\n private int id; // id of the node whose context this is\n private Set<Topic> topics; // topics belonging to this context\n private static int maxTopicsNo = 0;\n private static int maxTopicId = -1;\n private static Set<Integer> uniqueTopicsIds = new HashSet<>();\n public... | import java.util.*;
import mobemu.node.Context;
import mobemu.node.Message;
import mobemu.node.Node;
import mobemu.utils.Trust;
import mobemu.utils.Trust.TrustMessage; | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mobemu.algorithms;
/**
* Class for a Social Trust node.
*
* Abderrahmen Mtibaa and Khaled A. Harras. Social-based trust in mobile
* opportunistic networks. In Proceedings of 20th International Conference on... | public Message generateMessage(Message message) { | 1 |
cckevincyh/SafeChatRoom | SafeChat_Server/src/chat_server/server/backstage/ServerManage.java | [
"public class Message implements Serializable{\n\tprivate String MessageType;\n\tprivate String Content;\n\tprivate String Time;\n\tprivate String Sender;\n\tprivate String Getter;\n\tprivate byte[] Key;\t//秘钥\n\t\n\t\n\t\n\tpublic Message(String messageType, String sender, byte[] key) {\n\t\tsuper();\n\t\tMessageT... | import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import chat.common.Message;
import chat.common.MessageType;
import chat.common.User;
import chat.utils.DecryptionUtils;
import chat.util... | package chat_server.server.backstage;
/**
::
:;J7, :, ::;7:
,ivYi, , ;LLLFS:
:iv7Yi :7ri;j5PL
,:ivYLvr ,ivrrirrY2X,
... | Message m = new Message(); | 0 |
Sensirion/SmartGadget-Android | app/src/main/java/com/sensirion/smartgadget/view/history/type/HistoryIntervalType.java | [
"public abstract class AbstractHistoryDataView extends AbstractDatabaseObject {\n\n AbstractHistoryDataView(final String viewName) {\n super(viewName, DatabaseObjectType.VIEW);\n }\n\n /**\n * Obtains the SQL needed for obtaining the historical data of the selected view.\n *\n * @param d... | import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import com.sensirion.smartgadget.R;
import com.sensirion.smartgadget.persistence.history_database.table.AbstractHistoryDataView;
import com.sensirion.smartgadget.persistence.history_database.table.His... | /*
* Copyright (c) 2017, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditio... | new DaysElapsedTimeFormat(), | 6 |
CloudScale-Project/CloudStore | src/main/java/eu/cloudscale/showcase/db/model/mongo/OrderLine.java | [
"public class DatabaseHelper\n{\n\t\n public static IService getDatabase()\n\t{\n\n \tIService db = (IService) ContextHelper.getApplicationContext().getBean( \"service\" );\n \tif (db == null)\n \t{\n \t\tSystem.out.println(\"Service is null\");\n \t}\n\t\treturn db;\n\n\t}\n\t\n}",
"public inte... | import java.io.Serializable;
import org.bson.types.ObjectId;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework... | /*******************************************************************************
* Copyright (c) 2015 XLAB d.o.o.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* h... | public IItem getItem() | 1 |
drbild/c2dm4j | src/main/java/org/whispercomm/c2dm4j/async/handler/DeviceBackoffThrottle.java | [
"public interface Message {\n\n\t/**\n\t * Gets the identifier for the client to whom the message will be sent.\n\t * \n\t * @return the registration id of the client.\n\t */\n\tpublic String getRegistrationId();\n\n\t/**\n\t * Gets the collapse key for the message. The collapse key is used to\n\t * collapse simila... | import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.whispercomm.c2dm4j.Message;
import org.whispercomm.c2dm4j.Response;
import org.whispercomm.c2dm4j.ResponseType;
import org.whispercomm.c2dm4j.backoff.Attempt;
import org.whispercomm.c2dm4j.backoff.Backoff;
import org.wh... | /*
* Copyright 2012 The Regents of the University of Michigan
*
* 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... | private final BackoffProvider provider; | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.