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 |
|---|---|---|---|---|---|---|
wavever/GankLock | app/src/main/java/me/wavever/ganklock/model/data/DailyGankData.java | [
"@Table(name = \"GankDaily\")\npublic class GankDaily extends Model {\n @SerializedName(value = \"_id\")\n @Column(name = \"_id\")\n public String _id;\n @SerializedName(value = \"publishedAt\")\n @Column(name = \"publishedAt\")\n public String publishedAt;\n @SerializedName(value = \"title\")\... | import com.activeandroid.query.Select;
import java.util.List;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
import io.reactivex.ObservableSource;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactive... | package me.wavever.ganklock.model.data;
/**
* Created by wavever on 2016/9/1.
*/
public class DailyGankData {
private static String TAG = DailyGankData.class.getSimpleName() + "-->";
private GankService service = RetrofitUtil.getSingleton();
private List<GankDaily> mList;
public List<GankDaily... | LogUtil.d(TAG + "保存成功" + gankDaily.publishedAt); | 4 |
caseif/Steel | src/main/java/net/caseif/flint/steel/arena/SteelArena.java | [
"public class SteelCore extends CommonCore {\n\n public static final boolean SPECTATOR_SUPPORT;\n\n private static boolean VERBOSE_LOGGING;\n\n private static final ChatAgent CHAT_AGENT = new ChatAgent();\n\n public static final int MC_113_TRANSFORMED = 1_013_000;\n public static final int MC_114_TRA... | import static com.google.common.base.Preconditions.checkArgument;
import net.caseif.flint.arena.Arena;
import net.caseif.flint.common.arena.CommonArena;
import net.caseif.flint.common.minigame.CommonMinigame;
import net.caseif.flint.exception.rollback.RollbackException;
import net.caseif.flint.lobby.LobbySign;
import n... | /*
* The MIT License (MIT)
*
* Copyright (c) 2015-2016, Max Roncace <me@caseif.net>
*
* 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 ... | if (SteelCore.getMcVersion() >= SteelCore.MC_114_TRANSFORMED) { | 0 |
jacarrichan/bis | src/main/java/com/avicit/framework/support/service/impl/CommonServiceImpl.java | [
"public class Constants {\n public static final int DEFAULT_PAGE_SIZE = 10;\n \n public static final String COMMAND = \"command\";\n \n}",
"public interface ICommonDao {\n \n public <T extends BaseEntity> T save(T model);\n\n public <T extends BaseEntity> void saveOrUpdate(T model);\n \n ... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import com.avicit.framework.constants.Constants;
import com.avicit.framework.support.dao.hibernate.ICommonDao;
import com.avicit.framework.support.... | package com.avicit.framework.support.service.impl;
@Service("CommonService")
public class CommonServiceImpl implements CommonService {
@Autowired
@Qualifier("CommonHibernateDao")
private ICommonDao commonDao;
public <T extends BaseEntity> T save(T model) {
return commonDao.save(model)... | public <T extends BaseEntity> Page<T> listAll(Class<T> entityClass, int pn) { | 4 |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/DiskFileSystem.java | [
"public abstract class BaseFileSystem\n implements FileSystem\n{\n /**\n * Ensure consistent serialization.\n *\n * @since 1.0\n */\n private static final long serialVersionUID = 1L;\n\n /**\n * The root entry.\n */\n private final DirectoryEntry root = new DefaultDirectoryEnt... | import org.apache.commons.io.FileUtils;
import org.codehaus.mojo.mrm.api.BaseFileSystem;
import org.codehaus.mojo.mrm.api.DefaultDirectoryEntry;
import org.codehaus.mojo.mrm.api.DirectoryEntry;
import org.codehaus.mojo.mrm.api.Entry;
import org.codehaus.mojo.mrm.api.FileEntry;
import java.io.File;
import java.io.IOExce... | /*
* Copyright 2011 Stephen Connolly
*
* 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 agree... | public FileEntry put( DirectoryEntry parent, String name, InputStream content ) | 4 |
SlimeVoid/LittleBlocks-FML | src/main/java/net/slimevoid/littleblocks/core/lib/BlockUtil.java | [
"public interface ILittleWorld extends IBlockAccess {\r\n\r\n public World getParentWorld();\r\n\r\n public boolean isOutdated(World world);\r\n\r\n public boolean isOutSideLittleWorld(int x, int y, int z);\r\n\r\n public void activeChunkPosition(ChunkPosition chunkposition, boolean forced);\r\n\r\n ... | import ibxm.Player;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.Entity... | package net.slimevoid.littleblocks.core.lib;
public class BlockUtil {
@SideOnly(Side.CLIENT)
private static LittlePlayerController littlePlayerController;
private static HashMap<EntityPlayerMP, ItemInLittleWorldManager> itemInLittleWorldManagers;
@SideOnly(Side.CLIENT)
... | LoggerLittleBlocks.getInstance(Logger.filterClassName(LBCore.class.toString())).write(true, | 1 |
respoke/respoke-sdk-android | respokeSDKTest/src/androidTest/java/com/digium/respokesdktest/functional/PresenceTests.java | [
"public class Respoke {\n\n public final static int GUID_STRING_LENGTH = 36; // The length of GUID strings\n\n private static Respoke _instance;\n private static boolean factoryStaticInitialized;\n private String pushToken;\n private ArrayList<RespokeClient> instances;\n private Context context;\n... | import com.digium.respokesdk.Respoke;
import com.digium.respokesdk.RespokeCall;
import com.digium.respokesdk.RespokeClient;
import com.digium.respokesdk.RespokeDirectConnection;
import com.digium.respokesdk.RespokeEndpoint;
import com.digium.respokesdk.RespokeGroup;
import com.digium.respokesdktest.RespokeTestCase;
imp... | /**
* Copyright 2015, Digium, Inc.
* All rights reserved.
*
* This source code is licensed under The MIT License found in the
* LICENSE file in the root directory of this source tree.
*
* For all details and documentation: https://www.respoke.io
*/
package com.digium.respokesdktest.functional;
public clas... | public void onIncomingDirectConnection(RespokeDirectConnection directConnection, RespokeEndpoint endpoint) { | 3 |
scauwe/Generic-File-Driver-for-IDM | shim/src/main/java/info/vancauwenberge/filedriver/shim/driver/GenericFileDriverShim.java | [
"public interface IDriver {\n\tpublic ISubscriberShim getSubscriber();\n\t/**\n\t * Create a new XDS result document\n\t * @return\n\t */\n\tpublic XDSResultDocument newResultDoc();\n\t\n\t/**\n\t * Get all the driver parameters\n\t * @return\n\t */\n\tpublic Map<? extends String, ? extends Parameter> getDriverPara... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.novell.nds.dirxml.driver.ClassFilter;
import com.novell.nds.dirxml.driver.DriverFilter;
import com.no... |
/**
* <code>shutdown</code> indicates to the DriverShim that
* the driver is being terminated.
* <p>
* @param reasonXML unused
* @return an XML document containing status messages for this
* operation
*/
@Override
public XmlDocument shutdown(final XmlDocument reasonXML)
{
//MODIFY: put ... | public ISubscriberShim getSubscriber(){ | 1 |
ethmobile/ethdroid | ethdroid/src/main/java/io/ethmobile/ethdroid/solidity/coder/SCoder.java | [
"public abstract class Utils {\n\n/* */\n\n /**\n * Check given method to extract it's return type or parametized type with the exact generic\n * type\n * (must be defined in parameters and method annotated with GenericTypeIndex ).\n * The return type can be the generic of an Observable.\n ... | import java.lang.reflect.Type;
import java.util.AbstractMap;
import java.util.List;
import io.ethmobile.ethdroid.Utils;
import io.ethmobile.ethdroid.exception.EthDroidException;
import io.ethmobile.ethdroid.solidity.coder.decoder.SArrayDecoder;
import io.ethmobile.ethdroid.solidity.coder.decoder.SDecoder;
import io.eth... | package io.ethmobile.ethdroid.solidity.coder;
/**
* Created by gunicolas on 08/09/16.
*/
public abstract class SCoder {
public static String encodeParams(Object[] parameters) {
String encodedParameters = "";
for (Object parameter : parameters) {
encodedParameters += encodeParam(pa... | public static SType[] decodeParams(String encodedData, | 6 |
xiaolongzuo/personal-blog-webapp | personal-blog-webapp-site/src/main/java/com/zuoxiaolong/freemarker/FreemarkerHelper.java | [
"public class HttpClient {\n\n private static final Logger log = LoggerFactory.getLogger(HttpClient.class);\n\n private HttpClient() {}\n\n private static final String URL = \"http://127.0.0.1:8888\";\n\n private static Map<String, Object> map(String[] keys, Object... values) {\n if (keys == null... | import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.zuoxiaolong.algorithm.Random;
import com.zuoxiaolong.client.HttpClient;
import com.zuoxiaolong.client.HttpUriEnums;
import com.zuoxiaolong.config.Configuration;
import com.zuoxiaolong.dao.ArticleDao;
import com.zuox... | package com.zuoxiaolong.freemarker;
/*
* Copyright 2002-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LI... | data.put("newComments", DaoFactory.getDao(CommentDao.class).getLastComments(DEFAULT_RIGHT_COMMENT_NUMBER, viewMode)); | 3 |
ailab-uniud/distiller-CORE | src/main/java/it/uniud/ailab/dcore/annotation/annotators/StatisticalAnnotator.java | [
"public interface Annotator extends Stage {\r\n \r\n /**\r\n * The abstract annotation method. All classes that perform some kind of \r\n * annotation (splitting, PoS tagging, entity linking...) must inherit from\r\n * Annotator. They annotate the blackboard given as first parameter or a \r\n ... | import java.util.List;
import it.uniud.ailab.dcore.annotation.Annotator;
import it.uniud.ailab.dcore.Blackboard;
import it.uniud.ailab.dcore.annotation.DefaultAnnotations;
import it.uniud.ailab.dcore.annotation.annotations.FeatureAnnotation;
import it.uniud.ailab.dcore.persistence.DocumentComponent;
import it.uniud.ail... | /*
* Copyright (C) 2015 Artificial Intelligence
* Laboratory @ University of Udine.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option... | for (Gram g : s.getGrams()) { | 5 |
intellimate/Izou | src/main/java/org/intellimate/izou/system/context/EventsDistributor.java | [
"@AddonAccessible\npublic interface EventCallable {\n /**\n * This method is used to fire the event.\n * @param event the Event which should be fired\n * @throws MultipleEventsException IF the implementation doesn't allow multiple Events at once\n */\n void fire(EventModel event) throws Multip... | import org.intellimate.izou.events.EventCallable;
import org.intellimate.izou.events.EventModel;
import org.intellimate.izou.events.EventsControllerModel;
import org.intellimate.izou.identification.Identification;
import org.intellimate.izou.identification.IllegalIDException;
import ro.fortsoft.pf4j.AddonAccessible;
im... | package org.intellimate.izou.system.context;
/**
* @author Leander Kurscheidt
* @version 1.0
*/
@AddonAccessible
public interface EventsDistributor {
/**
* with this method you can register EventPublisher add a Source of Events to the System.
* <p>
* This method represents a higher level of abs... | void fireEventConcurrently(EventModel<?> eventModel); | 1 |
flyersa/MuninMX | src/com/clavain/jobs/CheckJob.java | [
"public class ReturnDebugTrace {\n private String output;\n private int checktime;\n private int retval;\n private int cid;\n private int user_id;\n\n /**\n * @return the output\n */\n public String getOutput() {\n return output;\n }\n\n /**\n * @param output the output... | import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import static com.clavain.utils.Generic.returnServiceCheck;
import static com.clavain.utils.Generic.checkIsProcessing;
import static com.clavain.utils.Generic.getUnixtime;
import static com.clavain.utils.Databa... | /*
* MuninMX
* Written by Enrico Kern, kern@clavain.com
* www.clavain.com
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this... | ReturnDebugTrace rdt = null; | 0 |
cloud-software-foundation/c5-replicator | c5-replicator-log/src/test/java/c5db/log/EncodedSequentialLogTest.java | [
"interface BytePersistence extends AutoCloseable {\n /**\n * Determine if the store is empty.\n *\n * @return True if empty, otherwise false.\n * @throws IOException\n */\n boolean isEmpty() throws IOException;\n\n /**\n * Get the size in bytes of the data, equal to the position/address of\n * next... | import c5db.interfaces.log.SequentialEntryCodec;
import com.google.common.collect.Lists;
import org.jmock.Expectations;
import org.jmock.Sequence;
import org.jmock.integration.junit4.JUnitRuleMockery;
import org.junit.Rule;
import org.junit.Test;
import java.io.IOException;
import java.io.InputStream;
import java.nio.B... | /*
* Copyright 2014 WANdisco
*
* WANdisco licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | OLogEntry entry = makeEntry(seqNum(1), term(2), "data"); | 7 |
stuart-warren/logit | src/main/java/com/stuartwarren/logit/log4j1/Layout.java | [
"public final class ExceptionField extends Field {\n \n private static final ExceptionField FIELD = new ExceptionField();\n \n private ExceptionField() {\n this.setSection(ROOT.EXCEPTION);\n Field.register(this);\n }\n \n public final static void put(final IFieldName key, final St... | import com.stuartwarren.logit.fields.ExceptionField;
import com.stuartwarren.logit.fields.ExceptionField.EXCEPTION;
import com.stuartwarren.logit.fields.LocationField;
import com.stuartwarren.logit.fields.LocationField.LOCATION;
import com.stuartwarren.logit.layout.IFrameworkLayout;
import com.stuartwarren.logit.layout... | /**
*
*/
package com.stuartwarren.logit.log4j1;
/**
* @author Stuart Warren
* @date 6 Oct 2013
*
*/
public class Layout extends org.apache.log4j.Layout implements IFrameworkLayout {
private String layoutType = "log";
private String detailThreshold = Level.ERROR.toString();
private String fi... | LocationField.clear(); | 2 |
dariober/ASCIIGenome | src/main/java/tracks/TrackPileup.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import jav... | package tracks;
/** Collect depth and coverage info over a region of a chromosome
* */
public class TrackPileup extends TrackWiggles {
/** Key: Position of the locus. Value: information at this position.
* NB: This is a hashmap so positions are not returned in order. The method(s)
* getDepth(), etc should r... | protected TrackPileup(String bam, GenomicCoords gc) throws IOException, ClassNotFoundException, InvalidGenomicCoordsException, InvalidRecordException, SQLException { | 3 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/remote/Server.java | [
"public class MoePlugin extends AbstractMoePlugin {\n\n private static final Logger LOG = Logging.getLogger(MoePlugin.class);\n\n private static final String MOE_ARCHS_PROPERTY = \"moe.archs\";\n\n @NotNull\n private MoeExtension extension;\n\n @NotNull\n @Override\n public MoeExtension getExte... | import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import org.apache.commons.codec.digest.DigestUtils;
import org.gradle.BuildResult;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.Task;
impo... |
@NotNull
public URI getSdkDir() {
return Require.nonNull(sdkDir);
}
@Nullable
private Task moeRemoteServerSetupTask;
@NotNull
public Task getMoeRemoteServerSetupTask() {
return Require.nonNull(moeRemoteServerSetupTask);
}
private final ExecutorService executor = E... | final FileList list = new FileList(gradlewZip.getParentFile(), getBuildDir()); | 3 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/server/action/GetRenderedImageFiles.java | [
"public abstract class ImageAttributes {\n\t\n\tpublic static final String DATA_FILE_EXTENSION = \".dat\";\n\tpublic static final String IMAGE_FILE_EXTENSION = \".png\";\n\t\n\tpublic static String getDataFilename(String imageName) {\n\t\treturn imageName + DATA_FILE_EXTENSION;\n\t}\n\n\tpublic static String getIma... | import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import com.sketchy.image.ImageAttribut... | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your op... | public JSONServletResult execute(HttpServletRequest request) throws Exception { | 3 |
paramsen/currency-android-reactive | app/src/main/java/com/amsen/par/cewlrency/view/activity/CurrencyActivity.java | [
"public class BehaviorTracker {\n private Analytics analytics;\n private EventStream eventStream;\n\n @Inject\n public BehaviorTracker(Analytics analytics, EventStream eventStream) {\n this.analytics = analytics;\n this.eventStream = eventStream;\n }\n\n public void start() {\n ... | import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.view.View;
import com.amsen.par.cewlrency.R;
import com.amsen.par.cewlrency.analytics.BehaviorTracker;
import com.amsen.par.cewlrency.base.rx.event.EventStream;
import com.amsen.par.c... | package com.amsen.par.cewlrency.view.activity;
public class CurrencyActivity extends BaseActivity {
@Inject
CurrencySource source;
@Inject
EventStream eventStream;
@Inject | BehaviorTracker behaviorTracker; | 0 |
psycopaths/jconstraints | src/main/java/gov/nasa/jpf/constraints/expressions/functions/math/axioms/IsNaNProperties.java | [
"public abstract class Expression<E> extends AbstractPrintable {\n \n \n public static final int QUOTE_IDENTIFIERS = 1;\n public static final int INCLUDE_VARIABLE_TYPE = 2;\n public static final int INCLUDE_BOUND_DECL_TYPE = 4;\n public static final int SIMPLE_PROP_OPERATORS = 8;\n \n public static final in... | import gov.nasa.jpf.constraints.api.Expression;
import gov.nasa.jpf.constraints.api.Variable;
import gov.nasa.jpf.constraints.expressions.Negation;
import gov.nasa.jpf.constraints.expressions.functions.FunctionExpression;
import gov.nasa.jpf.constraints.expressions.functions.math.BooleanDoubleFunction;
import static go... | /*
* Copyright (C) 2015, United States Government, as represented by the
* Administrator of the National Aeronautics and Space Administration.
* All rights reserved.
*
* The PSYCO: A Predicate-based Symbolic Compositional Reasoning environment
* platform is licensed under the Apache License, Version 2.0 (the "L... | Variable arg = var(BuiltinTypes.DOUBLE); | 6 |
RalleYTN/SimpleAudio | src/test/java/de/ralleytn/simple/audio/tests/PlayTest.java | [
"public interface Audio extends Playable {\n\t\n\t/**\n\t * Loops the audio for {@code n} times.\n\t * @param repetitions the number of repetitions\n\t * @since 1.0.0\n\t */\n\tpublic void loop(int repetitions);\n\t\n\t/**\n\t * Sets the position at which the audio should play.\n\t * @param millisecond position in ... | import de.ralleytn.simple.audio.Audio;
import de.ralleytn.simple.audio.AudioEvent;
import de.ralleytn.simple.audio.AudioException;
import de.ralleytn.simple.audio.BufferedAudio;
import de.ralleytn.simple.audio.StreamedAudio;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api... | /*
* MIT License
*
* Copyright (c) 2017 Ralph Niemitz
*
* 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, ... | testAudio(new BufferedAudio(resource)); | 3 |
InteractiveSystemsGroup/GamificationEngine-Kinben | src/main/java/info/interactivesystems/gamificationengine/entities/rewards/Reward.java | [
"@Named\n@Stateless\npublic class GoalDAO {\n\t@PersistenceContext(unitName = PersistenceUnit.PROJECT)\n\tprivate EntityManager em;\n\n\t/**\n\t * Stores a new goal in the data base.\n\t * \n\t * @param goal\n\t * The goal which should be stored in the data base.\n\t * @return The id of the {@link Goal}.... | import info.interactivesystems.gamificationengine.dao.GoalDAO;
import info.interactivesystems.gamificationengine.dao.RuleDAO;
import info.interactivesystems.gamificationengine.entities.Organisation;
import info.interactivesystems.gamificationengine.entities.Player;
import info.interactivesystems.gamificationengine.enti... | package info.interactivesystems.gamificationengine.entities.rewards;
/**
* The super class of all rewards. Here are general information of the reward
* like to which organisation the reward belongs to or the goal to which it
* is associated.
*
* A Reward will be awarded in dependent of the goal for a group ... | private Organisation belongsTo; | 2 |
Kaysoro/KaellyBot | src/main/java/exceptions/BadUseCommandDiscordException.java | [
"public abstract class AbstractCommand implements Command {\n\n private final static Logger LOG = LoggerFactory.getLogger(AbstractCommand.class);\n\n protected String name;\n protected String pattern;\n protected DiscordException badUse;\n private boolean isPublic;\n private boolean isUsableInMP;\... | import commands.model.AbstractCommand;
import commands.model.Command;
import commands.classic.HelpCommand;
import discord4j.core.object.entity.Message;
import enums.Language;
import util.Translator;
import java.util.regex.Matcher; | package exceptions;
/**
* Created by steve on 14/11/2016.
*/
public class BadUseCommandDiscordException implements DiscordException {
@Override | public void throwException(Message message, Command command, Language lg, Object... arguments) { | 3 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/Simplest_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import org.apache.jena.rdf.model.ModelFactory;
import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.ap... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Iterator<PredicateObjectMap> pomit=current.getPredicateObjectMaps().iterator();
| 5 |
aeshell/aesh-extensions | aesh/src/main/java/org/aesh/extensions/highlight/scanner/JavaScriptScanner.java | [
"public interface Encoder {\n\n void textToken(String text, TokenType type);\n\n void beginGroup(TokenType type);\n\n void endGroup(TokenType type);\n\n void beginLine(TokenType type);\n\n void endLine(TokenType type);\n\n public enum Type {\n TERMINAL, DEBUG\n }\n\n public abstract s... | import org.aesh.extensions.highlight.Encoder;
import org.aesh.extensions.highlight.Scanner;
import org.aesh.extensions.highlight.StringScanner;
import org.aesh.extensions.highlight.Syntax;
import org.aesh.extensions.highlight.TokenType;
import org.aesh.extensions.highlight.WordList;
import java.util.HashMap;
import jav... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | public void scan(StringScanner source, Encoder encoder, Map<String, Object> options) { | 2 |
ieee8023/PDFViewer | src/org/ebookdroid/ui/viewer/dialogs/GoToPageDialog.java | [
"public class Page {\n\n static final LogContext LCTX = LogManager.root().lctx(\"Page\", false);\n\n public final PageIndex index;\n public final PageType type;\n public final CodecPageInfo cpi;\n\n final IActivityController base;\n public final PageTree nodes;\n\n RectF bounds;\n int aspect... | import org.ebookdroid.common.settings.AppSettings;
import org.ebookdroid.common.settings.books.BookSettings;
import org.ebookdroid.common.settings.books.Bookmark;
import org.ebookdroid.core.Page;
import org.ebookdroid.core.models.DocumentModel;
import org.ebookdroid.ui.viewer.IActivityController;
import org.ebookdroid.... | package org.ebookdroid.ui.viewer.dialogs;
public class GoToPageDialog extends Dialog {
final IActivityController base;
final SeekBarIncrementHandler handler; | BookmarkAdapter adapter; | 3 |
maoruibin/AppPlus | app/src/main/java/com/gudong/appkit/dao/WeChatHelper.java | [
"public enum EEvent {\n /**\n * in setting activity,when user clicked Show AppPlus setting item,this Event will be trigger\n */\n RECENT_LIST_IS_SHOW_SELF_CHANGE,\n /**\n * in setting activity,when user clicked Brief mode setting item,this Event will be trigger\n */\n LIST_ITEM_BRIEF_MOD... | import android.content.Context;
import android.content.DialogInterface;
import android.os.Environment;
import android.support.v7.app.AlertDialog;
import com.gudong.appkit.R;
import com.gudong.appkit.event.EEvent;
import com.gudong.appkit.event.RxBus;
import com.gudong.appkit.event.RxEvent;
import com.gudong.appkit.ui.a... | package com.gudong.appkit.dao;
/**
* Created by GuDong on 7/19/16 23:11.
* Contact with gudong.name@gmail.com.
*/
public class WeChatHelper {
private Context mContext;
public WeChatHelper(Context context) {
mContext = context;
}
public void checkDownloadListDialog(boolean isCheckDataBe... | File exportParentFile = FileUtil.createDir(FileUtil.getSDPath(), FileUtil.KEY_EXPORT_DIR); | 5 |
zeevy/grblcontroller | app/src/main/java/in/co/gorest/grblcontroller/service/GrblBluetoothSerialService.java | [
"public class GrblRealTimeCommandEvent {\n\n private final byte command;\n\n public GrblRealTimeCommandEvent(byte command){\n this.command = command;\n }\n\n public byte getCommand(){\n return this.command;\n }\n\n}",
"public class UiToastEvent {\n\n private String message;\n pr... | import android.app.Notification;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothServerSocket;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
im... | connected(mmSocket, mmDevice, mSocketType);
}
public void cancel() {
try {
mmSocket.close();
} catch (IOException | NullPointerException e) {
Log.e(TAG, "close() of connect " + mSocketType + " socket failed", e);
}
... | public void onGrblGcodeSendEvent(GcodeCommand event){ | 5 |
caoli5288/SimpleORM | src/main/java/com/mengcraft/simpleorm/lib/GsonUtils.java | [
"public class CustomTypeAdapter<T> extends TypeAdapter<T> {\n\n private final JsonSerializer<T> serializer;\n private final JsonDeserializer<T> deserializer;\n private final Gson gson;\n private final TypeToken<T> typeToken;\n private final GsonContextImpl context = new GsonContextImpl();\n privat... | import com.google.common.collect.Maps;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.g... | package com.mengcraft.simpleorm.lib;
public class GsonUtils {
private static final Field PRIMITIVE_VALUE = Utils.getAccessibleField(JsonPrimitive.class, "value");
private static TypeFunctionRegistry<Object> registry = new TypeFunctionRegistry<>();
static {
registry.register(JsonNull.class, e -... | IDeserializer deserializer = SerializableTypes.asDeserializer(cls); | 2 |
stickfigure/batchfb | src/main/java/com/googlecode/batchfb/FacebookBatcher.java | [
"public class Batch implements Batcher, Later<JsonNode> {\r\n\t\r\n\t/** */\r\n\tprivate static final Logger log = Logger.getLogger(Batch.class.getName());\r\n\t\r\n\t/**\r\n\t * Required facebook access token\r\n\t */\r\n\tprivate String accessToken;\r\n\r\n\t/**\r\n\t * If not null, pass this proof with every met... | import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.da... | /*
* Copyright (c) 2010 Jeff Schnitzer.
*
* 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, mer... | return URLParser.parseQuery(StringUtils.read(response.getContentStream())).get("access_token");
| 7 |
santanusinha/dropwizard-db-sharding-bundle | src/test/java/io/appform/dropwizard/sharding/dao/LookupDaoTest.java | [
"@Entity\n@Table(name=\"audits\")\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\n@ToString\n@Builder\npublic class Audit {\n @Id\n @GeneratedValue(strategy = GenerationType.IDENTITY)\n @Column(name = \"id\")\n private long id;\n\n @Column(name = \"text\")\n private String text;\n\n @ManyToOne... | import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import io.appform.dropwizard.sharding.dao.testdata.entities.Audit;
import io.appform.dropwizard.sharding.dao.testdata.entities.Phone;
import io.appform.dropwizard.sharding.dao.testdata.... | /*
* Copyright 2016 Santanu Sinha <santanu.sinha@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | final ShardManager shardManager = new BalancedShardManager(sessionFactories.size()); | 5 |
AbrarSyed/SecretRoomsMod-forge | src/main/java/com/wynprice/secretroomsmod/integration/malisisdoors/SecretCompactMalisisDoors.java | [
"@Mod(modid = SecretRooms5.MODID, name = SecretRooms5.MODNAME, version = SecretRooms5.VERSION, acceptedMinecraftVersions = SecretRooms5.MCVERSION, dependencies = SecretRooms5.DEPENDENCIES,updateJSON = SecretRooms5.UPDATE_URL)\npublic class SecretRooms5\n{\n public static final String MODID = \"secretroomsmod\";\... | import com.wynprice.secretroomsmod.SecretRooms5;
import com.wynprice.secretroomsmod.handler.HandlerModContainer;
import com.wynprice.secretroomsmod.integration.malisisdoors.registries.blocks.SecretMalisisDoorBlock;
import com.wynprice.secretroomsmod.integration.malisisdoors.registries.blocks.SecretMalisisTrapDoorBlock;... | package com.wynprice.secretroomsmod.integration.malisisdoors;
public class SecretCompactMalisisDoors
{
private static final DoorDescriptor wooden_desc = createDoorDescriptor(DoorDescriptor.class, () -> {
Loader.instance().setActiveModContainer(HandlerModContainer.getContainer(MalisisDoors.modid)); //Needed to s... | public static final Item WOODEN_DOOR_ITEM = new SecretMalisiItemDoor(wooden_desc); | 4 |
FedUni/caliko | caliko-visualisation/src/main/java/au/edu/federation/caliko/visualisation/FabrikLine2D.java | [
"public class FabrikBone2D implements FabrikBone<Vec2f,FabrikJoint2D>\r\n{\r\n\t/**\r\n\t * mJoint\tThe joint attached to this FabrikBone2D.\r\n\t * <p>\r\n\t * Each bone has a single FabrikJoint2D which controls the angle to which the bone is\r\n\t * constrained with regard to the previous (i.e. earlier / closer t... | import au.edu.federation.caliko.FabrikBone2D;
import au.edu.federation.caliko.FabrikChain2D;
import au.edu.federation.caliko.FabrikChain2D.BaseboneConstraintType2D;
import au.edu.federation.caliko.FabrikJoint2D.ConstraintCoordinateSystem;
import au.edu.federation.caliko.FabrikStructure2D;
import au.edu.federation.... | package au.edu.federation.caliko.visualisation;
/**
* A static class used to draw a 2D lines to represent FabrikBone2D, FabrikChain2D or FabrickStructure2D objects.
* <p>
* These draw methods are only provided to assist with prototyping and debugging.
* <p>
* The GLSL shaders used to draw the lines requi... | point.draw(chain.getEmbeddedTarget(), Utils.YELLOW, 4.0f, mvpMatrix);
| 7 |
lenis0012/LoginSecurity-2 | src/main/java/com/lenis0012/bukkit/loginsecurity/commands/CommandAdmin.java | [
"public class LoginSecurity extends PluginHolder {\n private static final ExecutorService executorService = Executors.newCachedThreadPool();\n\n /**\n * Get the executor LoginSecurity uses for async processing.\n *\n * @return Executor service.\n */\n public static ExecutorService getExecut... | import com.google.common.collect.Maps;
import com.lenis0012.bukkit.loginsecurity.LoginSecurity;
import com.lenis0012.bukkit.loginsecurity.modules.general.GeneralModule;
import com.lenis0012.bukkit.loginsecurity.modules.storage.StorageImport;
import com.lenis0012.bukkit.loginsecurity.session.AuthService;
import com.leni... | package com.lenis0012.bukkit.loginsecurity.commands;
public class CommandAdmin extends Command {
private final Map<String, Method> methods = Maps.newLinkedHashMap(); // maintain order for help command
private final LoginSecurity plugin;
public CommandAdmin(LoginSecurity plugin) {
this.plugin = ... | StorageImport storageImport = StorageImport.fromSourceName(source, sender); | 2 |
bencvt/LibShapeDraw | projects/demos/src/main/java/libshapedraw/demos/mod_LSDDemoShapeCustom.java | [
"public class LibShapeDraw {\n private final Set<Shape> shapes;\n private final Set<Shape> shapesReadonly;\n private final Set<LSDEventListener> eventListeners;\n private final Set<LSDEventListener> eventListenersReadonly;\n private final String instanceId;\n private final String ownerId;\n pri... | import org.lwjgl.opengl.GL11;
import libshapedraw.LibShapeDraw;
import libshapedraw.MinecraftAccess;
import libshapedraw.primitive.Axis;
import libshapedraw.primitive.Color;
import libshapedraw.primitive.Vector3;
import libshapedraw.shape.Shape;
import libshapedraw.transform.ShapeRotate; | package libshapedraw.demos;
/**
* Any class in libshapedraw.shapes can be extended with new behaviors.
* <p>
* The built-in Shapes try to cover as many use cases as possible though: if
* you have an idea for a reuseable feature, feel free to request that it be
* added to LibShapeDraw!
*/
public class mod_LSDDe... | new ShapeRotate(0.0, Axis.Y) | 2 |
vector-im/riot-automated-tests | VectorMobileTests/src/test/java/mobilestests_ios/RiotMessagesReceptionTests.java | [
"public class RiotRoomPageObjects extends TestUtilities{\n\tprivate IOSDriver<MobileElement> driver;\n\tpublic RiotRoomPageObjects(AppiumDriver<MobileElement> myDriver) {\n\t\tdriver= (IOSDriver<MobileElement>) myDriver;\n\t\tPageFactory.initElements(new AppiumFieldDecorator(driver), this);\n\t\ttry {\n\t\t\twaitUn... | import java.io.FileNotFoundException;
import java.io.IOException;
import org.testng.Assert;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.esotericsoftware.yamlbeans.YamlException;
import io.appium.java_client.MobileElement;
import pom... | package mobilestests_ios;
@Listeners({ ScreenshotUtility.class })
public class RiotMessagesReceptionTests extends RiotParentTest{
private String msgFromUpUser="UP";
private String roomId="!SBpfTGBlKgELgoLALQ%3Amatrix.org";
private String roomIdCustomHs="!LVRuDkmtSvMXfqSgLy%3Ajeangb.org";
private String pic... | RiotRoomsTabPageObjects roomsTabPage= homePage.openRoomsTab(); | 2 |
shyampurk/bluemix-todo-app | Android-Client/app/src/main/java/vitymobi/com/todobluemix/ActivityTaskDetails.java | [
"public class TaskCommentsAdapter extends BaseAdapter {\n\n private Context parentContext;\n private LayoutInflater mInflater;\n private ArrayList<CommentTemplate> taskComments;\n\n\n public TaskCommentsAdapter(Context parentReference, ArrayList<CommentTemplate> commentsList){\n this.parentConte... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Bundle;
import android... | package vitymobi.com.todobluemix;
/**
* Created by manishautomatic on 22/03/16.
*/
public class ActivityTaskDetails extends AppCompatActivity implements View.OnClickListener {
private ListView mLstVwTaskComments;
private TaskCommentsAdapter mAdapter;
private ArrayList<CommentTemplate> commentsList ... | new IntentFilter(ChannelConstants.GET_TASK_DETAILS)); | 1 |
cuba-platform/yarg | core/modules/core/test/sample/bookstore2/BookStore2Test.java | [
"public class DefaultFormatterFactory implements ReportFormatterFactory {\n protected OfficeIntegrationAPI officeIntegration;\n protected DocumentConverter documentConverter;\n protected DefaultFormatProvider defaultFormatProvider;\n protected HtmlImportProcessor htmlImportProcessor;\n protected Html... | import java.io.File;
import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import com.haulmont.yarg.console.DatasourceHolder;
import com.haulmont.yarg.formatters.factory.DefaultFormatterFactory;
import com.haulmont.yarg.loaders.factory.DefaultLoaderFactory;
import com.haulmont.yarg.... | /*
* Copyright 2013 Haulmont
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... | Reporting reporting = new Reporting(); | 2 |
magnusmickelsson/pokeraidbot | src/main/java/pokeraidbot/jda/SignupWithPlusCommandListener.java | [
"public class BotService {\n private static final Logger LOGGER = LoggerFactory.getLogger(BotService.class);\n private final Set<EventListener> extraListeners = new CopyOnWriteArraySet<>();\n private TrackingService trackingService;\n private String ownerId;\n private String token;\n private JDA b... | import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.GenericEvent;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.api.hooks.EventListener;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.comm... | package pokeraidbot.jda;
public class SignupWithPlusCommandListener implements EventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(SignupWithPlusCommandListener.class);
private final RaidRepository raidRepository;
private final PokemonRepository pokemonRepository;
private fi... | private final LocaleService localeService; | 2 |
tobyweston/tempus-fugit | src/test/java/com/google/code/tempusfugit/concurrency/DefaultTimeoutableCompletionServiceTest.java | [
"public interface Clock {\n\n Date now();\n\n}",
"public interface Condition {\n boolean isSatisfied();\n}",
"public class Duration implements Comparable<Duration> {\n\n private final Long value;\n private final TimeUnit unit;\n\n private Duration(Long value, TimeUnit unit) {\n this.value ... | import com.google.code.tempusfugit.temporal.Clock;
import com.google.code.tempusfugit.temporal.Condition;
import com.google.code.tempusfugit.temporal.Duration;
import com.google.code.tempusfugit.temporal.RealClock;
import org.hamcrest.Description;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmoc... | /*
* Copyright (c) 2009-2018, toby weston & tempus-fugit committers
*
* 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... | private static final Duration TIMEOUT = millis(5); | 2 |
idega/com.idega.documentmanager | src/java/com/idega/documentmanager/manager/impl/XFormsManagerMultiUploadImpl.java | [
"public interface PropertiesMultiUpload extends PropertiesComponent{\n \n public abstract LocalizedStringBean getRemoveButtonLabel();\n\n public abstract void setRemoveButtonLabel(LocalizedStringBean removeButtonLabel);\n \n public abstract LocalizedStringBean getAddButtonLabel();\n\n public abstr... | import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import com.idega.documentmanager.business.component.properties.PropertiesMultiUpload;
import com.idega.documentmanager.component.FormComponent;
import com.idega.documentmanager.component.beans.ComponentDataBean;
import com.idega.docum... | package com.idega.documentmanager.manager.impl;
/**
* @author <a href="mailto:arunas@idega.com">Arūnas Vasmanas</a>
* @version $Revision: 1.14 $
*
* Last modified: $Date: 2008/10/26 16:47:10 $ by $Author: anton $
*/
public class XFormsManagerMultiUploadImpl extends XFormsManagerImpl implements
XFormsManagerMu... | LocalizedStringBean localizedText = properties.getAddButtonLabel(); | 4 |
cash1981/civilization-boardgame-rest | src/main/java/no/asgari/civilization/server/action/UndoAction.java | [
"public enum SheetName {\n CIV(\"Civ\"), CULTURE_1(\"Culture I\"), CULTURE_2(\"Culture II\"),\n CULTURE_3(\"Culture III\"), GREAT_PERSON(\"Great Person\"), INFANTRY(\"Infantry\"), ARTILLERY(\"Artillery\"), MOUNTED(\"Mounted\"),\n AIRCRAFT(\"Aircraft\"), VILLAGES(\"Villages\"), HUTS(\"Huts\"), WONDERS(\"Won... | import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import lombok.extern.log4j.Log4j;
import no.asgari.civilization.server.SheetName;
import no.asgari.civilization.server.dto.ItemDTO;
import no.asgari.civilization.server.model.Draw... | /*
* Copyright (c) 2015 Shervin Asgari
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | private boolean putDrawnItemBackInPBF(PBF pbf, Draw draw) { | 2 |
crate/elasticsearch-inout-plugin | src/main/java/crate/elasticsearch/plugin/inout/InOutPlugin.java | [
"public class DumpModule extends AbstractModule {\n\n @Override\n protected void configure() {\n bind(TransportDumpAction.class).asEagerSingleton();\n\n bind(DumpParser.class).asEagerSingleton();\n\n MapBinder<GenericAction, TransportAction> transportActionsBinder = MapBinder.newMapBinder... | import java.util.Collection;
import org.elasticsearch.common.collect.Lists;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;
import crate.elasticsearch.module.dump.DumpModule;
impo... | package crate.elasticsearch.plugin.inout;
public class InOutPlugin extends AbstractPlugin {
private final Settings settings;
public InOutPlugin(Settings settings) {
this.settings = settings;
}
public String name() {
return "inout";
}
public String description() {
... | restModule.addRestAction(RestRestoreAction.class); | 5 |
caseydavenport/biermacht | src/com/biermacht/brews/frontend/AddMashStepActivity.java | [
"public abstract class AddEditActivity extends DriveActivity implements OnClickListener {\n\n // Main view - holds all the rows\n public ViewGroup mainView;\n\n // Alert builder\n public AlertBuilder alertBuilder;\n\n // Important things\n public OnClickListener onClickListener;\n\n // LayoutInflater\n publ... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.TextView;
import com.biermacht.brews.R;
import ... | package com.biermacht.brews.frontend;
public class AddMashStepActivity extends AddEditActivity {
// Views
public View stepTempView;
public View waterToGrainRatioView;
public View infuseTemperatureView;
public View stepAmountView;
public View rampTimeView;
// Titles
public TextView stepTempViewTitl... | callback = new Callback() { | 5 |
8enet/AppOpsX | opsxpro/src/main/java/com/zzzmode/appopsx/LocalServerManager.java | [
"public class AdbStream implements Closeable {\n\n /** The AdbConnection object that the stream communicates over */\n\tprivate AdbConnection adbConn;\n\t\n\t/** The local ID of the stream */\n\tprivate int localId;\n\t\n\t/** The remote ID of the stream */\n\tprivate int remoteId;\n\t\n\t/** Indicates whether a... | import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import com.cgutman.adblib.AdbConnection;
import com.cgutman.adblib.AdbStream;
import com.zzzmode.adblib.AdbConnector;
import com.zzzmode.adblib.LineReader;
import com.zzzmode.appopsx.common.BaseCaller;
import com.zzzmode.appopsx.comm... | package com.zzzmode.appopsx;
/**
* Created by zl on 2016/11/13.
*/
class LocalServerManager {
private static final String TAG = "LocalServerManager";
private static LocalServerManager sLocalServerManager;
private OpsxManager.Config mConfig;
static LocalServerManager getInstance(OpsxManager.Config confi... | byte[] result = execPre(ParcelableUtil.marshall(new BaseCaller(method.wrapParams()))); | 7 |
zhao-mingjian/qvod | app/src/main/java/com/zmj/qvod/presenter/RecommendPresenter.java | [
"public class RecommendAdapter extends RecyclerArrayAdapter<VideoInfo> {\n\n\n public RecommendAdapter(Context context) {\n super(context);\n }\n\n @Override\n public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) {\n return new RecommendViewHolder(parent);\n }\n\n\n}... | import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import com.jude.beam.expansion.BeamBasePresenter;
import com.zmj.qvod.adapter.RecommendAd... | package com.zmj.qvod.presenter;
/**
* Created by matt on 2017/3/14.
*/
public class RecommendPresenter extends BeamBasePresenter<RecommendFragment> implements SwipeRefreshLayout.OnRefreshListener {
private RecommendAdapter adapter;
private LinearLayoutManager layoutManager;
@Override
protected... | VideoRes videoRes = VideoApplication.getInstance().getVideoRes(); | 3 |
DistantEye/EP_Utilities | EclipsePhaseLifePath/src/com/github/distanteye/ep_utils/core/EpEnvironment.java | [
"public abstract class Command {\r\n\tprotected String origString;\r\n\t\r\n\t// for both params and subparts, index 0 is the command name\r\n\tprotected HashMap<Integer,Object> params; // Params can be Strings, Integers, Funcs, Tables, or other Commands, unfortunately\r\n\t\t\t\t\t\t\t\t\t\t\t // the emphasis on ... | import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.regex.Pattern;
import com.github.distanteye.ep_utils.commands.Command;
import com.github.distanteye.ep_utils.commands.CommandBuilder;
import com.github.distanteye.ep_utils.commands.directives.Directive;
import com.github.distanteye.ep... | package com.github.distanteye.ep_utils.core;
// explicit because name ambiguity
/**
* The class takes in the appropriate information via DataProc to interactively generate a character
* through various stages,packages, and tables
*
* @author Vigilant
*
*/
public class EpEnvironment implements Characte... | Directive d = DirectiveBuilder.getDirective(effect);
| 3 |
jmimo/netty-icap | src/main/java/ch/mimo/netty/example/icap/simple/IcapServerHandler.java | [
"public class DefaultIcapResponse extends AbstractIcapMessage implements IcapResponse {\n\n\tprivate IcapResponseStatus status;\n\tprivate ChannelBuffer optionsContent;\n\t\n\t/**\n\t * Will create an instance of IcapResponse.\n\t * \n\t * @param version the version of the response.\n\t * @param status the Status c... | import ch.mimo.netty.handler.codec.icap.IcapVersion;
import java.nio.charset.Charset;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.handle... | /*******************************************************************************
* Copyright 2012 Michael Mimo Moratti
*
* 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://ww... | IcapMessageElementEnum bodyType = request.getBodyType(); | 2 |
batsw/AndroidAnonymityChat | app/src/main/java/com/batsw/anonimitychat/mainScreen/tabs/TabContacts.java | [
"public class AppController {\n private static final String LOG = AppController.class.getSimpleName();\n\n private static AppController mInstance;\n\n private AppCompatActivity mMainScreenActivity = null;\n\n private boolean mIsBackended = false;\n\n private static Activity mCurrentActivityContext = ... | import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
impor... | package com.batsw.anonimitychat.mainScreen.tabs;
/**
* Created by tudor on 3/29/2017.
*/
public class TabContacts extends Fragment {
private static final String LOG = TabContacts.class.getSimpleName();
private List<ContactEntity> mContactsList;
private ContactsAdapter mContactsAdapter;
private... | final List<IDbEntity> contactList = AppController.getInstanceParameterized(null).getContactList(); | 5 |
TheCBProject/EnderStorage | src/main/java/codechicken/enderstorage/proxy/Proxy.java | [
"public class EnderStorageManager {\n\n public static class EnderStorageSaveHandler {\n\n @SubscribeEvent\n public void onWorldLoad(WorldEvent.Load event) {\n if (event.getWorld().isClientSide()) {\n reloadManager(true);\n }\n }\n\n @SubscribeEvent... | import codechicken.enderstorage.manager.EnderStorageManager;
import codechicken.enderstorage.network.EnderStorageNetwork;
import codechicken.enderstorage.network.TankSynchroniser;
import codechicken.enderstorage.plugin.EnderItemStoragePlugin;
import codechicken.enderstorage.plugin.EnderLiquidStoragePlugin;
import net.m... | package codechicken.enderstorage.proxy;
/**
* Created by covers1624 on 4/11/2016.
*/
public class Proxy {
public void commonSetup(FMLCommonSetupEvent event) { | EnderStorageNetwork.init(); | 1 |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/app/solver/thread/RestrictionBuilder.java | [
"public interface AggregationManager\n{\n\n public abstract void resetAggregatedSoftFormulas();\n\n\n /**\n * Adds aggregated soft constraints.\n * \n * These aggregated soft constraints will be included into the gurobi model,\n * when solve() is executed.\n * \n * @param weight\n ... | import java.util.ArrayList;
import java.util.HashMap;
import com.googlecode.rockit.app.solver.aggregate.AggregationManager;
import com.googlecode.rockit.app.solver.pojo.Clause;
import com.googlecode.rockit.app.solver.pojo.Literal;
import com.googlecode.rockit.conn.ilp.ILPConnector;
import com.googlecode.rockit.conn.sql... | package com.googlecode.rockit.app.solver.thread;
public abstract class RestrictionBuilder extends Thread
{
| public abstract FormulaHard getFormula(); | 5 |
cryptomator/cryptolib | src/test/java/org/cryptomator/cryptolib/v2/FileHeaderCryptorImplTest.java | [
"public class AuthenticationFailedException extends CryptoException {\n\n\tpublic AuthenticationFailedException(String message) {\n\t\tsuper(message);\n\t}\n\n\tpublic AuthenticationFailedException(String message, Throwable cause) {\n\t\tsuper(message, cause);\n\t}\n\n}",
"public interface FileHeader {\n\n\t/**\n... | import com.google.common.io.BaseEncoding;
import org.cryptomator.cryptolib.api.AuthenticationFailedException;
import org.cryptomator.cryptolib.api.FileHeader;
import org.cryptomator.cryptolib.api.Masterkey;
import org.cryptomator.cryptolib.common.CipherSupplier;
import org.cryptomator.cryptolib.common.GcmTestHelper;
im... | /*******************************************************************************
* Copyright (c) 2016 Sebastian Stenzel and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the accompanying LICENSE.txt.
*
* Contributors:
* Sebastian Stenzel - i... | Masterkey masterkey = new Masterkey(new byte[64]); | 2 |
kuaijibird/palmsuda | src/com/mialab/palmsuda/main/MaintainMgr.java | [
"public class Constants {\n\tpublic static boolean TEST_MODE = false;\n\tpublic static boolean DEBUG_MODE =true;\t\n\tpublic static final String APP_TAG = \"PalmSuda\";\n\tpublic static final String APP_DIR = \"PalmSuda\";\n\tpublic static final String APP_CACHE = \"/cache\";\n\t\n\tpublic static final boolean MARK... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONArray;
import org.json.JSONObject;
import android.content.Context;
import android.content.Intent;
import andr... | "---------------"
+ contentItem.getContentName()
+ "------------");
Log.d("hand",
"---------------" + contentItem.getMobileNum()
+ "-----------");
Log.d("hand",
"---------------" + contentItem.getmItems()
+ "---------");
Log.d("hand",
... | ModuleConfigOptions options = mItem.getmOptions(); | 2 |
Kroger-Technology/Snow-Globe | src/integration/java/com/kroger/oss/snowGlobe/integration/tests/ReloadTest.java | [
"public class AppServiceCluster {\n\n private final String clusterName;\n private final boolean useHttps;\n private int httpResponseCode = 200;\n private String matchingPaths = \"*\";\n private Map<String, String> responseHeaders = new HashMap<>();\n private int port;\n\n /**\n * The constr... | import com.kroger.oss.snowGlobe.AppServiceCluster;
import com.kroger.oss.snowGlobe.NginxRpBuilder;
import org.junit.Before;
import org.junit.Test;
import static com.kroger.oss.snowGlobe.AppServiceCluster.makeHttpsWebService;
import static com.kroger.oss.snowGlobe.NginxRpBuilder.runNginxWithUpstreams;
import static com.... | /*
* Snow-Globe
*
* Copyright 2017 The Kroger Co.
*
* 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 l... | make(getRequest("https://www.nginx-test.com/login").to(nginxReverseProxy)) | 5 |
ooyala/Ooyala-AdobeCQ | ui/src/content/jcr_root/libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/forms/FormsHelper.java | [
"public class ELEvaluator {\n\n /**\n * The logger instance for this class.\n */\n private static final Logger log = LoggerFactory.getLogger(ELEvaluator.class);\n\n /**\n * Evaluates the given expression. If an error occurs while evaluating the\n * expression, then the expression is returne... | import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.... | // check for escaping
if ( pos > 0 && value.charAt(pos-1) == '\\' ) {
start = pos +1;
endLoop = false;
} else {
endLoop = true;
}
} while ( !endL... | rule = ELEvaluator.evaluate(rule, req, pageContext); | 0 |
guiying712/AndroidModulePattern | module_news/src/main/java/debug/NewsApplication.java | [
"public class BaseApplication extends Application {\n\n public static final String ROOT_PACKAGE = \"com.guiying.module\";\n\n private static BaseApplication sInstance;\n\n private List<IApplicationDelegate> mAppDelegateList;\n\n\n public static BaseApplication getIns() {\n return sInstance;\n ... | import com.guiying.module.common.base.BaseApplication;
import com.guiying.module.common.http.DataType;
import com.guiying.module.common.http.HttpClient;
import com.guiying.module.common.http.OnResultListener;
import com.guiying.module.news.Constants;
import com.guiying.module.news.data.bean.StoryList;
import com.orhano... | package debug;
/**
* <p>类说明</p>
*
* @author 张华洋 2017/2/15 20:11
* @version V1.2.0
* @name NewsApplication
*/
public class NewsApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
login();
}
/**
* 在这里模拟登陆,然后拿到sessionId或者Token
* 这样... | .bodyType(DataType.JSON_OBJECT, StoryList.class) | 5 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/test/java/com/here/account/auth/provider/FromHereCredentialsIniStreamTest.java | [
"public enum HttpMethods {\n /**\n * See <a href=\"https://tools.ietf.org/html/rfc7231#section-4.3.1\">HTTP/1.1 Semantics and Content: GET</a>.\n */\n GET(\"GET\"),\n POST(\"POST\");\n \n private final String method;\n \n private HttpMethods(String method) {\n this.method... | import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.*;
import com.here.account.http.HttpConstants.HttpMethods;
import com.here.account.http.HttpProvider.HttpRequest;
import com.here.account.http.HttpProvider.HttpRequestAuthorizer;
import com.here.accou... | /*
* Copyright (c) 2018 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 or a... | HttpRequest httpRequest = mock(HttpRequest.class); | 1 |
vgoldin/cqrs-eventsourcing-kafka | services-infrastructure-messaging/src/main/java/io/plumery/messaging/kafka/KafkaCommandListener.java | [
"public interface Action extends Serializable {\n\n}",
"public interface ActionHandler<T extends Action> {\n public void handle(T action);\n}",
"public abstract class ApplicationException extends RuntimeException {\n private final int version;\n private ID aggregateRootId;\n private String action;\... | import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.lifecycle.Managed;
import io.plumery.core.Action;
import io.plumery.core.ActionHandler;
import io.plumery.core.exception.ApplicationException;
import io.plumery.core.exception.SystemException;
import io.plumery.core.infrastructure.CommandListener;... | package io.plumery.messaging.kafka;
public class KafkaCommandListener implements CommandListener, Managed {
private static final Logger LOG = LoggerFactory.getLogger(KafkaCommandListener.class);
public static final String APPLICATION_EVENTS = ".ApplicationEvents";
private final KafkaConsumer consumer;
... | applicationEventPublisher.publish(applicationEventsStream, EventUtils.exceptionToEvent(targetException)); | 7 |
unitsofmeasurement/uom-systems | unicode/src/main/java/systems/uom/unicode/CLDR.java | [
"public interface Concentration<Q extends Quantity<Q>> extends Quantity<Concentration<Q>> {\n}",
"public interface Consumption<Q extends Quantity<Q>> extends Quantity<Consumption<Q>> {\n}",
"public interface Information extends Quantity<Information> {\n}",
"public interface InformationRate extends Quantity<In... | import static javax.measure.MetricPrefix.*;
import static tech.units.indriya.unit.Units.CUBIC_METRE;
import static tech.units.indriya.unit.Units.METRE;
import static tech.units.indriya.unit.Units.SQUARE_METRE;
import static tech.units.indriya.AbstractUnit.ONE;
import systems.uom.quantity.Concentration;
import systems.u... | /*
* Units of Measurement Systems
* Copyright (c) 2005-2021, Jean-Marie Dautelle, Werner Keil and others.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of sourc... | public static final Unit<Information> BIT = addUnit(new AlternateUnit<Information>(ONE, "bit"), "Bit", "bit", Information.class); | 2 |
nikacotAndroid/Weather-Guru-MVP | app/src/main/java/mk/petrovski/weathergurumvp/ui/day/DayFragment.java | [
"public class WeatherModel {\n private List<AstronomyModel> astronomy;\n private String date;\n private List<HourlyModel> hourly;\n private String maxtempC;\n private String maxtempF;\n private String mintempC;\n private String mintempF;\n private String uvIndex;\n\n public String getShortMonthDate() {\n ... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.v... | package mk.petrovski.weathergurumvp.ui.day;
/**
* Created by Nikola Petrovski on 2/14/2017.
*/
public class DayFragment extends BaseFragment
implements DayMvpView, RecyclerItemUtils.OnItemClickListener,
SwipeRefreshLayout.OnRefreshListener {
@Inject DayMvpPresenter<DayMvpView> presenter;
@Inject DaysA... | @Subscribe public void onEvent(RefreshWeatherEvent refreshWeatherEvent) { | 1 |
jsjolund/GdxDemo3D | core/src/com/mygdx/game/steerers/CollisionAvoidanceSteererBase.java | [
"public class GameRenderer implements Disposable, Observer {\n\n\t/**\n\t * Temporary vector that steerers can use to draw\n\t */\n\tpublic final Vector3 vTmpDraw1 = new Vector3();\n\n\t/**\n\t * Temporary vector that steerers can use to draw\n\t */\n\tpublic final Vector3 vTmpDraw2 = new Vector3();\n\n\tprivate fi... | import com.badlogic.gdx.ai.steer.SteeringAcceleration;
import com.badlogic.gdx.ai.steer.SteeringBehavior;
import com.badlogic.gdx.ai.steer.behaviors.CollisionAvoidance;
import com.badlogic.gdx.ai.steer.behaviors.PrioritySteering;
import com.badlogic.gdx.ai.steer.proximities.RadiusProximity;
import com.badlogic.gdx.grap... | /*******************************************************************************
* Copyright 2015 See AUTHORS file.
* <p/>
* 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:/... | public CollisionAvoidanceSteererBase(final SteerableBody steerableBody) { | 2 |
guiying712/AndroidModulePattern | module_news/src/main/java/debug/NewsApplication.java | [
"public class BaseApplication extends Application {\n\n public static final String ROOT_PACKAGE = \"com.guiying.module\";\n\n private static BaseApplication sInstance;\n\n private List<IApplicationDelegate> mAppDelegateList;\n\n\n public static BaseApplication getIns() {\n return sInstance;\n ... | import com.guiying.module.common.base.BaseApplication;
import com.guiying.module.common.http.DataType;
import com.guiying.module.common.http.HttpClient;
import com.guiying.module.common.http.OnResultListener;
import com.guiying.module.news.Constants;
import com.guiying.module.news.data.bean.StoryList;
import com.orhano... | package debug;
/**
* <p>类说明</p>
*
* @author 张华洋 2017/2/15 20:11
* @version V1.2.0
* @name NewsApplication
*/
public class NewsApplication extends BaseApplication {
@Override
public void onCreate() {
super.onCreate();
login();
}
/**
* 在这里模拟登陆,然后拿到sessionId或者Token
* 这样... | .bodyType(DataType.JSON_OBJECT, StoryList.class) | 1 |
liaozhoubei/NetEasyNews | app/src/main/java/cn/bproject/neteasynews/fragment/NewsFragment.java | [
"public class APPConst {\n private APPConst(){}\n\n // 设置ChannelManager频道管理中的每个item的间隔\n public static final int ITEM_SPACE = 5;\n\n // 0和1均表示ChannelManager频道管理中的tab不可可编辑\n // 其中tab的type为0时,字体会显示红色, 为1时会显示灰色\n public static final int ITEM_DEFAULT = 0;\n // 1均表示ChannelManager频道管理中的tab不可可编辑\n ... | import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolbar;
import androi... | package cn.bproject.neteasynews.fragment;
/**
* Created by Administrator on 2016/12/24.
* 新闻模块
*/
public class NewsFragment extends BaseFragment {
private final String TAG = NewsFragment.class.getSimpleName();
private TabLayout mTabLayout;
private ViewPager mNewsViewpager;
private View mView... | baseFragment = NewsListFragment.newInstance(myChannelList.get(i).getTid()); | 7 |
nimble-platform/identity-service | identity-service/src/main/java/eu/nimble/core/infrastructure/identity/system/RoleController.java | [
"@Entity\npublic class UaaUser implements Serializable {\n\n @Id\n @Column(nullable = false, unique = true)\n private String externalID;\n\n private String username;\n\n @OneToOne\n private PersonType ublPerson;\n\n @ColumnDefault(\"false\")\n private Boolean showWelcomeInfo = false;\n\n ... | import eu.nimble.core.infrastructure.identity.entity.UaaUser;
import eu.nimble.core.infrastructure.identity.repository.UaaUserRepository;
import eu.nimble.core.infrastructure.identity.service.IdentityService;
import eu.nimble.core.infrastructure.identity.uaa.KeycloakAdmin;
import eu.nimble.core.infrastructure.identity.... | package eu.nimble.core.infrastructure.identity.system;
@Controller
@RequestMapping(path = "/roles")
@Api(value = "user roles", description = "Services for managing roles on the platform.")
public class RoleController {
private static final Logger logger = LoggerFactory.getLogger(RoleController.class);
@Aut... | UaaUser requestingUser = uaaUserRepository.findByExternalID(userDetails.getUserId()); | 0 |
nantaphop/AomYim-Pantip | app/src/main/java/com/nantaphop/pantipfanapp/fragment/ForumHolderFragment.java | [
"public class ShowcaseView extends RelativeLayout\n implements View.OnTouchListener, ShowcaseViewApi {\n\n private static final int HOLO_BLUE = Color.parseColor(\"#33B5E5\");\n\n private final Button mEndButton;\n private final TextDrawer textDrawer;\n private final ShowcaseDrawer showcaseDrawer;... | import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
im... |
int sWidth = displaymetrics.widthPixels;
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {... | return ForumFragment_.builder().forumType(PantipRestClient.ForumType.Room).forumPagerItem(forumPagerItems.get(position)).build(); | 7 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/builder/SetObjectBuilder.java | [
"public final class ElementDescriptor<T>\n{\n\tpublic final static XmlContext DEFAULT_CONTEXT = new XmlContext()\n\t{\n\t};\n\n\t/**\n\t * The {@link QualifiedName} of this element.\n\t */\n\tpublic final QualifiedName qualifiedName;\n\n\t/**\n\t * An {@link IObjectBuilder} for elements of this type.\n\t */\n\tpubl... | import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.QualifiedName;
import org.dmfs.xmlobjects.XmlContext;
import org.dmfs.xmlobjects.pull.ParserContext;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import o... | /*
* Copyright (C) 2014 Marten Gajda <marten@dmfs.org>
*
* 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 appli... | XmlContext xmlContext = context.getXmlContext(); | 2 |
kaichunlin/android-transition | core/src/main/java/com/kaichunlin/transition/adapter/OnPageChangeListenerAdapter.java | [
"public class DefaultTransitionManager implements TransitionManager {\n private ArrayList<TransitionManagerListener> mListenerList = new ArrayList<>();\n private ArrayList<Transition> mTransitionList = new ArrayList<>();\n private Set<Transition> mBackupTransitionList = new HashSet<>();\n\n @Override\n ... | import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewPager;
import android.view.View;
import com.kaichunlin.transition.DefaultTransitionManager;
import com.kaichunlin.transition.R;
import com.kaichunlin.transition.Transition;
import com.kaichunlin.... | package com.kaichunlin.transition.adapter;
/**
* Adapter for ViewPager.
*/
public class OnPageChangeListenerAdapter extends AbstractAdapter implements ViewPager.OnPageChangeListener, ViewPager.PageTransformer {
public static final float LEFT_OF_CENTER = -1f;
public static final float CENTER = 0f;
publ... | if (TransitionConfig.isDebug()) { | 2 |
doanduyhai/killrvideo-java | src/main/java/killrvideo/service/RatingsService.java | [
"public static final String mergeStackTrace(Throwable throwable) {\n StringJoiner joiner = new StringJoiner(\"\\n\\t\", \"\\n\", \"\\n\");\n joiner.add(throwable.getMessage());\n Arrays.asList(throwable.getStackTrace())\n .forEach(stackTraceElement -> joiner.add(stackTraceElement.toString()));\n\n ... | import static killrvideo.utils.ExceptionUtils.mergeStackTrace;
import java.time.Instant;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype... | package killrvideo.service;
@Service
//public class RatingsService extends AbstractRatingsService {
public class RatingsService extends RatingsServiceImplBase {
private static final Logger LOGGER = LoggerFactory.getLogger(RatingsService.class);
@Inject
MappingManager manager;
@Inject
M... | .setRatingTimestamp(TypeConverter.instantToTimeStamp(time)) | 6 |
plusonelabs/calendar-widget | app/src/main/java/org/andstatus/todoagenda/widget/WidgetEntry.java | [
"public class InstanceSettings {\n private static final String TAG = InstanceSettings.class.getSimpleName();\n public final static InstanceSettings EMPTY = new InstanceSettings(null, 0, \"(empty)\");\n public final long instanceId = InstanceId.next();\n private final Context context;\n\n public stati... | import org.andstatus.todoagenda.prefs.InstanceSettings;
import org.andstatus.todoagenda.prefs.OrderedEventSource;
import org.andstatus.todoagenda.prefs.dateformat.DateFormatType;
import org.andstatus.todoagenda.util.DateUtil;
import org.andstatus.todoagenda.util.MyClock;
import org.joda.time.DateTime;
import org.joda.t... | }
private static DateTime calcEntryDay(InstanceSettings settings, WidgetEntryPosition entryPosition, DateTime entryDate) {
switch (entryPosition) {
case START_OF_TODAY:
case END_OF_TODAY:
return settings.clock().now().withTimeAtStartOfDay();
default:
... | isSameDate(endDate, other.endDate) && | 5 |
astagi/magpi-android | src/com/themagpi/android/GCMIntentService.java | [
"public class IssueDetailsActivity extends SherlockFragmentActivity implements RefreshableContainer {\n IssueDetailsFragment issueFragment = new IssueDetailsFragment();\n private Menu menu;\n private LayoutInflater inflater;\n \n @Override\n public void onCreate(Bundle savedInstanceState) {\n ... | import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.... | package com.themagpi.android;
public class GCMIntentService extends GCMBaseIntentService {
public GCMIntentService() {
super(Config.SENDER_ID);
}
@Override
protected void onError(Context ctx, String devId) {
Log.e("ERROR", "ERROR" + devId);
}
@Override
protected void onMessage(Context ctx, Intent int... | Intent notificationIntent = new Intent(this, IssueDetailsActivity.class); | 0 |
fcrepo4-labs/fcrepo-api-x | fcrepo-api-x-routing/src/test/java/org/fcrepo/apix/routing/impl/ExposedServiceUriAnalyzerTest.java | [
"public static URI append(final Object... segments) {\n return URI.create(\n Arrays.stream(segments)\n .reduce((a, b) -> String.join(\"/\", segment(a.toString()), terminal(b.toString())))\n .get().toString());\n}",
"public static String segment(final String path... | import static org.fcrepo.apix.routing.Util.append;
import static org.fcrepo.apix.routing.Util.segment;
import static org.fcrepo.apix.routing.Util.terminal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert... | final ServiceExposingBinding binding = toTest.match(exposureURI(path, extension1ExposedAt));
assertNotNull(binding);
assertEquals(path, binding.resourcePath);
assertEquals(extension1, binding.extension);
assertTrue(binding.repositoryResourceURI.toString().startsWith(fcrepoBaseUR... | segment(exposureBaseURI.toString()), | 1 |
ground-context/ground | modules/common/test/edu/berkeley/ground/common/model/core/EdgeTest.java | [
"public static String convertFromClassToString(Object object) {\n return Json.stringify(Json.toJson(object));\n}",
"public static Object convertFromStringToClass(String body, Class<?> klass) {\n return Json.fromJson(Json.parse(body), klass);\n}",
"public static String readFromFile(String filename) throws Grou... | import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromClassToString;
import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromStringToClass;
import static edu.berkeley.ground.common.util.ModelTestUtils.readFromFile;
import static org.junit.Assert.assertEquals;
import static org.junit.As... | /**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed ... | final String expected = convertFromClassToString(convertFromStringToClass(readFromFile | 2 |
Lyneira/MachinaCraft | MachinaFactory/src/me/lyneira/Fabricator/Blueprint.java | [
"public enum BlockRotation {\r\n ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270;\r\n\r\n private final static BlockFace[] yawFace = { BlockFace.SOUTH, BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST };\r\n private final static BlockVector[] yawVector = { new BlockVector(yawFace[0]), new BlockVector(yawFace[1]... | import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import me.lyneira.MachinaCore.BlockLocation;
import me.lyneira.MachinaCore.BlueprintBlock;
import me.lyneira.MachinaCore.block.BlockRotation;
import me.lyneira.MachinaCore.block.... | package me.lyneira.Fabricator;
/**
* Blueprint for the {@link Fabricator}.
*
* @author Lyneira
*/
public class Blueprint implements MachinaBlueprint {
private final Material anchorMaterial;
| final MachinaFactory plugin;
| 5 |
nextopcn/xcalendar | src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/widget/impl/XCalendarMinuteWidget.java | [
"public class XCalendar extends Canvas {\n\t//\n\tprotected final XCalendarModel model;\n\tprotected final XCalendarEventBus bus;\n\tprotected final XCalendarReactor reactor;\n\tprotected volatile boolean editable = true;\n\tprotected final Map<Object, Object> cookies;\n\tprotected Map<XCalendarState, List<XCalenda... | 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;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.XCal... | package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.widget.impl;
/**
* @author chenby
*
*/
public class XCalendarMinuteWidget extends AbstractXCalendarWidget {
//
private final int col, row;
/**
*
*/
public XCalendarMinuteWidget(XCalendar popup, int col, int row) {
super(popup); thi... | public Pair<Point> locate(int x, int y, int w, int m) { | 7 |
ilmila/J2EEScan | src/main/java/burp/j2ee/issues/impl/LFIModule.java | [
"public class HTTPMatcher {\n\n private static final Pattern SERVICES_PATTERN = Pattern.compile(\"services/(.*?)\\\\?wsdl\", Pattern.MULTILINE);\n\n private static final Pattern SERVLET_CLA_PATTERN = Pattern.compile(\"<servlet-class>(.*?)</servlet-class>\", Pattern.DOTALL | Pattern.MULTILINE);\n\n /**\n ... | import burp.HTTPMatcher;
import static burp.HTTPMatcher.getMatches;
import burp.IBurpExtenderCallbacks;
import burp.IExtensionHelpers;
import burp.IHttpRequestResponse;
import burp.IScanIssue;
import burp.IScannerInsertionPoint;
import burp.J2EELFIRetriever;
import static burp.J2EELocalAssessment.analyzeWEBXML;
import ... | package burp.j2ee.issues.impl;
/**
*
* Sometimes in J2EE environments absolute LFI attempts fails, because
* the issue is limited to the web application context.
*
* The module tries to retrieve the web.xml file of the remote J2EE application
*/
public class LFIModule implements IModule{
private stati... | DESCRIPTION + " " + HTTPMatcher.getServletsDescription(helpers.bytesToString(response)), | 0 |
Meituan-Dianping/walle | plugin/src/main/java/com/android/apksigner/core/internal/apk/v2/V2SchemeSigner.java | [
"public class MessageDigestSink implements DataSink {\n\n private final MessageDigest[] mMessageDigests;\n\n public MessageDigestSink(MessageDigest[] digests) {\n mMessageDigests = digests;\n }\n\n @Override\n public void consume(byte[] buf, int offset, int length) {\n for (MessageDiges... | import com.android.apksigner.core.internal.util.MessageDigestSink;
import com.android.apksigner.core.internal.util.Pair;
import com.android.apksigner.core.internal.zip.ZipUtils;
import com.android.apksigner.core.util.DataSource;
import com.android.apksigner.core.util.DataSources;
import java.io.IOException;
import java... | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | ZipUtils.setZipEocdCentralDirectoryOffset(eocdBuf, centralDirOffsetForDigesting); | 2 |
c-rack/cbor-java | src/main/java/co/nstant/in/cbor/CborEncoder.java | [
"public class MapEncoder extends AbstractEncoder<Map> {\n\n public MapEncoder(CborEncoder encoder, OutputStream outputStream) {\n super(encoder, outputStream);\n }\n\n @Override\n public void encode(Map map) throws CborException {\n Collection<DataItem> keys = map.getKeys();\n\n if ... | import java.io.OutputStream;
import java.util.List;
import java.util.Objects;
import co.nstant.in.cbor.encoder.ArrayEncoder;
import co.nstant.in.cbor.encoder.ByteStringEncoder;
import co.nstant.in.cbor.encoder.MapEncoder;
import co.nstant.in.cbor.encoder.NegativeIntegerEncoder;
import co.nstant.in.cbor.encoder.SpecialE... | package co.nstant.in.cbor;
/**
* Encoder for the CBOR format based.
*/
public class CborEncoder {
private final UnsignedIntegerEncoder unsignedIntegerEncoder;
private final NegativeIntegerEncoder negativeIntegerEncoder;
private final ByteStringEncoder byteStringEncoder;
private final UnicodeString... | private final MapEncoder mapEncoder; | 0 |
maxdemarzi/grittier_ext | src/main/java/com/maxdemarzi/likes/Likes.java | [
"public enum RelationshipTypes implements RelationshipType {\n BLOCKS,\n FOLLOWS,\n MUTES,\n LIKES,\n REPLIED_TO\n}",
"@Path(\"/users\")\npublic class Users {\n\n private final GraphDatabaseService db;\n private static final ObjectMapper objectMapper = new ObjectMapper();\n\n public Users... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.maxdemarzi.RelationshipTypes;
import com.maxdemarzi.users.Users;
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.Respons... | package com.maxdemarzi.likes;
@Path("/users/{username}/likes")
public class Likes {
private final GraphDatabaseService db;
private static final ObjectMapper objectMapper = new ObjectMapper();
public Likes(@Context DatabaseManagementService dbms ) {
this.db = dbms.database( "neo4j" );;
}
... | for (Relationship r1 : user.getRelationships(Direction.OUTGOING, RelationshipTypes.LIKES)) { | 0 |
optimaize/command4j | src/main/java/com/optimaize/command4j/impl/DefaultCommandExecutorService.java | [
"public interface Command<A, R> {\n\n /**\n * Runs the remote command.\n *\n * <p>This method always blocks until either the command finishes successfully, aborts by throwing an\n * exception, or is cancelled early. (The {@link CommandExecutorService} allows you to execute\n * commands in a n... | import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
import com.optimaize.command4j.Command;
import com.optim... | package com.optimaize.command4j.impl;
/**
* @author Eike Kettner
*/
public class DefaultCommandExecutorService implements CommandExecutorService {
@NotNull
private final Logger log;
@NotNull
private final Runner runner;
@NotNull
private final ExtensionHandler extensionHandler;
@NotNull... | public <A, V> ListenableFuture<Optional<V>> submit(@NotNull Command<A, V> cmd, @NotNull Mode mode, @Nullable A arg) { | 0 |
UweTrottmann/tmdb-java | src/main/java/com/uwetrottmann/tmdb2/services/TvEpisodesService.java | [
"public class Images {\n\n public Integer id;\n public List<Image> backdrops;\n public List<Image> posters;\n public List<Image> stills;\n\n}",
"public class TmdbDate {\n\n // can not use ThreadLocal.withInitial as it requires Java 8\n private static final ThreadLocal<DateFormat> TMDB_DATE_FORMA... | import com.uwetrottmann.tmdb2.entities.AppendToResponse;
import com.uwetrottmann.tmdb2.entities.BaseAccountStates;
import com.uwetrottmann.tmdb2.entities.Changes;
import com.uwetrottmann.tmdb2.entities.Credits;
import com.uwetrottmann.tmdb2.entities.Images;
import com.uwetrottmann.tmdb2.entities.RatingObject;
import co... | package com.uwetrottmann.tmdb2.services;
public interface TvEpisodesService {
/**
* Get the primary information about a TV episode by combination of a season and episode number.
*
* @param tvShowId A Tv Show TMDb id.
* @param tvShowSeasonNumber TvSeason Number.
* @param tvSho... | Call<Images> images( | 0 |
klakegg/pkix-ocsp | src/test/java/net/klakegg/pkix/ocsp/issuer/PeppolTestMultiOcspTest.java | [
"public enum CertificateStatus {\n\n /**\n * The certificate is valid.\n */\n GOOD,\n\n /**\n * The certificate is temporarily or permanently revoked.\n */\n REVOKED,\n\n /**\n * Status of certificate is unknown.\n */\n UNKNOWN\n\n}",
"public class OcspException extends E... | import net.klakegg.pkix.ocsp.CertificateStatus;
import net.klakegg.pkix.ocsp.OcspException;
import net.klakegg.pkix.ocsp.OcspMultiClient;
import net.klakegg.pkix.ocsp.OcspResult;
import net.klakegg.pkix.ocsp.util.CertificateHelper;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.security.cert.... | package net.klakegg.pkix.ocsp.issuer;
/**
* @author erlend
*/
public class PeppolTestMultiOcspTest {
private X509Certificate subjectExpired =
CertificateHelper.parse(getClass().getResourceAsStream("/peppol-ap-test/certificate-expired.cer"));
private X509Certificate subjectValid =
... | OcspResult ocspResult = ocspMultiClient.verify( | 3 |
jedwards1211/Jhrome | src/main/java/org/sexydock/tabs/demos/LabelReplacementDemo.java | [
"@SuppressWarnings( \"serial\" )\r\npublic class DefaultTabbedPaneWindow extends JFrame implements ITabbedPaneWindow\r\n{\r\n\t\r\n\tpublic DefaultTabbedPaneWindow( ) throws HeadlessException\r\n\t{\r\n\t\tsuper( );\r\n\t\tinit( );\r\n\t}\r\n\t\r\n\tpublic DefaultTabbedPaneWindow( GraphicsConfiguration gc )\r\n\t{\... | import org.sexydock.tabs.DefaultTabbedPaneWindowFactory;
import org.sexydock.tabs.ITabbedPaneWindow;
import org.sexydock.tabs.Tab;
import org.sexydock.tabs.TestTabFactory;
import org.sexydock.tabs.jhrome.JhromeTabbedPaneUI;
import java.awt.Component;
import java.awt.Window;
import java.awt.event.ActionEvent;
im... | /*
Copyright 2012 James Edwards
This file is part of Jhrome.
Jhrome 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.
Jhrom... | DefaultTabbedPaneWindow window = new DefaultTabbedPaneWindow( getClass( ).getSimpleName( ) );
| 0 |
santoslab/aadl-translator | edu.ksu.cis.projects.mdcf.aadl-translator-test/src/test/java/edu/ksu/cis/projects/mdcf/aadltranslator/test/arch/PortModelTests.java | [
"public static boolean initComplete = false;",
"public static HashSet<String> usedProperties = new HashSet<>();",
"public class DeviceModel extends DevOrProcModel {\n\t\n\tprivate HashBiMap<String, String> inToOutPortNames = HashBiMap.create();\n\t\n\tpublic DeviceModel(){\n\t\tsuper();\n\t\tprocessType = Proce... | import static edu.ksu.cis.projects.mdcf.aadltranslator.test.AllTests.initComplete;
import static edu.ksu.cis.projects.mdcf.aadltranslator.test.AllTests.usedProperties;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.AfterClass;
import org.junit.BeforeClass;
impor... | package edu.ksu.cis.projects.mdcf.aadltranslator.test.arch;
public class PortModelTests {
private static PortModel devSendPort;
private static PortModel procSendPort;
private static PortModel procRecvPort;
@BeforeClass
public static void initialize() {
if(!initComplete)
AllTests.initialize(); | usedProperties.add("MAP_Properties"); | 1 |
getsocial-im/getsocial-android-sdk | example/src/main/java/im/getsocial/demo/fragment/PollsListFragment.java | [
"public class ActivityListAdapter extends RecyclerView.Adapter<ActivityListAdapter.ActivityViewHolder> {\n\tprivate final List<GetSocialActivity> _items;\n\n\tpublic MessageClickListener clickListener;\n\n\tpublic ActivityListAdapter(final List<GetSocialActivity> items) {\n\t\t_items = items;\n\t}\n\n\t@Override\n\... | import android.app.Activity;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import a... | args.putBoolean("announcements", false);
fragment.setArguments(args);
return fragment;
}
public static Fragment inTopicAnnouncements(final String topicId) {
final PollsListFragment fragment = new PollsListFragment();
final Bundle args = new Bundle();
args.putString("topic", topicId);
args.putBoolean("a... | final ActionDialog dialog = new ActionDialog(getContext()); | 4 |
Nilhcem/devfestnantes-2016 | app/src/main/java/com/nilhcem/devfestnantes/data/database/DbMapper.java | [
"@Singleton\npublic class LocalDateTimeAdapter {\n\n private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\", Locale.US);\n\n @Inject\n public LocalDateTimeAdapter() {\n }\n\n @ToJson\n public String toText(LocalDateTime dateTime) {\n return dateTime.for... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.nilhcem.devfestnantes.core.moshi.LocalDateTimeAdapter;
import com.nilhcem.devfestnantes.data.app.AppMapper;
import com.nilhcem.devfestnantes.data.app.model.Room;
import com.nilhcem.devfestnantes.data.database.model.Session... | package com.nilhcem.devfestnantes.data.database;
public class DbMapper {
private final AppMapper appMapper;
private final LocalDateTimeAdapter localDateTimeAdapter;
private final JsonAdapter<List<Integer>> intListAdapter;
@Inject
public DbMapper(Moshi moshi, AppMapper appMapper, LocalDateT... | public List<com.nilhcem.devfestnantes.data.app.model.Session> toAppSessions(@NonNull List<Session> from, @NonNull Map<Integer, com.nilhcem.devfestnantes.data.app.model.Speaker> speakersMap) { | 4 |
lsjwzh/FastTextView | app/src/main/java/com/wechat/testdemo/FastTextViewListTestFragment.java | [
"public class AutoScrollHandler {\n\n private ListView listView;\n\n private int itemCount;\n\n private Handler uiHandler = new Handler(Looper.getMainLooper());\n\n public AutoScrollHandler(ListView listView, int itemCount) {\n this.listView = listView;\n this.itemCount = itemCount;\n }\n\n public void ... | import android.content.Context;
import android.os.Bundle;
import android.os.SystemClock;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGrou... | package com.wechat.testdemo;
public class FastTextViewListTestFragment extends Fragment {
private ListView listView;
private ListAdapter adapter;
private AutoScrollHandler autoScrollHandler;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable... | FastTextView.TEST_STATS.reset(); | 1 |
xing/java-beetle | beetle-core/src/test/java/com/xing/beetle/dedup/DeduplicatorTest.java | [
"@Configuration\n@Profile(\"!test\")\n@ConfigurationProperties(prefix = \"beetle\")\npublic class BeetleAmqpConfiguration {\n\n /**\n * system name (used for redis cluster partitioning) (defaults to \"system\") This is normally\n * defined by the environment variable BEETLE_SYSTEM_NAME.\n */\n @Value(\"${be... | import com.xing.beetle.amqp.BeetleAmqpConfiguration;
import com.xing.beetle.dedup.api.MessageListener;
import com.xing.beetle.dedup.spi.Deduplicator;
import com.xing.beetle.dedup.spi.KeyValueStore;
import com.xing.beetle.dedup.spi.KeyValueStoreBasedDeduplicator;
import com.xing.beetle.dedup.spi.MessageAdapter;
import o... | package com.xing.beetle.dedup;
public class DeduplicatorTest {
static class TestMessage {}
@Mock private MessageAdapter<TestMessage> messageAdapter;
@Mock private MessageListener<TestMessage> messageListener;
@Mock private KeyValueStore keyValueStore;
long expirationTime = Instant.now().getEpochSecon... | Deduplicator deduplicator = | 2 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/remote/ServerFileUploader.java | [
"public class DirectoryEntry extends Entry implements EntryParent {\n final List<Entry> entries = new ArrayList<>();\n\n DirectoryEntry(@NotNull String name, @NotNull EntryParent parent) {\n super(name, parent);\n }\n\n @Override\n protected void walk(@NotNull Walker walker) throws IOException... | import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.moe.gradle.utils.TermColor.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import org.gradle.api.GradleException;
import org.moe.gradle.anns.NotNull;
import org.moe.gradle.remote.file.DirectoryEn... | /*
Copyright (C) 2016 Migeran
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | private final FileList list; | 2 |
davidmoten/grumpy | grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/reduction/Reducer.java | [
"public static List<Rectangle> quarter(Rectangle region) {\n List<Rectangle> list = new ArrayList<Rectangle>();\n for (Rectangle r : splitHorizontally(region))\n list.addAll(splitVertically(r));\n return list;\n}",
"public static List<Rectangle> splitHorizontally(Rectangle region) {\n List<Rect... | import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.quarter;
import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.splitHorizontally;
import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.splitVertically;
import java.awt.Graphics2D;
import java.awt.Point;
import java... | package com.github.davidmoten.grumpy.wms.reduction;
public class Reducer {
public static <T> void render(Graphics2D g, Function<Position, T> function,
Projector projector, RectangleSampler sampler, ValueRenderer<T> regionRenderer) { | Rectangle region = WmsUtil.toTargetRectangle(projector); | 6 |
richkmeli/Richkware-Manager-Server | src/main/java/it/richkmeli/rms/web/v2/entity/RmcController.java | [
"@Entity\n@IdClass(RmcId.class)\npublic class Rmc {\n @Id\n @ManyToOne (fetch = FetchType.LAZY)\n private User associatedUser;\n @Id\n @Length(max = 68)\n private String rmcId;\n\n public Rmc() {\n }\n\n public Rmc(User associatedUser, String rmcId) {\n this.associatedUser = associ... | import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import it.richkmeli.jframework.auth.data.exception.AuthDatabaseException;
import it.richkmeli.jframework.auth.web.util.AuthServletManager;
import it.richkmeli.jframework.crypto.Crypto;
import it.richkmeli.jfra... | package it.richkmeli.rms.web.v2.entity;
@RestController
public class RmcController {
RmcController(UserRepository userRepository) {
}
@GetMapping(name = "rmc", path = "/rmc")
public void getRmc() {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestConte... | RMSServletManager rmsServletManager = new RMSServletManager(request, response); | 3 |
kumuluz/kumuluzee | servlet/jetty/src/main/java/com/kumuluz/ee/jetty/JettyServletServer.java | [
"public interface ServletServer extends KumuluzServer {\n\n void registerServlet(Class<? extends Servlet> servletClass, String mapping);\n\n void registerServlet(Class<? extends Servlet> servletClass, String mapping, Map<String, String> parameters);\n\n void registerServlet(Class<? extends Servlet> servlet... | import com.kumuluz.ee.common.ServletServer;
import com.kumuluz.ee.common.attributes.ClasspathAttributes;
import com.kumuluz.ee.common.config.EeConfig;
import com.kumuluz.ee.common.config.GzipConfig;
import com.kumuluz.ee.common.config.ServerConfig;
import com.kumuluz.ee.common.dependencies.EeComponentType;
import com.k... | /*
* Copyright (c) 2014-2017 Kumuluz and/or its affiliates
* and other contributors as indicated by the @author tags and
* the contributor list.
*
* Licensed under the MIT License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | private ServerConfig serverConfig; | 2 |
lazyparser/xbot_head | app/src/main/java/cn/ac/iscas/xlab/droidfacedog/network/YoutuConnection.java | [
"@TargetApi(21)\npublic class CameraActivity extends AppCompatActivity {\n\n private TextureView mTextureView;\n private SurfaceTexture mSurfaceTexture;\n private ImageView iv_show;\n private CameraManager mCameraManager;//摄像头管理器\n private String mCameraID;//摄像头Id 0 为后 1 为前\n private ImageReader ... | import android.content.Context;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import org.jso... | package cn.ac.iscas.xlab.droidfacedog.network;
/**
* Created by lisongting on 2017/5/22.
*/
public class YoutuConnection {
public static final String TAG = "YoutuConnection";
private Context context;
private Handler handler;
private Bitmap userFace;
private List<String> idList ;
priva... | final String encodedBitmap = ImageUtils.encodeBitmapToBase64(faceBitmap, Bitmap.CompressFormat.JPEG, 100); | 3 |
Ghosts/Maus | src/main/java/GUI/Views/SettingsView.java | [
"public class BottomBar implements Repository {\n private static Label connectionsLabel = null;\n\n public static Label getConnectionsLabel() {\n return connectionsLabel;\n }\n\n public HBox getBottomBar() {\n HBox hBox = new HBox();\n HBox.setHgrow(hBox, Priority.ALWAYS);\n ... | import GUI.Components.BottomBar;
import GUI.Components.NotificationView;
import GUI.Components.TopBar;
import GUI.Styler;
import Maus.Maus;
import Server.MausSettings;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.scene.control.*;
import javafx.scene.layout.BorderPane;
import javafx.s... | package GUI.Views;
class SettingsView {
BorderPane getSettingsView() {
BorderPane borderPane = new BorderPane();
borderPane.getStylesheets().add(getClass().getResource("/css/global.css").toExternalForm());
borderPane.setTop(new TopBar().getTopBar(Maus.getPrimaryStage()));
borderP... | TextField listeningPort = new TextField("" + MausSettings.PORT); | 5 |
isisaddons/isis-app-todoapp | integtests/src/test/java/todoapp/integtests/tests/ToDoItemsIntegTest.java | [
"public enum Category {\n PROFESSIONAL {\n @Override\n public List<Subcategory> subcategories() {\n return Arrays.asList(null, Subcategory.OPEN_SOURCE, Subcategory.CONSULTING, Subcategory.EDUCATION, Subcategory.MARKETING);\n }\n }, DOMESTIC {\n @Override\n public ... | import todoapp.integtests.fixture.ToDoItemsIntegTestFixture;
import java.util.List;
import javax.inject.Inject;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
import todoapp.dom.categories.Category;
import todoapp.dom.categories.Subcategory;
import todoapp.dom.... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License")... | final ToDoItem newToDo = toDoItems.newToDo("new todo", Category.PROFESSIONAL, Subcategory.OPEN_SOURCE, null, null); | 1 |
mslosarz/nextrtc-signaling-server | src/test/java/org/nextrtc/signalingserver/domain/conversation/BroadcastConversationTest.java | [
"@ContextConfiguration(classes = {TestConfig.class})\n@RunWith(SpringJUnit4ClassRunner.class)\npublic abstract class BaseTest {\n\n @Autowired\n private CreateConversation create;\n\n @Autowired\n private JoinConversation join;\n\n @Autowired\n private Members members;\n\n @Autowired\n priva... | import org.junit.Test;
import org.nextrtc.signalingserver.BaseTest;
import org.nextrtc.signalingserver.MessageMatcher;
import org.nextrtc.signalingserver.cases.LeftConversation;
import org.nextrtc.signalingserver.domain.Conversation;
import org.nextrtc.signalingserver.domain.InternalMessage;
import org.nextrtc.signalin... | package org.nextrtc.signalingserver.domain.conversation;
public class BroadcastConversationTest extends BaseTest {
@Autowired
private Conversations conversations;
@Autowired
private LeftConversation leftConversation;
@Test
public void shouldJoinBroadcaster() {
// given | MessageMatcher match = new MessageMatcher(); | 1 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/test/java/com/here/account/auth/provider/FromRunAsIdFileProviderTest.java | [
"public interface HttpProvider extends Closeable {\n \n /**\n * Wrapper for an HTTP request.\n */\n public static interface HttpRequest {\n \n /**\n * Add the Authorization header to this request, with the specified \n * <tt>value</tt>.\n * See also \n ... | import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import com.here.account.http.HttpProvider;
import com.here.account.http.HttpConstants.HttpMethods;
import com.here.account.oauth2.AccessTokenReq... | /*
* Copyright (c) 2018 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... | Clock clock = new SettableSystemClock(); | 4 |
wdtinc/mapbox-vector-tile-java | src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java | [
"public class JtsLayer {\n\n private final String name;\n private final Collection<Geometry> geometries;\n private final int extent;\n \n /**\n * Create an empty JTS layer.\n *\n * @param name layer name\n * @throws IllegalArgumentException when {@code name} is null\n */\n publ... | import org.locationtech.jts.algorithm.Area;
import org.locationtech.jts.geom.*;
import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsLayer;
import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsMvt;
import com.wdtinc.mapbox_vector_tile.encoding.GeomCmd;
import com.wdtinc.mapbox_vector_tile.VectorTile;
import com.w... | package com.wdtinc.mapbox_vector_tile.adapt.jts;
/**
* Load Mapbox Vector Tiles (MVT) to JTS {@link Geometry}. Feature tags may be converted
* to user data via {@link ITagConverter}.
*
* @see JtsMvt
* @see JtsLayer
*/
public final class MvtReader {
private static final int MIN_LINE_STRING_LEN = 6; // MoveT... | ZigZag.decode(geomCmds.get(i++)), | 5 |
sskorol/test-data-supplier | src/test/java/io/github/sskorol/testcases/CsvDataSupplierTests.java | [
"@AllArgsConstructor\npublic class CsvReader<T> implements DataReader<T> {\n\n @Getter\n private final Class<T> entityClass;\n @Getter\n private final String path;\n\n public CsvReader(final Class<T> entityClass) {\n this(entityClass, \"\");\n }\n\n @Override\n public StreamEx<T> read... | import io.github.sskorol.core.DataSupplier;
import io.github.sskorol.data.CsvReader;
import io.github.sskorol.entities.CrimeRecord;
import io.github.sskorol.entities.MissingClient;
import io.github.sskorol.entities.User;
import one.util.streamex.StreamEx;
import org.testng.annotations.Test;
import static io.github.ssko... | package io.github.sskorol.testcases;
public class CsvDataSupplierTests {
@DataSupplier | public StreamEx<User> getUsers() { | 3 |
dinosaurwithakatana/hacker-news-android | app/src/main/java/io/dwak/holohackernews/app/dagger/component/ViewModelComponent.java | [
"@Module\npublic class ViewModelModule {\n @Provides\n StoryListViewModel providesStoryListViewModel() {\n return new StoryListViewModel();\n }\n\n @Provides\n StoryDetailViewModel providesStoryDetailViewModel() {\n return new StoryDetailViewModel();\n }\n\n @Provides\n LoginVi... | import dagger.Component;
import io.dwak.holohackernews.app.dagger.module.ViewModelModule;
import io.dwak.holohackernews.app.ui.about.AboutActivity;
import io.dwak.holohackernews.app.ui.login.LoginActivity;
import io.dwak.holohackernews.app.ui.storydetail.StoryDetailFragment;
import io.dwak.holohackernews.app.ui.storyli... | package io.dwak.holohackernews.app.dagger.component;
@Component(dependencies = AppComponent.class,
modules = ViewModelModule.class)
public interface ViewModelComponent {
void inject(MainActivity activity);
| void inject(StoryListFragment fragment); | 5 |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/publisher/GitLabAcceptMergeRequestPublisherTest.java | [
"static final String GITLAB_CONNECTION_V3 = \"GitLabV3\";",
"static final String GITLAB_CONNECTION_V4 = \"GitLabV4\";",
"static final int MERGE_REQUEST_ID = 1;",
"static final int MERGE_REQUEST_IID = 2;",
"static final int PROJECT_ID = 3;",
"static AbstractBuild mockSimpleBuild(String gitLabConnection, Re... | import static com.dabsquared.gitlabjenkins.publisher.TestUtility.GITLAB_CONNECTION_V3;
import static com.dabsquared.gitlabjenkins.publisher.TestUtility.GITLAB_CONNECTION_V4;
import static com.dabsquared.gitlabjenkins.publisher.TestUtility.MERGE_REQUEST_ID;
import static com.dabsquared.gitlabjenkins.publisher.TestUtilit... | package com.dabsquared.gitlabjenkins.publisher;
/**
* @author Nikolay Ustinov
*/
public class GitLabAcceptMergeRequestPublisherTest {
@ClassRule
public static MockServerRule mockServer = new MockServerRule(new Object());
@ClassRule
public static JenkinsRule jenkins = new JenkinsRule();
privat... | setupGitLabConnections(jenkins, mockServer); | 7 |
jillesvangurp/jsonj | src/test/java/com/github/jsonj/TomlTest.java | [
"public class TomlParser {\n public TomlParser() {\n }\n\n public JsonObject parse(Reader input) {\n return tomlToJsonObject(new Toml().read(input));\n }\n\n public JsonObject parse(InputStream input) {\n return tomlToJsonObject(new Toml().read(input));\n }\n\n public JsonObject p... | import com.github.jsonj.toml.TomlParser;
import com.github.jsonj.toml.TomlSerializer;
import com.moandjiezana.toml.TomlWriter;
import org.assertj.core.api.Assertions;
import org.testng.annotations.Test;
import java.time.ZoneId;
import java.util.TimeZone;
import static com.github.jsonj.tools.JsonBuilder.array;
import st... | package com.github.jsonj;
@Test
public class TomlTest {
public void shouldSerializeToml() {
JsonObject object = object(
field("foo", "bar"),
field("list",array("one","two")),
field("obj", object(field("name","nested"))),
field("listOfObjec... | TomlSerializer jsonJToToml = new TomlSerializer(new TomlWriter()); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.