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 |
|---|---|---|---|---|---|---|
cccssw/enigma-vk | src/cuchaz/enigma/TranslatingTypeLoader.java | [
"public class JarIndex {\n\t\n\tprivate Set<ClassEntry> m_obfClassEntries;\n\tprivate Set<ClassEntry> m_nonePkgClassEntries;\n\tprivate TranslationIndex m_translationIndex;\n\tprivate Map<Entry,Access> m_access;\n\tprivate Multimap<ClassEntry,FieldEntry> m_fields;\n\tprivate Multimap<ClassEntry,BehaviorEntry> m_beh... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import javassist.ByteArrayClassPath;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassi... | /*******************************************************************************
* Copyright (c) 2015 Jeff Martin.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public
* License v3.0 which accompanies this distribution, and is avail... | private Translator m_obfuscatingTranslator; | 4 |
marcocor/smaph | src/main/java/it/unipi/di/acube/smaph/learn/featurePacks/BindingFeaturePack.java | [
"public class QueryInformation {\n\tpublic boolean includeSourceNormalSearch;\n\tpublic boolean includeSourceWikiSearch;\n\tpublic boolean includeSourceSnippets;\n\tpublic Double webTotalNS;\n\tpublic List<String> allBoldsNS;\n\tpublic HashMap<Integer, Integer> idToRankNS;\n\tpublic List<Pair<String, Integer>> bold... | import it.unipi.di.acube.batframework.data.Annotation;
import it.unipi.di.acube.batframework.utils.Pair;
import it.unipi.di.acube.batframework.utils.WikipediaInterface;
import it.unipi.di.acube.smaph.QueryInformation;
import it.unipi.di.acube.smaph.SmaphUtils;
import it.unipi.di.acube.smaph.WATRelatednessComputer;
impo... | package it.unipi.di.acube.smaph.learn.featurePacks;
public class BindingFeaturePack extends FeaturePack<HashSet<Annotation>> {
private static final long serialVersionUID = 1L;
private static String[] ftrNames = null;
public BindingFeaturePack(
HashSet<Annotation> binding, String query, | QueryInformation qi, WikipediaInterface wikiApi, WikipediaToFreebase w2f, EntityToAnchors e2a, HashMap<Annotation, HashMap<String, Double>> debugAnnotationFeatures, HashMap<String, Double> debugBindingFeatures){ | 4 |
Zahusek/TinyProtocolAPI | com/gmail/zahusek/tinyprotocolapi/api/tab/TabHolder.java | [
"public class TinyProtocolAPI extends JavaPlugin\r\n{\r\n\tpublic static void main(String[] args) \r\n\t{\r\n//\t\tlong s = System.nanoTime();\r\n//\t\tfor(int i = 0; i < 1000000; i++);\r\n//\t\tlong e = System.nanoTime();\r\n//\t\tSystem.out.println(e-s);\r\n\t}\r\n\t\r\n\tprivate static TinyProtocolAPI plugin;\r\... | import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
import java.util.UUID;
import com.gmail.zahusek.tinyprotocolapi.TinyProtocolAPI;
import com.gmail.zahusek.tinyprotocolapi.api.Preference;
import com.gmail.zahusek.tinyprotocolapi.packet.Packet;
import com.gmail.zahusek.tinyprot... | package com.gmail.zahusek.tinyprotocolapi.api.tab;
public class TabHolder implements TabModify
{
final int x = 4, y = 20;
final GameProfile[][] profile = new GameProfile[x][y];
final String uuid = "00000000-0000-%s-0000-000000000000";
final String token = "!@#$^*";
final GameType gamemode = GameType.... | final LinkedList<WrapperInfoData> xdefault = new LinkedList<>();
| 7 |
maeln/LambdaHindleyMilner | src/main/java/inference/interfaces/Unifyable.java | [
"public class Constraint extends Substitutable<Constraint> {\n private final Type left, right;\n\n public Constraint(Type left, Type right) {\n this.left = left;\n this.right = right;\n }\n\n public Type left() {\n return left;\n }\n\n public Type right() {\n return rig... | import inference.Constraint;
import inference.Substitution;
import exceptions.InfiniteTypeException;
import types.TVariable;
import types.Type;
import java.util.List; | package inference.interfaces;
/**
* Created by valentin on 25/10/2016.
*/
public interface Unifyable {
Substitution unifyWith(Type type);
default Substitution bind(TVariable var, Type type) {
if(var.equals(type)) return new Substitution(); | if(type.ftv().contains(var)) throw new InfiniteTypeException(this, type); | 2 |
pgroth/hbase-rdf | src/main/java/nl/vu/datalayer/hbase/coprocessor/CoprocessorBulkLoad.java | [
"public abstract class AbstractPrefixMatchBulkLoad {\n\t\n\tprivate static final long DEFAULT_BLOCK_SIZE = 134217728;\n\tprivate HTableInterface string2Id = null;\n\tprivate HTableInterface id2String = null;\n\t/**\n\t * Cluster parameters used to estimate number of reducers \n\t */\n\tpublic int TASK_PER_NODE =... | import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import nl.vu.datalayer.hbase.bulkload.AbstractPrefixMatchBulkLoad;
import nl.vu.datalayer.hbase.bulkload.BulkLoad;
import nl.vu.datalayer.hbase.bulkload.ResourceToTriple;
import nl.vu.datalayer.hbase.bulkload.ShuffleStageOptimizer;... | package nl.vu.datalayer.hbase.coprocessor;
public class CoprocessorBulkLoad extends AbstractPrefixMatchBulkLoad {
private String coprocessorPath;
public CoprocessorBulkLoad(Path input, int inputEstimateSize, String outputPath,
String schemaSuffix, boolean onlyTriples, int numberOfSlaveNodes,
S... | j.setJarByClass(BulkLoad.class); | 1 |
Bernardo-MG/repository-pattern-java | src/test/java/com/wandrell/pattern/test/integration/repository/access/postgresql/springjdbc/ITQueryPostgreSqlSpringJdbcRepository.java | [
"public class PersistenceContextPaths {\n\n /**\n * Eclipselink JPA persistence.\n */\n public static final String ECLIPSELINK = \"classpath:context/persistence/jpa-eclipselink.xml\";\n\n /**\n * Hibernate JPA persistence.\n */\n public static final String HIBERNATE = \"classpath:context... | import com.wandrell.pattern.test.util.config.properties.DatabaseScriptsPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.JdbcPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.PersistenceProviderPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.QueryPr... | /**
* The MIT License (MIT)
* <p>
* Copyright (c) 2015 the original author or authors.
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limi... | extends AbstractITQuery { | 6 |
xcltapestry/XCL-Charts | lib/src/main/java/org/xclcharts/renderer/LnChart.java | [
"public class CustomLineData {\n\t\n\tprivate String mLabel = \"\";\n\tprivate Double mDesireValue = 0d;\n\tprivate int mColor = Color.BLACK;\n\tprivate int mLineStroke = 0;\n\t\n\t//文字旋转角度\n\tprivate float mLabelRotateAngle = 0.0f; //-45f;\n\t\n\t//设置Label显示位置(左,中,右)\n\tprivate Align mLabelAlign = Align.RIGHT;\n\... | import org.xclcharts.renderer.info.PlotAxisTick;
import org.xclcharts.renderer.line.PlotCustomLine;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PointF;
import android.util.Log;
import java.util.List;
import org... | /**
* Copyright 2014 XCL-Charts
*
* 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... | protected PlotCustomLine mCustomLine = null; | 7 |
killbill/killbill-meter-plugin | src/main/java/org/killbill/billing/plugin/meter/api/user/DebugJsonSamplesOutputer.java | [
"public class TimelineChunksViews {\n\n public static class Base {\n\n }\n\n public static class Compact extends Base {\n\n }\n\n public static class Loose extends Base {\n\n }\n}",
"public class CSVConsumer {\n\n private CSVConsumer() {}\n\n public static String getSamplesAsCSV(final Samp... | import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.google.common.base.Strings;
import java.io.IOException;
import java.util.Collection;
import org.killbill.billing.plugin.meter.timeline.TimelineEventHandler;
import org.killbill.billing.plugin.meter.timeline.c... | /*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/lice... | writer.writeValue(generator, new TimelineChunkDecoded(chunk, sampleCoder)); | 2 |
kinnla/eniac | src/eniac/data/model/parent/ParentData.java | [
"public class KinderGarten {\n\n\t// all children in an array\n\tprivate EData[] _kinder;\n\n\t// data types\n\tprivate EType[] _types;\n\n\t// indices of the first element in each section\n\tprivate int[] _sections;\n\n\t// ============================ lifecycle\n\t// ===================================\n\n\tpubli... | import java.util.LinkedList;
import java.util.List;
import java.util.Observer;
import eniac.data.KinderGarten;
import eniac.data.model.EData;
import eniac.data.model.unit.Unit;
import eniac.io.Progressor;
import eniac.io.XMLUtil; | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | XMLUtil.appendCommentLine(l, indent, getName()); | 4 |
sergueik/SWET | src/main/java/com/github/sergueik/swet/SimpleToolBarEx.java | [
"public class Breadcrumb extends Canvas {\n\n\tprivate static final String IS_BUTTON_PRESSED = Breadcrumb.class.toString()\n\t\t\t+ \"_pressed\";\n\tprivate final List<BreadcrumbItem> items;\n\tprivate static final Display display = Display.getCurrent();\n\tprivate static Color START_GRADIENT_COLOR = new Color(disp... | import static org.hamcrest.CoreMatchers.hasItem;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Formatter;
import java.util.HashMap;
import java... | } catch (Exception e) {
// show the error dialog with exception trace
ExceptionDialogEx.getInstance().render(e);
}
shell.setData("payload", generatedScript);
ScrolledTextEx test = new ScrolledTextEx(Display.getCurrent(), shell);
updateStatus("Ready");
showEnabled(codeGenTool);
showE... | ChoicesDialog dialog = new ChoicesDialog(shell, SWT.APPLICATION_MODAL);
| 3 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/wizard/FindWizard.java | [
"public enum Event {\n\n\tDOCUMENT_VIEW,\n\tELEMENT_VIEW,\n\t\n\tWRITERESULT,\n\t\n\tEXCEPTION, \n\t\n\tTOWIZARD\n\t\n}",
"public class EventWorkBenchManager extends Object {\n\tprivate static EventWorkBenchManager thisInst;\n\t\n\tpublic static synchronized EventWorkBenchManager getInst(){\n\t\tif ( thisInst == ... | import java.io.IOException;
import org.aw20.mongoworkbench.Event;
import org.aw20.mongoworkbench.EventWorkBenchManager;
import org.aw20.mongoworkbench.MongoFactory;
import org.aw20.mongoworkbench.command.FindMongoCommand;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.eclipse.view.W... | /*
* MongoWorkBench is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3.
*
* MongoWorkBench is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implie... | if ( !cmd.getClass().getName().equals( FindMongoCommand.class.getName() ) ) | 3 |
regestaexe/bygle-ldp | src/main/java/org/bygle/service/RelationsService.java | [
"@Entity\n@Table(name = \"records\")\npublic class Records implements java.io.Serializable {\n\tprivate static final long serialVersionUID = -2757072151721076046L;\n\tprivate Long idRecord;\n\tprivate byte[] rdf;\n\tprivate Date creationDate;\n\tprivate Date modifyDate;\n\tprivate String rdfAbout;\n\tprivate String... | import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.lang3.StringUtils;
import org.bygle.bean.Records;
import org.bygle.bean.RelationTypes;
import org.bygle.b... | package org.bygle.service;
@Service("relationsService")
public class RelationsService {
@Autowired | BygleService bygleService; | 4 |
kyle-liu/netty4study | transport/src/main/java/io/netty/channel/local/LocalChannel.java | [
"public abstract class AbstractChannel extends DefaultAttributeMap implements Channel {\n\n private static final InternalLogger logger = InternalLoggerFactory.getInstance(AbstractChannel.class);\n\n static final ClosedChannelException CLOSED_CHANNEL_EXCEPTION = new ClosedChannelException(); //关闭Channel异常\n ... | import io.netty.channel.AbstractChannel;
import io.netty.channel.Channel;
import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelException;
import io.netty.channel.ChannelMetadata;
import io.netty.channel.ChannelOutboundBuffer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromi... | /*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | private final ChannelConfig config = new DefaultChannelConfig(this); | 4 |
tecsinapse/tecsinapse-data-io | src/main/java/br/com/tecsinapse/dataio/util/WorkbookUtil.java | [
"@Getter\n@EqualsAndHashCode(of = {\"hexString\"}, callSuper = false)\npublic class DataIOCustomColor extends HSSFColor {\n\n @Setter\n private short index;\n private final short[] triplet;\n private final String hexString;\n\n DataIOCustomColor(short index, Color color) {\n this.index = index... | import java.awt.Color;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.poi.hssf.usermodel.HSSFPalette;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.a... | /*
* Tecsinapse Data Input and Output
*
* License: GNU Lesser General Public License (LGPL), version 3 or later
* See the LICENSE file in the root directory or <http://www.gnu.org/licenses/lgpl-3.0.html>.
*/
package br.com.tecsinapse.dataio.util;
public class WorkbookUtil {
private Map<TableCellStyle, Cel... | List<List<TableCell>> matrix = table.getCells(); | 4 |
devhub-tud/Java-Gitolite-Manager | src/main/java/nl/tudelft/ewi/gitolite/config/ConfigImpl.java | [
"public interface Identifiable extends Comparable<Identifiable>, Serializable {\n\n\tString getPattern();\n\n\t@Override\n\tdefault int compareTo(Identifiable o) {\n\t\treturn getPattern().compareTo(o.getPattern());\n\t}\n\n}",
"@Value\npublic class Identifier implements Identifiable {\n\n\t/**\n\t * The name for... | import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import com.google.common.collect.Queues;
import com.google.common.collect.SetMultimap;
import lombok.EqualsAndHashCode;
import lomb... | package nl.tudelft.ewi.gitolite.config;
/**
* Simple config implementation.
*
* @author Jan-Willem Gmelig Meyling
*/
@Slf4j
@NoArgsConstructor
@EqualsAndHashCode
public class ConfigImpl implements Config {
private final Multimap<String, GroupRule> groupRuleMultimap = LinkedListMultimap.create();
| private final List<RepositoryRule> repositoryRules = Lists.newArrayList(); | 5 |
junneyang/xxproject | support/auth-server/src/main/java/com/xcompany/xproject/auth/server/controller/RegistrationController.java | [
"@Entity\npublic class Device {\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.AUTO)\n\tprivate Integer id;\n\n\t@NotEmpty\n\t@Column(unique = true, nullable = false)\n\tprivate String imei;\n\n\tprivate String name;\n\n\t@JsonIgnore\n\t@ManyToMany(fetch = FetchType.EAGER, mappedBy = \"devices\", cascade = {... | import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.sprin... | package com.xcompany.xproject.auth.server.controller;
@RestController
public class RegistrationController {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private IUserService userService;
@RequestMapping(value = "/user/registration", method = RequestMethod.POST)
... | public ApiError registerUserAccount(@Valid final UserDto accountDto, final HttpServletRequest request) { | 3 |
B2MSolutions/reyna | reyna-test/src/com/b2msolutions/reyna/services/ForwardServiceTest.java | [
"public enum Result {\n OK, PERMANENT_ERROR, TEMPORARY_ERROR, BLACKOUT, NOTCONNECTED\n}",
"public class Message implements Serializable {\n private static final long serialVersionUID = 6230786319646630263L;\n\n private Long id;\n\n private String url;\n\n private String body;\n\n private Header[... | import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import com.b2msolutions.reyna.*;
import com.b2msolutions.reyna.Dispatcher.Result;
import com.b2msolutions.reyna.system.Message;
import com.b2msolutions.reyna.system.PeriodicBackoutCheck... | package com.b2msolutions.reyna.services;
@Config(sdk = 18)
@RunWith(RobolectricTestRunner.class)
public class ForwardServiceTest {
private ForwardService forwardService;
@Mock Dispatcher dispatcher;
@Mock
Repository repository;
@Mock Thread thread;
@Mock
NetworkInfo networkInfo;
... | IMessageProvider messageProvider = this.forwardService.getMessageProvider(); | 6 |
mistraltechnologies/smog | src/test/java/com/mistraltech/smog/examples/generics/GenericsMatcherExamplesTest.java | [
"public class BoxMatcher<P1, R extends BoxMatcher, T extends Box<P1>> extends CompositePropertyMatcher<T> {\n private static final String MATCHED_OBJECT_DESCRIPTION = \"a Box\";\n\n private PropertyMatcher<P1> contentsMatcher = new ReflectingPropertyMatcher<P1>(\"contents\", this);\n\n protected BoxMatcher... | import com.mistraltech.smog.examples.generics.matcher.BoxMatcher;
import com.mistraltech.smog.examples.generics.matcher.LabelledBoxMatcher;
import com.mistraltech.smog.examples.model.generics.Box;
import com.mistraltech.smog.examples.model.generics.LabelledBox;
import org.hamcrest.Matcher;
import org.junit.Test;
import... | package com.mistraltech.smog.examples.generics;
public class GenericsMatcherExamplesTest {
@Test
public void testBoxMatcherSucceedsWhenMatches() { | Matcher<Box<Integer>> matcher = is(BoxMatcher.<Integer>aBoxThat().hasContents(5)); | 0 |
jsjolund/GdxDemo3D | core/src/com/mygdx/game/objects/SteerableBody.java | [
"public class GameScreen extends LoadableGdxScreen<GdxDemo3D> {\n\n\tprivate final static String TAG = \"GameScreen\";\n\n\tpublic static GameScreen screen;\n\n\tprivate final Viewport viewport;\n\tpublic GameStage stage;\n\tpublic final GameEngine engine;\n\tpublic final Sounds sounds;\n\tprivate final Color viewp... | import com.mygdx.game.utilities.Constants;
import com.mygdx.game.utilities.Steerer;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.ai.steer.Steerable;
import com.badlogic.gdx.ai.steer.SteeringAcceleration;
import com.badlogic.gdx.ai.utils.Location;
import com.badlogic.gdx.graphics.g3d.Model;
import com.badlogic.g... | /*******************************************************************************
* Copyright 2015 See AUTHORS file.
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p/>
* http:/... | updateSteerableData(GameScreen.screen.engine.getScene()); | 0 |
xandradx/ovirt-engine-disaster-recovery | app/controllers/Configurations.java | [
"public class ServiceResponse<T> {\n\t\n\tprivate boolean success;\n\tprivate String userMessage;\n\tprivate String errorMessage;\n\tprivate String sessionId;\n\t\n\tprivate T data;\n\t\n\tpublic static <T> ServiceResponse<T> success(String userMessage) {\n\t\treturn ServiceResponse.successToken(userMessage, null, ... | import dto.response.ServiceResponse;
import helpers.GlobalConstants;
import jobs.services.HostsJob;
import jobs.services.StorageConnectionsJob;
import models.Configuration;
import models.DatabaseConnection;
import models.DatabaseIQN;
import models.RemoteHost;
import play.data.validation.Valid;
import play.i18n.Messages... | package controllers;
@With(Secure.class)
@Check(GlobalConstants.ROLE_ADMIN)
public class Configurations extends AuthenticatedController {
public static void editConfiguration() {
Configuration configuration = Configuration.generalConfiguration();
render(configuration);
}
public static ... | public static void saveHosts(@Valid List<RemoteHost> hosts) { | 7 |
flexgp/flexgp | mrgp-flexgp/src/evogpj/sort/DominatedCount.java | [
"public class FitnessComparisonStandardizer {\n\n\t/**\n\t * Standardizes the way by which fitnesses are compared. Will always return\n\t * a fitness score where lower indicates better.\n\t * \n * @param individual\n * @param funcName\n * @param fitnessFunctions\n\t * @return transformed fit... | import evogpj.evaluation.FitnessComparisonStandardizer;
import evogpj.evaluation.FitnessFunction;
import evogpj.gp.Individual;
import evogpj.gp.Population;
import java.util.LinkedHashMap;
import java.util.Set;
import evogpj.operator.Operator; | /**
* Copyright (c) 2011-2013 Evolutionary Design and Optimization Group
*
* Licensed under the MIT License.
*
* See the "LICENSE" file for a copy of the license.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTA... | Double af = FitnessComparisonStandardizer.getFitnessForMinimization(a, fitnessFunctionName, fitnessFunctions); | 0 |
gallir/SpokenPic | src/com/spokenpic/Model.java | [
"public static class ClipData extends JsonData {\n\tpublic Long session_id;\n\tpublic String lang; // Locale.getDefault().getLanguage()\n\tpublic String user;\n\tpublic Long user_id;\n\tpublic String created;\n\tpublic Integer duration;\n\tpublic Integer status;\n\tpublic String title;\n\tpublic String hash_key;\n\... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.L... | db = dbOpenHelper.getWritableDatabase();
}
public void open() throws SQLException {
db = dbOpenHelper.getReadableDatabase();
}
public void close() {
if (db != null) {
db.close();
}
}
public void add(long id, int type, String filename, Boolean isImported) {
MediaItem e = new MediaItem(id, type, fil... | RestClientPut complete = new RestClientPut(resourceUri, clip.toString()); | 5 |
citysearch/web-widgets | src/main/java/com/citysearch/webwidget/facade/AbstractGrouponOffersFacade.java | [
"public class GrouponResponse {\n\tprivate String id;\n\tprivate String dealUrl;\n\tprivate String title;\n\tprivate String smallImageUrl;\n\tprivate String mediumImageUrl;\n\tprivate String largeImageUrl;\n\tprivate String divisionId;\n\tprivate String divisionName;\n\tprivate String latitude;\n\tprivate String lo... | import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.log4j.Logger;
import com.citysearch.webwidget.api.bean.GrouponResponse;... | package com.citysearch.webwidget.facade;
public abstract class AbstractGrouponOffersFacade {
private Logger log = Logger.getLogger(getClass());
private static final String DATE_FORMAT = "reviewdate.format";
private static final String GROUPON_TRACKING_URL_KEY = "groupon.tracking.url";
protected Stri... | dealUrl = Utils.getThirdPartyTrackingUrl(dealUrl, request.getDartClickTrackUrl(), | 8 |
graphql-java/java-dataloader | src/test/java/org/dataloader/fixtures/TestKit.java | [
"@FunctionalInterface\n@PublicSpi\npublic interface BatchLoader<K, V> {\n\n /**\n * Called to batch load the provided keys and return a promise to a list of values.\n * <p>\n * If you need calling context then implement {@link org.dataloader.BatchLoaderWithContext}\n *\n * @param keys the col... | import org.dataloader.BatchLoader;
import org.dataloader.DataLoader;
import org.dataloader.DataLoaderFactory;
import org.dataloader.DataLoaderOptions;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import static java.util.stream.Collectors.... | package org.dataloader.fixtures;
public class TestKit {
public static <T> BatchLoader<T, T> keysAsValues() {
return CompletableFuture::completedFuture;
}
public static <K, V> BatchLoader<K, V> keysAsValues(List<List<K>> loadCalls) {
return keys -> {
List<K> ks = new ArrayLi... | return failedFuture(new IllegalStateException("Error")); | 4 |
cash1981/civilization-boardgame-rest | src/main/java/no/asgari/civilization/server/action/TurnAction.java | [
"@Data\n@JsonIgnoreProperties(ignoreUnknown = true)\n@NoArgsConstructor\n@JsonRootName(\"turn\")\npublic class TurnDTO {\n private int turnNumber;\n @NotEmpty\n private String order;\n @NotNull\n private String phase;\n private boolean locked;\n}",
"@Log4j\npublic class SendEmail {\n public s... | import com.mongodb.DB;
import lombok.extern.log4j.Log4j;
import no.asgari.civilization.server.dto.TurnDTO;
import no.asgari.civilization.server.email.SendEmail;
import no.asgari.civilization.server.misc.CivUtil;
import no.asgari.civilization.server.misc.SecurityCheck;
import no.asgari.civilization.server.model.GameLog;... | package no.asgari.civilization.server.action;
@Log4j
public class TurnAction extends BaseAction {
private final JacksonDBCollection<PBF, String> pbfCollection;
public TurnAction(DB db) {
super(db);
this.pbfCollection = JacksonDBCollection.wrap(db.getCollection(PBF.COL_NAME), PBF.class, Str... | .forEach(p -> SendEmail.sendMessage(p.getEmail(), "Start of turn updated", playerhand.getUsername() + " has updated start of turn with " + | 1 |
kaif-open/kaif-android | app/src/main/java/io/kaif/mobile/service/ServiceModule.java | [
"public class ApiConfiguration {\n\n private String endPoint;\n\n private String clientId;\n\n private String redirectUri;\n\n private String clientSecret;\n\n public ApiConfiguration(String endPoint,\n String clientId,\n String clientSecret,\n String redirectUri) {\n this.endPoint = endPoint... | import android.app.Application;
import android.net.ConnectivityManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import io.kaif.mobile.BuildConfig;
import... | package io.kaif.mobile.service;
@Module
public class ServiceModule {
private final Application application;
private static final int CACHE_SIZE = 10 * 1024 * 1024;
public ServiceModule(Application application) {
this.application = application;
}
@Provides
@Singleton
public FeedService provid... | public ApiConfiguration provideOauthConfiguration() { | 0 |
kontalk/desktopclient-java | src/main/java/org/kontalk/view/ChatView.java | [
"public final class FeatureDiscovery {\n private static final Logger LOGGER = Logger.getLogger(FeatureDiscovery.class.getName());\n\n public enum Feature {\n USER_AVATAR,\n MULTI_ADDRESSING,\n /** New XEP-0363 upload service. */\n HTTP_FILE_UPLOAD,\n /** XEP-0012. */\n ... | import javax.swing.Icon;
import javax.swing.JFileChooser;
import javax.swing.JViewport;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt... | Chat oldChat = this.getCurrentChat().orElse(null);
if (oldChat != null)
oldChat.deleteObserver(this);
chat.addObserver(this);
if (!mMessageListCache.containsKey(chat)) {
MessageList newMessageList = new MessageList(mView, this, chat);
chat.addObserve... | boolean isMember = chat instanceof GroupChat && !((GroupChat) chat).containsMe(); | 3 |
kuaijibird/palmsuda | src/com/mialab/palmsuda/main/PalmSudaApp.java | [
"public class Constants {\n\tpublic static boolean TEST_MODE = false;\n\tpublic static boolean DEBUG_MODE =true;\t\n\tpublic static final String APP_TAG = \"PalmSuda\";\n\tpublic static final String APP_DIR = \"PalmSuda\";\n\tpublic static final String APP_CACHE = \"/cache\";\n\t\n\tpublic static final boolean MARK... | import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ApplicationInfo;
import android.content.p... | package com.mialab.palmsuda.main;
//import com.mialab.push_client.ServiceManager;
/**
* @author mialab
* @date 创建时间:2015-8-22 上午9:40:48
*
*/
public class PalmSudaApp extends Application {
private static final String TAG = Constants.APP_TAG;
private static PalmSudaApp app = null;
private SharedPreferences se... | StartServiceRecevier.class); | 3 |
vert-x3/vertx-kafka-client | src/test/java/io/vertx/kafka/client/common/tracing/TracingTest.java | [
"@DataObject(generateConverter = true)\npublic class KafkaClientOptions {\n /**\n * Default peer address to set in traces tags is null, and will automatically pick up bootstrap server from config\n */\n public static final String DEFAULT_TRACE_PEER_ADDRESS = null;\n\n /**\n * Default tracing policy is 'pro... | import io.vertx.core.Context;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.spi.tracing.SpanKind;
import io.vertx.core.spi.tracing.TagExtractor;
import io.vertx.core.spi.tracing.VertxTracer;
import io.vertx.core.tracing.TracingOptions;
import io.vertx.core.tracing.TracingPolicy;
im... | /*
* Copyright 2020 Red Hat 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... | producer.write(KafkaProducerRecord.create(topicName, "key-" + i, "value-" + i, 0)); | 3 |
igniterealtime/jbosh | src/test/java/org/igniterealtime/jbosh/XEP0124Section09Test.java | [
"public abstract class AbstractBody {\n\n ///////////////////////////////////////////////////////////////////////////\n // Constructor:\n\n /**\n * Restrict subclasses to the local package.\n */\n AbstractBody() {\n // Empty\n }\n\n //////////////////////////////////////////////////... | import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.concurrent.atomic.AtomicInteger;
i... | /*
* Copyright 2009 Mike Cumings
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | CMSessionParams params = session.getCMSessionParams(); | 1 |
olivergondza/jenkins-config-cloner | src/main/java/org/jenkinsci/tools/configcloner/Main.java | [
"public class CloneJob extends TransferHandler {\n\n public CloneJob(final ConfigTransfer config) {\n\n super(config);\n }\n\n @Override\n protected String getCommandName() {\n return \"get-job\";\n }\n\n @Override\n protected String updateCommandName() {\n return \"update-... | import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.jenkinsci.tools.configcloner.handler.CloneJob;
import org.jenkinsci.tools.configcloner.handler.CloneNode;
import or... | /*
* The MIT License
*
* Copyright (c) 2013 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy... | private final Handler usage = new Usage(this); | 3 |
acmeair/acmeair | acmeair-services-wxs/src/main/java/com/acmeair/wxs/service/FlightServiceImpl.java | [
"public interface AirportCodeMapping{\n\t\n\t\n\tpublic String getAirportCode();\n\t\n\tpublic void setAirportCode(String airportCode);\n\t\n\tpublic String getAirportName();\n\t\n\tpublic void setAirportName(String airportName);\n\n}",
"public interface FlightSegment {\n\t\n\tpublic String getFlightName();\n\n\t... | import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
impor... | /*******************************************************************************
* Copyright (c) 2013-2015 IBM Corp.
*
* 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.o... | private static String FLIGHT_SEGMENT_MAP_NAME="FlightSegment"; | 1 |
spearal/spearal-java | src/main/java/org/spearal/impl/introspector/IntrospectorImpl.java | [
"public interface SpearalContext {\n\n\tvoid configure(Configurable configurable);\n\tvoid configure(Configurable configurable, boolean append);\n\t\n\tSecurizer getSecurizer();\n\t\n\tString alias(Class<?> cls);\n\tString unalias(String aliasedClassName);\n\t\n\tClass<?> loadClass(String classNames, Type target)\n... | import static java.lang.reflect.Modifier.PRIVATE;
import static java.lang.reflect.Modifier.PROTECTED;
import static java.lang.reflect.Modifier.STATIC;
import static java.lang.reflect.Modifier.TRANSIENT;
import static org.spearal.configuration.PropertyFactory.ZERO_PROPERTIES;
import java.lang.reflect.Field;
import java.... | /**
* == @Spearal ==>
*
* Copyright (C) 2014 Franck WOLFF & William DRAI (http://www.spearal.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/... | private final CopyOnWriteMap<Class<?>, Object, Property[]> cache; | 4 |
brk3/finch | src/com/bourke/finch/fragments/BaseTimelineFragment.java | [
"public class FinchTwitterFactory {\n\n private static final String TAG = \"RoidRage/ResourceLoader\";\n\n private static FinchTwitterFactory singletonInstance = null;\n\n private Context mContext;\n\n private Twitter mTwitter;\n\n private FinchTwitterFactory(Context context) {\n mContext = co... | import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ListView;
import android.widget.Rel... | package com.bourke.finch;
public abstract class BaseTimelineFragment extends SherlockFragment
implements OnScrollListener {
protected String TAG = "Finch/BaseTimelineFragment";
protected ListView mMainList;
protected LazyAdapter mMainListAdapter;
protected Twitter mTwitter;
... | case TwitterTask.GET_HOME_TIMELINE: | 1 |
massivedisaster/ADAL | sample/src/androidTest/java/com/massivedisaster/adal/tests/unit/suite/adapters/AbstractBaseAdapterTests.java | [
"public abstract class AbstractLoadMoreBaseAdapter<T> extends AbstractBaseAdapter<T> {\n\n public static final int VIEW_TYPE_ITEM = 0;\n public static final int VIEW_TYPE_LOAD = 1;\n public static final int VIEW_TYPE_HEADER = 2;\n\n private static final int INVALID_RESOURCE_ID = -1;\n\n protected OnC... | import android.support.test.filters.LargeTest;
import android.support.test.runner.AndroidJUnit4;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.massivedisaster.adal.adapter.AbstractLoadMoreBaseAdapter;
import com.massivedisaster.adal.sample.feature.networ... | /*
* ADAL - A set of Android libraries to help speed up Android development.
*
* Copyright (c) 2017 ADAL
*
* 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, includin... | public class AbstractBaseAdapterTests extends AbstractBaseTestSuite { | 3 |
roscrazy/Android-RealtimeUpdate-CleanArchitecture | mvp/src/main/java/com/mike/feed/mapper/FeedModelMapper.java | [
"public class Deleted {\n}",
"public class Feed {\n private String title;\n private String body;\n private String image;\n private String key;\n private int index;\n\n public String getTitle() {\n return title;\n }\n\n public void setTitle(String title) {\n this.title = title... | import com.mike.feed.domain.Deleted;
import com.mike.feed.domain.Feed;
import com.mike.feed.domain.FeedChangedInfo;
import com.mike.feed.domain.Written;
import com.mike.feed.model.DeletedModel;
import com.mike.feed.model.FeedChangedInfoModel;
import com.mike.feed.model.FeedModel;
import com.mike.feed.model.WrittenModel... | package com.mike.feed.mapper;
/**
* Created by MinhNguyen on 8/24/16.
*/
@Singleton
public class FeedModelMapper {
@Inject
public FeedModelMapper(){
}
public FeedModel transform(Feed entity){
FeedModel feed = new FeedModel();
feed.setImage(entity.getImage());
feed.setBo... | public FeedChangedInfoModel transform(FeedChangedInfo entity){ | 2 |
noctarius/castmapr | src/test/java/com/noctarius/castmapr/ClientMapReduceTest.java | [
"public interface MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n extends ExecutableMapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n{\n\n /**\n * Defines the mapper for this task. This method is not idempotent and is callable only one time. If called further\n * times an {@link IllegalStateExceptio... | import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Semaphore;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.ex... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed u... | MapReduceTask<Integer, Integer, String, Integer> task = factory.build( m1 ); | 0 |
desht/ScrollingMenuSign | src/main/java/me/desht/scrollingmenusign/views/SMSView.java | [
"public enum SMSAccessRights {\n OWNER, GROUP, OWNER_GROUP, ANY;\n\n /**\n * Check if the given player is allowed to use an access-controlled object owned by the given owner.\n *\n * @param player the player to check for\n * @param ownerId the UUID of the object's owner\n * @param own... | import me.desht.dhutils.*;
import me.desht.dhutils.block.BlockUtil;
import me.desht.scrollingmenusign.*;
import me.desht.scrollingmenusign.enums.SMSAccessRights;
import me.desht.scrollingmenusign.enums.SMSUserAction;
import me.desht.scrollingmenusign.enums.ViewJustification;
import me.desht.scrollingmenusign.util.Subst... | package me.desht.scrollingmenusign.views;
/**
* Represents a base menu view from which all concrete views will inherit.
*/
public abstract class SMSView extends CommandTrigger implements Observer, SMSPersistable, ConfigurationListener, SMSInteractableBlock {
// operations which were player-specific (active sub... | attributes.registerAttribute(ACCESS, SMSAccessRights.ANY, "Who may use this view"); | 0 |
tech-advantage/sonar-gerrit-plugin | src/test/java/fr/techad/sonar/gerrit/network/rest/GerritRestConnectorTest.java | [
"@ScannerSide\n@InstantiationStrategy(InstantiationStrategy.PER_BATCH)\npublic class GerritConfiguration {\n private static final Logger LOG = Loggers.get(GerritConfiguration.class);\n\n private boolean enabled;\n private boolean valid;\n private boolean anonymous;\n private boolean commentNewIssuesO... | import fr.techad.sonar.GerritConfiguration;
import fr.techad.sonar.GerritConstants;
import fr.techad.sonar.GerritPluginException;
import fr.techad.sonar.PropertyKey;
import fr.techad.sonar.gerrit.GerritConnector;
import fr.techad.sonar.gerrit.factory.GerritConnectorFactory;
import fr.techad.sonar.mockito.MockitoExtensi... | package fr.techad.sonar.gerrit.network.rest;
@ExtendWith(MockitoExtension.class)
@RunWith(JUnitPlatform.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class GerritRestConnectorTest {
static private String listFiles = ")]}'" +
" {" +
" \"/COMMIT_MSG\": {" +
" \"sta... | settings.setProperty(PropertyKey.GERRIT_SCHEME, GerritConstants.SCHEME_HTTP) | 1 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorJMSTest.java | [
"public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.junit.Test;
import com.tibco.exchange.tibreview.common.TIBResource;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.mod... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class CProcessorJMSTest {
private static final Logger LOGGER = Logger.getLogger(CProcessorJMSTest.class);
@Test
public void testCProcessorJMSTest() {
TIBResource fileresource;
try {
fileresource = new TIBResource("src/tes... | Tibrules tibrules= RulesParser.getInstance().parseFile("src/test/resources/FileResources/xml/JMSConnectionResource.xml");
| 6 |
msoute/vertx-deploy-tools | vertx-deploy-agent/src/main/java/nl/jpoint/vertx/deploy/agent/service/DefaultDeployService.java | [
"@JsonIgnoreProperties(ignoreUnknown = true)\npublic class DeployApplicationRequest extends ModuleRequest {\n\n private boolean running = false;\n private String javaOpts = \"\";\n private String instances = \"1\";\n private String configLocation = \"\";\n private boolean installed = false;\n priv... | import nl.jpoint.vertx.deploy.agent.request.DeployApplicationRequest;
import nl.jpoint.vertx.deploy.agent.request.DeployArtifactRequest;
import nl.jpoint.vertx.deploy.agent.request.DeployConfigRequest;
import nl.jpoint.vertx.deploy.agent.request.DeployRequest;
import nl.jpoint.vertx.deploy.agent.util.LogConstants;
impo... | package nl.jpoint.vertx.deploy.agent.service;
public class DefaultDeployService {
private static final Logger LOG = LoggerFactory.getLogger(DefaultDeployService.class);
private final DeployApplicationService applicationDeployService;
private final DeployArtifactService artifactDeployService;
priv... | LOG.info("[{} - {}]: Done extracting all config.", LogConstants.DEPLOY_CONFIG_REQUEST, id); | 4 |
ericleong/forceengine | Force Engine/src/forceengine/demo/objects/Mover.java | [
"public class CircleMath {\n\t/**\n\t * checks whether or not 2 circles have collided with each other\n\t * \n\t * @param circle1\n\t * the first circle\n\t * @param circle2\n\t * the second circle\n\t * @return whether or not they have collided\n\t */\n\tpublic static final boolean checkcircl... | import forceengine.math.CircleMath;
import forceengine.objects.Accelerator;
import forceengine.objects.Circle;
import forceengine.objects.Force;
import forceengine.objects.PointVector;
import forceengine.objects.RectVector;
import forceengine.objects.StaticCircle;
import forceengine.objects.Vector;
import forceengine.p... | package forceengine.demo.objects;
public class Mover extends StaticCircle implements Accelerator {
private boolean alive;
private int direction;
public Mover(double x, double y, double power, int direction) {
super(x, y, power);
alive = true;
this.direction = direction;
}
@Override
public Vector accele... | return PhysicsMath.inverseSquaredAttraction(-radius * radius * 250 * direction, this, pv); | 8 |
shamanland/xdroid | lib-options/src/main/java/xdroid/options/OptionAccessor.java | [
"public static Context getContext() {\n if (sContext == null) {\n sContext = CurrentApplicationHolder.INSTANCE;\n }\n\n return notNull(sContext);\n}",
"@SuppressWarnings(\"unchecked\")\npublic static <T> T cast(Object object) {\n return (T) object;\n}",
"public static <T> T notNull(T object) ... | import android.content.Context;
import android.content.SharedPreferences;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import static xdroid.core.Global.getContext;
import static xdroid.core.ObjectUtils.cast;
import static xdroid.core.ObjectUtils.notNull;
import static xdroid.core.Shared... | mGetter = new BooleanGetter();
mSetter = new BooleanSetter();
}
public OptionAccessor(String defaultValue) {
mDefaultValue = defaultValue;
mGetter = new StringGetter();
mSetter = new StringSetter();
}
public OptionAccessor(Set<String> defaultValue) {
mDe... | mValue = getFloat(getPrefs(), mOption.getName(), (Float) mDefaultValue); | 4 |
bafomdad/uniquecrops | com/bafomdad/uniquecrops/entities/EntityEulaBook.java | [
"@Mod(modid=UniqueCrops.MOD_ID, name=UniqueCrops.MOD_NAME, version=UniqueCrops.VERSION)\npublic class UniqueCrops {\n\n\tpublic static final String MOD_ID = \"uniquecrops\";\n\tpublic static final String MOD_NAME = \"Unique Crops\";\n\tpublic static final String VERSION = \"0.2.02\";\n\t\n\t@SidedProxy(clientSide=\... | import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.ItemStack;
imp... | package com.bafomdad.uniquecrops.entities;
public class EntityEulaBook extends EntityPotion {
public EntityEulaBook(World world) {
super(world);
}
public EntityEulaBook(World worldIn, EntityLivingBase throwerIn, ItemStack potionDamageIn) {
super(worldIn, throwerIn, potionDamageIn);
}
@Override
... | UCPacketHandler.sendToNearbyPlayers(worldObj, pos, new PacketUCEffect(EnumParticleTypes.CRIT, pos.getX() - 0.5D, pos.getY() - 0.5D, pos.getZ() - 0.5D, 5)); | 3 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/fragment/NewsFragment.java | [
"public abstract class BenihRecyclerListener extends RecyclerView.OnScrollListener\n{\n private int previousTotal = 0;\n private boolean loading = true;\n private int visibleThreshold = 3;\n private int firstVisibleItem;\n private int visibleItemCount;\n private int totalItemCount;\n private in... | import id.zelory.codepolitan.data.LocalDataManager;
import id.zelory.codepolitan.ui.ListArticleActivity;
import id.zelory.codepolitan.ui.ReadActivity;
import id.zelory.codepolitan.ui.adapter.NewsAdapter;
import timber.log.Timber;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.... | /*
* Copyright (c) 2015 Zelory.
*
* 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... | recyclerView.addOnScrollListener(new BenihRecyclerListener((LinearLayoutManager) recyclerView.getLayoutManager(), 3) | 0 |
dschadow/ApplicationIntrusionDetection | duke-encounters/src/main/java/de/dominikschadow/dukeencounters/account/AccountController.java | [
"@Entity\n@Table(name = \"confirmations\")\n@Data\npublic class Confirmation {\n @Id\n @GeneratedValue\n private long id;\n @ManyToOne\n @JoinColumn(name = \"user_id\", nullable = false)\n private DukeEncountersUser user;\n @ManyToOne(fetch = FetchType.LAZY)\n @JoinColumn(name = \"encounter_... | import de.dominikschadow.dukeencounters.confirmation.Confirmation;
import de.dominikschadow.dukeencounters.confirmation.ConfirmationService;
import de.dominikschadow.dukeencounters.encounter.DukeEncountersUser;
import de.dominikschadow.dukeencounters.encounter.Encounter;
import de.dominikschadow.dukeencounters.encounte... | /*
* Copyright (C) 2016 Dominik Schadow, dominikschadow@gmail.com
*
* This file is part of the Application Intrusion Detection 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
... | private final ConfirmationService confirmationService; | 1 |
iostackproject/SDGen | src/com/ibm/compression/jcraft/jzlib/ZOutputStream.java | [
"public final class Deflate implements Cloneable {\n\n\tstatic final private int MAX_MEM_LEVEL = 9;\n\n\tstatic final private int Z_DEFAULT_COMPRESSION = -1;\n\n\tstatic final private int MAX_WBITS = 15; // 32K LZ77 window\n\tstatic final private int DEF_MEM_LEVEL = 8;\n\n\tstatic class Config {\n\t\tint good_lengt... | import com.ibm.compression.jcraft.jzlib.Deflate;
import com.ibm.compression.jcraft.jzlib.Deflater;
import com.ibm.compression.jcraft.jzlib.DeflaterOutputStream;
import com.ibm.compression.jcraft.jzlib.Inflater;
import com.ibm.compression.jcraft.jzlib.JZlib;
import com.ibm.compression.jcraft.jzlib.ZStreamException;
impo... | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
/*
Copyright (c) 2011 ymnk, JCraft,Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the... | throw new ZStreamException("inflating: "+inflater.msg); | 5 |
calrissian/flowmix | src/test/java/org/calrissian/flowmix/api/builder/FlowBuilderTest.java | [
"public class Flow implements Serializable{\n\n String id;\n String name;\n String description;\n\n Map<String,StreamDef> streams = new HashMap<String, StreamDef>();\n\n public String getId() {\n return id;\n }\n\n public String getName() {\n return name;\n }\n\n public Stri... | import org.calrissian.flowmix.api.Flow;
import org.calrissian.flowmix.api.Policy;
import org.calrissian.flowmix.api.aggregator.CountAggregator;
import org.calrissian.flowmix.api.aggregator.LongSumAggregator;
import org.calrissian.flowmix.api.filter.CriteriaFilter;
import org.calrissian.flowmix.api.builder.FlowBuilder;
... | /*
* Copyright (C) 2014 The Calrissian Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | .aggregate().aggregator(LongSumAggregator.class).evict(Policy.COUNT, 500).trigger(Policy.TIME, 25).end() | 3 |
Ericliu001/Weather2016 | app/src/mock/java/com/example/ericliu/weather2016/repo/FakeRemoteWeatherRepo.java | [
"public class MyApplication extends Application {\n\n private static RepoComponent component;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n RepoComponent repoComponent = DaggerRepoComponent.builder()\n .repoModule(new RepoModule())\n .appModule... | import android.app.Application;
import android.util.Log;
import com.example.ericliu.weather2016.R;
import com.example.ericliu.weather2016.application.MyApplication;
import com.example.ericliu.weather2016.framework.repository.RepositoryResult;
import com.example.ericliu.weather2016.framework.repository.Specification;
im... | package com.example.ericliu.weather2016.repo;
/**
* Created by ericliu on 12/04/2016.
*/
public class FakeRemoteWeatherRepo extends RemoteWeatherRepo {
private static final String TAG = FakeRemoteWeatherRepo.class.getSimpleName();
@Inject
Application mApplication;
@Inject
Gson mGson;
... | public WeatherResult get(Specification spec) throws IOException { | 5 |
FAOSTAT/faostat-api | faostat-api-web/src/main/java/org/fao/faostat/api/web/rest/V10Definitions.java | [
"public class FAOSTATAPICore {\n\n private static final Logger LOGGER = Logger.getLogger(FAOSTATAPICore.class);\n\n private QUERIES queries;\n\n public FAOSTATAPICore() {\n this.setQueries(new QUERIES());\n }\n\n public OutputBean query(String queryCode, DatasourceBean datasourceBean, Metadata... | import javax.ws.rs.core.*;
import org.apache.log4j.Logger;
import org.fao.faostat.api.core.FAOSTATAPICore;
import org.fao.faostat.api.core.StreamBuilder;
import org.fao.faostat.api.core.beans.DatasourceBean;
import org.fao.faostat.api.core.beans.MetadataBean;
import org.fao.faostat.api.core.constants.OUTPUTTYPE;
import... | /**
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991
* <p/>
* Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is no... | StreamBuilder sb = new StreamBuilder(); | 1 |
PedroGomes/TPCw-benchmark | src/org/uminho/gsd/benchmarks/benchmark/BenchmarkExecutor.java | [
"public class ResultHandler {\n\n\tprivate static List<ResultHandler> client_results = new CopyOnWriteArrayList<ResultHandler>();\n\n\tprivate Map<String, String> bechmark_info = null;\n\n\tprivate int testsamples = 100;\n\n\tprivate String test_name;\n\n\n\t/**\n\t * results -> for each operation store the result... | import java.util.concurrent.CountDownLatch;
import org.uminho.gsd.benchmarks.dataStatistics.ResultHandler;
import org.uminho.gsd.benchmarks.interfaces.Workload.AbstractWorkloadGeneratorFactory;
import org.uminho.gsd.benchmarks.interfaces.Workload.WorkloadGeneratorInterface;
import org.uminho.gsd.benchmarks.interfaces.e... | /*
* *********************************************************************
* Copyright (c) 2010 Pedro Gomes and Universidade do Minho.
* 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... | final DatabaseExecutorInterface executor = databaseInterface.getDatabaseClient(); | 4 |
Wootric/WootricSDK-Android | androidsdk/src/main/java/com/wootric/androidsdk/network/tasks/CheckEligibilityTask.java | [
"public class Constants {\n\n public static final long DAY_IN_MILLIS = 1000L *60L *60L *24L;\n\n public static final int NOT_SET = -1;\n\n public static final long DEFAULT_RESURVEY_DAYS = 90L;\n\n public static final long DEFAULT_DECLINE_RESURVEY_DAYS = 30L;\n\n public static final String TAG = \"WOO... | import com.wootric.androidsdk.utils.Utils;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Map;
import android.util.Log;
import com.wootric.androidsdk.Constants;
import com.wootric.androidsdk.network.responses.EligibilityResponse;
import com.wootric.androidsdk.objects.EndUser;
import com.woo... | /*
* Copyright (c) 2016 Wootric (https://wootric.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modi... | Log.d(Constants.TAG, "parameters: " + paramsMap); | 0 |
adamin1990/MaterialWpp | wpp/app/src/main/java/adamin90/com/wpp/fragment/OtherFragment.java | [
"public class Constant {\n public static final String BASEURL=\"http://client.pic.hiapk.com/\";\n}",
"public class OtherAdapter extends RecyclerView.Adapter<OtherAdapter.MyHolder> {\n\nprivate List<Datum> datums;\n private int pid;\n\n public OtherAdapter(int pid, List<Datum> datums) {\n this.p... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.GridLayoutManager;
import android.view.LayoutInflater;
import android.view.Vi... | package adamin90.com.wpp.fragment;
/**
* Created by LiTao on 2015-11-21-15:36.
* Company: QD24so
* Email: 14846869@qq.com
* WebSite: http://lixiaopeng.top
*/
public class OtherFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener,OnMoreListener{
private int pid;
private int start ... | private OtherAdapter adapter; | 1 |
lucassaldanha/playdoh | src/main/java/com/lsoftware/playdoh/ObjectBuilderImpl.java | [
"public interface TypeValueGenerator<T> {\n\n T generate();\n\n <T> T[] generateArray();\n\n}",
"public interface ValueGeneratorFactory {\n\n TypeValueGenerator getFromType(Class type);\n\n boolean existsForType(Class type);\n\n void register(Class type, TypeValueGenerator generator);\n\n}",
"pub... | import com.lsoftware.playdoh.generator.TypeValueGenerator;
import com.lsoftware.playdoh.generator.ValueGeneratorFactory;
import com.lsoftware.playdoh.generator.ValueGeneratorFactoryImpl;
import com.lsoftware.playdoh.resolver.InterfaceResolver;
import com.lsoftware.playdoh.resolver.InterfaceResolverImpl;
import com.lsof... | package com.lsoftware.playdoh;
@SuppressWarnings("unchecked")
public final class ObjectBuilderImpl implements ObjectBuilder {
private static final ValueGeneratorFactory valueGeneratorFactory = new ValueGeneratorFactoryImpl();
private static final InterfaceResolver interfaceResolver = new InterfaceResolverI... | if(Primitives.isPrimitiveArray(field.getType())) { | 5 |
nerlo/nerlo | java/src/org/ister/graphdb/executor/AbstractGraphdbMsgExecutor.java | [
"public class Main {\n\n\tprivate final String[] args;\n\tprivate final String pwd = System.getProperty(\"user.dir\");\n\t\n\tprivate String sname = \"jnode\";\n\tprivate String cookie = \"123456\";\n\tprivate String peer = \"shell\";\n\tprivate String handlerClass = \"org.ister.ej.SimpleMsgHandler\";\n\tprivate... | import org.apache.log4j.Logger;
import org.ister.ej.Main;
import org.ister.ej.Msg;
import org.ister.ej.Node;
import org.ister.nerlo.AbstractMsgExecutor;
import org.ister.nerlo.ExecutorException;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.index.IndexService; | package org.ister.graphdb.executor;
public abstract class AbstractGraphdbMsgExecutor extends AbstractMsgExecutor {
protected final Logger log = Main.getLogger();
protected GraphDatabaseService db;
protected IndexService index;
| public void init(Node node, GraphDatabaseService db, IndexService index) { | 2 |
dgrunwald/arden2bytecode | src/arden/MainClass.java | [
"public final class CompiledMlm implements MedicalLogicModule {\n\tprivate final byte[] data;\n\tprivate final MaintenanceMetadata maintenance;\n\tprivate final LibraryMetadata library;\n\tprivate final String mlmname;\n\tprivate final double priority;\n\tprivate Constructor<? extends MedicalLogicModuleImplementati... | import java.lang.reflect.InvocationTargetException;
import arden.compiler.CompiledMlm;
import arden.compiler.Compiler;
import arden.compiler.CompilerException;
import arden.runtime.ArdenValue;
import arden.runtime.ExecutionContext;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOExcept... | // arden2bytecode
// Copyright (c) 2010, Daniel Grunwald
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this lis... | Compiler compiler = new Compiler(); | 1 |
apache/commons-exec | src/test/java/org/apache/commons/exec/issues/Exec49Test.java | [
"public class CommandLine {\n\n /**\n * The arguments of the command.\n */\n private final Vector<Argument> arguments = new Vector<>();\n\n /**\n * The program to execute.\n */\n private final String executable;\n\n /**\n * A map of name value pairs used to expand command line arg... | import java.io.ByteArrayOutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecuteResultHandler;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.Executor;
import org.apache.comm... | /*
* 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 ... | final DefaultExecuteResultHandler handler = new DefaultExecuteResultHandler(); | 1 |
siis/coal | src/main/java/edu/psu/cse/siis/coal/transformers/PathTransformer.java | [
"public interface Internable<T> {\n public T intern();\n}",
"public class Pool<T> {\n private final ConcurrentMap<T, T> pool = new ConcurrentHashMap<>();\n\n public T intern(T element) {\n T result = pool.putIfAbsent(element, element);\n if (result == null) {\n return element;\n } else {\n r... | import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import edu.psu.cse.siis.coal.Internable;
import edu.psu.cse.siis.coal.Pool;
import edu.psu.cse.siis.coal.field.transformers.FieldTransformer;
import edu.psu.cse.siis.coal.field.values.FieldValue;
import edu.psu.cse.siis.coal.field.values.NullFiel... | /*
* Copyright (C) 2015 The Pennsylvania State University and the University of Wisconsin
* Systems and Internet Infrastructure Security Laboratory
*
* Author: Damien Octeau
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Y... | public PathValue computeTarget(PathValue source) { | 5 |
trigor74/travelers-diary | app/src/main/java/com/travelersdiary/adapters/DiaryImagesListAdapter.java | [
"public final class Constants {\n // firebase\n public static final String FIREBASE_URL = BuildConfig.FIREBASE_ROOT_URL;\n public static final String FIREBASE_USERS = \"users\";\n public static final String FIREBASE_USER_EMAIL = \"email\";\n public static final String FIREBASE_USER_NAME = \"name\";\n... | import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.G... | package com.travelersdiary.adapters;
public class DiaryImagesListAdapter extends RecyclerView.Adapter<DiaryImagesListAdapter.ViewHolder> {
private final static int IMAGES = 0;
private final static int SHOW_ALL = 1;
private final static int WARNING = 3;
private final static int ITEM_COUNT = 12;
... | Intent intent = new Intent(mFragment.getContext(), FullScreenImageActivity.class); | 3 |
alfa-laboratory/colibri-ui | src/main/java/ru/colibri/ui/core/steps/AbsSteps.java | [
"@Component\n@Getter\n@Setter\npublic class TestContext {\n private String currentPageName;\n private Map<String, String> context = new HashMap<>();\n}",
"public interface IElement {\n String getName();\n\n String getContentDesc();\n\n String getId();\n\n String getText();\n\n String getXpath... | import io.appium.java_client.AppiumDriver;
import lombok.extern.java.Log;
import org.jbehave.core.steps.Steps;
import org.openqa.selenium.WebElement;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import ru.colibri.ui.core.contexts.TestContext;
... | package ru.colibri.ui.core.steps;
@Log
public abstract class AbsSteps extends Steps implements InitializingBean {
private static final int TIMEOUT = 7;
private int currentTimeout;
@Autowired
protected TestContext testContext;
@Autowired
protected AppiumDriver driver;
@Autowired(requir... | protected DriversSettings driverSettings; | 5 |
klaus7/jfastnet | src/main/java/com/jfastnet/State.java | [
"public class EventLog {\n\n\tprivate final Config config;\n\tprivate final State state;\n\n\t@Getter\n\tprivate CircularFifoQueue<Event> eventQueue;\n\n\tpublic EventLog(Config config, State state) {\n\t\tthis.config = config;\n\t\tthis.state = state;\n\t\tthis.eventQueue = new CircularFifoQueue<>(config.eventLogS... | import java.lang.reflect.InvocationTargetException;
import java.util.*;
import com.jfastnet.events.EventLog;
import com.jfastnet.idprovider.IIdProvider;
import com.jfastnet.messages.MessagePart;
import com.jfastnet.processors.IMessageReceiverPostProcessor;
import com.jfastnet.processors.IMessageReceiverPreProcessor;
im... | /*******************************************************************************
* Copyright 2018 Klaus Pfeiffer - klaus@allpiper.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
*
... | private SortedMap<Long, SortedMap<Integer, MessagePart>> byteArrayBufferMap = new TreeMap<>(); | 2 |
mikelewis0/easyccg | src/uk/ac/ed/easyccg/rebanking/SubcategorizePrepositionRebanker.java | [
"public abstract class Category {\n private final String asString;\n private final int id;\n private final static String WILDCARD_FEATURE = \"X\"; \n private final static Set<String> bracketAndQuoteCategories = ImmutableSet.of(\"LRB\", \"RRB\", \"LQU\", \"RQU\");\n\n private Category(String asString, String se... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import uk.ac.ed.easyccg.syntax.Category;
import uk.ac.ed.easyccg.syntax.SyntaxTreeNode;
import uk.ac.ed.easyccg.syntax.SyntaxTreeNode.SyntaxTreeNodeLeaf;
import uk.ac.ed.easyccg.syntax.evaluation.... | package uk.ac.ed.easyccg.rebanking;
/**
* Subcategorizes PP and PR categories, making categories like: ((S[dcl]\NP)/PP[with])/PR[out]
*/
public class SubcategorizePrepositionRebanker extends Rebanker
{
private final static Category POSSESSIVE_PRONOUN = Category.valueOf("NP/(N/PP)");
private final static Categ... | List<SyntaxTreeNodeLeaf> doRebanking(SyntaxTreeNode parse, DependencyParse dependencyParse) | 1 |
splendidbits/play-pushservices | module/app/helpers/pushservices/MessageBuilder.java | [
"public enum MessagePriority {\n @EnumValue(\"low\")\n PRIORITY_LOW,\n\n @EnumValue(\"normal\")\n PRIORITY_NORMAL,\n\n @EnumValue(\"high\")\n PRIORITY_HIGH,\n}",
"public class MessageValidationException extends Throwable {\n\n public MessageValidationException(String message) {\n super... | import enums.pushservices.MessagePriority;
import exceptions.pushservices.MessageValidationException;
import models.pushservices.db.Credentials;
import models.pushservices.db.Message;
import models.pushservices.db.PayloadElement;
import models.pushservices.db.Recipient;
import javax.annotation.Nonnull;
import javax.ann... | package helpers.pushservices;
/**
* Easily build a Push Service's Platform {@link Message} which can be then
* added to a task and sent to the platform providers using the {@link java.util.TaskQueue}.
*/
public class MessageBuilder {
public static class Builder {
private final int ONE_WEEK_IN_SECONDS ... | List<PayloadElement> payload = new ArrayList<>(); | 4 |
reportportal/service-authorization | src/main/java/com/epam/reportportal/auth/config/AuthIntegrationValidatorConfig.java | [
"public class SamlUpdateAuthRequestValidator extends UpdateAuthRequestValidator {\n\n\tprivate static final Predicate<UpdateAuthRQ> FULL_NAME_IS_EMPTY = request -> FULL_NAME_ATTRIBUTE.getParameter(request).isEmpty();\n\tprivate static final Predicate<UpdateAuthRQ> FIRST_AND_LAST_NAME_IS_EMPTY = request ->\n\t\t\tLA... | import com.epam.reportportal.auth.integration.validator.request.SamlUpdateAuthRequestValidator;
import com.epam.reportportal.auth.integration.validator.request.UpdateAuthRequestValidator;
import com.epam.reportportal.auth.integration.validator.request.param.provider.LdapRequiredParamNamesProvider;
import com.epam.repor... | package com.epam.reportportal.auth.config;
@Configuration
public class AuthIntegrationValidatorConfig {
@Bean
public ParamNamesProvider ldapParamNamesProvider() { | return new LdapRequiredParamNamesProvider(); | 2 |
Simperium/simperium-android | Simperium/src/androidTestSupport/java/com/simperium/SimperiumTest.java | [
"public class Bucket<T extends Syncable> {\n \n public interface Channel {\n Change queueLocalChange(String simperiumKey);\n Change queueLocalDeletion(Syncable object);\n void log(int level, CharSequence message);\n void start();\n void stop();\n void reset();\n ... | import com.simperium.client.Bucket;
import com.simperium.client.BucketObject;
import com.simperium.client.BucketSchema.Index;
import com.simperium.client.User;
import com.simperium.test.MockAuthResponseListener;
import com.simperium.test.MockBucketStore;
import com.simperium.test.MockClient;
import java.util.ArrayList;... | package com.simperium;
public class SimperiumTest extends BaseSimperiumTest {
protected Simperium mSimperium;
protected MockClient mClient;
protected User.Status mLastStatus;
protected List<User.Status> mAuthStatuses = new ArrayList<User.Status>();
protected User.StatusChangeListener mAuthList... | Bucket<BucketObject> bucket = mSimperium.bucket("stuff"); | 0 |
Condroidapp/android | Condroid/src/main/java/cz/quinix/condroid/ui/fragments/TimetableFragment.java | [
"public class SearchProvider {\r\n\r\n\tprivate static Map<String, SearchQueryBuilder> map;\r\n\r\n\tstatic {\r\n\t\tmap = new HashMap<String, SearchQueryBuilder>();\r\n\t}\r\n\r\n\tpublic static SearchQueryBuilder getSearchQueryBuilder(String tag) {\r\n\t\tif (!map.containsKey(tag)) {\r\n\t\t\tmap.put(tag, new Sea... | import java.util.List;
import cz.quinix.condroid.database.SearchProvider;
import cz.quinix.condroid.database.SearchQueryBuilder;
import cz.quinix.condroid.model.Annotation;
import cz.quinix.condroid.ui.adapters.EndlessAdapter;
import cz.quinix.condroid.ui.adapters.GroupedAdapter;
import cz.quinix.condroid.ui.adap... | package cz.quinix.condroid.ui.fragments;
public class TimetableFragment extends NewCondroidFragment {
private GroupedAdapter wrapped;
public static NewCondroidFragment newInstance() {
return new TimetableFragment();
}
@Override
| protected EndlessAdapter createListViewAdapter() {
| 3 |
scriptkitty/SNC | unikl/disco/calculator/gui/NetworkVisualizationPanel.java | [
"public class SNC {\r\n\r\n private final UndoRedoStack undoRedoStack;\r\n private static SNC singletonInstance;\r\n private final List<Network> networks;\r\n private final int currentNetworkPosition;\r\n\r\n private SNC() {\r\n networks = new ArrayList<>();\r\n undoRedoStack = new Undo... | import edu.uci.ics.jung.algorithms.layout.CircleLayout;
import edu.uci.ics.jung.algorithms.layout.FRLayout;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.SparseMultigraph;
import edu.uci.ics.jung.graph.util.Context;
import edu.uci.ics.jung.graph.uti... | /*
* (c) 2017 Michael A. Beck, Sebastian Henningsen
* disco | Distributed Computer Systems Lab
* University of Kaiserslautern, Germany
* All Rights Reserved.
*
* This software is work in progress and is released in the hope that it will
* be useful to the scientific community. It is provided "as is" with... | private class NetworkChangeListener implements NetworkListener { | 3 |
jenkinsci/google-storage-plugin | src/main/java/com/google/jenkins/plugins/storage/AbstractUpload.java | [
"public class BuildGcsUploadReport extends AbstractGcsUploadReport {\n\n private final Set<String> buckets;\n private final Set<String> files;\n\n public BuildGcsUploadReport(Run<?, ?> run) {\n super(run);\n this.buckets = Sets.newHashSet();\n this.files = Sets.newHashSet();\n }\n\n /**\n * @param p... | import static com.google.common.base.Preconditions.checkNotNull;
import com.google.api.client.googleapis.media.MediaHttpUploader;
import com.google.api.client.http.InputStreamContent;
import com.google.api.services.storage.Storage;
import com.google.api.services.storage.model.Bucket;
import com.google.api.services.stor... | /*
* Copyright 2013 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 ... | BuildGcsUploadReport links = BuildGcsUploadReport.of(run); | 0 |
immopoly/android | src/org/immopoly/android/app/UserLoginActivity.java | [
"public class C2DMessaging {\n\tpublic static final String EXTRA_SENDER = \"sender\";\n\tpublic static final String EXTRA_APPLICATION_PENDING_INTENT = \"app\";\n\tpublic static final String REQUEST_UNREGISTRATION_INTENT = \"com.google.android.c2dm.intent.UNREGISTER\";\n\tpublic static final String REQUEST_REGISTRAT... | import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import org.immopoly.android.R;
import org.immopoly.android.c2dm.C2DMessaging;
import org.immopoly.android.constants.Const;
import org.immopoly.android.helper.Settings;
import org.immopoly.android.helper.TrackingManager;
import org.i... | package org.immopoly.android.app;
public class UserLoginActivity extends Activity {
public static final int RESULT_REGISTER = 4321;
private GoogleAnalyticsTracker tracker;
private Handler toggleProgressHandler;
public static final int MIN_PASSWORTH_LENGTH = 4;
private static final int MIN_USERNAME_LENGTH = 1... | C2DMessaging.register(UserLoginActivity.this,Const.IMMOPOLY_EMAIL); | 0 |
lyubenblagoev/postfix-rest-server | src/main/java/com/lyubenblagoev/postfixrest/service/DomainServiceImpl.java | [
"public final class FileUtils {\n\t\n\tprivate static final Logger log = LoggerFactory.getLogger(FileUtils.class);\n\t\n\tprivate FileUtils() {\n\t\t// Prevent class instantiation\n\t}\n\n\tpublic static void renameFolder(File parentFolder, String oldName, String newName) {\n\t\tString parentPath = parentFolder.get... | import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lyubenblagoev.postfixrest.FileUtils;
import com.lyubenblagoev.postfixrest.c... | package com.lyubenblagoev.postfixrest.service;
@Service
@Transactional(readOnly = true)
public class DomainServiceImpl implements DomainService {
private final DomainRepository domainRepository;
private final MailServerConfiguration mailServerConfiguration;
public DomainServiceImpl(DomainRepository domainRep... | FileUtils.renameFolder(new File(mailServerConfiguration.getVhostsPath()), entity.getName(), domain.getName()); | 0 |
PaNaVTEC/Clean-Contacts | app/src/main/java/me/panavtec/cleancontacts/modules/main/MainActivity.java | [
"public class PresentationContact {\n\n public String gender;\n public String title;\n public String firstName;\n public String lastName;\n public PresentationLocation location;\n public String email;\n public String username;\n public String password;\n public String md5;\n public PresentationPicture pic... | import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.Bind;
import com.carlosdelachica.easyrecyc... | package me.panavtec.cleancontacts.modules.main;
public class MainActivity extends BaseActivity
implements MainView, SwipeRefreshLayout.OnRefreshListener, EasyViewHolder.OnItemClickListener {
@Inject MainPresenter presenter;
@Inject ErrorManager errorManager;
@Inject ImageLoader imageLoader;
@Inject Eleva... | new EasyRecyclerAdapter(contactViewHolderFactory, PresentationContact.class, | 0 |
jimmc/HapiPodcastJ | src/info/xuluan/podcast/tests/FeedHandlerTest.java | [
"public class FeedHandler {\r\n\tprivate static final int REPEAT_UPDATE_FEED_COUNT = 3;\r\n\tprivate final Log log = Log.getLog(getClass());\r\n\t\r\n\tprivate ContentResolver cr;\r\n\tprivate int max_valid_size;\r\n\t\r\n\tpublic FeedHandler(ContentResolver context, int max_valid_sz){\r\n\t\tcr = context;\r\n\t\t... | import android.test.mock.MockContentResolver;
import info.xuluan.podcastj.R;
import info.xuluan.podcast.parser.FeedHandler;
import info.xuluan.podcast.parser.FeedParserHandler;
import info.xuluan.podcast.parser.FeedParserListener;
import info.xuluan.podcast.provider.FeedItem;
import info.xuluan.podcast.provider.Podcast... | /*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | FeedParserHandler handler = new FeedParserHandler(null,0); | 1 |
TechzoneMC/NPCLib | nms-v1_8_R3/src/main/java/net/techcable/npclib/nms/versions/v1_8_R3/ai/NPCPath.java | [
"public interface LivingNPC extends NPC {\r\n\r\n /**\r\n * Set the current name of the npc\r\n *\r\n * @param name the new name\r\n */\r\n public void setName(String name);\r\n\r\n /**\r\n * Retrieve the name of this npc\r\n *\r\n * @return this npc's name\r\n */\r\n pub... | import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.ChunkCache;
import net.minecraft.server.v1_8_R3.EntityHuman;
import net.minecraft.server.v1_8_R3.EntityLiving;
import net.minecraft.server.v1_8_R3.MathHelper;
import net.minecraft.server.v1_8_R3.PathEntity;
import net.minecraft.serve... | package net.techcable.npclib.nms.versions.v1_8_R3.ai;
/**
* A npc pathing class
* <p/>
* Taken from "https://github.com/lenis0012/NPCFactory/blob/master/src/main/java/com/lenis0012/bukkit/npc/NPCPath.java"
* It is MIT Licensed by lenis0012
*/
public class NPCPath implements AITask {
private final LivingNPC... | final LivingNPCHook hook = NMS.getHook(npc); | 3 |
ddarriba/jmodeltest2 | src/main/java/es/uvigo/darwin/jmodeltest/exe/RunConsense.java | [
"public class ModelTest {\n\n\tprivate ApplicationOptions options = ApplicationOptions.getInstance();\n\n\t/** The MPJ rank of the process. It is only useful if MPJ is running. */\n\tpublic static int MPJ_ME;\n\t/** The MPJ size of the communicator. It is only useful if MPJ is running. */\n\tpublic static int MPJ_S... | import java.io.PrintWriter;
import java.io.PushbackReader;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.Vector;
import pal.misc.Identifier;
import pal.tree.ReadTree;
import pal.tree.Tree;
impo... | /*
Copyright (C) 2011 Diego Darriba, David Posada
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 distributed... | private Model[] model; | 3 |
linheimx/LChart | library/src/main/java/com/linheimx/app/library/render/XAxisRender.java | [
"public interface IValueAdapter {\n String value2String(double value);\n}",
"public class MappingManager {\n\n /**\n * 区域视图\n */\n RectF _contentRect;\n\n /**\n * 数据视图\n */\n RectD _maxViewPort;\n RectD _currentViewPort;\n\n\n /**\n * 数据视图的约束\n */\n float fatFactor ... | import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import com.linheimx.app.library.adapter.IValueAdapter;
import com.linheimx.app.library.manager.MappingManager;
import com.linheimx.app.library.model.Axis;
import com.linheimx.app.library.model.WarnLine;
import com.linheimx.app... | package com.linheimx.app.library.render;
/**
* Created by lijian on 2016/11/14.
*/
public class XAxisRender extends AxisRender {
public XAxisRender(RectF _FrameManager, MappingManager _MappingManager, Axis axis) {
super(_FrameManager, _MappingManager, axis);
}
@Override
public void rend... | List<WarnLine> warnLines = _Axis.getListWarnLins(); | 3 |
simon816/ChatUI | src/main/java/com/simon816/chatui/group/GroupListRenderer.java | [
"@Plugin(id = \"chatui\", name = \"Chat UI\", dependencies = @Dependency(id = \"chatuilib\"))\r\npublic class ChatUI {\r\n\r\n public static final String ADMIN_PERMISSON = \"chatui.admin\";\r\n\r\n private static ChatUI instance;\r\n\r\n private FeatureManager features;\r\n\r\n @Inject\r\n @DefaultCo... | import com.simon816.chatui.ChatUI;
import com.simon816.chatui.lib.PlayerChatView;
import com.simon816.chatui.lib.PlayerContext;
import com.simon816.chatui.ui.table.DefaultColumnRenderer;
import com.simon816.chatui.ui.table.DefaultTableRenderer;
import com.simon816.chatui.ui.table.TableColumnRenderer;
import com.s... | package com.simon816.chatui.group;
class GroupListRenderer extends DefaultTableRenderer {
private final ChatGroupFeature feature;
private final PlayerChatView view;
GroupListRenderer(PlayerChatView view, ChatGroupFeature feature) {
this.view = view;
this.feature = feature;
... | public List<Text> renderCell(Object value, int row, int tableWidth, PlayerContext ctx) {
| 2 |
dvanherbergen/robotframework-formslibrary | src/main/java/org/robotframework/formslibrary/operator/TreeOperator.java | [
"public class FormsLibraryException extends RuntimeException {\n\n private static final long serialVersionUID = 1L;\n\n public static final boolean ROBOT_SUPPRESS_NAME = true;\n\n public FormsLibraryException(String message) {\n super(message);\n }\n\n public FormsLibraryException(Throwable t)... | import org.robotframework.formslibrary.FormsLibraryException;
import org.robotframework.formslibrary.chooser.ByComponentTypeChooser;
import org.robotframework.formslibrary.util.ComponentType;
import org.robotframework.formslibrary.util.Constants;
import org.robotframework.formslibrary.util.Logger;
import org.robot... | package org.robotframework.formslibrary.operator;
/**
* Operator for handling DTree navigation
*/
public class TreeOperator extends AbstractComponentOperator {
/**
* Initialize a TreeOperator with the navigation tree found in the current
* context.
*/
public TreeOperator() {
| super(new ByComponentTypeChooser(0, ComponentType.TREE));
| 1 |
PEMapModder/PocketMine-GUI | src/main/java/com/github/pemapmodder/pocketminegui/gui/startup/config/ServerOptionsActivity.java | [
"@AllArgsConstructor\npublic class CheckBoxOptionAdaptor implements OptionAdaptor<Boolean>{\n\t@Getter private JCheckBox checkBox;\n\n\t@Override\n\tpublic Boolean getOption(){\n\t\treturn checkBox.isSelected();\n\t}\n}",
"@AllArgsConstructor\npublic class NumberFieldAdaptor implements OptionAdaptor<Number>{\n\tp... | import com.github.pemapmodder.pocketminegui.gui.startup.config.adaptor.CheckBoxOptionAdaptor;
import com.github.pemapmodder.pocketminegui.gui.startup.config.adaptor.NumberFieldAdaptor;
import com.github.pemapmodder.pocketminegui.gui.startup.config.adaptor.OptionAdaptor;
import com.github.pemapmodder.pocketminegui.lib.A... | package com.github.pemapmodder.pocketminegui.gui.startup.config;
/*
* This file is part of PocketMine-GUI.
*
* PocketMine-GUI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of th... | adaptor = new NumberFieldAdaptor(field); | 1 |
AstartesGuardian/WebDAV-Server | WebDAV-Server/src/webdav/server/commands/WD_Head.java | [
"public abstract class HTTPCommand\r\n{\r\n public HTTPCommand(String command)\r\n {\r\n this.name = command.trim().toUpperCase();\r\n openedResources = new HashMap<>();\r\n }\r\n \r\n private final String name;\r\n \r\n /**\r\n * Get the name of the command.\r\n * \r\n ... | import http.server.HTTPCommand;
import http.server.message.HTTPResponse;
import webdav.server.resource.IResource;
import http.server.exceptions.NotFoundException;
import http.server.exceptions.UserRequiredException;
import http.server.message.HTTPEnvRequest;
| package webdav.server.commands;
public class WD_Head extends HTTPCommand
{
public WD_Head()
{
super("head");
}
@Override
| public HTTPResponse.Builder Compute(HTTPEnvRequest environment) throws UserRequiredException, NotFoundException
| 1 |
kaliturin/BlackList | app/src/main/java/com/kaliturin/blacklist/fragments/GetContactsFragment.java | [
"public class CustomFragmentActivity extends AppCompatActivity {\n private static final String TAG = CustomFragmentActivity.class.getName();\n private static final String ACTIVITY_TITLE = \"ACTIVITY_TITLE\";\n private static final String FRAGMENT_ARGUMENTS = \"FRAGMENT_ARGUMENTS\";\n private static fina... | import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.util.LongSparseArray;
import com.kaliturin.blacklist.R;
import com.kaliturin.blacklis... | /*
* Copyright (C) 2017 Anton Kaliturin <kaliturin@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 a... | final String permission = ContactsAccessHelper.getPermission(sourceType); | 1 |
rubenlagus/Tsupport | TMessagesProj/src/main/java/org/telegram/messenger/ApplicationLoader.java | [
"public class AndroidUtilities {\n\n private static final Hashtable<String, Typeface> typefaceCache = new Hashtable<>();\n private static int prevOrientation = -10;\n private static boolean waitingForSms = false;\n private static final Object smsLock = new Object();\n\n public static int statusBarHei... | import android.app.Activity;
import android.app.AlarmManager;
import android.app.Application;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import a... | @Override
public void run() {
synchronized (sync) {
int selectedColor = 0;
try {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
... | applicationContext.startService(new Intent(applicationContext, NotificationsService.class)); | 3 |
eriq-augustine/jocr | src/com/eriqaugustine/ocr/drivers/KLTReducerTest.java | [
"public interface OCRClassifier {\n public String classify(WrapImage image);\n}",
"public class PLOVEClassifier extends CharacterClassifier {\n private static Logger logger = LogManager.getLogger(PLOVEClassifier.class.getName());\n\n public PLOVEClassifier(String trainingCharacters, String[] fonts, FeatureV... | import com.eriqaugustine.ocr.classifier.OCRClassifier;
import com.eriqaugustine.ocr.classifier.PLOVEClassifier;
import com.eriqaugustine.ocr.classifier.reduce.KLTReducer;
import com.eriqaugustine.ocr.classifier.reduce.FeatureVectorReducer;
import com.eriqaugustine.ocr.plove.PLOVE;
import com.eriqaugustine.ocr.utils.Pro... | package com.eriqaugustine.ocr.drivers;
/**
* Quck test for PLOVEClassifier.
*/
public class KLTReducerTest extends ClassifierTest {
public static void main(String[] args) throws Exception {
KLTReducerTest test = new KLTReducerTest();
test.run();
}
private void run() throws Exception {
i... | FeatureVectorReducer reduce = new KLTReducer(PLOVE.getNumberOfFeatures(), numFeatures); | 2 |
struberg/juel | modules/impl/src/test/java/de/odysseus/el/tree/impl/ast/AstFunctionTest.java | [
"public class ELException extends RuntimeException {\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t/**\r\n\t * Creates an ELException with no detail message.\r\n\t */\r\n\tpublic ELException() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an ELException with the provided detail message.\r\n... | import javax.el.ELException;
import de.odysseus.el.TestCase;
import de.odysseus.el.tree.Bindings;
import de.odysseus.el.tree.Tree;
import de.odysseus.el.tree.impl.Builder;
import de.odysseus.el.tree.impl.Builder.Feature;
import de.odysseus.el.util.SimpleContext;
| /*
* Copyright 2006-2009 Odysseus Software GmbH
*
* 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... | try { parseNode("${f()}").setValue(null, null, null); fail(); } catch (ELException e) {}
| 0 |
flyersa/MuninMX | src/com/clavain/munin/MuninPlugin.java | [
"public class Alert {\n private String str_PluginName; \n private String str_GraphName;\n private Integer node_id;\n private Integer alert_id;\n private BigDecimal raise_value = new BigDecimal(\"0\");\n private String condition;\n private Integer num_samples;\n // last alert (unix timestam... | import java.util.List;
import java.util.StringTokenizer;
import static com.clavain.muninmxcd.p;
import static com.clavain.muninmxcd.logger;
import static com.clavain.utils.Generic.getUnixtime;
import static com.clavain.muninmxcd.logMore;
import static com.clavain.utils.Generic.getAlertByNidPluginAndGraph;
import... | /**
* Sets lastFrontendQuery to current unixtime
*/
public void setLastFrontendQuery()
{
l_lastFrontendQuery = System.currentTimeMillis() / 1000L;
}
/*
* will connect to munin if no connections exists and will update
* values for all graphs, then retu... | ArrayList<Alert> av = getAlertByNidPluginAndGraph(this.get_NodeId(),this.getPluginName(),l_mg.getGraphName());
| 5 |
ralscha/spring4ws-demos | src/main/java/ch/rasc/s4ws/portfolio/web/PortfolioController.java | [
"public class Portfolio {\n\n\tprivate final Map<String, PortfolioPosition> positionLookup = new LinkedHashMap<>();\n\n\tpublic List<PortfolioPosition> getPositions() {\n\t\treturn new ArrayList<>(this.positionLookup.values());\n\t}\n\n\tpublic void addPosition(PortfolioPosition position) {\n\t\tthis.positionLookup... | import ch.rasc.s4ws.portfolio.service.Trade;
import ch.rasc.s4ws.portfolio.service.TradeService;
import java.security.Principal;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springfra... | /*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | Portfolio portfolio = this.portfolioService.findPortfolio(principal.getName()); | 0 |
rampage128/hombot-control | wear/src/main/java/de/jlab/android/hombot/WearMainActivity.java | [
"public class HombotStatus {\n\n public static enum Status {\n OFFLINE, CHARGING, STANDBY, WORKING, UNDOCKING, DOCKING, PAUSE, HOMING\n }\n\n public static enum Mode {\n ZIGZAG, CELLBYCELL, SPIRAL, MYSPACE, MYSPACE_RECORD\n }\n\n private Status status = Status.OFFLINE;\n private int ... | import android.animation.Animator;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceManager;
import android.support.wearable.activity.WearableActivity;
import a... | mViewHolder.arrowRight = (ImageView)findViewById(R.id.arrow_right);
mViewHolder.arrowBottom = (ImageView)findViewById(R.id.arrow_bottom);
mViewHolder.arrowLeft = (ImageView)findViewById(R.id.arrow_left);
mViewHolder.loader = (ProgressBar)findViewById(R.id.loader);
mViewHolder.lo... | public void sendCommand(RequestEngine.Command command) { | 1 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner11.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.util.Comparator;
import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel;
import se.oru.coordination.coordination_oru.CriticalSection;
import se.oru.coordination.coordination_oru.Mission;
import se.oru.coordination.coordination_oru.RobotAtCriticalSection;
import se.... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "Three robots coordinating at high speed (paths obtained with the ReedsSheppCarPlanner).")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner11 {
public static void main(String[] args) throws InterruptedException {
double M... | tec.addComparator(new Comparator<RobotAtCriticalSection> () { | 3 |
jentrata/jentrata | ebms-as4/src/test/java/org/jentrata/ebms/as4/internal/routes/WSSERouteBuilderTest.java | [
"public class EbmsConstants {\n\n public static final String JENTRATA_VERSION = \"JentrataVersion\";\n\n //Jentrata Message Header keys\n public static final String SOAP_VERSION = \"JentrataSOAPVersion\";\n public static final String EBMS_VERSION = \"JentrataEBMSVersion\";\n public static final Strin... | import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.commons.io.IOUtils;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.CryptoFactory;
imp... | package org.jentrata.ebms.as4.internal.routes;
/**
* Unit test for org.jentrata.ebms.as4.internal.routes.WSSERouteBuilder
*
* @author aaronwalker
*/
public class WSSERouteBuilderTest extends CamelTestSupport {
private static final Logger LOG = LoggerFactory.getLogger(WSSERouteBuilderTest.class);
priva... | request.getIn().setHeader(EbmsConstants.MESSAGE_ID, "testMSG-0001"); | 0 |
leonardoanalista/java2word | java2word/src/test/java/word/w2004/TableTest.java | [
"public class TestUtils {\n\n\tpublic static int regexCount(String text, String regex){\n\t\tif(text == null || regex == null){\n\t\t\tthrow new IllegalArgumentException(\"Can't be null.\");\n\t\t}\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\t\t\n\t\tint total = 0;... | import junit.framework.Assert;
import org.junit.Test;
import word.utils.TestUtils;
import word.w2004.elements.Paragraph;
import word.w2004.elements.ParagraphPiece;
import word.w2004.elements.Table;
import word.w2004.elements.tableElements.TableCol;
import word.w2004.elements.tableElements.TableDefinition;
import word.w... | package word.w2004;
public class TableTest extends Assert {
@Test
// New table has to return ""
public void testCreateEmptyTable() {
Table tbl01 = new Table();
assertEquals("", tbl01.getContent());
}
// ### TH - Table Header ###
@Test
public void testTableWithArray() {
... | assertEquals(1, TestUtils.regexCount(tbl.getContent(), "<w:r wsp:rsidRPr=\"004374EC\"> ")); | 0 |
OHDSI/WhiteRabbit | whiterabbit/src/main/java/org/ohdsi/whiteRabbit/scan/SourceDataScan.java | [
"public class DbType {\r\n\tpublic static DbType\tMYSQL\t\t= new DbType(\"mysql\");\r\n\tpublic static DbType\tMSSQL\t\t= new DbType(\"mssql\");\r\n\tpublic static DbType\tPDW\t\t\t= new DbType(\"pdw\");\r\n\tpublic static DbType\tORACLE\t\t= new DbType(\"oracle\");\r\n\tpublic static DbType\tPOSTGRESQL\t= new DbTy... | import java.io.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.*;
import java.util.stream.Collectors;
import com.epam.parso.Column;
import com.epam.parso.SasFileProperties;
import com.epam.parso.SasFileReader;
import com.... | /*******************************************************************************
* Copyright 2019 Observational Health Data Sciences and Informatics
*
* This file is part of WhiteRabbit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with ... | private DbType dbType;
| 0 |
AbrarSyed/SecretRoomsMod-forge | src/main/java/com/wynprice/secretroomsmod/base/interfaces/ISecretBlock.java | [
"@Config(modid = SecretRooms5.MODID, category = \"\")\n@EventBusSubscriber(modid=SecretRooms5.MODID)\npublic final class SecretConfig {\n\n public static final General GENERAL = new General();\n public static final EnergizedPaste ENERGIZED_PASTE = new EnergizedPaste();\n public static final SRMBlockFunctio... | import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.wynprice.secretroomsmod.SecretConfig;
import com.wynprice.secretroomsmod.handler.ParticleHandler;
import com.wynprice.secretroomsmod.render.FakeBlockAccess;
import com.wynprice.secretroomsmod.render.RenderStateUnlistedProperty;
impor... | package com.wynprice.secretroomsmod.base.interfaces;
/**
* The interface used by all SRM blocks. Most methods here are called directly from the block, as to store all the same code in the same place.
* Extends {@link ITileEntityProvider} as all SRM blocks have TileEntities.
* <br>Not needed but means,
* <br>{... | return new TileEntityInfomationHolder(); | 7 |
asebak/ui5-intellij-plugin | src/com/atsebak/ui5/projectbuilder/UI5ProjectTemplateGenerator.java | [
"public enum AppType {\n DESKTOP,\n MOBILE\n}",
"public enum FileType {\n JS,\n XML,\n HTML,\n JSON,\n PROPERTIES\n}",
"public class Controller extends UI5View {\n /**\n * generates code for the controller\n *\n * @param modulePath\n * @param controllerName\n * @retur... | import com.atsebak.ui5.AppType;
import com.atsebak.ui5.FileType;
import com.atsebak.ui5.autogeneration.Controller;
import com.atsebak.ui5.autogeneration.Index;
import com.atsebak.ui5.autogeneration.UI5View;
import com.atsebak.ui5.locale.UI5Bundle;
import com.atsebak.ui5.util.*;
import com.atsebak.ui5.util.Writer;
impor... | package com.atsebak.ui5.projectbuilder;
/**
* This is for the sub template of the project.
* Once the finished but is click generateProject method is called and runs a separate process
*/
public class UI5ProjectTemplateGenerator extends WebProjectTemplate<UI5ProjectTemplateGenerator.UI5ProjectSettings> {
priv... | return UI5Bundle.getString("app"); | 5 |
mikifus/padland | app/src/main/java/com/mikifus/padland/PadLandDataActivity.java | [
"public class EditPadDialog extends FormDialog {\n public static final String TAG = \"EditPadDialog\";\n private EditText fieldName;\n private EditText fieldLocalName;\n private Spinner fieldGroup;\n private SpinnerGroupAdapter<PadGroup> spinnerAdapter;\n private long edit_pad_id = 0;\n\n publi... | import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
impo... | HashMap<Long, Long> hashMap = new HashMap<>();
cursor.moveToFirst();
while (!cursor.isAfterLast())
{
hashMap.put(cursor.getLong(0), cursor.getLong(1));
cursor.moveToNext();
}
cursor.close();
Log.d(TAG, ha... | ServerModel serverModel = new ServerModel(this); | 6 |
theangrydev/fluent-bdd | all/src/test/java/acceptance/PullsInAllModulesTest.java | [
"public interface Documentation {}",
"@SuppressWarnings(\"PMD\")\npublic interface WithFluentAssertJ<TestResult> extends WithFluentBdd<TestResult> {\n\tDelegateWithAssertions DELEGATE = new DelegateWithAssertions();\n\n\t/**\n\t * Delegate call to {@link org.assertj.core.api.Assertions#offset(Float)}\n\t */\n\tde... | import io.github.theangrydev.fluentbdd.Documentation;
import io.github.theangrydev.fluentbdd.assertj.WithFluentAssertJ;
import io.github.theangrydev.fluentbdd.core.FluentBdd;
import io.github.theangrydev.fluentbdd.hamcrest.WithFluentHamcrest;
import io.github.theangrydev.fluentbdd.mockito.FluentMockito;
import io.githu... | /*
* Copyright 2016 Liam Williams <liam.williams@zoho.com>.
*
* This file is part of fluent-bdd.
*
* 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/L... | assertNotNull(WithFluentAssertJ.class); | 1 |
Omegapoint/facepalm | src/main/java/se/omegapoint/facepalm/infrastructure/JPACommentRepository.java | [
"public class ImageComment {\n\n public final Long imageId;\n public final String author;\n public final String text;\n\n public ImageComment(final Long imageId, final String author, final String text) {\n this.imageId = imageId;\n this.author = author;\n this.text = text;\n }\n\... | import static java.util.stream.Collectors.toList;
import static org.apache.commons.lang3.Validate.notNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import se.omegapoint.facepalm.domai... | /*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | private final EventService eventService; | 1 |
mmonkey/Destinations | src/main/java/com/github/mmonkey/destinations/listeners/PlayerListeners.java | [
"public class DestinationsConfig extends Config {\n\n public static final String DATABASE_SETTINGS = \"Database Settings\";\n public static final String COMMAND_SETTINGS = \"Command Settings\";\n\n private static DestinationsConfig instance;\n\n /**\n * DestinationsConfig constructor\n *\n *... | import com.flowpowered.math.vector.Vector3d;
import com.github.mmonkey.destinations.configs.DestinationsConfig;
import com.github.mmonkey.destinations.entities.BedEntity;
import com.github.mmonkey.destinations.entities.LocationEntity;
import com.github.mmonkey.destinations.entities.PlayerEntity;
import com.github.mmonk... | package com.github.mmonkey.destinations.listeners;
public class PlayerListeners {
@Listener
@IsCancelled(Tristate.FALSE)
public void onClientConnectionEventLogin(ClientConnectionEvent.Login event) {
Optional<Player> optionalPlayer = event.getTargetUser().getPlayer();
if (optionalPlayer.i... | for (SpawnEntity spawnEntity : SpawnCache.instance.get()) { | 4 |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/dialogs/AddLocationDialog.java | [
"public class MainActivity extends BaseActivity {\n\n private final String DEBUG_TAG = \"main_activity_debug\";\n private AppDatabase database;\n private ItemTouchHelper.Callback callback;\n private ItemTouchHelper touchHelper;\n RecyclerOverviewListAdapter adapter;\n List<CityToWatch> cities;\n\n... | import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view... | package org.secuso.privacyfriendlyweather.dialogs;
/**
* Created by yonjuni on 04.01.17.
*/
public class AddLocationDialog extends DialogFragment {
Activity activity;
View rootView;
AppDatabase database;
private AutoCompleteTextView autoCompleteTextView;
private AutoCompleteCityTextViewGe... | CityToWatch newCity = convertCityToWatched(); | 3 |
wesabe/grendel | src/test/java/com/wesabe/grendel/resources/tests/LinksResourceTest.java | [
"public class Credentials {\n\t/**\n\t * An authentication challenge {@link Response}. Use this when a client's\n\t * provided credentials are invalid.\n\t */\n\tpublic static final Response CHALLENGE =\n\t\tResponse.status(Status.UNAUTHORIZED)\n\t\t\t.header(HttpHeaders.WWW_AUTHENTICATE, \"Basic realm=\\\"Grendel\... | import static org.fest.assertions.Assertions.*;
import static org.mockito.Mockito.*;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.Status;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runn... | package com.wesabe.grendel.resources.tests;
@RunWith(Enclosed.class)
public class LinksResourceTest {
public static class Listing_Links {
protected Document document;
protected Credentials credentials;
protected User user;
protected Session session;
protected UserDAO userDAO;
protected DocumentDAO doc... | final LinkListRepresentation docs = resource.listLinks(uriInfo, credentials, "bob", "document1.txt"); | 6 |
matburt/mobileorg-android | MobileOrg/src/main/java/com/matburt/mobileorg/gui/outline/OutlineAdapter.java | [
"public class AgendaFragment extends Fragment {\n\n class AgendaItem {\n public OrgNodeTimeDate.TYPE type;\n public OrgNode node;\n public String text;\n long time;\n public AgendaItem(OrgNode node, OrgNodeTimeDate.TYPE type, long time){\n this.node = node;\n ... | import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import android.support.v7.a... | package com.matburt.mobileorg.gui.outline;
public class OutlineAdapter extends RecyclerView.Adapter<OutlineAdapter.OutlineItem> {
private final AppCompatActivity activity;
// Number of added items. Here it is two: Agenda and Todos.
final private int numExtraItems = 2;
public List<OrgFile> items = ne... | for (OrgFile file : OrgProviderUtils.getFiles(resolver)){ | 5 |
ajonkisz/TraVis | src/travis/model/attach/Playback.java | [
"public abstract class StructComponent implements Comparable<StructComponent>,\n Serializable {\n\n private static final long serialVersionUID = -7522901348550035402L;\n\n // This is used for lazy loading. Once calculated data is stored to avoid\n // future calculations.\n protected enum State {\... | import java.util.concurrent.Executors;
import java.util.regex.Pattern;
import travis.model.project.structure.StructComponent;
import travis.model.project.structure.StructMethod;
import travis.model.script.FileParser;
import travis.model.script.ScriptHandler;
import travis.model.script.TraceInfo;
import travis.util.Mess... | Messages.get("playback.position.exception"));
this.playbackStart = playbackStart;
needScannerRestart = true;
if (!isRunning())
restartScanner();
}
public void setPlaybackEnd(double playbackEnd) {
if (playbackEnd < 0 || playbackEnd > 1)
... | StructComponent pckg = currentMethod.getParent().getParent(); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.