id stringlengths 7 14 | text stringlengths 1 37.2k |
|---|---|
84880723_86 | @NotNull
public static List<File> multiple(
GeneratorEnvironment environment,
@NotNull File templates[],
File outputFolder,
@NotNull File sourceFolder,
String version) throws IOException, NoSuchAlgorithmException {
List<File> result = new ArrayList<>();
CDepManifestYml manifests[] = new CDepMani... |
84916374_52 | @Override
public List<String> queryTopicCurrentData() {
Date date = new Date();
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Map<String, List<String>> topicCache = dashboardCollectService.getTopicCache(format.format(date));
List<String> result = Lists.newArrayList();
for (Map.Entry<String... |
84974822_23 | @Override
public String toString()
{
return this.transformationChain.transformToString();
} |
85088788_0 | public int add(int a, int b) {
return a + b;
} |
85113353_16 | public static Artifact fromPath(Path path) {
String extension = com.google.common.io.Files.getFileExtension(path.toString());
if (Files.exists(path.resolve("WEB-INF"))) {
if (Files.exists(path.resolve("WEB-INF/appengine-web.xml"))) {
return new Artifact(ArtifactType.COMPAT_EXPLODED_WAR, path);
}
... |
85168745_1 | @Override
public void transform()
throws Exception {
logger.info("In DatasetTreeBuildETL java launch transform jython scripts");
} |
85172071_211 | @SuppressWarnings("unchecked")
public static <Term extends AMonomial<Term>,
Poly extends AMultivariatePolynomial<Term, Poly>>
PolynomialFactorDecomposition<Poly> FactorInGF(final Poly polynomial) {
if (canConvertToZp64(polynomial))
return FactorInGF(asOverZp64(polynomial)).mapTo(Conversions64bit::co... |
85184501_8 | public boolean isHash() {
return true;
} |
85229098_2 | public BigDecimal findTotalPagoMesAtual() {
return findTotalAPagarMesAtual(true);
} |
85239682_95 | public static <T> Observable<T> singleOrEmpty(Observable<? extends Collection<T>> collectionObservable) {
return collectionObservable.toList().concatMap(lists -> {
if (lists.size() > 1) {
return Observable.error(new IllegalArgumentException("Observable contains more than one collection."));
... |
85242760_0 | @Override
public Span start() {
Span wspan = wrapped.start();
String spanId = UUID.randomUUID().toString();
wspan.setBaggageItem(BAGGAGE_SPANID_KEY, spanId);
// shamelessly copied from io.jaegertracing.internal.JaegerTracer.SpanBuilder#start
// of io.jaegertracing:jaeger-core:0.35.5
if (referen... |
85416181_1 | @Schedule(minute = "*",second = "*/10",hour = "*")
public void calculateMetrics() {
System.out.println(".");
this.successesPerSecond = ((double)(success.longValue() - this.lastSuccess))/10;
this.lastSuccess = success.longValue();
this.overflowsPerSecond = ((double)(overflow.longValue() - this.lastOver... |
85416613_5 | public static VectorCommand createVectorCommand(String svgCommandString) {
SVGCommand cmd = SVGCommand.valueOf(svgCommandString.substring(0, 1));
String[] argsAsString = svgCommandString.substring(1).split(SVG_ARG_DELIMITER);
float[] args = new float[argsAsString.length];
int i = 0;
for (String arg : argsAsSt... |
85497373_2 | public void loadBooks() {
compositeDisposable.add(booksRepository.getBooks()
.subscribeOn(Schedulers.io())
.observeOn(mainScheduler)
.subscribeWith(new DisposableSingleObserver<List<Book>>() {
@Override
public void onSuccess(List<Book> bookList) {... |
85541447_3 | @Activate
public void start(ActivatorConfiguration config) {
String[] authorizableIds = config.pwdreset_authorizables();
Session session = null;
try {
ResourceResolver resolver = resolverFactory.getAdministrativeResourceResolver(null);
UserManager userManager = resolver.adaptTo(UserManager... |
85673672_0 | @Override
public void fetchHotMovie() {
invoke(mDoubanService.fetchHotMovie(),new Callback<HotMovieBean>(){});
} |
85686334_7 | static boolean equals(Object a, Object b) {
return (a == null) ? (b == null) : a.equals(b);
} |
85692970_89 | @Override
public final void acceptNextClient() throws ClientConnectionFailedException {
final Logging logging = loggingValue.get();
logging.debug("Accepting next client.");
logging.trace("Checking ConnectorCore value ..");
logging.trace("Requesting next Client handling at ConnectorCore ..");
connectorCoreValue.get... |
85710339_5 | public Group getGroup(int position) {
if (position == 0) {
return parent;
} else {
return children.get(position - 1);
}
} |
85713388_0 | public static <T> T[] parse(final Class<T> rowType, final String[] headerAndRows) {
return parse(rowType, headerAndRows, new SpockitoValueConverter());
} |
85780482_11 | @SuppressLint("CommitPrefEdits")
@NonNull
@Override
public Observable<Job> update(@NonNull Status status) {
return get(status.id())
.filter(job -> !Job.isInvalid(job))
.flatMap(job -> save(job.withStatus(status)))
.defaultIfEmpty(Job.INVALID_JOB);
} |
85794642_75 | public MethodSpec generateFor(final AnnotationMirror unconditionalHandlerAnnotation) {
checkNotNull(unconditionalHandlerAnnotation, "Argument \'unconditionalHandlerAnnotation\' cannot be null.");
final String annotationClassName = unconditionalHandlerAnnotation.getAnnotationType().toString();
if (!methodSpe... |
85795396_72 | @Override public DropwizardMetricsSystem create(MetricsSystemConfiguration<?> config) {
// Verify we got configuration this factory can use
if (config instanceof DropwizardMetricsSystemConfiguration) {
DropwizardMetricsSystemConfiguration typedConfig =
(DropwizardMetricsSystemConfiguration) config;
... |
85830116_8 | @Override
public void accept(NewtonEvent event) {
apply(event);
} |
85838297_0 | public static String sign(String urlString, String algorithm, String secretKey) {
if (algorithm != null && !algorithm.equals(HMAC_SHA256_ALGORITHM)) {
throw new RuntimeException("Unsupported signature: " + algorithm);
}
if (secretKey == null) {
throw new RuntimeException("Signature key not f... |
85860202_0 | @Override
public void infoLoaded(List<MovieInfo> movieInfoList) {
/*
Note - translate internal business logic to presenter logic
*/
List<MovieViewInfo> movieViewInfoList = new ArrayList<>();
for (MovieInfo movieInfo : movieInfoList) {
movieViewInfoList.add(new MovieViewInfoImpl(movieInfo));... |
85866226_16 | public ImageTypersProvider(CaptchaQueue queue, String apiKey) throws ImageTypersConfigurationException {
this.queue = queue;
this.apiKey = apiKey;
this.captchaClient = new OkHttpClient();
if (this.apiKey == null || this.apiKey.isEmpty()) {
throw new ImageTypersConfigurationException("Missing ImageTypers Access T... |
85880302_5 | @Override
public MetricsListener metricsListener() {
return guiceValues.metricsListener;
} |
85987914_7 | public boolean withdraw(int requested) {
int expectedCount = Math.min(requested / nominal, count);
int expectedCash = expectedCount * nominal;
boolean nextCellResult = true;
if (requested != expectedCash) {
nextCellResult = next != null && next.withdraw(requested - expectedCash);
}
if(ne... |
86001819_20 | } |
86105877_10 | @Override
public int hashCode() {
return Objects.hash(getStatement().hashCode(), getNumberOfRowsAffected());
} |
86106666_1 | @Override
public void put(String key, String value) {
Collection<String> values = headers.get(key);
if (values == null) {
values = new ArrayList<>(1);
headers.put(key, values);
}
try {
values.add(value);
} catch (UnsupportedOperationException ex) {
if (values instanc... |
86107810_13 | @Override
public InputStreamResource getFileById(String fileId) {
Metadata metadata = getMetadataById(fileId);
if (isAnUnprocessedCpcFile(metadata)) {
return new InputStreamResource(storageService.getFileByLocationId(metadata.getSubmissionLocator()));
}
throw new NoFileInDatabaseException(FILE_NOT_FOUND);
} |
86108100_8 | public static boolean epsilonEqualsByteSequence(IDLSequence.Byte a, IDLSequence.Byte b, double epsilon)
{
return epsilonEqualsPrimitiveSequence(a::get, b::get, a, b, epsilon);
} |
86205415_42 | public boolean add(String id, Callable<?> func, Duration delay) {
if (Objects.isNull(delay)) {
log.warn("delay is null: id={}", id);
return false;
}
if (Objects.isNull(func)) {
log.warn("func is null: id={}", id);
return false;
}
if (cacheTasks.containsKey(id)) {
log.warn("task has alread... |
86221285_5 | public List<User> getByPage(int page, int rows) {
Page<User> userPage = PageHelper.startPage(page, rows, true);
List<User> users = userMapper.getBypage();
System.out.println("-------------------" + userPage.toString() + "-----------");
return users;
} |
86230857_2 | @DeleteMapping("/{id}")
public ResponseEntity deleteSpeaker(@PathVariable long id) {
speakerRepository.delete(id);
return ResponseEntity.noContent().build();
} |
86269383_2 | public int getEndIndex() {
return mEndIndex;
} |
86278665_1 | public static KubeOpt inst(String instanceId) {
return multiInst("KUBE", instanceId);
} |
86291168_20 | protected final <R> void submitSqlStatementTask(
CheckedSqlFunction<? super Statement, ? extends R> function,
BiConsumer<? super R, ? super Throwable> callback
) {
submit(new SqlStatementTask<>(function, wrapCallback(callback)));
} |
86312760_0 | public String leaderId() {
return currentLeader.get();
} |
86321843_1 | public void addInputValidator(InputValidator inputValidator) {
mInputValidatorList.add(inputValidator);
} |
86325095_0 | public AppInfo getAbout() {
return unwrap(delegate.getAbout());
} |
86331365_134 | public static String substr(String str, int start) {
return StringUtils.substring(str, start);
} |
86339121_17 | @Override
public OplogBatch fetch() throws StopReplicationException, RollbackReplicationException {
if (state.isClosed()) {
return FinishedOplogBatch.getInstance();
}
try {
return retrier.retry(() -> {
try {
if (state.isClosed()) {
return FinishedOplogBatch.getInstance();
... |
86369859_5 | public static boolean overlaping(float minA, float maxA, float minB, float maxB) {
if (maxA < minA) {
// swap values
float a = maxA;
maxA = minA;
minA = a;
}
if (maxB < minB) {
// swap values
float b = minB;
maxB = minB;
minB = b;
}
/... |
86398553_5 | public static <T> When<T> when(T t){
return new When<T>();
} |
86400116_6 | public String getHosts() {
return hosts;
} |
86418271_0 | StatusListener getStatusListener() {
return statusListener;
} |
86422172_60 | public static String constructGenericUpsertStatement(String tableName, int numColumns) {
if (numColumns == 0) {
throw new IllegalArgumentException("At least one column must be provided for upserts");
}
List<String> parameterList = Lists.newArrayListWithCapacity(numColumns);
for (int i = 0; i ... |
86422972_0 | public static boolean isValidEmail(CharSequence email) {
return email != null && EMAIL_PATTERN.matcher(email).matches();
} |
86461287_24 | @Override
public long countNameDistinctly(long teamId) {
return jobRepository.countNameDistinctly(teamId);
} |
86535963_0 | @ApiOperation(value = "Create a new customer.")
@PostMapping
@ResponseStatus(HttpStatus.CREATED)
public void createCustomer(@Valid @RequestBody Customer customer) {
log.debug("Creating customer {}", customer);
customerRepository.save(customer);
} |
86607520_10 | @Override
public boolean test(Entry entry) {
String entryName = entry.getName();
// Matches _VBA_PROJECT_CUR, VBA, ... :)
if (!isMacro(entryName)) {
return true;
}
LOGGER.info("Found Macros, removing them.");
StringBuilder infos = new StringBuilder();
if (entry instanceof DirectoryEntry) {
Set<S... |
86651310_0 | @Override
public int compareTo(final Altitude that) {
return Integer.compare(this.val, that.val);
} |
86653231_59 | @Override public Location getLastLocation() {
final List<String> providers = locationManager.getAllProviders();
final long minTime = clock.getCurrentTimeInMillis() - RECENT_UPDATE_THRESHOLD_IN_MILLIS;
Location bestLocation = null;
float bestAccuracy = Float.MAX_VALUE;
long bestTime = Long.MIN_VALUE;
for (... |
86653876_0 | public static InputStream getResourceAsStream(String path) {
if (StrUtil.startWithIgnoreCase(path, CLASSPATH_PRE)) {
path = path.substring(CLASSPATH_PRE.length());
}
return getClassLoader().getResourceAsStream(path);
} |
86663812_36 | public static <T> Patch<T> diff(List<T> original, List<T> revised, DiffAlgorithmListener progress) {
return DiffUtils.diff(original, revised, new MyersDiff<>(), progress);
} |
86707239_25 | @NonNull
public static LexList list(@NonNull List<? extends CharSequence> items) {
return list(items.toArray(new CharSequence[]{}));
} |
86711482_3 | public Tokens read(final File file) throws Throwable {
final Tokens tokens = new Tokens();
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilder builder = factory.newDocumentBuilder();
final Document doc = builder.parse(new BOMInputStream(new FileInputStream(file)));
to... |
86808110_225 | @Override
public boolean checkForMatchingCharacteristic(Element element, String toCheckFor) {
if (element != null && toCheckFor != null) {
String name = null;
switch (element.getKind()) {
case ENUM:
case INTERFACE:
case ANNOTATION_TYPE:
case CLASS: {
... |
86871676_13 | @Override
public List<Booking> getBookingsByUser(String user) {
try {
List<BookingImpl> bookingImpls = bookingRepository.findByCustomerId(user);
List<Booking> bookings = new ArrayList<Booking>();
for (Booking b : bookingImpls) {
bookings.add(b);
}
return bookings;... |
86897360_0 | private boolean isTypeMatch(Type type, Type targetType) {
if (type instanceof Class && targetType instanceof Class) {
if (((Class) type).isAssignableFrom((Class) targetType)) {
return true;
}
} else if (type instanceof ParameterizedType && targetType instanceof ParameterizedType) {
... |
86918234_1 | public static void enableLogging() {
enableLogging(new TraceurConfig(true));
} |
86987836_1 | @Override
public void dismissDialog(final int dialogId) {
final Dialog dialog = mDialogInstances.get(dialogId);
if (dialog != null) {
dialog.dismiss();
mDialogInstances.remove(dialogId);
mDialogConfigs.remove(dialogId);
return;
}
final DialogFragment dialogFragment = mDia... |
87095183_2 | public EmailAggregate getByUUID(String uuid) {
return EmailAggregate.from(uuid, eventSourcingService.getRelatedEvents(uuid));
} |
87212987_55 | @UiThread
public List<Symbol> create(@NonNull String json) {
return create(FeatureCollection.fromJson(json));
} |
87220385_0 | public List<View> generateView() {
Assert.notNull(project, "Project must not be null");
Assert.notNull(projectEvent, "Event must not be null");
Assert.notNull(commit, "Commit must not be null");
Assert.notNull(commit, "Commit must contain files");
// Do not generate view if there are no files
i... |
87225655_0 | public void addInvocation(Invocation invocation) {
numberOfInvocations++;
if (this.methodName != null) {
this.methodName = invocation.getMethodName();
}
this.recentDuration = invocation.getRecentDuration();
this.lastInvocationTimestamp = invocation.getCreationTime();
String currentExcept... |
87269276_3 | public int getPairingDeviceStatus() {
if (this.boundingDevice == null) {
throw new IllegalStateException("No device currently bounding");
}
int bondState = this.boundingDevice.getBondState();
// If the new state is not BOND_BONDING, the pairing is finished, cleans up the state.
if (bondState... |
87289313_111 | @JsonIgnore
public Collection<?> getValues() {
return allowedValues;
} |
87336871_1224 | @Override
public ServiceResult<Boolean> isShowStateAidAgreement(long targetId, long organisationId) {
return getStateAidEligibilityForCompetition(targetId).andOnSuccess(eligibility -> {
if (!eligibility) {
return serviceSuccess(false);
}
return isBusinessOrganisation(organisation... |
87363270_0 | public static void groupByAge(List<Person> people) {
} |
87392130_25 | public void setPostAuthenticationFlows(@Nonnull @NonnullElements final Collection<String> flows) {
Constraint.isNotNull(flows, "Collection of flows cannot be null");
postAuthenticationFlows = new ArrayList<>(StringSupport.normalizeStringCollection(flows));
} |
87402251_6 | public String greetFromRepoJpa() {
Hello databaseSide =
helloRepoJpa.save(new Hello(0, "Greetings from the paging and sorting database side"));
Optional<Hello> byId = helloRepoJpa.findById(databaseSide.getId());
return byId.orElse(new Hello(-99, "not found")).getMessage();
} |
87455763_63 | void onNavigationFinished() {
if (navigationListener != null) {
navigationListener.onNavigationFinished();
}
} |
87548125_15 | @Override
public void scanModel(final SensorContext context, final ActiveRule rule, final Model<Location> model) {
final Integer maximum = Integer.valueOf(rule.param(PARAM_MAXIMUM));
for (final Package<Location> packageToCheck : model.getPackages()) {
final Set<Class<Location>> classes = packageToCheck.getClasses(... |
87556817_49 | public TextMarkupDocument parseString(String text, final TextMarkupDocumentSection otherSection) {
ImmutableList<TextMarkupDocumentSection> textMarkupDocumentSections = this.parseString(text, this.firstLevelElements, true, "////");
if (otherSection != null) {
TextMarkupDocumentSection thisSection = tex... |
87590893_59 | @Deprecated
public static <V> V getDoneUnchecked(Future<V> future) {
/*
* We throw IllegalStateException, since the call could succeed later. Perhaps we "should" throw
* IllegalArgumentException, since the call could succeed with a different argument. Those
* exceptions' docs suggest that either is acceptable. Googl... |
87683712_7 | @ApiOperation(value = "删除指定ID的user记录", notes="删除指定ID的user记录")
@ApiImplicitParam(name = "id", value = "用户ID", paramType = "path", required = true, dataType = "Integer")
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public int delete(@PathVariable int id){
return userService.delete(id);
} |
87826047_10 | public BigInteger decrypt(final BigInteger modulus, final BigInteger ciphertext, final byte[] key, final byte[] tweak) throws FPEException {
if (modulus == null) {
throw new IllegalArgumentException("modulus must not be null.");
}
if (ciphertext == null) {
throw new IllegalArgumentException("ciphertext must not ... |
87839153_1 | public void put(final RouterMeta routerMeta) {
final JsonEventToLogger event = new JsonEventToLogger(this.getClass());
String logCorrelation = routerMeta.correlation;
event.put("correlation", logCorrelation);
try {
String key = MessageFormat.format(FORMAT_KEY_ROUTERS, routerMeta.envId, routerMe... |
87859908_476 | private Counter.Builder counter(ProceedingJoinPoint pjp, Counted counted) {
Counter.Builder builder = Counter.builder(counted.value()).tags(tagsBasedOnJoinPoint.apply(pjp));
String description = counted.description();
if (!description.isEmpty()) {
builder.description(description);
}
return b... |
87869865_3 | public static int skip_spaces_reverse(StringBuilder s, int pos) {
return skip_char_reverse(s, " \t\n\r", pos);
} |
87910456_7 | public boolean getNetworkNodeList(NetworkNodeListCallback callback) {
Log.d("6lowpan","getNetworkNodeList: "+mRequestTimeout);
if(mRequestTimeout !=null)
return false;
mNodeListCallback = callback;
getParentNode().enableNotification(this);
mNetworkResponse = new NetworkResponse();
Netwo... |
87911627_4 | public Concept fill(Concept concept, CsvLine line) throws IllegalArgumentException {
if (!CollectionUtils.isEmpty(concept.getConceptMappings())) {
concept.getConceptMappings().clear();
}
String mappingsStr = line.get(HEADER_MAPPINGS_SAMEAS);
if (!StringUtils.isEmpty(mappingsStr)) {
for (ConceptMap mapping : l... |
87966671_7 | public int getIdentifier() {
return crash.getId();
} |
87969126_3 | public String createScanCodeLocationName(final String sourcePath, final String scanTargetPath, final String projectName, final String projectVersionName, final String prefix, final String suffix) {
final String pathPiece = cleanScanTargetPath(scanTargetPath, sourcePath);
final String codeLocationTypeString = Co... |
88019930_1 | public ProductDto toProductDto(Product product) {
return this.mapper.map(product, ProductDto.class);
} |
88063304_14 | @Option(value = "x", mnemonic = 'x')
; |
88127865_3 | static boolean isGuavaCompatibilityFound() {
return INSTANCE.isGuavaCompatibilityFound;
} |
88132125_30 | public static String getSuperString(long time) {
return getDateFormatSuper.get().format(new Date(time));
} |
88139536_4 | @CheckReturnValue
@NonNull
public static <R> Maybe<R> maybe(@NonNull final Callable<Task<R>> callable) {
return Single.fromCallable(callable).flatMapMaybe(
new Function<Task<R>, MaybeSource<? extends R>>() {
@Override
public MaybeSource<? extends R> apply(Task<R> task) throws Exception {... |
88152958_48 | public void writeStructuredControlFlow(final StackifierStructuredControlFlowWriter writer) {
flow.writeStructuredControlFlow(writer);
} |
88178114_50 | @Override
public Class<?> getObjectType() {
Index index = getIndex();
return index != null ? index.getClass() : Index.class;
} |
88231534_1 | @Override
public String generateName(CommandStartedEvent event) {
return event != null && event.getCommandName() != null ?
event.getCommandName() : NO_OPERATION;
} |
88242107_2 | public List<AccessibleObject> getJpaAnnotatedMembers(Class<?> c, Class<? extends Annotation> annotation) {
final List<AccessibleObject> jpaAnnotated = new ArrayList<AccessibleObject>();
for (Class<?> cl = c; cl != Object.class && cl != null; cl = cl.getSuperclass()) {
parseClass(annotation, jpaAnnotated... |
88284952_110 | @Override
public void onNext(@NonNull T t) {
if (done) {
return;
}
if (t == null) {
s.dispose();
onError(new NullPointerException("onNext called with null. Null values are generally not allowed in 2.x operators and sources."));
return;
}
synchronized (this) {
... |
88286191_4 | public int getWebformatHeight() {
return webformatHeight;
} |
88374068_4 | public static Function<HttpRequest, String> PREFIXED_REQUEST_METHOD_TARGET_NAME(
final String prefix) {
return (request) -> replaceIfNull(prefix, "")
+ replaceIfNull(request.getRequestLine().getMethod(), "unknown")
+ " " + replaceIfNull(standardizeUri(request.getRequestLine().getUri()), "unknown");
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.