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 |
|---|---|---|---|---|---|---|
sunhong/jcurses | src/jcurses/widgets/TextComponent.java | [
"public interface ValueChangedListener extends Listener {\r\n\t\r\n /**\r\n * The method will be called by an widget, generating <code>ValueChangedEvent</code> instances,\r\n * if the listener has been registered by it.\r\n * \r\n * @param event the event occured\r\n */\r\n\tpublic abstract void ... | import java.util.ArrayList;
import jcurses.event.ValueChangedListener;
import jcurses.event.ValueChangedListenerManager;
import jcurses.event.ValueChangedEvent;
import jcurses.system.Toolkit;
import jcurses.system.CharColor;
import jcurses.system.InputChar;
import jcurses.util.Rectangle;
import jcurses.util.Pag... | protected int getTextHeight() {
return _lines.size();
}
protected int getTextWidth() {
int result = 0;
for (int i=0; i<_lineLengths.size(); i++) {
int value = ((Integer)_lineLengths.get(i)).intValue();
if (value > result) {
result = value;
}
}
return result;
}
private void... | private static CharColor __bgDefaultColors =
| 3 |
raphaeljolivet/java2typescript | java2typescript-jaxrs/src/main/java/java2typescript/jaxrs/ServiceDescriptorGenerator.java | [
"public class DefinitionGenerator {\n\n\tprivate final ObjectMapper mapper;\n\n\tpublic DefinitionGenerator(ObjectMapper mapper) {\n\t\tthis.mapper = mapper;\n\t}\n\n\t/**\n\t * @param module\n\t * Module to be filled with named types (classes, enums, ...)\n\t * @param classes\n\t * Class for ... | import static java2typescript.jaxrs.model.ParamType.BODY;
import static java2typescript.jaxrs.model.ParamType.FORM;
import static java2typescript.jaxrs.model.ParamType.PATH;
import static java2typescript.jaxrs.model.ParamType.QUERY;
import java.beans.Introspector;
import java.io.IOException;
import java.io.StringWriter... | /*******************************************************************************
* Copyright 2013 Raphael Jolivet
*
* 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.apa... | RestMethod restMethod = generateMethod(method); | 7 |
Whiley/WhileyTheoremProver | src/main/java/wyal/util/TypeChecker.java | [
"public static interface Named extends Declaration {\n\n\tpublic Name getName();\n\n\tpublic Tuple<VariableDeclaration> getParameters();\n\n\tpublic static abstract class FunctionOrMacro extends AbstractSyntacticItem implements Named {\n\t\tpublic FunctionOrMacro(Name name, Tuple<VariableDeclaration> parameters, St... | import wybs.lang.SyntacticItem;
import static wyal.lang.WyalFile.*;
import java.util.List;
import wyal.lang.*;
import wyal.lang.WyalFile.Declaration.Named;
import wyfs.util.ArrayUtils;
import wyfs.util.Pair;
import wyfs.lang.Path;
import wytp.types.TypeInferer.Environment;
import wytp.types.util.StdTypeEnvironment;
imp... | private Type checkArithmeticOperator(Environment env, Expr.Operator expr) {
checkOperands(env, expr, new Type.Int());
return new Type.Int();
}
/**
* Check the type for a given arithmetic operator. Such an operator has the
* type bool, and all children should also produce values of type int.
*
* @param e... | } catch (NameResolver.ResolutionError e) { | 6 |
flipkart-incubator/BlueShift | src/main/java/com/flipkart/fdp/migration/db/api/CBatchRunsApi.java | [
"public class DBInitializer {\n\n\tprivate SessionFactory sessionFactory = null;\n\n\tprivate DBConfig config = null;\n\n\tprivate IBatchDao batchDao = null;\n\n\tprivate IBatchRunsDao batchRunDao = null;\n\n\tprivate IMapperDetailsDao mapperDetailsDao = null;\n\n\tpublic DBInitializer(DBConfig config) {\n\t\tthis.... | import java.util.List;
import com.flipkart.fdp.migration.db.DBInitializer;
import com.flipkart.fdp.migration.db.core.IBatchRunsDao;
import com.flipkart.fdp.migration.db.models.BatchRun;
import com.flipkart.fdp.migration.db.models.Status;
import com.flipkart.fdp.migration.db.utils.EBase;
import com.flipkart.fdp.migratio... | /*
*
* Copyright 2015 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | public BatchRun createBatchRun(long batchId, String jobId, | 2 |
taoneill/war | war/src/main/java/com/tommytony/war/command/DeleteTeamCommand.java | [
"public class Team {\n\tprivate final Warzone warzone;\n\tRandom teamSpawnRandomizer = new Random();\n\tprivate List<Player> players = new ArrayList<Player>();\n\tprivate List<Player> teamChatPlayers = new ArrayList<Player>();\n\tprivate List<Location> teamSpawns;\n\tprivate Location teamFlag = null;\n\tprivate Str... | import java.util.logging.Level;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.tommytony.war.Team;
import com.tommytony.war.War;
import com.tommytony.war.Warzone;
import com.tommytony.war.config.TeamKind;
import com.tommytony.war.mapper.WarzoneYmlMapper;
import com.tommytony.war.st... | package com.tommytony.war.command;
/**
* Deletes a team.
*
* @author Tim Düsterhus
*/
public class DeleteTeamCommand extends AbstractZoneMakerCommand {
public DeleteTeamCommand(WarCommandHandler handler, CommandSender sender, String[] args) throws NotZoneMakerException {
super(handler, sender, args);
}
@... | Team team = zone.getTeamByKind(TeamKind.teamKindFromString(this.args[0])); | 3 |
googleapis/java-iamcredentials | google-cloud-iamcredentials/src/main/java/com/google/cloud/iam/credentials/v1/stub/GrpcIamCredentialsStub.java | [
"public final class GenerateAccessTokenRequest extends com.google.protobuf.GeneratedMessageV3\n implements\n // @@protoc_insertion_point(message_implements:google.iam.credentials.v1.GenerateAccessTokenRequest)\n GenerateAccessTokenRequestOrBuilder {\n private static final long serialVersionUID = 0L;\n //... | import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.rpc.ClientContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.g... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | private static final MethodDescriptor<GenerateIdTokenRequest, GenerateIdTokenResponse> | 2 |
GlitchCog/ChatGameFontificator | src/main/java/com/glitchcog/fontificator/gui/controls/panel/ControlPanelChat.java | [
"public class ConfigChat extends Config\n{\n public static final int MIN_CHROMA_CORNER_RADIUS = 0;\n public static final int MAX_CHROMA_CORNER_RADIUS = 128;\n\n /**\n * Whether the chat is scrollable by rolling the mouse wheel\n */\n private Boolean scrollable;\n\n /**\n * Whether the cha... | import java.awt.Component;
import java.awt.Dimension;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentEv... | package com.glitchcog.fontificator.gui.controls.panel;
/**
* Control Panel containing all the Chat Window options
*
* @author Matt Yanos
*/
public class ControlPanelChat extends ControlPanelBase
{
private static final long serialVersionUID = 1L;
private JCheckBox resizableBox;
private JCheckBox s... | private ControlWindow ctrlWindow; | 6 |
neva-dev/felix-search-webconsole-plugin | src/main/java/com/neva/felix/webconsole/plugins/search/rest/BundleAssembleServlet.java | [
"public enum MessageType {\n SUCCESS,\n ERROR\n}",
"public static void writeMessage(HttpServletResponse response, MessageType type, String text)\n throws IOException {\n writeMessage(response, type, text, Collections.<String, Object>emptyMap());\n}",
"public class BundleJar {\n\n private Bund... | import static com.neva.felix.webconsole.plugins.search.utils.JsonUtils.MessageType;
import static com.neva.felix.webconsole.plugins.search.utils.JsonUtils.writeMessage;
import com.google.common.collect.Lists;
import com.neva.felix.webconsole.plugins.search.core.BundleJar;
import com.neva.felix.webconsole.plugins.search... | package com.neva.felix.webconsole.plugins.search.rest;
public class BundleAssembleServlet extends RestServlet {
private static final Logger LOG = LoggerFactory.getLogger(BundleAssembleServlet.class);
public static final String ALIAS_NAME = "bundle-assemble";
private final SearchMonitor<BundleAssembleJ... | final Set<BundleJar> bundles = osgiExplorer.findBundleJars(params.getBundleIds()); | 2 |
DigitasLbiMobile/AndroidTextExtensions | AndroidTextExtensionsPlugin/src/digitaslbi/ext/plugin/AndroidTextExtensionsPlugin.java | [
"public class FontFamily {\n\n protected final String mName;\n protected final List<Font> mFonts = new ArrayList<Font>();\n\n public FontFamily(String name) {\n mName = capitalize(name);\n }\n\n public FontFamily(String name, Font... fonts) {\n this(name);\n checkNotNull(fonts);\... | import com.android.builder.model.SourceProvider;
import com.android.tools.idea.gradle.parser.BuildFileKey;
import com.android.tools.idea.gradle.parser.Dependency;
import com.android.tools.idea.gradle.parser.Dependency.Scope;
import com.android.tools.idea.gradle.parser.Dependency.Type;
import com.android.tools.idea.grad... | /*
* Copyright (c) 2015 DigitasLBi.
* 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 writin... | final FontFamilyStyleGenerator styleGenerator = new FontFamilyStyleGenerator.Builder().build(); | 2 |
tomaswolf/gerrit-gitblit-plugin | src/main/java/com/googlesource/gerrit/plugins/gitblit/GitBlitServletModule.java | [
"@Singleton\npublic class RawServlet extends HttpServlet {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tprivate transient Logger logger = LoggerFactory.getLogger(RawServlet.class);\n\n\tprivate final IRuntimeManager runtimeManager;\n\n\tprivate final IRepositoryManager repositoryManager;\n\n\t@Inject\... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.gitblit.AvatarGenerator;
import com.gitblit.GravatarGenerator;
import com.gitblit.IStoredSettings;
import com.gitblit.guice.IPublicKeyManagerProvider;
import com.gitblit.guice.WorkQueueProvider;
import com.gitblit.manager.FederationManager;
import com.... | // Copyright (C) 2012 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... | bind(IAuthenticationManager.class).to(GerritGitBlitAuthenticationManager.class); | 5 |
diadoc/diadocsdk-java | src/main/java/Diadoc/Api/print/PrintFormClient.java | [
"public class DiadocSdkException extends Exception {\n public DiadocSdkException(Exception ex) {\n super(ex);\n }\n\n public DiadocSdkException(String message) {\n super(message);\n }\n\n private String formatMessage(Throwable[] exceptions) {\n String text = super.toString();\n ... | import Diadoc.Api.exceptions.DiadocSdkException;
import Diadoc.Api.print.models.DocumentProtocolResult;
import Diadoc.Api.print.models.DocumentZipResult;
import Diadoc.Api.print.models.PrintFormContent;
import Diadoc.Api.print.models.PrintFormResult;
import Diadoc.Api.helpers.Tools;
import Diadoc.Api.httpClient.DiadocH... | package Diadoc.Api.print;
public class PrintFormClient {
private DiadocHttpClient diadocHttpClient;
public PrintFormClient(DiadocHttpClient diadocHttpClient) {
this.diadocHttpClient = diadocHttpClient;
}
public PrintFormResult generatePrintForm(String boxId, String messageId, String docume... | return new PrintFormResult(new PrintFormContent(response.getContentType(), response.getFileName(), response.getContent())); | 3 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/service/impl/FeatureServiceImpl.java | [
"public class Event {\n\n public Event() {\n // left deliberately empty\n }\n\n public Event(final EventType type, final String additionalData) {\n this.type = type;\n this.additionalData = additionalData;\n }\n\n private EventType type;\n\n private String additionalData;\n\n ... | import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.service.FeatureService;
import com.jeanchampemont.wtfdyum.service.feature.FeatureStrategy;
import com.jeanchampemont.wtfdyum.utils.WTFDYUMException;
import org.springframework.stereotype.Service... | /*
* Copyright (C) 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Un... | public void completeCron(final Long userId, final Feature feature) throws WTFDYUMException { | 4 |
pmarques/SocketIO-Server | SocketIO-Netty/src/test/java/eu/k2c/socket/io/ci/usecases/UC03Handler.java | [
"public abstract class AbstractHandler extends AbstractSocketIOHandler {\n\t@Override\n\tpublic boolean validate(String URI) {\n\t\t// This isn't belongs to socketIO Spec AFAIK\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventReg... | import eu.k2c.socket.io.server.api.SocketIOSessionNSRegister;
import eu.k2c.socket.io.server.exceptions.SocketIOException;
import org.apache.log4j.Logger;
import eu.k2c.socket.io.ci.AbstractHandler;
import eu.k2c.socket.io.server.api.SocketIOOutbound;
import eu.k2c.socket.io.server.api.SocketIOSessionEventRegister; | /**
* Copyright (C) 2011 K2C @ Patrick Marques <patrickfmarques@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights ... | public void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventRegister, | 2 |
jajja/jorm | src/main/java/com/jajja/jorm/Transaction.java | [
"public static class Value {\n private Composite composite;\n private Object[] values;\n\n private Value(Composite composite, Object ... values) {\n this.composite = composite;\n this.values = values;\n }\n\n public Composite getComposite() {\n return composite;\n }\n\n pub... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Savepoint;
import java.sql.Statement;
imp... | * the class defining the table mapping.
* @param column
* the column to use as key.
* @param query
* the query.
* @return the matched records.
* @throws SQLException
* if a database access error occurs or the generated SQL
* ... | Field field = row.field(foreignKeyColumn); | 5 |
segator/proxylive | src/main/java/com/github/segator/proxylive/processor/RemoteTranscodeStreamProcessor.java | [
"public class RemoteTranscoder {\n private String endpoint;\n private String profile;\n\n public static RemoteTranscoder CreateFrom(RemoteTranscoder remoteTranscoder) {\n RemoteTranscoder rt= new RemoteTranscoder();\n rt.setEndpoint(remoteTranscoder.getEndpoint());\n rt.setProfile(remo... | import java.io.IOException;
import java.util.Objects;
import com.github.segator.proxylive.config.RemoteTranscoder;
import com.github.segator.proxylive.stream.ClientBroadcastedInputStream;
import com.github.segator.proxylive.tasks.IStreamTask;
import com.github.segator.proxylive.tasks.ProcessorTasks;
import com.github.s... | /*
* The MIT License
*
* Copyright 2017 Isaac Aymerich <isaac.aymerich@gmail.com>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation t... | private ProcessorTasks tasks; | 3 |
luboganev/dejalist | DejalistApp/src/com/luboganev/dejalist/ui/CategoryDialogFragment.java | [
"public class ColorPicker extends View {\n\t/*\n\t * Constants used to save/restore the instance state.\n\t */\n\tprivate static final String STATE_PARENT = \"parent\";\n\tprivate static final String STATE_ANGLE = \"angle\";\n\tprivate static final String STATE_OLD_COLOR = \"color\";\n\n\t/**\n\t * Colors to constr... | import static nl.qbusict.cupboard.CupboardFactory.cupboard;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.support.v4.app.DialogFragm... | package com.luboganev.dejalist.ui;
public class CategoryDialogFragment extends DialogFragment {
@InjectView(R.id.category_picker) ColorPicker picker;
@InjectView(R.id.category_value_bar) ValueBar valueBar;
@InjectView(R.id.category_saturation_bar) SaturationBar saturationBar;
@InjectView(R.id.et_category_name) E... | public void onCategoryCreated(Category category); | 4 |
bitkylin/BitkyShop | Android/bitkyShop/app/src/main/java/cc/bitky/bitkyshop/fragment/userfragment/addressactivity/AddressOptionActivity.java | [
"public class ReceiveAddress extends BmobObject implements Serializable {\n\n private String userObjectId;\n private String username;\n private String name;\n private String phone;\n private String address;\n private Boolean isDefault;\n\n public ReceiveAddress() {\n }\n\n public ReceiveAddress(String user... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.CheckBox;
i... | package cc.bitky.bitkyshop.fragment.userfragment.addressactivity;
public class AddressOptionActivity extends AppCompatActivity implements View.OnClickListener {
private AddressOptionPresenter presenter;
private ToastUtil toastUtil;
private KyBaseRecyclerAdapter<ReceiveAddress> recyclerAdapter;
private String... | KyToolBar kyToolBar = (KyToolBar) findViewById(R.id.addressOptionActivity_kyToolbar); | 2 |
vy/hrrs | replayer/src/main/java/com/vlkan/hrrs/replayer/cli/Replayer.java | [
"public interface HttpRequestRecord {\n\n String getId();\n\n Date getTimestamp();\n\n String getGroupName();\n\n String getUri();\n\n HttpRequestMethod getMethod();\n\n List<HttpRequestHeader> getHeaders();\n\n HttpRequestPayload getPayload();\n\n Builder toBuilder();\n\n interface Build... | import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;
import com.google.common.base.Stopwatch;
import com.google.common.util.concurrent.RateLimiter;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.vlkan.hrrs.api.HttpRequestRecord;
import com.vlkan.hrrs.co... | package com.vlkan.hrrs.replayer.cli;
@Singleton
public class Replayer implements Runnable, Closeable, HttpRequestRecordStreamConsumer {
private static final Logger LOGGER = LoggerFactory.getLogger(Replayer.class);
private final Config config;
private final CloseableExecutor closeableExecutor;
| private final HttpRequestRecordStream recordStream; | 6 |
packetpirate/Generic-Zombie-Shooter | GenericZombieShooter/src/genericzombieshooter/structures/weapons/Turret.java | [
"public class GZSFramework {\n // Member variables.\n public JFrame frame;\n public GZSCanvas canvas;\n private StoreWindow store;\n private LevelScreen levelScreen;\n \n // Game objects.\n private Player player; // The player character.\n public Player getPlayer() { return player; }\n ... | import genericzombieshooter.GZSFramework;
import genericzombieshooter.actors.Zombie;
import genericzombieshooter.misc.Globals;
import genericzombieshooter.misc.Images;
import genericzombieshooter.misc.Sounds;
import genericzombieshooter.structures.Particle;
import java.awt.BasicStroke;
import java.awt.Color;
im... | /**
This file is part of Generic Zombie Shooter.
Generic Zombie Shooter 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 ver... | private Zombie target; // Used to calculate position to fire at each update.
| 1 |
Stratio/stratio-connector-deep | src/test/java/com/stratio/connector/deep/engine/query/QueryExecutorTest.java | [
"public class DeepConnection extends Connection<Object> {\n\n\tprivate boolean isConnect = false;\n\n\tprivate final ExtractorConfig<Cells> extractorConfig;\n\n\t/**\n\t * Constructor using credentials and cluster config.\n\t *\n\t * @param credentials\n\t * the credentials.\n\t * @param config\n\t * ... | import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.*;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.function.Functio... | /**
*
*/
package com.stratio.connector.deep.engine.query;
/**
* DeepQueryEngine testing class
*/
@RunWith(PowerMockRunner.class)
public class QueryExecutorTest {
private static final String CATALOG_CONSTANT = "catalogname";
private static final TableName TABLE1_CONSTANT = new TableName(CATALOG_CON... | private DeepConnection deepConnection; | 0 |
PuffOpenSource/Puff-Android | app/src/main/java/sun/bob/leela/ui/activities/AuthorizeActivity.java | [
"public class App extends Application {\n @Override\n public void onCreate(){\n super.onCreate();\n AccountHelper.getInstance(getApplicationContext());\n CategoryHelper categoryHelper = CategoryHelper.getInstance(getApplicationContext());\n TypeHelper typeHelper = TypeHelper.getIns... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCo... | package sun.bob.leela.ui.activities;
/**
* A login screen that offers login via email/password.
*/
public class AuthorizeActivity extends AppCompatActivity {
// UI references.
private EditText mPasswordView;
private View mProgressView;
private View mLoginFormView; | private Account master; | 1 |
beiyoufx/teemo | teemo/src/main/java/com/teemo/service/ResourceService.java | [
"@Repository\r\npublic class ResourceDao extends BaseDao<Resource> {\r\n\r\n /**\r\n * 获取根资源ID\r\n * id最小的就是根资源\r\n */\r\n public Long getRootResourceId() {\r\n Query query = getSession().createQuery(\"select MIN(id) as id from \" + Resource.class.getName());\r\n return (Long) query.... | import com.teemo.dao.ResourceDao;
import com.teemo.entity.*;
import core.service.BaseService;
import core.support.Condition;
import core.support.SearchRequest;
import core.support.search.Searchable;
import core.util.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transactio... | /**
* Copyright (c) 2016- https://github.com/beiyoufx
*
* Licensed under the GPL-3.0
*/
package com.teemo.service;
/**
* @author yongjie.teng
* @date 16-11-22 上午9:31
* @email yongjie.teng@foxmail.com
* @package com.teemo.service
*/
@Service
public class ResourceService extends BaseService<Re... | Searchable searchable = SearchRequest.newSearchRequest();
| 3 |
butter-fly/belling-admin | src/main/java/com/belling/admin/controller/houtai/RoleController.java | [
"@Data\n@EqualsAndHashCode(callSuper = false)\npublic class Role extends PersistentObject {\n\n\t/**\n\t * 序列化ID\n\t */\n\tprivate static final long serialVersionUID = 564115576254799088L;\n\n\t/** 名称 */\n\tprivate String name;\n\t\n\t/** 编码 */\n\tprivate String code;\n\t\n\t/** 排序 */\n\tprivate Integer sort = Inte... | import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotatio... | package com.belling.admin.controller.houtai;
/**
* <pre>
* Description
* Copyright: Copyright (c)2017
* Company: Sunny
* Author: Administrator
* Version: 1.0
* Create at: 2017年6月23日 上午8:48:33
*
* Modification History:
* Date Author Version Description
* -----------------------... | Role role; | 0 |
kstenschke/shifter-plugin | src/com/kstenschke/shifter/models/ShiftableWord.java | [
"public class ShifterPreferences {\n\n @NonNls\n private static final String PROPERTY_DICTIONARY = \"PluginShifter.Dictionary.Terms\";\n @NonNls\n private static final String PROPERTY_SHIFTING_MODE_TIMESTAMP = \"PluginShifter.ShiftingModeTimestamps\";\n @NonNls\n private static final String PROPER... | import com.kstenschke.shifter.ShifterPreferences;
import com.kstenschke.shifter.models.shiftable_types.CssUnit;
import com.kstenschke.shifter.models.shiftable_types.JsDoc;
import com.kstenschke.shifter.models.shiftable_types.NumericValue;
import com.kstenschke.shifter.utils.UtilsFile;
import com.kstenschke.shifter.util... | /*
* Copyright Kay Stenschke
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... | private final ShiftableTypes.Type wordType; | 6 |
DorsetProject/dorset-framework | core/src/test/java/edu/jhuapl/dorset/ApplicationTest.java | [
"public interface Agent {\n\n /**\n * Get the name of the agent\n *\n * @return name\n */\n public String getName();\n\n /**\n * Override the default name of the agent\n *\n * @param name New name for the agent\n */\n public void setName(String name);\n\n /**\n * ... | import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import edu.jhuapl.dorset.agents.Agent;
import edu.jhuapl.dorset.agents.AgentRequest;
import edu.jhuapl.dorset.agents.AgentResponse;
import edu... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | Router router = new SingleAgentRouter(agent); | 6 |
hpgrahsl/kafka-connect-mongodb | src/main/java/at/grahsl/kafka/connect/mongodb/MongoDbSinkTask.java | [
"public abstract class CdcHandler {\n\n private final MongoDbSinkConnectorConfig config;\n\n public CdcHandler(MongoDbSinkConnectorConfig config) {\n this.config = config;\n }\n\n public MongoDbSinkConnectorConfig getConfig() {\n return this.config;\n }\n\n public abstract Optional<W... | import at.grahsl.kafka.connect.mongodb.cdc.CdcHandler;
import at.grahsl.kafka.connect.mongodb.converter.SinkConverter;
import at.grahsl.kafka.connect.mongodb.converter.SinkDocument;
import at.grahsl.kafka.connect.mongodb.processor.PostProcessor;
import at.grahsl.kafka.connect.mongodb.writemodel.strategy.WriteModelStrat... | /*
* Copyright (c) 2017. Hans-Peter Grahsl (grahslhp@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required... | private SinkConverter sinkConverter = new SinkConverter(); | 1 |
dlcs/the-mathmos-server | the-mathmos-server/src/test/java/com/digirati/themathmos/web/controller/OATextSearchControllerTest.java | [
"@SuppressWarnings(\"serial\")\npublic class SearchQueryException extends RuntimeException {\n\n public SearchQueryException(String msg) {\n\tsuper(msg);\n }\n}",
"public class ServiceResponse<T> implements Serializable{\n\n /**\n *\n */\n private static final long serialVersionUID = 823167197... | import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.junit.Before;
import org.jun... | package com.digirati.themathmos.web.controller;
public class OATextSearchControllerTest {
OATextSearchController controller;
private TextSearchService textSearchService;
private AnnotationAutocompleteService annotationAutocompleteService;
HttpServletRequest request;
TextUtils textUtils;
... | ServiceResponse notFoundResponse = new ServiceResponse(Status.NOT_FOUND, null); | 1 |
Chisel-Team/ConnectedTexturesMod | src/main/java/team/chisel/ctm/client/texture/type/TextureTypeMap.java | [
"@ParametersAreNonnullByDefault\npublic interface ICTMTexture<T extends ITextureType> {\n\n /**\n * Transforms a quad to conform with this texture\n * \n * @param quad\n * The Quad\n * @param context\n * The Context NULL CONTEXT MEANS INVENTORY\n * @param quadGoa... | import javax.annotation.Nonnull;
import lombok.RequiredArgsConstructor;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.state.BlockState;
import team.chisel.ctm.api.texture.ICTMTexture;
import team.chisel.ctm.api.texture.ITextureContext;
import te... | package team.chisel.ctm.client.texture.type;
@RequiredArgsConstructor
public class TextureTypeMap implements ITextureType {
private final MapType type;
@Override | public TextureMap makeTexture(TextureInfo info) { | 5 |
RestNEXT/restnext | restnext-server/src/main/java/org/restnext/server/ServerHandler.java | [
"public final class MediaType {\n\n private static final String TYPE_WILDCARD = \"*\";\n\n private static final String TOKEN = \"([a-zA-Z0-9-!#$%&'*+.^_`{|}~]+)\";\n private static final String QUOTED = \"\\\"([^\\\"]*)\\\"\";\n private static final Pattern TYPE_SUBTYPE = Pattern.compile(TOKEN + \"/\" + TOKEN);... | import static org.restnext.core.http.Response.Status.BAD_REQUEST;
import static org.restnext.core.http.Response.Status.INTERNAL_SERVER_ERROR;
import static org.restnext.core.http.Response.Status.METHOD_NOT_ALLOWED;
import static org.restnext.core.http.Response.Status.NOT_FOUND;
import static org.restnext.core.http.Resp... | /*
* Copyright (C) 2016 Thiago Gutenberg Carvalho da Costa
*
* 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 ... | final Request request = new RequestImpl(ctx, req); | 3 |
tsaglam/EcoreMetamodelExtraction | src/main/java/eme/generator/EMemberGenerator.java | [
"public class ExtractedMethod extends ExtractedElement {\n private final List<ExtractedDataType> exceptions;\n private boolean isAbstract;\n private boolean isStatic;\n private MethodType methodType;\n private AccessLevelModifier modifier;\n private final List<ExtractedParameter> parameters;\n ... | import java.util.List;
import java.util.Map;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EParameter;... | package eme.generator;
/**
* Generator class for Ecore members ({@link EOperation}s and {@link EStructuralFeature}s).
* @author Timur Saglam
*/
public class EMemberGenerator {
private final Map<String, EClassifier> eClassifierMap;
private final EcoreFactory ecoreFactory;
private final SelectionHelper... | for (ExtractedField field : type.getFields()) { // for every field | 3 |
fengyuwusong/blog | src/main/java/cn/niriqiang/blog/service/TagService.java | [
"@Data\npublic class ArticleTags {\n private Integer articleId;\n private Integer tagId;\n}",
"@Mapper\n@Repository\npublic interface ArticleTagsMapper {\n void insert(ArticleTags articleTags);\n\n int update(ArticleTags articleTags);\n\n int delete(ArticleTags articleTags);\n\n List<ArticleTags... | import cn.niriqiang.blog.domain.ArticleTags;
import cn.niriqiang.blog.domain.ArticleTagsMapper;
import cn.niriqiang.blog.domain.Tag;
import cn.niriqiang.blog.domain.TagMapper;
import cn.niriqiang.blog.dto.Result;
import cn.niriqiang.blog.enums.ResultEnum;
import cn.niriqiang.blog.exception.TagException;
import cn.niriq... | package cn.niriqiang.blog.service;
/**
* Created by fengyuwusong on 2017/9/26 1:00.
*/
@Service
public class TagService {
@Autowired
private TagMapper mapper;
@Autowired | private ArticleTagsMapper articleTagsMapper; | 1 |
kwon37xi/hibernate4-memcached | hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/Hibernate4MemcachedRegionFactory.java | [
"public interface MemcachedAdapter {\n /**\n * Lifecycle callback to perform initialization.\n *\n * @param properties the defined cfg properties\n */\n void init(OverridableReadOnlyProperties properties);\n\n /**\n * Lifecycle callback to perform cleanup.\n */\n void destroy();\... | import kr.pe.kwonnam.hibernate4memcached.memcached.MemcachedAdapter;
import kr.pe.kwonnam.hibernate4memcached.regions.*;
import kr.pe.kwonnam.hibernate4memcached.timestamper.HibernateCacheTimestamper;
import kr.pe.kwonnam.hibernate4memcached.timestamper.HibernateCacheTimestamperJvmImpl;
import kr.pe.kwonnam.hibernate4m... | package kr.pe.kwonnam.hibernate4memcached;
/**
* Hibernate 4 Memcached Cache Region Factory
*
* @author KwonNam Son (kwon37xi@gmail.com)
*/
public class Hibernate4MemcachedRegionFactory implements RegionFactory {
private final Logger log = LoggerFactory.getLogger(Hibernate4MemcachedRegionFactory.class);
... | private MemcachedAdapter memcachedAdapter; | 0 |
xiaoyaoyou1212/BLE | newapp/src/main/java/com/vise/bledemo/activity/MainActivity.java | [
"public class ViseBle {\n private Context context;//上下文\n private BluetoothManager bluetoothManager;//蓝牙管理\n private BluetoothAdapter bluetoothAdapter;//蓝牙适配器\n private DeviceMirrorPool deviceMirrorPool;//设备连接池\n private DeviceMirror lastDeviceMirror;//上次操作设备镜像\n\n private static ViseBle instance;... | import android.Manifest;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.Co... | package com.vise.bledemo.activity;
/**
* @Description: 主页,展示已连接设备列表
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/20 17:35
*/
public class MainActivity extends AppCompatActivity {
private TextView supportTv;
private TextView statusTv;
private ListView deviceLv;
... | ToastUtil.showToast(MainActivity.this, "Disconnect!"); | 5 |
sdnwiselab/sdn-wise-java | ctrl/src/main/java/com/github/sdnwiselab/sdnwise/controller/ControllerFactory.java | [
"public abstract class AbstractAdapter extends Observable implements Observer {\r\n\r\n /**\r\n * Logger.\r\n */\r\n protected static final Logger LOGGER = Logger.getLogger(\"ADP\");\r\n\r\n private boolean active;\r\n\r\n /**\r\n * Creates an AbstractAdapter.\r\n */\r\n AbstractAdapt... | import com.github.sdnwiselab.sdnwise.adapter.AbstractAdapter;
import com.github.sdnwiselab.sdnwise.adapter.AdapterTcp;
import com.github.sdnwiselab.sdnwise.adapter.AdapterUdp;
import com.github.sdnwiselab.sdnwise.configuration.ConfigController;
import com.github.sdnwiselab.sdnwise.configuration.Configurator;
impor... | /*
* Copyright (C) 2015 SDN-WISE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is d... | low.add(new AdapterTcp(map));
| 1 |
4FunApp/4Fun | server/4FunServer/src/com/mollychin/spider/PicWufaZhuceSpider.java | [
"public class PicOne {\n\tprivate String authorWork;\n\tprivate String picDescription;\n\tprivate String picDate;\n\tprivate String picUrl;\n\tprivate String pubTime;\n\tprivate String VOL;\n\n\tpublic String getVOL() {\n\t\treturn VOL;\n\t}\n\n\tpublic void setVOL(String vOL) {\n\t\tVOL = vOL;\n\t}\n\n\tpublic Str... | import java.io.IOException;
import java.sql.Connection;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.mollychin.bean.PicOne;
import com.moll... | package com.mollychin.spider;
public class PicWufaZhuceSpider {
private static final String PICTURE4ONE = "Picture4One/";
// public void picWufaZhuceSpider()
public void picWufaZhuceSpider() {
try {
PicWufaZhuceSpider picSpider = new PicWufaZhuceSpider();
Document document = JsoupUtil | .connect(ConstantsUtil.PIC_WUFAZHUCE_URL); | 1 |
neoremind/navi-pbrpc | src/main/java/com/baidu/beidou/navi/pbrpc/server/PbrpcServer.java | [
"public interface ServiceLocator<KEY> {\n\n /**\n * 根据服务标示获取服务描述\n * \n * @param key\n * @return\n */\n ServiceDescriptor<KEY> getServiceDescriptor(KEY key);\n\n /**\n * 注入服务\n * \n * @param key\n * @param serviceBean\n * @return\n */\n boolean regiserService(... | import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.nett... | package com.baidu.beidou.navi.pbrpc.server;
/**
* ClassName: PbrpcServer <br/>
* Function: 基于netty nio的Pbrpc服务端
*
* @author Zhang Xu
*/
public class PbrpcServer {
private static final Logger LOG = LoggerFactory.getLogger(PbrpcServer.class);
/**
* 服务端口
*/
private int port;
/**
... | ch.pipeline().addLast("coreHandler", new PbrpcServerHandler(serviceLocator)); | 2 |
ogarcia/opensudoku | app/src/main/java/org/moire/opensudoku/game/SudokuGame.java | [
"public abstract class AbstractCommand {\n\n private static final CommandDef[] commands = {\n new CommandDef(ClearAllNotesCommand.class.getSimpleName(), \"c1\",\n ClearAllNotesCommand::new),\n new CommandDef(EditCellNoteCommand.class.getSimpleName(), \"c2\",\n ... | import org.moire.opensudoku.game.command.FillInNotesWithAllValuesCommand;
import org.moire.opensudoku.game.command.SetCellValueAndRemoveNotesCommand;
import org.moire.opensudoku.game.command.SetCellValueCommand;
import java.util.ArrayList;
import android.os.Bundle;
import android.os.SystemClock;
import androidx.annotat... |
@Nullable
public Cell getLastChangedCell() {
return mCommandStack.getLastChangedCell();
}
/**
* Start game-play.
*/
public void start() {
mState = GAME_STATE_PLAYING;
resume();
}
public void resume() {
// reset time we have spent playing so far, s... | executeCommand(new ClearAllNotesCommand()); | 1 |
karthicks/gremlin-ogm | gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/traversal/library/HasKeys.java | [
"@FunctionalInterface\npublic interface ElementTo<O> extends SubTraversal<Element, O> {\n\n /**\n * A function denoting a {@code GraphTraversal} that starts at elements, and ends at elements.\n */\n @FunctionalInterface\n interface Element extends SubTraversal<\n org.apache.tinkerpop.gremlin.structure.E... | import org.apache.tinkerpop.gremlin.object.model.OrderingKey;
import org.apache.tinkerpop.gremlin.object.model.PrimaryKey;
import org.apache.tinkerpop.gremlin.object.traversal.ElementTo;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.structure.Element... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... | if (isMissing(value)) { | 7 |
PuffOpenSource/Puff-Android | app/src/main/java/sun/bob/leela/ui/activities/SetQuickPasswordActivity.java | [
"public class Account {\r\n\r\n private Long id;\r\n /** Not-null value. */\r\n private String name;\r\n private long type;\r\n private String account;\r\n private String masked_account;\r\n private Boolean hide_name;\r\n private String account_salt;\r\n /** Not-null value. */\r\n priv... | import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.Toolbar;
import android... | package sun.bob.leela.ui.activities;
public class SetQuickPasswordActivity extends AppCompatActivity {
public static final long ShowTypeSet = 0x6001;
public static final long ShowTypeVerify = 0x6002;
public static String hintStrSet;
public static String hintStrVerify;
private Pat... | Account save = new Account(); | 0 |
Keridos/FloodLights | src/main/java/de/keridos/floodlights/tileentity/TileEntityMetaFloodlight.java | [
"public class NetworkDataList extends NonNullList<Object> {\n\n public NetworkDataList() {\n super();\n }\n}",
"public class ConfigHandler {\n private static ConfigHandler instance = null;\n\n public static boolean electricFloodlight;\n public static boolean smallElectricFloodlight;\n pub... | import de.keridos.floodlights.core.NetworkDataList;
import de.keridos.floodlights.handler.ConfigHandler;
import de.keridos.floodlights.init.ModBlocks;
import de.keridos.floodlights.reference.Names;
import de.keridos.floodlights.util.MathUtil;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.... |
@Override
public void update() {
if (world.isRemote)
return;
if (timeout > 0) {
timeout--;
return;
}
// Energy itself is handled in one of the derived classes
if (active && hasEnergy() && (wasActive != active || !hasLight)) {
... | public NetworkDataList getSyncData(@Nonnull NetworkDataList data) { | 0 |
Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/ParticlesView.java | [
"@Keep\npublic interface SceneConfiguration {\n\n /**\n * Set number of particles to draw per scene.\n *\n * @param density the number of particles to draw per scene\n * @throws IllegalArgumentException if density is negative\n */\n void setDensity(@IntRange(from = 0) int density);\n\n ... | import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Animatable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import com.doctoror.particlesdrawable.contract.SceneConfi... | /*
* Copyright (C) 2017 Yaroslav Mytkalyk
*
* 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... | SceneScheduler { | 3 |
wesabe/grendel | src/test/java/com/wesabe/grendel/openpgp/tests/MasterKeyTest.java | [
"public enum AsymmetricAlgorithm implements IntegerEquivalent {\n\t/**\n\t * Elgamal (Encrypt-Only)\n\t * \n\t * @see <a href=\"http://en.wikipedia.org/wiki/ElGamal_encryption\">Wikipedia</a>\n\t */\n\tELGAMAL(\t\"ElGamal\",\t\tPublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {\n\t\t@Override\n\t\tpublic AlgorithmParameterS... | import static org.fest.assertions.Assertions.*;
import java.io.FileInputStream;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunW... | package com.wesabe.grendel.openpgp.tests;
@RunWith(Enclosed.class)
public class MasterKeyTest {
public static class A_Master_Key {
private MasterKey key;
@Before
public void setup() throws Exception {
final FileInputStream keyRingFile = new FileInputStream("src/test/resources/secret-keyring.gpg");
... | CompressionAlgorithm.ZLIB, | 1 |
chenzj-king/RvHelper | demo/src/main/java/com/dreamliner/lib/rvhelper/sample/ui/activity/customempty/CustomEmptyActivity.java | [
"public class AppContext extends Application {\n\n private static AppContext mInstance;\n\n private boolean isDebug;\n\n public static AppContext getInstance() {\n return mInstance;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n mInstance = this;\n i... | import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.dreamliner.lib.rvhelper.sample.AppContext;
import com.dreamliner.lib.rvhelper.sample.R;
import com.dreamliner.lib.rvhelper.sample.ui.adapter.TextAdapter;
import com.dreamliner.lib.rvhelper.sample.ui.base.BaseActivity;
import co... | package com.dreamliner.lib.rvhelper.sample.ui.activity.customempty;
/**
* @author chenzj
* @Title: CustomEmptyActivity
* @Description: 类的描述 -
* @date 2016/10/11 9:42
* @email admin@chenzhongjin.cn
*/
public class CustomEmptyActivity extends BaseActivity implements OnRefreshListener, View.OnClickListener {
... | OptimumRecyclerView mOptimumRecyclerView; | 5 |
underhilllabs/dccsched | src/com/underhilllabs/dccsched/io/LocalSessionsHandler.java | [
"public class ScheduleContract {\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that an entry\n * has never been updated, or doesn't exist yet.\n */\n public static final long UPDATED_NEVER = -2;\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that... | import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.END_TAG;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
import static org.xmlpull.v1.XmlPullParser.TEXT;
import com.underhilllabs.dccsched.provider.ScheduleContract;
import com.underhilllabs.dccsched.provider.Sche... | /*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | trackId = Tracks.generateTrackId(text); | 3 |
emina/kodkod | test/kodkod/test/sys/ExamplesTestWithRegularSolver.java | [
"public final class Solution {\n\tprivate final Outcome outcome;\n\tprivate final Statistics stats;\n\tprivate final Instance instance;\n\tprivate final Proof proof;\n\n\t\n\t/**\n\t * Constructs a Solution from the given values.\n\t * @requires outcome != null && stats != null\n\t * @requires outcome = SATISFIABLE... | import java.util.ArrayList;
import java.util.Collection;
import kodkod.ast.Formula;
import kodkod.engine.Solution;
import kodkod.engine.Solver;
import kodkod.engine.satlab.SATFactory;
import kodkod.instance.Bounds;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Paramet... | package kodkod.test.sys;
@RunWith(Parameterized.class)
public class ExamplesTestWithRegularSolver extends ExamplesTest {
private final Solver solver;
public ExamplesTestWithRegularSolver(SATFactory solverOpt) {
this.solver = new Solver();
this.solver.options().setSolver(solverOpt);
}
@Parameters
pu... | protected Solution solve(Formula formula, Bounds bounds) { | 3 |
OvercastNetwork/Tracker | src/main/java/tc/oc/tracker/damage/resolvers/GravityDamageResolver.java | [
"public interface DamageInfo {\n /**\n * Gets the living entity most responsible for this damage.\n *\n * @return Resolved damager or null if none exists\n */\n @Nullable LivingEntity getResolvedDamager();\n}",
"public interface DamageResolver {\n @Nullable DamageInfo resolve(@Nonnull Liv... | import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import tc.oc.tracker.DamageInfo;
import tc.oc.tracker.DamageResolver;
imp... | package tc.oc.tracker.damage.resolvers;
public class GravityDamageResolver implements DamageResolver {
public GravityDamageResolver(@Nonnull SimpleGravityKillTracker tracker) {
Preconditions.checkNotNull(tracker, "tracker");
this.tracker = tracker;
}
public @Nullable DamageInfo resolve... | return new GravityDamageInfo(fall.attacker, fall.cause, fall.from); | 3 |
ddf/Minim | src/main/java/ddf/minim/javasound/JSMinim.java | [
"public abstract class AudioMetaData\n{\t\n\t/**\n\t * The length of the recording in milliseconds.\n\t * \n\t * @return int: the length in milliseconds\n\t * \n\t * @related AudioMetaData\n\t */\n\tpublic int length()\n\t{\n\t\treturn -1;\n\t}\n\t\n\t/**\n\t * \n\t * How many sample frames are in this recording.\n... | import java.io.BufferedInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import javax.sound.sampled.AudioFileFormat;
impor... |
public void setOutputMixer(Mixer mix)
{
outputMixer = mix;
}
public Mixer getOutputMixer()
{
return outputMixer;
}
public void start()
{
}
public void stop()
{
}
public void debugOn()
{
debug = true;
}
public void debugOff()
{
debug = false;
}
void debug(String s)
{
... | public AudioRecordingStream getAudioRecordingStream(String filename, | 4 |
bencvt/LibShapeDraw | projects/main/src/main/java/libshapedraw/shape/Shape.java | [
"public class LibShapeDraw {\n private final Set<Shape> shapes;\n private final Set<Shape> shapesReadonly;\n private final Set<LSDEventListener> eventListeners;\n private final Set<LSDEventListener> eventListenersReadonly;\n private final String instanceId;\n private final String ownerId;\n pri... | import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import libshapedraw.LibShapeDraw;
import libshapedraw.MinecraftAccess;
import libshapedraw.primitive.ReadonlyVector3;
import libshapedraw.primitive.Vector3;
import libshapedraw.transform.ShapeTransform;
import org.lwjgl.opengl.GL11; | package libshapedraw.shape;
/**
* Generic base class for a renderable object.
*/
public abstract class Shape {
private boolean visible = true;
private Vector3 origin;
private boolean relativeToOrigin = true; | private List<ShapeTransform> transforms; | 4 |
sergioag/cobol2java | src/main/java/com/res/java/util/NameUtil.java | [
"public class Main {\r\n\r\n private RESConfig config = RESConfig.getInstance();\r\n private static RESContext context = new RESContext();\r\n private boolean doListDir = false;\r\n private Preprocessor preprocessor = new Preprocessor();\r\n public long startClock;\r\n\r\n public static void main(... | import com.res.java.translation.symbol.SymbolTable;
import com.res.java.translation.symbol.SymbolUtil;
import java.util.Arrays;
import java.util.Collection;
import com.res.cobol.Main;
import java.util.Iterator;
import java.util.Stack;
import java.util.TreeSet;
import com.res.common.RESConfig;
import com.res.ja... | package com.res.java.util;
/*****************************************************************************
Copyright 2009 Venkat Krishnamurthy
This file is part of RES.
RES 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 Softwa... | public static String getJavaName(SymbolProperties props2,boolean lastSet) {
| 6 |
FlareBot/FlareBot | src/main/java/stream/flarebot/flarebot/ModlogEvents.java | [
"public class RedisController {\n\n private static JedisPool jedisPool;\n\n public static BlockingQueue<RedisSetData> setQueue = new LinkedBlockingQueue<>();\n\n private RedisController() {\n }\n\n public RedisController(JSONConfig config) {\n jedisPool = new JedisPool(\n new Je... | import net.dv8tion.jda.core.EmbedBuilder;
import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.audit.ActionType;
import net.dv8tion.jda.core.audit.AuditLogChange;
import net.dv8tion.jda.core.audit.AuditLogEntry;
import net.dv8tion.jda.core.entities.Channel;
import net.dv8tion.jda.core.entities.Guild;
imp... | package stream.flarebot.flarebot;
public class ModlogEvents implements EventListener {
private long roleResponseNumber = 0;
private long guildResponseNumber = 0;
@Override
public void onEvent(Event event) {
if (!(event instanceof GenericGuildEvent)
&& !(event instanceof Gene... | GuildWrapper guildWrapper = FlareBotManager.instance().getGuild(g.getId()); | 4 |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/publisher/GitLabCommitStatusPublisherTest.java | [
"static final String BUILD_URL = \"/build/123\";",
"static final String GITLAB_CONNECTION_V3 = \"GitLabV3\";",
"static final String GITLAB_CONNECTION_V4 = \"GitLabV4\";",
"static final int PROJECT_ID = 3;",
"static void setupGitLabConnections(JenkinsRule jenkins, MockServerRule mockServer) throws IOExceptio... | import static com.dabsquared.gitlabjenkins.publisher.TestUtility.BUILD_URL;
import static com.dabsquared.gitlabjenkins.publisher.TestUtility.GITLAB_CONNECTION_V3;
import static com.dabsquared.gitlabjenkins.publisher.TestUtility.GITLAB_CONNECTION_V4;
import static com.dabsquared.gitlabjenkins.publisher.TestUtility.PROJE... | package com.dabsquared.gitlabjenkins.publisher;
/**
* @author Robin Müller
*/
public class GitLabCommitStatusPublisherTest {
private static final String SHA1 = "0616d12a3a24068691027a1e113147e3c1cfa2f4";
@ClassRule
public static MockServerRule mockServer = new MockServerRule(new Object());
@Class... | verifyMatrixAggregatable(GitLabCommitStatusPublisher.class, listener); | 5 |
angelozerr/jsbuild-eclipse | core/fr.opensagres.eclipse.jsbuild.ui/src/fr/opensagres/eclipse/jsbuild/internal/ui/views/actions/AddBuildFilesAction.java | [
"public interface IJSBuildFileNode {\r\n\r\n\t/**\r\n\t * Returns the node name.\r\n\t * \r\n\t * @return the node name.\r\n\t */\r\n\tString getName();\r\n\r\n\t/**\r\n\t * Returns the label of the task.\r\n\t * \r\n\t * @return the label of the task.\r\n\t */\r\n\tString getLabel();\r\n\r\n\t/**\r\n\t * Returns t... | import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.swt.widge... | /**
* Copyright (c) 2013-2014 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* ... | IJSBuildFileUIHelpContextIds.ADD_BUILDFILE_ACTION); | 1 |
chenzj-king/RvHelper | demo/src/main/java/com/dreamliner/lib/rvhelper/sample/ui/activity/banner/BannerActivity.java | [
"public class AppContext extends Application {\n\n private static AppContext mInstance;\n\n private boolean isDebug;\n\n public static AppContext getInstance() {\n return mInstance;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n mInstance = this;\n i... | import android.util.SparseIntArray;
import android.view.View;
import com.dreamliner.lib.rvhelper.sample.AppContext;
import com.dreamliner.lib.rvhelper.sample.BR;
import com.dreamliner.lib.rvhelper.sample.R;
import com.dreamliner.lib.rvhelper.sample.databinding.ActDbBannerBinding;
import com.dreamliner.lib.rvhelper.samp... | package com.dreamliner.lib.rvhelper.sample.ui.activity.banner;
/**
* Created by chenzj on 2017/4/11.
*/
public class BannerActivity extends BaseActivity implements OnItemClickListener<String>, OnRefreshListener, OnBannerListener {
private ActDbBannerBinding mActDbBannerBinding;
private OptimumRecycle... | mOptimumRecyclerView.addItemDecoration(DividerUtil.getDefalutDivider(AppContext.getInstance())); | 0 |
FlareBot/FlareBot | src/main/java/stream/flarebot/flarebot/objects/GuildWrapper.java | [
"public class FlareBot {\n\n public static final Logger LOGGER;\n public static final Gson GSON = new GsonBuilder().create();\n private static final AtomicBoolean RUNNING = new AtomicBoolean(false);\n public static final AtomicBoolean EXITING = new AtomicBoolean(false);\n public static final AtomicBo... | import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.Guild;
import net.dv8tion.jda.core.entities.Role;
import net.dv8tion.jda.core.entities.User;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.Getters;
import stream.flarebot.flarebot.mod.Moderation;
import stream.flare... | package stream.flarebot.flarebot.objects;
public class GuildWrapper {
public static transient final long DATA_VERSION = 1;
public final long dataVersion = DATA_VERSION;
private String guildId; | private char prefix = Constants.COMMAND_CHAR; | 3 |
melloc/roguelike | engine/src/main/java/edu/brown/cs/roguelike/engine/graphics/LookLayer.java | [
"public final class Vec2i implements Serializable {\r\n\tprivate static final long serialVersionUID = 5659632794862666943L;\r\n\t\r\n\t/**\r\n\t * Since {@link Vec2i} instances are immutable, their x and y fields may be accessed without getters.\r\n\t */\r\n\tpublic final int x, y;\r\n\t\r\n\t/**\r\n\t * Creates a ... | import com.googlecode.lanterna.input.Key;
import com.googlecode.lanterna.terminal.Terminal.Color;
import cs195n.Vec2i;
import edu.brown.cs.roguelike.engine.entities.EntityActionManager;
import edu.brown.cs.roguelike.engine.entities.Stackable;
import edu.brown.cs.roguelike.engine.events.GameAction;
import edu.brown.cs.r... | package edu.brown.cs.roguelike.engine.graphics;
/**
* A layer that allows the player to look at tiles, getting descriptions of the monsters
*
* @author jte
*
* @param <A> the main Application of the Roguelike
*/
public class LookLayer<A extends Application> implements Layer {
private final int OFFSET = 3... | Direction dir = null; | 4 |
aurbroszniowski/Rainfall-core | src/main/java/io/rainfall/execution/Pattern.java | [
"public abstract class Configuration {\n\n public abstract List<String> getDescription();\n\n}",
"public abstract class Execution {\n\n public enum ExecutionState {\n UNKNOWN,\n BEGINNING,\n ENDING\n }\n\n /**\n * Provide an easy way to mark all operations as underway.\n *\n * @param scenario t... | import io.rainfall.AssertionEvaluator;
import io.rainfall.Configuration;
import io.rainfall.Execution;
import io.rainfall.Scenario;
import io.rainfall.TestException;
import io.rainfall.WeightedOperation;
import io.rainfall.configuration.ConcurrencyConfig;
import io.rainfall.statistics.StatisticsHolder;
import io.rainfa... | /*
* Copyright (c) 2014-2022 Aurélien Broszniowski
*
* 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 applicabl... | protected final Over over; | 6 |
HubSpot/Rosetta | RosettaCore/src/test/java/com/hubspot/rosetta/RosettaBinderTest.java | [
"public class InnerBean {\n private String stringProperty;\n\n public String getStringProperty() {\n return stringProperty;\n }\n\n public void setStringProperty(String stringProperty) {\n this.stringProperty = stringProperty;\n }\n}",
"public class ListBean {\n private List<Integer> values;\n\n publ... | import static org.assertj.core.api.Assertions.assertThat;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jack... | package com.hubspot.rosetta;
public class RosettaBinderTest {
@Test
public void itBindsRosettaCreatorConstructorBeanCorrectly() {
RosettaCreatorConstructorBean bean = new RosettaCreatorConstructorBean("value");
assertThat(bind(bean)).isEqualTo(map("stringProperty", "value"));
assertThat(bindWithP... | StoredAsJsonBean bean = new StoredAsJsonBean(); | 7 |
1and1/reactive | reactive-http/src/test/java/net/oneandone/reactive/sse/servlet/ReactiveSseServletTest.java | [
"public interface ReactiveSink<T> extends Closeable {\n \n boolean isWriteable();\n \n \n /**\n * @param element the element to write\n * @return the write future \n */\n CompletableFuture<Void> writeAsync(T element);\n\n \n /**\n * @param element the element to write\n ... | import org.junit.Test;
import java.net.URI;
import java.util.UUID;
import net.oneandone.reactive.ReactiveSink;
import net.oneandone.reactive.ReactiveSource;
import net.oneandone.reactive.WebContainer;
import net.oneandone.reactive.sse.ServerSentEvent;
import net.oneandone.reactive.sse.client.ClientSseSource;
import net... | /*
* Copyright 1&1 Internet AG, https://github.com/1and1/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | ReactiveSink<ServerSentEvent> reactiveSink = new ClientSseSink(url).open(); | 5 |
Terracotta-OSS/offheap-store | src/test/java/org/terracotta/offheapstore/paging/EvictionRefusalStealingIT.java | [
"public class UpfrontAllocatingPageSource implements PageSource {\n\n public static final String ALLOCATION_LOG_LOCATION = UpfrontAllocatingPageSource.class.getName() + \".allocationDump\";\n\n private static final Logger LOGGER = LoggerFactory.getLogger(UpfrontAllocatingPageSource.class);\n private static... | import org.terracotta.offheapstore.paging.UnlimitedPageSource;
import org.terracotta.offheapstore.paging.UpfrontAllocatingPageSource;
import org.terracotta.offheapstore.paging.PageSource;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
i... | /*
* Copyright 2015 Terracotta, Inc., a Software AG company.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | Map<Integer, byte[]> victim = new EvictionRefusingWriteLockedOffHeapClockCache<>(rndm, new UnlimitedPageSource(new HeapBufferSource()), new SplitStorageEngine<>(new IntegerStorageEngine(), new OffHeapBufferHalfStorageEngine<>(source, 16 * 1024, ByteArrayPortability.INSTANCE, false, true))); | 4 |
TomDemeranville/orcid-update-java | src/test/java/uk/bl/odin/orcid/htmlmeta/GenericHTMLMetaBuilderTest.java | [
"public interface IsOrcidWork {\n\tpublic OrcidWork toOrcidWork();\n}",
"public enum DC_KEYS {\n\tCONTRIBUTOR(\"contributor\"), COVERAGE(\"coverage\"), CREATOR(\"creator\"), DATE(\"date\"), DESCRIPTION(\"description\"), FORMAT(\n\t\t\t\"format\"), IDENTIFIER(\"identifier\"), LANGUAGE(\"language\"), PUBLISHER(\"pu... | import static org.junit.Assert.*;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.appengine.repackaged.com.google.common.collect.Sets;... | package uk.bl.odin.orcid.htmlmeta;
public class GenericHTMLMetaBuilderTest {
@Test
public final void test() throws IOException {
Document doc = Jsoup.parse(getClass().getResourceAsStream("meta.html"),"UTF-8","");
//Document doc = Jsoup.connect("").timeout(10000).get();
HTMLMetaBuilder builder = new HTML... | DublinCoreMeta dc = builder.getDublinCoreMeta(); | 2 |
tomtom-international/configuration-service | src/main/java/com/tomtom/services/configuration/implementation/Configuration.java | [
"@SuppressWarnings(\"squid:S2637\")\npublic class ConfigurationServiceProperties implements HasProperties {\n\n @Nonnull\n private final String startupConfigurationURI;\n\n @Inject\n public ConfigurationServiceProperties(\n @Named(\"ConfigurationService.startupConfigurationURI\") @Nonnull fin... | import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.google.common.base.Splitter;
import com.tomt... | /*
* Copyright (C) 2012-2021, TomTom (http://tomtom.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | final List<SearchResultDTO> results = new ArrayList<>(); | 5 |
gdgand/android-rxjava | 2016-06-15_hot_and_cold/app/src/test/java/com/gdgand/rxjava/rxjavasample/hotandcold/presentation/mvp/imgur/ImgurMvpPresenterTest.java | [
"public class TestSchedulerProxy {\n\n private static final TestScheduler SCHEDULER = new TestScheduler();\n private static final TestSchedulerProxy INSTANCE = new TestSchedulerProxy();\n\n static {\n try {\n RxJavaPlugins.getInstance().registerSchedulersHook(new RxJavaSchedulersHook() {\... | import com.google.common.collect.Lists;
import com.gdgand.rxjava.rxjavasample.hotandcold.TestSchedulerProxy;
import com.gdgand.rxjava.rxjavasample.hotandcold.data.imgur.ImgurApi;
import com.gdgand.rxjava.rxjavasample.hotandcold.data.imgur.Topic;
import com.gdgand.rxjava.rxjavasample.hotandcold.data.imgur.TopicResponse;... | package com.gdgand.rxjava.rxjavasample.hotandcold.presentation.mvp.imgur;
@RunWith(MockitoJUnitRunner.class)
@Ignore("java.lang.IllegalStateException at ImgurMvpPresenterTest.java:52")
public class ImgurMvpPresenterTest {
@Mock
ImgurApi imgurApi;
@Mock
ImgurMvpView view;
@InjectMocks
ImgurMvpPresenter p... | TestSchedulerProxy proxy = TestSchedulerProxy.get(); | 0 |
SmasSive/DaggerWorkshopGDG | app/src/main/java/com/smassive/daggerworkshopgdg/app/view/fragment/ComicDetailFragment.java | [
"@Data\npublic class ComicModel {\n\n private int id;\n\n private String title;\n\n private String description;\n\n private int pageCount;\n\n private String thumbnailUrl;\n\n private List<String> imageUrls;\n}",
"@PerActivity\npublic class ComicDetailPresenter implements Presenter {\n\n priv... | import com.google.common.base.Strings;
import com.smassive.daggerworkshopgdg.app.R;
import com.smassive.daggerworkshopgdg.app.model.ComicModel;
import com.smassive.daggerworkshopgdg.app.presenter.ComicDetailPresenter;
import com.smassive.daggerworkshopgdg.app.presenter.Presenter;
import com.smassive.daggerworkshopgdg.a... | /**
* Copyright (C) 2016 Sergi Castillo Open Source Project
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless r... | if (getActivity() instanceof ComicDetailActivity) { | 3 |
oxoooo/mr-mantou-android | app/src/main/java/ooo/oxo/mr/ViewerActivity.java | [
"@AVClassName(\"Image\")\npublic class Image extends AVObject {\n\n public static final Creator CREATOR = AVObjectCreator.instance;\n\n private static final String PUBLISHED_AT = \"publishedAt\";\n\n private static final String FILE = \"file\";\n\n private static final String META = \"meta\";\n\n pri... | import android.Manifest;
import android.annotation.TargetApi;
import android.app.WallpaperManager;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.databinding.ObservableArrayList;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.medi... | @Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void onTransitionEnd(Transition transition) {
getWindow().getEnterTransition().removeListener(this);
fadeIn();
}
});
} else {
... | InOutAnimationUtils.animateIn(binding.toolbar, R.anim.viewer_toolbar_fade_in); | 4 |
BracketCove/Profiler | app/src/main/java/com/wiseass/profiler/photodetail/PhotoDetailPresenter.java | [
"public interface AuthSource {\n\n Completable createAccount(Credentials cred);\n\n Completable attemptLogin(Credentials cred);\n\n Completable deleteUser();\n\n Maybe<User> getUser();\n\n Completable logUserOut();\n\n Completable reauthenticateUser(String password);\n\n void setReturnFail(bool... | import com.wiseass.profiler.R;
import com.wiseass.profiler.data.auth.AuthSource;
import com.wiseass.profiler.data.auth.User;
import com.wiseass.profiler.data.database.DatabaseSource;
import com.wiseass.profiler.data.database.Profile;
import com.wiseass.profiler.util.BaseSchedulerProvider;
import io.reactivex.disposable... | package com.wiseass.profiler.photodetail;
/**
* Created by Ryan on 04/01/2017.
*/
public class PhotoDetailPresenter implements PhotoDetailContract.Presenter {
private BaseSchedulerProvider schedulerProvider;
private AuthSource auth;
private PhotoDetailContract.View view;
private DatabaseSource da... | .subscribeWith(new DisposableMaybeObserver<User>() { | 1 |
cimiano/tbx2rdf | test/tbx2rdf/Simple1Test.java | [
"public class TBX_Terminology {\n\n /// Set of terms\n public final Set<Term> terms = new HashSet<Term>();\n \n /// Type. As for now, we have only type \"TBX\"\n public final String type;\n \n /// Header\n public final MartifHeader header;\n\n public TBX_Terminology(String type, MartifHea... | import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDF;
import java.io.FileReader;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import or... | package tbx2rdf;
/**
*
* @author jmccrae
*/
public class Simple1Test {
private Model model;
public Simple1Test() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() throws Exception {
final Mappings mappings = Mappin... | final List<Statement> stats2 = model.listStatements(stat.getSubject(), DC.language, (RDFNode) null).toList(); | 1 |
fhussonnois/kafkastreams-cep | streams/src/main/java/com/github/fhuss/kafka/streams/cep/state/QueryStoreBuilders.java | [
"public class Queried<K, V> {\n\n protected StoreSupplier<KeyValueStore<Bytes, byte[]>> storeSupplier;\n\n protected Serde<K> keySerde;\n protected Serde<V> valueSerde;\n protected boolean loggingEnabled = true;\n protected boolean cachingEnabled = true;\n protected Map<String, String> topicConfig... | import com.github.fhuss.kafka.streams.cep.Queried;
import com.github.fhuss.kafka.streams.cep.core.nfa.Stages;
import com.github.fhuss.kafka.streams.cep.core.pattern.Pattern;
import com.github.fhuss.kafka.streams.cep.core.pattern.StagesFactory;
import com.github.fhuss.kafka.streams.cep.state.internal.QueriedInternal;
im... | /*
* 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 n... | final NFAStoreBuilder<K, V> builder = QueryStores.nfaStoreBuilder( | 5 |
MKLab-ITI/easIE | src/main/java/certh/iti/mklab/easie/Main.java | [
"public final class Configuration {\r\n\r\n public URL url;\r\n\r\n public HashSet<String> group_of_urls;\r\n\r\n public String source_name;\r\n\r\n public String entity_name;\r\n\r\n public String table_selector;\r\n\r\n public ArrayList<ScrapableField> metrics;\r\n\r\n public ArrayList<Scrapa... | import certh.iti.mklab.easie.configuration.Configuration;
import certh.iti.mklab.easie.configuration.ConfigurationReader;
import certh.iti.mklab.easie.exception.IllegalSchemaException;
import certh.iti.mklab.easie.exception.PaginationException;
import certh.iti.mklab.easie.exception.RelativeURLException;
import co... | /*
* Copyright 2016 vasgat.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | ConfigurationReader reader = new ConfigurationReader(args[0], ".");
| 1 |
lacuna/bifurcan | src/io/lacuna/bifurcan/DurableMap.java | [
"public class Roots {\n\n private static class Lookup {\n public final Fingerprint fingerprint;\n public final IMap<Fingerprint, Fingerprint> redirects;\n\n public Lookup(Fingerprint fingerprint, IMap<Fingerprint, Fingerprint> redirects) {\n this.fingerprint = fingerprint;\n this.redirects = red... | import io.lacuna.bifurcan.durable.Roots;
import io.lacuna.bifurcan.durable.codecs.HashMap;
import io.lacuna.bifurcan.durable.codecs.HashMapEntries;
import io.lacuna.bifurcan.durable.codecs.TempStream;
import io.lacuna.bifurcan.durable.io.FileOutput;
import io.lacuna.bifurcan.utils.Iterators;
import java.nio.file.Path;
... | package io.lacuna.bifurcan;
public class DurableMap<K, V> extends IMap.Mixin<K, V> implements IMap.Durable<K, V> {
private final IDurableEncoding.Map encoding;
private final Root root;
private final DurableInput.Pool bytes;
private final long size;
private final ISortedMap<Long, Long> hashTable;
private... | return Iterators.from( | 5 |
lyubenblagoev/postfix-rest-server | src/main/java/com/lyubenblagoev/postfixrest/service/BccServiceImpl.java | [
"public class BadRequestException extends RuntimeException {\n\n\tprivate static final long serialVersionUID = 540536621916319350L;\n\n\tpublic BadRequestException() {\n\t}\n\n\tpublic BadRequestException(String message) {\n\t\tsuper(message);\n\t}\n\n\tpublic BadRequestException(Throwable cause) {\n\t\tsuper(cause... | import java.util.Optional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lyubenblagoev.postfixrest.BadRequestException;
import com.lyubenblagoev.postfixrest.entity.Account;
import com.lyubenblagoev.postfixrest.entity.IncomingBcc;
import com.ly... | package com.lyubenblagoev.postfixrest.service;
@Service
@Transactional(readOnly = true)
public class BccServiceImpl extends AbstractBccServiceImpl {
private final OutgoingBccRepository outBccRepository;
private final IncomingBccRepository inBccRepository;
public BccServiceImpl(OutgoingBccRepository outBccRepo... | OutgoingBcc entity = outBccRepository.findByAccountId(resource.getAccountId()); | 3 |
monster860/FastDMM | src/main/java/com/github/monster860/fastdmm/editing/placement/DeleteBlockPlacementHandler.java | [
"public class FastDMM extends JFrame implements ActionListener, TreeSelectionListener, ListSelectionListener {\n\tprivate static final long serialVersionUID = 1L;\n\tpublic File dme;\n\tpublic DMM dmm;\n\tpublic List<DMM> loadedMaps = new ArrayList<DMM>();\n\tpublic Map<String, ModifiedType> modifiedTypes = new Has... | import java.awt.Color;
import java.util.HashSet;
import java.util.Set;
import com.github.monster860.fastdmm.FastDMM;
import com.github.monster860.fastdmm.Util;
import com.github.monster860.fastdmm.dmirender.DMI;
import com.github.monster860.fastdmm.dmirender.IconSubstate;
import com.github.monster860.fastdmm.dmirender.... | package com.github.monster860.fastdmm.editing.placement;
public class DeleteBlockPlacementHandler implements PlacementHandler {
Location startLocation;
Location endLocation;
private FastDMM editor; | private ObjInstance oInstance; | 7 |
kenumir/ApkInfo | app/src/main/java/com/wt/apkinfo/activity/ApplicationDetailsActivity.java | [
"public class ApplicationDetailsEntity implements ApplicationDetailsModel {\n\n\tpublic String id;\n\tpublic String name;\n\tpublic String dataDir;\n\tpublic String nativeLibraryDir;\n\tpublic ComponentInfo[] activities;\n\tpublic ComponentInfo[] services;\n\tpublic ComponentInfo[] permissions;\n\tpublic ComponentI... | import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.D... | ctx.startActivity(it, options.toBundle());
} else {
ctx.startActivity(it);
}
}
private Toolbar toolbar;
private RecyclerView recycler;
private AppInfoAdapter mAppInfoAdapter;
private ComponentInfo[] selectedData;
private MenuItem shareMenuItem, appInfoMenu, playStoreMenu, runMenu;
@Override
protecte... | View navIcon = ViewUtil.findViewWithContentDescription(toolbar, appId); | 5 |
arquillian/arquillian-container-chameleon | arquillian-chameleon-runner/runner/src/test/java/org/arquillian/container/chameleon/runner/AnnotationExtractorTest.java | [
"public enum Mode {\n\n EMBEDDED(\"embedded\"),\n MANAGED(\"managed\"),\n REMOTE(\"remote\");\n\n private String mode;\n\n Mode(String mode) {\n this.mode = mode;\n }\n\n public String mode() {\n return this.mode;\n }\n\n}",
"@ChameleonTarget(container = \"tomcat\", version =... | import org.arquillian.container.chameleon.api.ChameleonTarget;
import org.arquillian.container.chameleon.api.Mode;
import org.arquillian.container.chameleon.runner.fixtures.GenericTest;
import org.arquillian.container.chameleon.runner.fixtures.SystemPropertiesTest;
import org.arquillian.container.chameleon.runner.fixtu... | package org.arquillian.container.chameleon.runner;
public class AnnotationExtractorTest {
@Test
public void should_get_proeprties_from_chameleon_annotation() {
// given
final ChameleonTarget chameleonTarget = GenericTest.class.getAnnotation(ChameleonTarget.class);
// when
f... | assertThat(chameleonTargetConfiguration.getMode()).isEqualTo(Mode.MANAGED); | 0 |
rhritz/kyberia-haiku | app/models/feeds/UserLocationHistory.java | [
"@Entity(\"Feed\")\npublic class Feed extends MongoEntity{\n\n public static DBCollection dbcol = null;\n private static final String key = \"feed_\";\n\n protected String name;\n protected ObjectId owner;\n protected List<ObjectId> nodes;\n protected Int... | import plugins.MongoDB;
import com.mongodb.BasicDBObject;
import com.mongodb.DBCursor;
import java.util.List;
import java.util.Map;
import play.Logger;
import play.mvc.Http.Request;
import play.mvc.Scope.RenderArgs;
import play.mvc.Scope.Session;
import models.Feed;
import models.Page;
import models.User;
import models... | /*
Kyberia Haiku - advanced community web application
Copyright (C) 2010 Robert Hritz
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, o... | User user, | 2 |
raulh82vlc/Transactions-Viewer | domain/src/main/java/com/raulh82vlc/TransactionsViewer/domain/interactors/SavedTransactionListInteractorImpl.java | [
"public class CustomException extends Exception {\n public CustomException(String detailMessage) {\n super(detailMessage);\n }\n}",
"public interface Interactor {\n void run() throws CustomException;\n}",
"public interface InteractorExecutor {\n void run(Interactor interactor) throws CustomEx... | import com.raulh82vlc.TransactionsViewer.domain.exceptions.CustomException;
import com.raulh82vlc.TransactionsViewer.domain.executors.Interactor;
import com.raulh82vlc.TransactionsViewer.domain.executors.InteractorExecutor;
import com.raulh82vlc.TransactionsViewer.domain.executors.MainThread;
import com.raulh82vlc.Tran... | /*
* Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | SavedTransactionsCallback savedTransactionsCallback) throws CustomException { | 0 |
santanusinha/dropwizard-db-sharding-bundle | src/test/java/io/appform/dropwizard/sharding/dao/LookupDaoTest.java | [
"@Entity\n@Table(name=\"audits\")\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\n@ToString\n@Builder\npublic class Audit {\n @Id\n @GeneratedValue(strategy = GenerationType.IDENTITY)\n @Column(name = \"id\")\n private long id;\n\n @Column(name = \"text\")\n private String text;\n\n @ManyToOne... | import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import io.appform.dropwizard.sharding.dao.testdata.entities.Audit;
import io.appform.dropwizard.sharding.dao.testdata.entities.Phone;
import io.appform.dropwizard.sharding.dao.testdata.... | /*
* Copyright 2016 Santanu Sinha <santanu.sinha@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | new ConsistentHashBucketIdExtractor<>( | 6 |
sorinMD/MCTS | src/main/java/mcts/tree/selection/UCT.java | [
"public interface Game {\n\n\t/**\n\t * @return a clone of the game state\n\t */\n\tpublic int[] getState();\n\n\tpublic int getWinner();\n\n\tpublic boolean isTerminal();\n\n\tpublic int getCurrentPlayer();\n\n\t/**\n\t * Updates the state description based on the chosen action\n\t * \n\t * @param a\n\t * ... | import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.ThreadLocalRandom;
import mcts.game.Game;
import mcts.game.GameFactory;
import mcts.tree.Tree;
import mcts.tree.node.StandardNode;
import mcts.tree.node.Key;
import mcts.tree.node.TreeNode;
import mcts.utils.Selection;
import mcts.uti... | package mcts.tree.selection;
/**
* UCT selection policy with afterstates
*
* @author sorinMD
*
*/
public class UCT extends SelectionPolicy{
public UCT() {}
/**
* Select node based on the best UCT value.
* Ties are broken randomly.
*
* @param node
* @param tree
* @return
*/ | protected Selection selectChild(StandardNode node, Tree tree, GameFactory factory, Game obsGame){ | 2 |
marmelo/chili | chili/src/test/java/me/defying/chili/ToStringTest.java | [
"@ToString\npublic class BasicModifiersClass {\n final int _default = 1;\n public final int _public = 2;\n private final int _private = 3;\n protected final int _protected = 4;\n transient final int _transient = 5;\n volatile int _volatile = 6;\n static final int _static = 7;\n}",
"@ToString\... | import me.defying.chili.util.ChiliTest;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.google.inject.Inject;
import me.defying.chili.tostring.BasicModifiersClass;
import me.defying.chili.tostring.BasicTypesClass;
import me.defying.chili.tostring.EmptyClass;
import me.defying.chili.tostri... | /*
* The MIT License (MIT)
* Copyright (c) 2018 Rafael Marmelo
*
* 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, ... | private ToStringClass toStringClass; | 5 |
BoD/irondad | src/main/java/org/jraf/irondad/handler/wikipedia/WikipediaHandler.java | [
"public class Config {\n\n public static final boolean LOGD = true;\n\n}",
"public class Constants {\n public static final String TAG = \"irondad/\";\n\n public static final String PROJECT_FULL_NAME = \"BoD irondad\";\n public static final String PROJECT_URL = \"https://github.com/BoD/irondad\";\n ... | import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.List;
import java.util.Locale;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.json.JSONArray;
import com.github.kevinsawicki.h... | /*
* This source is part of the
* _____ ___ ____
* __ / / _ \/ _ | / __/___ _______ _
* / // / , _/ __ |/ _/_/ _ \/ __/ _ `/
* \___/_/|_/_/ |_/_/ (_)___/_/ \_, /
* /___/
* repository.
*
* Copyright (C) 2016 Nicolas Pomepuy
* Copyright (C) 2013 Benoit 'BoD' Lubek (BoD@JR... | protected void handleChannelMessage(final Connection connection, final String channel, String fromNickname, String text, List<String> textAsList, | 5 |
codebling/VFSJFileChooser2 | src/net/sf/vfsjfilechooser/demo/Main.java | [
"@SuppressWarnings(\"serial\")\r\npublic class VFSJFileChooser extends JComponent implements Accessible\r\n{\r\n private static final Frame SHARED_FRAME = new Frame();\r\n private static final FileObject[] EMPTY_FILEOBJECT_ARRAY = new FileObject[]{};\r\n\r\n // ******************************\r\n // ****... | import javax.swing.AbstractAction;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextField;
import net.sf.vfsjfilechooser.VFSJFileChooser;
import net.sf.vfsjfilechooser.VFSJFileChooser.RETURN_TYPE;
import net.sf.vfsjfilechooser.VFSJFileChooser.SELECTION_MODE;
import net.sf.vfsjfilechooser.a... | /*
* VFSJFileChooser demo
*
* Copyright (C) 2005-2008 Yves Zoundi
*
* 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... | RETURN_TYPE answer = fileChooser.showOpenDialog(Main.this); | 1 |
pagarme/pagarme-java | src/test/java/me/pagarme/helper/BulkAnticipationHelpers.java | [
"public class BulkAnticipation extends PagarMeModel<String> {\n\n @Expose(serialize = false)\n private Status status;\n @Expose(serialize = false)\n private Integer amount;\n @Expose(serialize = false)\n private Integer fee;\n @Expose(serialize = false)\n private Integer anticipationFee;\n ... | import java.util.Collection;
import me.pagar.model.BulkAnticipation;
import me.pagar.model.BulkAnticipation.Timeframe;
import me.pagar.model.PagarMeException;
import me.pagar.model.Recipient;
import me.pagar.model.Transaction;
import me.pagarme.factory.TransactionFactory;
import me.pagarme.util.PagarmeCalendar; | package me.pagarme.helper;
public class BulkAnticipationHelpers {
private static TransactionFactory transactionFactory = new TransactionFactory();
public static Recipient increaseAnticipationVolume(Recipient recipient) throws PagarMeException{
recipient.setAnticipatableVolumePercentage(100);
... | public static BulkAnticipation createAnticipation(Integer requestedAmount, Timeframe timeFrame, Boolean build, Recipient recipient) | 0 |
eurohlam/rss2kindle | rss-2-kindle-web-test/src/test/java/org/roag/web/SubscriberDetailsPageTest.java | [
"public class LifecycleTestExtension implements BeforeAllCallback, BeforeEachCallback, AfterEachCallback, AfterAllCallback {\n\n @Override\n public void beforeAll(ExtensionContext extensionContext) throws Exception {\n //we ignore error message here that such user already exists\n to(SignUpPage.... | import com.codeborne.selenide.Condition;
import com.github.javafaker.Faker;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.roag.junit.LifecycleTestExtension;
import org.roag.pages.ProfilePage;
i... | package org.roag.web;
@ExtendWith(LifecycleTestExtension.class)
@DisplayName("Subscriptions operations tests")
@Tag("SUBSCRIBERS")
@Tag("SUBSCRIPTIONS")
public class SubscriberDetailsPageTest {
private Faker faker = new Faker();
@Test
@DisplayName("Test operations with subscriptions: activate, deactiva... | .navigateTo(NavigationItem.SUBSCRIBERS); | 4 |
uPhyca/idobata4j | idobata4j-core/src/test/java/com/uphyca/idobata/IdobataTest.java | [
"public interface Client {\n\n /**\n * Synchronously execute an HTTP represented by {@code request} and encapsulate all response data\n * into a {@link Response} instance.\n */\n Response execute(Request request) throws IOException;\n}",
"public class Request {\n\n private final String method... | import com.pusher.client.Pusher;
import com.uphyca.idobata.http.Client;
import com.uphyca.idobata.http.Request;
import com.uphyca.idobata.http.Response;
import com.uphyca.idobata.http.TypedInput;
import com.uphyca.idobata.model.*;
import com.uphyca.idobata.pusher.PusherBuilder;
import com.uphyca.idobata.transform.Conve... | /*
* Copyright (C) 2014 uPhyca Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | Client client; | 0 |
chRyNaN/Android-Guitar-Tuner | app/src/main/java/com/chrynan/android_guitar_tuner/tuner/GuitarTuner.java | [
"public interface PitchDetector {\n\n /**\n * Retrieves a pitch frequency (note) using the provided array of values representing a sound\n * wave. Note that this method operates on the calling Thread. The calling Thread should be off\n * the main Thread.\n *\n * @param wave The array of 16 bi... | import com.chrynan.android_guitar_tuner.tuner.detection.PitchDetector;
import com.chrynan.android_guitar_tuner.tuner.note.MutableNote;
import com.chrynan.android_guitar_tuner.tuner.note.Note;
import com.chrynan.android_guitar_tuner.tuner.note.NoteFinder;
import com.chrynan.android_guitar_tuner.tuner.recorder.AudioRecor... | package com.chrynan.android_guitar_tuner.tuner;
/**
* An implementation of the {@link Tuner} interface.
*/
public class GuitarTuner implements Tuner {
private final MutableNote note = new MutableNote();
private final Observable<Note> observable;
| public GuitarTuner(final AudioRecorder audioRecorder, final PitchDetector detector, final NoteFinder finder) { | 0 |
ZerothAngel/ToHPluginUtils | src/main/java/org/tyrannyofheaven/bukkit/util/uuid/CommandUuidResolver.java | [
"public static String colorize(String text) {\n if (text == null) return null;\n\n // Works best with interned strings\n String cacheResult = colorizeCache.get(text);\n if (cacheResult != null) return cacheResult;\n\n StringBuilder out = new StringBuilder();\n\n ColorizeState state = ColorizeState... | import static org.tyrannyofheaven.bukkit.util.ToHMessageUtils.colorize;
import static org.tyrannyofheaven.bukkit.util.ToHMessageUtils.sendMessage;
import static org.tyrannyofheaven.bukkit.util.ToHStringUtils.hasText;
import static org.tyrannyofheaven.bukkit.util.command.reader.CommandReader.abortBatchProcessing;
import... | /*
* Copyright 2014 ZerothAngel <zerothangel@tyrannyofheaven.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requir... | UuidDisplayName udn = parseUuidDisplayName(name); | 5 |
shaohui10086/ShareUtil | shareutil/src/main/java/me/shaohui/shareutil/login/instance/QQLoginInstance.java | [
"public class ShareLogger {\n\n private static final String TAG = \"share_util_log\";\n\n public static void i(String info) {\n if (ShareManager.CONFIG.isDebug()) {\n Log.i(TAG, info);\n }\n }\n\n public static void e(String error) {\n if (ShareManager.CONFIG.isDebug()) {... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
import com.tencent.tauth.UiError;
import jav... | package me.shaohui.shareutil.login.instance;
/**
* Created by shaohui on 2016/12/1.
*/
public class QQLoginInstance extends LoginInstance {
private static final String SCOPE = "get_simple_userinfo";
private static final String URL = "https://graph.qq.com/user/get_user_info";
private Tencent mTencen... | ShareLogger.i(INFO.QQ_AUTH_SUCCESS); | 8 |
SilentChaos512/ScalingHealth | src/main/java/net/silentchaos512/scalinghealth/init/ModItems.java | [
"@Mod(ScalingHealth.MOD_ID)\npublic class ScalingHealth {\n public static final String MOD_ID = \"scalinghealth\";\n public static final String MOD_NAME = \"Scaling Health\";\n public static final String VERSION = \"2.5.3\";\n\n public static final Random random = new Random();\n\n public static fina... | import net.silentchaos512.scalinghealth.item.PowerCrystal;
import net.silentchaos512.utils.Lazy;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Locale;
import java.util.function.Supplier;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.IItemProvi... | /*
* Scaling Health
* Copyright (C) 2018 SilentChaos512
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 3
* of the License.
*
* This library is distributed in the hope t... | HEART_CRYSTAL(HeartCrystal::new), | 3 |
dariober/ASCIIGenome | src/main/java/tracks/TrackReads.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.... | package tracks;
/**
* Prepare track for printing aligned reads
* @author berald01
*
*/
public class TrackReads extends Track{
private List<List<SamSequenceFragment>> readStack;
// private boolean withReadName= false;
private long nRecsInWindow= -1;
private int userWindowSize;
private List<Argument> color... | public TrackReads(String bam, GenomicCoords gc) throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException{ | 4 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/builder/UriObjectBuilder.java | [
"public final class ElementDescriptor<T>\n{\n\tpublic final static XmlContext DEFAULT_CONTEXT = new XmlContext()\n\t{\n\t};\n\n\t/**\n\t * The {@link QualifiedName} of this element.\n\t */\n\tpublic final QualifiedName qualifiedName;\n\n\t/**\n\t * An {@link IObjectBuilder} for elements of this type.\n\t */\n\tpubl... | import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.pull.ParserContext;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import org.dmfs.xmlobjects.serializer.SerializerContext;
import org.dmfs.xmlobje... | /*
* Copyright (C) 2014 Marten Gajda <marten@dmfs.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | public void writeChildren(ElementDescriptor<URI> descriptor, URI object, IXmlChildWriter childWriter, SerializerContext context) | 5 |
mkovatsc/iot-semantics | semantic-ide/src/main/java/ch/ethz/inf/vs/semantics/ide/workspace/VirtualWorkspace.java | [
"public class Backup {\n\tprivate Collection<Device> devices;\n\tprivate Collection<Query> queries;\n\n\tpublic Backup() {\n\n\t}\n\n\tpublic Backup(Collection<Device> devices, Collection<Query> queries) {\n\n\t\tthis.devices = devices;\n\t\tthis.queries = queries;\n\t}\n\n\tpublic Collection<Device> getDevices() {... | import ch.ethz.inf.vs.semantics.ide.domain.Backup;
import ch.ethz.inf.vs.semantics.ide.domain.Device;
import ch.ethz.inf.vs.semantics.ide.domain.Query;
import ch.ethz.inf.vs.semantics.ide.domain.WorkspaceInfo;
import ch.ethz.inf.vs.semantics.parser.N3Utils;
import ch.ethz.inf.vs.semantics.server.semantics.SemanticDataC... | package ch.ethz.inf.vs.semantics.ide.workspace;
public class VirtualWorkspace extends Workspace {
private String name; | public HashMap<Integer, Device> devices; | 1 |
mtenrero/vetManager | src/main/java/es/urjc/etsii/mtenrero/Controllers/ClientDashboardController.java | [
"public class AppointmentMerger {\n\n ClientRepository clientRepository;\n\n public AppointmentMerger(ClientRepository clientRepository) {\n this.clientRepository = clientRepository;\n }\n\n public List<Appointment> getAppointmentsByClient(Client client) {\n\n List<Appointment> appointment... | import es.urjc.etsii.mtenrero.BusinessLogic.Helpers.AppointmentMerger;
import es.urjc.etsii.mtenrero.Entities.Appointment;
import es.urjc.etsii.mtenrero.Entities.Client;
import es.urjc.etsii.mtenrero.Repositories.AppointmentRepository;
import es.urjc.etsii.mtenrero.Repositories.ClientRepository;
import es.urjc.etsii.mt... | package es.urjc.etsii.mtenrero.Controllers;
/**
* Created by marcostenrero on 14/3/17.
*/
@Controller
public class ClientDashboardController {
@Autowired
ClientRepository clientRepository;
@Autowired
AppointmentRepository appointmentRepository;
@Autowired
PreferenceRepository preferenceRep... | model.addAttribute("title", VetmanagerApplication.appName); | 7 |
mostlymagic/hacking-java | 3_defect-analysis/1_errorprone/src/test/java/org/zalando/techtalks/hackingjava/defectanalysis/errorprone/regex/ErrorProneRegexBugDetectionTest.java | [
"public interface DefectAnalysisEngine {\n CompilationResult compile(File sourceFile);\n}",
"public interface IllBehaved {}",
"public interface WellBehaved {\n}",
"public class ErrorProneAnalysisEngine implements DefectAnalysisEngine {\n\n private final Set<String> activatedChecks;\n\n public ErrorPr... | import com.google.common.collect.ImmutableSet;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.engine.DefectAnalysisEngine;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.IllBehaved;
import org.zalando.techtalks.hackingjava.defectanalysis.baseline.marker.WellBehaved;
import org... | package org.zalando.techtalks.hackingjava.defectanalysis.errorprone.regex;
public class ErrorProneRegexBugDetectionTest extends AbstractDefectDetectionTest {
@Override protected Class<? extends WellBehaved> wellBehavedClass() {
return WellBehavedRegex.class;
}
| @Override protected Class<? extends IllBehaved> illBehavedClass() { | 1 |
MaLeLabTs/RegexGenerator | Random Regex Turtle/src/it/units/inginf/male/terminalsets/FlaggingNgramsTerminalSetBuilder.java | [
"public class Configuration {\n\n private static final Logger LOG = Logger.getLogger(Configuration.class.getName()); \n \n /**\n * Initializes with default values, parameters and operators.\n */\n public Configuration() {\n this.evolutionParameters = new EvolutionParameters();\n t... | import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import it.units.inginf.male.configuration.Configuration;
import it.units.inginf.male.inputs.Context;
import it.units.inginf.male.inputs.DataSet;
import it.units.inginf.male.inputs.DataSet.Example;
import it.units.ingin... | /*
* Copyright (C) 2015 Machine Learning Lab - University of Trieste,
* Italy (http://machinelearning.inginf.units.it/)
*
* 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 ... | Leaf leaf = new Constant(Utils.escape(ngram)); | 3 |
bbottema/outlook-message-parser | src/test/java/org/simplejavamail/outlookmessageparser/HighoverEmailsTest.java | [
"public interface OutlookAttachment {\n\n}",
"public class OutlookFileAttachment implements OutlookAttachment {\n\n\t/**\n\t * The (by Outlook) shortened filename of the attachment.\n\t */\n\tprivate String filename;\n\t/**\n\t * The full filename of the attachment.\n\t */\n\tprivate String longFilename;\n\t/**\n... | import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.junit.Ignore;
import org.junit.Test;
import org.simplejavamail.outlookmessageparser.model.OutlookAttachment;
import org.simplejavamail.outlookmessageparser.model.OutlookFileAttachment;
import org.simplejavamail.outlookmessag... | package org.simplejavamail.outlookmessageparser;
public class HighoverEmailsTest {
@Test
public void testRtfSent()
throws IOException { | OutlookMessage msg = parseMsgFile("test-messages/simple sent.msg"); | 2 |
xyxyLiu/PluginM | PluginManager/src/main/java/com/reginald/pluginm/comm/PluginLocalManager.java | [
"public final class PluginInfo implements Parcelable {\n // install info\n public String packageName;\n public String apkPath;\n public String versionName;\n public int versionCode;\n public long fileSize;\n public long lastModified;\n public String dataDir;\n public String dexDir;\n p... | import android.content.Context;
import android.content.pm.PackageInfo;
import android.os.IBinder;
import com.reginald.pluginm.PluginInfo;
import com.reginald.pluginm.comm.invoker.InvokeCallback;
import com.reginald.pluginm.comm.invoker.InvokeCallbackWrapper;
import com.reginald.pluginm.comm.invoker.InvokeResult;
import... | package com.reginald.pluginm.comm;
/**
* Created by lxy on 17-9-20.
*/
public class PluginLocalManager implements IPluginLocalManager {
private static final String TAG = "PluginLocalManager";
private static volatile PluginLocalManager sInstance;
private Context mContext;
public static synchroni... | public IInvokeResult invoke(String packageName, String serviceName, String methodName, String params, IInvokeCallback callback) { | 4 |
curtisullerich/attendance | src/main/java/edu/iastate/music/marching/attendance/servlets/StudentServlet.java | [
"public class AbsenceManager extends AbstractManager {\n\n\tprivate DataTrain train;\n\n\tprivate static final Logger LOG = Logger.getLogger(AbsenceManager.class\n\t\t\t.getName());\n\n\tpublic AbsenceManager(DataTrain dataTrain) {\n\t\tthis.train = dataTrain;\n\t}\n\n\t/**\n\t * This does not store any changes in ... | import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.goog... | package edu.iastate.music.marching.attendance.servlets;
public class StudentServlet extends AbstractBaseServlet {
private enum Page {
index, attendance, forms, info, viewabsence;
}
/**
*
*/
private static final long serialVersionUID = 6636386568039228284L;
private static final Logger LOG = Logger.ge... | secondEmail = Util.makeEmail(req.getParameter("SecondEmail")); | 7 |
FernandoOrtegaMartinez/Planket | app/src/main/java/com/fomdeveloper/planket/ui/presentation/main/MainPresenter.java | [
"public class RxEventBus {\n\n private final PublishSubject<Object> busSubject;\n\n public RxEventBus() {\n busSubject = PublishSubject.create();\n }\n\n public void post(Object event) {\n busSubject.onNext(event);\n }\n\n public Observable<Object> observable() {\n return busS... | import android.support.annotation.NonNull;
import com.fomdeveloper.planket.bus.RxEventBus;
import com.fomdeveloper.planket.bus.events.FlickrUserLoggedInEvent;
import com.fomdeveloper.planket.data.model.FlickrUser;
import com.fomdeveloper.planket.data.prefs.PlanketBoxPreferences;
import com.fomdeveloper.planket.data.rep... | package com.fomdeveloper.planket.ui.presentation.main;
/**
* Created by Fernando on 31/05/16.
*/
public class MainPresenter extends BasePresenter<MainView> {
private FlickrRepository flickrRepository;
private PlanketBoxPreferences planketBoxPreferences;
private RxEventBus rxEventBus;
private S... | .subscribe(new SingleSubscriber<FlickrUser>() { | 2 |
LklCBPay/javasdk | src/main/java/com/lakala/crossborder/client/LklCbPayBatchTradeClient.java | [
"public class LklCrossPayEncryptReq extends LklCrossPaySuperReq {\n\n private static final long serialVersionUID = 1182200158599407155L;\n\n /**\n * 对称密钥\n */\n private String encKey;\n\n /**\n * 加密业务数据\n */\n private String encData;\n\n private String mac;\n\n\n public String g... | import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.lakala.crossborder.client.entities.LklCrossPayEncryptReq;
import com.lakala.crossborder.client.entities.LklCrossPayEncryptRes;
import com.lakala.crossborder.client.entities.LklCrossPaySuperReq;
import com.lakala.crossborder.client.entities.batc... | package com.lakala.crossborder.client;
/**
* 批量交易
*
* @author jiangzhifei jiangzhifei@lakala.com
*/
@Component("LklBatchTradeClient")
public class LklCbPayBatchTradeClient {
private static final Logger logger = LoggerFactory.getLogger(LklCbPayBatchTradeClient.class);
@Autowired
private LklCrossPayRe... | LklCrossPayEncryptReq req = LklMsgUtil.encryptMsg(order, dataHead); | 0 |
RojerAlone/shop | src/main/java/cn/cie/services/impl/OrderServiceImpl.java | [
"public class OrderDTO {\n\n /**\n * 订单id\n */\n private Integer id;\n\n /**\n * 订单所属用户id\n */\n private Integer uid;\n\n /**\n * 订单的总价格\n */\n private Double total;\n\n /**\n * 订单创建时间\n */\n private Date ctime;\n\n /**\n * 订单更新时间\n */\n private ... | import cn.cie.entity.*;
import cn.cie.entity.dto.OrderDTO;
import cn.cie.entity.dto.OrderItemDTO;
import cn.cie.mapper.*;
import cn.cie.services.OrderService;
import cn.cie.utils.MsgCenter;
import cn.cie.utils.PageUtil;
import cn.cie.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import or... | package cn.cie.services.impl;
/**
* Created by RojerAlone on 2017/6/12.
*/
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderMapper orderMapper;
@Autowired
private OrderitemMapper orderitemMapper;
@Autowired
private GameMapper gameMapper;
@Autowir... | PageUtil pageUtil = new PageUtil(orderMapper.getOrderNumsByUidAndStat(uid, Order.STAT_NOT_PAY), page); | 4 |
cdancy/artifactory-rest | src/main/java/com/cdancy/artifactory/rest/features/StorageApi.java | [
"@Singleton\npublic class BindListPropertiesToPath implements Binder {\n @SuppressWarnings(\"unchecked\")\n @Override\n public <R extends HttpRequest> R bindToRequest(final R request, final Object properties) {\n\n checkArgument(properties instanceof List, \"binder is only valid for List\");\n List<... | import javax.inject.Named;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.cdancy.artifactory.rest.binders.BindListPropertiesToPath;... | /*
* 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 ... | FileList fileList(@PathParam("repoKey") String repoKey, | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.