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 |
|---|---|---|---|---|---|---|
emergentdotorg/shaman | src/org/emergent/android/weave/syncadapter/NetworkUtilities.java | [
"public class ShamanApplication extends Application implements Constants.Implementable {\n\n private static ShamanApplication sm_instance;\n\n @Override\n public void onCreate() {\n super.onCreate();\n sm_instance = this;\n }\n\n public static ShamanApplication getInstance() {\n return sm_instance;\n ... | import java.net.URISyntaxException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import android.content.Context;
import android.content.SharedPreferences;
import org.emergent.android.weave.ShamanApplication;
import org.emergent.android.weave.StaticUtils;
import org.emergent.android.weave.client.... | /*
* Copyright 2010 Patrick Woodworth
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | return prefs.getBoolean(PrefKey.allcerts.name(), WeaveConstants.ALLOW_INVALID_CERTS_DEFAULT); | 3 |
peshkira/c3po | c3po-core/src/test/java/com/petpet/c3po/dao/MongoPersistenceLayerTest.java | [
"public class Element implements Model {\n\n /**\n * A back-end related identifier of this object.\n */\n private String id;\n\n /**\n * The collection to which the current element belongs.\n */\n private String collection;\n\n /**\n * Some non-unique name of this element.\n */\n private String na... | import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import ... | /*******************************************************************************
* Copyright 2013 Petar Petrov <me@petarpetrov.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | Iterator<Element> find = pLayer.find(Element.class, new Filter(new FilterCondition("uid", "test1"))); | 2 |
noctarius/snowcast | src/main/java/com/noctarius/snowcast/impl/ClientSnowcast.java | [
"@ThreadSafe\npublic interface Snowcast {\n\n /**\n * Creates a {@link com.noctarius.snowcast.SnowcastSequencer} or returns an already existing\n * instance based on the given sequencerName and custom epoch. This method is fully thread-safe\n * and safe to be called concurrently.<br>\n * This ope... | import static com.noctarius.snowcast.impl.ExceptionMessages.RETRIEVE_CLIENT_ENGINE_FAILED;
import static com.noctarius.snowcast.impl.ExceptionMessages.UNKNOWN_HAZELCAST_VERSION;
import static com.noctarius.snowcast.impl.ExceptionUtils.exception;
import static com.noctarius.snowcast.impl.InternalSequencerUtils.printStar... | /*
* Copyright (c) 2015-2017, Christoph Engelbert (aka noctarius) and
* contributors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | public SnowcastSequencer createSequencer(@Nonnull String sequencerName, @Nonnull SnowcastEpoch epoch) { | 1 |
cornelcreanga/bitbucket-rest-client | src/main/java/com/ccreanga/bitbucket/rest/client/http/SshClientRest.java | [
"public class Range {\n\n private int start;\n private int limit;\n\n public Range(int start, int limit) {\n if (start < 0)\n throw new IllegalArgumentException(\"start should be greater than 0 not:\" + start);\n if (limit < 0)\n throw new IllegalArgumentException(\"limi... | import com.ccreanga.bitbucket.rest.client.Range;
import com.ccreanga.bitbucket.rest.client.SshClient;
import com.ccreanga.bitbucket.rest.client.model.Page;
import com.ccreanga.bitbucket.rest.client.model.RepositorySshKey;
import com.ccreanga.bitbucket.rest.client.http.responseparsers.Parsers;
import com.ccreanga.bitbuc... | /*
*
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writ... | public Page<RepositorySshKey> getRepositoryKeys(String projectKey, String repositorySlug, Range range) { | 3 |
jahlborn/rmiio | src/main/java/com/healthmarketscience/rmiio/socket/RMISocket.java | [
"public interface RemoteClient {\n\n /** The default retry policy used if none is specified by the client. */\n public static final RemoteRetry DEFAULT_RETRY = RemoteRetry.SIMPLE; \n \n /**\n * Sets the client side RemoteRetry policy to use for the underlying remote\n * communication layer. For most clien... | import com.healthmarketscience.rmiio.SimpleRemoteOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.Serializable;
import com.healthmarketscience.rmiio.RemoteClient;... | /*
Copyright (c) 2012 James Ahlborn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | RmiioUtil.closeQuietly(_in); | 5 |
fredg02/se.bitcraze.crazyflie.lib | se.bitcraze.crazyflie.lib.examples/src/main/java/se/bitcraze/crazyflie/lib/examples/ParamExample.java | [
"public class Crazyflie {\n\n private final Logger mLogger = LoggerFactory.getLogger(this.getClass().getSimpleName());\n\n private CrtpDriver mDriver;\n private Thread mIncomingPacketHandlerThread;\n\n private LinkedBlockingDeque<CrtpPacket> mResendQueue = new LinkedBlockingDeque<>();\n private Threa... | import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import se.bitcraze.crazyflie.lib.crazyflie.ConnectionAdapter;
import se.bitcraze.crazyflie.lib.crazyflie.Crazyflie;
import se.bitcraze.crazyflie.lib.crazyradio.ConnectionData;
imp... | package se.bitcraze.crazyflie.lib.examples;
/**
* Simple example that connects to the Crazyflie on the given channel and data rate.
* It triggers reading of all the parameters and displays their values. It then modifies
* one parameter and reads back it's value. Finally it disconnects.
*/
public class ParamExamp... | final Toc paramToc = this.mCrazyflie.getParam().getToc(); | 3 |
msteiger/jxmapviewer2 | jxmapviewer2/src/main/java/org/jxmapviewer/JXMapKit.java | [
"public class CenterMapListener extends MouseAdapter\n{\n private JXMapViewer viewer;\n \n /**\n * @param viewer the jxmapviewer\n */\n public CenterMapListener(JXMapViewer viewer)\n {\n this.viewer = viewer;\n }\n\n @Override\n public void mousePressed(MouseEvent evt)\n {\... | import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.geom.Point2D;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.HashSet;
import java.util.Set;
import javax.swing.AbstractAction;
imp... | /*
* JXMapKit.java
*
* Created on November 19, 2006, 3:52 AM
*/
package org.jxmapviewer;
/**
* <p>The JXMapKit is a pair of JXMapViewers preconfigured to be easy to use
* with common features built in. This includes zoom buttons, a zoom slider,
* and a mini-map in the lower right corner showi... | MouseInputListener mia = new PanMouseInputListener(mainMap);
| 1 |
xuyunqiang/MeiziAPP | app/src/main/java/com/yunq/gankio/ui/activity/GirlFaceActivity.java | [
"public class GankApp extends Application {\n\n private RefWatcher refWatcher;\n\n ApplicationComponent mApplicationComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n refWatcher = LeakCanary.install(this);\n\n if (BuildConfig.DEBUG) {\n //警告在主线程中执行耗... | import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import com.yunq.gankio.GankApp;
import com.yunq.gankio.R;
import com.yunq.gankio.injection.component.DaggerGirlFaceActivityComponen... | package com.yunq.gankio.ui.activity;
public class GirlFaceActivity extends BaseActivity implements IGirlFaceView {
private static final String EXTRA_BUNDLE_URL = "BUNDLE_URL";
private static final String EXTRA_BUNDLE_TITLE = "BUNDLE_TITLE";
@Bind(R.id.iv_girl_detail)
ImageView mIvGrilDetail;
... | ToastUtils.showShort(this, message); | 5 |
DDoS/JICI | src/main/java/ca/sapon/jici/evaluator/member/ArrayLengthVariable.java | [
"public class LiteralReferenceType extends SingleReferenceType implements LiteralType, TypeArgument {\n public static final LiteralReferenceType THE_STRING = LiteralReferenceType.of(String.class);\n public static final LiteralReferenceType THE_OBJECT = LiteralReferenceType.of(Object.class);\n public static... | import java.lang.reflect.Array;
import ca.sapon.jici.evaluator.type.LiteralReferenceType;
import ca.sapon.jici.evaluator.type.PrimitiveType;
import ca.sapon.jici.evaluator.type.Type;
import ca.sapon.jici.evaluator.value.IntValue;
import ca.sapon.jici.evaluator.value.Value; | /*
* This file is part of JICI, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software... | return PrimitiveType.THE_INT; | 1 |
realrolfje/anonimatron | src/main/java/com/rolfje/anonimatron/file/FileAnonymizerService.java | [
"public class AnonymizerService {\n\tprivate static final Logger LOG = Logger.getLogger(AnonymizerService.class);\n\n\tprivate Map<String, Anonymizer> customAnonymizers = new HashMap<>();\n\tprivate Map<String, String> defaultTypeMapping = new HashMap<>();\n\n\tprivate SynonymCache synonymCache;\n\n\tprivate Set<St... | import com.rolfje.anonimatron.anonymizer.AnonymizerService;
import com.rolfje.anonimatron.configuration.Column;
import com.rolfje.anonimatron.configuration.Configuration;
import com.rolfje.anonimatron.configuration.DataFile;
import com.rolfje.anonimatron.progress.Progress;
import com.rolfje.anonimatron.progress.Progres... | package com.rolfje.anonimatron.file;
/**
* Reads rows from a file and returns anonymized rows.
*/
public class FileAnonymizerService {
private final Logger LOG = Logger.getLogger(FileAnonymizerService.class);
private Configuration config;
private AnonymizerService anonymizerService; | private Progress progress; | 4 |
NickAcPT/Lithium-Forge | src/main/java/net/nickac/lithium/frontend/mod/ui/renders/SliderRenderer.java | [
"public class LithiumMessage implements IMessage {\n\n\tprivate String text;\n\n\t// used for reflective Instantiation\n\tpublic LithiumMessage(){\n\n\t}\n\n\tpublic LithiumMessage(String text) {\n\t\tthis.text = text;\n\t}\n\n\tpublic String getText() {\n\t\treturn text;\n\t}\n\n\tpublic void setText(String text) ... | import net.nickac.lithium.backend.other.LithiumConstants;
import net.nickac.lithium.backend.other.objects.Point;
import net.nickac.lithium.backend.other.objects.Rectangle;
import net.nickac.lithium.backend.other.rendering.ILithiumControlRenderer;
import net.nickac.lithium.frontend.mod.network.LithiumMessage;
import net... | /*
* MIT License
*
* Copyright (c) 2017 NickAc
*
* 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, m... | ModCoderPackUtils.playButtonPressSound(); | 4 |
idega/com.idega.block.cal | src/java/com/idega/block/cal/business/CalServiceBean.java | [
"public class CalendarManagerBean implements Serializable {\n\n\tprivate static final long serialVersionUID = 2479903618028715269L;\n\t\n\tprivate Map<String, CalendarPropertiesBean> calendarProperties = null;\n\t\n\tpublic CalendarManagerBean() {\n\t\tcalendarProperties = new HashMap<String, CalendarPropertiesBean... | import java.rmi.RemoteException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.ejb.FinderException;
import javax.faces.component.UIComponent;
import javax.servlet.ServletCo... | package com.idega.block.cal.business;
public class CalServiceBean implements CalService {
private CalBusiness calBusiness = null;
private GroupService groupService = null;
private GroupBusiness groupBusiness = null;
private String calendarCacheName = "calendarViewersUniqueIdsCache";
private String eventsCac... | private CalendarManagerBean getBean() { | 0 |
mitoma/kashiki | src/main/java/in/tombo/kashiki/EditorImpl.java | [
"public class Buffer {\n\n private String bufferName;\n\n private CaretHandler caretHandler = new CaretHandlerImpl(this);\n private Caret mark = new Caret(0, 0);\n private List<BufferLine> lines = new ArrayList<BufferLine>();\n private BufferObserver observer = new BufferObserver();\n\n public Buffer(String b... | import java.awt.Frame;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.util.ArrayList;
import java.util.List;
import in.tombo.kashiki.buffer.Buffer;
import in.tombo.kashiki.buffer.BufferRepository;
import in.tombo.kashiki.view.Base;
import in.tombo.kashiki.view.BufferView;
import in.tom... | package in.tombo.kashiki;
public class EditorImpl implements Editor {
private Buffer currentBuffer;
private List<Buffer> buffers = new ArrayList<>(); | private List<Base> currentDrawables = new ArrayList<>(); | 2 |
wakaleo/maven-schemaspy-plugin | src/main/java/net/sourceforge/schemaspy/view/HtmlTablePage.java | [
"public class Config\r\n{\r\n private static Config instance;\r\n private final List<String> options;\r\n private Map<String, String> dbSpecificOptions;\r\n private Map<String, String> originalDbSpecificOptions;\r\n private boolean helpRequired;\r\n private boolean dbHelpRequired;\r\n private F... | import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import net.sourceforge.schemaspy.Config;
import net.sourceforge.schemaspy.model.D... | /*
* This file is a part of the SchemaSpy project (http://schemaspy.sourceforge.net).
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 John Currier
*
* SchemaSpy is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by th... | public WriteStats write(Database db, Table table, boolean hasOrphans, File outputDir, WriteStats stats, LineWriter out) throws IOException {
| 2 |
raphaelcohn/java2c | source/transpiler/com/stormmq/java2c/transpiler/javaModules/JavaModuleCompiler.java | [
"public final class CodeTreeAnalyzerProcessor extends AbstractTreeAnalyzerProcessor\n{\n\t@NotNull private final Warnings warnings;\n\t@NotNull private final Map<ElementKind, ElementConverter<?>> topLevelConverters;\n\n\t@Nullable private Trees trees;\n\n\tpublic CodeTreeAnalyzerProcessor(@NotNull final Warnings wa... | import com.stormmq.java2c.transpiler.annotationProcessors.CodeTreeAnalyzerProcessor;
import com.stormmq.java2c.transpiler.conversion.CFileCreator;
import com.stormmq.java2c.transpiler.conversion.CMaker;
import com.stormmq.java2c.transpiler.conversion.elementConverters.TopLevelClassElementConverter;
import com.stormmq.j... | package com.stormmq.java2c.transpiler.javaModules;
public final class JavaModuleCompiler
{
@NotNull private final JavaCompiler javaCompiler;
@NotNull private final Locale locale;
@NotNull private final Path sourcePath;
@NotNull private final Warnings warnings;
@NotNull private final StandardJavaFileManager fil... | fileManager = javaCompiler.getStandardFileManager(this.warnings, locale, Utf8); | 5 |
notem/Saber-Bot | src/main/java/ws/nmathe/saber/commands/general/SkipCommand.java | [
"public class Main\n{\n private static ShardManager shardManager;\n private static BotSettingsManager botSettingsManager = new BotSettingsManager();\n private static EntryManager entryManager = new EntryManager();\n private static ScheduleManager scheduleManager = new Sched... | import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import ws.nmathe.saber.Main;
import ws.nmathe.saber.commands.Command;
import ws.nmathe.saber.commands.CommandInfo;
import ws.nmathe.saber.core.schedule.ScheduleEntry;
import ws.nmathe.saber.utils.Logging;
import ws.nmathe.saber.utils.MessageUtilities;
impo... | package ws.nmathe.saber.commands.general;
/**
* used for generating the list of valid timezone strings
*/
public class SkipCommand implements Command
{
@Override
public String name()
{
return "skip";
}
@Override
public CommandInfo info(String prefix)
{
String head = pre... | MessageUtilities.sendMsg(content, event.getTextChannel(), null); | 5 |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/source/files/FilesConfigurationSource.java | [
"public interface ConfigurationSource {\n\n /**\n * Get configuration set for a given {@code environment} from this source in a form of {@link Properties}.\n * Provided {@link Environment} will be used to determine which environment to use.\n *\n * @param environment environment to use\n * @return config... | import static java.util.Objects.requireNonNull;
import org.cfg4j.source.ConfigurationSource;
import org.cfg4j.source.context.environment.Environment;
import org.cfg4j.source.context.environment.MissingEnvironmentException;
import org.cfg4j.source.context.filesprovider.ConfigFilesProvider;
import org.cfg4j.source.contex... | /*
* Copyright 2015-2018 Norbert Potocki (norbert.potocki@nort.pl)
*
* 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 ... | new PropertyBasedPropertiesProvider(), new YamlBasedPropertiesProvider(), new JsonBasedPropertiesProvider() | 8 |
freme-project/freme-ner | src/main/java/org/elinker/core/api/java/FremeLabelMatch.java | [
"@Service\npublic class FremeEntityLinker {\n\n @Value(\"${freme.ner.solrURI:}\")\n private String solrURI;\n\n\n public List<Result> link(List<String> datasets, Integer topN, String language, List<Result> entities) {\n\n QueryBuilder queryBuilder = new QueryBuilder(datasets, language);\n Sol... | import lombok.RequiredArgsConstructor;
import org.ahocorasick.trie.Emit;
import org.elinker.core.api.process.Result;
import org.elinker.core.link.FremeEntityLinker;
import org.elinker.core.rest.FremeRequest;
import org.elinker.core.spotter.FremeSpotter;
import org.nlp2rdf.NIFWrapper;
import org.springframework.beans.fa... | package org.elinker.core.api.java;
@Service
@RequiredArgsConstructor
public class FremeLabelMatch {
@Autowired
private FremeSpotter spotter;
@Autowired
private FremeEntityLinker fremeEntityLinker;
| public String annotate(FremeRequest request) { | 1 |
killbill/killbill-meter-plugin | src/test/java/org/killbill/billing/plugin/meter/timeline/TestInMemoryEventHandler.java | [
"public interface MeterConfig {\n\n @Config(\"org.killbill.billing.plugin.meter.timelines.length\")\n @Description(\"How long to buffer data in memory before flushing it to the database\")\n @Default(\"60m\")\n TimeSpan getTimelineLength();\n\n // This is used to predict the number of samples between... | import org.killbill.billing.plugin.meter.timeline.times.TimelineCoder;
import org.skife.config.ConfigurationObjectFactory;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
import java.io.File;
import java.util.Map;
i... | /*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/lice... | new FileBackedBuffer(config.getSpoolDir(), "TimelineEventHandler", 1024 * 1024, 10)); | 2 |
XiaokangLei/ImageRetrieval | src/image/identification/PHash.java | [
"public class AmplificatingShrinking {\n\t\n\t/**\n\t * 双线性插值法图像的放大\n\t * @param srcPath\n\t * @param distPath\n\t * @param formatName\n\t * @param k1\n\t * @param k2\n\t */\n\tpublic static void bilinearityInterpolation(String srcPath, String distPath,\n\t\t\tString formatName, float k1, float k2) {\n\t\tBufferedI... | import image.AmplificatingShrinking;
import image.ImageDecorator;
import image.ImageDigital;
import image.ImageProcessing;
import image.sharpening.EdgeDetection;
import image.sharpening.Sobel;
import image.transformation.DCT;
import java.awt.image.BufferedImage; | package image.identification;
/**
* 指纹识别图像
*
* @author Administrator
*
*/
public class PHash extends FingerIdentification {
@Override
public long getCharacteristicValue(int[] pix, int w, int h) {
pix = AmplificatingShrinking.shrink(pix, w, h, DCTW, DCTH);
pix = ImageDigital.grayImage(pix, DCTW, DCTH);
... | ImageDecorator sboel = new Sobel(); | 5 |
games647/FastLogin | velocity/src/main/java/com/github/games647/fastlogin/velocity/listener/ConnectListener.java | [
"@FunctionalInterface\npublic interface RateLimiter {\n\n boolean tryAcquire();\n}",
"public class StoredProfile extends Profile {\n\n private long rowId;\n private final ReentrantLock saveLock = new ReentrantLock();\n\n private boolean premium;\n private String lastIp;\n private Instant lastLog... | import com.github.games647.craftapi.UUIDAdapter;
import com.github.games647.fastlogin.core.RateLimiter;
import com.github.games647.fastlogin.core.StoredProfile;
import com.github.games647.fastlogin.core.shared.LoginSession;
import com.github.games647.fastlogin.velocity.FastLoginVelocity;
import com.github.games647.fast... | /*
* SPDX-License-Identifier: MIT
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2021 <Your name and contributors>
*
* 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 restric... | Runnable asyncPremiumCheck = new AsyncPremiumCheck(plugin, connection, username, continuation, preLoginEvent); | 3 |
LegendOnline/InventoryAPI | src/main/java/com/minecraftlegend/inventoryapi/Elements/GUISubContainer.java | [
"public class ComponentClickEvent implements EventWrapper {\n\n private GUIContainer gui;\n private GUIComponent component;\n private ItemStack item, cursor;\n private HumanEntity player;\n private Inventory clickedInventory;\n private ClickType click;\n private int slot, rawSlot;\n\n public... | import com.minecraftlegend.inventoryapi.Events.ComponentClickEvent;
import com.minecraftlegend.inventoryapi.Events.ContainerCloseEvent;
import com.minecraftlegend.inventoryapi.GUIContainer;
import com.minecraftlegend.inventoryapi.GUIEvent;
import com.minecraftlegend.inventoryapi.GUILayout;
import com.minecraftlegend.in... |
if ( child != null ) {
child.setParent( this );
if ( useNextButton ) {
add( nextButton );
nextButton.addEvent( new GUIEvent() {
@Override
public void onClick( ComponentClickEvent event ) {
dr... | exitButton.setPosition( new Vector2i( 8, 0 ) ); | 6 |
TechzoneMC/NPCLib | nms-v1_9_R1/src/main/java/net/techcable/npclib/nms/versions/v1_9_R1/HumanNPCHook.java | [
"@RequiredArgsConstructor\npublic enum Animation {\n /**\n * Makes the npc act hurt\n * <p/>\n * Only applicable to living entities\n */\n HURT,\n /**\n * Makes the npc lie on the ground\n * <p/>\n * Only applicable to living entities\n */\n DEAD,\n\n // Human Animatio... | import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.UUID;
import net.minecraft.server.v1_9_R1.EntityPlayer;
import net.minecraft.server.v1_9_R1.Packet;
import net.minecraft.server.v1_9_R1.PacketPlayOutAnimation;
import net.minecraft.server.v1_9_R1.PacketPlayOutPlayerInfo;
import net.mine... | package net.techcable.npclib.nms.versions.v1_9_R1;
public class HumanNPCHook extends LivingNPCHook implements IHumanNPCHook {
public HumanNPCHook(HumanNPC npc, Location toSpawn) {
super(npc, toSpawn, EntityType.PLAYER);
getNmsEntity().setHook(this);
}
@Override
public void setSkin... | private static final Field nameField = Reflection.makeField(GameProfile.class, "name"); | 4 |
kaif-open/kaif-android | app/src/main/java/io/kaif/mobile/view/ArticleListAdapter.java | [
"public class Article implements Serializable {\n\n public enum ArticleType {\n EXTERNAL_LINK, SPEAK\n }\n\n private final String zone;\n\n private final String zoneTitle;\n\n private final String articleId;\n\n private final String title;\n\n private final Date createTime;\n\n private final String link;... | import android.content.Context;
import android.net.Uri;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import butterkn... | package io.kaif.mobile.view;
public class ArticleListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
public interface OnItemClickListener {
void onItemClick(ArticleViewModel item);
}
public interface OnItemVoteClickListener {
void onItemVoteClick(View view, Vote.VoteState from, Vote.... | if (article.getArticleType() == Article.ArticleType.EXTERNAL_LINK) { | 0 |
memfis19/Annca | app/src/main/java/io/github/memfis19/sample/CustomCamera2Activity.java | [
"public final class AnncaConfiguration {\n\n public static final int MEDIA_QUALITY_AUTO = 10;\n public static final int MEDIA_QUALITY_LOWEST = 15;\n public static final int MEDIA_QUALITY_LOW = 11;\n public static final int MEDIA_QUALITY_MEDIUM = 12;\n public static final int MEDIA_QUALITY_HIGH = 13;\... | import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.Toast;
import io.github.memfis19.annca.internal.configuration.AnncaConfiguration;
import io.github.memfis19.annca.internal.configuration.C... | package io.github.memfis19.sample;
/**
* Created by memfis on 2/7/17.
*/
public class CustomCamera2Activity extends AnncaCameraActivity<String> {
private static final int REQUEST_CODE = 404;
@AnncaConfiguration.MediaAction
private static final int PHOTO = AnncaConfiguration.MEDIA_ACTION_PHOTO;
... | return CameraSwitchView.CAMERA_TYPE_REAR; | 6 |
researchgate/restler | restler-core/src/main/java/net/researchgate/restdsl/model/ServiceModel.java | [
"public interface PersistentServiceDao<V, K> extends BaseServiceDao<V, K>, EntityLifecycleListener<V, K> {\n\n /**\n * @param serviceQuery service query\n * @return number of deleted entries\n */\n int delete(ServiceQuery<K> serviceQuery) throws RestDslException;\n\n\n /**\n * @param entity... | import net.researchgate.restdsl.dao.PersistentServiceDao;
import net.researchgate.restdsl.domain.EntityInfo;
import net.researchgate.restdsl.exceptions.RestDslException;
import net.researchgate.restdsl.queries.PatchContext;
import net.researchgate.restdsl.queries.ServiceQuery;
import net.researchgate.restdsl.util.BeanU... | package net.researchgate.restdsl.model;
/**
* This model exposes full CRUD.
* Use this if you want simply want to expose the mongo operations via REST.
* If you have more challenging businessLogic, consider using {@link BaseServiceModel} and implement
* write operations yourself.
*
* @param <V> Type of the ent... | public V patch(V entity, PatchContext patchContext) throws RestDslException { | 3 |
iacobcl/MARA | src/logic/analysis/RefinedCodesStatsAnalysis.java | [
"public class CodeDistr \r\n{\r\n\r\n\tprivate String code;\r\n\tprivate int total;\r\n\tprivate double perc;\r\n\tprivate int totalrel;\r\n\tprivate double percrel;\r\n\t\r\n\tpublic CodeDistr()\r\n\t{\r\n\t\tcode = new String();\r\n\t\ttotal = 0;\r\n\t\tperc = 0;\r\n\t\ttotalrel = 0;\r\n\t\tpercrel = 0;\r\n\t}\r\... | import java.util.ArrayList;
import objs.CodeDistr;
import objs.stats.RefCodeStats;
import objs.stats.reports.ReportClassCodeStats;
import storage.DBQuerying;
import storage.FileStoring;
| /*
# 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 ... | String[] refcodes = FileStoring.loadCodes(cc);
| 4 |
davemckain/jacomax | jacomax/src/main/java/uk/ac/ed/ph/jacomax/internal/MaximaProcessController.java | [
"public class JacomaxLogicException extends JacomaxRuntimeException {\n\n private static final long serialVersionUID = 7100573731627419599L;\n\n public JacomaxLogicException(final String message) {\n super(message);\n }\n\n public JacomaxLogicException(final Throwable cause) {\n super(caus... | import uk.ac.ed.ph.jacomax.JacomaxLogicException;
import uk.ac.ed.ph.jacomax.JacomaxRuntimeException;
import uk.ac.ed.ph.jacomax.MaximaInteractiveProcess;
import uk.ac.ed.ph.jacomax.MaximaProcessLauncher;
import uk.ac.ed.ph.jacomax.MaximaProcessTerminatedException;
import uk.ac.ed.ph.jacomax.MaximaTimeoutException;
imp... | /* Copyright (c) 2010 - 2012, The University of Edinburgh.
* 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
... | throw new MaximaProcessTerminatedException(); | 4 |
alexmojaki/boxes | src/test/java/alex/mojaki/boxes/test/ViewTest.java | [
"public class BoxFamily {\n\n private static final InstanceStore<BoxFamily> INSTANCE_STORE = new InstanceStore<BoxFamily>() {\n @Override\n public BoxFamily getNew(Object... args) {\n return new BoxFamily((Class<?>) args[0], (String) args[1]);\n }\n };\n\n private final Stri... | import alex.mojaki.boxes.BoxFamily;
import alex.mojaki.boxes.CommonBox;
import alex.mojaki.boxes.PowerBox;
import alex.mojaki.boxes.middleware.get.GetMiddleware;
import alex.mojaki.boxes.observers.change.ChangeObserver;
import alex.mojaki.boxes.View;
import alex.mojaki.boxes.observers.get.GetObserver;
import org.junit.... | package alex.mojaki.boxes.test;
public class ViewTest {
@Rule
public ExpectedException exception = ExpectedException.none();
private class Product extends View<Integer> {
private final PowerBox<Integer> x;
private final PowerBox<Integer> y;
public Product(PowerBox<Integer> x,... | }).addGetObserver(new GetObserver() { | 6 |
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... | private GitHubAccount gitHubAccount; | 0 |
mozvip/sports-predictions | predictor/src/main/java/predictions/PredictionsApplication.java | [
"public class FootballDataClient {\n\n public static final class Builder {\n\n private String apiKey;\n\n private Builder(String apiKey) {\n this.apiKey = apiKey;\n }\n\n public FootballDataClient build() {\n return new FootballDataClient( apiKey );\n }\n\... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.github.mozvip.footballdata.FootballDataClient;
import com.google.common.io.Resources;
import io.dropwizard.Application;
import io.dropwizard.assets.AssetsBundle;
import io.dropwizard.auth.AuthDyna... | package predictions;
public class PredictionsApplication extends Application<PredictionsConfiguration> {
@Override
public String getName() {
return "Sports Predictions";
}
@Override
public void initialize(Bootstrap<PredictionsConfiguration> bootstrap) {
bootstrap.addBundle(new AssetsBundle("/assets", "... | CommunityBasicCredentialAuthFilter<User> basicCredentialAuthFilter = new CommunityBasicCredentialAuthFilter.Builder<User>(configuration.getDefaultCommunity()) | 1 |
MyGrades/mygrades-app | app/src/main/java/de/mygrades/view/activity/SelectUniversityActivity.java | [
"public class Rule {\n\n private Long ruleId;\n /** Not-null value. */\n private String name;\n private String semesterFormat;\n private String semesterPattern;\n private Integer semesterStartSummer;\n private Integer semesterStartWinter;\n private Double gradeFactor;\n private java.util.... | import android.os.Bundle;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAni... | package de.mygrades.view.activity;
/**
* Activity which shows all universities.
* The user can select a university to be forwarded to the LoginActivity.
*/
public class SelectUniversityActivity extends AppCompatActivity {
private static final String SAVED_STATE_EXPANDABLE_ITEM_MANAGER = "RecyclerViewExpanda... | private UniversitiesDataProvider dataProvider; | 6 |
ChiralBehaviors/Kramer | kramer/src/main/java/com/chiralbehaviors/layout/outline/Outline.java | [
"public class ColumnSet {\n\n private final List<Column> columns = new ArrayList<>();\n\n {\n columns.add(new Column());\n }\n\n public void add(SchemaNodeLayout node) {\n columns.get(0)\n .add(node);\n }\n\n public void adjustHeight(double delta) {\n columns.for... | import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import com.chiralbehaviors.layout.ColumnSet;
import com.chiralbehaviors.layout.RelationLayout;
import com.chiralbehaviors.layout.cell.control.FocusTraversal;
import com.chiralbehaviors.layout.flowless.VirtualFlow;
import com.chiralbehaviors.la... | /**
* Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | List<JsonNode> list = SchemaNode.asList(item); | 4 |
UweTrottmann/tmdb-java | src/test/java/com/uwetrottmann/tmdb2/services/NetworksServiceTest.java | [
"public abstract class BaseTestCase {\n\n private static final boolean LOG_BODY = System.getenv(\"CI\") == null;\n\n // Do NOT use this API key in your application, it is only for testing tmdb-java!\n private static final String TEST_API_KEY = \"25da90e9f8f0b3892d8bdeb6c3d6267d\";\n // limit requests fo... | import com.uwetrottmann.tmdb2.BaseTestCase;
import com.uwetrottmann.tmdb2.entities.Network;
import com.uwetrottmann.tmdb2.entities.NetworkImages;
import org.junit.Test;
import retrofit2.Call;
import java.io.IOException;
import static com.uwetrottmann.tmdb2.TestData.testNetwork;
import static com.uwetrottmann.tmdb2.asse... | package com.uwetrottmann.tmdb2.services;
public class NetworksServiceTest extends BaseTestCase {
@Test
public void test_networks() throws IOException {
Call<Network> call = getUnauthenticatedInstance().networksService().summary( | testNetwork.id | 3 |
Deltik/SignEdit | test/net/deltik/mc/signedit/ArgParserTest.java | [
"public class NumberParseLineSelectionException extends LineSelectionException {\n public NumberParseLineSelectionException(String s) {\n super(s);\n }\n}",
"public class OutOfBoundsLineSelectionException extends LineSelectionException {\n public OutOfBoundsLineSelectionException(String s) {\n ... | import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import net.deltik.mc.signedit.exceptions.NumberParseLineSelectionException;
import net.deltik.mc.signedit.exceptions.OutOfBoundsLineSelectionException;
import net.deltik.mc.signedit.exceptio... | /*
* Copyright (C) 2017-2021 Deltik <https://www.deltik.net/>
*
* This file is part of SignEdit for Bukkit.
*
* SignEdit for Bukkit is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of th... | Set<String> subcommandNames = SignSubcommandModule.provideSubcommandNames(); | 4 |
jadler-mocking/jadler | jadler-all/src/test/java/net/jadler/StubbingResponseHeadersTest.java | [
"public class TestParameters {\n\n /**\n * @return parameters for acceptance/integration tests located in this module. The fugly return type\n * is required by the jUnit parameters mechanism. It basically returns two stub server factories as\n * test parameters.\n */\n public Iterable<StubHttp... | import net.jadler.parameters.StubHttpServerFactory;
import net.jadler.parameters.TestParameters;
import org.apache.http.HttpResponse;
import org.apache.http.client.fluent.Executor;
import org.apache.http.client.fluent.Request;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.juni... | /*
* Copyright (c) 2012 - 2016 Jadler contributors
* This program is made available under the terms of the MIT License.
*/
package net.jadler;
/**
* Integration test for default response headers.
*/
@RunWith(Parameterized.class)
public class StubbingResponseHeadersTest {
private final StubHttpServerFacto... | onRequest().respond().withBody("13 chars long"); | 3 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/parser/ProgramParser.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.Collection;
import java.util.Collections;
import com.threecrickets.scripturian.Executable;
import com.threecrickets.scripturian.ExecutableSegment;
import com.threecrickets.scripturian.Parser;
import com.threecrickets.scripturian.ParsingContext;
import com.threecrickets.scripturian.exception.DocumentExc... | /**
* Copyright 2009-2017 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of the LGPL version 3.0:
* http://www.gnu.org/copyleft/lesser.html
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly f... | public Collection<ExecutableSegment> parse( String sourceCode, ParsingContext parsingContext, Executable executable ) throws ParsingException, DocumentException | 4 |
geoparser/geolocator | geo-locator/src/edu/cmu/geoparser/ui/LDCTest.java | [
"public class GetReader {\n\n public static BufferedReader getUTF8FileReader(String filename) throws FileNotFoundException,\n UnsupportedEncodingException {\n File file = new File(filename);\n BufferedReader bin = new BufferedReader(new InputStreamReader(new FileInputStream(file),\n \"utf... | import edu.cmu.geoparser.Disambiguation.ContextDisamb;
import edu.cmu.geoparser.io.GetReader;
import edu.cmu.geoparser.io.GetWriter;
import edu.cmu.geoparser.model.Tweet;
import edu.cmu.geoparser.parser.english.EnglishParser;
import edu.cmu.geoparser.resource.gazindexing.Index;
import edu.cmu.geoparser.resource.gazinde... | /**
*
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 may not use t... | EnglishParser enparser = new EnglishParser("res/", ci, false); | 3 |
PeterCxy/BlackLight | src/us/shandian/blacklight/cache/comments/CommentTimeLineApiCache.java | [
"public class Constants\n{\n\tpublic static final int DB_CACHE_DAYS = 10;\n\tpublic static final int FILE_CACHE_DAYS = 3;\n\t\n\t// File Cache Types\n\tpublic static final String FILE_CACHE_AVATAR_SMALL = \"avatar_small\";\n\tpublic static final String FILE_CACHE_AVATAR_LARGE = \"avatar_large\";\n\tpublic static fi... | import us.shandian.blacklight.model.CommentListModel;
import us.shandian.blacklight.model.MessageListModel;
import android.content.Context;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.google.gson.Gson;
import us.shandian.blacklight.api.... | /*
* Copyright (C) 2014 Peter Cai
*
* This file is part of BlackLight
*
* BlackLight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ve... | protected MessageListModel load() { | 4 |
Joy-Whale/EasyShare | platform/src/main/java/cn/joy/libs/platform/wechat/WechatEntryActivity.java | [
"public class AuthCallbackReceiver extends BroadcastReceiver {\n\n\tprivate static final String TAG = \"AUTHCallbackReceiver\";\n\tprivate static final String ACTION_AUTH_CALLBACK = \"cn.joy.libs.platforms.ACTION_AUTH_CALLBACK\";\n\tprivate static final String EXTRA_CALLBACK_CODE = \"EXTRA_CALLBACK_CODE\";\n\tpriva... | import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import cn.joy.libs.platform.AuthCallbackReceiver;
import cn.joy.libs.platform.ErrorCode;
import cn.joy.libs.platform.Logs;
import cn.joy.libs.platform.Operate;
import cn.joy.libs.platform.PlatformAuthInf... | package cn.joy.libs.platform.wechat;
/**
* User: JiYu
* Date: 2016-07-26
* Time: 18-05
*/
public class WeChatEntryActivity extends Activity implements IWXAPIEventHandler {
private static final String TAG = "WeChatEntryActivity";
private static final String SCOPE_BASE = "snsapi_base";
private static final... | AuthCallbackReceiver.sendBroadcastCancel(this); | 0 |
apache/commons-cli | src/test/java/org/apache/commons/cli/bug/BugCLI252Test.java | [
"public class AmbiguousOptionException extends UnrecognizedOptionException {\n /**\n * This exception {@code serialVersionUID}.\n */\n private static final long serialVersionUID = 5829816121277947229L;\n\n /**\n * Build the exception message from the specified list of options.\n *\n * @... | import org.apache.commons.cli.AmbiguousOptionException;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.junit.Test; | /*
* 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 may ... | public void testAmbiquousOptionName() throws ParseException { | 4 |
sachin-handiekar/jInstagram | src/test/java/org/jinstagram/InstagramTest.java | [
"public class Token implements Serializable {\n\tprivate static final long serialVersionUID = 715000866082812683L;\n\n\tprivate final String rawResponse;\n\n\tprivate final String secret;\n\n\tprivate final String token;\n\n\t/**\n\t * Default constructor\n\t * \n\t * @param token token value\n\t * @param secret to... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import java.util.ArrayList;
import java.util.List;
import org.jinstagram.auth.model.Token;
import org.jinstagram.entity.common.Location;
import org.jinstagram.entity.common.Meta;
import org.jinstagram.entity.locations.LocationS... | package org.jinstagram;
public class InstagramTest {
private final Logger logger = LoggerFactory.getLogger(InstagramTest.class);
private static final String IG_TOKEN_SYSTEM_PROPERTY = "IG_ACCESS_TOKEN";
private InstagramClient instagram = null;
@Before
public void beforeMethod() {
o... | for (UserFeedData userFeedData : userFeed.getUserList()) { | 6 |
otto-de/jlineup | web/src/main/java/de/otto/jlineup/service/JLineupService.java | [
"public class JLineupRunner {\n\n private final static Logger LOG = LoggerFactory.getLogger(lookup().lookupClass());\n\n public static final String REPORT_LOG_NAME_KEY = \"reportlogname\";\n public static final String LOGFILE_NAME = \"jlineup.log\";\n\n private final JobConfig jobConfig;\n private fi... | import com.google.common.collect.ImmutableList;
import de.otto.jlineup.JLineupRunner;
import de.otto.jlineup.config.JobConfig;
import de.otto.jlineup.web.JLineupRunStatus;
import de.otto.jlineup.web.JLineupRunnerFactory;
import de.otto.jlineup.web.State;
import de.otto.jlineup.web.configuration.JLineupWebProperties;
im... | package de.otto.jlineup.service;
@Service
public class JLineupService {
private final static Logger LOG = LoggerFactory.getLogger(lookup().lookupClass());
private final ConcurrentHashMap<String, JLineupRunStatus> runs = new ConcurrentHashMap<>();
private final ExecutorService executorService;
priv... | private final JLineupWebProperties jLineupWebProperties; | 5 |
Jardo-51/user_module | jpa/src/test/java/com/jardoapps/usermodule/jpa/UserDatabaseModelJpaTest.java | [
"public class User {\r\n\r\n\tprivate final int id;\r\n\r\n\tprivate final String name;\r\n\r\n\tprivate final String email;\r\n\r\n\tprivate final String registrationControlCode;\r\n\r\n\tprivate final boolean registrationConfirmed;\r\n\r\n\tprivate final UserPassword password;\r\n\r\n\tprivate int rank;\r\n\r\n\t... | import com.jardoapps.usermodule.User;
import com.jardoapps.usermodule.UserDatabaseModel;
import com.jardoapps.usermodule.UserRanks;
import com.jardoapps.usermodule.containers.PasswordResetToken;
import com.jardoapps.usermodule.containers.SocialAccountDetails;
import com.jardoapps.usermodule.containers.UserPassword... | /*
* This file is part of the User Module library.
* Copyright (C) 2014 Jaroslav Brtiš
*
* User Module 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 version 3 of the License... | UserPassword password = new UserPassword("ea1baa4cad9d822a51a1aa267a618fb2ac6d5d98a89709a595487ea493a69e90",
| 5 |
AVMf/avmf | src/main/java/org/avmframework/examples/inputdatageneration/triangle/TriangleBranchTargetObjectiveFunction.java | [
"public class Vector extends AbstractVector {\n\n public void addVariable(Variable variable) {\n variables.add(variable);\n }\n\n public List<Variable> getVariables() {\n return new ArrayList<>(variables);\n }\n\n public void setVariablesToInitial() {\n for (Variable var : variables) {\n var.setV... | import org.avmframework.Vector;
import org.avmframework.examples.inputdatageneration.Branch;
import org.avmframework.examples.inputdatageneration.BranchTargetObjectiveFunction;
import org.avmframework.examples.inputdatageneration.ControlDependenceChain;
import org.avmframework.examples.inputdatageneration.ControlDepend... | package org.avmframework.examples.inputdatageneration.triangle;
public class TriangleBranchTargetObjectiveFunction extends BranchTargetObjectiveFunction {
public TriangleBranchTargetObjectiveFunction(Branch target) {
super(target);
}
@Override | protected ControlDependenceChain getControlDependenceChainForTarget() { | 3 |
loklak/loklak_server | src/org/loklak/DumpProcessConversation.java | [
"public class JSONObject {\n /**\n * JSONObject.NULL is equivalent to the value that JavaScript calls null,\n * whilst Java's null is equivalent to the value that JavaScript calls\n * undefined.\n */\n private static final class Null {\n\n /**\n * There is only intended to be a ... | import java.util.concurrent.atomic.AtomicLong;
import org.json.JSONObject;
import org.loklak.data.DAO;
import org.loklak.harvester.TwitterScraper.TwitterTweet;
import org.loklak.tools.storage.JsonFactory;
import org.loklak.tools.storage.JsonReader;
import org.loklak.tools.storage.JsonStreamReader;
import java.io.File;
... | /**
* DumpProcessConversation
* Copyright 18.04.2018 by Michael Peter Christen, @0rb1t3r
*
* 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
* version 2.1 of the License... | while ((tweet = dumpReader.take()) != JsonStreamReader.POISON_JSON_MAP) { | 4 |
kkung/kakao-android-sdk-standalone | sdk/src/com/kakao/authorization/authcode/KakaoWebViewDialog.java | [
"public class KakaoException extends RuntimeException {\n private static final long serialVersionUID = 3738785191273730776L;\n private ERROR_TYPE errorType;\n\n public enum ERROR_TYPE{\n ILLEGAL_ARGUMENT,\n MISS_CONFIGURATION,\n CANCELED_OPERATiON,\n AUTHORIZATION_FAILED,\n }... | import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.net.http.SslError;
import... | /**
* Copyright 2014 Kakao Corp.
*
* Redistribution and modification in source or binary forms are not permitted without specific prior written permission.
*
* 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 co... | sendErrorToListener(new KakaoException(ERROR_TYPE.CANCELED_OPERATiON, "")); | 1 |
rrauschenbach/mobi-api4java | src/main/java/org/rr/mobi4java/EXTHRecordFactory.java | [
"public static int getInt(byte[] buffer, int offset, int length) {\n\treturn getInt(getBytes(buffer, offset, length));\n}",
"public static enum RECORD_TYPE {\n\tAUTHOR(100),\n\tPUBLISHER(101),\n\tIMPRINT(102),\n\tDESCRIPTION(103),\n\tISBN(104),\n\tSUBJECT(105),\n\tPUBLISHING_DATE(106),\n\tREVIEW(107),\n\tCONTRIBU... | import static org.rr.mobi4java.ByteUtils.getInt;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import org.rr.mobi4java.EXTHRecord.RECORD_TYPE;
import org.rr.mobi4java.exth.ASINRecordDelegate;
import org.rr.mobi4java.exth.DateRecordDelegate;
import org.rr.mobi4java.exth.... | package org.rr.mobi4java;
/**
* Class providing factory methods to create new {@link EXTHRecord} or {@link RecordDelegate} derivation instances which can be added to a
* document using {@link MobiMetaData#addEXTHRecord(org.rr.mobi4java.exth.RecordDelegate)}.
*/
public class EXTHRecordFactory {
public static E... | public static LanguageRecordDelegate createLanguageRecord(String languageCode) { | 5 |
ihongs/HongsCORE | hongs-serv-matrix/src/main/java/io/github/ihongs/serv/matrix/Data.java | [
"public final class Cnst {\n\n //** 默认取值 **/\n\n public static final String LANG_DEF = \"zh_CN\"; // 默认语言\n\n public static final String ZONE_DEF = \"GMT+8\"; // 默认时区\n\n public static final int RN_DEF = 20 ; // 默认每页行数\n\n //** 查询参数 **/\n\n public static final String ID_KEY = \"id\"; // 编号\n... | import io.github.ihongs.Cnst;
import io.github.ihongs.Core;
import io.github.ihongs.HongsException;
import io.github.ihongs.HongsExemption;
import io.github.ihongs.action.ActionHelper;
import io.github.ihongs.action.FormSet;
import io.github.ihongs.db.DB;
import io.github.ihongs.db.Model;
import io.github.ihongs.db.Tab... | package io.github.ihongs.serv.matrix;
/**
* 数据存储模型
*
* <pre>
* 错误代码:
* matrix.form.not.exists=表单配置文件不存在
* matrix.wait.one.second=等会儿, 不要急
* matrix.item.is.removed=记录已被删除了
* matrix.node.not.exists=找不到恢复起源
* matrix.node.is.current=这已是最终记录
* matrix.rev.unsupported=资源不支持恢复
* </pre>
*
* @author Hongs
*/
pu... | return (Data) Core.getInstance (type); | 1 |
jeluard/stone | core/src/main/java/com/github/jeluard/stone/pattern/Poller.java | [
"@ThreadSafe\npublic interface Reader {\n\n /**\n * @return beginning of values stored, if any\n * @throws IOException \n */\n Optional<Long> beginning() throws IOException;\n\n /**\n * @return end of values stored, if any\n * @throws IOException \n */\n Optional<Long> end() throws IOException;\n\n ... | import com.github.jeluard.guayaba.annotation.Idempotent;
import com.github.jeluard.guayaba.base.Triple;
import com.github.jeluard.guayaba.lang.Cancelable;
import com.github.jeluard.guayaba.util.concurrent.Scheduler;
import com.github.jeluard.stone.api.Reader;
import com.github.jeluard.stone.api.TimeSeries;
import com.g... | /**
* Copyright 2012 Julien Eluard
* This project includes software developed by Julien Eluard: https://github.com/jeluard/
*
* 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
*
* htt... | private final ConcurrentMap<T, TimeSeries> timeseriess = new ConcurrentHashMap<T, TimeSeries>(); | 1 |
mcxiaoke/Android-Next | samples/src/main/java/com/mcxiaoke/next/samples/ListViewExtendSamples.java | [
"public class SimpleTaskCallback<Result> implements TaskCallback<Result> {\n\n @Override\n public void onTaskStarted(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskFinished(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskCancelled(String name, Bun... | import android.annotation.TargetApi;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.mcxiaoke.next.task.SimpleTaskCallback;
import com.mcxiaoke.next.task.TaskCallback;
import com.mcxiaoke.next.task.TaskQueue;
import com.mcxiaoke.ne... | package com.mcxiaoke.next.samples;
/**
* EndlessListView使用示例
* User: mcxiaoke
* Date: 13-10-25
* Time: 下午4:44
*/
@TargetApi(VERSION_CODES.HONEYCOMB)
public class ListViewExtendSamples extends BaseActivity {
public static final String TAG = ListViewExtendSamples.class.getSimpleName();
@BindView(android.... | final TaskCallback<List<String>> callback = new SimpleTaskCallback<List<String>>() { | 1 |
asebak/embeddedlinux-jvmdebugger-intellij | src/com/atsebak/embeddedlinuxjvm/project/RPiJavaModuleBuilder.java | [
"public final class EmbeddedLinuxJVMBundle {\n\n @NonNls\n private static final String BUNDLE = \"com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle\";\n private static Reference<ResourceBundle> ourBundle;\n\n /**\n * Private Constructor\n */\n private EmbeddedLinuxJVMBundle() {... | import com.atsebak.embeddedlinuxjvm.localization.EmbeddedLinuxJVMBundle;
import com.atsebak.embeddedlinuxjvm.ui.EmbeddedJavaModuleStep;
import com.atsebak.embeddedlinuxjvm.utils.FileUtilities;
import com.atsebak.embeddedlinuxjvm.utils.ProjectUtils;
import com.atsebak.embeddedlinuxjvm.utils.Template;
import com.google.c... | package com.atsebak.embeddedlinuxjvm.project;
@Getter
@Setter
@NoArgsConstructor
public class RPiJavaModuleBuilder extends JavaModuleBuilder {
private static final ProjectType PI_PROJECT_TYPE = new ProjectType("PI_JAVA");
private static final String PROJECT_NAME = "Raspberry PI";
private String packageNa... | Template.builder().name(getMainClassTemplateName()) | 4 |
emboss/krypt-core-java | src/impl/krypt/asn1/parser/ParsedHeaderImpl.java | [
"public class Asn1Object {\n \n private Header header;\n private byte[] value;\n\n public Asn1Object(Header header, byte[] value) {\n this.header = header;\n this.value = value;\n }\n\n public Header getHeader() {\n return header;\n }\n\n public byte[] getValue() {\n ... | import impl.krypt.asn1.Length;
import impl.krypt.asn1.ParseException;
import impl.krypt.asn1.ParsedHeader;
import impl.krypt.asn1.SerializeException;
import impl.krypt.asn1.Tag;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import impl.krypt.a... | /*
* krypt-core API - Java version
*
* Copyright (c) 2011-2013
* Hiroshi Nakamura <nahi@ruby-lang.org>
* Martin Bosslet <martin.bosslet@gmail.com>
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
... | Header h = new EncodableHeader(tag, length); | 2 |
evant/simplefragment | simplefragment/src/main/java/me/tatarka/simplefragment/activity/SimpleFragmentDelegate.java | [
"public abstract class SimpleFragment implements SimpleFragmentManagerProvider {\n private View view;\n private State state = new State();\n private SimpleFragmentStateManager stateManager;\n private SimpleFragmentManager manager;\n\n public abstract void onCreate(Context context, @Nullable Bundle st... | import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentAc... | package me.tatarka.simplefragment.activity;
/**
* A delegate class for implementing SimpleFragments in your own Activity. While there are a lot of
* methods, implementing is mostly a matter of overriding all the methods with the same name and
* calling the delegate. See {@link SimpleFragmentActivity} for an exam... | private SimpleFragmentManager manager; | 1 |
hitherejoe/Pickr | app/src/test/java/com/hitherejoe/pickr/DatabaseHelperTest.java | [
"public class DatabaseHelper {\n\n private BriteDatabase mBriteDb;\n\n public DatabaseHelper(Context context) {\n mBriteDb = SqlBrite.create().wrapDatabaseHelper(new DbOpenHelper(context));\n }\n\n public BriteDatabase getBriteDb() {\n return mBriteDb;\n }\n\n public Observable<Point... | import android.database.Cursor;
import com.hitherejoe.pickr.data.local.DatabaseHelper;
import com.hitherejoe.pickr.data.local.Db;
import com.hitherejoe.pickr.data.model.PointOfInterest;
import com.hitherejoe.pickr.util.DefaultConfig;
import com.hitherejoe.pickr.util.MockModelsUtil;
import org.junit.Before;
import org.j... | package com.hitherejoe.pickr;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = DefaultConfig.EMULATE_SDK, manifest = DefaultConfig.MANIFEST)
public class DatabaseHelperTest {
private static final String POI_DUPLICATE_ID = "1234";
private DatabaseHelper mDatabaseHelper;
... | PointOfInterest pointOfInterest = MockModelsUtil.createMockPointOfInterest(); | 4 |
thane98/3DSFE-Randomizer | randomizer/fates/model/processors/chapter/TextHandler.java | [
"public enum CharacterType {\n FirstGen, SecondGen, NPC, Player\n}",
"public class Chapter {\n private ChapterType type;\n private String cid;\n private String parentPid;\n private String childPid;\n private int id;\n\n public String getChildPid() {\n return childPid;\n }\n\n pub... | import randomizer.common.enums.CharacterType;
import randomizer.common.structures.Chapter;
import randomizer.common.utils.CompressionUtils;
import randomizer.common.utils.MessageBinUtils;
import randomizer.fates.model.structures.FatesCharacter;
import randomizer.fates.singletons.FatesChapters;
import randomizer.fates.s... | package randomizer.fates.model.processors.chapter;
public class TextHandler {
private static boolean[] options = FatesGui.getInstance().getSelectedOptions();
private static FatesCharacters fatesCharacters = FatesCharacters.getInstance();
private static FatesChapters fatesChapters = FatesChapters.getInsta... | Files.write(file.toPath(), CompressionUtils.compress(raw)); | 2 |
IMAGINARY/morenaments-euc | src/main/java/de/tum/in/gagern/ornament/recog/Recognizer.java | [
"/* */ public class I18n\n/* */ {\n/* 19 */ private static ResourceBundle res = null;\n/* */ \n/* */ private I18n()\n/* */ {\n/* 16 */ throw new Error(\"Don't instantiate!\");\n/* */ }\n/* */ \n/* */ public static String _(String key)\n/* */ {\n/* */ try\n/* */ ... | import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import java.awt.Transparency;
import java.awt.color.ColorSpace;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
i... | (int)Math.round(matrix[2]),
(int)Math.round(matrix[3]));
}
else {
g.drawLine(x - 5, y - 5, x + 5, y + 5);
g.drawLine(x - 5, y + 5, x + 5, y - 5);
}
g.dispose();
debugImg(res, file);
if (stream != System.err) stream.close();
}
/**
* Limit used when deciding whether two vec... | MinGrid minGrid = new MinGrid(ax, ay, bx, by); | 2 |
apache/creadur-rat | apache-rat-core/src/main/java/org/apache/rat/report/xml/XmlReportFactory.java | [
"public class ReportConfiguration {\n private IHeaderMatcher headerMatcher;\n private ILicenseFamily[] approvedLicenseNames;\n private boolean addingLicenses;\n private boolean addingLicensesForced;\n private String copyrightMessage;\n private boolean approveDefaultLicenses = true;\n\n /**\n ... | import java.util.ArrayList;
import java.util.List;
import org.apache.rat.ReportConfiguration;
import org.apache.rat.analysis.DefaultAnalyserFactory;
import org.apache.rat.document.IDocumentAnalyser;
import org.apache.rat.document.impl.util.DocumentAnalyserMultiplexer;
import org.apache.rat.policy.DefaultPolicy;
import ... | /*
* 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 ... | reporters.add(new ClaimAggregator(pStatistic)); | 2 |
thwegene/OCT | src/oct/polygonization/OctDualMasspointTri.java | [
"public enum OCT_EDGE implements OCT_ENUM {\r\n\r\n\t/**\r\n\t * BACK DOWN, Direction X,Y,Z: 0, -1, -1\r\n\t */\r\n\tBD(0, -1, -1, OCT_VERTEX.LBD, OCT_VERTEX.RBD), // 0\r\n\t/**\r\n\t * RIGHT DOWN, Direction X,Y,Z: 1, 0, -1\r\n\t */\r\n\tRD(1, 0, -1, OCT_VERTEX.RBD, OCT_VERTEX.RFD), // 1\r\n\t/**\r\n\t * FRONT DOWN... | import java.util.ArrayList;
import java.util.HashMap;
import oct.enums.OCT_EDGE;
import oct.enums.OCT_ENUM;
import oct.enums.OCT_FACE;
import oct.enums.OCT_VERTEX;
import oct.math.OctFunction;
import oct.octree.OctNode;
import oct.octree.OctOctree;
import oct.octree.OctRST;
import oct.octree.OctXYZ;
import p... | package oct.polygonization;
public class OctDualMasspointTri extends OctPoly {
private PApplet p5;
private OctOctree myOctree;
public OctMesh octMesh;
private OctXYZ[] vertexList;
private float nodeSizeX;
private float nodeSizeY;
private float nodeSizeZ;
| private OctFunction myFunction;
| 4 |
mbolt35/coffee-graph | src/main/java/bolt/web/coffee/CoffeeGraph.java | [
"public class CoffeeGraphCommandParser implements CoffeeGraphOptionsParser {\n\n private final String[] arguments;\n\n private final JCommander commander;\n private final CoffeeGraphCommand command;\n\n private StringBuilder usageString;\n\n public CoffeeGraphCommandParser(String[] arguments) {\n ... | import bolt.web.coffee.io.*;
import bolt.web.coffee.util.CoffeeScript;
import bolt.web.coffee.command.CoffeeGraphCommandParser;
import bolt.web.coffee.dependency.graph.CyclicDependencyException;
import bolt.web.coffee.exceptions.ChainedExportException;
import bolt.web.coffee.exceptions.NoValidCoffeeFilesException;
impo... | ////////////////////////////////////////////////////////////////////////////////
//
// Coffee-Graph
// Copyright(C) 2012 Matt Bolt
//
// 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 w... | catch (ChainedExportException e) { | 2 |
dvorka/shifts-solver | src/com/mindforger/shiftsolver/client/ui/dialogs/ChangeAssignmentDialog.java | [
"public class RiaContext implements ShiftSolverConstants {\n\n\t// RIA\n\tprivate Ria ria;\n\t\n\t// i18n and l10n\n\tprivate RiaMessages i18n;\n\t\n\t// server\n\tprivate ShiftSolverServiceAsync service;\n\t\n\t// solver\n\tprivate ShiftSolver solver;\n\t\n\t// validation\n\tprivate FieldVerifier fieldVerifier;\n\... | import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.FlexTable;
im... | package com.mindforger.shiftsolver.client.ui.dialogs;
public class ChangeAssignmentDialog extends DialogBox {
private RiaMessages i18n;
private static final String EMPLOYEES_RADIO_GROUP="employees";
private List<RadioButton> radios;
private List<Employee> employees;
public ChangeAssignmentDialog(
final R... | final ChangeAssignmentButton trigger, | 4 |
fredg02/se.bitcraze.crazyflie.lib | se.bitcraze.crazyflie.lib.examples/src/main/java/se/bitcraze/crazyflie/lib/examples/ConsoleExample.java | [
"public class Crazyflie {\n\n private final Logger mLogger = LoggerFactory.getLogger(this.getClass().getSimpleName());\n\n private CrtpDriver mDriver;\n private Thread mIncomingPacketHandlerThread;\n\n private LinkedBlockingDeque<CrtpPacket> mResendQueue = new LinkedBlockingDeque<>();\n private Threa... | import java.util.Timer;
import java.util.TimerTask;
import se.bitcraze.crazyflie.lib.crazyflie.Crazyflie;
import se.bitcraze.crazyflie.lib.crazyflie.Crazyflie.State;
import se.bitcraze.crazyflie.lib.crazyflie.DataListener;
import se.bitcraze.crazyflie.lib.crazyradio.ConnectionData;
import se.bitcraze.crazyflie.lib.craz... | package se.bitcraze.crazyflie.lib.examples;
/**
* Simple example that connects to the Crazyflie on the given channel and data rate.
* It prints the contents of the console.
*/
public class ConsoleExample {
private Crazyflie mCrazyflie;
private StringBuffer consoleBuffer = new StringBuffer();
public ... | mCrazyflie = new Crazyflie(new RadioDriver(new UsbLinkJava())); | 5 |
kpavlov/fixio | core/src/test/java/fixio/netty/pipeline/ServerChannelPipelineIntegrationTest.java | [
"public interface FixMessage {\n\n String FIX_4_0 = \"FIX.4.0\";\n String FIX_4_1 = \"FIX.4.1\";\n String FIX_4_2 = \"FIX.4.2\";\n String FIX_4_3 = \"FIX.4.3\";\n String FIX_4_4 = \"FIX.4.4\";\n String FIX_5_0 = \"FIXT.1.1\";\n\n FixMessageHeader getHeader();\n\n List<FixMessageFragment> get... | import fixio.fixprotocol.FieldType;
import fixio.fixprotocol.FixMessage;
import fixio.fixprotocol.FixMessageBuilderImpl;
import fixio.fixprotocol.FixMessageHeader;
import fixio.fixprotocol.MessageTypes;
import fixio.handlers.FixApplicationAdapter;
import fixio.netty.pipeline.server.FixAcceptorChannelInitializer;
import... | /*
* Copyright 2014 The FIX.io Project
*
* The FIX.io Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unles... | final FixMessageHeader header = logon.getHeader(); | 2 |
jmhertlein/MCTowns | src/main/java/cafe/josh/mctowns/listeners/QuickSelectToolListener.java | [
"public class TownManager {\n private final HashMap<String, Town> towns;\n private final HashMap<String, MCTownsRegion> regions;\n\n /**\n * Constructs a new, empty town manager.\n */\n public TownManager() {\n towns = new HashMap<>();\n regions = new HashMap<>();\n }\n\n /**... | import cafe.josh.mctowns.TownManager;
import cafe.josh.mctowns.command.ActiveSet;
import cafe.josh.mctowns.region.Plot;
import cafe.josh.mctowns.region.Territory;
import cafe.josh.mctowns.region.Town;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import... | /*
* Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.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 3 of the License, or
* (at your option) any later ve... | this.townMan = MCTowns.getTownManager(); | 5 |
jackpotsvr/Java-Conquer-Server | tests/net/co/java/entity/Inventory.java | [
"public class Player extends Entity {\n\t\n\tprivate static final long serialVersionUID = 8357201473468302184L;\n\n\tprivate AbstractClient client;\n\t//private NPC_Dialog activeDialog;\n\t\n\tprivate int gold = 0, cps = 0,\n\t\t\texperience = 0, pkPoints = 0, rebornCount = 0, stamina = 100, action = 0,\n\t\t\tstre... | import static org.junit.Assert.*;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import net.co.java.entity.Player;
import net.co.java.item.ItemInstance;
import net.co.java.item.ItemPrototype;
import net.co.java.model.AccessException;
import net.co.java.model.Mock;
import net.co.java.model.Mod... | package net.co.java.entity;
public class Inventory {
private Player player;
private static Model mock;
private static ArrayList<ItemInstance> items = new ArrayList<ItemInstance>();
private static long itemIdentity = 2342345l;
static {
try {
| mock = new Mock();
| 4 |
domenique/tripled-framework | eventbus-core/src/test/java/eu/tripledframework/eventbus/handler/TestCommandHandler.java | [
"public class AnCommandHandledByMultipleHandlers {\n\n}",
"public class CommandHandledByAPrivateMethod {\n\n}",
"public class FailingCommand {\n}",
"public class FailingCommandWithCheckedException {\n\n}",
"public class HelloCommand {\n\n private String name;\n\n public HelloCommand(String name) {\n th... | import eu.tripledframework.eventbus.Handler;
import eu.tripledframework.eventbus.Handles;
import eu.tripledframework.eventbus.command.AnCommandHandledByMultipleHandlers;
import eu.tripledframework.eventbus.command.CommandHandledByAPrivateMethod;
import eu.tripledframework.eventbus.command.FailingCommand;
import eu.trip... | /*
* Copyright 2015 TripleD framework.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | @Handles(CommandHandledByAPrivateMethod.class) | 1 |
hamadmarri/Biscuit | main/java/com/biscuit/factories/ProjectCompleterFactory.java | [
"public class Project {\n\n\tpublic String name;\n\tpublic String description;\n\tpublic Backlog backlog = new Backlog();\n\tpublic List<Release> releases = new ArrayList<>();\n\tpublic List<Sprint> sprints = new ArrayList<>();\n\n\n\tpublic void save() {\n\t\tModelHelper.save(this, name);\n\t}\n\n\n\tpublic void d... | import java.util.ArrayList;
import java.util.List;
import com.biscuit.models.Project;
import com.biscuit.models.Release;
import com.biscuit.models.Sprint;
import com.biscuit.models.UserStory;
import com.biscuit.models.services.Finder.Releases;
import com.biscuit.models.services.Finder.Sprints;
import com.biscuit.models... | package com.biscuit.factories;
public class ProjectCompleterFactory {
public static List<Completer> getProjectCompleters(Project project) {
List<Completer> completers = new ArrayList<Completer>();
// TODO: project commands
// completers.add(new ArgumentCompleter(new StringsCompleter("summary",
// "info",... | new StringsCompleter(UserStory.fields), new NullCompleter())); | 3 |
offbynull/coroutines | java-agent/src/main/java/com/offbynull/coroutines/javaagent/CoroutinesAgent.java | [
"public final class InstrumentationResult {\n private final byte[] instrumentedClass;\n private final UnmodifiableMap<String, byte[]> extraFiles;\n\n InstrumentationResult(byte[] instrumentedClass) {\n this(instrumentedClass, Collections.emptyMap());\n }\n\n InstrumentationResult(\n ... | import com.offbynull.coroutines.instrumenter.InstrumentationResult;
import com.offbynull.coroutines.instrumenter.InstrumentationSettings;
import com.offbynull.coroutines.instrumenter.Instrumenter;
import com.offbynull.coroutines.instrumenter.asm.ClassResourceClassInformationRepository;
import com.offbynull.coroutines.i... | /*
* Copyright (c) 2017, Kasra Faghihi, All rights reserved.
*
* 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
* version 3.0 of the License, or (at your option) any later ve... | Instrumenter instrumenter = new Instrumenter(new ClassResourceClassInformationRepository(loader)); | 3 |
monkeyk/oauth2-shiro | resources/src/main/java/com/monkeyk/os/oauth/resources/MkkOAuthRSProvider.java | [
"public class AccessToken extends AbstractDomain {\n private static final long serialVersionUID = 7336709167855003668L;\n\n\n public static final String BEARER_TYPE = \"Bearer\";\n\n\n /**\n * 默认的 refresh_token 的有效时长: 30天\n */\n public final static int REFRESH_TOKEN_VALIDITY_SECONDS = 60 * 60 * ... | import com.monkeyk.os.domain.oauth.AccessToken;
import com.monkeyk.os.domain.oauth.ClientDetails;
import com.monkeyk.os.domain.rs.RSOAuthClient;
import com.monkeyk.os.domain.shared.BeanProvider;
import com.monkeyk.os.service.OAuthRSService;
import org.apache.oltu.oauth2.common.error.OAuthError;
import org.apache.oltu.o... | package com.monkeyk.os.oauth.resources;
/**
* 2015/7/8
*
* @author Shengzhao Li
*/
public class MkkOAuthRSProvider implements OAuthRSProvider {
private static final Logger LOG = LoggerFactory.getLogger(MkkOAuthRSProvider.class);
private transient OAuthRSService rsService = BeanProvider.getBean(OAuthRS... | ClientDetails clientDetails = rsService.loadClientDetails(accessToken.clientId(), rsId); | 1 |
snooplsm/njtransit | scheduler/src/com/njtransit/StopActivity.java | [
"public class DepartureVision {\n\n\tpublic interface TrainStatusListener {\n\t\t\n\t\tvoid onTrainStatus(TrainStatus status);\n\t\t\n\t}\n\n private static String nj = \"http://technically.us:7979/\";\n \n private InputStream stream;\n \n private Gson gson;\n \n StringBuilder b = new StringBui... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Timer;
import java.... | package com.njtransit;
public class StopActivity extends SchedulerActivity implements TrainStatusListener {
private StopListView stopTimes;
private TimerTask updaterThread = null;
private boolean needsReschedule = false;
private TextView departure;
private TextView arrival;
private TextView errors;
pri... | private List<Stop> stops = new ArrayList<Stop>(); | 4 |
tonivade/resp-server | src/main/java/com/github/tonivade/resp/protocol/RedisSerializer.java | [
"public static final class ArrayRedisToken extends AbstractRedisToken<Sequence<RedisToken>> {\n\n ArrayRedisToken(Sequence<RedisToken> value) {\n super(RedisTokenType.ARRAY, checkNonNull(value).asArray());\n }\n\n @Override\n public <T> T accept(RedisTokenVisitor<T> visitor) {\n return visitor.array(this)... | import static com.github.tonivade.purefun.Precondition.checkNonNull;
import static java.nio.charset.StandardCharsets.UTF_8;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import com.github.tonivade.purefun.data.Sequence;
import com.github.tonivade.resp.protocol.AbstractRedisToken.ArrayRedisToken;
import com.github... | /*
* Copyright (c) 2015-2022, Antonio Gabriel Muñoz Conejo <antoniogmc at gmail dot com>
* Distributed under the terms of the MIT License
*/
package com.github.tonivade.resp.protocol;
public class RedisSerializer {
private static final Recycler<ByteBufferBuilder> RECYCLER = new Recycler<ByteBufferBuilder>() {... | String error = ((ErrorRedisToken) msg).getValue(); | 1 |
kaazing/netx | ws/src/main/java/org/kaazing/netx/ws/internal/WebSocketImpl.java | [
"public final class URLConnectionHelper {\n\n private final Map<String, URLConnectionHelperSpi> helpers;\n\n /**\n * Converts a {@code URI} to an {@code URL} with behavior registered by protocol scheme.\n *\n * If no behavior has been registered, then the default Java behavior is used instead.\n ... | import org.kaazing.netx.ws.MessageWriter;
import org.kaazing.netx.ws.WebSocket;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.n... | /**
* Copyright 2007-2015, Kaazing Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | public MessageWriter getMessageWriter() throws IOException { | 4 |
gwtbootstrap3/gwtbootstrap3 | gwtbootstrap3/src/main/java/org/gwtbootstrap3/client/ui/Collapse.java | [
"public class HiddenEvent extends GwtEvent<HiddenHandler> {\n private static final Type<HiddenHandler> TYPE = new Type<HiddenHandler>();\n private final NativeEvent nativeEvent;\n\n public static Type<HiddenHandler> getType() {\n return TYPE;\n }\n\n public HiddenEvent() {\n this(null);... | import org.gwtbootstrap3.client.shared.event.ShownEvent;
import org.gwtbootstrap3.client.shared.event.ShownHandler;
import org.gwtbootstrap3.client.shared.js.JQuery;
import org.gwtbootstrap3.client.ui.base.helper.StyleHelper;
import org.gwtbootstrap3.client.ui.constants.CollapseParam;
import org.gwtbootstrap3.client.ui... | package org.gwtbootstrap3.client.ui;
/*
* #%L
* GwtBootstrap3
* %%
* Copyright (C) 2013 GwtBootstrap3
* %%
* 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... | public HandlerRegistration addShowHandler(final ShowHandler showHandler) { | 2 |
42Lines/blog-cdidemo | src/main/java/net/ftlines/blog/cdidemo/web/app/TeamEditPage.java | [
"@Entity\r\npublic class Member {\r\n @GeneratedValue\r\n @Id\r\n private Long id;\r\n\r\n @ManyToOne(optional = false)\r\n private Employee employee;\r\n\r\n @ManyToOne(optional = false)\r\n private Position position;\r\n\r\n @Temporal(TemporalType.DATE)\r\n private Date effectiveDate;\r\n\r\n public Emp... | import javax.inject.Inject;
import net.ftlines.blog.cdidemo.model.Member;
import net.ftlines.blog.cdidemo.model.PositionsRepository;
import net.ftlines.blog.cdidemo.model.Team;
import net.ftlines.blog.cdidemo.web.EntityModel;
import net.ftlines.blog.cdidemo.web.UserAction;
import org.apache.wicket.ajax.AjaxReques... | package net.ftlines.blog.cdidemo.web.app;
public class TeamEditPage extends BasePage {
@Inject
UserAction action;
public TeamEditPage(PageParameters params) {
action.begin();
Long teamId = params.get("id").toLong();
| IModel<Team> team = new EntityModel<Team>(Team.class, teamId);
| 3 |
JanWiemer/jacis | src/test/java/org/jacis/readonlytxview/ReadOnlyTxViewTest.java | [
"@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ... | import static org.junit.Assert.assertEquals;
import java.util.concurrent.atomic.AtomicReference;
import org.jacis.container.JacisContainer;
import org.jacis.container.JacisContainerReadOnlyTransactionContext;
import org.jacis.plugin.txadapter.local.JacisLocalTransaction;
import org.jacis.store.JacisStore;
import ... | /*
* Copyright (c) 2020. Jan Wiemer
*/
package org.jacis.readonlytxview;
public class ReadOnlyTxViewTest {
@Test
public void testSimpleUsageOfReadOnlyTxContext() {
JacisTestHelper testHelper = new JacisTestHelper();
JacisStore<String, TestObject> store = testHelper.createTestStoreWithClo... | JacisContainer container = store.getContainer();
| 0 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/Run.java | [
"public class MakeIndex {\n\n\t@com.beust.jcommander.Parameter(description = \"input-nanopub-files\")\n\tprivate List<File> inputFiles = new ArrayList<File>();\n\n\t@com.beust.jcommander.Parameter(names = \"-fs\", description = \"Add index nanopubs from input files \" +\n\t\t\t\"as sub-indexes (instead of elements)... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.rdf4j.RDF4JException;
import org.nanopub.extra.index.MakeIndex;
import org.nanopub.extra.security.MakeKeys;
import org.nanopub.extra.security.SignNan... | package org.nanopub;
public class Run {
private Run() {} // no instances allowed
public static void main(String[] args) throws IOException, RDF4JException {
NanopubImpl.ensureLoaded();
run(args);
}
private static List<Class<?>> runnableClasses = new ArrayList<>();
private static Map<String,Class<?>> run... | addRunnableClass(GetServerInfo.class, "server"); | 4 |
xSAVIKx/openweathermap-java-api | api-examples/src/main/java/org/openweathermap/api/example/HourlyForecastExample.java | [
"public interface DataWeatherClient extends WeatherClient {\n\n CurrentWeather getCurrentWeather(CurrentWeatherOneLocationQuery query);\n\n List<CurrentWeather> getCurrentWeather(CurrentWeatherMultipleLocationsQuery query);\n\n ForecastInformation<HourlyForecast> getForecastInformation(HourlyForecastQuery ... | import org.openweathermap.api.DataWeatherClient;
import org.openweathermap.api.UrlConnectionDataWeatherClient;
import org.openweathermap.api.model.forecast.ForecastInformation;
import org.openweathermap.api.model.forecast.hourly.HourlyForecast;
import org.openweathermap.api.query.Language;
import org.openweathermap.api... | /*
* Copyright 2021, Yurii Serhiichuk
*
* 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... | .language(Language.ENGLISH) // in English | 4 |
Apptitive/BanglaHadith | app/src/main/java/com/hadithbd/banglahadith/ui/BookCategoryListActivity.java | [
"public class BookCategoryListAdapter extends RecyclerView.Adapter<BookCategoryListAdapter.ViewHolder> implements View.OnClickListener {\n\n\n private BookCategoryItemClickListener mBookCategoryItemClickListener;\n\n private List<BookTypeInfo> mBookTypeInfoList;\n\n private String mBook, mCountSuffix;\n\n... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.hadithbd.banglahadith.R;
import com.hadithbd.banglahadith.adapters.BookCategoryListAdapter;
import com.hadithbd.... | package com.hadithbd.banglahadith.ui;
public class BookCategoryListActivity extends BaseActivity implements BookCategoryListAdapter.BookCategoryItemClickListener{
private RecyclerView mRecyclerView;
private List<BookTypeInfo> mBookTypeInfoList;
private BookCategoryListAdapter mBookCategoryListAdapter;
... | actionBar.setTitle(UtilBanglaSupport.getBanglaSpannableString("")); | 1 |
awslabs/amazon-sqs-java-messaging-lib | src/main/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetch.java | [
"public interface Acknowledger {\n\n /**\n * Generic Acknowledge method. This method will delete message(s) in SQS Queue.\n * \n * @param message\n * message to acknowledge.\n * @throws JMSException\n */\n public void acknowledge(SQSMessage message) throws JMSException;\n\n ... | import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.MessageListener;
import org.apache.commons.logging.Log;
impo... |
if (messages != null && !messages.isEmpty()) {
processReceivedMessages(messages);
}
} catch (InterruptedException e) {
nackQueueMessages = true;
break;
} catch (Throwable e) {
LOG.error("Unexpect... | jmsMessage = new SQSTextMessage(acknowledger, queueUrl, message); | 6 |
spearal/spearal-java | src/main/java/org/spearal/impl/descriptor/FilteredBeanDescriptorFactoryImpl.java | [
"public interface SpearalContext {\n\n\tvoid configure(Configurable configurable);\n\tvoid configure(Configurable configurable, boolean append);\n\t\n\tSecurizer getSecurizer();\n\t\n\tString alias(Class<?> cls);\n\tString unalias(String aliasedClassName);\n\t\n\tClass<?> loadClass(String classNames, Type target)\n... | import org.spearal.SpearalContext;
import org.spearal.SpearalPropertyFilter;
import org.spearal.configuration.FilteredBeanDescriptorFactory;
import org.spearal.configuration.PartialObjectFactory.ExtendedPartialObjectProxy;
import org.spearal.configuration.PartialObjectFactory.PartialObjectProxy;
import org.spearal.conf... | /**
* == @Spearal ==>
*
* Copyright (C) 2014 Franck WOLFF & William DRAI (http://www.spearal.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/... | if (value instanceof ExtendedPartialObjectProxy) | 3 |
codetoart/r2-streamer-java | server/src/main/java/com/readium/r2_streamer/server/EpubServer.java | [
"public class EpubFetcher implements Fetcher {\n private final String TAG = \"EpubFetcher\";\n public Container container;\n public EpubPublication publication;\n private String rootFileDirectory;\n\n public EpubFetcher(Container container, EpubPublication publication) throws EpubFetcherException {\n... | import com.readium.r2_streamer.fetcher.EpubFetcher;
import com.readium.r2_streamer.fetcher.EpubFetcherException;
import com.readium.r2_streamer.model.container.Container;
import com.readium.r2_streamer.model.publication.EpubPublication;
import com.readium.r2_streamer.parser.EpubParser;
import com.readium.r2_streamer.se... | package com.readium.r2_streamer.server;
/**
* Created by Shrikant Badwaik on 20-Jan-17.
*/
public class EpubServer extends RouterNanoHTTPD {
private static final String SEARCH_QUERY_HANDLE = "/search";
private static final String MANIFEST_HANDLE = "/manifest";
private static final String MANIFEST_ITEM... | addRoute(filePath + SEARCH_QUERY_HANDLE, SearchQueryHandler.class, fetcher); | 7 |
yinyiliang/RabbitCloud | app/src/main/java/yyl/rabbitcloud/main/MainActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n\n protected Toolbar mToolbar;\n private TextView mTitleView;\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n requestLayout();\n ButterKnife.bind... | import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.os.Bundle;
import android.widget.FrameLayout;
import butterknife.BindView;
import me.majiajie.pagerbottomtabstrip.ItemController;
import me.majiajie.pagerbottomtabst... | package yyl.rabbitcloud.main;
public class MainActivity extends BaseActivity {
@BindView(R.id.main_content)
FrameLayout mContentLayout;
@BindView(R.id.main_bottom_view)
PageBottomTabLayout mNavigationView;
private ItemController mItemController; | private HomeFragment mHomeFragment; | 3 |
hcordeiro/InthegraApp | InthegraApp/src/main/java/com/hcordeiro/android/InthegraApp/Activities/MenuPrincipalActivity.java | [
"public class LinhasMenuActivity extends AppCompatActivity {\n private final String TAG = \"DetailParada\";\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n Log.d(TAG, \"OnCreate Called\");\n super.onCreate(savedInstanceState);\n setContentView(R.layout.linhas_men... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import com.google.android.gms.ads.MobileAds;
i... | package com.hcordeiro.android.InthegraApp.Activities;
public class MenuPrincipalActivity extends AppCompatActivity {
String TAG = "MenuPrincipal";
FirebaseAnalytics mFirebaseAnalytics;
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d(TAG, "OnCreate Called");
super... | Intent intent = new Intent(this, ParadasMenuActivity.class); | 1 |
miguelbcr/RxGpsService | app/src/main/java/com/miguelbcr/rx_gpsservice/app/RouteFragment.java | [
"public class RxGpsService extends Service implements RxGpsServiceView {\n private static RxGpsService instance;\n private static Listener listener;\n private static GpsConfig gpsConfig;\n private NotificationFactory notificationFactory;\n private RxGpsPresenter rxGpsPresenter;\n private Observable<RouteStats... | import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v... | RxGpsService.instance().stopChrono();
}
private void playChrono() {
setPreferenceIsPlaying(getContext(), true);
ib_play.setImageResource(getPreferenceIsPlaying(getContext()) ? R.drawable.ic_pause : R.drawable.ic_play_arrow);
if (RxGpsService.isServiceStarted())
... | if (throwable instanceof PermissionDeniedException) { | 2 |
OlliV/angr | workspace/Angr/src/fi/hbp/angr/GdxGame.java | [
"public class GameState {\n /**\n * Grenade counter.\n */\n public class Grenades {\n /**\n * Amount of grenades at the beginning.\n */\n public final int originalCount;\n /**\n * Current count.\n */\n private int count;\n\n /**\n ... | import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import fi.hbp.angr.logic.GameState;
import fi.hbp.angr.models.levels.Level;
import fi.hbp.angr.screens.GameScreen;
import fi.hbp.angr.screens.MainMenuScreen;
import fi.hbp.angr.screens.PauseScreen;
import fi.hbp.angr.scre... | package fi.hbp.angr;
public class GdxGame extends Game {
/**
* Main menu.
*/
private MainMenuScreen mainMenu;
/**
* Actual game is on this screen.
*/
private GameScreen gameScreen;
/**
* Game summary/score is shown on this screen.
*/
| private SummaryScreen gameEnd;
| 5 |
bootique/bootique-job | bootique-job-instrumented/src/main/java/io/bootique/job/instrumented/InstrumentedJobRegistry.java | [
"public interface Job {\n\n\tJobMetadata getMetadata();\n\n\tJobResult run(Map<String, Object> params);\n}",
"public class JobMetadata {\n\n private String name;\n private Collection<JobParameterMetadata<?>> parameters;\n\n JobMetadata(String name, Collection<JobParameterMetadata<?>> parameters) {\n ... | import java.util.Set;
import io.bootique.job.Job;
import io.bootique.job.JobMetadata;
import io.bootique.job.MappedJobListener;
import io.bootique.job.config.JobDefinition;
import io.bootique.job.scheduler.Scheduler;
import io.bootique.job.scheduler.execution.DefaultJobRegistry;
import io.bootique.job.scheduler.executi... | /*
* Licensed to ObjectStyle LLC under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ObjectStyle LLC licenses
* this file to you under the Apache License, Version 2.0 (the
* "License"); you may not u... | Collection<Job> standaloneJobs, | 0 |
olerass/presenter-first-android | chapter1-geoquiz/app/src/main/java/com/olerass/pfexample/android/geoquiz/platform/QuizActivity.java | [
"public class Question {\n private String text;\n private boolean correctAnswer;\n\n public Question(String text, boolean correctAnswer) {\n this.text = text;\n this.correctAnswer = correctAnswer;\n }\n\n public String getText() {\n return text;\n }\n\n public boolean getCo... | import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.olerass.pfexample.android.geoquiz.R;
import com.olerass.pfexample.android.geoquiz.domain.question.Question;
import com.olerass.pfexample.android.geoquiz.domain.question.QuestionModel;
import com.olerass.pfexample.android.geoquiz.domai... | package com.olerass.pfexample.android.geoquiz.platform;
public class QuizActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
| QuestionModel model = new StandardQuestionModel(new Question(getString(R.string.question_text), false)); | 0 |
jpatanooga/KnittingBoar | src/test/java/com/cloudera/knittingboar/metrics/Test20NewsApplyModel.java | [
"public class InputRecordsSplit {\n \n TextInputFormat input_format = null;\n InputSplit split = null;\n JobConf jobConf = null;\n \n RecordReader<LongWritable,Text> reader = null;\n LongWritable key = null;\n \n final Reporter voidReporter = Reporter.NULL;\n \n public InputRecordsSplit(JobConf jobConf, ... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.commons.compress.archivers.ArchiveException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.... | /**
* 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 may... | c.set( "com.cloudera.knittingboar.setup.RecordFactoryClassname", RecordFactory.TWENTYNEWSGROUPS_RECORDFACTORY); | 1 |
urandom/gearshift | gearshift/src/test/java/org/sugr/gearshift/unit/service/TransmissionSessionManagerTest.java | [
"public final class G {\n public static final String PREF_DEBUG = \"debug\";\n\n public static final String PREF_SHOW_STATUS = \"show_status\";\n public static final String PREF_SHOW_ADD_DIALOG = \"show_add_dialog\";\n public static final String PREF_DELETE_DATA = \"delete_data\";\n public static fin... | import android.app.Activity;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.util.Base64;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.... | package org.sugr.gearshift.unit.service;
@RunWith(RobolectricGradleTestRunner.class)
@Config(constants = BuildConfig.class)
public class TransmissionSessionManagerTest {
private ConnectivityManager connMananager;
private SharedPreferences defaultPrefs;
private TransmissionProfile profile; | private DataSource dataSource; | 4 |
CESNET/perun | perun-core/src/main/java/cz/metacentrum/perun/core/impl/modules/attributes/urn_perun_user_attribute_def_def_vsupExchangeMail.java | [
"public interface AttributesManager {\n\n\tString NS_FACILITY_ATTR = \"urn:perun:facility:attribute-def\";\n\tString NS_FACILITY_ATTR_DEF = \"urn:perun:facility:attribute-def:def\";\n\tString NS_FACILITY_ATTR_OPT = \"urn:perun:facility:attribute-def:opt\";\n\tString NS_FACILITY_ATTR_CORE = \"urn:perun:facility:attr... | import cz.metacentrum.perun.core.api.Attribute;
import cz.metacentrum.perun.core.api.AttributeDefinition;
import cz.metacentrum.perun.core.api.AttributesManager;
import cz.metacentrum.perun.core.api.User;
import cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException;
import cz.metacentrum.perun.core.api.e... | package cz.metacentrum.perun.core.impl.modules.attributes;
/**
* Attribute module for Primary school mail at VŠUP.
* Expected format is "firstName.lastName[counter]@umprum.cz"
* Artistic names have preference over normal: "u:d:artisticFirstName", "u:d:artisticLastName".
* Value can be empty or manually changed ... | vsupExchangeMailAliasesAttribute = session.getPerunBl().getAttributesManagerBl().getAttribute(session, user, vsupExchangeMailAliasesUrn); | 3 |
UKPLab/emnlp2017-claim-identification | src/main/java/de/tudarmstadt/ukp/dkpro/argumentation/crossdomainclaims/experiments/InDomainSampledCVLibSvm.java | [
"public class ExperimentUtils\n{\n\n public final static String MATRIX_PATH = \"/matrices/\";\n public final static String OUTCOME_PATH = \"/outcome/\";\n public final static String PREDICTIONS_PATH = \"/predictions/\";\n\n public final static String EVAL_FILE = \"evaluation.txt\";\n public final sta... | import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.experiments.utils.ExperimentUtils;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.discourse.PDTBDiscourseFeatures;
import de.tudarmstadt.ukp.dkpro.argumentation.crossdomainclaims.features.embeddings.EmbeddingFeatures;
import de.tu... | /*
* Copyright 2017
* Ubiquitous Knowledge Processing (UKP) Lab
* Technische Universität Darmstadt
*
* 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/lice... | discFeatures.add(LastComponentInParagraph.class.getName()); | 5 |
cqyijifu/OpenFalcon-SuitAgent | src/main/java/com/yiji/falcon/agent/plugins/plugin/oracle/OraclePlugin.java | [
"public enum CounterType {\n /**\n * 用户上传什么样的值,就原封不动的存储\n */\n GAUGE,\n /**\n * 指标在存储和展现的时候,会被计算为speed,即(当前值 - 上次值)/ 时间间隔\n */\n COUNTER\n}",
"@Data\npublic class FalconReportObject implements Cloneable{\n\n /**\n * 标明Metric的主体(属主),比如metric是cpu_idle,那么Endpoint就表示这是哪台机器的cpu_idle... | import com.yiji.falcon.agent.falcon.CounterType;
import com.yiji.falcon.agent.falcon.FalconReportObject;
import com.yiji.falcon.agent.falcon.MetricsType;
import com.yiji.falcon.agent.plugins.JDBCPlugin;
import com.yiji.falcon.agent.plugins.metrics.MetricsCommon;
import com.yiji.falcon.agent.plugins.util.PluginActivateT... | /*
* www.yiji.com Inc.
* Copyright (c) 2016 All Rights Reserved
*/
package com.yiji.falcon.agent.plugins.plugin.oracle;
/*
* 修订记录:
* guqiu@yiji.com 2016-06-28 11:07 创建
*/
/**
* @author guqiu@yiji.com
*/
@Slf4j
public class OraclePlugin implements JDBCPlugin {
private final List<JDBCConnectionInfo> conne... | public Collection<FalconReportObject> inbuiltReportObjectsForValid(Connection connection) throws SQLException, ClassNotFoundException { | 1 |
respoke/respoke-sdk-android | respokeSDKTest/src/androidTest/java/com/digium/respokesdktest/functional/ConnectionTests.java | [
"public class Respoke {\n\n public final static int GUID_STRING_LENGTH = 36; // The length of GUID strings\n\n private static Respoke _instance;\n private static boolean factoryStaticInitialized;\n private String pushToken;\n private ArrayList<RespokeClient> instances;\n private Context context;\n... | import android.util.Log;
import com.digium.respokesdk.Respoke;
import com.digium.respokesdk.RespokeCall;
import com.digium.respokesdk.RespokeClient;
import com.digium.respokesdk.RespokeDirectConnection;
import com.digium.respokesdk.RespokeEndpoint;
import com.digium.respokesdk.RespokeGroup;
import com.digium.respokesdk... | /**
* Copyright 2015, Digium, Inc.
* All rights reserved.
*
* This source code is licensed under The MIT License found in the
* LICENSE file in the root directory of this source tree.
*
* For all details and documentation: https://www.respoke.io
*/
package com.digium.respokesdktest.functional;
public cla... | RespokeEndpoint endpoint; | 4 |
brettwooldridge/NuProcess | src/main/java/com/zaxxer/nuprocess/windows/NuKernel32.java | [
"class DWORD extends IntegerType\n{\n public static final int SIZE = 4;\n\n public DWORD()\n {\n this(0);\n }\n\n public DWORD(long value)\n {\n super(SIZE, value, true);\n }\n}",
"class HANDLE extends PointerType\n{\n static final Pointer INVALID = Pointer.createConstant(Native.POINTER_... | import com.zaxxer.nuprocess.windows.NuWinNT.SECURITY_ATTRIBUTES;
import com.zaxxer.nuprocess.windows.NuWinNT.PROCESS_INFORMATION;
import com.zaxxer.nuprocess.windows.NuWinNT.STARTUPINFO;
import com.zaxxer.nuprocess.windows.NuWinNT.ULONG_PTRByReference;
import com.zaxxer.nuprocess.windows.NuWinNT.ULONG_PTR;
import java.... | /*
* Copyright (C) 2013 Brett Wooldridge
*
* 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... | char[] lpCurrentDirectory, STARTUPINFO lpStartupInfo, PROCESS_INFORMATION lpProcessInformation); | 4 |
NICMx/rdap-server | src/main/java/mx/nic/rdap/server/util/PrivacyUtil.java | [
"public enum PrivacyStatus {\n\tOWNER, AUTHENTICATED, ANY, NONE;\n\n\tprivate PrivacyStatus() {\n\t}\n\n}",
"public class RdapConfiguration {\n\tprivate static Properties systemProperties;\n\n\t// property keys\n\tprivate static final String LANGUAGE_KEY = \"language\";\n\tprivate static final String MINIMUN_SEAR... | import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import javax.servlet.ServletContext;
import mx.nic.r... | package mx.nic.rdap.server.util;
public class PrivacyUtil {
private static Map<String, Map<String, PrivacySetting>> OBJECTS_PRIVACY_SETTING = new HashMap<>();
// ***** Names of the properties files *****
public static final String ENTITY = "entity";
public static final String ENTITY_PUBLIC_ID = "entity_public... | ObscuredPrivacy privacySetting = ObscuredPrivacy.create(textToShow); | 3 |
bourgesl/marlin-renderer | src/main/java/org/marlin/pisces/RendererContext.java | [
"public abstract class Path2D implements Shape, Cloneable {\n /**\n * An even-odd winding rule for determining the interior of\n * a path.\n *\n * @see PathIterator#WIND_EVEN_ODD\n * @since 1.6\n */\n public static final int WIND_EVEN_ODD = PathIterator.WIND_EVEN_ODD;\n\n /**\n ... | import static org.marlin.pisces.MarlinUtils.getCallerInfo;
import static org.marlin.pisces.MarlinUtils.logInfo;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicInteger;
import org.marlin.geom.Path2D;
import static org.marlin.pisces.ArrayCache.*;
import or... | /*
* Copyright (c) 2015, 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 Softwa... | + "\tfrom=\t" + getCallerInfo(className)); | 3 |
AndyGu/ShanBay | src/com/shanbay/words/review/experience/ExpSpellView.java | [
"public class WordsSoundPlayer\n{\n private View mAudioButton;\n private WordsClient mClient;\n private MediaPlayer.OnCompletionListener mOnCompletionListener = new MediaPlayer.OnCompletionListener()\n {\n public void onCompletion(MediaPlayer paramAnonymousMediaPlayer)\n {\n if (WordsSoundPlayer.this... | import android.view.ViewGroup;
import android.widget.TextView;
import com.shanbay.words.WordsSoundPlayer;
import com.shanbay.words.activity.WordsActivity;
import com.shanbay.words.model.ReviewData;
import com.shanbay.words.model.VocabularyData;
import com.shanbay.words.view.SpellView;
import java.util.regex.Matcher;
im... | package com.shanbay.words.review.experience;
public class ExpSpellView extends SpellView
{
private WordsActivity mActivity;
private String mAudioUrl;
private boolean mIsEnableCollins;
public ExpSpellView(WordsActivity paramWordsActivity, ViewGroup paramViewGroup, boolean paramBoolean, String paramString)
{... | VocabularyData localVocabularyData = paramReviewData.getVocabulary(); | 3 |
peckb1/autojackson | examples/src/test/java/com/github/peckb1/examples/auto/TestModel.java | [
"@AutoJackson\npublic interface Boober extends Fraggle<DaveGoelz> {\n\n @Named(\"superstitions\") long getNumberOfSuperstitions();\n\n}",
"@AutoJackson\npublic interface Gobo<X extends Number> extends Fraggle<JerryNelson> {\n\n @Named(\"postcards\") int getFetchedPostcards();\n\n X getX();\n\n @Named(... | import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.github.peckb1.examp... | package com.github.peckb1.examples.auto;
public class TestModel {
private ObjectMapper objectMapper;
@Before
public void setUp() throws Exception {
this.objectMapper = new ObjectMapper();
this.objectMapper.registerModule(new JavaTimeModule());
this.objectMapper.registerModule(n... | assertEquals(FraggleName.BOOBER, fraggle.getName()); | 7 |
bjuvensjo/rsimulator | rsimulator-core/src/main/java/com/github/bjuvensjo/rsimulator/core/config/CoreModule.java | [
"@Singleton\npublic class JsonHandler extends AbstractHandler {\n private final Logger log = LoggerFactory.getLogger(JsonHandler.class);\n private final ObjectMapper mapper = new ObjectMapper();\n\n private String escape(JsonNode node) {\n if (node.isArray()) {\n return StreamSupport.stre... | import com.github.bjuvensjo.rsimulator.core.*;
import com.github.bjuvensjo.rsimulator.core.handler.regexp.JsonHandler;
import com.github.bjuvensjo.rsimulator.core.handler.regexp.TxtHandler;
import com.github.bjuvensjo.rsimulator.core.handler.regexp.XmlHandler;
import com.github.bjuvensjo.rsimulator.core.util.FileUtils;... | package com.github.bjuvensjo.rsimulator.core.config;
/**
* CoreModule holds Guice configurations.
*/
public class CoreModule extends AbstractModule {
private final Logger log = LoggerFactory.getLogger(CoreModule.class);
private static final CacheManager cacheManager = CacheManager.create();
@Provides
... | PropsCacheInterceptor propsCacheInterceptor = new PropsCacheInterceptor(); | 5 |
3pillarlabs/spring-integration-aws | spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/core/SnsExecutor.java | [
"public abstract class AwsUtil {\n\n\tpublic abstract static class AddPermissionHandler {\n\n\t\tpublic abstract void execute(Permission p);\n\t}\n\n\tpublic static void addPermissions(Map<String, String> attributes,\n\t\t\tSet<Permission> permissions, AddPermissionHandler handler) {\n\n\t\tString policyStr = attri... | import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.integration.Message;
impo... | package org.springframework.integration.aws.sns.core;
/**
* Bundles common core logic for the Sns components.
*
* @author Sayantam Dey
* @since 1.0
*
*/
public class SnsExecutor implements InitializingBean, DisposableBean {
private final Log log = LogFactory.getLog(SnsExecutor.class);
private String top... | private Map<String, SqsExecutor> sqsExecutorMap; | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.