patch
stringlengths
17
31.2k
y
int64
1
1
oldf
stringlengths
0
2.21M
idx
int64
1
1
id
int64
4.29k
68.4k
msg
stringlengths
8
843
proj
stringclasses
212 values
lang
stringclasses
9 values
@@ -53,7 +53,7 @@ public class ProtocGapicPluginGeneratorTest { model.getFiles().stream().map(ProtoFile::getProto).collect(Collectors.toList())) // Only the file to generate a client for (don't generate dependencies) .addFileToGenerate("multiple_services.proto") - ....
1
/* Copyright 2019 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 in...
1
30,879
can we also test for `transport=rest`?
googleapis-gapic-generator
java
@@ -182,7 +182,9 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface */ protected function createBackend(Connector $connector) { + $config = $this->config->get($this->mainConfig); $backend = new $this->backendClass($connector); + $backend->setPageSize($config-...
1
<?php /** * Abstract factory for SOLR backends. * * PHP version 7 * * Copyright (C) Villanova University 2013. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * as published by the Free Software Foundation. * * This p...
1
30,188
If record_batch_size is not set in config.ini, this code will trigger a notice about an undefined value. I would suggest either wrapping the setPageSize() call in an `if (!empty(...)) {` check, or else providing a default value in the set call (i.e. `$config->Index->record_batch_size ?? 100`).
vufind-org-vufind
php
@@ -1,6 +1,6 @@ <script type="text/javascript"> window.analytics||(window.analytics=[]),window.analytics.methods=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group","on","once","off"],window.analytics.factory=function(t){return function(){var a=Array...
1
<script type="text/javascript"> window.analytics||(window.analytics=[]),window.analytics.methods=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group","on","once","off"],window.analytics.factory=function(t){return function(){var a=Array.prototype.slice.c...
1
9,132
I didn't realize we were hardcoding this, thanks for moving it to an env value.
thoughtbot-upcase
rb
@@ -99,7 +99,7 @@ module.exports = function fileItem (props) { } </h4> <div class="UppyDashboardItem-status"> - ${file.data.size && html`<div class="UppyDashboardItem-statusSize">${prettyBytes(file.data.size)}</div>`} + ${isNaN(file.data.size) ? '' : html`<div class="UppyDashboardIt...
1
const html = require('yo-yo') const { getETA, getSpeed, prettyETA, getFileNameAndExtension, truncateString, copyToClipboard } = require('../../core/Utils') const prettyBytes = require('prettier-bytes') const FileItemProgress = require('./FileItemProgress') const getFileTypeI...
1
10,142
We are trying to support IE 10-11, so we'll need a polyfill for this one, I think.
transloadit-uppy
js
@@ -38,6 +38,9 @@ const { useSelect, useDispatch } = Data; function ResetButton( { children } ) { const postResetURL = useSelect( ( select ) => select( CORE_SITE ).getAdminURL( 'googlesitekit-splash', { notification: 'reset_success' } ) ); + const isNavigating = useSelect( ( select ) => select( CORE_LOCATION ).isN...
1
/** * ResetButton component. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * ...
1
35,547
It looks like there's a new `isNavigatingTo( url )` selector for this very purpose so let's use this here instead. This way we just need to use the one selector rather than two. Let's assign that to a similar-named variable here (e.g. `isNavigatingToPostResetURL`) rather than the prop it's used with.
google-site-kit-wp
js
@@ -29,8 +29,8 @@ namespace lbann { -void im2col(const Mat& im, - Mat& col, +void im2col(const AbsMat& im, + AbsMat& col, const int num_channels, const int im_num_dims, const int * im_dims,
1
//////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2014-2016, Lawrence Livermore National Security, LLC. // Produced at the Lawrence Livermore National Laboratory. // Written by the LBANN Research Team (B. Van Essen, et al.) listed in // the CONTRIBUTORS file. <lbann-dev@l...
1
12,526
I think im2col should only accommodate CPUMat.
LLNL-lbann
cpp
@@ -24,6 +24,8 @@ from google.cloud.forseti.notifier.notifiers import cscc_notifier from google.cloud.forseti.notifier.notifiers.inventory_summary import InventorySummary from google.cloud.forseti.services.inventory.storage import DataAccess from google.cloud.forseti.services.scanner import dao as scanner_dao +from ...
1
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
1
32,995
alpha sort the imports
forseti-security-forseti-security
py
@@ -1067,7 +1067,7 @@ fpga_result mmio_error(struct RASCommandLine *rasCmdLine) if ( rasCmdLine->function >0 ) function = rasCmdLine->bus; - snprintf(sysfs_path, sizeof(sysfs_path), + snprintf_s_iiii(sysfs_path, sizeof(sysfs_path), DEVICEID_PATH,0,bus,device,function); result = sysfs_read_u64(sysfs_path,...
1
// Copyright(c) 2017, Intel Corporation // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the ...
1
14,917
Can you explain why is this necessary? Is `snprintf()` with four integer arguments unsafe?
OPAE-opae-sdk
c
@@ -219,7 +219,19 @@ def internal_keyDownEvent(vkCode,scanCode,extended,injected): for k in range(256): keyStates[k]=ctypes.windll.user32.GetKeyState(k) charBuf=ctypes.create_unicode_buffer(5) + # First try getting the keyboard layout from the thread with the focus (input thread) hkl=ctypes.windll.us...
1
# -*- coding: UTF-8 -*- #keyboardHandler.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2006-2017 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V. """Keyboard support""" import ctypes ...
1
28,140
How likely would it be that the keyboard layout for the NVDA main thread differs from the keyboard layout of the currently focused app?
nvaccess-nvda
py
@@ -198,6 +198,10 @@ class Driver extends webdriver.WebDriver { * @return {!Driver} A new driver instance. */ static createSession(options, service = getDefaultService()) { + if (!service) { + service = getDefaultService(); + } + let client = service.start().then(url => new http.HttpClien...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
15,395
Would you mind removing the default parameter above? (I doubt I'll ever use defaults again since you still have to protect against callers explicitly passing `null` or `undefined`)
SeleniumHQ-selenium
rb
@@ -2186,7 +2186,7 @@ class WebElement { if (!this.driver_.fileDetector_) { return this.schedule_( new command.Command(command.Name.SEND_KEYS_TO_ELEMENT). - setParameter('text', keys). + setParameter('text', keys.then(keys => keys.join(''))). setParameter(...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
14,518
Also update line 2205 below
SeleniumHQ-selenium
java
@@ -39,6 +39,7 @@ func (p *Provisioner) ProvisionHostPath(opts pvController.VolumeOptions, volumeC name := opts.PVName stgType := volumeConfig.GetStorageType() saName := getOpenEBSServiceAccountName() + shared := volumeConfig.GetSharedMountValue() path, err := volumeConfig.GetPath() if err != nil {
1
/* Copyright 2019 The OpenEBS 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 agreed to in writing, sof...
1
18,028
n_: It is a good practice to name the variable to indicate what they contain. In this case since `shared` is supposed to have boolean, calling it: `isShared` can help in the readability of the code.
openebs-maya
go
@@ -85,7 +85,10 @@ export class ManualColumnFreeze extends BasePlugin { } /** - * Freezes the given column (add it to fixed columns). + * Freezes the specified column (i.e. adds it to fixed columns). + * + * `freezeColumn()` doesn't re-render the table, + * so you need to call the `render()` method af...
1
import { BasePlugin } from '../base'; import freezeColumnItem from './contextMenuItem/freezeColumn'; import unfreezeColumnItem from './contextMenuItem/unfreezeColumn'; import './manualColumnFreeze.css'; export const PLUGIN_KEY = 'manualColumnFreeze'; export const PLUGIN_PRIORITY = 110; const privatePool = new WeakMap...
1
19,759
I suppose it's a false-positive error. Maybe there is a way to configure the `eslint-*` package to accept `i.e. .... lower case` syntax
handsontable-handsontable
js
@@ -133,7 +133,7 @@ namespace OpenTelemetry.Trace private void RunGetRequestedDataOtherSampler(Activity activity) { ActivityContext parentContext; - if (string.IsNullOrEmpty(activity.ParentId)) + if (string.IsNullOrEmpty(activity.ParentId) || activity.ParentSpanId.To...
1
// <copyright file="ActivitySourceAdapter.cs" company="OpenTelemetry Authors"> // Copyright The OpenTelemetry 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...
1
17,151
this maynot be a perf issue, if ToHexString() is not actually allocating a string, but returns the caches string value. to be confirmed.
open-telemetry-opentelemetry-dotnet
.cs
@@ -114,11 +114,16 @@ func (w *watcher) run(ctx context.Context, provider imageprovider.Provider, inte updates = append(updates, u...) } if len(updates) == 0 { - w.logger.Info("no image to be updated") + w.logger.Info("no image to be updated", + zap.String("image-provider", provider.Name()), + ...
1
// Copyright 2020 The PipeCD 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 agree...
1
12,203
`zap.String("image-provider", provider.Name())` should be in a same line.
pipe-cd-pipe
go
@@ -1,8 +1,6 @@ /*exported DqElement */ function truncate(str, maxLength) { - 'use strict'; - maxLength = maxLength || 300; if (str.length > maxLength) {
1
/*exported DqElement */ function truncate(str, maxLength) { 'use strict'; maxLength = maxLength || 300; if (str.length > maxLength) { var index = str.indexOf('>'); str = str.substring(0, index + 1); } return str; } function getSource (element) { 'use strict'; var source = element.outerHTML; if (!sourc...
1
11,101
Why this deletion?
dequelabs-axe-core
js
@@ -419,7 +419,10 @@ class S3KeyTest(unittest.TestCase): remote_metadata = check._get_remote_metadata() # TODO: investigate whether encoding ' ' as '%20' makes sense - self.assertEqual(check.cache_control, 'public,%20max-age=500') + self.assertIn( + check.cache_control, + ...
1
# -*- coding: utf-8 -*- # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # All rights reserved. # # 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 # withou...
1
12,012
This change looks unrelated to the CL description?
boto-boto
py
@@ -18,7 +18,7 @@ class DedupTest : public QueryTestBase { void SetUp() override { QueryTestBase::SetUp(); } }; -#define DEDUP_RESUTL_CHECK(inputName, outputName, sentence, expected) \ +#define DEDUP_RESULT_CHECK(inputName, outputName, sentence, expected) \ do { ...
1
/* Copyright (c) 2020 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License. */ #include <gtest/gtest.h> #include "graph/context/QueryContext.h" #include "graph/executor/query/DedupExecutor.h" #include "graph/executor/query/ProjectExecutor.h" #include "graph/executor/test/QueryT...
1
31,964
I'm not certain that `res`+`utl` isn't a thing.
vesoft-inc-nebula
cpp
@@ -182,6 +182,7 @@ public class FetchActiveFlowDao { + " LEFT JOIN " + " executors et ON ex.executor_id = et.id" + " WHERE ex.status NOT IN (" + + Status.EXECUTION_STOPPED.getNumVal() + ", " + Status.SUCCEEDED.getNumVal() + ", " + Status.KILLE...
1
/* * Copyright 2017 LinkedIn 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.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
1
22,718
This method can cause bugs. Why don't you use list of finalize statuses and then use join by comma and that will give you correct value. Use Apache Commons Lang library List<Integer> list = Arrays.asList(1,2,3,4,5,6,7); String str = org.apache.commons.lang.StringUtils.join(list, ","); You can use it at multiple places ...
azkaban-azkaban
java
@@ -23,7 +23,10 @@ void wlr_input_device_init(struct wlr_input_device *dev, } void wlr_input_device_destroy(struct wlr_input_device *dev) { - if (!dev) return; + if (!dev) { + return; + } + if (dev->_device) { switch (dev->type) { case WLR_INPUT_DEVICE_KEYBOARD:
1
#define _XOPEN_SOURCE 500 #include <stdlib.h> #include <string.h> #include <wayland-server.h> #include <wlr/types/wlr_input_device.h> #include <wlr/interfaces/wlr_input_device.h> #include <wlr/interfaces/wlr_keyboard.h> #include <wlr/interfaces/wlr_pointer.h> #include <wlr/interfaces/wlr_touch.h> #include <wlr/interfac...
1
7,712
Merge with next condition
swaywm-wlroots
c
@@ -348,6 +348,7 @@ type appResourcesGetter interface { type taskDeployer interface { DeployTask(input *deploy.CreateTaskResourcesInput, opts ...cloudformation.StackOption) error + DeleteTask(task deploy.TaskStackInfo) error } type taskRunner interface {
1
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package cli import ( "encoding" "io" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/copilot-cli/internal/pkg/aws/cloudformation" "github.com/aws/copilot-cli/internal/pkg/aws/codepipeline" "gith...
1
16,144
Maybe add it when it is used.
aws-copilot-cli
go
@@ -36,3 +36,17 @@ TWO_ENABLED = {'scanners': [ {'name': 'cloudsql_acl', 'enabled': False}, {'name': 'iam_policy', 'enabled': True} ]} + +NONEXIST_ENABLED = {'scanners': [ + {'name': 'bigquery', 'enabled': False}, + {'name': 'bucket_acl', 'enabled': True}, + {'name': 'cloudsql_acl', 'enabled': False...
1
# Copyright 2017 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
1
32,431
More clear naming: NONEXISTENT_ENABLED
forseti-security-forseti-security
py
@@ -282,10 +282,10 @@ public class TypeUtil { switch (from.typeId()) { case INTEGER: - return to == Types.LongType.get(); + return to.equals(Types.LongType.get()); case FLOAT: - return to == Types.DoubleType.get(); + return to.equals(Types.DoubleType.get()); c...
1
/* * 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 ...
1
43,990
why is this change necessary?
apache-iceberg
java
@@ -178,9 +178,8 @@ public class SchemaTypeTable implements ImportTypeTable, SchemaTypeFormatter { @Override public String getFullNameFor(TypeModel type) { - // TODO(andrealin): Remove this hack when null response types are implemented. - if (type == null) { - return "nullFullName"; + if (type.isE...
1
/* Copyright 2017 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 in...
1
25,087
make a SchemaTypeNameConverter.getTypeNameForEmptyType() and call that here.
googleapis-gapic-generator
java
@@ -26,7 +26,10 @@ class TinyMCELanguage extends AbstractSmartyPlugin public function __construct(Request $request) { - $this->locale = $request->getSession()->getLang()->getLocale(); + if($request->getSession() != null) + $this->locale = $request->getSession()->getLang()->getLocale...
1
<?php /*************************************************************************************/ /* This file is part of the Thelia package. */ /* */ /* Copyright (c) OpenStudio ...
1
10,490
Use braces on your conditional structures please
thelia-thelia
php
@@ -16,6 +16,7 @@ DECLARE_string(u); DECLARE_string(p); +DEFINE_bool(enable_history, false, "Whether to force saving the command history"); namespace nebula { namespace graph {
1
/* Copyright (c) 2018 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #include "base/Base.h" #include "base/Status.h" #include <termios.h> #include <unistd.h> #include <readline/readline.h> ...
1
19,463
Great God, I have a question. This ".nebula_history" file is used to save history commands. Is there a file size limit? When the file is large, does it take a long time to start initialization (loadHistory)? How did you think about this? Thx.
vesoft-inc-nebula
cpp
@@ -1004,8 +1004,9 @@ static void parseRecord (tokenInfo *const token) */ if (!isType (token, TOKEN_OPEN_PAREN)) readToken (token); + if (!isType (token, TOKEN_OPEN_PAREN)) + return; - Assert (isType (token, TOKEN_OPEN_PAREN)); do { if (isType (token, TOKEN_COMMA) ||
1
/* * Copyright (c) 2002-2003, Darren Hiebert * * This source code is released for free distribution under the terms of the * GNU General Public License. * * This module contains functions for generating tags for PL/SQL language * files. */ /* * INCLUDE FILES */ #include "general.h" /* must always come first...
1
12,112
Isn't this the same check as two lines above?
universal-ctags-ctags
c
@@ -18,8 +18,11 @@ from mitmproxy import io from mitmproxy import log from mitmproxy import version from mitmproxy import optmanager +from mitmproxy import options import mitmproxy.tools.web.master # noqa +CONFIG_PATH = os.path.join(options.CA_DIR, 'config.yaml') + def flow_to_json(flow: mitmproxy.flow.Flow) -...
1
import hashlib import json import logging import os.path import re from io import BytesIO import mitmproxy.addons.view import mitmproxy.flow import tornado.escape import tornado.web import tornado.websocket from mitmproxy import contentviews from mitmproxy import exceptions from mitmproxy import flowfilter from mitmpr...
1
13,424
Don't redefine, just import the existing one in `cmdline.py`. :)
mitmproxy-mitmproxy
py
@@ -92,7 +92,8 @@ module Mongoid # # @since 2.0.0.rc.7 def process_attribute(name, value) - if store_as = aliased_fields.invert[name.to_s] + responds = respond_to?("#{name}=") + if !responds && store_as = aliased_fields.invert[name.to_s] name = store_as end ...
1
# encoding: utf-8 module Mongoid module Attributes # This module contains the behavior for processing attributes. module Processing # Process the provided attributes casting them to their proper values if a # field exists for them on the document. This will be limited to only the # attribu...
1
11,069
why not call `respond_to?("#{name}=")` from the `if` line?
mongodb-mongoid
rb
@@ -215,7 +215,8 @@ public final class BlazeCidrLauncher extends CidrLauncher { workingDir = workspaceRootDirectory; } - GeneralCommandLine commandLine = new GeneralCommandLine(runner.executableToDebug.getPath()); + GeneralCommandLine commandLine = new GeneralCommandLine(runner.executableToD...
1
/* * Copyright 2016 The Bazel Authors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
1
7,002
This was properly set above as `<target>.runfiles/<workspace_name>` (with a fallback to workspace root dir) but never used past this line.
bazelbuild-intellij
java
@@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MvvmCross.Core.Views; + +namespace MvvmCross.Uwp.Attributes +{ + public class MvxPagePresentationAttribute : MvxBasePresentationAttribute + { + } +}
1
1
13,341
Are all these namespaces required for this attribute?
MvvmCross-MvvmCross
.cs
@@ -53,9 +53,12 @@ module Beaker result.stdout << std_out result.stderr << std_err result.exit_code = status.exitstatus + @logger.info(result.stdout) + @logger.info(result.stderr) end rescue => e result.stderr << e.inspect + @logger.info...
1
require 'open3' module Beaker class LocalConnection attr_accessor :logger, :hostname, :ip def initialize options = {} @logger = options[:logger] @ssh_env_file = File.expand_path(options[:ssh_env_file]) @hostname = 'localhost' @ip = '127.0.0.1' @options = options end d...
1
16,544
Given this may be used and printed in other ways, isn't `debug` more appropriate?
voxpupuli-beaker
rb
@@ -540,3 +540,7 @@ func (s *blockDiskStore) remove(id kbfsblock.ID) error { } return err } + +func (s blockDiskStore) clear() error { + return ioutil.RemoveAll(s.dir) +}
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "path/filepath" "strings" "github.com/keybase/go-codec/codec" "github.com/keybase/kbfs/ioutil" "github.com/keybase/kbfs/kbfsblock" "gith...
1
16,071
Looks like this is unused? Did you mean to call it when clearing the block journal?
keybase-kbfs
go
@@ -117,8 +117,10 @@ public class ExecutorManager extends EventHandler implements public ExecutorManager(Props props, ExecutorLoader loader, Map<String, Alerter> alters) throws ExecutorManagerException { + alerters = alters; azkProps = props; this.executorLoader = loader; + this.setupExecu...
1
/* * Copyright 2014 LinkedIn 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.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
1
10,776
why named alters? how about this.alerts = alerts?
azkaban-azkaban
java
@@ -1549,7 +1549,7 @@ func (js *jetStream) processStreamLeaderChange(mset *stream, isLeader bool) { resp.Error = jsError(err) s.sendAPIErrResponse(client, acc, subject, reply, _EMPTY_, s.jsonResponse(&resp)) } else { - resp.StreamInfo = &StreamInfo{Created: mset.createdTime(), State: mset.state(), Config: mset...
1
// Copyright 2020-2021 The NATS 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 agreed to ...
1
12,645
not sure if this has to be here or not tbh
nats-io-nats-server
go
@@ -72,7 +72,12 @@ func newHarnessUsingAutodelete(ctx context.Context, t *testing.T) (drivertest.Ha } func (h *harness) CreateTopic(ctx context.Context, testName string) (dt driver.Topic, cleanup func(), err error) { + // Keep the topic entity name under 50 characters as per Azure limits. + // See https://docs.micr...
1
// Copyright 2018 The Go Cloud Development Kit 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
1
16,302
There's a better fix for this in #1741, which should replace this.
google-go-cloud
go
@@ -63,7 +63,7 @@ func (s *StreamMock) Close() error { func TestHandshake(t *testing.T) { logger := logging.New(ioutil.Discard, 0) info := Info{ - Address: "node1", + Address: []byte("node1"), NetworkID: 0, Light: false, }
1
// Copyright 2020 The Swarm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package handshake import ( "bytes" "errors" "fmt" "io/ioutil" "testing" "github.com/ethersphere/bee/pkg/logging" "github.com/ethersphere/bee/pkg/p2p/...
1
8,713
Use swarm.Address not []byte as type, and construct it from actual byteslice or use swarm.NewAddress if it is constructed from hex-encoded string.
ethersphere-bee
go
@@ -80,8 +80,9 @@ func TestFSRepoInit(t *testing.T) { dir, err := ioutil.TempDir("", "") assert.NoError(t, err) - - defer os.RemoveAll(dir) + defer func() { + require.NoError(t, os.RemoveAll(dir)) + }() t.Log("init FSRepo") assert.NoError(t, InitFSRepo(dir, config.NewDefaultConfig()))
1
package repo import ( "io/ioutil" "os" "path/filepath" "strings" "testing" ds "github.com/ipfs/go-datastore" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/filecoin-project/go-filecoin/config" tf "github.com/filecoin-project/go-filecoin/testhelpers/testflags" ) con...
1
18,756
It would be worth factoring this out to a function, but you don't have to do that here.
filecoin-project-venus
go
@@ -0,0 +1,15 @@ +package com.fsck.k9.message.html; + +/** + * General framework to handle uris when parsing. Allows different handling depending on the scheme identifier. + */ +public interface UriParser { + /** + * Parse and linkify scheme specific uri beginning from given position. The result will be written ...
1
1
15,440
There's no need for `final` in interfaces.
k9mail-k-9
java
@@ -101,6 +101,9 @@ namespace Datadog.Trace.OpenTracing case DatadogTags.ServiceName: Span.ServiceName = value; return this; + case DatadogTags.ServiceVersion: + Span.SetTag(Tags.Version, value); + return thi...
1
using System; using System.Collections.Generic; using System.Globalization; using OpenTracing; using OpenTracing.Tag; namespace Datadog.Trace.OpenTracing { internal class OpenTracingSpan : ISpan { internal OpenTracingSpan(Span span) { Span = span; Context = new OpenTraci...
1
16,889
Isn't this case handled as a custom tag in `Span.SetTag()` below? This switch is only for special tags that actually set `Span` properties.
DataDog-dd-trace-dotnet
.cs
@@ -681,7 +681,6 @@ class Quitter: @cmdutils.argument('session', completion=miscmodels.session) def quit(self, save=False, session=None): """Quit qutebrowser. - Args: save: When given, save the open windows even if auto_save.session is turned off.
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
1
21,628
This shouldn't be changed.
qutebrowser-qutebrowser
py
@@ -1,5 +1,5 @@ ## This file is part of Invenio. -## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. +## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU Gene...
1
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, ...
1
12,294
This one is important `2: I102 copyright year is outdated, expected 2014 but got 2012`
inveniosoftware-invenio
py
@@ -32,6 +32,8 @@ import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.concurrent.TimeoutException; +import java.util.function.BiConsumer; +import java.util.function.Consumer; import com.google.common.collect.Lists; import com.google.common.collect.Maps;
1
/* * 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 ...
1
40,876
Are these imports needed (BiConsumer and Consumer)? If they are unused imports, then precommit will fail.
apache-lucene-solr
java
@@ -0,0 +1,10 @@ +class TraceDestroyerJob < ApplicationJob + queue_as :default + + def perform(trace) + trace.destroy + rescue StandardError => ex + logger.info ex.to_s + ex.backtrace.each { |l| logger.info l } + end +end
1
1
11,753
Why are we catching and logging exceptions? By doing that we make it look like the job has succeeded and it will be removed from the queue - if we didn't do that then it would stay queued...
openstreetmap-openstreetmap-website
rb
@@ -90,14 +90,11 @@ class CartController extends FrontBaseController */ public function indexAction(Request $request) { - $cart = $this->cartFacade->getCartOfCurrentCustomer(); - - if ($cart->isEmpty()) { - $this->cartFacade->cleanAdditionalData(); - } + $cart = $t...
1
<?php namespace Shopsys\ShopBundle\Controller\Front; use Shopsys\FrameworkBundle\Component\Domain\Domain; use Shopsys\FrameworkBundle\Component\FlashMessage\ErrorExtractor; use Shopsys\FrameworkBundle\Model\Cart\AddProductResult; use Shopsys\FrameworkBundle\Model\Cart\CartFacade; use Shopsys\FrameworkBundle\Model\Cus...
1
13,978
If there are `@param` tags in docblock, there should be `@return` tag also. (applies for a whole file)
shopsys-shopsys
php
@@ -34,7 +34,8 @@ public enum BesuMetricCategory implements MetricCategory { PRUNER("pruner"), RPC("rpc"), SYNCHRONIZER("synchronizer"), - TRANSACTION_POOL("transaction_pool"); + TRANSACTION_POOL("transaction_pool"), + VALIDATORS("validators"); private static final Optional<String> BESU_PREFIX = Option...
1
/* * Copyright ConsenSys AG. * * 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...
1
19,732
Is the concept of validators exclusive to IBFT2? I wonder if this category should be more explicitly linked to IBFT2.
hyperledger-besu
java
@@ -14,9 +14,7 @@ */ package org.hyperledger.besu.tests.acceptance.dsl.account; -import org.hyperledger.besu.crypto.SECP256K1.KeyPair; -import org.hyperledger.besu.crypto.SECP256K1.PrivateKey; -import org.hyperledger.besu.crypto.SECP256K1.PublicKey; +import org.hyperledger.besu.crypto.*; import org.hyperledger.be...
1
/* * Copyright ConsenSys AG. * * 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...
1
24,585
Spotless is configured to reject star imports. Please replace with explicit imports.
hyperledger-besu
java
@@ -115,6 +115,8 @@ void SYCLInternal::initialize(const sycl::device& d) { m_maxThreadsPerSM = d.template get_info<sycl::info::device::max_work_group_size>(); + m_maxShmemPerBlock = + d.template get_info<sycl::info::device::local_mem_size>(); m_indirectKernelMem.reset(*m_queue); m_in...
1
/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 // Copyright (2020) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Govern...
1
27,390
Remind me why you are using CUDA vocabulary when naming these variables.
kokkos-kokkos
cpp
@@ -898,6 +898,16 @@ public final class DBReader { } final LongIntMap feedCounters = adapter.getFeedCounters(feedIds); + int feedFilter = UserPreferences.getFeedFilter(); + if (feedFilter == UserPreferences.FEED_FILTER_COUNTER_ZERO) { + for (int i = 0; i < feeds.size(); i++)...
1
package de.danoeh.antennapod.core.storage; import android.database.Cursor; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.collection.ArrayMap; import android.text.TextUtils; import android.util.Log; import java.util.ArrayList; import java.util.Collections; import java.util.Co...
1
16,688
Please turn the iteration order around (instead of `0...size` to `size...0`). The reason is that this sometimes skips indices when removing an item. You can therefore end up with feeds that have counter 0 and are still displayed.
AntennaPod-AntennaPod
java
@@ -620,7 +620,7 @@ def execute_reentrant_pipeline(pipeline, typed_environment, throw_on_error, reen def get_subset_pipeline(pipeline, solid_subset): check.inst_param(pipeline, 'pipeline', PipelineDefinition) check.opt_list_param(solid_subset, 'solid_subset', of_type=str) - return pipeline if solid_subset...
1
''' Naming conventions: For public functions: execute_* These represent functions which do purely in-memory compute. They will evaluate expectations the core transform, and exercise all logging and metrics tracking (outside of outputs), but they will not invoke *any* outputs (and their APIs don't allow the user to)....
1
12,192
this is a behavior change. solid_subset=[] represents an empty pipeline where as solid_subset=None is the full pipeline
dagster-io-dagster
py
@@ -318,8 +318,7 @@ Licensed under the MIT License. See License.txt in the project root for license { foreach (var unmatchedSetting in CustomSettings.Keys) { - Logger.LogError(new ArgumentException(unmatchedSetting), - Resources.Pa...
1
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; using Microsoft.Rest.Generator.Logging; using Micros...
1
21,487
this is a breaking change, any specific reason you want to do this?
Azure-autorest
java
@@ -91,6 +91,8 @@ type nodeChainReader interface { GetTipSetStateRoot(tsKey types.SortedCidSet) (cid.Cid, error) HeadEvents() *ps.PubSub Load(context.Context) error + PutTipSetAndState(context.Context, *chain.TipSetAndState) error + SetHead(context.Context, types.TipSet) error Stop() }
1
package node import ( "context" "encoding/json" "fmt" "os" "sync" "time" ps "github.com/cskr/pubsub" "github.com/ipfs/go-bitswap" bsnet "github.com/ipfs/go-bitswap/network" bserv "github.com/ipfs/go-blockservice" "github.com/ipfs/go-cid" "github.com/ipfs/go-datastore" "github.com/ipfs/go-hamt-ipld" bsto...
1
19,354
Blocking: we still want read write separation. Node functions should absolutely not write to the chain store and the interface should reflect that. Only the syncer should have this capability in production code. It should be no problem to keep casting chainForTest to a read-write interface, or doing other function deco...
filecoin-project-venus
go
@@ -22,7 +22,8 @@ const ( minimalPrefetchWorkerQueueSize int = 1 testBlockRetrievalWorkerQueueSize int = 5 testPrefetchWorkerQueueSize int = 1 - defaultOnDemandRequestPriority int = 100 + defaultOnDemandRequestPriority int = 1<<30 - 1 + lowestTriggerPrefetchPriority int = 1 ...
1
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "container/heap" "io" "reflect" "sync" "github.com/keybase/client/go/logger" "github.com/pkg/errors" "golang.org/x/net/context" ) cons...
1
17,371
The PR description says the lowest on-demand request priority is `2^30`. Why the `-1` here?
keybase-kbfs
go
@@ -609,6 +609,14 @@ bool Game::removeCreature(Creature* creature, bool isLogout/* = true*/) return true; } +void Game::executeDeath(uint32_t creatureId) +{ + Creature* creature = getCreatureByID(creatureId); + if (creature && !creature->isRemoved() && creature->getHealth() < 1) { + creature->onDeath(); + } +} + ...
1
/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2019 Mark Samman <mark.samman@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; eithe...
1
17,232
checking health again? I think it is not necessary.
otland-forgottenserver
cpp
@@ -442,7 +442,18 @@ configRetry: log.Infof("Starting the Typha connection") err := typhaConnection.Start(context.Background()) if err != nil { - log.WithError(err).Fatal("Failed to connect to Typha") + log.WithError(err).Error("Failed to connect to Typha. Retrying...") + startTime := time.Now() + for ...
1
// Copyright (c) 2017-2019 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ...
1
16,841
Need an `if err == nil {break}` above this line so that we don't log/sleep if the retry succeeds.
projectcalico-felix
c
@@ -0,0 +1,18 @@ +'use strict'; + +const assert = require('assert'); + +class ProvidedPromise { + set Promise(lib) { + assert.ok(typeof lib === 'function', `mongodb.Promise must be a function, got ${lib}`); + this._promise = lib; + } + get Promise() { + return this._promise; + } +} + +const provided = new ...
1
1
17,359
to reiterate my point above, this class is not the actual provided Promise, but rather something a user can provide a Promise to/with. I think a name like `PromiseProvider` is more appropriate.
mongodb-node-mongodb-native
js
@@ -738,6 +738,12 @@ func addDep(s *scope, args []pyObject) pyObject { dep := core.ParseBuildLabelContext(string(args[1].(pyString)), s.pkg) exported := args[2].IsTruthy() target.AddMaybeExportedDependency(dep, exported, false, false) + // Queue this dependency if it'll be needed. + if target.State() > core.Inact...
1
package asp import ( "encoding/json" "fmt" "io" "path" "reflect" "sort" "strconv" "strings" "github.com/Masterminds/semver/v3" "github.com/manifoldco/promptui" "github.com/thought-machine/please/src/cli" "github.com/thought-machine/please/src/core" "github.com/thought-machine/please/src/fs" ) // A few ...
1
9,929
I guess we can only call this from a post-build function, but we might need to check that this target is to be built? I guess target A depends on B which has a post build. We `plz build :B` which adds C as a dep of A. Won't we queue C to be built even though it only needs to build if A needs to be built? That's kinda w...
thought-machine-please
go
@@ -123,7 +123,7 @@ def sndrcv(pks, pkt, timeout = None, inter = 0, verbose=None, chainCC=0, retry=0 if remaintime <= 0: break r = None - if arch.FREEBSD or arch.DARWIN: + ...
1
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license """ Functions to send and receive packets. """ import errno import cPickle,os,sys,time,subprocess import itertools from ...
1
8,509
You should use `isinstance()` instead of comparing the class name to a string.
secdev-scapy
py
@@ -15,6 +15,11 @@ axe.utils.isHidden = function isHidden(el, recursed) { return false; } + // do not exclude `video` or `audio` el's + if ([`VIDEO`, `AUDIO`].includes(el.nodeName.toUpperCase())) { + return false; + } + // 11 === Node.DOCUMENT_FRAGMENT_NODE if (el.nodeType === 11) { el = el.host; // grab...
1
/** * Determine whether an element is visible * @method isHidden * @memberof axe.utils * @param {HTMLElement} el The HTMLElement * @param {Boolean} recursed * @return {Boolean} The element's visibilty status */ axe.utils.isHidden = function isHidden(el, recursed) { 'use strict'; const node = axe.utils.getNodeF...
1
15,190
Why should audio and video elements always return `false` for `isHidden`?
dequelabs-axe-core
js
@@ -27,7 +27,7 @@ namespace Playground.Core Mvx.IoCProvider.RegisterSingleton<IMvxTextProvider>(new TextProviderBuilder().TextProvider); - RegisterAppStart<RootViewModel>(); + // RegisterAppStart<RootViewModel>(); } /// <summary>
1
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MS-PL license. // See the LICENSE file in the project root for more information. using System.Threading.Tasks; using MvvmCross; using MvvmCross.IoC; using MvvmCross.Localization; using MvvmCross...
1
15,623
This obviously won't work for all the other platforms.
MvvmCross-MvvmCross
.cs
@@ -15,7 +15,7 @@ public class ManipulationTest extends BasicJBehaveTest { @Override public InjectableStepsFactory stepsFactory() { - Map<String, Object> state = new HashMap<String, Object>(); + Map<String, Object> state = new HashMap<>(); return new InstanceStepsFactory(configurati...
1
package com.github.javaparser.bdd; import com.github.javaparser.bdd.steps.ManipulationSteps; import com.github.javaparser.bdd.steps.SharedSteps; import de.codecentric.jbehave.junit.monitoring.JUnitReportingRunner; import org.jbehave.core.steps.InjectableStepsFactory; import org.jbehave.core.steps.InstanceStepsFactory;...
1
8,876
Isn't he diamond operator Java7+?
javaparser-javaparser
java
@@ -159,6 +159,17 @@ public final class Require { return number; } + public static double positive(String argName, double number, String message) { + if (number <= 0) { + if (message == null) { + throw new IllegalArgumentException(argName + " must be greater than 0"); + } else { + ...
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
18,469
Prefer adding a second `positive(String, double)` that delegates down to this three-param version. Using `null` in code is generally Not A Great Idea, and it looks ugly.
SeleniumHQ-selenium
rb
@@ -474,7 +474,7 @@ func (rule removeCount) Name() string { func (rule removeCount) Pattern() plan.Pattern { return plan.Pat(universe.CountKind, plan.Any()) } -func (rule removeCount) Rewrite(ctx context.Context, node plan.Node) (plan.Node, bool, error) { +func (rule removeCount) Rewrite(ctx context.Context, node p...
1
package lang_test import ( "bytes" "context" "encoding/json" "math" "strings" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/influxdata/flux" "github.com/influxdata/flux/ast" _ "github.com/influxdata/flux/builtin" fcsv "github.com/influxdata/flux/csv" "github.com/influxdata/flux/dependencies...
1
15,288
This pattern, where we add a new parameter without using it, often indicates to me that we've got a leaky interface or abstraction. I see this pattern _a lot_ in this patch, so wondering you have thoughts about it.
influxdata-flux
go
@@ -164,10 +164,13 @@ func WriteWordpressConfig(wordpressConfig *WordpressConfig, filePath string) err return err } - // Ensure target directory is writable. + // Ensure target directory exists and is writeable dir := filepath.Dir(filePath) - err = os.Chmod(dir, 0755) - if err != nil { + if err = os.Chmod(dir,...
1
package ddevapp import ( "os" "path/filepath" "text/template" "fmt" "github.com/Masterminds/sprig" "github.com/drud/ddev/pkg/archive" "github.com/drud/ddev/pkg/fileutil" "github.com/drud/ddev/pkg/output" "github.com/drud/ddev/pkg/util" ) // WordpressConfig encapsulates all the configurations for a WordPres...
1
13,064
This seems like an improved pattern :)
drud-ddev
go
@@ -127,16 +127,16 @@ class UserController < ApplicationController # valid OpenID and one the user has control over before saving # it as a password equivalent for the user. session[:new_user_settings] = params - openid_verify(params[:user][:openid_url], @user) + federated_verif...
1
class UserController < ApplicationController layout :choose_layout skip_before_filter :verify_authenticity_token, :only => [:api_read, :api_details, :api_gpx_files] before_filter :disable_terms_redirect, :only => [:terms, :save, :logout, :api_details] before_filter :authorize, :only => [:api_details, :api_gpx_...
1
8,054
`open_id_authentication` is no longer the name of the function, and it's not OpenID specific
openstreetmap-openstreetmap-website
rb
@@ -243,10 +243,10 @@ void rai_qt::accounts::refresh_wallet_balance () balance = balance + (this->wallet.node.ledger.account_balance (transaction, key)); pending = pending + (this->wallet.node.ledger.account_pending (transaction, key)); } - auto final_text (std::string ("Wallet balance (XRB): ") + wallet.format...
1
#include <rai/qt/qt.hpp> #include <boost/property_tree/json_parser.hpp> #include <sstream> namespace { void show_line_error (QLineEdit & line) { line.setStyleSheet ("QLineEdit { color: red }"); } void show_line_ok (QLineEdit & line) { line.setStyleSheet ("QLineEdit { color: black }"); } void show_line_success (QLi...
1
13,126
This didn't require corresponding changes to the test case(s)?
nanocurrency-nano-node
cpp
@@ -509,6 +509,7 @@ type TaskConfig struct { Count Count `yaml:"count"` ExecuteCommand ExecuteCommand `yaml:"exec"` Variables map[string]string `yaml:"variables"` + EnvFile string `yaml:"env_file"` Secrets map[string]string `yaml:"secrets"` ...
1
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // Package manifest provides functionality to create Manifest files. package manifest import ( "errors" "fmt" "path/filepath" "strconv" "strings" "time" "github.com/aws/copilot-cli/internal/pkg/docker/...
1
20,257
A question! I think `string` totally works, but what do you think of `*string` for consistency?
aws-copilot-cli
go
@@ -25,6 +25,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +const ( + AnnotationClusterInfrastructureReady = "aws.cluster.sigs.k8s.io/infrastructure-ready" + AnnotationControlPlaneReady = "aws.cluster.sigs.k8s.io/control-plane-ready" + ValueReady = "true" +) + /...
1
/* Copyright 2018 The Kubernetes 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 agreed to in writing, ...
1
10,005
Should this be: `aws.infrastructure.cluster.sigs.k8s.io` instead?
kubernetes-sigs-cluster-api-provider-aws
go
@@ -142,7 +142,7 @@ void PairLubricate::compute(int eflag, int vflag) Ef[2][2] = h_rate[2]/domain->zprd; Ef[0][1] = Ef[1][0] = 0.5 * h_rate[5]/domain->yprd; Ef[0][2] = Ef[2][0] = 0.5 * h_rate[4]/domain->zprd; - Ef[1][2] = Ef[2][1] = 0.5 * h_rate[3]/domain->zprd; + Ef[1][2] = Ef[2][1] = 0.5 * h_rate...
1
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov Copyright (2003) Sandia Corporation. Under the terms of Contract DE-AC04...
1
27,612
Not clear on why this change is correct.
lammps-lammps
cpp
@@ -193,5 +193,10 @@ public final class ByteBuffersIndexInput extends IndexInput implements RandomAcc if (in == null) { throw new AlreadyClosedException("Already closed."); } - } + } + + @Override + public boolean isMMapped() { + return true; + } }
1
/* * 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 ...
1
28,783
Hi Simon. Whether this should return true depends on what byte buffers are used? The same applies to ByteBufferIndexInput, actually... I don't think you can generally tell whether the ByteBuffers the input operates on come from a mmap call or from somewhere else (even direct buffers don't have to be a result of mmap).
apache-lucene-solr
java
@@ -54,6 +54,7 @@ storiesOf( 'PageSpeed Insights Module/Settings', module ) decorators: [ withRegistry, ], + padding: 0, } ) .add( 'View, open with all settings', ( args, { registry } ) => { return <Settings isOpen={ true } registry={ registry } />;
1
/** * PageSpeed Insights Settings stories. * * Site Kit by Google, Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/L...
1
38,279
All stories in this file also need to have the default padding.
google-site-kit-wp
js
@@ -804,8 +804,10 @@ static void subsurface_handle_place_above(struct wl_client *client, return; } + assert(sibling->parent == subsurface->parent); + wl_list_remove(&subsurface->parent_pending_link); - wl_list_insert(&sibling->parent_pending_link, + wl_list_insert(sibling->parent_pending_link.prev, &subsurf...
1
#include <assert.h> #include <stdlib.h> #include <wayland-server-core.h> #include <wlr/render/interface.h> #include <wlr/types/wlr_buffer.h> #include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_matrix.h> #include <wlr/types/wlr_region.h> #include <wlr/types/wlr_surface.h> #include <wlr/types/wlr_output.h> #inc...
1
16,836
I don't think these asserts are necessary, because `subsurface_find_sibling` already searches in the parent. Or am I missing something?
swaywm-wlroots
c
@@ -0,0 +1,15 @@ +class Episode < ActiveRecord::Base + attr_accessible :title, :duration, :file, :description, :published_on, :notes, + :old_url, :file_size + + validates_presence_of :title, :duration, :file, :file_size, :description, + :published_on + + def self.published + where("published_on <= ?", Date....
1
1
6,629
Should this be `number` instead of `id`?
thoughtbot-upcase
rb
@@ -1569,12 +1569,11 @@ NATable *BindWA::getNATable(CorrName& corrName, ((QualifiedName&)(table->getTableName())).setIsVolatile(TRUE); } - // For now, do not allow access through the Trafodion external name created for - // the HIVE object unless the inDDL flag is set. inDDL is set for drop - /...
1
/********************************************************************** // @@@ START COPYRIGHT @@@ // // 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. ...
1
7,446
I have forgotten why we thought this restriction is necessary. A user registers a Hive/HBase table with us but is not able to use the table with the registered name in DML. Will UPDATE STATs will be on the original name too (and update stats code will find out registered name and use it for Table_uid?). This was the re...
apache-trafodion
cpp
@@ -40,6 +40,18 @@ struct ase_cfg_t *cfg; +int app2sim_alloc_rx; // app2sim mesaage queue in RX mode +int sim2app_alloc_tx; // sim2app mesaage queue in TX mode +int app2sim_mmioreq_rx; // MMIO Request path +int sim2app_mmiorsp_tx; // MMIO Response path +int app2sim_umsg_rx; // UMSG message queue in RX mode...
1
// Copyright(c) 2014-2017, Intel Corporation // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and...
1
14,635
Should most of these non-globals be static?
OPAE-opae-sdk
c
@@ -14,6 +14,14 @@ class TestFakerName < Test::Unit::TestCase assert @tester.name_with_middle.match(/(\w+\.? ?){3,4}/) end + def test_first_name + assert @tester.first_name.match(/(\w+\.? ?){3,4}/) + end + + def test_last_name + assert @tester.last_name.match(/(\w+\.? ?){3,4}/) + end + def test_p...
1
require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb') class TestFakerName < Test::Unit::TestCase def setup @tester = Faker::Name end def test_name assert @tester.name.match(/(\w+\.? ?){2,3}/) end def test_name_with_middle assert @tester.name_with_middle.match(/(\w+\.? ?){3,4}/) ...
1
8,395
Please do not approve PRs without tests!!!!
faker-ruby-faker
rb
@@ -48,7 +48,7 @@ class WebEngineView(QWebEngineView): else: profile = webenginesettings.default_profile page = WebEnginePage(theme_color=theme_color, profile=profile, - parent=self) + parent=self, win_id=win_id) self.setPag...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
1
21,368
Now that you handle this in `webenginetab.py` you can undo all the changes in this file.
qutebrowser-qutebrowser
py
@@ -30,7 +30,11 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext public class JavaFXApplication extends Application { public static void main(String[] args) { - Application.launch(JavaFXApplication.class); + try { + Application.launch(JavaFXApplication...
1
/* * Copyright (C) 2015-2017 PÂRIS Quentin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is...
1
11,909
I think we should log the exception to a log file instead of printing it. The current behavior (not catching the exception) should lead to an automatic print of the exception to the terminal/console.
PhoenicisOrg-phoenicis
java
@@ -57,7 +57,7 @@ func (r *Helper) Apply(obj []byte) (ApplyResult, error) { if err != nil { r.logger.WithError(err). WithField("stdout", ioStreams.Out.(*bytes.Buffer).String()). - WithField("stderr", ioStreams.ErrOut.(*bytes.Buffer).String()).Error("running the apply command failed") + WithField("stderr", ...
1
package resource import ( "bytes" "io" "k8s.io/apimachinery/pkg/runtime" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/cli-runtime/pkg/printers" kcmdapply "k8s.io/kubernetes/pkg/kubectl/cmd/apply" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" ) // ApplyResult indicates what type of change was perform...
1
11,339
These changes to the resource helpers have some more far-reaching implications as they also affect calls made in hive-operator, I believe. It's probably OK still, though. Ideally, the resource helper would not be the one doing the logging, since it cannot know the severity, but that is well beyond something that we sho...
openshift-hive
go
@@ -167,7 +167,7 @@ class ExportCategoryTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Export', '\\Thelia\\Model\\Export', RelationMap::ONE_TO_MANY, array('id' => 'export_category_id', ), 'CASCADE', 'RESTRICT', 'Exports'); + $this->addRelation('Export...
1
<?php namespace Thelia\Model\Map; use Propel\Runtime\Propel; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\InstancePoolTrait; use Propel\Runtime\Connection\ConnectionInterface; use Propel\Runtime\DataFetcher\DataFetcherInterface; use Propel\Runtime\Exception\PropelException; use Propel\Runti...
1
10,314
do you really want to change the behavior on foreign key ?
thelia-thelia
php
@@ -183,7 +183,8 @@ void event_batch_destroy (struct event_batch *batch) if (batch->f) (void)flux_future_wait_for (batch->f, -1); if (batch->state_trans) { - event_publish_state (batch->event, batch->state_trans); + if (json_array_size (batch->state_trans) > 0) + ...
1
/************************************************************\ * Copyright 2019 Lawrence Livermore National Security, LLC * (c.f. AUTHORS, NOTICE.LLNS, COPYING) * * This file is part of the Flux resource manager framework. * For details, see https://github.com/flux-framework. * * SPDX-License-Identifier: LGPL-3....
1
28,264
Looks like my bad. Thanks for fixing!
flux-framework-flux-core
c
@@ -82,6 +82,7 @@ class Command: no_cmd_split: If true, ';;' to split sub-commands is ignored. backend: Which backend the command works with (or None if it works with both) + no_replace_variables: Whether or not to replace variables like {url} _qute_args: The saved da...
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
1
15,585
I think "Don't replace variables ..." would be cleaner.
qutebrowser-qutebrowser
py
@@ -82,8 +82,7 @@ class MPLPlot(DimensionedPlot): sublabel_size = param.Number(default=18, doc=""" Size of optional subfigure label.""") - projection = param.ObjectSelector(default=None, - objects=['3d', 'polar', None], doc=""" + projection = param.Parameter(d...
1
from __future__ import division import numpy as np import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D # noqa (For 3D plots) from matplotlib import pyplot as plt from matplotlib import gridspec, animation import param from ...core import (OrderedDict, HoloMap, AdjointLayout, NdLayout, ...
1
14,484
Do you validate the possible strings? I've not read the code below but we should make sure if a string is supplied it is validate...
holoviz-holoviews
py
@@ -40,13 +40,11 @@ func AddDiskImportSteps(w *daisy.Workflow, dataDiskInfos []ovfutils.DiskInfo) { for i, dataDiskInfo := range dataDiskInfos { dataDiskIndex := i + 1 dataDiskFilePath := dataDiskInfo.FilePath - diskNames = append( - diskNames, - fmt.Sprintf("%v-data-disk-%v", w.Vars["instance_name"].Value...
1
// Copyright 2019 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appl...
1
9,867
I'd recommend using generateDataDiskName here as well -- might as well benefit from the safety that it gives to protect yourself from future changes to w.ID().
GoogleCloudPlatform-compute-image-tools
go
@@ -29,6 +29,11 @@ import java.util.Map; * @param <F> the concrete Java class of a ContentFile instance. */ public interface ContentFile<F> { + /** + * Returns the ordinal position of the file in a manifest, or null if it was not read from a manifest. + */ + Long pos(); + /** * Returns id of the parti...
1
/* * 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 ...
1
27,366
qq: do we want to include anything in the name to indicate that it is a position in the manifest?
apache-iceberg
java
@@ -969,8 +969,11 @@ public class VRBrowserActivity extends PlatformActivity implements WidgetManager GleanMetricsService.stopImmersive(); Handler handler = new Handler(Looper.getMainLooper()); handler.postDelayed(() -> { - mWindows.resumeCompositor(); - Log.d(LOGTAG, "C...
1
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package org.mozilla.vrbrowser; imp...
1
9,156
These logs should probably use the `LOGTAG`
MozillaReality-FirefoxReality
java
@@ -28,10 +28,10 @@ import ( "github.com/mysteriumnetwork/node/core/connection" "github.com/mysteriumnetwork/node/services/wireguard" "github.com/mysteriumnetwork/node/services/wireguard/key" - "github.com/mysteriumnetwork/wireguard-go/device" - "github.com/mysteriumnetwork/wireguard-go/tun" "github.com/pkg/err...
1
/* * Copyright (C) 2018 The "MysteriumNetwork/node" Authors. * * 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. * ...
1
15,162
From this, it was clear, that we are using our version of wireguard-go. And now it looks like we are using original packages which is confusing.
mysteriumnetwork-node
go
@@ -43,7 +43,7 @@ namespace Nethermind.JsonRpc public static ResultWrapper<T> Fail(Exception e) { - return new() { Result = Result.Fail(e.ToString()), ErrorCode = ErrorCodes.InternalError}; + return new() { Result = Result.Fail(e.Message), ErrorCode = ErrorCodes.Interna...
1
// Copyright (c) 2021 Demerzel Solutions Limited // This file is part of the Nethermind library. // // The Nethermind library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of...
1
26,192
Any particular reason for this? This potentially will make harder to investigate users issues
NethermindEth-nethermind
.cs
@@ -999,7 +999,8 @@ Blockly.BlockSvg.prototype.updatePreviews = function(closestConnection, // grayed-out blocks instead of highlighting the connection; for compatibility // with Web Blockly the name "highlightedConnection" will still be used. if (Blockly.highlightedConnection_ && - Blockly.highlightedCon...
1
/** * @license * Visual Blocks Editor * * Copyright 2012 Google Inc. * https://developers.google.com/blockly/ * * 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.apach...
1
7,697
Do you also need to check if Blockly.localConnection_ is non-null?
LLK-scratch-blocks
js
@@ -1,5 +1,6 @@ module RSpec module Core + # Internal container for global non-configuration data class World include RSpec::Core::Hooks
1
module RSpec module Core class World include RSpec::Core::Hooks attr_reader :example_groups, :filtered_examples attr_accessor :wants_to_quit def initialize(configuration=RSpec.configuration) @configuration = configuration @example_groups = [] @filtered_examples =...
1
11,784
Not really a container, and it's not just about non-config data, not sure of a better description, @myronmarston ?
rspec-rspec-core
rb
@@ -3,6 +3,8 @@ const { basename } = require('./path-utils'); const shim = require('./shim').default; const JoplinError = require('./JoplinError').default; const { Buffer } = require('buffer'); +const { Readable } = require('stream').Readable; +const { GetObjectCommand, ListObjectsV2Command, HeadObjectCommand, PutOb...
1
const { basicDelta } = require('./file-api'); const { basename } = require('./path-utils'); const shim = require('./shim').default; const JoplinError = require('./JoplinError').default; const { Buffer } = require('buffer'); const S3_MAX_DELETES = 1000; class FileApiDriverAmazonS3 { constructor(api, s3_bucket) { th...
1
17,434
The desktop app will load this fine. on iOS I get `TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[8], "stream").Readable.Readable')` if I change it to `const Readable = require('stream').Readable;` or `const { Readable } = require('stream');` I get undefined errors from the stream on iOS:...
laurent22-joplin
js
@@ -93,7 +93,9 @@ func (m *MockStorer) Put(ctx context.Context, mode storage.ModePut, chs ...swarm po := swarm.Proximity(ch.Address().Bytes(), m.baseAddress) m.bins[po]++ } - m.store[ch.Address().String()] = ch.Data() + b := make([]byte, len(ch.Data())) + copy(b, ch.Data()) + m.store[ch.Address().String(...
1
// Copyright 2020 The Swarm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package mock import ( "context" "errors" "sync" "github.com/ethersphere/bee/pkg/storage" "github.com/ethersphere/bee/pkg/swarm" ) var _ storage.Store...
1
13,966
this is needed since the chunk feeder shares memory across calls to the pipeline. this is in order to avoid multiple allocations. this change mimics the behavior of shed and localstore, and copies the data from the call into the in-memory store
ethersphere-bee
go
@@ -42,6 +42,10 @@ import ( "go.uber.org/yarpc/yarpcerrors" ) +func init() { + opentracing.SetGlobalTracer(nil) +} + func TestHandlerSuccess(t *testing.T) { mockCtrl := gomock.NewController(t) defer mockCtrl.Finish()
1
// Copyright (c) 2017 Uber Technologies, 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, modify, merge...
1
15,400
wut. We can do this at the beginning of tests if we want right? Why are we depending on init?
yarpc-yarpc-go
go
@@ -1403,9 +1403,12 @@ func (c *client) processConnect(arg []byte) error { c.mu.Lock() acc := c.acc c.mu.Unlock() + srv.mu.Lock() if acc != nil && acc != srv.gacc { + srv.mu.Unlock() return ErrTooManyAccountConnections } + srv.mu.Unlock() } c.authViolation() return E...
1
// Copyright 2012-2020 The NATS 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 agreed to ...
1
10,130
Same trick here IMO.
nats-io-nats-server
go
@@ -108,10 +108,11 @@ module Selenium def initialize(source, duration, x, y, element: nil, origin: nil) super(source) + @duration = duration * 1000 @x_offset = x @y_offset = y - @origin = element || origin + @origin = origin || POINTER en...
1
# frozen_string_literal: true # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0...
1
17,344
Should be `@origin = element || origin || POINTER`
SeleniumHQ-selenium
rb
@@ -50,11 +50,14 @@ func NewUpgradeCStorSPCJob() *cobra.Command { Long: cstorSPCUpgradeCmdHelpText, Example: `upgrade cstor-spc --spc-name <spc-name>`, Run: func(cmd *cobra.Command, args []string) { + util.CheckErr(options.RunCStorSPCUpgradeChecks(cmd, args), util.Fatal) options.resourceKind = "storag...
1
/* Copyright 2019 The OpenEBS 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 agreed to in writing, sof...
1
18,386
this example needs a fix?
openebs-maya
go
@@ -248,9 +248,9 @@ static void close(struct roots_view *view) { struct wlr_xdg_surface *surface = view->xdg_surface; struct wlr_xdg_popup *popup = NULL; wl_list_for_each(popup, &surface->popups, link) { - wlr_xdg_surface_send_close(popup->base); + wlr_xdg_popup_destroy(popup->base); } - wlr_xdg_surface_send_...
1
#include <assert.h> #include <stdbool.h> #include <stdlib.h> #include <wayland-server.h> #include <wlr/types/wlr_box.h> #include <wlr/types/wlr_surface.h> #include <wlr/types/wlr_xdg_shell.h> #include <wlr/util/log.h> #include "rootston/cursor.h" #include "rootston/desktop.h" #include "rootston/input.h" #include "roots...
1
13,188
Is it safe to assume this surface is a toplevel?
swaywm-wlroots
c
@@ -225,6 +225,16 @@ projCtx pj_ctx_alloc() return new (std::nothrow) projCtx_t(*pj_get_default_ctx()); } +/************************************************************************/ +/* pj_ctx_clone() */ +/****************************************************...
1
/****************************************************************************** * Project: PROJ.4 * Purpose: Implementation of the projCtx thread context object. * Author: Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 2010...
1
11,987
we don't need that function
OSGeo-PROJ
cpp
@@ -72,6 +72,13 @@ public enum Platform { } }, + WIN10("windows 10", "win10") { + @Override + public Platform family() { + return WINDOWS; + } + }, + MAC("mac", "darwin", "os x") {}, SNOW_LEOPARD("snow leopard", "os x 10.6") {
1
// Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you m...
1
12,210
we'll also have to think about adding "Windows Server 2014" or whatever they come up with later.
SeleniumHQ-selenium
rb
@@ -35,6 +35,9 @@ public interface ExecutorLoader { Map<Integer, Pair<ExecutionReference, ExecutableFlow>> fetchActiveFlows() throws ExecutorManagerException; + Pair<ExecutionReference, ExecutableFlow> fetchActiveFlowByExecId(int execId) + throws ExecutorManagerException; + List<ExecutableFlow> fet...
1
/* * Copyright 2012 LinkedIn 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.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
1
13,023
curious do we have an API to fetch an inactive flow?
azkaban-azkaban
java