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
SmasSive/DaggerWorkshopGDG
domain/src/main/java/com/smassive/daggerworkshopgdg/domain/interactor/GetComicsUseCaseImpl.java
[ "@Data\npublic class ComicBo {\n\n private int id;\n\n private String title;\n\n private String description;\n\n private int pageCount;\n\n private String thumbnailUrl;\n\n private List<String> imageUrls;\n}", "public interface ErrorBundle {\n Exception getException();\n\n String getErrorMessa...
import com.smassive.daggerworkshopgdg.domain.bean.ComicBo; import com.smassive.daggerworkshopgdg.domain.exception.ErrorBundle; import com.smassive.daggerworkshopgdg.domain.executor.PostExecutionThread; import com.smassive.daggerworkshopgdg.domain.executor.ThreadExecutor; import com.smassive.daggerworkshopgdg.domain.rep...
/** * Copyright (C) 2016 Sergi Castillo Open Source Project * <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://www.apache.org/licenses/LICENSE-2.0 * <p/> * Unless r...
public void onComicListLoaded(Collection<ComicBo> comicBoCollection) {
0
reines/game
game-common/src/main/java/com/game/common/codec/Packet.java
[ "public class Friend implements Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\n\tprotected Hash id;\n\tprotected String username;\n\tprotected transient boolean online;\n\n\tpublic Friend(Hash id, String username, boolean online) {\n\t\tthis.id = id;\n\t\tthis.username = username;\n\t\tthis.o...
import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.security.PrivateKey; import java.util.Date; import javax.crypto.Cipher; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.slf4j.Logg...
package com.game.common.codec; public class Packet { private static final Logger log = LoggerFactory.getLogger(Packet.class); public static final int HEADER_SIZE = 4 + 4; // type + size protected static final CharsetDecoder stringDecoder; static { stringDecoder = Charset.forName("UTF-8").newDecoder(); } ...
public Path getPath() {
3
dkarv/jdcallgraph
jdcallgraph/src/main/java/com/dkarv/jdcallgraph/data/DataDependenceGraph.java
[ "public class StackItem {\n private final String className;\n private final String methodName;\n private final int lineNumber;\n private final boolean returnSafe;\n\n private final String formatted;\n\n public StackItem(String className, String methodName, int lineNumber, boolean returnSafe) {\n this.class...
import com.dkarv.jdcallgraph.writer.RemoveDuplicatesWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.dkarv.jdcallgraph.util.StackItem; import com.dkarv.jdcallgraph.util.options.Target; import com.dkarv.jdcallgraph.util.conf...
/* * MIT License * <p> * Copyright (c) 2017 David Krebs * <p> * 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, co...
Target[] targets = Config.getInst().writeTo();
2
mariotaku/RestFu
sample/src/main/java/Main.java
[ "public class RestAPIFactory<E extends Exception> {\n\n private Endpoint endpoint;\n private Authorization authorization;\n private ValueMap constantPool;\n\n private RestHttpClient httpClient;\n\n private HttpRequest.Factory<E> httpRequestFactory = new HttpRequest.DefaultFactory<>();\n private Re...
import org.apache.commons.io.IOUtils; import org.jetbrains.annotations.NotNull; import org.mariotaku.restfu.RestAPIFactory; import org.mariotaku.restfu.callback.RawCallback; import org.mariotaku.restfu.http.Endpoint; import org.mariotaku.restfu.http.HttpResponse; import org.mariotaku.restfu.urlconnection.URLConnectionR...
/** * Created by mariotaku on 16/1/17. */ public class Main { public static void main(String[] args) throws GithubException { RestAPIFactory<GithubException> factory = new RestAPIFactory<>(); factory.setHttpClient(new URLConnectionRestClient()); factory.setEndpoint(new Endpoint("https://...
github.rawContributors("mariotaku", "RestFu", new RawCallback<GithubException>() {
1
jesuino/kie-ml
providers/kie-ml-weka/src/main/java/org/fxapps/ml/api/provider/impl/WekaKieMLProvider.java
[ "@XmlRootElement(name = \"input\")\npublic class Input {\n\t\n\t/**\n\t * An URL containing the payload to be converted. This accepts Java URL format.\n\t */\n\tprivate String url;\n\t\n\t/**\n\t * A text used in the predict\n\t */\n\tprivate String text;\n\t\n\t/**\n\t * Raw binary data\n\t */\n\tprivate byte[] ra...
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.net.URL; import java.util.HashMap; import org.fxapps.ml.api.model.Input; import org.fxapps.ml.api.model.Model; import org.fxapps.ml.api.model.Result; import org.fxapps.ml.api.provider.ML...
package org.fxapps.ml.api.provider.impl; /** * * The Weka provider implementation that can be used to make predictions based * on Weka classifiers * * @author wsiqueir * */ public class WekaKieMLProvider implements MLProvider { // TODO: THis is a very preliminary weka support as a proof of concept - // m...
public Result run(KieMLContainer kc, Model model, Input input) {
1
sonyxperiadev/gerrit-events
src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/attr/Provider.java
[ "public static final String NAME = \"name\";", "public static final String HOST = \"host\";", "public static final String PORT = \"port\";", "public static final String PROTOCOL = \"proto\";", "public static final String SCHEME = \"scheme\";", "public static final String URL = \"url\";", "public static ...
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.URL; import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.VERSION; import com.sonymobile.tools.gerrit.gerritevents.GerritConnection; import net.sf.json.JSONObject; import com.sonymobile.tools.gerrit.gerritevents.dto.GerritJ...
*/ public void setScheme(String scheme) { this.scheme = scheme; } /** * Get url. * * @return the url */ public String getUrl() { String frontUrl = this.url; if (frontUrl != null && !frontUrl.isEmpty() && !frontUrl.endsWith("/")) { frontUrl +=...
scheme = GerritConnection.GERRIT_PROTOCOL_SCHEME_NAME; //The default for old stuff
7
tthuem/VariantSync
de.tubs.variantsync.core/src/de/tubs/variantsync/core/patch/base/DefaultPatchFactory.java
[ "public class APatch<T> implements IPatch<T> {\n\n\tprivate List<IDelta<T>> deltas = new ArrayList<>();\n\tprivate long startTime, endTime;\n\tprivate String feature;\n\n//\tpublic APatch() {}\n\n\t@Override\n\tpublic void addDelta(IDelta<T> delta) {\n\t\tif (delta.getPatch() == null) delta.setPatch(this);\n\t\tif ...
import org.eclipse.core.resources.IFile; import de.ovgu.featureide.fm.core.ExtensionManager.NoSuchExtensionException; import de.tubs.variantsync.core.patch.APatch; import de.tubs.variantsync.core.patch.DeltaFactoryManager; import de.tubs.variantsync.core.patch.interfaces.IDelta; import de.tubs.variantsync.core.patch.in...
package de.tubs.variantsync.core.patch.base; public class DefaultPatchFactory implements IPatchFactory { @Override public IPatch<IDelta<?>> createPatch(String context) { IPatch<IDelta<?>> patch = new APatch<IDelta<?>>(); patch.setContext(context); patch.setStartTime(System.currentTimeMillis()); return pat...
IDeltaFactory<?> factory = DeltaFactoryManager.getFactoryById(delta.getFactoryId());
1
MHAVLOVICK/Sketchy
src/main/java/com/sketchy/server/action/SaveDrawingSettings.java
[ "public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS...
import javax.servlet.http.HttpServletRequest; import com.sketchy.SketchyContext; import com.sketchy.drawing.DrawingProperties; import com.sketchy.drawing.DrawingSize; import com.sketchy.metadata.MetaDataObject; import com.sketchy.server.HttpServer; import com.sketchy.server.JSONServletResult; import com.sketchy.server....
/* 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...
DrawingProperties drawingProperties = (DrawingProperties) MetaDataObject.fromJson(responseBody);
1
w9jds/MarketBot
app/src/main/java/com/w9jds/marketbot/data/loader/GroupsLoader.java
[ "public interface CrestService {\n\n @GET(\"/\")\n Observable<Response<CrestServerStatus>> getServer();\n\n @GET(\"/market/types/\")\n Call<CrestDictionary<CrestMarketType>> getMarketTypes(@Query(\"page\") int page);\n\n @GET(\"/inventory/types/{typeId}/\")\n Call<CrestType> getTypeInfo(@Path(\"ty...
import android.content.Context; import android.content.SharedPreferences; import android.net.Uri; import android.support.annotation.Nullable; import com.w9jds.marketbot.classes.CrestService; import com.w9jds.marketbot.classes.MarketBot; import com.w9jds.marketbot.classes.models.MarketItemBase; import com.w9jds.marketbo...
} } public void update() { updateStarted(); incrementUpdatingCount(1); if (isConnected()) { publicCrest.getServer() .subscribeOn(Schedulers.newThread()) .observeOn(AndroidSchedulers.mainThread()) .doOnError(error -> lo...
.doOnNext(orders -> MarketTypeEntry.addNewMarketTypes(orders, subject))
5
SW-Team/java-TelegramBot
src/milk/telegram/method/getter/ChatMemberGetter.java
[ "public class TelegramBot extends Thread{\n\n public static final String BASE_URL = \"https://api.telegram.org/bot%s/%s\";\n\n private String token = \"\";\n\n private int lastId = 0;\n private int limit = 100;\n private int timeout = 1500;\n\n private User me;\n\n private Handler handler;\n\n ...
import milk.telegram.bot.TelegramBot; import milk.telegram.type.Identifier; import milk.telegram.type.Usernamed; import milk.telegram.type.chat.Channel; import milk.telegram.type.user.ChatMember; import milk.telegram.type.user.User; import org.json.JSONObject;
package milk.telegram.method.getter; public class ChatMemberGetter extends Getter{ public ChatMemberGetter(TelegramBot bot){ super(bot); } public int getUserId(){ return this.optInt("user_id"); } public String getChatId(){ return this.optString("chat_id"); } pub...
chat_id = chat_id instanceof Channel ? "@" + ((Usernamed) chat_id).getUsername() : ((Identifier) chat_id).getId();
3
fp7-netide/Usecases
Usecase3/floodlight/Application/src/monitor/internal/Monitor.java
[ "public interface IMonitorListener {\n\t/**\n\t * Alert registered listener of a latency change\n\t */\n\tvoid latencyAlert();\n}", "public interface IMonitorService extends IFloodlightService {\n\t/**\n\t * Add a new Monitor listener\n\t * @param listener The listener\n\t */\n\tpublic void addListener(IMonitor...
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import net.floodlightcontroller.core.FloodlightContext; import net.floodlightcontroller.core.IFloodlightProviderService; import net.fl...
package net.floodlightcontroller.monitor.internal; /** * Manages the monitored parameters of the network by continuously updating different containers<br> * {@link MonitorSwitchContainer} for switches and {@link MonitorPortContainer} for ports.<br> * Uses {@link MonitorStatisticsThread} for general statistics an...
protected List<IMonitorListener> monitorAware;
0
bourgesl/marlin-fx
src/main/java/com/sun/prism/impl/shape/DMarlinRasterizer.java
[ " public class Path2D extends Shape implements PathConsumer2D {\n\n static final int curvecoords[] = {2, 2, 4, 6, 0};\n\n public enum CornerPrefix {\n CORNER_ONLY,\n MOVE_THEN_CORNER,\n LINE_THEN_CORNER\n }\n\n /**\n * An even-odd winding rule for determining the interior...
import com.sun.javafx.sg.prism.NGCanvasPath; import com.sun.marlin.DMarlinRenderer; import com.sun.marlin.DMarlinRenderingEngine; import com.sun.marlin.MaskMarlinAlphaConsumer; import com.sun.marlin.DRendererContext; import com.sun.prism.BasicStroke; import com.sun.prism.impl.PrismSettings; import com.sun.javafx.geom.P...
/* * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free ...
final Path2D p2d = rdrCtx.getPath2D();
0
butter-fly/belling-admin
src/main/java/com/belling/admin/controller/houtai/RoleController.java
[ "@Data\n@EqualsAndHashCode(callSuper = false)\npublic class Role extends PersistentObject {\n\n\t/**\n\t * 序列化ID\n\t */\n\tprivate static final long serialVersionUID = 564115576254799088L;\n\n\t/** 名称 */\n\tprivate String name;\n\t\n\t/** 编码 */\n\tprivate String code;\n\t\n\t/** 排序 */\n\tprivate Integer sort = Inte...
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotatio...
package com.belling.admin.controller.houtai; /** * <pre> * Description * Copyright: Copyright (c)2017 * Company: Sunny * Author: Administrator * Version: 1.0 * Create at: 2017年6月23日 上午8:48:33 * * Modification History: * Date Author Version Description * -----------------------...
public @ResponseBody TablePageResult page(String kw, Integer start, Integer length, Integer draw) {
4
OpenJunction/JavaJunction
src/main/java/edu/stanford/junction/props2/PropDaemon.java
[ "public class JSONObjWrapper extends JSONObject{\n\t\n\n\tprivate JSONObject self;\n\n\n\tpublic JSONObjWrapper(JSONObject obj){\n\t\tthis.self = obj;\n\t}\n\n\tpublic JSONObject getRaw(){\n\t\treturn self;\n\t}\n\n\tpublic int hashCode(){\n\t\treturn (this.opt(\"id\")).hashCode();\n\t}\n\n\tpublic boolean equals(O...
import edu.stanford.junction.api.activity.JunctionExtra; import org.json.JSONObject; import org.json.JSONException; import java.util.*; import java.net.*; import edu.stanford.junction.addon.JSONObjWrapper; import edu.stanford.junction.api.activity.JunctionExtra; import edu.stanford.junction.api.messaging.MessageHeader;...
/* * Copyright (C) 2010 Stanford University * * 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 ...
public void onMessageReceived(MessageHeader header, JSONObject msg){
2
Sigimera/sigimera-android-app
src/org/sigimera/app/android/StatisticFragment.java
[ "public class ApplicationController {\n\tpublic static ApplicationController instance = null;\n\t\n\tprivate SessionHandler sessionHandler;\n\t\n\tprivate Context context;\n\tprivate SharedPreferences settings;\n\tprivate PersistentStorage pershandler;\n\tprivate ActionBar actionBar;\n\t\n\tprivate boolean updating...
import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import org.sigimera.app.android.controller.ApplicationController; import org.sigimera.app.android.controller.DistanceController; import org.sigimera.app.android.controller.LocationController; import org.sigimera.app.android.controller...
package org.sigimera.app.android; /** * Sigimera Crises Information Platform Android Client * Copyright (C) 2013 by Sigimera * All Rights Reserved * * 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 F...
userLocation = LocationController.getInstance()
2
yfiton/yfiton
yfiton-notifiers/yfiton-notifier-desktop/src/main/java/com/yfiton/notifiers/desktop/DesktopNotifier.java
[ "public abstract class Notifier {\n\n protected static final Logger log = LoggerFactory.getLogger(Notifier.class);\n\n protected final Stopwatch stopwatch = Stopwatch.createUnstarted();\n\n private HierarchicalINIConfiguration configuration;\n\n public Notifier() {\n try {\n configurat...
import com.yfiton.api.Notifier; import com.yfiton.api.annotation.Parameter; import com.yfiton.api.exceptions.NotificationException; import com.yfiton.api.parameter.Parameters; import com.yfiton.notifiers.desktop.converters.LineBreakConverter; import com.yfiton.notifiers.desktop.validators.ParseAsIntegerValidator; impor...
/* * Copyright 2015 Laurent Pellegrino * * 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 agr...
protected Check checkParameters(Parameters parameters) {
2
yoichiro/oauth2-server
src/main/java/jp/eisbahn/oauth2/server/granttype/impl/ClientCredentials.java
[ "public abstract class DataHandler {\n\n\tprivate Request request;\n\n\t/**\n\t * Initialize this instance with the request information.\n\t * This constructor calls the init() method to initialize a connection\n\t * to your database, a preparation of your cache and so on.\n\t * @param request The request instance....
import org.apache.commons.lang3.StringUtils; import jp.eisbahn.oauth2.server.data.DataHandler; import jp.eisbahn.oauth2.server.exceptions.OAuthError; import jp.eisbahn.oauth2.server.models.AuthInfo; import jp.eisbahn.oauth2.server.models.ClientCredential; import jp.eisbahn.oauth2.server.models.Request;
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ma...
ClientCredential clientCredential = getClientCredentialFetcher().fetch(request);
3
domoinc/domo-java-sdk
domo-java-sdk-all/src/test/java/com/domo/sdk/streams/ExecutionUploadDataPartExample.java
[ "public class ExampleBase {\n\n protected DomoClient client;\n\n @Before\n public void setup() {\n Config config = Config.with()\n .clientId(\"MY_CLIENT_ID\")\n .clientSecret(\"MY_CLIENT_SECRET\")\n .apiHost(\"api.domo.com\")\n .useHttps(true)\n .scope(US...
import com.domo.sdk.ExampleBase; import com.domo.sdk.datasets.model.Column; import com.domo.sdk.datasets.model.CreateDataSetRequest; import com.domo.sdk.datasets.model.Schema; import com.domo.sdk.streams.model.Execution; import com.domo.sdk.streams.model.Stream; import com.domo.sdk.streams.model.StreamRequest; import c...
package com.domo.sdk.streams; public class ExecutionUploadDataPartExample extends ExampleBase { @Test public void streamClient_smokeTest() throws IOException { StreamClient sdsClient = client.streamClient(); //Build DataSet to populate the create stream request CreateDataSetRequest ds = new Crea...
Execution execution = sdsClient.createExecution(sds.getId());
4
taskadapter/redmine-java-api
src/test/java/com/taskadapter/redmineapi/ProjectIntegrationIT.java
[ "public class CustomField {\n\n private final PropertyStorage storage = new PropertyStorage();\n\n public final static Property<Integer> DATABASE_ID = new Property<>(Integer.class, \"id\");\n public final static Property<String> NAME = new Property<>(String.class, \"name\");\n public final static Proper...
import com.taskadapter.redmineapi.bean.CustomField; import com.taskadapter.redmineapi.bean.CustomFieldDefinition; import com.taskadapter.redmineapi.bean.CustomFieldFactory; import com.taskadapter.redmineapi.bean.Project; import com.taskadapter.redmineapi.bean.Tracker; import com.taskadapter.redmineapi.bean.Version; imp...
//add more than one tracker, it does not replace previous trackers Collection<Tracker> trackersToAdd=new HashSet<Tracker>(Arrays.asList(availableTrackers.get(1), availableTrackers.get(2))); createdProject.addTrackers(trackersToAdd).update(); createdProject=projectManager...
CustomField customField = new CustomField().setId(fieldId);
0
BoD/android-contentprovider-generator
etc/sample-generated-code/org/jraf/androidcontentprovidergenerator/sample/provider/product/ProductColumns.java
[ "public class SampleProvider extends BaseContentProvider {\n private static final String TAG = SampleProvider.class.getSimpleName();\n\n private static final boolean DEBUG = BuildConfig.LOG_DEBUG_PROVIDER;\n\n private static final String TYPE_CURSOR_ITEM = \"vnd.android.cursor.item/\";\n private static ...
import org.jraf.androidcontentprovidergenerator.sample.provider.company.CompanyColumns; import org.jraf.androidcontentprovidergenerator.sample.provider.manual.ManualColumns; import org.jraf.androidcontentprovidergenerator.sample.provider.person.PersonColumns; import org.jraf.androidcontentprovidergenerator.sample.provi...
/* * This source is part of the * _____ ___ ____ * __ / / _ \/ _ | / __/___ _______ _ * / // / , _/ __ |/ _/_/ _ \/ __/ _ `/ * \___/_/|_/_/ |_/_/ (_)___/_/ \_, / * /___/ * repository. * * Copyright (C) 2012-2017 Benoit 'BoD' Lubek (BoD@JRAF.org) * * This program is fre...
public static final String PREFIX_MANUAL = TABLE_NAME + "__" + ManualColumns.TABLE_NAME;
3
iGoodie/TwitchSpawn
src/main/java/net/programmer/igoodie/twitchspawn/tslanguage/action/OsRunAction.java
[ "@Mod(TwitchSpawn.MOD_ID)\npublic class TwitchSpawn {\n\n public static final String MOD_ID = \"twitchspawn\";\n public static final Logger LOGGER = LogManager.getLogger(TwitchSpawn.class);\n\n public static MinecraftServer SERVER;\n public static TraceManager TRACE_MANAGER;\n\n public TwitchSpawn() ...
import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.fmllegacy.network.NetworkDirection; import net.programmer.igoodie.twitchspawn.TwitchSpawn; import net.programmer.igoodie.twitchspawn.network.NetworkManager; import net.programmer.igoodie.twitchspawn.network.packet.OsRunPacket; import net.programm...
package net.programmer.igoodie.twitchspawn.tslanguage.action; public class OsRunAction extends TSLAction { public static void handleLocalScript(Shell shell, String script) { ProcessResult result = runScript(shell, script); if (result.exception != null) TwitchSpawn.LOGGER.info("OS_RUN...
NetworkManager.CHANNEL.sendTo(new OsRunPacket(shell, replaceExpressions(shellScript, args)),
2
garbagemule/MobArena
src/main/java/com/garbagemule/MobArena/MobArena.java
[ "public class CommandHandler implements CommandExecutor, TabCompleter\n{\n private MobArena plugin;\n private Messenger fallbackMessenger;\n\n private Map<String,Command> commands;\n\n public CommandHandler(MobArena plugin) {\n this.plugin = plugin;\n this.fallbackMessenger = new Messenger...
import com.garbagemule.MobArena.commands.CommandHandler; import com.garbagemule.MobArena.config.LoadsConfigFile; import com.garbagemule.MobArena.events.MobArenaPreReloadEvent; import com.garbagemule.MobArena.events.MobArenaReloadEvent; import com.garbagemule.MobArena.formula.FormulaMacros; import com.garbagemule.MobAre...
formman = FormulaManager.createDefault(); } public void onEnable() { ServerVersionCheck.check(getServer()); try { setup(); reload(); checkForUpdates(); } catch (ConfigError e) { getLogger().log(Level.SEVERE, "You have an error in y...
MobArenaReloadEvent post = new MobArenaReloadEvent(this);
2
M4thG33k/TombManyGraves2
src/main/java/com/m4thg33k/tombmanygraves/proxy/ClientProxy.java
[ "public class ModConfigs {\n\n public static Configuration config;\n\n // Client configs\n public static boolean FORCE_DIRT_RENDER;\n public static int GRAVE_SKULL_RENDER_TYPE;\n public static boolean DISPLAY_GRAVE_NAME;\n public static int NAME_FORCE;\n public static int NAME_YIELD;\n publi...
import java.awt.Color; import org.lwjgl.util.vector.Vector3f; import com.m4thg33k.tombmanygraves.ModConfigs; import com.m4thg33k.tombmanygraves.TombManyGraves; import com.m4thg33k.tombmanygraves.client.fx.PathFX; import com.m4thg33k.tombmanygraves.client.render.ItemRenderRegister; import com.m4thg33k.tombmanygraves.cli...
package com.m4thg33k.tombmanygraves.proxy; public class ClientProxy extends CommonProxy{ private Color NEAR; private Color FAR; @Override public void preinit(FMLPreInitializationEvent e) { super.preinit(e); } @Override public void init(FMLInitializationEvent e) { supe...
NEAR = ModConfigs.NEAR_PARTICLE;
0
PaulNoth/saral
src/main/java/com/pidanic/saral/domain/block/IfStatement.java
[ "public interface Statement {\n void accept(StatementGenerator generator);\n}", "public abstract class Expression {\n private Type type;\n\n public Expression(Type type) {\n this.type = type;\n }\n\n public Type type() {\n return type;\n }\n\n public abstract void accept(Express...
import com.pidanic.saral.domain.Statement; import com.pidanic.saral.domain.expression.Expression; import com.pidanic.saral.exception.IncompatibleTypeIfElse; import com.pidanic.saral.generator.BlockStatementGenerator; import com.pidanic.saral.generator.StatementGenerator; import com.pidanic.saral.scope.Scope; import com...
package com.pidanic.saral.domain.block; public class IfStatement extends BlockStatementImpl { private Expression booleanExpression; private List<Statement> trueBlock; private List<Statement> falseBlock; public IfStatement(Scope scope, Expression booleanExpression, List<Statement> trueBlock) { ...
public void accept(StatementGenerator generator) {
4
Sensis/http-stub-server
core/src/main/java/au/com/sensis/stubby/service/StubService.java
[ "public class Script {\n\n private String source;\n\n public Script(String source) {\n this.source = source;\n }\n\n public String getSource() {\n return source;\n }\n\n private ScriptEngine createEngine() {\n ScriptEngineManager manager = new ScriptEngineManager();\n S...
import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.util.List; import org.apache.log4j.Logger; import au.com.sensis.stubby.js.Script; import au.com.sensis.stubby.js.ScriptWorld; import au.com.sensis.stubby.model.StubExchange; import au.com.sensis.stubby.model.StubRequest; ...
package au.com.sensis.stubby.service; public class StubService { private static final Logger LOGGER = Logger.getLogger(StubService.class); private LinkedList<StubServiceExchange> responses = new LinkedList<StubServiceExchange>(); private LinkedList<StubRequest> requests = new LinkedList<StubRequest>()...
LOGGER.debug("Adding response: " + JsonUtils.prettyPrint(exchange));
8
data-integrations/salesforce
src/main/java/io/cdap/plugin/salesforce/plugin/source/batch/util/SalesforceSplitUtil.java
[ "public class BulkAPIBatchException extends RuntimeException {\n private BatchInfo batchInfo;\n\n public BulkAPIBatchException(String message, BatchInfo batchInfo) {\n super(String.format(\"%s. BatchId='%s', Reason='%s'\", message, batchInfo.getId(), batchInfo.getStateMessage()));\n this.batchInfo = batchIn...
import com.sforce.async.AsyncApiException; import com.sforce.async.BatchInfo; import com.sforce.async.BatchStateEnum; import com.sforce.async.BulkConnection; import com.sforce.async.JobInfo; import com.sforce.async.JobStateEnum; import com.sforce.async.OperationEnum; import io.cdap.plugin.salesforce.BulkAPIBatchExcepti...
/* * Copyright © 2021 Cask Data, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
public static BulkConnection getBulkConnection(AuthenticatorCredentials authenticatorCredentials) {
6
wordpress-mobile/WordCamp-Android
app/src/main/java/org/wordcamp/android/wcdetails/SessionDetailsActivity.java
[ "public class SessionDetailAdapter extends BaseAdapter {\n\n private Context mContext;\n private List<MiniSpeaker> speakers;\n private LayoutInflater inflater;\n\n public SessionDetailAdapter(Context ctx, List<MiniSpeaker> speakerList){\n mContext = ctx;\n speakers = speakerList;\n ...
import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.text.Html; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; impo...
package org.wordcamp.android.wcdetails; /** * Created by aagam on 12/2/15. */ public class SessionDetailsActivity extends AppCompatActivity { private SessionDB sessionDB; private org.wordcamp.android.objects.speaker.Session session; private ArrayList<MiniSpeaker> speakerList; private DBCommunica...
speakersListView.setAdapter(new SessionDetailAdapter(getApplicationContext(), speakerList));
0
cjdaly/fold
net.locosoft.fold.channel.vitals/src/net/locosoft/fold/channel/vitals/DynamicVitals.java
[ "public class ChannelUtil {\n\n\tpublic static IChannelService getChannelService() {\n\t\treturn FoldUtil.getService(IChannelService.class);\n\t}\n}", "public interface IChannelService {\n\n\tIChannel[] getAllChannels();\n\n\tIChannel getChannel(String channelId);\n\n\t<T extends IChannel> T getChannel(Class<T> c...
import java.util.List; import net.locosoft.fold.channel.ChannelUtil; import net.locosoft.fold.channel.IChannelService; import net.locosoft.fold.channel.times.ITimesChannel; import net.locosoft.fold.sketch.pad.neo4j.HierarchyNode; import net.locosoft.fold.sketch.pad.neo4j.MultiPropertyAccessNode; import net.locosoft.fol...
/***************************************************************************** * Copyright (c) 2015 Chris J Daly (github user cjdaly) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and ...
ITimesChannel timesChannel = channelService
2
snazy/ohc
ohc-core/src/test/java/org/caffinitas/ohc/chunked/CheckOHCacheImpl.java
[ "public interface CacheLoader<K, V>\n{\n /**\n * Cache loaders implement this method and return a non-{@code null} value on success.\n * {@code null} can be returned to indicate that the no value for the requested key could be found.\n * <p>\n * Permanent failures in loading a <em>specific</em> k...
import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; import java.util.Collections; import java.util.Iterator; import java.util.Map; import java.util.NoSuchElementException; import java.util.concurrent.ExecutionException; impo...
/* * Copyright (C) 2014 Robert Stupp, Koeln, Germany, robert-stupp.de * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
private final CacheSerializer<K> keySerializer;
1
TritonHo/supportsmallshop-android
src/com/marspotato/supportsmallshop/UpdateShopActivity.java
[ "public class Shop implements Serializable {\r\n\tprivate static final long serialVersionUID = 1L;\r\n\t\r\n\t@Expose\r\n\tpublic String id;\r\n\t@Expose\r\n\tpublic String name;\r\n\t@Expose\r\n\tpublic String shortDescription;\r\n\t@Expose\r\n\tpublic String fullDescription;\r\n\t@Expose\r\n\tpublic String search...
import java.io.UnsupportedEncodingException; import java.math.BigDecimal; import java.math.RoundingMode; import java.net.URLEncoder; import org.joda.time.DateTime; import com.android.volley.DefaultRetryPolicy; import com.android.volley.NetworkError; import com.android.volley.NoConnectionError; import com.androi...
package com.marspotato.supportsmallshop; public class UpdateShopActivity extends Activity implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, AuthCodeRequester { private BroadcastReceiver authCodeIntentReceiver; private String regId; priva...
if (lastClickTime != null && lastClickTime.plusMillis(Config.AVOID_DOUBLE_CLICK_PERIOD).isAfterNow())
5
Wokdsem/Kinject
compiler/src/main/java/com/wokdsem/kinject/codegen/ModuleAdapterSpec.java
[ "public class Dependency {\n\n\tpublic final String canonicalClassName;\n\tpublic final String named;\n\n\tpublic Dependency(String canonicalClassName, String named) {\n\t\tthis.canonicalClassName = canonicalClassName;\n\t\tthis.named = named;\n\t}\n\n}", "public class Module {\n\n\tpublic final String canonicalM...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeSpec; import com.wokdsem.kinject.annotations.Provides; import com.wokdsem.kinject.codegen.domains.Dependency; import com.wokdsem.kinject.codegen.domains.M...
package com.wokdsem.kinject.codegen; class ModuleAdapterSpec { static TypeSpec getModuleAdapterSpec(Module module, String adapterName) { List<MethodSpec> methods = getMethods(module.canonicalModuleName, module.provides); return TypeSpec .classBuilder(adapterName) .addModifiers(PUBLIC, FINAL) .addMeth...
private static List<MethodSpec> getMethods(String moduleName, List<Provide> provides) {
2
bhatti/PlexRBAC
src/main/java/com/plexobject/rbac/service/impl/PermissionsServiceImpl.java
[ "public class ServiceFactory {\n private static RepositoryFactory REPOSITORY_FACTORY = new RepositoryFactoryImpl();\n private static PermissionManager PERMISSION_MANAGER = new PermissionManagerImpl(\n REPOSITORY_FACTORY, new JavascriptEvaluator());\n\n public static RepositoryFactory getDefaultF...
import java.util.Collection; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; imp...
package com.plexobject.rbac.service.impl; @Path("/security/permissions") @Component("permissionsService") @Scope("singleton")
public class PermissionsServiceImpl implements PermissionsService,
7
pokowaka/android-geom
geom/src/main/java/math/geom2d/line/StraightLine2D.java
[ "public class AffineTransform2D implements Bijection2D, GeometricObject2D,\r\n Cloneable {\r\n\r\n // coefficients for x coordinate.\r\n protected double m00, m01, m02;\r\n\r\n // coefficients for y coordinate.\r\n protected double m10, m11, m12;\r\n\r\n // ====================================...
import java.util.ArrayList; import java.util.Collection; import math.geom2d.AffineTransform2D; import math.geom2d.Angle2D; import math.geom2d.Box2D; import math.geom2d.GeometricObject2D; import math.geom2d.Point2D; import math.geom2d.Shape2D; import math.geom2d.UnboundedShape2DException; import math.geom2d.Vec...
/* File StraightLine2D.java * * Project : Java Geometry Library * * =========================================== * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either...
return new GenericCirculinearDomain2D(this);
5
fmunch/transloader
src/test/java/com/googlecode/transloader/test/function/MinimalCloningTest.java
[ "public final class DefaultTransloader implements Transloader {\r\n\tprivate final CloningStrategy cloningStrategy;\r\n\r\n\t/**\r\n\t * Contructs a new <code>Transloader</code> to produce wrappers, the <code>ObjectWrapper</code>s being\r\n\t * configured with the given <code>CloningStrategy</code>.\r\n\t * \r\n\t ...
import junit.extensions.ActiveTestSuite; import junit.framework.Test; import com.googlecode.transloader.DefaultTransloader; import com.googlecode.transloader.Transloader; import com.googlecode.transloader.clone.CloningStrategy; import com.googlecode.transloader.test.Triangulate; import com.googlecode.transloader....
package com.googlecode.transloader.test.function; public class MinimalCloningTest extends CloningTestCase { public static Test suite() throws Exception { return new ActiveTestSuite(MinimalCloningTest.class); } public void testDoesNotCloneStrings() throws Exception { Object string = Triangulate.anyS...
assertDeeplyClonedToOtherClassLoader(new WithSetFields());
6
simo415/spc
src/com/sijobe/spc/command/Achievement.java
[ "public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\...
import com.sijobe.spc.util.FontColour; import com.sijobe.spc.validation.Parameter; import com.sijobe.spc.validation.ParameterString; import com.sijobe.spc.validation.Parameters; import com.sijobe.spc.wrapper.CommandSender; import com.sijobe.spc.wrapper.Minecraft; import com.sijobe.spc.wrapper.Player; import com.sijobe....
package com.sijobe.spc.command; /** * Gives achievements to the player * * TODO: Achievement isn't triggered correctly for some reason * * @author simo_415 * @version 1.0 */ @Command ( name = "achievement", description = "Allows you to list or unlock all achievements", videoURL = "http://www.youtube....
Player player = Minecraft.getPlayer();
6
appfoundry/android-nfc-lib
nfclib/src/androidTest/java/be/appfoundry/nfclibrary/utilities/async/AbstractFailsTestsAsync.java
[ "public class InsufficientCapacityException extends Exception {\n\n public InsufficientCapacityException() {\n }\n\n public InsufficientCapacityException(String message) {\n super(message);\n }\n\n public InsufficientCapacityException(StackTraceElement[] stackTraceElements) {\n setStack...
import be.appfoundry.nfclibrary.tasks.interfaces.AsyncOperationCallback; import be.appfoundry.nfclibrary.tasks.interfaces.AsyncUiCallback; import be.appfoundry.nfclibrary.utilities.TestUtilities; import be.appfoundry.nfclibrary.utilities.interfaces.AsyncNfcWriteOperation; import be.appfoundry.nfclibrary.utilities.async...
/* * AbstractFailsTestsAsync.java * NfcLibrary project. * * Created by : Daneo van Overloop - 17/6/2014. * * The MIT License (MIT) * * Copyright (c) 2014 AppFoundry. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documen...
this.mAsyncNfcWriteOperation = new WriteEmailNfcAsync(asyncUiCallback,
7
HiveKa/HiveKa
src/main/java/org/apache/hadoop/hive/kafka/KafkaRecordReader.java
[ "public class CamusWrapper<R> {\n private R record;\n private long timestamp;\n private MapWritable partitionMap;\n\n public CamusWrapper(R record) {\n this(record, System.currentTimeMillis());\n }\n\n public CamusWrapper(R record, long timestamp) {\n this(record, timestamp, \"unknown_server\", \"unknow...
import java.io.IOException; import java.util.HashSet; import kafka.message.Message; import org.apache.avro.generic.GenericDatumReader; import org.apache.avro.generic.GenericDatumWriter; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.Decoder; import org.apache.avro.io.DecoderFactory; import org....
this.reporter = reporter; /*if (context instanceof Mapper.Context) { mapperContext = (Mapper.Context) context; }*/ this.skipSchemaErrors = false; this.endTimeStamp = Long.MAX_VALUE; this.maxPullTime = Long.MAX_VALUE; beginTimeStamp = 0; ignoreServerServiceList = new HashSet<S...
decoder = MessageDecoderFactory.createMessageDecoder(conf, request.getTopic());
7
gdi-by/downloadclient
src/main/java/de/bayern/gdi/gui/controller/ServiceSelectionController.java
[ "public class ApplicationSettings {\n\n private static final Logger LOG = LoggerFactory.getLogger(ApplicationSettings.class.getName());\n\n private static final int DEFAULT_TIMEOUT = 10000;\n\n private static final int S_TO_MS = 1000;\n\n private final Document doc;\n\n private final Settings setting...
import de.bayern.gdi.config.ApplicationSettings; import de.bayern.gdi.config.Config; import de.bayern.gdi.config.Credentials; import de.bayern.gdi.gui.ServiceModel; import de.bayern.gdi.services.Atom; import de.bayern.gdi.services.Service; import de.bayern.gdi.services.WFSMeta; import de.bayern.gdi.services.WFSMetaExtr...
searchButton.setVisible(false); searchButton.setManaged(false); progressSearch.setVisible(true); progressSearch.setManaged(true); }); if (controller.catalogReachable) { ...
if (ServiceChecker.isReachable(serviceModel
8
Tonius/SimplyJetpacks
src/main/java/tonius/simplyjetpacks/item/meta/PackBase.java
[ "@Mod(modid = SimplyJetpacks.MODID, version = SimplyJetpacks.VERSION, dependencies = SimplyJetpacks.DEPENDENCIES, guiFactory = SimplyJetpacks.GUI_FACTORY)\npublic class SimplyJetpacks {\n \n public static final String MODID = \"simplyjetpacks\";\n public static final String VERSION = \"@VERSION@\";\n pu...
import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.min...
package tonius.simplyjetpacks.item.meta; public class PackBase { protected static final Set<PackBase> ALL_PACKS = new LinkedHashSet<PackBase>(); protected static final String TAG_ON = "PackOn"; public final String name; public final int tier; public final EnumRarity rarity; protecte...
public void tickInventory(World world, EntityPlayer player, ItemStack stack, ItemPack item) {
4
jlinn/riot-api-java
src/main/java/net/joelinn/riot/Riot.java
[ "public class ChampionClient extends AbstractClient{\n\n public ChampionClient(String apiKey, Region region) {\n super(apiKey, region);\n }\n\n @Override\n protected String getVersion() {\n return \"1.2\";\n }\n\n /**\n * @see <a href=\"https://developer.riotgames.com/api/methods...
import net.joelinn.riot.champion.ChampionClient; import net.joelinn.riot.game.GameClient; import net.joelinn.riot.league.LeagueClient; import net.joelinn.riot.staticdata.StaticDataClient; import net.joelinn.riot.stats.StatsClient; import net.joelinn.riot.summoner.SummonerClient; import net.joelinn.riot.team.TeamClient;...
package net.joelinn.riot; /** * Joe Linn * 12/17/13 */ public class Riot { protected String apiKey; protected Region region; protected Map<Class<? extends AbstractClient>, AbstractClient> clients = new HashMap<>(); public Riot(String apiKey){ this.apiKey = apiKey; } public Riot...
public LeagueClient league(){
2
8Yards/Nebula_Android
src/org/nebula/client/rtp/RTPReceiver.java
[ "public class DataFrame {\n\t/** The share RTP timestamp */\n\tprivate long rtpTimestamp;\n\t/** The calculated UNIX timestamp, guessed after 2 Sender Reports */\n\tprivate long timestamp = -1;\n\t/** the SSRC from which this frame originated */\n\tprivate long SSRC;\n\t/** contributing CSRCs, only read from the fi...
import java.util.Enumeration; import jlibrtp.DataFrame; import jlibrtp.Participant; import jlibrtp.RTPAppIntf; import jlibrtp.RTPSession; import org.sipdroid.codecs.G711; import android.util.Log;
/* * author - michel * refactor - michel, prajwol */ package org.nebula.client.rtp; public class RTPReceiver implements RTPAppIntf { private RTPSession rtpReceiver = null; public RTPReceiver(RTPSession rtpSession) { this.rtpReceiver = rtpSession; } public void stopPlaying() { Enumera...
G711.alaw2linear(data, linData, linData.length);
4
elminsterjimmy/PSN-API
PSN-API/src/main/java/com/elminster/retrieve/psn/parser/UserGameTrophyParser.java
[ "public enum TrophyType {\n\n UNKNOWN(\"Unknown\", 0xFF),\n BRONZE(\"Bronze\", 0x01),\n SILVER(\"Silver\", 0x02),\n GOLD(\"Gold\", 0x04), \n PLATINUM(\"Platinum\", 0x08);\n\n private final String name;\n private final int type;\n\n TrophyType(String name, int type) {\n this.name = name;\n this.type = ...
import java.util.ArrayList; import java.util.Date; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.elminster.common.parser.IParser; import com.elminster.common.parser.ParseException; import com.elminster.common.util.CollectionUtil; import com.elmins...
package com.elminster.retrieve.psn.parser; public class UserGameTrophyParser extends BaseParser implements IParser<JsonCompareTrophies, List<PSNUserTrophy>> { /** the logger. */ private static final Log logger = LogFactory.getLog(UserGameTrophyParser.class); /** * {@inheritDoc} */ @Override publ...
List<JsonTrophyInfo> list = gameUser.getList();
3
RandoApp/Rando-android
src/main/java/com/github/randoapp/service/BaseAuthService.java
[ "public class MainActivity extends FragmentActivity {\n\n\n private BroadcastReceiver receiver = new BroadcastReceiver() {\n\n @Override\n public void onReceive(Context context, Intent intent) {\n Log.i(BroadcastReceiver.class, \"Recieved event:\", intent.getAction());\n\n swi...
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.Toast; import com.android.volley.Response; import com.android.volley.VolleyError; import com.github.randoapp.MainActivity; impor...
package com.github.randoapp.service; public abstract class BaseAuthService { protected Activity activity; protected Progress progress; public BaseAuthService(Activity activity, Progress progress) { this.activity = activity; this.progress = progress; } public void done() { ...
Intent intent = new Intent(activity, MainActivity.class);
0
sputnikdev/bluetooth-manager
src/test/java/org/sputnikdev/bluetooth/manager/impl/BluetoothManagerImplTest.java
[ "public class DiscoveredAdapter implements DiscoveredObject {\n\n private static final String COMBINED_ADAPTER_ADDRESS = CombinedGovernor.COMBINED_ADDRESS;\n\n private final URL url;\n private final String name;\n private final String alias;\n\n /**\n * Creates a new object.\n * @param url bl...
import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.powermock.modules.junit4.PowerMockRunner; import org.sputnikdev.bluetooth.URL; import org.sputnikdev.bluetooth.manager.DiscoveredAdapter; import org.sputnikdev.bluetooth.m...
package org.sputnikdev.bluetooth.manager.impl; @RunWith(PowerMockRunner.class) public class BluetoothManagerImplTest { private static final String TINYB_PROTOCOL_NAME = "tinyb"; private static final URL TINYB_ADAPTER_URL = new URL("tinyb:/11:22:33:44:55:66"); private static final URL TINYB_DEVICE_URL =...
private Adapter tinybAdapter;
1
baratine/lucene-plugin
service/src/test/java/tests/TestIndexFile.java
[ "public class LuceneEntry\n{\n private int _id;\n private float _score;\n private String _externalId;\n\n public LuceneEntry()\n {\n }\n\n public LuceneEntry(int id)\n {\n this(0, Float.MAX_VALUE);\n }\n\n public LuceneEntry(int id, float score)\n {\n this(id, score, null);\n }\n\n public LuceneE...
import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.concurrent.ExecutionException; import java.util.stream.Stream; import com.caucho.junit.ConfigurationBaratine; import com.caucho.junit.RunnerBaratine; import com.caucho.junit.ServiceTest; import com.caucho.lucene.LuceneEntry; im...
package tests; /** * title: test indexFile index */ @RunWith(RunnerBaratine.class) @ServiceTest(LuceneWriterImpl.class) @ServiceTest(LuceneReaderImpl.class) @ServiceTest(LuceneFacadeImpl.class)
@ServiceTest(SearcherUpdateServiceImpl.class)
4
moorkop/mccy-engine
src/main/java/me/itzg/mccy/controllers/ApiContainersController.java
[ "public class ContainerRequest {\n @AssertTrue(message = \"The Minecraft EULA needs to be accepted for each created container\")\n private boolean ackEula;\n\n @NotNull @Size(min = 1)\n private String name;\n\n @Min(value = 0, message = \"Port needs to be 0 or greater\")\n private int port;\n\n ...
import com.spotify.docker.client.exceptions.DockerException; import me.itzg.mccy.model.ContainerDetails; import me.itzg.mccy.model.ContainerRequest; import me.itzg.mccy.model.ContainerSummary; import me.itzg.mccy.model.ServerStatus; import me.itzg.mccy.model.SingleValue; import me.itzg.mccy.services.ContainersService; ...
package me.itzg.mccy.controllers; /** * @author Geoff Bourne * @since 12/21/2015 */ @RestController @RequestMapping("/api/containers") public class ApiContainersController { @Autowired private ContainersService containers; @RequestMapping(method = RequestMethod.GET) public List<ContainerSummary>...
public ServerStatus getContainerStatus(@PathVariable("containerId") String containerId,
2
datacleaner/metamodel_extras
dbase/src/main/java/org/xBaseJ/XBaseXmlParser.java
[ "public class CharField extends Field {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic Object clone() throws CloneNotSupportedException {\n\t\tCharField tField = (CharField) super.clone();\n\t\ttField.name = new String(name);\n\t\ttField.nength = nength;\n\t\treturn tField;\n\t}\n\n\tpublic CharF...
import org.xBaseJ.fields.FloatField; import org.xBaseJ.fields.LogicalField; import org.xBaseJ.fields.MemoField; import org.xBaseJ.fields.NumField; import org.xBaseJ.fields.PictureField; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; ...
/** * eobjects.org MetaModel * Copyright (C) 2010 eobjects.org * * This copyrighted material is made available to anyone wishing to use, modify, * copy, or redistribute it subject to the terms and conditions of the GNU * Lesser General Public License, as published by the Free Software Foundation. * * This progr...
dbf.addField(new LogicalField(fldName));
4
CubeEngine/ReflecT
core/src/main/java/org/cubeengine/reflect/codec/CodecManager.java
[ "public class ConverterManager\n{\n private ConverterManager parent;\n\n private Map<Class<?>, Converter> converters = new ConcurrentHashMap<Class<?>, Converter>();\n private Map<Class, Converter> convertersByClass = new ConcurrentHashMap<Class, Converter>();\n\n protected ConverterManager(ConverterMana...
import java.util.HashMap; import java.util.Map; import org.cubeengine.converter.ConverterManager; import org.cubeengine.reflect.Reflector; import org.cubeengine.reflect.Section; import org.cubeengine.reflect.SectionConverter; import org.cubeengine.reflect.exception.ReflectedInstantiationException;
/* * The MIT License * Copyright © 2013 Cube Island * * 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, modif...
throw new ReflectedInstantiationException("Could not instantiate unregistered Codec! " + clazz.getName(), e);
4
lastfm/lastcommons-kyoto
src/main/java/fm/last/commons/kyoto/factory/CursorAdapter.java
[ "public enum AccessType {\n READ_WRITE(true),\n READ_ONLY(false);\n\n private boolean value;\n\n private AccessType(boolean value) {\n this.value = value;\n }\n\n public boolean value() {\n return value;\n }\n}", "public enum CursorStep {\n /** Advance to the next record */\n NEXT_RECORD(true),\n ...
import java.io.IOException; import kyotocabinet.Cursor; import kyotocabinet.Error; import fm.last.commons.kyoto.AccessType; import fm.last.commons.kyoto.CursorStep; import fm.last.commons.kyoto.KyotoCursor; import fm.last.commons.kyoto.ReadOnlyVisitor; import fm.last.commons.kyoto.WritableVisitor; import fm.last.common...
/* * Copyright 2012 Last.fm * * 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...
errorHandler = new ErrorHandler(new ErrorSource() {
5
spotify/java-hamcrest
future/src/test/java/com/spotify/hamcrest/future/CompletableFutureMatchersTest.java
[ "public static Matcher<CompletionStage<?>> stageCompletedWithException() {\n return stageCompletedWithExceptionThat(is(any(Throwable.class)));\n}", "public static Matcher<CompletionStage<?>> stageCompletedWithExceptionThat(\n final Matcher<? extends Throwable> matcher) {\n return new ExceptionallyCompletedCo...
import static org.hamcrest.CoreMatchers.isA; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.CoreMatchers.sameInstance; import static org.junit.Assert.assertThat; import java.util.concurrent....
/*- * -\-\- * hamcrest-future * -- * Copyright (C) 2016 Spotify AB * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unl...
assertThat(cf, stageWillCompleteWithExceptionThat(is(sameInstance(ex))));
5
KMax/cqels
src/test/java/org/deri/cqels/UnregisterQueryTest.java
[ "public interface Mapping extends Map<Var, Long>{\n\t\n\n\tpublic long get(Var var); \n\t\n\tpublic void from(OpRouter router);\n\t\n\tpublic OpRouter from();\n\t\n\tpublic ExecContext getCtx();\n\t\n\tpublic Iterator<Var> vars();\n\t\n\tpublic void addParent(Mapping parent);\n\t\n\tpublic boolean hasParent();\n\t\...
import com.hp.hpl.jena.datatypes.xsd.XSDDatatype; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.ResourceFactory; import static com.jayway.awaitility.Awaitility.await; import ...
package org.deri.cqels; public class UnregisterQueryTest { private static final String STREAM_ID_PREFIX = "http://example.org/simpletest/test"; private static final String CQELS_HOME = "cqels_home"; private static ExecContext context; @BeforeClass public static void beforeClass() { File ...
RDFStream stream = new DefaultRDFStream(context, STREAM_ID);
7
saoj/mentabean
src/test/java/org/mentabean/jdbc/one_to_one/OneToOneTest.java
[ "public class BeanConfig {\r\n\r\n\tprivate final Map<String, DBField> fieldList = new LinkedHashMap<String, DBField>();\r\n\r\n\tprivate final Map<String, DBField> pkList = new LinkedHashMap<String, DBField>();\r\n\t\r\n\tprivate final Map<String, Class<? extends Object>> abstractInstances = new LinkedHashMap<Stri...
import org.junit.After; import org.junit.Before; import org.junit.Test; import org.mentabean.BeanConfig; import org.mentabean.BeanManager; import org.mentabean.BeanSession; import org.mentabean.DBTypes; import org.mentabean.jdbc.AbstractBeanSessionTest; import org.mentabean.jdbc.AnsiSQLBeanSession; import org.mentabean...
package org.mentabean.jdbc.one_to_one; /** * This test illustrates all particularities of how MentaBean handles one-to-one relationships. * * Post has one-and-only-one User * * @author Sergio Oliveira Jr. */ public class OneToOneTest extends AbstractBeanSessionTest { private BeanSession session; @Befor...
.pk(user.getId(), DBTypes.AUTOINCREMENT)
3
centralperf/centralperf
src/main/java/org/centralperf/service/BootstrapService.java
[ "public class Configuration {\n\tpublic static final String INITIALIZED = \"initialized\";\n\t\n\tprivate String keyLabel;\n\tprivate String keyToolTip;\n\tprivate String keyName;\n\tprivate String keyValue;\n\tprivate boolean readOnly;\n\tprivate boolean fromDb;\n\tprivate boolean booleanValue;\n\tprivate String t...
import org.centralperf.model.Configuration; import org.centralperf.model.dao.Project; import org.centralperf.model.dao.Run; import org.centralperf.repository.RunRepository; import org.centralperf.sampler.driver.jmeter.JMeterSampler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.bea...
/* * Copyright (C) 2014 The Central Perf authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * T...
private RunRepository runRepository;
3
CubeEngine/ReflecT
converter/src/main/java/org/cubeengine/converter/converter/generic/MapConverter.java
[ "public class ConversionException extends Exception\n{\n private ConversionException(String message)\n {\n super(message);\n }\n\n private ConversionException(String message, Throwable cause)\n {\n super(message, cause);\n }\n\n public static ConversionException of(Object converte...
import org.cubeengine.converter.ConversionException; import org.cubeengine.converter.ConverterManager; import org.cubeengine.converter.node.MapNode; import org.cubeengine.converter.node.Node; import org.cubeengine.converter.node.StringNode; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; ...
/* * The MIT License * Copyright © 2013 Cube Island * * 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, modif...
public Node toNode(Map map, ConverterManager manager) throws ConversionException
3
FlyingPumba/SoundBox
src/com/arcusapp/soundbox/player/MediaPlayerService.java
[ "public class SoundBoxPreferences {\n\n private final static String LAST_SONGS = \"lastsongs\";\n private final static String LAST_PLAYED_SONG = \"lastplayedsong\";\n\n public static class LastSongs {\n public static List<String> getLastSongs() { \n SharedPreferences preferences = Pref...
import android.app.AlarmManager; import android.app.Notification; import android.app.PendingIntent; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.media.MediaPlayer; import android.m...
/* * SoundBox - Android Music Player * Copyright (C) 2013 Iván Arcuschin Moreno * * This file is part of SoundBox. * * SoundBox 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 L...
Song currentSong = getCurrentSong();
5
RockinChaos/ItemJoin
src/me/RockinChaos/itemjoin/utils/sql/Database.java
[ "public class ItemJoin extends JavaPlugin {\n\t\n \tprivate static ItemJoin instance;\n \tprivate boolean isStarted = false;\n \t\n /**\n * Called when the plugin is loaded.\n * \n */\n @Override\n public void onLoad() {\n \tinstance = this;\n }\n \n /**\n * Called when the plugin ...
import me.RockinChaos.itemjoin.handlers.ConfigHandler; import me.RockinChaos.itemjoin.utils.SchedulerUtils; import me.RockinChaos.itemjoin.utils.ServerUtils; import me.RockinChaos.itemjoin.utils.StringUtils; import java.io.File; import java.io.IOException; import java.sql.Connection; import java.sql.DriverManager; impo...
/* * ItemJoin * Copyright (C) CraftationGaming <https://www.craftationgaming.com/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your ...
ServerUtils.logSevere("{SQL} [1] Failed to execute database statement.");
3
jhy/jsoup
src/test/java/org/jsoup/nodes/DocumentTest.java
[ "public class Jsoup {\n private Jsoup() {}\n\n /**\n Parse HTML into a Document. The parser will make a sensible, balanced document tree out of any HTML.\n\n @param html HTML to parse\n @param baseUri The URL where the HTML was retrieved from. Used to resolve relative URLs to absolute URLs, tha...
import org.jsoup.Jsoup; import org.jsoup.TextUtil; import org.jsoup.integration.ParseTest; import org.jsoup.nodes.Document.OutputSettings; import org.jsoup.nodes.Document.OutputSettings.Syntax; import org.jsoup.parser.ParseSettings; import org.jsoup.parser.Parser; import org.jsoup.select.Elements; import org.junit.jupi...
package org.jsoup.nodes; /** Tests for Document. @author Jonathan Hedley, jonathan@hedley.net */ public class DocumentTest { private static final String charsetUtf8 = "UTF-8"; private static final String charsetIso8859 = "ISO-8859-1"; @Test public void setTextPreservesDocumentStructure() {
Document doc = Jsoup.parse("<p>Hello</p>");
0
TrainerGuy22/Oceania
src/main/java/oceania/entity/render/RenderOceaniaBoatWithChest.java
[ "public abstract class EntityOceaniaBoat extends EntityBoat\n{\n\tprivate static final int\tINDEX_BOAT_TYPE\t= 20;\n\tprivate static final int\tINDEX_HEALTH\t= 21;\n\tprivate static final int\tINDEX_OWNER\t\t= 22;\n\t\n\tprivate static final double\tTURN_SPEED\t\t= 20.0;\n\t\n\tprivate int\t\t\t\t\tticksUntilHeal;\...
import static org.lwjgl.opengl.GL11.*; import java.util.HashMap; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import oceania.entity.EntityOceaniaBoat; import oceania.entity.EntityOceaniaBoatWithChest; import oceania.entity.render.mod...
package oceania.entity.render; @SideOnly(Side.CLIENT) public class RenderOceaniaBoatWithChest extends Render { private ModelBoatWithChest model; private HashMap<String, ResourceLocation> texCache; public RenderOceaniaBoatWithChest() { // this.model = (TechneModel) AdvancedModelLoader.loadModel("/assets/...
OUtil.bindTexture(this.getEntityTexture(entity));
4
Nedelosk/OreRegistry
src/main/java/oreregistry/config/Config.java
[ "@Mod(modid = Constants.MOD_ID, name = Constants.NAME, version = Constants.VERSION, acceptedMinecraftVersions = \"[1.11]\")\npublic class OreRegistry {\n\n\t@Nullable\n\t@Mod.Instance(Constants.MOD_ID)\n\tpublic static OreRegistry instance;\n\n\tpublic static final ResourceRegistry registry;\n\tpublic static final ...
import javax.annotation.Nullable; import java.io.File; import java.util.List; import java.util.Map; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.MinecraftForge; import net.minecr...
/* * Copyright (c) 2017 Nedelosk, Mezz * * This work (the MOD) is licensed under the "MIT" License, see LICENSE for details. */ package oreregistry.config; public class Config { @Nullable public static Configuration config; public static boolean unifyItems = true; public static void load(Sid...
MinecraftForge.EVENT_BUS.post(new CompleteChoosingEvent());
1
MindscapeHQ/raygun4java
sampleapp/src/main/java/com/mindscapehq/raygun4java/sampleapp/SampleApp.java
[ "public interface IRaygunClientFactory {\n IRaygunClientFactory withBeforeSend(IRaygunSendEventFactory<IRaygunOnBeforeSend> onBeforeSend);\n IRaygunClientFactory withAfterSend(IRaygunSendEventFactory<IRaygunOnAfterSend> onAfterSend);\n IRaygunClientFactory withFailedSend(IRaygunSendEventFactory<IRaygunOnFa...
import com.mindscapehq.raygun4java.core.IRaygunClientFactory; import com.mindscapehq.raygun4java.core.IRaygunOnAfterSend; import com.mindscapehq.raygun4java.core.IRaygunOnBeforeSend; import com.mindscapehq.raygun4java.core.IRaygunSendEventFactory; import com.mindscapehq.raygun4java.core.RaygunClient; import com.mindsca...
package com.mindscapehq.raygun4java.sampleapp; /** * To test with getting the version from the jar * mvn clean package install * java -jar sampleapp\target\sampleapp-3.0.0-SNAPSHOT-jar-with-dependencies.jar */ public class SampleApp { public static final String API_KEY = "YOUR_API_KEY"; /** * An e...
RaygunSettings.getSettings().setHttpProxy("nothing here", 80);
6
erickok/retrofit-xmlrpc
xmlrpc/src/test/java/nl/nl2312/xmlrpc/MockedTest.java
[ "public interface ArrayDeserializer<T> {\n\n T deserialize(ArrayValues values);\n\n}", "public final class ArrayValues {\n\n private final DeserializationContext context;\n private final List<Value> data;\n\n public ArrayValues(DeserializationContext context, List<Value> data) {\n this.context ...
import nl.nl2312.xmlrpc.deserialization.ArrayDeserializer; import nl.nl2312.xmlrpc.deserialization.ArrayValues; import nl.nl2312.xmlrpc.deserialization.StructDeserializer; import nl.nl2312.xmlrpc.deserialization.StructMembers; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.mo...
package nl.nl2312.xmlrpc; public final class MockedTest { private Retrofit retrofit; private MockWebServer server; @Before public void setUp() { HttpLoggingInterceptor logging = new HttpLoggingInterceptor(); logging.setLevel(HttpLoggingInterceptor.Level.BODY); OkHttpClient...
.addArrayDeserializer(PostWithConstructor.class, new ArrayDeserializer<PostWithConstructor>() {
0
Karumi/MarvelApiClientAndroid
MarvelApiClient/src/main/java/com/karumi/marvelapiclient/SeriesApiClient.java
[ "public class ComicsDto extends MarvelCollection<ComicDto> {\n\n public List<ComicDto> getComics() {\n return getResults();\n }\n\n @Override public String toString() {\n return \"CharactersDto{\"\n + \"offset=\"\n + getOffset()\n + \", limit=\"\n + getLimit()\n + \", tot...
import com.karumi.marvelapiclient.model.ComicsDto; import com.karumi.marvelapiclient.model.ComicsQuery; import com.karumi.marvelapiclient.model.MarvelResponse; import com.karumi.marvelapiclient.model.SeriesCollectionDto; import com.karumi.marvelapiclient.model.SeriesDto; import com.karumi.marvelapiclient.model.SeriesQu...
/* * Copyright (C) 2015 Karumi. * 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 MarvelResponse<SeriesCollectionDto> getAll(int offset, int limit)
3
telosys-tools-bricks/telosys-tools-generic-model
src/test/java/org/telosys/tools/generic/model/types/TypeConverterForJavaTest.java
[ "public static final int NONE = 0 ;", "public static final int NOT_NULL = 1 ;", "public static final int OBJECT_TYPE = 4 ;", "public static final int PRIMITIVE_TYPE = 2 ;", "public static final int UNSIGNED_TYPE = 8 ;" ]
import static org.telosys.tools.generic.model.types.AttributeTypeInfo.NONE; import static org.telosys.tools.generic.model.types.AttributeTypeInfo.NOT_NULL; import static org.telosys.tools.generic.model.types.AttributeTypeInfo.OBJECT_TYPE; import static org.telosys.tools.generic.model.types.AttributeTypeInfo.PRIMITIVE_T...
package org.telosys.tools.generic.model.types; public class TypeConverterForJavaTest { private static final String LOCAL_DATE = TypeConverterForJava.LOCAL_DATE_CLASS; private static final String LOCAL_TIME = TypeConverterForJava.LOCAL_TIME_CLASS; private static final String LOCAL_DATE_TIME = Type...
check( getType(tc, NeutralType.STRING, PRIMITIVE_TYPE ), String.class);
3
upnext/blekit-android
src/main/java/com/upnext/blekit/conditions/BLECondition.java
[ "public enum BeaconEvent {\n\n /**\n * A beacon has appeared in range\n */\n REGION_ENTER,\n\n /**\n * A beacon has disappeared from range.\n * This event is in reality delayed to prevent imemdiate enter-exit-enter events.\n * Because of that LEAVE is delayed by {@link com.upnext.blekit...
import com.upnext.blekit.model.Zone; import com.upnext.blekit.util.ExpressionEvaluator; import com.upnext.blekit.util.L; import java.util.Map; import android.content.Context; import com.upnext.blekit.BeaconEvent; import com.upnext.blekit.model.Beacon; import com.upnext.blekit.model.Trigger;
/* * Copyright (c) 2014 UP-NEXT. All rights reserved. * http://www.up-next.com * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the...
ExpressionEvaluator evaluator = new ExpressionEvaluator();
4
graywolf336/Jail
src/main/java/com/graywolf336/jail/command/subcommands/JailListCommand.java
[ "public class JailManager {\n private JailMain plugin;\n private HashMap<String, Jail> jails;\n private HashMap<String, CreationPlayer> jailCreators;\n private HashMap<String, CreationPlayer> cellCreators;\n private HashMap<String, ConfirmPlayer> confirms;\n private HashMap<UUID, CachePrisoner> ca...
import java.util.Collection; import java.util.List; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import com.graywolf336.jail.JailManager; import com.graywolf336.jail.beans.Jail; import com.graywolf336.jail.beans.Prisoner; import com.graywolf336.jail.command.Command; import com.graywolf336.jail....
package com.graywolf336.jail.command.subcommands; @CommandInfo( maxArgs = 1, minimumArgs = 0, needsPlayer = false, pattern = "list|l", permission = "jail.command.jaillist", usage = "/jail list (jail)" ) public class JailListCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
0
zhenglu1989/web-sso
ki4so-common/src/main/java/com/github/ebnew/ki4so/core/authentication/KnightEncryCredentialManagerImpl.java
[ "public class KnightBase64Coder {\n\n private static final Logger logger = Logger.getLogger(KnightBase64Coder.class);\n\n /**\n * 编码\n * @param bstr\n * @return\n */\n\n public static String encryptBase64(byte[] bstr){\n if(bstr == null || bstr.length == 0){\n return null;...
import com.alibaba.fastjson.JSON; import com.github.ebnew.ki4so.common.KnightBase64Coder; import com.github.ebnew.ki4so.common.KnightDECoder; import com.github.ebnew.ki4so.common.utils.StringUtils; import com.github.ebnew.ki4so.core.key.KnightKey; import com.github.ebnew.ki4so.core.key.KnightKeyService; import com.gith...
package com.github.ebnew.ki4so.core.authentication; /** * 加密凭据管理的实现类 * @author zhenglu * @since 15/4/27 */ public class KnightEncryCredentialManagerImpl implements KnightEncryCredentialManager { private static final Logger logger = Logger.getLogger(KnightEncryCredentialManagerImpl.class); private Knigh...
if(encryCredential != null && !StringUtils.isEmpty(encryCredential.getCredential())){
2
flyingrub/TamTime
app/src/main/java/flying/grub/tamtime/fragment/AllLinesFragment.java
[ "public class OneLineActivity extends AppCompatActivity {\n\n private static final String TAG = OneLineActivity.class.getSimpleName();\n private Toolbar toolbar;\n private ViewPager viewPager;\n private SlidingTabLayout slidingTabLayout;\n\n private int linePosition;\n private Line line;\n\n pr...
import android.app.Activity; import android.support.v4.app.Fragment; import android.content.Intent; import android.os.Bundle; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; imp...
package flying.grub.tamtime.fragment; public class AllLinesFragment extends Fragment { private RecyclerView recyclerView; private AllLinesAdapter adapter; private RecyclerView.LayoutManager layoutManager;
private ArrayList<Line> lines;
4
carrotsearch/smartsprites
src/main/java/org/carrot2/labs/smartsprites/SpriteImageBuilder.java
[ "public enum SpriteImageFormat\n{\n PNG, GIF, JPG;\n\n private String value;\n\n private SpriteImageFormat()\n {\n this.value = name().toLowerCase();\n }\n\n @Override\n public String toString()\n {\n return value;\n }\n\n public static SpriteImageFormat getValue(String v...
import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Map; import javax.imageio.ImageIO; import org.apache.commons....
package org.carrot2.labs.smartsprites; /** * Lays out and builds sprite images based on the collected SmartSprites directives. */ public class SpriteImageBuilder { /** This builder's configuration */ public final SmartSpritesParameters parameters; /** This builder's message log */ private final ...
BufferedImageUtils.drawImage(mergedImage, imageToWrite, 0, 0);
6
t28hub/json2java4idea
idea/src/main/java/io/t28/json2java/idea/command/NewClassCommandAction.java
[ "public class JavaConverter {\n private final Configuration configuration;\n\n public JavaConverter(@Nonnull Configuration configuration) {\n this.configuration = configuration;\n }\n\n @Nonnull\n @CheckReturnValue\n public String convert(@Nonnull String packageName, @Nonnull String classNa...
import com.google.common.base.Preconditions; import com.google.inject.Inject; import com.google.inject.assistedinject.Assisted; import com.intellij.ide.highlighter.JavaFileType; import com.intellij.openapi.application.Result; import com.intellij.openapi.command.WriteCommandAction; import com.intellij.openapi.fileTypes....
/* * Copyright (c) 2017 Tatsuya Maki * * 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...
throw new ClassAlreadyExistsException("Class '" + name + "'already exists in " + packageElement.getName());
1
hugmanrique/PokeData
src/main/java/me/hugmanrique/pokedata/utils/ImageUtils.java
[ "public class Lz77 {\n public static int getDataLength(ROM rom, int offset) {\n byte[] data = rom.readBytes(offset, 0x10);\n\n return (int) BitConverter.toInt32(\n new byte[] {\n data[1],\n data[2],\n data[3],\n 0x0\n ...
import me.hugmanrique.pokedata.compression.Lz77; import me.hugmanrique.pokedata.graphics.ImageType; import me.hugmanrique.pokedata.graphics.Palette; import me.hugmanrique.pokedata.graphics.ROMImage; import me.hugmanrique.pokedata.roms.ROM; import java.awt.*; import java.awt.image.BufferedImage; import java.util.HashMap...
package me.hugmanrique.pokedata.utils; /** * {@link Palette} and {@link ROMImage} loader that keeps a palette cache to * avoid too many {@link me.hugmanrique.pokedata.compression.HexInputStream} creation to decompress Lz77 * @author Hugmanrique * @since 01/06/2017 * @see Palette * @see ROMImage */ public clas...
public static ROMImage getImage(ROM rom, int pointer, Palette palette, int width, int height) {
3
hoffimar/timerdroid
app/src/main/java/com/tomatodev/timerdroid/widget/WidgetProviderSmall.java
[ "public class MyApplication extends Application {\n\tpublic static boolean mainVisible = false;\n\tprivate static int counter;\n\t\n\tpublic static boolean showRunningTimers = false;\n\t\n\tpublic static synchronized int getId() {\n\t\treturn counter++;\n\t}\n}", "public class Utilities {\n\n\tpublic static Strin...
import android.app.PendingIntent; import android.app.Service; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.database.Curs...
package com.tomatodev.timerdroid.widget; public class WidgetProviderSmall extends AppWidgetProvider { public static String ACTION_WIDGET_RECEIVER_MAIN = "ActionReceiverWidgetMain"; public static String ACTION_WIDGET_RECEIVER_CONFIGURE = "ActionReceiverWidgetConfigure"; public static String ACTION_WIDGET_RECEIVER...
static DbAdapter mDbHelper;
2
chedim/minedriod
src/main/java/com/onkiup/minedroid/gui/drawables/RoundedCornerDrawable.java
[ "@SideOnly(Side.CLIENT)\npublic class GuiManager {\n /**\n * Current MineDroid theme\n */\n public static HashMap<Integer, Style> themes = new HashMap<Integer, Style>();\n\n /**\n * Minecraft client instance\n */\n @SideOnly(Side.CLIENT)\n protected static Minecraft mc = Minecraft.get...
import com.onkiup.minedroid.gui.GuiManager; import com.onkiup.minedroid.gui.XmlHelper; import com.onkiup.minedroid.gui.primitives.Color; import com.onkiup.minedroid.gui.primitives.GLColor; import com.onkiup.minedroid.gui.primitives.Point; import com.onkiup.minedroid.gui.resources.Style;
package com.onkiup.minedroid.gui.drawables; /** * Draws a rectangle with rounded corners */ public class RoundedCornerDrawable extends ColorDrawable { /** * Rectangle size */ protected Point size; /** * Corners radius; */ protected int radius; protected final static EllipseD...
public RoundedCornerDrawable(GLColor color, int radius) {
3
MaChristmann/mobile-trial
sample/SimpleSample/src/org/mobiletrial/simplesample/MainActivity.java
[ "public class LicenseChecker {\n\tprivate static final String TAG = \"LicenseChecker\";\n\t\n\tprivate static final String KEY_FACTORY_ALGORITHM = \"RSA\";\n\n\t// Timeout value (in milliseconds) for calls to service.\n\tprivate static final int TIMEOUT_MS = 100 * 1000;\n\n\tprivate static final SecureRandom RANDOM...
import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import org.mobiletrial.license.LicenseChecker; import org.mobiletrial.license.NotLicensedDialog; import org.mobiletrial.license.PlaystoreAccountType; import org.mobiletrial.license.RetryDialog; import org.mobiletrial.license.ServerManagedP...
/* * Copyright (C) 2010 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 ap...
new PlaystoreAccountType());
2
paulirotta/cascade
icebox/systemtest/src/main/java/com/futurice/cascade/systemtest/ThreadTypeTest.java
[ "public class AltFutureFuture<IN, OUT> extends Origin implements Future<OUT> {\n private static final long DEFAULT_GET_TIMEOUT = 5000;\n private static final long CHECK_INTERVAL = 50; // This is a fallback in case you for example have an error and fail to altFuture.notifyAll() when finished\n\n @NonNull\n ...
import android.util.Log; import com.reactivecascade.util.AltFutureFuture; import com.reactivecascade.functional.ImmutableValue; import com.reactivecascade.functional.SettableAltFuture; import com.reactivecascade.i.CallOrigin; import com.reactivecascade.i.IThreadType; import com.reactivecascade.i.action.IAction; import ...
/* * Copyright (c) 2015 Futurice GmbH. All rights reserved. * <p> * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - Redistributions of source code must retain the above copyright notice, this * list of conditions ...
protected IThreadType threadType;
3
SecUSo/privacy-friendly-qr-scanner
app/src/main/java/com/secuso/privacyfriendlycodescanner/qrscanner/ui/helpers/BaseActivity.java
[ "public class AboutActivity extends AppCompatActivity {\n\n @SuppressLint(\"RestrictedApi\")\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_about);\n\n getSupportActionBar().setDefaultDisplayHo...
import android.content.Intent; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; import android.view.MenuItem; import android.view.View; import androidx.appcompat.app.ActionBarDrawerToggle; import androidx...
package com.secuso.privacyfriendlycodescanner.qrscanner.ui.helpers; /** * @author Christopher Beckmann, Karola Marky * @version 20171017 * This class is a parent class of all activities that can be accessed from the * Navigation Drawer (example see MainActivity.java) * * The default NavigationDrawer functiona...
intent = new Intent(this, QrGeneratorOverviewActivity.class);
6
EsupPortail/esup-dematec
src/main/java/fr/univrouen/poste/services/PosteAPourvoirService.java
[ "@RooJavaBean\n@RooToString\n@RooJpaActiveRecord\npublic class AppliConfig {\n\t\n\tpublic static enum MailReturnReceiptModeTypes {NEVER, EACH_UPLOAD, EACH_SESSION};\n\n\tprivate static String cacheTitre;\n\t\n\tprivate static String cacheImageUrl;\n\t\n\tprivate static String cachePiedPage;\n\n\tprivate static Str...
import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import fr.univrouen.poste.domain.AppliConfig; import fr.uni...
package fr.univrouen.poste.services; @Service @Transactional public class PosteAPourvoirService { public List<PosteAPourvoirAvailableBean> getPosteAPourvoirAvailables(User candidat) { List<PosteAPourvoir> postesAPourvoir = PosteAPourvoir.findPosteAPourvoirsByDateEndSignupCandidatGreaterThan(new Date()).getR...
RecevableEnum recevableEnum = AppliConfig.getCacheCandidatureRecevableEnumDefault();
3
patrickfav/Dali
dali/src/main/java/at/favre/lib/dali/Dali.java
[ "public class ContextWrapper {\n private Context context;\n private RenderScript renderScript;\n private RenderScript.ContextType renderScriptContextType = RenderScript.ContextType.NORMAL;\n\n public ContextWrapper(Context context) {\n this.context = context;\n }\n\n public ContextWrapper(C...
import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.util.Log; import android.view.View; import androidx.annotation.Nullable; import androidx.appcompat.widget.Toolbar; import androidx.drawerlayout.widget.DrawerLayout...
package at.favre.lib.dali; public final class Dali { public static final int NO_RESID = -1; private static final String TAG = Dali.class.getSimpleName(); private static TwoLevelCache DISK_CACHE_MANAGER; private static ExecutorManager EXECUTOR_MANAGER; private static Config GLOBAL_CONFIG = new C...
private ContextWrapper contextWrapper;
0
OpenBEL/cytoscape-plugins
org.openbel.cytoscape.navigator/src/org/openbel/cytoscape/navigator/task/AbstractSearchKamTask.java
[ "public interface KamService {\n\n /**\n * Reloads the {@link ClientConnector} in this {@link KamService}\n */\n void reloadClientConnector();\n\n /**\n * Finds {@link KamNode KamNodes} by a {@link List} of\n * {@link NamespaceValue NamespaceValues} and optional {@link NodeFilter\n * no...
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java...
/* * KAM Navigator Plugin * * URLs: http://openbel.org/ * Copyright (C) 2012, Selventa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at...
kamHandle = new KamLoader().load(kamId);
2
InteractiveSystemsGroup/GamificationEngine-Kinben
src/main/java/info/interactivesystems/gamificationengine/entities/PlayerGroup.java
[ "@Path(\"/goal\")\r\n@Stateless\r\n@Produces(MediaType.APPLICATION_JSON)\r\npublic class GoalApi {\r\n\r\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(GoalApi.class);\r\n\r\n\t@Inject\r\n\tOrganisationDAO organisationDao;\r\n\t@Inject\r\n\tGoalDAO goalDao;\r\n\t@Inject\r\n\tRuleDAO ruleDao;\r\n\t@...
import info.interactivesystems.gamificationengine.api.GoalApi; import info.interactivesystems.gamificationengine.api.ValidateUtils; import info.interactivesystems.gamificationengine.dao.PlayerDAO; import info.interactivesystems.gamificationengine.entities.goal.FinishedGoal; import info.interactivesystems.gamificationen...
package info.interactivesystems.gamificationengine.entities; /** * Players can be assigned to a group by its creation or at a later point in time. * For example depending on the respective organization, a group can be a * department, a work group or several employees with the same occupation. It is * possi...
public List<FinishedGoal> getFinishedGoalsByGoal(Goal goal) {
4
pulsarIO/druid-kafka-ext
kafka-eight-ex/src/test/java/io/druid/firehose/kafka/support/KafkaIngestConsumer.java
[ "public class ConsumerPartitionReader implements PartitionReader {\n\tprivate final ZKConnector<?> zkConnector;\n\tprivate final String topic;\n\tprivate final String groupId;\n\tprivate final int partition;\n\tprivate final String clientId;\n\tprivate final KafkaConsumerConfig config;\n\n\t//private final String ...
import java.util.Iterator; import java.util.Properties; import com.ebay.pulsar.druid.firehose.kafka.support.ConsumerPartitionReader; import com.ebay.pulsar.druid.firehose.kafka.support.SimpleConsumerController; import com.ebay.pulsar.druid.firehose.kafka.support.SimpleConsumerEx; import com.ebay.pulsar.druid.firehose.k...
package io.druid.firehose.kafka.support; /** *@author qxing * **/ public class KafkaIngestConsumer { private static SimpleConsumerController kafkaController; private static ZKConnector zkConnector; private static ConsumerPartitionReader reader; public static void main(String[] args) throws InterruptedExcep...
final SimpleConsumerEx consumer=kafkaController.createConsumer(UTGlobal.topic);
2
yammer/tenacity
tenacity-core/src/test/java/com/yammer/tenacity/core/http/tests/ClientTimeoutTest.java
[ "public abstract class TenacityCommand<R> extends HystrixCommand<R> {\n protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {\n this(tenacityPropertyKey, tenacityPropertyKey);\n }\n\n protected TenacityCommand(TenacityPropertyKey commandKey,\n TenacityProp...
import com.codahale.metrics.MetricRegistry; import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; import com.netflix.hystrix.exception.HystrixRuntimeException; import com.yammer.tenacity.core.TenacityCommand; import com.yammer.tenacity.core.config.BreakerboxConfiguration; import com.yamm...
package com.yammer.tenacity.core.http.tests; public class ClientTimeoutTest { @Path("/") public static class BarrierTarget { private void doSleep(long time) throws InterruptedException { Thread.sleep(time); } @POST public void post(@QueryParam("time") ...
private final TenacityJerseyClientBuilder tenacityClientBuilder = TenacityJerseyClientBuilder.builder(DependencyKey.CLIENT_TIMEOUT);
3
optimizely/android-sdk
datafile-handler/src/main/java/com/optimizely/ab/android/datafile_handler/DefaultDatafileHandler.java
[ "public class Cache {\n\n @NonNull private final Context context;\n @NonNull private final Logger logger;\n\n /**\n * Create new instance of {@link Cache}.\n *\n * @param context any {@link Context instance}\n * @param logger a {@link Logger} instances\n */\n public Cache(@NonNull C...
import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import android.content.Context; import android.os.FileObserver; import androidx.annotation.Nullable; import com.optimizely.ab.android.shared.Cache; import com.optimizely.ab.android.shared.Client; import com.optimiz...
/**************************************************************************** * Copyright 2017-2021, Optimizely, Inc. and contributors * * * * Licensed under the Apache License, Version 2.0 (the "License"); * * ...
new Cache(context, LoggerFactory.getLogger(Cache.class)),
0
redfin/fuzzy
fuzzy-core/src/test/java/com/redfin/fuzzy/cases/StringCaseTest.java
[ "public class Any {\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Case<T>... cases) {\n\t\treturn new UnionCase<>(cases);\n\t}\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Subcase<T>... subcases) { return Cases.of(subcases); }\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Supplier<T>... cases) { return...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import com.redfin.fuzzy.Any; import com.redfin.fuzzy.Case; import com.redfin.fuzzy.FuzzyUtil; import com.redfin.fuzzy.Literal; import com.redfin.fuzzy.Subcase; import java.util.Collections...
package com.redfin.fuzzy.cases; public class StringCaseTest { private Random random; @Before public void before() { random = new Random(12345); // keep tests consistent } @Test public void testDefaultConfig() { Case<String> subject = Any.string(); Set<Subcase<String>> subcases = subject.getSubcases();...
if(allCharsAreFrom(actual, FuzzyUtil.toCharSet("ABC"))) {
2
atam4j/atam4j
acceptance-tests/src/test/java/me/atam/atam4jsampleapp/FailingTestAcceptanceTest.java
[ "public class FailingTest {\n\n @Test\n public void testThatFails(){\n Assert.assertTrue(\"Was expecting false to be true\", false);\n }\n}", "public class PassingAndFailingTests {\n\n @Test\n public void testThatFails(){\n Assert.assertTrue(\"Was expecting false to be true\", false);...
import me.atam.atam4j.dummytests.FailingTest; import me.atam.atam4j.dummytests.PassingAndFailingTests; import me.atam.atam4jdomain.IndividualTestResult; import me.atam.atam4jdomain.TestsRunResult; import me.atam.atam4jsampleapp.testsupport.AcceptanceTest; import me.atam.atam4jsampleapp.testsupport.Atam4jApplicationStar...
package me.atam.atam4jsampleapp; public class FailingTestAcceptanceTest extends AcceptanceTest { @Test public void givenSampleApplicationStartedWithFailingTest_whenHealthCheckCalledAfterTestRun_thenFailuresMessageReceived(){ //given dropwizardTestSupportAppConfig = Atam4jApplicationStarter....
TestsRunResult testRunResult = response.readEntity(TestsRunResult.class);
3
EManual/EManual-Android
app/src/main/java/io/github/emanual/app/ui/fragment/ResourceCenterFragment.java
[ "public class EmanualAPI {\n /**\n * 下载对应的语言\n *\n * @param lang\n * @param responseHandler\n */\n @SuppressLint(\"DefaultLocale\") public static void downloadLang(String lang, AsyncHttpResponseHandler responseHandler) {\n RestClient.get(String.format(\"/md-%s/dist/%s.zip\", lang.to...
import android.annotation.SuppressLint; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import android.view.View; import andro...
break; case R.id.btn_python: lang = "python"; break; case R.id.btn_javascript: lang = "javascript"; break; case R.id.btn_c: lang = "c"; break; case R.id.btn_ang...
ZipUtils.unZipFiles(downloadFile.getAbsolutePath(), MD_PATH
5
serialx/kkma
src/org/snu/ids/ha/ma/MCandidate.java
[ "public class Condition\n\textends Hangul\n{\n\tpublic static final String[] COND_ARR = { \n\t\t\t\"ㅣ겹\", \t\t// 01 ㅣ겹모음 'ㅑ,ㅕ,ㅛ,ㅠ,ㅒ,ㅖ'\n\t\t\t\"모음\", \t\t// 02 마지막 음절이 종성을 가지지 않음\n\t\t\t\"자음\", \t\t// 03 마지막 음절이 종성을 가짐\n\t\t\t\"양성\", \t\t// 04 마지막 음절이 양성 모음\n\t\t\t\"음성\", \t\t// 05 마지막 음절이 음성 모음\n\t\t\t\"사오\", \t\t...
import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; import org.snu.ids.ha.constants.Condition; import org.snu.ids.ha.constants.POSTag; import org.snu.ids.ha.dic.Dictionary; import org.snu.ids.ha.dic.PDDictionary; import org.snu.ids.ha.dic.SpacingPDDictionary; import org.snu.ids.ha.util....
/** * <pre> * </pre> * @author therocks * @since 2007. 6. 4 */ package org.snu.ids.ha.ma; /** * <pre> * 표현형에 대한 하나의 형태소 분석 후보를 저장한다. * 분석 후보 형태소 목록에 덧붙여 접속 조건, 합성 조건 등의 부가 정보를 저장한다. * </pre> * @author therocks * @since 2007. 6. 4 */ public class MCandidate extends MorphemeList implements Comparable<...
return POSTag.getTagStr(atlEnc);
1
amao12580/BookmarkHelper
app/src/main/java/pro/kisscat/www/bookmarkhelper/converter/support/impl/BaiduBrowser.java
[ "public final class R {\n public static final class anim {\n public static final int abc_fade_in=0x7f050000;\n public static final int abc_fade_out=0x7f050001;\n public static final int abc_grow_fade_in_from_bottom=0x7f050002;\n public static final int abc_popup_enter=0x7f050003;\n ...
import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.support.v4.content.ContextCompat; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import lombok.Getter; import lombok.Setter; import pro.kissc...
package pro.kisscat.www.bookmarkhelper.converter.support.impl; /** * Created with Android Studio. * Project:BookmarkHelper * User:ChengLiang * Mail:stevenchengmask@gmail.com * Date:2016/1/16 * Time:17:46 */ public class BaiduBrowser extends BasicBrowser { private static final String TAG = "Baidu"; p...
private List<Bookmark> bookmarks;
2
zzz40500/ThemeDemo
baselibrary/src/main/java/com/dim/widget/CheckBox.java
[ "public class CircleRevealHelper {\n\n private ValueAnimator mValueAnimator;\n\n public CircleRevealHelper(View view) {\n mView = view;\n\n\n if (view instanceof CircleRevealEnable) {\n mCircleRevealEnable = (CircleRevealEnable) view;\n } else {\n throw new RuntimeEx...
import android.content.Context; import android.graphics.Canvas; import android.support.v7.widget.AppCompatCheckBox; import android.util.AttributeSet; import com.dim.circletreveal.CircleRevealHelper; import com.dim.circletreveal.CircleRevealEnable; import com.dim.listener.SingleClickListener; import com.dim.skin.SkinEna...
package com.dim.widget; /** * Created by zzz40500 on 15/8/26. */ public class CheckBox extends AppCompatCheckBox implements CircleRevealEnable,SkinEnable { private CircleRevealHelper mCircleRevealHelper ; private SkinHelper mSkinHelper; public CheckBox(Context context) { super(context); ...
public void setSkinStyle(SkinStyle skinStyle) {
4
turn/sorcerer
src/main/java/com/turn/sorcerer/pipeline/executable/impl/ScheduledPipeline.java
[ "public class SorcererInjector {\n\tprivate static final Logger logger =\n\t\t\tLoggerFactory.getLogger(SorcererInjector.class);\n\n\t// We use Guice as the underlying binder\n\tprivate Injector INJECTOR;\n\n\t/**\n\t * Singleton pattern. A single instance of Sorcerer runs per JVM.\n\t */\n\tprivate static Sorcerer...
import com.turn.sorcerer.injector.SorcererInjector; import com.turn.sorcerer.pipeline.executable.ExecutablePipeline; import com.turn.sorcerer.pipeline.type.PipelineType; import com.turn.sorcerer.status.Status; import com.turn.sorcerer.status.StatusManager; import java.util.Map; import com.google.common.collect.Maps; im...
/* * Copyright (c) 2015, Turn Inc. All Rights Reserved. * Use of this source code is governed by a BSD-style license that can be found * in the LICENSE file. */ package com.turn.sorcerer.pipeline.executable.impl; /** * Class Description Here * * @author tshiou */ public class ScheduledPipeline extends Exec...
protected ScheduledPipeline(int id, PipelineType t) {
2
Zerthick/PlayerShopsRPG
src/main/java/io/github/zerthick/playershopsrpg/cmd/cmdexecutors/shop/ShopCreateExecutor.java
[ "@Plugin(id = \"playershopsrpg\",\n name = \"PlayerShopsRPG\",\n description = \"A region-based player shop plugin.\",\n authors = {\n \"Zerthick\"\n }\n)\npublic class PlayerShopsRPG {\n\n private ShopManager shopManager;\n private EconManager econManager;\n priv...
import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.chat.ChatTypes; import org.spongepowered.api.text.format.TextColors; import ja...
/* * Copyright (C) 2016 Zerthick * * This file is part of PlayerShopsRPG. * * PlayerShopsRPG is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any ...
Optional<Region> regionOptional = regionBuffer.getRegion();
3
mauriciogracia/DGuitarSoftware
DGuitar/src/dguitar/codecs/midi/MidiOutputStream.java
[ "public class GPAdaptor {\r\n private static String className = GPAdaptor.class.toString();\r\n\r\n private static Logger logger = Logger.getLogger(className);\r\n\r\n // The following definition of pulses per quarter note is for high\r\n // resolution,\r\n // supporting up to dotted 128th notes and ...
import java.io.IOException; import java.io.OutputStream; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import javax.sound.midi.MidiEvent; import javax.sound.midi.MidiSystem; import javax.sound.midi.Sequence; import javax.sound.midi.Track; import dguitar.adaptors.guitarPro.GPAda...
/* * Created on Mar 19, 2005 */ package dguitar.codecs.midi; /** * @author Chris */ public class MidiOutputStream implements CodecOutputStream { OutputStream out; public MidiOutputStream(OutputStream out) { this.out = out; } public void close() throws IOExce...
song = GPAdaptor.makeSong(gpsong);
0
groupon/Selenium-Grid-Extras
SeleniumGridExtras/src/main/java/com/groupon/seleniumgridextras/tasks/StartGrid.java
[ "public class BrowserVersionDetector {\n\n// TODO: Dima finish this when you have some free time. Good idea but using classloader is a bad ide\n// TODO: Java is not good with dynamic jar loading in way you want. Instead go with a mini grid with 1\n// TODO: node and do all of the stuff via simple HTTP calls, CURL...
import com.google.gson.JsonObject; import com.groupon.seleniumgridextras.browser.BrowserVersionDetector; import com.groupon.seleniumgridextras.config.GridNode; import com.groupon.seleniumgridextras.config.RuntimeConfig; import com.groupon.seleniumgridextras.config.capabilities.Capability; import com.groupon.seleniumgri...
/** * Copyright (c) 2013, Groupon, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditi...
return GridStarter.startAllNodes(getJsonResponse());
4
antag99/aquarria
aquarria/src/com/github/antag99/aquarria/entity/PlayerEntity.java
[ "public enum Direction {\n\t// Note that the order is important\n\tNORTH(0, 1),\n\tNORTHEAST(1, 1),\n\tEAST(1, 0),\n\tSOUTHEAST(1, -1),\n\tSOUTH(0, -1),\n\tSOUTHWEST(-1, -1),\n\tWEST(-1, 0),\n\tNORTHWEST(-1, 1);\n\n\tprivate static Direction[] values = values();\n\n\tprivate final int horizontal;\n\tprivate final i...
import com.badlogic.gdx.Input; import com.badlogic.gdx.math.Vector2; import com.github.antag99.aquarria.Direction; import com.github.antag99.aquarria.GameRegistry; import com.github.antag99.aquarria.Inventory; import com.github.antag99.aquarria.Item; import com.github.antag99.aquarria.world.World; import com.badlogic.g...
/******************************************************************************* * Copyright (c) 2014-2015, Anton Gustafsson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistri...
for (Direction direction : Direction.values()) {
0
Leaking/WeGit
app/src/main/java/com/quinn/githubknife/interactor/RepoInteractorImpl.java
[ "public class GitHubAccount {\n\n\n private static final String TAG = \"GitHubAccount\";\n\n public static final String ACCOUNT_TYPE = \"com.githubknife\";\n\n private final Account account;\n\n private final AccountManager manager;\n\n private volatile static GitHubAccount instance;\n\n private C...
import android.content.Context; import android.util.Log; import com.quinn.githubknife.R; import com.quinn.githubknife.account.GitHubAccount; import com.quinn.githubknife.listener.OnLoadRepoListener; import com.quinn.githubknife.model.GithubService; import com.quinn.githubknife.model.RetrofitUtil; import com.quinn.httpk...
package com.quinn.githubknife.interactor; /** * Created by Quinn on 8/1/15. */ public class RepoInteractorImpl implements RepoInteractor{ private final static String TAG = RepoInteractorImpl.class.getSimpleName(); private final static int STAR_STATE = 1; private final static int FAIL = 2; privat...
this.service = RetrofitUtil.getJsonRetrofitInstance(context).create(GithubService.class);
3
saltedge/saltedge-android
saltedge-library/src/androidTest/java/com/saltedge/sdk/connector/PendingTransactionConnectorTest.java
[ "public class SaltEdgeSDK {\n\n private static SaltEdgeSDK instance;\n private Context applicationContext;\n private String appId;\n private String appSecret;\n private String returnToUrl;\n private boolean loggingEnabled;\n\n public static SaltEdgeSDK getInstance() {\n if (instance == n...
import androidx.test.InstrumentationRegistry; import androidx.test.runner.AndroidJUnit4; import com.saltedge.sdk.SaltEdgeSDK; import com.saltedge.sdk.TestTools; import com.saltedge.sdk.interfaces.FetchTransactionsResult; import com.saltedge.sdk.model.SETransaction; import com.saltedge.sdk.network.SEApiInterface; import...
/* Copyright © 2019 Salt Edge. https://saltedge.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publis...
SETransaction transaction = transactionsList.get(0);
3
quhfus/DoSeR-Disambiguation
doser-dis-disambiguationserver/src/main/java/doser/server/actions/disambiguation/DisambiguationService.java
[ "public final class DisambiguationMainService {\n\n\tpublic final static int MAXCLAUSECOUNT = 4096;\n\n\tprivate static final int TIMERPERIOD = 10000;\n\n\tprivate static DisambiguationMainService instance = null;\n\n//\tprivate Model hdtdbpediaCats;\n//\tprivate Model hdtdbpediaCats_ger;\n//\tprivate Model hdtdbpe...
import java.util.LinkedList; import java.util.List; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bi...
package doser.server.actions.disambiguation; @Controller @RequestMapping("/disambiguation") public class DisambiguationService { public DisambiguationService() { super(); } /** * Testing * * @param request * @return */ @RequestMapping(value = "/disambiguateWithoutCategories-single", method = Requ...
final List<AbstractDisambiguationTask> tasks = new LinkedList<AbstractDisambiguationTask>();
1
ailab-uniud/distiller-CORE
src/main/java/it/uniud/ailab/dcore/annotation/annotators/ItalianLemmatizerAnnotator.java
[ "public class Blackboard {\r\n\r\n /**\r\n * The default document identifier.\r\n */\r\n private static final String DEFAULT_DOCUMENT_ID = \"DocumentRoot\";\r\n\r\n /**\r\n * The full raw text of the document.\r\n */\r\n private String rawText;\r\n\r\n /**\r\n * The root block of ...
import it.uniud.ailab.dcore.Blackboard; import it.uniud.ailab.dcore.annotation.Annotator; import it.uniud.ailab.dcore.persistence.DocumentComponent; import it.uniud.ailab.dcore.persistence.Sentence; import it.uniud.ailab.dcore.persistence.Token; import it.uniud.ailab.dcore.utils.DocumentUtils; import it.uniud.ailab.dco...
/* * Copyright (C) 2016 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 (Sentence s : DocumentUtils.getSentences(component)) {
3
fabioCollini/LifeCycleBinder
lifecyclebinder-processor/src/main/java/it/codingjam/lifecyclebinder/ElementsCollector.java
[ "public class EventMethodElement {\n private static final ClassName EVENT_CLASS_NAME = ClassName.get(LifeCycleEvent.class);\n public final ExecutableElement element;\n public final LifeCycleEvent[] events;\n public final TypeName viewTypeName;\n\n public EventMethodElement(ExecutableElement element) ...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.TypeName; import it.codingjam.lifecyclebinder.data.EventMethodElement; import it.codingjam.lifecyclebinder.data.LifeCycleAwareInfo; import it.codingjam.lifecyclebinder.data.NestedLifeCycleAwareInfo; import it.codingjam.lifecyclebinder.data.RetainedObj...
/* * Copyright 2016 Fabio Collini. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
info.eventsElements.add(new EventMethodElement((ExecutableElement) element));
0
alda-lang/alda-client-java
src/alda/repl/commands/ReplList.java
[ "public class AldaClient {\n private static UnsuccessfulException unexpectedAldaApiResponseError(\n JsonObject json\n ) {\n return new UnsuccessfulException(\"Unexpected Alda API response: \" + json);\n }\n\n public static void updateAlda()\n throws SystemException, UnsuccessfulException {\n String ...
import alda.AldaClient; import alda.AldaResponse.AldaScore; import alda.AldaServer; import alda.AldaServerOptions; import alda.error.NoResponseException; import alda.error.SystemException; import java.util.function.Consumer; import jline.console.ConsoleReader;
package alda.repl.commands; public class ReplList implements ReplCommand { private static int LIST_PROCESSES_TIMEOUT = 5000; @Override public void act(String args, StringBuffer history, AldaServer server, ConsoleReader reader, Consumer<AldaScore> newInstrument) throws NoResponseException ...
AldaServerOptions serverOpts = new AldaServerOptions();
3
janishar/JPost
java-jpost/src/main/java/com/mindorks/javajpost/JPost.java
[ "public interface Broadcast<C extends Channel<? extends PriorityBlockingQueue<? extends WeakReference<? extends ChannelPost>>,\n ? extends ConcurrentHashMap<? extends Integer,? extends WeakReference<?>>>> {\n\n int CHANNEL_INITIAL_CAPACITY = 5;\n\n /**\n *\n * @param owner it is the owner of th...
import java.util.concurrent.locks.ReentrantLock; import com.mindorks.jpost.core.Broadcast; import com.mindorks.jpost.core.BroadcastCenter; import com.mindorks.jpost.core.Channel; import com.mindorks.jpost.core.ChannelPost; import com.mindorks.jpost.core.ChannelState; import com.mindorks.jpost.core.ChannelType; import c...
/* * Copyright (C) 2016 Janishar Ali Anwar * * 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...
private static ConcurrentHashMap<Integer, Channel<PriorityBlockingQueue<WeakReference<ChannelPost>>,
3