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 |
|---|---|---|---|---|---|---|
mariotaku/RestFu | moshi/src/main/java/org/mariotaku/restfu/moshi/MoshiConverterFactory.java | [
"public interface RestConverter<F, T, E extends Exception> {\n\n @NotNull\n T convert(@NotNull F from) throws ConvertException, IOException, E;\n\n interface Factory<E extends Exception> {\n\n @NotNull\n RestConverter<HttpResponse, ?, E> forResponse(@NotNull Type toType) throws ConvertExcepti... | import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.Moshi;
import org.jetbrains.annotations.NotNull;
import org.mariotaku.restfu.RestConverter;
import org.mariotaku.restfu.http.ContentType;
import org.mariotaku.restfu.http.HttpResponse;
import org.mariotaku.restfu.http.mime.Body;
import org.mariotaku.restf... | package org.mariotaku.restfu.moshi;
/**
* Created by mariotaku on 2019/5/8.
*/
public class MoshiConverterFactory<E extends Exception> extends RestConverter.SimpleFactory<E> {
private final Moshi moshi;
public MoshiConverterFactory(Moshi moshi) {
this.moshi = moshi;
}
@NotNull
@Ove... | return new StringBody(json, ContentType.parse("application/json")); | 5 |
andieguo/nearbydemo | NearbyServerDemo/src/com/andieguo/nearby/service/Service.java | [
"public class GPS {\n\n\tprivate int id;\n\tprivate UserInfo user;//一对一的关系\n\tprivate String longitude;\n\tprivate String latitude;\n\tprivate Date time;\n\tprivate String geohash;\n\t\n\tpublic GPS() {\n\t\tsuper();\n\t}\n\tpublic GPS(UserInfo user, String longitude, String latitude, Date time) {\n\t\tsuper();\n\t... | import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import com.andieguo.nearby.bean.GPS;
import com.andieguo.nearby.bean.UserInfo;
import com.andieguo.nearby.dao.GpsDao;
import com.andieguo.nearby.dao.UserDao;
import com.andieguo.nearby.message.NearbyInfo;
import com.andieguo.nearby.util.GP... | package com.andieguo.nearby.service;
public class Service {
public void saveOrUpdateGPS(GPS gps) throws SQLException {
GpsDao dao = new GpsDao();
GPS gpsinfo = dao.findGPS(gps.getUser().getId());
if (gpsinfo == null) {
dao.saveGPS(gps);
} else {
dao.updateGPS(gps);
}
}
public List<NearbyInfo> f... | UserDao dao = new UserDao(); | 3 |
lkoskela/maven-build-utils | src/test/java/com/lassekoskela/maven/timeline/GoalOrganizerTest.java | [
"public static final int COLUMN_WIDTH_PIXEL = 60;",
"public static Goal goal(String name, long duration, long startTime, String... dependencies) {\n\treturn new Goal(name, new Duration(duration), startTime, asList(dependencies));\n}",
"public static Phase phase(String name, Goal... goals) {\n\treturn new Phase(... | import static com.lassekoskela.maven.timeline.GoalOrganizer.COLUMN_WIDTH_PIXEL;
import static com.lassekoskela.maven.timeline.ObjectBuilder.goal;
import static com.lassekoskela.maven.timeline.ObjectBuilder.phase;
import static com.lassekoskela.maven.timeline.ObjectBuilder.project;
import static org.hamcrest.MatcherAsse... | package com.lassekoskela.maven.timeline;
public class GoalOrganizerTest {
private ConsoleLogger logger;
private GoalOrganizer goalOrganizer;
@Before
public void setUp() {
logger = new ConsoleLogger();
goalOrganizer = new GoalOrganizer(logger);
}
@Test(expected = IllegalArgumentException.class)
public ... | assertThat(goalOrganizer.leftPositionForColumn(1), is(COLUMN_WIDTH_PIXEL)); | 0 |
caoyj1991/Core-Java | framework/src/main/java/com/framework/webdevelop/annotation/FrameworkAnnotationResolver.java | [
"public class AnnotationClazz {\n\n private String clazzName;\n private String methodName;\n private Set<String> implementSet;\n private String parentClassName;\n\n public void setClazzName(String clazzName){\n this.clazzName = clazzName;\n }\n public String getClazzName(){\n retu... | import com.framework.webdevelop.annotation.entity.AnnotationClazz;
import com.framework.webdevelop.annotation.entity.AnnotationField;
import com.framework.webdevelop.annotation.entity.AnnotationObjectType;
import com.framework.webdevelop.scanner.PackageScanner;
import com.network.protocol.http.HttpMethod;
import java.l... | package com.framework.webdevelop.annotation;
/**
* Author Jun
* Email
* Date 6/25/17
* Time 3:10 PM
*/
public class FrameworkAnnotationResolver<T> {
private static volatile FrameworkAnnotationResolver instance = null;
private static Map<AnnotationObjectType, Object> annotationObjectMap;
public... | public List<AnnotationField> findField(AnnotationObjectType...types){ | 1 |
hiBrianLee/AndroidMvvm | sample/src/main/java/com/hibrianlee/sample/mvvm/adapter/AndroidVersionsAdapter.java | [
"public abstract class RecyclerViewAdapter<ITEM_T, VIEW_MODEL_T extends ItemViewModel<ITEM_T>>\n extends RecyclerView.Adapter<RecyclerViewAdapter.ItemViewHolder<ITEM_T, VIEW_MODEL_T>> {\n\n protected final ArrayList<ITEM_T> items;\n\n private final ActivityComponent activityComponent;\n\n public Rec... | import java.util.ArrayList;
import butterknife.ButterKnife;
import butterknife.OnClick;
import android.databinding.ViewDataBinding;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.hibrianlee.mvvmapp.adapter.RecyclerViewAd... | /*
* Copyright (C) 2015 Brian Lee (@hiBrianLee)
*
* 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 ... | private final ViewModelFactory viewModelFactory; | 4 |
otale/tale | src/main/java/com/tale/extension/Theme.java | [
"public class TaleConst {\n\n public static final String CLASSPATH = new File(AdminApiController.class.getResource(\"/\").getPath()).getPath() + File.separatorChar;\n\n public static final String REMEMBER_IN_COOKIE = \"remember_me\";\n public static final String LOGIN_ERROR_COUNT = \"login_error... | import com.blade.kit.JsonKit;
import com.blade.kit.StringKit;
import com.blade.kit.json.Ason;
import com.blade.mvc.WebContext;
import com.blade.mvc.http.Request;
import com.tale.bootstrap.TaleConst;
import com.tale.model.dto.Comment;
import com.tale.model.dto.Types;
import com.tale.model.entity.Comments;
import com.tal... | */
public static String theNext() {
Contents contents = article_next();
if (null != contents) {
return theNext(title(contents));
}
return "";
}
/**
* 当前文章的下一篇文章链接
*
* @param title 文章标题
* @return
*/
public static String theNext(St... | return categories(TaleConst.MAX_POSTS); | 0 |
tmorcinek/android-codegenerator-library | src/test/java/com/morcinek/android/codegenerator/BActivityCodeGeneratorTest.java | [
"public class TemplateCodeGenerator {\n\n private BuildersCollection buildersCollection;\n\n private ResourceProvidersFactory resourceProvidersFactory;\n\n private TemplateManager templateManager;\n\n public TemplateCodeGenerator(String templateName, ResourceProvidersFactory resourceProvidersFactory, Te... | import com.morcinek.android.codegenerator.codegeneration.TemplateCodeGenerator;
import com.morcinek.android.codegenerator.codegeneration.providers.factories.BActivityResourceProvidersFactory;
import com.morcinek.android.codegenerator.codegeneration.templates.ResourceTemplatesProvider;
import com.morcinek.android.codege... | package com.morcinek.android.codegenerator;
public class BActivityCodeGeneratorTest {
private CodeGenerator codeGenerator;
private InputStreamProvider inputStreamProvider = new InputStreamProvider();
| private TemplatesProvider templatesProvider = new ResourceTemplatesProvider(); | 3 |
srcdeps/srcdeps-core | srcdeps-core/src/main/java/org/srcdeps/core/config/ScmRepositoryGradle.java | [
"public class CharStreamSource {\n\n public enum Scheme {\n classpath {\n @Override\n public Reader openReader(String resource, Charset encoding, Path resolveAgainst) {\n return new InputStreamReader(getClass().getResourceAsStream(resource), encoding);\n }\n... | import java.util.Map;
import org.srcdeps.core.config.scalar.CharStreamSource;
import org.srcdeps.core.config.tree.Node;
import org.srcdeps.core.config.tree.ScalarNode;
import org.srcdeps.core.config.tree.impl.DefaultContainerNode;
import org.srcdeps.core.config.tree.impl.DefaultScalarNode; | /**
* Copyright 2015-2017 Maven Source Dependencies
* Plugin contributors as indicated by the @author tags.
*
* 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... | final ScalarNode<CharStreamSource> modelTransformer = new DefaultScalarNode<>("modelTransformer", | 4 |
Earthblood/Toe | app/src/main/java/com/earthblood/tictactoe/activity/MainActivity.java | [
"public class ToeGame {\n\n private PreferenceHelper preferenceHelper;\n\n @Inject\n public ToeGame(PreferenceHelper preferenceHelper){\n this.preferenceHelper = preferenceHelper;\n }\n\n public String titleHack(String appName, String statusMessage){\n return \"<font color=#CD5C5C><b>\"... | import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import co... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* 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 ... | skillSpinner.setAdapter(new ArrayAdapter<Skill>(this, R.layout.skill_spinner_layout, Skill.values())); | 5 |
suzp1984/jbig-android | mvc-sample/src/main/java/io/github/suzp1984/jbigandroid/JbigApplication.java | [
"public class JniJbigCodec implements JbigCodec {\n\n @Override\n public byte[] encode(Bitmap[] bitmaps) {\n if (bitmaps != null && bitmaps.length != 0) {\n return encodeNative(bitmaps);\n }\n\n return null;\n }\n\n @Override\n public Bitmap[] decode(byte[] data) {\n ... | import android.app.Application;
import android.content.Context;
import android.os.StrictMode;
import io.github.suzp1984.jbig.JniJbigCodec;
import io.github.suzp1984.jbigandroid.injector.component.ApplicationComponent;
import io.github.suzp1984.jbigandroid.injector.component.DaggerApplicationComponent;
import io.github.... | package io.github.suzp1984.jbigandroid;
/**
* Created by moses on 8/28/15.
*/
public class JbigApplication extends Application {
private ApplicationComponent mApplicationComponent;
public static JbigApplication from(Context context) {
return (JbigApplication) context.getApplicationContext();
... | .persistenceModule(new PersistenceModule()) | 3 |
arquillian/arquillian-recorder | arquillian-recorder-screenshooter-base/arquillian-recorder-screenshooter-impl-base/src/test/java/org/arquillian/extension/recorder/screenshooter/ScreenshooterLifecycleObserverTestCase.java | [
"public class RecorderStrategyRegister {\n\n private final Set<RecorderStrategy<?>> recorderStrategies = new TreeSet<RecorderStrategy<?>>(new RecorderStrategyComparator());\n\n public void add(RecorderStrategy<?> recorderStrategy) {\n this.recorderStrategies.add(recorderStrategy);\n }\n\n public ... | import java.util.List;
import org.arquillian.extension.recorder.RecorderStrategyRegister;
import org.arquillian.extension.recorder.screenshooter.api.Screenshot;
import org.arquillian.extension.recorder.screenshooter.event.AfterScreenshotTaken;
import org.arquillian.extension.recorder.screenshooter.event.BeforeScreensho... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* y... | assertEventFired(TakeScreenshot.class, 0); | 3 |
LilyPad/Bukkit-Connect | src/main/java/lilypad/bukkit/connect/ConnectPlugin.java | [
"public class SpigotHook {\n\n private boolean isSpigot;\n private String whitelistMessage;\n private String serverFullMessage;\n\n public SpigotHook() {\n Class<?> spigotConfig;\n\n try {\n spigotConfig = Class.forName(\"org.spigotmc.SpigotConfig\");\n ... | import lilypad.bukkit.connect.hooks.SpigotHook;
import lilypad.bukkit.connect.injector.HandlerListInjector;
import lilypad.bukkit.connect.injector.NettyInjector;
import lilypad.bukkit.connect.injector.OfflineInjector;
import lilypad.bukkit.connect.login.LoginListener;
import lilypad.bukkit.connect.login.LoginNettyInjec... | package lilypad.bukkit.connect;
public class ConnectPlugin extends JavaPlugin {
private LoginPayloadCache payloadCache = new LoginPayloadCache();
private SpigotHook spigotHook = new SpigotHook();
private Connect connect;
private ConnectThread connectThread;
private String securityKey;
private int commonPort;
... | super.getServer().getPluginManager().registerEvents(new LoginListener(this, payloadCache), this); | 4 |
AndyGu/ShanBay | src/com/shanbay/account/SignupActivityHelper.java | [
"public class BaseActivityHelper<T extends APIClient>\n{\n protected final String TAG = LogUtils.makeLogTag(getClass());\n protected BaseActivity<T> bActivity;\n protected T mClient;\n\n public BaseActivityHelper(BaseActivity<T> paramBaseActivity)\n {\n this.bActivity = paramBaseActivity;\n this.mClient ... | import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.shanbay.app.BaseActivityHelper;
import com.shanbay.app.ShanbayActivity;
import com.shanbay.http.APIClient;
import com.shanbay.http.DataResponseHandler;
import com.shanbay.http.ModelResponseException;
import com.shanbay.words.R... | package com.shanbay.account;
public class SignupActivityHelper<T extends APIClient> extends
BaseActivityHelper<T> {
protected TextView mEmailTextView;
private InitHandler<T> mInitRH;
protected TextView mPassword2TextView;
protected TextView mPasswordTextView;
private UserHandler<T> mUserHandler;
protected Tex... | public SignupActivityHelper(ShanbayActivity<T> mActivity) { | 1 |
bvarner/javashare | src/main/java/org/beShare/gui/AppPanel.java | [
"public class AboutDialog extends JDialog implements ActionListener {\r\n\tJPanel\t\tmainPanel;\r\n\tCreditPanel\tcreditPanel;\r\n\tJLabel\t\tlblAppImage;\r\n\t\r\n\tJButton btnOk;\r\n\t\r\n\t/**\r\n\t * Creates a new AboutDialog with the following parameters:\r\n\t *\r\n\t * @param owner - The owner frame of this ... | import blv.swing.AboutDialog;
import com.meyer.muscle.message.Message;
import com.meyer.muscle.support.Rect;
import gnu.regexp.RE;
import gnu.regexp.REException;
import org.beShare.data.*;
import org.beShare.event.*;
import org.beShare.gui.prefPanels.JavaSharePrefListener;
import org.beShare.network.Tranto;
im... | /* Change Log:
* 3.11.2002 - Version 1.0 Final Released!
* 4.22.2002 - Updated version Info to reflect work on File Sharing.
* 5.8.2002 - Added support for the System Beep method of sound events.
* 5.9.2002 - Re-implemented the time stamp System.currentTimeInMillis().
* I haven't found a better way of do... | AboutDialog aboutJavaShare;
| 0 |
ominidi/ominidi-web | src/test/java/org/ominidi/facebook/service/PageFeedServiceTest.java | [
"@Getter\r\npublic class Feed<Post> implements Iterable<Post> {\r\n private final List<Post> posts;\r\n private final String nextUrl;\r\n private final String prevUrl;\r\n private final Integer size;\r\n\r\n public Feed(List<Post> posts, String nextUrl, String prevUrl) {\r\n this.posts = posts... | import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import com.restfb.Connection;
import com.restfb.json.JsonObject;
import org.ominidi.domain.model.Feed;
import org.ominidi.domain.model.Post;
import org.ominidi.facebook.exception.Conne... | package org.ominidi.facebook.service;
@RunWith(MockitoJUnitRunner.class)
public class PageFeedServiceTest {
@Mock
private Connection<JsonObject> connection;
@Mock
private ConnectionAware pageFeed;
@Mock
private FeedMapper feedMapper;
@Mock
| private PostMapper postMapper;
| 4 |
tomasbjerre/git-changelog-lib | src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiTest.java | [
"public static GitChangelogApi gitChangelogApiBuilder() {\n return new GitChangelogApi();\n}",
"public static final String ZERO_COMMIT = \"0000000000000000000000000000000000000000\";",
"public static void mock(final RestClient mock) {\n mockedRestClient = mock;\n}",
"public class GitHubMockInterceptor imple... | import static java.nio.charset.StandardCharsets.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder;
import static se.bjurr.gitchangelog.api.GitChangelogApiConstants.ZERO_COMMIT;
import static se.bjurr.gitchangelog.internal.inte... | package se.bjurr.gitchangelog.api;
public class GitChangelogApiTest {
private RestClientMock mockedRestClient; | private GitHubMockInterceptor gitHubMockInterceptor; | 3 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/adapter/PegdownAdapter.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.Arrays;
import org.pegdown.PegDownProcessor;
import com.threecrickets.scripturian.Executable;
import com.threecrickets.scripturian.LanguageAdapter;
import com.threecrickets.scripturian.Program;
import com.threecrickets.scripturian.exception.LanguageAdapterException;
import com.threecrickets.scripturian... | /**
* Copyright 2009-2017 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of the LGPL version 3.0:
* http://www.gnu.org/copyleft/lesser.html
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly f... | public PegdownAdapter() throws LanguageAdapterException | 3 |
alexmojaki/boxes | src/main/java/alex/mojaki/boxes/BoxFamily.java | [
"public interface ChangeMiddleware<T> {\n\n /**\n * Return the given {@code currentValue} or some transformation of it.\n * Called during {@link PowerBox#set(Object)} for zero or more of these objects before applying the list of\n * {@link ChangeObserver}s.\n *\n * @param box the {... | import alex.mojaki.boxes.middleware.change.ChangeMiddleware;
import alex.mojaki.boxes.middleware.get.GetMiddleware;
import alex.mojaki.boxes.observers.change.ChangeObserver;
import alex.mojaki.boxes.observers.change.ThrowOnNull;
import alex.mojaki.boxes.observers.get.GetObserver;
import alex.mojaki.boxes.utils.Instance... | package alex.mojaki.boxes;
/**
* This class holds metadata for a group of {@code PowerBox}es, including middleware and observers.
* Boxes which return the same value from {@link PowerBox#getFamily()} are said to belong to the
* same family and share all this metadata.
* <p>
* Here is an example of declaring a b... | private ParticipantList<GetMiddleware> getMiddlewares = new ParticipantList<GetMiddleware>(); | 1 |
sismics/home | home-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java | [
"public class AppContext {\n /**\n * Singleton instance.\n */\n private static AppContext instance;\n\n /**\n * Event bus.\n */\n private EventBus eventBus;\n \n /**\n * Generic asynchronous event bus.\n */\n private EventBus asyncEventBus;\n\n /**\n * Sensor serv... | import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.H... | package com.sismics.util.filter;
/**
* Filter used to process a couple things in the request context.
*
* @author jtremeaux
*/
public class RequestContextFilter implements Filter {
/**
* Logger.
*/
private static final Logger log = LoggerFactory.getLogger(RequestContextFilter.class);
@O... | TransactionUtil.handle(new Runnable() { | 2 |
SilentChaos512/ScalingHealth | src/main/java/net/silentchaos512/scalinghealth/config/Config.java | [
"@Mod(ScalingHealth.MOD_ID)\npublic class ScalingHealth {\n public static final String MOD_ID = \"scalinghealth\";\n public static final String MOD_NAME = \"Scaling Health\";\n public static final String VERSION = \"2.5.3\";\n\n public static final Random random = new Random();\n\n public static fina... | import java.nio.file.Path;
import java.util.EnumSet;
import java.util.function.Supplier;
import net.minecraftforge.fml.loading.FMLPaths;
import net.silentchaos512.scalinghealth.ScalingHealth;
import net.silentchaos512.scalinghealth.client.gui.difficulty.DifficultyMeterShow;
import net.silentchaos512.scalinghealth.clien... | /*
* Scaling Health
* Copyright (C) 2018 SilentChaos512
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 3
* of the License.
*
* This library is distributed in the hope t... | public final EnumValue<DifficultyMeterShow> difficultyMeterShow; | 1 |
palominolabs/benchpress | worker-core/src/test/java/com/palominolabs/benchpress/worker/WorkerAdvertiserTest.java | [
"public interface ZookeeperConfig {\n @Config(\"benchpress.zookeeper.client.connection-string\")\n @Default(\"127.0.0.1:2281\")\n String getConnectionString();\n\n @Config(\"benchpress.zookeeper.path\")\n @Default(\"/benchpress\")\n String getBasePath();\n\n @Config(\"benchpress.zookeeper.worke... | import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.io.Closeables;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.palominolabs.benchpress.config.ZookeeperConfig;
import com.palominolabs.be... | package com.palominolabs.benchpress.worker;
public final class WorkerAdvertiserTest {
@Inject
private WorkerAdvertiser workerAdvertiser;
@Inject
private ZookeeperConfig zookeeperConfig;
@Inject
private CuratorFramework curatorFramework;
@Inject
private CuratorModule.CuratorLifecycleHo... | .serializer(injector.getInstance(InstanceSerializerFactory.class) | 1 |
WojciechZankowski/iextrading4j-hist | iextrading4j-hist-api/src/test/java/pl/zankowski/iextrading4j/hist/api/message/administrative/IEXSecurityDirectoryMessageTest.java | [
"public enum IEXMessageType implements IEXByteEnum {\n\n QUOTE_UPDATE((byte) 0x51),\n TRADE_REPORT((byte) 0x54),\n TRADE_BREAK((byte) 0x42),\n SYSTEM_EVENT((byte) 0x53),\n SECURITY_DIRECTORY((byte) 0x44),\n TRADING_STATUS((byte) 0x48),\n OPERATIONAL_HALT_STATUS((byte) 0x4f),\n SHORT_SALE_PRI... | import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.jupiter.api.Test;
import pl.zankowski.iextrading4j.api.util.ToStringVerifier;
import pl.zankowski.iextrading4j.hist.api.IEXMessageType;
import pl.zankowski.iextrading4j.hist.api.field.IEXPrice;
import pl.zankowski.iextrading4j.hist.api.message.administrativ... | package pl.zankowski.iextrading4j.hist.api.message.administrative;
class IEXSecurityDirectoryMessageTest {
@Test
void constructor() {
final byte securityDirectoryFlag = (byte) -64;
final long timestamp = 1494855059287436131L;
final String symbol = "SNAP";
final int roundLotSi... | final IEXLULDTier luldTier = IEXLULDTier.TIER_1_NMS; | 2 |
9miao/CartoonHouse | DMZJ/proj.android/src/com/dmzj/manhua/HelloCpp.java | [
"public class AccessTokenKeeper {\n private static final String PREFERENCES_NAME = \"com_weibo_sdk_android\";\n\n private static final String KEY_UID = \"uid\";\n private static final String KEY_ACCESS_TOKEN = \"access_token\";\n private static final String KEY_EXPIRES_IN = \"expires_in\";... | import org.CrossApp.lib.Cocos2dxActivity;
import org.CrossApp.lib.Cocos2dxGLSurfaceView;
import com.baidu.android.pushservice.PushConstants;
import com.baidu.android.pushservice.PushManager;
import com.dmzj.manhua.openapi.AccessTokenKeeper;
import com.dmzj.manhua.openapi.OpenApiHelper;
import com.dmzj.manhua.openapi.Si... | package com.dmzj.manhua;
public class HelloCpp extends Cocos2dxActivity{
//推送的json数据
public static final String INTENT_EXTRA_TITLE = "intent_extra_title";
public static final String INTENT_EXTRA_DESC = "intent_extra_desc";
public static final String INTENT_EXTRA_PUSHMSG = "intent_extra_pushmsg";
privat... | MessagePushTool.onMessageObtain(HelloCpp.this, getIntent().getStringExtra(INTENT_EXTRA_TITLE), | 4 |
gesellix/Nimbus-JOSE-JWT | src/main/java/com/nimbusds/jose/crypto/RSASSAVerifier.java | [
"public class JOSEException extends Exception {\n\n\n\t/**\n\t * Creates a new JOSE exception with the specified message.\n\t *\n\t * @param message The exception message.\n\t */\n\tpublic JOSEException(final String message) {\n\t\t\n\t\tsuper(message);\n\t}\n\t\n\t\n\t/**\n\t * Creates a new JOSE exception with th... | import java.util.HashSet;
import java.util.Set;
import java.security.Signature;
import java.security.InvalidKeyException;
import java.security.SignatureException;
import java.security.interfaces.RSAPublicKey;
import net.jcip.annotations.ThreadSafe;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.JWSHea... | package com.nimbusds.jose.crypto;
/**
* RSA Signature-Scheme-with-Appendix (RSASSA) verifier of
* {@link com.nimbusds.jose.JWSObject JWS objects}. This class is thread-safe.
*
* <p>Supports the following JSON Web Algorithms (JWAs):
*
* <ul>
* <li>{@link com.nimbusds.jose.JWSAlgorithm#RS256}
* ... | public JWSHeaderFilter getJWSHeaderFilter() { | 1 |
OpenMods/OpenPeripheral-Addons | src/main/java/openperipheral/addons/proxy/ClientProxy.java | [
"@Mod(modid = OpenPeripheralAddons.MODID, name = \"OpenPeripheralAddons\", version = \"$VERSION$\", dependencies = \"required-after:OpenMods@[$LIB-VERSION$,$NEXT-LIB-VERSION$);required-after:OpenPeripheralApi@$OP-API-VERSION$;after:ComputerCraft@[1.70,]\")\npublic class OpenPeripheralAddons {\n\n\tpublic static fin... | import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.common.MinecraftForge;
import openmods.api.IProxy;
import openmods.renderer.BlockRenderingHandler;
import openperipheral.addons.OpenPeripheral... | package openperipheral.addons.proxy;
public class ClientProxy implements IProxy {
@Override
public void preInit() {
MinecraftForge.EVENT_BUS.register(TerminalManagerClient.instance.createForgeBusListener());
FMLCommonHandler.instance().bus().register(TerminalManagerClient.instance.createFmlBusListener());
}
... | OpenPeripheralAddons.renderId = RenderingRegistry.getNextAvailableRenderId(); | 0 |
DSH105/SparkTrail | src/main/java/com/dsh105/sparktrail/util/protocol/wrapper/WrapperPacketChat.java | [
"public class SparkTrailPlugin extends DSHPlugin {\n\n private YAMLConfig config;\n private YAMLConfig dataConfig;\n private YAMLConfig langConfig;\n public AutoSave AS;\n public SparkTrailAPI api;\n\n public EffectManager EH;\n public SQLEffectManager SQLH;\n\n // Update data\n public bo... | import com.dsh105.sparktrail.SparkTrailPlugin;
import com.dsh105.sparktrail.util.ReflectionUtil;
import com.dsh105.sparktrail.util.protocol.Packet;
import com.dsh105.sparktrail.util.protocol.PacketFactory;
import com.dsh105.sparktrail.util.reflection.SafeMethod; | /*
* This file is part of SparkTrail 3.
*
* SparkTrail 3 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.
*
* SparkTrail 3 is di... | this.write("a", new SafeMethod(ReflectionUtil.getNMSClass("ChatSerializer"), "a", String.class).invoke(null, chatComponent)); | 4 |
kontalk/desktopclient-java | src/main/java/org/kontalk/client/Client.java | [
"public final class PersonalKey {\n private static final Logger LOGGER = Logger.getLogger(PersonalKey.class.getName());\n\n /** (Server) Authentication key. */\n private final PGPPublicKey mAuthKey;\n /** (Server) Login key. */\n private final PrivateKey mLoginKey;\n /** Signing key. */\n priva... | import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.logging.Level;
imp... | /*
* Kontalk Java client
* Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org>
*
* 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 ... | private final EnumMap<FeatureDiscovery.Feature, JID> mFeatures; | 1 |
godrin/TowerDefense | defend/src/com/cdm/gui/Button.java | [
"public class AnimatedColor {\n\tprivate SingleValue r, g, b, a;\n\tprivate Color c = new Color();\n\n\tpublic AnimatedColor(Animator r, Animator g, Animator b, Animator a) {\n\t\tthis.r = new AnimatedValue(new AnimationValueStore(r.startValue()), r);\n\t\tthis.g = new AnimatedValue(new AnimationValueStore(g.startV... | import com.badlogic.gdx.graphics.Color;
import com.cdm.gui.effects.AnimatedColor;
import com.cdm.gui.effects.AnimatedRect;
import com.cdm.gui.effects.AnimatorSin;
import com.cdm.gui.effects.AnimatorStatic;
import com.cdm.view.IRenderer;
import com.cdm.view.Position;
import com.cdm.view.Rectangle; | package com.cdm.gui;
// review1
public class Button extends Widget {
private int x, y, radius;
private Position position;
private IButtonPressed pressedListener;
private AnimatedRect rect;
private AnimatedRect rectEnabled;
private AnimatedRect rectDisabled;
private String buttonName;
private boolean enabl... | c = new AnimatedColor(new AnimatorStatic(0.9f), new AnimatorStatic( | 3 |
deepakpk009/JScreenRecorder | src/com/deepak/jscreenrecorder/gui/WatermarkSelector.java | [
"public class TextWatermarkCreator {\n\n // the text watermark image object\n private BufferedImage textWatermarkImage = null;\n // the watermark display panel refernce\n private WatermarkDisplayPanel watermarkDisplayPanel = null;\n\n // the constructor with watermark display panel as the parameter\n... | import com.deepak.jscreenrecorder.core.TextWatermarkCreator;
import com.deepak.jscreenrecorder.core.config.RecordConfig;
import com.deepak.jscreenrecorder.core.constants.Directory;
import com.deepak.jscreenrecorder.core.constants.Extension;
import com.deepak.jscreenrecorder.core.filters.ImageFileNameFilter;
import com.... | /*
This file is part of JScreenRecorder v0.3
JScreenRecorder is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
JScreenRecorder i... | File watermarkFiles[] = watermarkDir.listFiles(new ImageFileNameFilter()); | 4 |
santiago-hollmann/igcparser | igcParser/src/main/java/com/shollmann/android/igcparser/util/WaypointUtilities.java | [
"public class BRecord implements ILatLonRecord, Serializable {\n private static final int TIME_START_INDEX = 1;\n private static final int TIME_END_INDEX = 7;\n private static final int LAT_END_INDEX = 15;\n private static final int LON_END_INDEX = 24;\n private static final int FIX_VALIDITY_START_IN... | import com.shollmann.android.igcparser.model.CRecordWayPoint;
import com.shollmann.android.igcparser.model.IGCFile;
import com.shollmann.android.igcparser.model.ILatLonRecord;
import com.shollmann.android.igcparser.model.TaskConfig;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
imp... | /*
* MIT License
*
* Copyright (c) 2017 Santiago Hollmann
*
* 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... | List<ILatLonRecord> waypoints = igcFile.getWaypoints(); | 4 |
Cloudhunter/OpenCCSensors | src/main/java/openccsensors/common/sensor/MinecartSensor.java | [
"public interface IRequiresIconLoading {\n\tpublic void loadIcon(IIconRegister iconRegistry);\n}",
"public interface ISensor {\n\tHashMap getDetails(World world, Object obj, ChunkCoordinates location, boolean additional);\n\tHashMap getTargets(World world, ChunkCoordinates location, ISensorTier tier);\n\tString[]... | import java.util.HashMap;
import mods.railcraft.api.carts.IEnergyTransfer;
import mods.railcraft.api.carts.IExplosiveCart;
import mods.railcraft.api.carts.IRoutableCart;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
impo... | package openccsensors.common.sensor;
public class MinecartSensor implements ISensor, IRequiresIconLoading {
private IIcon icon;
@Override
public HashMap getDetails(World world, Object obj, ChunkCoordinates sensorPos, boolean additional) {
EntityMinecart minecart = (EntityMinecart) obj;
HashMap response =... | if (Mods.RAIL) { | 5 |
xuxueli/xxl-api | xxl-api-admin/src/main/java/com/xxl/api/admin/controller/XxlApiBizController.java | [
"public class XxlApiBiz {\n\n private int id;\n private String bizName;\n private int order;\n\n public int getId() {\n return id;\n }\n\n public void setId(int id) {\n this.id = id;\n }\n\n public String getBizName() {\n return bizName;\n }\n\n public void setBizN... | import com.xxl.api.admin.controller.annotation.PermessionLimit;
import com.xxl.api.admin.core.model.ReturnT;
import com.xxl.api.admin.core.model.XxlApiBiz;
import com.xxl.api.admin.core.util.tool.StringTool;
import com.xxl.api.admin.dao.IXxlApiBizDao;
import com.xxl.api.admin.dao.IXxlApiDataTypeDao;
import com.xxl.api.... | package com.xxl.api.admin.controller;
/**
* Created by xuxueli on 17/5/23.
*/
@Controller
@RequestMapping("/biz")
public class XxlApiBizController {
@Resource
private IXxlApiBizDao xxlApiBizDao;
@Resource
private IXxlApiProjectDao xxlApiProjectDao;
@Resource
private IXxlApiDataTypeDao xxlA... | List<XxlApiBiz> list = xxlApiBizDao.pageList(start, length, bizName); | 0 |
grandwazir/BanHammer | src/main/java/name/richardson/james/bukkit/banhammer/UndoCommand.java | [
"public class PlayerNamePositionalArgument {\n\n\tpublic static Argument getInstance(PlayerRecordManager playerRecordManager, int position, boolean required, final PlayerRecordManager.PlayerStatus playerStatus) {\n\t\tArgumentMetadata metadata = new SimpleArgumentMetadata(ARGUMENT_PLAYER_ID, ARGUMENT_PLAYER_NAME, A... | import name.richardson.james.bukkit.banhammer.ban.PlayerRecordManager;
import static name.richardson.james.bukkit.banhammer.utilities.localisation.BanHammer.*;
import java.util.ArrayList;
import java.util.Collection;
import org.bukkit.command.CommandSender;
import org.bukkit.permissions.Permissible;
import name.richard... | /*******************************************************************************
* Copyright (c) 2012 James Richardson.
*
* UndoCommand.java is part of BanHammer.
*
* BanHammer 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 S... | this.players = PlayerNamePositionalArgument.getInstance(playerRecordManager, 0, true, PlayerRecordManager.PlayerStatus.BANNED); | 0 |
clementf2b/FaceT | app/src/main/java/fyp/hkust/facet/activity/ColorizeFaceActivity.java | [
"public class FaceDet {\n private static final String TAG = \"dlib\";\n\n // accessed by native methods\n @SuppressWarnings(\"unused\")\n private long mNativeFaceDetContext;\n private String mLandMarkPath = \"\";\n\n static {\n try {\n System.loadLibrary(\"android_dlib\");\n ... | import android.app.Activity;
import android.app.FragmentManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
impor... | package fyp.hkust.facet.activity;
/**
* A simple demo, get a picture form your phone<br />
* Use the facepp api to detect<br />
* Find all face on the picture, and mark them out.
*
* @author moon5ckq
*/
public class ColorizeFaceActivity extends AppCompatActivity implements ColorSelectFragment.OnDataPass {
... | private PinchImageView imageView = null; | 6 |
hljwang3874149/ElephantReader | app/src/main/java/reader/simple/com/simple_reader/presenter/impl/SplashPresenter.java | [
"public class DebugUtil {\n static String className;\n private DebugUtil(){}\n\n public static boolean isDebugEnable() {\n return Config.DEBUG;\n }\n\n private static String createLog( String log ) {\n return log;\n }\n\n private static void getMethodNames(StackTraceElement[] sEle... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.widget... | package reader.simple.com.simple_reader.presenter.impl;
/**
* ==================================================
* 项目名称:Simple_Reader
* 创建人:wangxiaolong
* 创建时间:16/3/17 下午5:56
* 修改时间:16/3/17 下午5:56
* 修改备注:
* Version:
* ==================================================
*/
public class SplashPresenter implem... | DebugUtil.e("initialized"); | 0 |
maxdemarzi/grittier_ext | src/main/java/com/maxdemarzi/blocks/Blocks.java | [
"public enum RelationshipTypes implements RelationshipType {\n BLOCKS,\n FOLLOWS,\n MUTES,\n LIKES,\n REPLIED_TO\n}",
"public final class Properties {\n\n private Properties() {\n throw new IllegalAccessError(\"Utility class\");\n }\n\n public static final String COUNT = \"count\";... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.maxdemarzi.RelationshipTypes;
import org.neo4j.dbms.api.DatabaseManagementService;
import org.neo4j.graphdb.*;
import javax.ws.rs.Path;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import java.io.IOException;
impo... | package com.maxdemarzi.blocks;
@Path("/users/{username}/blocks")
public class Blocks {
private final GraphDatabaseService db;
private static final ObjectMapper objectMapper = new ObjectMapper();
public Blocks(@Context DatabaseManagementService dbms ) {
this.db = dbms.database( "neo4j" );;
}... | Map<String, Object> result = getUserAttributes(blocked); | 5 |
porscheinformatik/selenium-components | src/main/java/at/porscheinformatik/seleniumcomponents/clarity/ClarityRadioComponent.java | [
"public interface WebElementSelector\n{\n\n /**\n * Creates a selector that always uses the specified element. This selector ignores the {@link SearchContext}.\n *\n * @param description a description for toString, to make it easier to find the specified element. Most-often the\n * des... | import static at.porscheinformatik.seleniumcomponents.WebElementSelector.*;
import at.porscheinformatik.seleniumcomponents.AbstractSeleniumComponent;
import at.porscheinformatik.seleniumcomponents.ActiveSeleniumComponent;
import at.porscheinformatik.seleniumcomponents.SeleniumComponent;
import at.porscheinformatik.sele... | /**
*
*/
package at.porscheinformatik.seleniumcomponents.clarity;
/**
* @author Daniel Furtlehner
*/
public class ClarityRadioComponent extends AbstractSeleniumComponent implements ActiveSeleniumComponent
{
private final RadioComponent radio = new RadioComponent(this);
private final HtmlComponent label ... | public ClarityRadioComponent(SeleniumComponent parent) | 3 |
irccloud/android | src/com/irccloud/android/activity/PastebinsActivity.java | [
"public abstract class AsyncTaskEx<Params, Progress, Result> {\n private static final String LOG_TAG = \"AsyncTaskEx\";\n\n private static final int CORE_POOL_SIZE = 10;\n private static final int MAXIMUM_POOL_SIZE = 50;\n private static final int KEEP_ALIVE = 10;\n\n private static final LinkedBlock... | import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View... | /*
* Copyright (c) 2015 IRCCloud, Ltd.
*
* 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 ... | return NetworkConnection.getInstance().pastebins(++page); | 2 |
gallery/gallery-remote | com/gallery/GalleryRemote/GRAppletSlideshow.java | [
"public class GRI18n implements PreferenceNames {\n\tprivate static final String RESNAME =\n\t\t\t\"com.gallery.GalleryRemote.resources.GRResources\";\n\tprivate static final String RESNAME_DEV =\n\t\t\t\"GRResources\";\n\tprivate static final String RESPATH =\n\t\t\t\"com/gallery/GalleryRemote/resources/GRResource... | import com.gallery.GalleryRemote.util.GRI18n;
import com.gallery.GalleryRemote.util.ImageUtils;
import com.gallery.GalleryRemote.model.Album;
import com.gallery.GalleryRemote.model.Picture;
import com.gallery.GalleryRemote.prefs.SlideshowPanel;
import com.gallery.GalleryRemote.prefs.PreferenceNames;
import javax.swing.... | package com.gallery.GalleryRemote;
/**
* Created by IntelliJ IDEA.
* User: paour
* Date: Oct 30, 2003
*/
public class GRAppletSlideshow
extends GRAppletMini
implements GalleryRemoteCore, ActionListener, ListDataListener, PreferenceNames {
public static final String MODULE = "AppletSlideshow";
JButton jStar... | SlideshowPanel jSlidePanel; | 4 |
pokerazor/jmbus | src/main/java/org/openmuc/jmbus/app/TechemReceiver.java | [
"public class DecodingException extends Exception {\n\n private static final long serialVersionUID = 1735527302166708223L;\n\n public DecodingException() {\n super();\n }\n\n public DecodingException(String s) {\n super(s);\n }\n\n public DecodingException(Throwable cause) {\n ... | import org.openmuc.jmbus.WMBusSapRadioCrafts;
import java.io.IOException;
import org.openmuc.jmbus.DecodingException;
import org.openmuc.jmbus.HexConverter;
import org.openmuc.jmbus.SecondaryAddress;
import org.openmuc.jmbus.TechemHKVMessage;
import org.openmuc.jmbus.WMBusMessage;
import org.openmuc.jmbus.WMBusMode;
im... | /*
* Copyright 2010-16 Fraunhofer ISE
*
* This file is part of jMBus.
* For more information visit http://www.openmuc.org
*
* jMBus 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 t... | tempMBusSap = new WMBusSapRadioCrafts(serialPortName, mode, new TechemReceiver()); | 8 |
ctodb/push | cn.ctodb.push.server/src/main/java/cn/ctodb/push/server/handler/HandshakeHandler.java | [
"public class Connection {\n\n private ChannelHandlerContext chc;\n\n public void send(Packet packet) {\n chc.channel().writeAndFlush(packet);\n }\n\n public ChannelHandlerContext getChc() {\n return chc;\n }\n\n public void setChc(ChannelHandlerContext chc) {\n this.chc = chc... | import cn.ctodb.push.core.Connection;
import cn.ctodb.push.dto.Command;
import cn.ctodb.push.dto.HandshakeReq;
import cn.ctodb.push.dto.HandshakeResp;
import cn.ctodb.push.dto.Packet;
import cn.ctodb.push.handler.AbstractHandler;
import cn.ctodb.push.server.session.PushSession;
import cn.ctodb.push.server.session.Sessi... | package cn.ctodb.push.server.handler;
/**
* All rights Reserved, Designed By www.ctodb.cn
*
* @version V1.0
* @author: lichaohn@163.com
* @Copyright: 2018 www.ctodb.cn Inc. All rights reserved.
*/
public class HandshakeHandler extends AbstractHandler<HandshakeReq> {
@Autowired
private SessionManager s... | public void handle(HandshakeReq message, Connection connection) { | 0 |
flexgp/flexgp | mrgp-flexgp/src/evogpj/operator/SubtreeMutate.java | [
"public class Tree extends Genotype {\n private static final long serialVersionUID = -3871767863867101731L;\n\n // A TreeNode with the root of the Tree as its only child (effectively a\n // pointer to the root of the tree). This level of indirection allows the\n // entire tree to change (meaning we can ... | import evogpj.genotype.Tree;
import evogpj.genotype.TreeGenerator;
import evogpj.genotype.TreeNode;
import evogpj.gp.GPException;
import evogpj.gp.Individual;
import evogpj.gp.MersenneTwisterFast;
import java.util.ArrayList;
import java.util.Properties;
import evogpj.algorithm.Parameters; | /**
* Copyright (c) 2011-2013 Evolutionary Design and Optimization Group
*
* Licensed under the MIT License.
*
* See the "LICENSE" file for a copy of the license.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHAN... | public Individual mutate(Individual i) throws GPException { | 3 |
kgilmer/org.openexchangerate.client | org.openexchangerates.client/src/org/openexchangerates/client/OERClient.java | [
"public interface ErrorHandler {\n\t/**\n\t * @param code the HTTP code of the error\n\t * @param human-readable error message\n\t * @throws IOException on I/O error\n\t */\n\tvoid handleError(int code, String message) throws IOException;\n}",
"public interface HttpGETCache {\n\t\t\n\t/**\n\t * @param key cache k... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONT... | package org.openexchangerates.client;
/**
* openexchangerates.org (OER) client for Java. Deserializes OER JSON messages into native Java types.
*
* Depends on org.touge RestClient (a wrapper for HTTPUrlConnection) and org.json JSON library.
*
* @author kgilmer
*
*/
public final class OERClient {
/**
*... | Response<JSONObject> response = restClient.callGet(url, new JSONObjectDeserializer()); | 2 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/test/java/com/here/account/oauth2/SignInWithClientCredentialsIT.java | [
"public class OAuth1ClientCredentialsProvider implements ClientCredentialsProvider {\n\n private final Clock clock;\n private final String tokenEndpointUrl;\n private final OAuth1Signer oauth1Signer;\n private final String scope;\n \n /**\n * Construct a new {@code OAuth1ClientCredentialsProvi... | import com.here.account.http.HttpProvider.HttpRequestAuthorizer;
import com.here.account.util.Clock;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.ScheduledExecutorService;
impor... | /*
* Copyright (c) 2016 HERE Europe B.V.
*
* 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 o... | private Clock clock; | 5 |
dkarv/jdcallgraph | jdcallgraph/src/test/java/com/dkarv/jdcallgraph/callgraph/CallGraphTest.java | [
"public class DotFileWriter implements GraphWriter {\n private static final Logger LOG = new Logger(DotFileWriter.class);\n\n FileWriter writer;\n\n @Override\n public void start(String identifier) throws IOException {\n if (writer != null) {\n // close an old writer to make sure everything is flushed t... | import com.dkarv.jdcallgraph.writer.DotFileWriter;
import com.dkarv.jdcallgraph.writer.GraphWriter;
import com.dkarv.jdcallgraph.writer.CsvMatrixFileWriter;
import com.dkarv.jdcallgraph.writer.RemoveDuplicatesWriter;
import com.dkarv.jdcallgraph.util.options.GroupBy;
import com.dkarv.jdcallgraph.util.StackItem;
import ... | package com.dkarv.jdcallgraph.callgraph;
public class CallGraphTest {
@Test
public void testCreateWriter() { | GraphWriter w = CallGraph.createWriter(Target.DOT, true); | 1 |
vy/hrrs | replayer-base64/src/main/java/com/vlkan/hrrs/replayer/base64/Base64HttpRequestRecordStream.java | [
"public interface HttpRequestRecord {\n\n String getId();\n\n Date getTimestamp();\n\n String getGroupName();\n\n String getUri();\n\n HttpRequestMethod getMethod();\n\n List<HttpRequestHeader> getHeaders();\n\n HttpRequestPayload getPayload();\n\n Builder toBuilder();\n\n interface Build... | import com.vlkan.hrrs.api.HttpRequestRecord;
import com.vlkan.hrrs.api.HttpRequestRecordReader;
import com.vlkan.hrrs.api.HttpRequestRecordReaderSource;
import com.vlkan.hrrs.replayer.record.HttpRequestRecordStream;
import com.vlkan.hrrs.replayer.record.HttpRequestRecordStreamConsumer;
import com.vlkan.hrrs.serializer.... | package com.vlkan.hrrs.replayer.base64;
public class Base64HttpRequestRecordStream implements HttpRequestRecordStream {
private static final Logger LOGGER = LoggerFactory.getLogger(Base64HttpRequestRecordStream.class);
@Override
public void consumeWhile(URI inputUri, boolean replayOnce, Callable<Boole... | Iterator<HttpRequestRecord> iterator = reader.read().iterator(); | 0 |
pokowaka/android-geom | geom/src/main/java/math/geom2d/line/StraightLine2D.java | [
"public class AffineTransform2D implements Bijection2D, GeometricObject2D,\r\n Cloneable {\r\n\r\n // coefficients for x coordinate.\r\n protected double m00, m01, m02;\r\n\r\n // coefficients for y coordinate.\r\n protected double m10, m11, m12;\r\n\r\n // ====================================... | import java.util.ArrayList;
import java.util.Collection;
import math.geom2d.AffineTransform2D;
import math.geom2d.Angle2D;
import math.geom2d.Box2D;
import math.geom2d.GeometricObject2D;
import math.geom2d.Point2D;
import math.geom2d.Shape2D;
import math.geom2d.UnboundedShape2DException;
import math.geom2d.Vec... | /* File StraightLine2D.java
*
* Project : Java Geometry Library
*
* ===========================================
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either... | return new Circle2D(c2, r2, direct);
| 6 |
xcurator/xcurator | src/edu/toronto/cs/xcurator/discoverer/BasicEntityDiscovery.java | [
"public interface Mapping {\n\n /**\n * Check if this mapping is initialized.\n *\n * @return\n */\n boolean isInitialized();\n\n /**\n * Set this mapping as initialized, return success flag.\n *\n * @return true if successfully initialized, false if not successful.\n */\n ... | import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import edu.toronto.cs.xcurator.common.DataDocument;
import edu.toronto.cs.xcurator.mapping.Mapping;
import edu.toronto.cs.xcurator.mapping.Attribute;
import edu.toronto.cs.xcurator.mapping.Schema;
import edu.toronto.cs.xcurator.mapping.Relation;
import edu.toronto.c... | /*
* Copyright (c) 2013, University of Toronto.
*
* 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 requi... | Attribute attr = new ValueAttribute(entity, rdfUri); | 1 |
cejug/hurraa | src/main/java/org/cejug/hurraa/controller/UpdateOccurrenceController.java | [
"@Entity\npublic class Occurrence implements Serializable {\n\t\n\tprivate static final long serialVersionUID = -9182122904967670112L;\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tprivate Long id;\n\t\n\t@Temporal(TemporalType.TIMESTAMP)\n\tprivate Date dateOfOpening;\n\t\n\tprivate String ser... | import org.cejug.hurraa.model.bean.UserBean;
import org.cejug.hurraa.model.bean.exception.NoChangeInOccurrenceException;
import org.cejug.hurraa.producer.ValidationMessages;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Get;
import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.Post;
i... | /*
* Hurraa is a web application conceived to manage resources
* in companies that need manage IT resources. Create issues
* and purchase IT materials. Copyright (C) 2014 CEJUG.
*
* Hurraa is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* th... | private SectorBean sectorBean; | 5 |
Beloumi/PeaFactory | src/peafactory/peas/file_pea/FileTypePanel.java | [
"public class PeaSettings {\n\n\tprivate static JDialog keyboard = null;\n\tprivate static final JDialog pswGenerator = null;\n\t\n\tprivate static final boolean BOUND = true;\n\tprivate static final String EXTERNAL_FILE_PATH = null;\n\tprivate static final boolean EXTERN_FILE = true;\n\tprivate static final String... | import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;
import java.util.MissingResourceException;
im... | package cologne.eck.peafactory.peas.file_pea;
/*
* Peafactory - Production of Password Encryption Archives
* Copyright (C) 2015 Axel von dem Bruch
*
* This library 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 Softwar... | languagesBundle = PswDialogBase.getBundle(); | 1 |
keeps/roda-in | src/main/java/org/roda/rodain/ui/source/SourceTreeCell.java | [
"public class ConfigurationManager {\n private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationManager.class.getName());\n\n private static final Path rodainPath = computeRodainPath();\n private static Path schemasPath, templatesPath, logPath, metadataPath, helpPath, externalConfigPath,\n ex... | import java.nio.file.Path;
import java.nio.file.Paths;
import org.roda.rodain.core.ConfigurationManager;
import org.roda.rodain.core.Constants;
import org.roda.rodain.core.Constants.PathState;
import org.roda.rodain.core.I18n;
import org.roda.rodain.core.shallowSipManager.UriCreator;
import org.roda.rodain.ui.source.it... | package org.roda.rodain.ui.source;
/**
* @author Andre Pereira apereira@keep.pt
* @since 12-10-2015.
*/
public class SourceTreeCell extends TreeCell<String> {
private ContextMenu menu = new ContextMenu();
/**
* Instantiates a new SourceTreeCell object.
*/
public SourceTreeCell() {
MenuItem remov... | if (sti instanceof SourceTreeFile && !FileExplorerPane.isShowFiles()) { | 5 |
Hatzen/EasyPeasyVPN | src/main/java/de/hartz/vpn/main/installation/client/ConnectToServerPanel.java | [
"public class RadioButtonWithDescription extends JPanel {\n\n private JRadioButton radioButton;\n private Component descriptionComponent;\n\n public RadioButtonWithDescription(String radioButtonText, String description) {\n this(radioButtonText, description, null);\n }\n\n public RadioButtonWi... | import de.hartz.vpn.helper.RadioButtonWithDescription;
import de.hartz.vpn.main.UserData;
import de.hartz.vpn.main.installation.InstallationController;
import de.hartz.vpn.main.installation.InstallationPanel;
import de.hartz.vpn.mediation.Mediator;
import de.hartz.vpn.utilities.Constants;
import de.hartz.vpn.utilities.... | package de.hartz.vpn.main.installation.client;
/**
* Panel that connects a client to a network.
*/
public class ConnectToServerPanel extends InstallationPanel implements MetaClient.ClientListener, ActionListener {
private JTextField serverAddress;
private JTextField serverPort;
private boolean succes... | mediatorConnectionWrapper.add( UiUtilities.getComponentWrapper(networkNameLabel)); | 6 |
google/compile-testing | src/main/java/com/google/testing/compile/JavaSourcesSubject.java | [
"public static Subject.Factory<CompilationSubject, Compilation> compilations() {\n return FACTORY;\n}",
"public static Compiler javac() {\n return compiler(getSystemJavaCompiler());\n}",
"public static JavaSourcesSubjectFactory javaSources() {\n return new JavaSourcesSubjectFactory();\n}",
"static Immutabl... | import static com.google.common.truth.Fact.simpleFact;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.testing.compile.CompilationSubject.compilations;
import static com.google.testing.compile.Compiler.javac;
import static com.google.testing.compile.JavaSourcesSubjectFactory.javaSource... | /*
* Copyright (C) 2013 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | check("compilation()").about(compilations()).that(compilation).succeeded(); | 0 |
magnetsystems/message-samples-android | RichMessaging/app/src/main/java/com/magnet/messagingsample/activities/ChatActivity.java | [
"public class MessageRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n\n private static final int TEXT_TYPE = 0;\n private static final int IMAGE_TYPE = 1;\n private static final int MAP_TYPE = 2;\n private static final int VIDEO_TYPE = 3;\n\n private List<Object> messageI... | import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Parcelable;
import android.provider.MediaStore;
import ... |
MMX.registerListener(mEventListener);
S3UploadService.init(this);
mGPS = new GPSTracker(this);
ActionBar ab = getActionBar();
if (ab != null) {
ab.setTitle("Chatting With: " + mUser.getUsername());
}
rvMessages = (RecyclerView) findViewById(R.id.rvM... | String videoPath = FileHelper.getPath(this, videoUri); | 1 |
CrypDist/CrypDist | Client/src/main/java/Blockchain/BlockchainManager.java | [
"public class PostgresDB {\n\n private static org.apache.log4j.Logger log = Logger.getLogger(\"DbManager\");\n\n Connection conn;\n final String TABLE_NAME = Config.DB_TABLE_NAME;\n public PostgresDB(String dbName, String user, String secret, boolean reset)\n {\n\n try {\n Class.for... | import DbManager.PostgresDB;
import UploadUnit.ServerAccessor;
import Util.Config;
import Util.CrypDist;
import Util.Decryption;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import org.apache.commons.net.ntp.NTPUDPClient;
import org.apache.commons.net.ntp.TimeInfo;
import org.apache.log4j.Logger;
imp... | package Blockchain;
/**
* Created by Kaan on 18-Feb-17.
*/
public class BlockchainManager
{
static transient Logger log = Logger.getLogger("BlockchainManager"); | private CrypDist crypDist; | 3 |
yyxhdy/ManyEAs | src/jmetal/problems/Binh2.java | [
"public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t... | import jmetal.core.Problem;
import jmetal.core.Solution;
import jmetal.encodings.solutionType.BinaryRealSolutionType;
import jmetal.encodings.solutionType.RealSolutionType;
import jmetal.util.JMException;
import jmetal.util.wrapper.XReal; | // Binh2.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
//
// Copyright (c) 2012 Antonio J. Nebro
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either ver... | public void evaluate(Solution solution) throws JMException { | 4 |
WassimBenltaief/ReactiveFB | app/src/main/java/com/beltaief/reactivefbexample/views/MyPhotosActivity.java | [
"public class ReactiveFB {\n\n private static ReactiveFB mInstance = null;\n private static SimpleFacebookConfiguration mConfiguration =\n new SimpleFacebookConfiguration.Builder().build();\n private static SessionManager mSessionManager = null;\n\n public static void sdkInitialize(Context co... | import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.widget.Toast;
import com.beltaief.reactivefb.ReactiveFB;
import com.beltaief.reactivefb.actions.ReactiveLo... | package com.beltaief.reactivefbexample.views;
public class MyPhotosActivity extends AppCompatActivity {
private static final String TAG = MyPhotosActivity.class.getSimpleName();
private PhotosAdapter mAdapter;
private List<Photo> photos = new ArrayList<>();
@Override
protected void onCreate(... | .registerTypeAdapter(Date.class, new GsonDateTypeAdapter()) | 5 |
scarletsky/Bangumi-Android | app/src/main/java/io/github/scarletsky/bangumi/ui/fragments/CollectionFragment.java | [
"public class BangumiApplication extends Application {\n\n private static BangumiApplication mInstance;\n private SessionManager session;\n\n @Override\n public void onCreate() {\n super.onCreate();\n mInstance = this;\n }\n\n public static synchronized BangumiApplication getInstance... | import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import java.util.List;
import io.github.scarletsky.bangumi.BangumiApplica... | package io.github.scarletsky.bangumi.ui.fragments;
/**
* Created by scarlex on 15-7-8.
*/
public class CollectionFragment extends BaseToolbarFragment {
private static final String TAG = CollectionFragment.class.getSimpleName(); | private SessionManager session = BangumiApplication.getInstance().getSession(); | 0 |
OpenWatch/OpenWatch-Android | app/OpenWatch/src/org/ale/openwatch/OWInvestigationViewActivity.java | [
"public class Constants {\n\n public static final String SUPPORT_EMAIL = \"team@openwatch.net\";\n public static final String GOOGLE_STORE_URL = \"https://play.google.com/store/apps/details?id=org.ale.openwatch\";\n public static final String APPLE_STORE_URL = \"https://itunes.apple.com/us/app/openwatch-so... | import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.text.Html;
import android.util.Log;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsher... | package org.ale.openwatch;
public class OWInvestigationViewActivity extends SherlockActivity implements OWObjectBackedEntity {
private static final String TAG = "OWInvestigationViewActivity";
//private View progress;
private int model_id;
private int server_id;
@Override
protected void onCreate(Bundle ... | model_id = getIntent().getExtras().getInt(Constants.INTERNAL_DB_ID); | 0 |
el-groucho/jsRules | src/main/java/org/grouchotools/jsrules/loader/impl/RulesetLoaderImpl.java | [
"public class ResponseConfig extends JsonBean implements Config {\n private String response;\n private String responseClass;\n\n public ResponseConfig() {\n\n }\n\n public ResponseConfig(String response, String responseClass) {\n this.response = response;\n this.responseClass = respon... | import org.grouchotools.jsrules.*;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RulesetConfig;
import org.grouchotools.jsrules.exception.ClassHandlerException;
import org.grouchotools.jsrules.exception.InvalidConfigException;
import org.grouchotools.jsrules.impl.RuleExec... | package org.grouchotools.jsrules.loader.impl;
/**
* Created by Paul Richardson 5/14/2015
*/
public class RulesetLoaderImpl implements RulesetLoader {
private JsRules jsRules;
public RulesetLoaderImpl(JsRules jsRules) {
this.jsRules = jsRules;
}
@Override
@SuppressWarnings("unchecked") | public RulesetExecutor load(RulesetConfig config) throws InvalidConfigException { | 3 |
DorsetProject/dorset-framework | api/src/main/java/edu/jhuapl/dorset/rest/WebService.java | [
"public class Application {\n private final Logger logger = LoggerFactory.getLogger(Application.class);\n\n protected Agent[] agents;\n protected Router router;\n protected Reporter reporter;\n protected User user;\n protected List<RequestFilter> requestFilters;\n protected List<ResponseFilter>... | import edu.jhuapl.dorset.agents.Agent;
import edu.jhuapl.dorset.agents.Description;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.slf4j.Logger;
import org.slf4j... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC
* 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/li... | Agent[] agents = app.getAgents(); | 3 |
wso2-extensions/identity-outbound-auth-samlsso | components/org.wso2.carbon.identity.application.authenticator.samlsso/src/test/java/org/wso2/carbon/identity/application/authenticator/samlsso/logout/Utils/LogoutUtilTest.java | [
"public class SAMLMessageContext<T1 extends Serializable, T2 extends Serializable> extends IdentityMessageContext {\n\n private String acsUrl;\n private String response;\n private String sessionID;\n private String idpSessionID;\n private String tenantDomain;\n private Boolean validStatus;\n pr... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.mockito.Mock;
import org.opensaml.saml.saml2.core.LogoutRequest;
import org.opensaml.saml.saml2.core.LogoutResponse;
import org.opensaml.saml.saml2.core.SessionIndex;
import org.powermock.modules.testng.PowerMockTestCase;
import org.testn... | /*
* Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | SAMLMessageContext mockedContext = new SAMLMessageContext(mockedIdentityRequest, new HashMap()); | 0 |
edwise/complete-spring-project | src/main/java/com/edwise/completespring/controllers/BookController.java | [
"@Getter\n@Setter\n@Accessors(chain = true)\npublic class BookResource extends ResourceSupport {\n private Book book;\n}",
"@Component\npublic class BookResourceAssembler extends ResourceAssemblerSupport<Book, BookResource> {\n\n public BookResourceAssembler() {\n super(BookController.class, BookReso... | import com.edwise.completespring.assemblers.BookResource;
import com.edwise.completespring.assemblers.BookResourceAssembler;
import com.edwise.completespring.entities.Book;
import com.edwise.completespring.exceptions.InvalidRequestException;
import com.edwise.completespring.services.BookService;
import io.swagger.annot... | package com.edwise.completespring.controllers;
@RestController
@RequestMapping("/api/books/")
@Api(value = "books", description = "Books API", produces = "application/json")
@Slf4j
public class BookController {
private static final int RESPONSE_CODE_OK = 200;
private static final int RESPONSE_CODE_CREATED = ... | throw new InvalidRequestException(errors); | 3 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/buildpacks/BuildpackInstallationUpdate.java | [
"public class Heroku {\n\n\n public enum Config {\n ENDPOINT(\"HEROKU_HOST\", \"heroku.host\", \"heroku.com\");\n public final String environmentVariable;\n public final String systemProperty;\n public final String defaultValue;\n public final String value;\n\n Config(St... | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.heroku.api.Heroku;
import com.heroku.api.exception.RequestFailedException;
import com.heroku.api.http.Http;
import com.heroku.api.parser.Json;
import com.heroku.api.request.Request... | package com.heroku.api.request.buildpacks;
/**
* @author Joe Kutner on 10/26/17.
* Twitter: @codefinger
*/
public class BuildpackInstallationUpdate implements Request<Unit> {
private final RequestConfig config;
private final Map<String, List<Map<String,String>>> buildpacks;
public BuildpackInstal... | return Heroku.Resource.BuildpackInstalltions.format(config.getAppName()); | 0 |
alexvasilkov/Events | sample/src/main/java/com/alexvasilkov/events/sample/ui/activity/RepoDetailsActivity.java | [
"public class Event extends EventBase {\n\n private final Dispatcher dispatcher;\n private final String key;\n private final Object[] params;\n private final Object[] tags;\n\n Event(Builder builder) {\n this.dispatcher = builder.dispatcher;\n this.key = builder.key;\n this.param... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;
import com.alex... | package com.alexvasilkov.events.sample.ui.activity;
public class RepoDetailsActivity extends BaseActivity {
private static final String EXTRA_ID = "ID";
private ViewHolder views;
public static void open(Context context, long id) {
Intent intent = new Intent(context, RepoDetailsActivity.class);... | private void onReadmeLoadingStatus(Event event, EventStatus status) { | 1 |
ground-context/ground | modules/postgres/app/edu/berkeley/ground/postgres/dao/core/PostgresEdgeDao.java | [
"public interface EdgeDao extends ItemDao<Edge> {\n\n @Override\n default Class<Edge> getType() {\n return Edge.class;\n }\n\n @Override\n Edge retrieveFromDatabase(String sourceKey) throws GroundException;\n\n @Override\n Edge retrieveFromDatabase(long id) throws GroundException;\n\n List<Long> getLeave... | import com.fasterxml.jackson.databind.JsonNode;
import edu.berkeley.ground.common.dao.core.EdgeDao;
import edu.berkeley.ground.common.exception.GroundException;
import edu.berkeley.ground.common.exception.GroundException.ExceptionType;
import edu.berkeley.ground.common.model.core.Edge;
import edu.berkeley.ground.common... | /**
* 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
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>Unless required by applicable law or agreed to in writing, software distributed ... | postgresStatements.append(String.format(SqlConstants.INSERT_EDGE_WITH_NAME, uniqueId, edge.getSourceKey(), edge.getFromNodeId(), | 5 |
ghjansen/cas | cas-unidimensional/src/test/java/com/ghjansen/cas/unidimensional/ca/UnidimensionalGeneralRuleTest.java | [
"public abstract class Combination<A extends State> {\n\n private A reference;\n private List<A> neighborhood;\n\n protected Combination(A reference, A... neighbors) throws InvalidStateException {\n if (reference == null || neighbors == null) {\n throw new InvalidStateException();\n ... | import org.junit.Assert;
import org.junit.Test;
import com.ghjansen.cas.core.ca.Combination;
import com.ghjansen.cas.core.ca.Rule;
import com.ghjansen.cas.core.ca.State;
import com.ghjansen.cas.core.ca.Transition;
import com.ghjansen.cas.core.exception.InvalidCombinationException;
import com.ghjansen.cas.core.exception... | /*
* CAS - Cellular Automata Simulator
* Copyright (C) 2016 Guilherme Humberto Jansen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at ... | throws InvalidStateException, InvalidCombinationException, InvalidTransitionException { | 6 |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/ui/RecycleList/RecyclerOverviewListAdapter.java | [
"@Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)\npublic abstract class AppDatabase extends RoomDatabase {\n public static final String DB_NAME = \"PF_WEATHER_DB.db\";\n static final int VERSION = 7;\n static... | import android.app.Activity;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup... | package org.secuso.privacyfriendlyweather.ui.RecycleList;
/**
* This is the adapter for the RecyclerList that is to be used for the overview of added locations.
* For the most part, it has been taken from
* https://medium.com/@ipaulpro/drag-and-swipe-with-recyclerview-b9456d2b1aaf#.hmhbe8sku
* as of 2016-08-0... | private static List<CityToWatch> cities; | 1 |
maximeAudrain/jenerate | org.jenerate/src/test/org/jenerate/internal/manage/impl/MethodContentManagerImplTest.java | [
"public interface EqualsHashCodeGenerationData extends MethodGenerationData {\n\n /**\n * @return {@code true} if object references should be compared for the equals method generation, {@code false}\n * otherwise.\n */\n boolean compareReferences();\n\n /**\n * @return {@code true} ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Iterator;
import java.util.LinkedHashSet;
import org.eclipse.jdt.core.IType;
import org.jenerate.internal.domain.data.CompareToGenerationData;
import org.jenerate.internal.domain.data.EqualsHashCodeGenerationD... | package org.jenerate.internal.manage.impl;
/**
* Unit test for {@link MethodContentManagerImpl}
*
* @author maudrain
*/
@RunWith(MockitoJUnitRunner.Silent.class)
public class MethodContentManagerImplTest {
@Mock
private PreferencesManager preferencesManager;
@Mock
private JavaI... | LinkedHashSet<MethodSkeleton<EqualsHashCodeGenerationData>> skeletons = new LinkedHashSet<>();
| 0 |
cesquivias/mumbler | lang/src/main/java/mumbler/truffle/parser/Analyzer.java | [
"public static void throwReaderException(String message, Syntax<?> syntax,\n Namespace ns) {\n throw new MumblerReadException(message) {\n private static final long serialVersionUID = 1L;\n\n @Override\n public SourceSection getSourceSection() {\n return syntax.getSourceSec... | import static mumbler.truffle.parser.MumblerReadException.throwReaderException;
import java.util.HashMap;
import java.util.Map;
import mumbler.truffle.syntax.ListSyntax;
import mumbler.truffle.syntax.SymbolSyntax;
import mumbler.truffle.type.MumblerList;
import mumbler.truffle.type.MumblerSymbol;
import com.oracle.truf... | package mumbler.truffle.parser;
/**
* This class walks through the syntax objects to define all the namespaces
* and the identifiers within. Special forms are also verified to be structured
* correctly.
* <p>
* After the scan, a lambda's namespace can be fetched to find symbols'
* appropriate {@link FrameDes... | if (!(list.cdr().car() instanceof SymbolSyntax)) { | 2 |
samuelhehe/AppMarket | src/com/samuel/downloader/app/AtyDownloadMgr.java | [
"public class CompareableLocalAppInfo {\r\n\r\n\t/**\r\n\t * \r\n\t * \r\n\t AppId String 應用ID appIcon String 应用图标 AppName String 應用名稱 VersionName\r\n\t * String App版本名稱 AppVersion Int App版本編號 SysVersion String Android最低版本要求\r\n\t * VersionDesc String 版本描述 ModifyTime String 更新時間 FileEntity String AppUrl\r\n\t * \r\... | import java.io.File;
import java.util.List;
import net.tsz.afinal.FinalDBChen;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.text.format.Formatter;
i... | public void run() {
imageView.setImageURI(imageUri);
}
});
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.download_manager_activity);
allDownloadTaskLayout = (LinearLayout) findViewById(R... | stsize = AppMarketUtils.getAppSize(Long.parseLong(stsize))
| 5 |
chenyihan/Simple-SQLite-ORM-Android | src/org/cyy/fw/android/dborm/sqlite/SQLBuilder.java | [
"public final class ORMUtil {\n\tprivate ORMUtil() {\n\t\tsuper();\n\t}\n\n\t/**\n\t * \n\t * Look up relation target POJO class<BR>\n\t * \n\t * @param mainClass\n\t * relation source class\n\t * @param childFieldName\n\t * relation attribute name\n\t * @return the target class, null if faile... | import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
import org.cyy.fw.android... | String[] pks, Map<Class<?>, String> tableMap) {
ORMapInfo mapInfo = getOrMapInfo(mainClass, tableMap);
Map<String, String> columnFieldMap = mapInfo.getColumnFieldMap();
if (columnFieldMap.isEmpty()) {
return null;
}
QuerySql querySql = new QuerySql();
try {
fillSqlFragmentByPks(mainClass, childrenP... | UniqueIDGenerator mIDGenerator) { | 8 |
eXfio/CucumberSync | CucumberSync/src/main/java/org/exfio/csyncdroid/syncadapter/CalendarsSyncAdapterService.java | [
"public class Constants {\n\tpublic static final String APP_VERSION = BuildConfig.VERSION_NAME;\n\tpublic static final String ACCOUNT_TYPE_CSYNC = \"org.exfio.csyncdroid.csync\";\n\tpublic static final String ACCOUNT_TYPE_FXACCOUNT = \"org.exfio.csyncdroid.fxaccount\";\n\tpublic static final String A... | import org.exfio.csyncdroid.resource.LocalCalendar;
import org.exfio.csyncdroid.resource.LocalCollection;
import org.exfio.csyncdroid.resource.WeaveCalendar;
import org.exfio.csyncdroid.resource.WeaveCollection;
import java.util.HashMap;
import java.util.Map;
import android.accounts.Account;
import android.app.Service;... | /*
* Copyright (C) 2015 Gerry Healy <nickel_chrome@exfio.org> and contributors
*
* 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 ... | for (LocalCalendar calendar : LocalCalendar.findAll(account, provider, settings)) { | 1 |
gentoku/pinnacle-api-client | src/pinnacle/api/dataobjects/Fixtures.java | [
"public class Json {\n\n\tprivate JsonObject jsonObject;\n\n\t/**\n\t * Private constructor by JsonObject.\n\t * \n\t * @param json\n\t */\n\tprivate Json(JsonObject jsonObject) {\n\t\tthis.jsonObject = jsonObject;\n\t}\n\n\t/**\n\t * Factory\n\t * \n\t * @param text\n\t * @return\n\t * @throws PinnacleException\n\... | import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import pinnacle.api.Json;
import pinnacle.api.PinnacleException;
import pinnacle.api.enums.EVENT_STATUS;
import pinnacle.api.enums.LIVE_STATUS;
impo... | package pinnacle.api.dataobjects;
public class Fixtures extends AbstractDataObject {
private Integer sportId;
public Integer sportId() {
return this.sportId;
}
private Long last;
public Long last() {
return this.last;
}
private List<League> league = new ArrayList<>();
public List<League> league() {... | private PARLAY_RESTRICTION parlayRestriction; | 4 |
trustsystems/elfinder-java-connector | src/main/java/br/com/trustsystems/elfinder/command/AbstractCommand.java | [
"public final class ElFinderConstants {\n\n //global constants\n public static final int ELFINDER_TRUE_RESPONSE = 1;\n public static final int ELFINDER_FALSE_RESPONSE = 0;\n\n //options\n public static final String ELFINDER_VERSION_API = \"2.1\";\n\n //security\n // regex that matches any chara... | import br.com.trustsystems.elfinder.ElFinderConstants;
import br.com.trustsystems.elfinder.core.ElfinderContext;
import br.com.trustsystems.elfinder.core.Target;
import br.com.trustsystems.elfinder.service.ElfinderStorage;
import br.com.trustsystems.elfinder.service.VolumeHandler;
import br.com.trustsystems.elfinder.su... | /*
* #%L
* %%
* Copyright (C) 2015 Trustsystems Desenvolvimento de Sistemas, LTDA.
* %%
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice... | ElfinderStorage elfinderStorage = context.getVolumeSourceFactory().getVolumeSource(); | 3 |
martincooper/java-datatable | src/test/java/QuickSortTests.java | [
"public class DataTable implements IBaseTable {\n\n private final String name;\n private final DataRowCollectionModifiable rows;\n private final DataColumnCollection columns;\n\n /**\n * Private DataTable constructor. Empty Table with no columns.\n * Use 'build' to create instance.\n *\n ... | import com.github.martincooper.datatable.DataTable;
import com.github.martincooper.datatable.DataTableBuilder;
import com.github.martincooper.datatable.DataView;
import com.github.martincooper.datatable.sorting.SortItem;
import com.github.martincooper.datatable.sorting.SortOrder;
import io.vavr.collection.List;
import ... |
/**
* Tests for Quick Sorting.
* Created by Martin Cooper on 29/07/2017.
*/
public class QuickSortTests {
@Test
public void testSimpleQuickSort() {
DataTable table = DataTableBuilder
.create("NewTable")
.withColumn(Integer.class, "IntCol", List.of(3, 20, 4, 18, 0, ... | Try<DataView> view = table.quickSort("IntCol", SortOrder.Descending); | 2 |
dvanherbergen/robotframework-formslibrary | src/main/java/org/robotframework/formslibrary/operator/StatusBarOperator.java | [
"public class FormsLibraryException extends RuntimeException {\n\n private static final long serialVersionUID = 1L;\n\n public static final boolean ROBOT_SUPPRESS_NAME = true;\n\n public FormsLibraryException(String message) {\n super(message);\n }\n\n public FormsLibraryException(Throwable t)... | import org.robotframework.formslibrary.FormsLibraryException;
import org.robotframework.formslibrary.chooser.ByComponentTypeChooser;
import org.robotframework.formslibrary.util.ComponentType;
import org.robotframework.formslibrary.util.Logger;
import org.robotframework.formslibrary.util.ObjectUtil;
import org.robo... | package org.robotframework.formslibrary.operator;
/**
* Oracle Forms default Status Bar operator.
*/
public class StatusBarOperator extends AbstractRootComponentOperator {
/**
* Create a new operator for the default status bar.
*/
public StatusBarOperator() {
| super(new ByComponentTypeChooser(0, ComponentType.STATUS_BAR));
| 1 |
XYScience/StopApp | app/src/main/java/com/sscience/stopapp/fragment/ComponentDetailsFragment.java | [
"public class ComponentDetailsActivity extends BaseActivity {\n\n public static final String EXTRA_APP_NAME = \"app_name\";\n public static final String EXTRA_APP_PACKAGE_NAME = \"app_package_name\";\n public CoordinatorLayout mCoordinatorLayout;\n public ViewPager mViewPager;\n\n public static void ... | import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.science.baserecyclerviewadapter.interfaces.OnItemClickListener;
import com.sscience.stopapp.R;
impor... | package com.sscience.stopapp.fragment;
/**
* @author SScience
* @description
* @email chentushen.science@gmail.com
* @data 2017/4/4
*/
public class ComponentDetailsFragment extends BaseFragment implements ComponentDetailsContract.View {
private ComponentDetailsContract.Presenter mPresenter;
private C... | snackBarShow(((ComponentDetailsActivity) getActivity()).mCoordinatorLayout | 0 |
google/exposure-notifications-internals | exposurenotification/src/main/java/com/google/samples/exposurenotification/matching/ExposureWindowUtils.java | [
"public class ExposureResultStorage implements AutoCloseable {\n\n private final List<Row> transactionRows = new ArrayList<>();\n private final Map<byte[], byte[]> threadSafeLevelDb = new HashMap<>();\n\n public static ExposureResultStorage open(Context context) throws StorageException {\n return ne... | import android.annotation.TargetApi;
import android.os.Build.VERSION_CODES;
import com.google.samples.exposurenotification.ExposureKeyExportProto.TemporaryExposureKey.ReportType;
import com.google.samples.exposurenotification.ExposureNotificationEnums.Infectiousness;
import com.google.samples.exposurenotification.stora... | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | exposureResultStorage.getAll(callingPackage, signatureHash, TOKEN_A); | 4 |
NickstaDB/BaRMIe | src/nb/barmie/modes/attack/RMIDeserAttack.java | [
"public abstract class BaRMIeException extends Exception {\n\tpublic BaRMIeException(String message) {\n\t\tsuper(message);\n\t}\n\t\n\tpublic BaRMIeException(String message, Throwable cause) {\n\t\tsuper(message, cause);\n\t}\n}",
"public class BaRMIeGetObjectException extends BaRMIeException {\n\tpublic BaRMIeG... | import java.io.IOException;
import java.io.InvalidClassException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.ServerError;
import java.rmi.ServerException;
import java.rmi.UnmarshalException;
import java.rmi.regis... | package nb.barmie.modes.attack;
/***********************************************************
* Abstract base class for RMI deserialization attacks.
*
* Use this as a base class for RMI attacks which target
* deserialization. For example calling a remote method
* that accepts an arbitrary Object as a parameter.
... | throw new BaRMIeGetObjectException("Failed to start RMI object proxy, unknown RMI registry host.", uhe); | 1 |
Sleeksnap/sleeksnap | src/org/sleeksnap/uploaders/generic/FTPUploader.java | [
"public class FileUpload implements Upload {\n\n\t/**\n\t * The file in this upload\n\t */\n\tprivate File file;\n\t\n\tpublic FileUpload(File file) {\n\t\tthis.file = file;\n\t}\n\t\n\t/**\n\t * Set the upload's file\n\t * @param file\n\t * \t\t\tThe file to set\n\t */\n\tpublic void setFile(File file) {\n\t\tthis... | import org.sleeksnap.util.Utils.DateUtil;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import org.sleeksnap.upload.FileUpload;
import org.sleeksnap.upload.ImageUpload;
import org.sleeksnap.upload.TextUpload;
import org.sleeksnap.uploaders.Uploader;
import org.sleeksnap.uploaders.Uploader... | /**
* Sleeksnap, the open source cross-platform screenshot uploader
* Copyright (C) 2012 Nikki <nikki@nikkii.us>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the L... | throws IOException, UploaderConfigurationException { | 4 |
AChep/HeadsUp | project/app/src/main/java/com/achep/headsup/HeadsUpNotificationView.java | [
"@SuppressWarnings(\"ConstantConditions\")\npublic final class Config extends ConfigBase {\n\n private static final String TAG = \"Config\";\n\n public static final String KEY_ENABLED = \"enabled\";\n\n // notifications\n public static final String KEY_NOTIFY_MIN_PRIORITY = \"notify_min_priority\";\n ... | import com.achep.acdisplay.Config;
import com.achep.acdisplay.Timeout;
import com.achep.acdisplay.notifications.OpenNotification;
import com.achep.acdisplay.ui.widgets.notification.NotificationWidget;
import com.achep.base.Build;
import com.achep.base.utils.RippleUtils;
import com.achep.base.utils.ViewUtils;
import and... | }
@Override
protected void onDetachedFromWindow() {
mTimeout.clear();
mTimeout.unregisterListener(this);
mTimeout.unregisterListener(mTimeoutGui);
super.onDetachedFromWindow();
}
private void handleTimeout(@NonNull MotionEvent event) {
switch (event.getActio... | case Config.ST_DISMISS: | 0 |
eckig/graph-editor | core/src/main/java/de/tesis/dynaware/grapheditor/core/selections/SelectionTracker.java | [
"public abstract class GSkin<T extends EObject>\n{\n\n private final BooleanProperty selectedProperty = new BooleanPropertyBase(false)\n {\n\n @Override\n protected void invalidated()\n {\n selectionChanged(get());\n }\n\n @Override\n public Object getBean(... | import java.util.HashSet;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import de.tesis.dynaware.grapheditor.GSkin;
import de.tesis.dynaware.grapheditor.SkinLookup;
import de.tesis.dynaware.grapheditor.model.GConnection;
import de.tesis.dynaware.grapheditor.model.GConnector;
import de.tesis.dynaware.grap... | package de.tesis.dynaware.grapheditor.core.selections;
/**
* Provides observable lists of selected nodes and joints for convenience.
*/
public class SelectionTracker
{
private final ObservableSet<EObject> selectedElements = FXCollections.observableSet(new HashSet<>());
private final SkinLookup skinLookup... | if (obj instanceof GNode n) | 5 |
BruceHurrican/asstudydemo | app/src/main/java/com/bruce/demo/studydata/game/gamepuzzle/PuzzleLoginActivity.java | [
"public abstract class BaseActivity extends Activity {\n private final String TAG = getTAG();\n private Context context;\n private DemoApplication application;\n /**\n * 加载进度等待对话框\n */\n private ProgressDialog pd_waiting;\n private UIHandler mUIHandler;\n private WorkerHandler mWorkerHa... | import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.os.Message;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.Button;
import android.wid... | /*
* BruceHurrican
* Copyright (c) 2016.
* 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 o... | private GridItemsAdapter mAdapter; | 1 |
xiprox/WaniKani-for-Android | WaniKani/src/tr/xip/wanikani/content/notification/NotificationPublisher.java | [
"public class Browser extends AppCompatActivity {\n\n public static final String ARG_ACTION = \"action\";\n public static final String ARG_ITEM = \"item\";\n public static final String ARG_ITEM_TYPE = \"itemtype\";\n\n public static final String ACTION_ITEM_DETAILS = \"itemdetails\";\n public static ... | import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;
import android.util... | package tr.xip.wanikani.content.notification;
/**
* Created by Hikari on 12/16/14.
*/
public class NotificationPublisher extends BroadcastReceiver {
public static final int REQUEST_CODE = 0;
private static final int NOTIFICATION_ID = 0;
private static final int BROWSER_TYPE_LESSONS = 0;
private s... | browserIntent.setData(Uri.parse(Browser.LESSON_URL)); | 0 |
R2RML-api/R2RML-api | r2rml-api-rdf4j-binding/src/test/java/rdf4jTest/N3Syntax_Test.java | [
"public class RDF4JR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static RDF4JR2RMLMappingManager INSTANCE = new RDF4JR2RMLMappingManager(new RDF4J());\n\n private RDF4JR2RMLMappingManager(RDF4J rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import eu.optique.r2rml.api.binding.rdf4j.RDF4JR2RMLMappingManager;
import eu.optique.r2rml.api.model.impl.SQLBaseTableOrViewImpl;
import org.apache.commons.rdf.api.IRI;
import org.junit.Assert;
import org.junit.Test;
import org... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | SubjectMap s=current.getSubjectMap();
| 6 |
jonfryd/tifoon | tifoon-core/src/main/java/com/elixlogic/tifoon/domain/service/reporting/impl/WellKnownPortsLookupServiceImpl.java | [
"@Data\n@NoArgsConstructor\n@AllArgsConstructor\npublic class IanaServiceEntries {\n private List<IanaServiceEntry> ianaServiceEntries;\n}",
"@Data\n@NoArgsConstructor\npublic class IanaServiceEntry {\n @CsvBindByName(column = \"Service Name\")\n private String serviceName;\n @CsvBindByName(column = \... | import com.elixlogic.tifoon.domain.model.network.IanaServiceEntries;
import com.elixlogic.tifoon.domain.model.network.IanaServiceEntry;
import com.elixlogic.tifoon.domain.model.scanner.Port;
import com.elixlogic.tifoon.domain.model.scanner.Protocol;
import com.elixlogic.tifoon.domain.service.reporting.WellKnownPortsLoo... | package com.elixlogic.tifoon.domain.service.reporting.impl;
@Service
@Slf4j | public class WellKnownPortsLookupServiceImpl implements WellKnownPortsLookupService { | 4 |
TU-Berlin-SNET/JCPABE | src/main/java/cpabe/CpabeWeber.java | [
"public class Bsw07 {\n\n private static final String ATTRIBUTE_NOT_FOUND = \"an attribute was not found in the source private key\";\n private static final String ATTRIBUTES_DONT_SATISFY = \"decryption failed: attributes in key do not satisfy policy\";\n\n /**\n * Generate a secret master key. The pub... | import cpabe.bsw07.Bsw07;
import cpabe.bsw07.Bsw07Cipher;
import cpabe.bsw07.Bsw07CipherAndKey;
import cpabe.policy.AttributeParser;
import cpabe.policy.PolicyParsing;
import cpabe.policyparser.ParseException;
import it.unisa.dia.gas.jpbc.Element;
import it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory;
import java.io... | package cpabe;
public class CpabeWeber {
static {
try {
System.loadLibrary("jpbc-pbc");
} catch (UnsatisfiedLinkError e) {
// cant fix this error, jcpabe still runs (slowly)
}
PairingFactory.getInstance().setUsePBCWhenPossible(true);
}
public stati... | String parsedPolicy = PolicyParsing.parsePolicy(policy); | 4 |
sfPlayer1/Matcher | src/matcher/gui/tab/BytecodeTab.java | [
"public enum NameType {\n\tPLAIN(true, false, false, 0),\n\tMAPPED(false, true, false, 0),\n\tAUX(false, false, false, 1),\n\tAUX2(false, false, false, 2),\n\n\tMAPPED_PLAIN(true, true, false, 0),\n\tMAPPED_AUX_PLAIN(true, true, false, 1),\n\tMAPPED_AUX2_PLAIN(true, true, false, 2),\n\tMAPPED_TMP_PLAIN(true, true, ... | import java.io.PrintWriter;
import java.io.StringWriter;
import org.objectweb.asm.util.TraceClassVisitor;
import matcher.NameType;
import matcher.gui.Gui;
import matcher.gui.ISelectionProvider;
import matcher.srcprocess.HtmlUtil;
import matcher.type.ClassInstance;
import matcher.type.FieldInstance;
import matcher.type.... | package matcher.gui.tab;
public class BytecodeTab extends WebViewTab {
public BytecodeTab(Gui gui, ISelectionProvider selectionProvider, boolean unmatchedTmp) {
super("bytecode", "ui/ByteCodeTemplate.htm");
this.gui = gui;
this.selectionProvider = selectionProvider;
this.unmatchedTmp = unmatchedTmp;
}
... | if (method != null) select(HtmlUtil.getId(method)); | 3 |
kinnla/eniac | src/eniac/menu/action/OpenConfiguration.java | [
"public class Manager {\n\n\t/*\n\t * ========================= applet lifecycle states =======================\n\t */\n\n\tpublic enum LifeCycle {\n\n\t\t/**\n\t\t * Default lifecycle state on startup\n\t\t */\n\t\tDEFAULT,\n\n\t\t/**\n\t\t * Livecycle state indicating a successful initialization\n\t\t */\n\t\tINI... | import java.awt.event.ActionEvent;
import java.util.List;
import eniac.Manager;
import eniac.data.io.ConfigIO;
import eniac.io.Proxy;
import eniac.lang.Dictionary;
import eniac.menu.action.gui.OpenConfigurationPanel;
import eniac.util.Status; | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | OpenConfigurationPanel panel = new OpenConfigurationPanel(proxies); | 4 |
ceaseless-prayer/CeaselessAndroid | app/src/main/java/org/theotech/ceaselessandroid/fragment/ProgressCardSupportFragment.java | [
"public interface CacheManager {\n ScriptureData getCachedScripture();\n\n void cacheScripture(ScriptureData scriptureData);\n\n String getCachedVerseImageURL();\n\n void cacheVerseImageURL(String verseImageURL);\n\n List<String> getCachedPersonIdsToPrayFor();\n\n void cachePersonIdsToPrayFor(List... | import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.theotech.ceasel... | package org.theotech.ceaselessandroid.fragment;
public class ProgressCardSupportFragment extends Fragment implements ICardPageFragment {
private static final String TAG = ProgressCardSupportFragment.class.getSimpleName();
@BindView(R.id.prayed_for_text)
TextView prayedFor;
@BindView(R.id.prayer_pro... | personManager = PersonManagerImpl.getInstance(getActivity()); | 3 |
MatejVancik/amaroKontrol | amaroKontrol_wear/wear/src/main/java/com/mv2studio/amarok/kontrol/ui/PlayNowWearActivity.java | [
"public class WearApp extends Application {\n\n private static WearApp instance;\n\n public static WearApp getInstance() {\n return instance;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n instance = this;\n }\n\n /**\n * Don't forget to call .connec... | import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.support.wearable.vi... | package com.mv2studio.amarok.kontrol.ui;
public class PlayNowWearActivity extends Activity implements WatchViewStub.OnLayoutInflatedListener,
View.OnClickListener, NodeApi.NodeListener {
private TextView mArtistText, mSongText;
private ImageButton mPlayButton, mNextButton, mPrevButton;
private I... | String artistData = getIntent().getStringExtra(DataLayerListenerService.DATA_ARTIST); | 2 |
protolambda/blocktopograph | app/src/main/java/com/protolambda/blocktopograph/map/renderer/BiomeRenderer.java | [
"public class Chunk {\n\n public final WorldData worldData;\n\n public final int x, z;\n public final Dimension dimension;\n\n private Version version;\n\n private AtomicReferenceArray<TerrainChunkData>\n terrain = new AtomicReferenceArray<>(256);\n\n private volatile NBTChunkData entit... | import android.graphics.Bitmap;
import com.protolambda.blocktopograph.chunk.Chunk;
import com.protolambda.blocktopograph.chunk.ChunkManager;
import com.protolambda.blocktopograph.chunk.Version;
import com.protolambda.blocktopograph.chunk.terrain.TerrainChunkData;
import com.protolambda.blocktopograph.map.Biome;
import ... | package com.protolambda.blocktopograph.map.renderer;
public class BiomeRenderer implements MapRenderer {
/**
* Render a single chunk to provided bitmap (bm)
* @param cm ChunkManager, provides chunks, which provide chunk-data
* @param bm Bitmap to render to
* @param dimension Mapped dimensi... | Biome biome; | 4 |
nextopcn/xcalendar | src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/widget/impl/XCalendarSelectTodayWidget.java | [
"public final class Fonts {\n\t//\n\tpublic static final Font SYSTEM = Display.getDefault().getSystemFont();\n\tpublic static final Font AWESOME = FontAwesome.getFont(Math.max(10, getHeight(SYSTEM)));\n\t\n\t//\n\tprotected static final ConcurrentMultiKeyMap<Class<?>, String, Font> FONTS = new ConcurrentMultiKeyMap... | import cn.nextop.thorin.rcp.support.swt.utility.graphics.Fonts;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.XCalendar;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.bus.internal.*;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.reactor.impl.action.XCalendarSelectAction;
imp... | package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.widget.impl;
/**
* @author chenby
*
*/
public class XCalendarSelectTodayWidget extends AbstractXCalendarWidget {
/**
*
*/
public XCalendarSelectTodayWidget(XCalendar popup) {
super(popup);
}
/**
*
*/
@Override | public Pair<Point> locate(int x, int y, int w, int m) { | 7 |
Toberumono/WRF-Runner | src/toberumono/wrf/timing/round/ListRound.java | [
"public class WRFRunnerComponentFactory<T> {\n\tprivate static final Map<Class<?>, WRFRunnerComponentFactory<?>> factories = new HashMap<>();\n\tprivate final Map<String, BiFunction<ScopedMap, Scope, T>> components;\n\tprivate String defaultComponentType;\n\tprivate BiFunction<ScopedMap, Scope, T> disabledComponent... | import java.util.ArrayList;
import java.util.List;
import toberumono.wrf.WRFRunnerComponentFactory;
import toberumono.wrf.scope.Scope;
import toberumono.wrf.scope.ScopedList;
import toberumono.wrf.scope.ScopedMap;
import toberumono.wrf.timing.ScopedTimingComponentList; | package toberumono.wrf.timing.round;
/**
* An implementation of {@link Round} that wraps a {@link List} of individual {@link Round} implementations (which can be of type {@link ListRound})
* and applies them iteratively.
*
* @author Toberumono
*/
public class ListRound extends ScopedTimingComponentList<Round> ... | this((ScopedList) parameters.get("items"), parent); | 2 |
msgpack/msgpack-java | msgpack-core/src/test/java/org/msgpack/core/example/MessagePackExample.java | [
"public class MessagePack\n{\n /**\n * @exclude\n * Applications should use java.nio.charset.StandardCharsets.UTF_8 instead since Java 7.\n */\n public static final Charset UTF8 = Charset.forName(\"UTF-8\");\n\n /**\n * Configuration of a {@link MessagePacker} used by {@link #newDefaultPack... | import org.msgpack.core.MessagePack;
import org.msgpack.core.MessagePack.PackerConfig;
import org.msgpack.core.MessagePack.UnpackerConfig;
import org.msgpack.core.MessageBufferPacker;
import org.msgpack.core.MessageFormat;
import org.msgpack.core.MessagePacker;
import org.msgpack.core.MessageUnpacker;
import org.msgpac... | packer.packInt(2);
// pack binary data
byte[] ba = new byte[] {1, 2, 3, 4};
packer.packBinaryHeader(ba.length);
packer.writePayload(ba);
// Write ext type data: https://github.com/msgpack/msgpack/blob/master/spec.md#ext-format-family
byte[] extData = "custom dat... | MessageBufferPacker packer = new PackerConfig() | 1 |
rinde/RinLog | src/test/java/com/github/rinde/opt/localsearch/SwapsTest.java | [
"@SafeVarargs\npublic static <T> ImmutableList<T> list(T... items) {\n return ImmutableList.copyOf(items);\n}",
"static DoubleList asDoubleList(double... values) {\n return DoubleLists.unmodifiable(new DoubleArrayList(values));\n}",
"static IntList asIntList(final int... values) {\n return IntLists.unmodifia... | import static com.github.rinde.opt.localsearch.InsertionsTest.list;
import static com.github.rinde.opt.localsearch.Swaps.asDoubleList;
import static com.github.rinde.opt.localsearch.Swaps.asIntList;
import static com.github.rinde.opt.localsearch.Swaps.inListSwap;
import static com.github.rinde.opt.localsearch.Swaps.rem... | /*
* Copyright (C) 2013-2016 Rinde van Lon, iMinds-DistriNet, KU Leuven
*
* 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
*
* Unl... | list(list(G, D, D, G), list(A, C, B, F, E, F, A, B)), asIntList(0, 0), | 2 |
cejug/hurraa | src/main/java/org/cejug/hurraa/model/bean/OccurrenceBean.java | [
"@Entity\npublic class Occurrence implements Serializable {\n\t\n\tprivate static final long serialVersionUID = -9182122904967670112L;\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tprivate Long id;\n\t\n\t@Temporal(TemporalType.TIMESTAMP)\n\tprivate Date dateOfOpening;\n\t\n\tprivate String ser... | import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.ejb.TransactionManagement;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java... | /*
* Hurraa is a web application conceived to manage resources
* in companies that need manage IT resources. Create issues
* and purchase IT materials. Copyright (C) 2014 CEJUG.
*
* Hurraa is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* th... | public void updateOccurrence(Occurrence occurrence , String updateNote, User user) throws NoChangeInOccurrenceException{ | 7 |
tfiskgul/mux2fs | core/src/test/java/se/tfiskgul/mux2fs/mux/MuxerTest.java | [
"public static final int SUCCESS = 0;",
"public abstract class Fixture {\n\n\tprotected Path mockPath(String name, FileSystem fileSystem) {\n\t\tPath path = mock(Path.class);\n\t\twhen(path.getFileSystem()).thenReturn(fileSystem);\n\t\twhen(path.toString()).thenReturn(name);\n\t\tFile file = mock(File.class);\n\t... | import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.M... | /*
MIT License
Copyright (c) 2017 Carl-Frederik Hallberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | private Sleeper sleeper; | 2 |
luminis-ams/elastic-rest-spring-wrapper | src/test/java/eu/luminis/elastic/document/DocumentServiceIT.java | [
"public class IndexDocumentHelper {\n @Autowired\n private DocumentService documentService;\n\n public void indexDocument(String index, String type, String id, String message) {\n indexDocument(index, type, id, message, 2000L);\n }\n\n public void indexDocument(String index, String type, Strin... | import eu.luminis.elastic.IndexDocumentHelper;
import eu.luminis.elastic.SingleClusterRestClientConfig;
import eu.luminis.elastic.TestConfig;
import eu.luminis.elastic.document.helpers.MessageEntity;
import eu.luminis.elastic.document.helpers.MessageEntityByIdTypeReference;
import eu.luminis.elastic.index.IndexService;... | package eu.luminis.elastic.document;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SingleClusterRestClientConfig.class, TestConfig.class})
public class DocumentServiceIT {
private static final String INDEX = "inttests";
private static final String TYPE = "inttest";
private sta... | indexService.refreshIndexes(DEFAULT_CLUSTER_NAME, INDEX); | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.